A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: closing a movie clip with a mouse click?

  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    19

    closing a movie clip with a mouse click?

    I have a button that loads a movie clip and I want to be able to close that same movieclip by clicking anywhere.

    This is my code so far:

    btn_2.addEventListener(MouseEvent.CLICK, goBio);
    function goBio (e:MouseEvent):void {
    var newBio:BioToc = new BioToc();
    this.addChild(newBio);
    newBio.x = 25;
    newBio.y = 45;
    }

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    Firstly make newBio a member variable. You can then add a click event to the stage and remove the newBio movieclip.

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