Thursday, 2 August 2012

addChild in as3

step 1: Create a movieClip on your stage and delete the movieClip from the stage.
step 2: Open the Library (Ctrl+l) select movieclip,right click select "properties" and under the "ActionScript              Linkage" select the Export the ActionScript.
www.actionscriptguru.in



step 3: Give the Class Name : mc and press OK.

step 4:    ACTION SCRIPT

var myMc:mc = new mc();
myMc.x = 100;
myMc.y = 100;
addChild(myMc);

attachMovie in as2 :

attachMovie("mc","mc",_root.getNextHighestDepth(),{_x:100,_y:100})

No comments:

Post a Comment