homepage Welcome to WebmasterWorld Guest from 204.236.254.124
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Loading a flash movie from a flash movie
icpooreman




msg:1563359
 8:11 pm on May 1, 2006 (gmt 0)

Hey I'm looking to load a flash movie into a flash movie. I've figured out if I have a second swf file in my first I can go

loadMovieNum("ex.swf",1);
this will load "ex.swf" on top of my already playing movie, but this isn't what I want. I want to load this movie and make the movie that's loading it dissapear until the movie I just loaded is done playing.

My original Idea was make a blank frame and before I load my second movie go to it so it gives the appearence that it's playing by itself. However when I do that I don't know how to regain control of my original movie when the second is done playing. Is there any type of onUnload type deal that can signal when this happens?

 

Richard_N




msg:1563360
 10:31 pm on May 1, 2006 (gmt 0)

you can load the movie over the top of the existing one by using an alternate depth ie 2 instead of 1 you could also load the second movie into an empty clip on the root movies timeline.

Both can then be conrolled via actionscript.

dareRock




msg:1563361
 5:13 pm on May 2, 2006 (gmt 0)

to have the top level movie dissapear when it is done, you can try some AS like:

unloadMovieNum(this);

to check if the movie (loaded on _level1) is done playing, you could create a setInterval() within the _level0 or _root movie which checks something like this:

function isCompleted(){
if (_level1._currentframe == _level1._totalframes){
trace('_level1 movie is complete');
}
}
// load the swf into _level1
loadMovieNum('ex.swf', 1);
setInterval(isCompleted, 100);

Alternatively, you could have an action/function in the last frame of ex.swf that removes itself and starts the _root movie up again (or goes to a frame, etc)

There are many ways to accomplish this, the trick is finding the best one for your situation.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved