Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Flash Development
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 10-06-2009, 02:31 AM
  #1
miccheckone
Novice (Level 1)
 
Join Date: Jul 2008
Location: Los Angeles, California, USA
Posts: 8
iTrader: (0)
miccheckone is an unknown quantity at this point
ActionScript 3.0 code help - gotoAndPlay a different movie clip symbol

Hi there. I could use some help with a Flash CS4/ActionScript 3.0 question. Both are very new to me, so I'm struggling.

So, I'm building a website. I've got my main timeline (Scene 1) separated into layers containing a pre-loader, an animated splash page, and then the content of the website:



The pre-loader works fine; I basically just copied & pasted the ActionScript 3.0 code from an online tutorial. The loading animation plays, then goes to the next frame, which contains an instance of a movie clip symbol that contains the splash page animation timeline (instance name: "splashPageAnimation"). Here's where I get confused. When the timeline inside "splashPageAnimation" has played all the way to the end, how do I tell it to then jump back out to the main timeline and proceed to the next frame, which contains an instance of a movie clip symbol that contains the real content of the website (instance name: "entireSite")?

Can anyone offer up some code to make this happen? And would I put the Action on the last frame of the nested "splashPageAnimation" timeline itself (frame 213 in the image below), or would I put it on the frame that contains "splashPageAnimation" on the main/Scene 1 timeline (frame 2 in previous image)?



Any helpful advice would be greatly appreciated. Thanks!
miccheckone is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-06-2009, 08:24 AM
  #2
RysChwith
Super Guru
 
Join Date: Jun 2004
Posts: 4,117
iTrader: (0)
RysChwith will become famous soon enough
Tough to say. What's the code you have so far for the preloader?

Rys
RysChwith is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-06-2009, 12:44 PM
  #3
miccheckone
Novice (Level 1)
 
Join Date: Jul 2008
Location: Los Angeles, California, USA
Posts: 8
iTrader: (0)
miccheckone is an unknown quantity at this point
Here's the ActionScript I'm using for the preloader:

Code:
stop();

addEventListener(Event.ENTER_FRAME, loaderF);

function loaderF(e:Event):void{
	var toLoad:Number = loaderInfo.bytesTotal;
	var loaded:Number = loaderInfo.bytesLoaded;
	var total:Number = loaded/toLoad;
	if(loaded == toLoad){
		removeEventListener(Event.ENTER_FRAME, loaderF);
		gotoAndStop(2);
	} else {
		preloader_mc.preloaderFill_mc.scaleX = total;
		preloader_mc.percent_txt.text = Math.floor(total*100) + "%";
		preloader_mc.ofBytes_txt.text = loaded + " bytes";
		preloader_mc.totalBytes_txt.text = toLoad + " bytes";
	}
}

Last edited by miccheckone : 10-06-2009 at 02:22 PM. Reason: updated code
miccheckone is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-06-2009, 12:51 PM
  #4
miccheckone
Novice (Level 1)
 
Join Date: Jul 2008
Location: Los Angeles, California, USA
Posts: 8
iTrader: (0)
miccheckone is an unknown quantity at this point
In my research, I found this article on Adobe's site about using a utility called the TimelineWatcher class.

http://www.adobe.com/devnet/flash/ar...newatcher.html

The article's still a bit beyond my grasp at this point, but if this looks like a solution to my dilemma, I'll try to figure it out. Any thoughts?
miccheckone is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-06-2009, 07:00 PM
  #5
miccheckone
Novice (Level 1)
 
Join Date: Jul 2008
Location: Los Angeles, California, USA
Posts: 8
iTrader: (0)
miccheckone is an unknown quantity at this point
Okay, I got it. Amazing what another 8 hours of searching can turn up.

On the last frame of my splash animation timeline, I added a simple action that returns to the root timeline (Scene 1) and resumes playback, thereby proceeding to the next MovieClip (on frame 3) where my site content resides. There is a simple stop(); action on frame 3 that pauses the root timeline at this MovieClip.

I found the code in a post on AS2 and just migrated it to AS3.

ActionScript 2.0:
PHP Code:
_root.play(); 
ActionScript 3.0:
PHP Code:
MovieClip(root).play(); 
miccheckone is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-07-2009, 08:32 AM
  #6
RysChwith
Super Guru
 
Join Date: Jun 2004
Posts: 4,117
iTrader: (0)
RysChwith will become famous soon enough
Ah, that makes sense. You might consider using parent instead of root, in case the SWF ever gets embedded in another SWF (presumably not likely, but it's a good habit to get into in general).

Rys
RysChwith is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 10-12-2009, 04:25 PM
  #7
miccheckone
Novice (Level 1)
 
Join Date: Jul 2008
Location: Los Angeles, California, USA
Posts: 8
iTrader: (0)
miccheckone is an unknown quantity at this point
Quote:
Originally Posted by RysChwith View Post
You might consider using parent instead of root... it's a good habit to get into in general.
Cool, thanks for the tip, Rys!
miccheckone is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 12:39 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.