cannot remove movieclip with button click.

  • djarot
  • Born
  • Born
  • djarot
  • Posts: 2

Post 3+ Months Ago

hi...,im new here n new on actionscript.

im trying to make a flash presentation using flash ActionScript3,
i have three button each load their movieclip.

when SWF is play, then mc1 is load,
when btn2 click, then mc1/mc3 is remove n mc2 s load..and so on.
when btn1 click, then mc1 is load,...
...just like the website menu...
the problem is...,the movieclip that has been load before cannot be removed..
here is the actionscript..

Code: [ Select ]

flash.display.MovieClip;
var mc1:loadLoad = new loadLoad();
var mc2:aaMc = new aaMc();
var mc3:bbMc = new bbMc();


var tT:testTest = new testTest();

[*]/*load when SWF is loaded*/
showLoad();
function showLoad(){
    this.addChild(mc1);
    /*this.addChild(tT)
    tT.y= 100;*/
    }

btn1.addEventListener(MouseEvent.CLICK, btn1Load);
function btn1Load(e:MouseEvent):void{
    try{//this.removeChild();
    this.addChild(mc1);
    removeChild(mc3);
    removeChild(mc2);
    
    }catch(e:Error){}
    
    
    }

btn2.addEventListener(MouseEvent.CLICK,btn2Load);
function btn2Load(e:MouseEvent):void{
    try{er.play();
    this.addChild(mc3);
    removeChild(mc1);
    removeChild(mc2);
    
    }catch(e:Error){}
    }
    

btn3.addEventListener(MouseEvent.CLICK,btn3Load);
function btn3Load(e:MouseEvent):void{
    try{
    addChild(mc2);
    removeChild(mc3);
    removeChild(mc1);
    
    }catch(e:Error){}}
  1. flash.display.MovieClip;
  2. var mc1:loadLoad = new loadLoad();
  3. var mc2:aaMc = new aaMc();
  4. var mc3:bbMc = new bbMc();
  5. var tT:testTest = new testTest();
  6. [*]/*load when SWF is loaded*/
  7. showLoad();
  8. function showLoad(){
  9.     this.addChild(mc1);
  10.     /*this.addChild(tT)
  11.     tT.y= 100;*/
  12.     }
  13. btn1.addEventListener(MouseEvent.CLICK, btn1Load);
  14. function btn1Load(e:MouseEvent):void{
  15.     try{//this.removeChild();
  16.     this.addChild(mc1);
  17.     removeChild(mc3);
  18.     removeChild(mc2);
  19.     
  20.     }catch(e:Error){}
  21.     
  22.     
  23.     }
  24. btn2.addEventListener(MouseEvent.CLICK,btn2Load);
  25. function btn2Load(e:MouseEvent):void{
  26.     try{er.play();
  27.     this.addChild(mc3);
  28.     removeChild(mc1);
  29.     removeChild(mc2);
  30.     
  31.     }catch(e:Error){}
  32.     }
  33.     
  34. btn3.addEventListener(MouseEvent.CLICK,btn3Load);
  35. function btn3Load(e:MouseEvent):void{
  36.     try{
  37.     addChild(mc2);
  38.     removeChild(mc3);
  39.     removeChild(mc1);
  40.     
  41.     }catch(e:Error){}}


>>that is the actionscript code that embedded in .fla file..
please...,help.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.