A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: loading movie clip to stage with button click AS3

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

    loading movie clip to stage with button click AS3

    I'm trying to figure out how to load a movie clip to the stage with a button click and have the movieclip close again using a close button. Does anyone have a step by step on how to do this or links to some tutorials.

    Below is an example of what I'm trying to do.

    Last edited by good_snow; 04-25-2013 at 06:06 PM.

  2. #2
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    Look up addChild and removeChild in the live docs....it allows you to add and remove items from the stage

    PHP Code:
    openbtn0.addEventListener(MouseEvent.CLICKopenfunctionfalsetrue);
    closebtn0.addEventListener(MouseEvent.CLICKclosefunctionfalsetrue);
    function 
    openFunction(e:MouseEvent):void{
    addChild(movieClip0);
    }

    function 
    closeFunction(e:MouseEvent):void{
    movieClip0.parent.removeChild(movieClip0);

    ~calmchess~

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