Link to home
Start Free TrialLog in
Avatar of eddyperu
eddyperuFlag for United States of America

asked on

I need help me with the Loader.unloadAndStop

hi Expert;
I have 4 buttons in my main movie and each one of them load 4 different movies (Movie1.swf; Movie2.swf; Movie3.swf; Movie4.swf) into a Moviel Clip that I have set in my scene.
I just discovered that the problem is with the loader.unloadAndStop
I don't know where to put it in my code.
any help Thanks

I am using AS3
var thisMovieClip:MovieClip;
var thisLoader:Loader = new Loader();

function WhichMovieToPlay():void{
	
	 if(ButtonUnicValue == 1)   //if button 1 Have been click
         {   
		 thisLoader.load(new URLRequest("Movie1.swf"));
		 thisLoader.name = "Movie1";
	
	 }

	 if(ButtonUnicValue == 2)  //if button 2 Have been click
	 {
		 thisLoader.load(new URLRequest("Movie2.swf"));
		 thisLoader.name = "Movie2";
	 }		

	 if(ButtonUnicValue == 3)  //if button 3 Have been click
	 {
		 thisLoader.load(new URLRequest("Movie3.swf"));
		 thisLoader.name = "Movie3";	 	
	 }	 

	 if(ButtonUnicValue == 4)  //if button 4 Have been click
	 {
		 thisLoader.load(new URLRequest("Movie4.swf"));
		 thisLoader.name = "Movie4";	
	
	 }		
 
    thisLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoading);	
    var info:LoaderInfo = LoaderInfo(thisLoader.contentLoaderInfo)	 
}

function doneLoading(e:Event):void { 
  thisMovieClip = MovieClip(e.currentTarget.content);  
  loadDemo_mc.addChild(thisMovieClip);
  loadDemo_mc.addEventListener(Event.ENTER_FRAME,runOnce);
   
}

Open in new window

Avatar of Montoya
Montoya

I'm trying to understand your problem. Are you saying that your application does not switch properly between the 4 movies?
ASKER CERTIFIED SOLUTION
Avatar of Montoya
Montoya

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eddyperu

ASKER

Thanks