There is no such a thing as a item on stage without an instance name. If you did not create a name, ActionScript 3.0 will create a name for you. Find out how to trace this name and how to access the item, using it.
CLICK HERE FOR A COMPLETE ACTIONSCRIPT 3.0 CARTOON SMART TUTORIAL
HERE IS THE SOURCE CODE!
// Avraham Saltoun solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE
var mySmile : Smile;
// the variable mySmile will contain
// a smile movie clip
//This will add 3 smiles
//next one another
for (var i: int =0; i <3; i++) {
mySmile = new Smile();
//this class was automatically created
// on previous tutorial
addChild (mySmile);
//this adds a smile to stage
mySmile.x = i*mySmile.width;
//this will position the smile next to previous
//This will give us the instance name
trace (mySmile.name);
}
addChild(mySmile);
//this will place a smile
//on our empty stage
remove_btn.addEventListener(MouseEvent.CLICK, removeSmile);
// removeSmile is a function we will create
// that removes the movie clip from stage
function removeSmile (event:MouseEvent):void {
removeChild(getChildByName ("instance13"));
// this will remove the child with the name instance 13 from stage.
}



































October 25th, 2009 at 7:48 am
Nice tytorial, it was chosen for the homepage of http://www.tutorialsroom.com