PDA

View Full Version : attachMovie() ...how do i unload the movie??



dbalatero
April 24th, 2002, 04:08 PM
I have a button, that, when you press it, loads an external SWF while going to a transitional "Loading ..." screen. Afterwards, I want the loading screen to disappear, and have my portfolio.swf become visible. My code is as follows:

////////////////////
on (release) {
&nbsp &nbsp &nbsp &nbsp _root.attachMovie("loadTransition", "t_load", 0); // attach the loading movie clip
&nbsp &nbsp &nbsp &nbsp setProperty("t_load", _x, 325);
&nbsp &nbsp &nbsp &nbsp setProperty("t_load", _y, 200);
&nbsp &nbsp &nbsp &nbsp _root.loadMovieNum("portfolio.swf", 1); // load the portfolio
&nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp while (_level1.getBytesLoaded() !== _level1.getBytesTotal()) {
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp i = 0; // delay everything until it loads&nbsp &nbsp &nbsp &nbsp
&nbsp &nbsp &nbsp &nbsp }
&nbsp &nbsp &nbsp &nbsp _root["t_load"]["loadingText"].gotoAndPlay(3); // send it to the frame that says "Done."

// insert unattach code here:
}
//////////////////////////

Now, I need to figure out how to unattach my attached movie clip (loadTransition) and make it so portfolio.swf shows. Any thoughts?

Thanks,
David Balatero

upuaut8
April 24th, 2002, 07:22 PM
as long as you're using the attach method,

removeMovieClip();

should work fine