A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: removing thats swf that is external thats is inside one single movie clip

Threaded View

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    1

    removing thats swf that is external thats is inside one single movie clip

    i have a university project and instead of just constantly asking for help in my class. I want to gain knowledge outside of the class.

    I have 4 buttons that each load different external swf and load properly the probelm i have is i cant remove them. this is my trouble. I have tried the remove child but it cant be that easy and it doesnt work. i must be going wrong.

    when i go to remove one single child it remove the the latest child but wont remove every child that i want so the MC is clear and ready for the nest button to load the swf.

    heres my code so far.
    Code:
    import flash.events.MouseEvent;
    import flash.media.SoundMixer;
    
    var load1:URLRequest=new URLRequest("bigmp3.swf");
    var load2:URLRequest=new URLRequest("flashgallery.swf");
    var load3:URLRequest=new URLRequest("txt.swf");
    var load4:URLRequest=new URLRequest("s.swf");
    
    var img1loader:Loader = new Loader();
    var img2loader:Loader = new Loader();
    var img3loader:Loader = new Loader();
    var img4loader:Loader = new Loader();
    var mysquare = new square()
    
    
    
    load1_mc.addEventListener(MouseEvent.CLICK, click1);
    load2_mc.addEventListener(MouseEvent.CLICK, click2);
    load3_mc.addEventListener(MouseEvent.CLICK, click3);
    load4_mc.addEventListener(MouseEvent.CLICK, click4);
    
    
    
    
    function click1(event:MouseEvent) {
    	img1loader.load(load1);
    	mcloader.addChild(img1loader)
    	SoundMixer.stopAll();
    	mcloader.unloadAndStop
    }
    
    function click2(event:MouseEvent) {
    	img2loader.load(load2);
    	mcloader.addChild(img2loader)
    	SoundMixer.stopAll();
    	mcloader.unloadAndStop
    	
    }
    
    function click3(event:MouseEvent) {
    	img3loader.load(load3);
    	mcloader.addChild(img3loader)
    	SoundMixer.stopAll()
    	mcloader.unloadAndStop
    	
    
    }
    
    function click4(event:MouseEvent) {
    	img4loader.load(load4);
    	mcloader.addChild(img4loader)
    	SoundMixer.stopAll();
    	mcloader.unloadAndStop
    }
    mcloader.unloadAndStop is obviously worng and i have been through many others code.
    as i have said i can load the swf but then to make that swf gone from the MC so then the next swf hasnt got the previous swf overlapping it.

    thanks
    Last edited by 5TonsOfFlax; 11-18-2011 at 12:50 PM. Reason: code goes in code tags. non-code doesn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center