Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stoping movie clip after loaded

Status
Not open for further replies.

clemrock

Programmer
May 20, 2004
118
US
Hello,

This seems to be a straightforward problem but I can't seem to get this to work.

I'm trying to load a movie and stop it when it's fully loaded.

Right now, when I load a movie it automatically starts playing after it's fully loaded.

Here's the code I'm using:

_root.media_clip.loadMovie( "movie_to_load.swf" );
_root.media_clip.gotoAndStop(1);
 
I made this function and it works beautifully:


Problem solved - heres a function I used to solve the problem:


function load_movie_and_stop( target_mc:MovieClip, movie_clip_to_load:String )
{
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip)
{
target_mc.stop(); //trace( "loadlistener called" );
};

var my_mcl:MovieClipLoader = new MovieClipLoader();
my_mcl.addListener(mclListener);
my_mcl.loadClip( movie_clip_to_load, target_mc );
}

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top