| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Dec 2000
Location: Scotland (UK)
Posts: 5
|
Hi, can anyone help please, This is probably a dumb question to regular flash users. I want to be able to load a movie, wait till it finishes, unload that movie and then load a new movie. Kinda like a slideshow using external movies. My problem is understanding how to determine when a loaded movie has reached its last frame. Please, please help.
leo99 |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,625
|
In Flash 5 you can dot his in more ways than one, but still by far the easiest way is to simply include the action in the last frame of your loaded movie.
So that last frame of your first loaded movie will have: [bunloadMovieNum (1); loadMovieNum("movie.swf", 1);[/b] (PS - If this doesn't work, replace the load movie with: _root.loadMovieNum ) That will unload your current movie and go on to the next one and it saves you the hassle of using the _currentframe and _totalframes parameters (even though you could). Cheers Jesse |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Dec 2000
Location: Scotland (UK)
Posts: 5
|
Thanks Jesse, but I'm still having trouble. I'm using Wildform SWFX to create text animations output as swf files. I'm loading these into a main movie in Flash and I can't edit the last frame of the external text animations to add the script that you suggested. What I would really like to know is if there is a way to determine when a loaded movie has played once only without personally knowing how many frames are in the external movie - I've noticed other people mentioning that it is not a good idea to leave x amount of blank frames in the timeline to cover the play length of a external movie. Any ideas??
Leo99 |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,625
|
OK then you have to do it the hard way
![]() It's not that hard really. I assume you load your clip up onto another level (or within another clip, it makes no difference really). I think the best way to do it would be to load your clip onto another level. Then you use get properties (see the tutorial ) to check the length of the loaded clip and loop until the current frame is greater than or equal to the total length... Come to think of it you might have to load it into a target clip ... but either way you code would be something like this: Once movie is loaded: total = getProperty ( "/target", _totalframes ); This sets the variable 'total' to the total number of frames in your loaded clip. Then have a 2 frame looping MC with: Frame 1: if (_level0.target._currentframe = _level0:total) { // we're at the last frame, do whatever } else { gotoAndPlay (2); } Frame 2: if (_level0.target._currentframe = _level0:total) { // we're at the last frame, do whatever } else { gotoAndPlay (1); } So this will loop until you reach the last frame of the loaded clip, then do whatever you put where the comment is.... Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,625
|
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Dec 2000
Location: Scotland (UK)
Posts: 5
|
Strok, could you elaborate please...
Leo. |
|
|
|
|
|
#7 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,625
|
Strok? Right thread?
Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#8 |
|
Registered User
Join Date: Dec 2000
Location: Scotland (UK)
Posts: 5
|
Ooooh.. spooky, I could have sworn there was a comment from Strok on this thread when I read it yesterday. I even checked the similar thread from crzyhorse and it's not there, think I need to lie down. What's my name again?...
thanks Jesse, Leo |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can unload the external .swf but not the streaming .flv inside it | starboard | ActionScript 2.0 | 1 | 08-28-2007 01:25 AM |
| external movie, text, css problem | openeyes | ActionScript 2.0 | 3 | 01-21-2006 08:07 AM |
| Loading images in different frames.. | nchagial | ActionScript 2.0 | 22 | 12-21-2005 09:06 AM |
| Unloading External SWF | txusm | ActionScript 1.0 (and below) | 3 | 12-14-2004 09:50 AM |
| unloading prob | wil | Other Flash General Questions | 2 | 12-08-2001 06:13 PM |