Sup guys.
Alright, so I’m trying to do this thing where I click and object on the stage, and then the idea would be to add the name of that object (a movieClip I guess?) to an array.
Right now, this is what I’ve got
eef_mc.addEventListener(MouseEvent.CLICK, addBeefToIngredients);
function addBeefToIngredients(event:MouseEvent):void
{
ingredients.push("beef");
}
toString_mc.addEventListener(MouseEvent.CLICK, printIngredients);
function printIngredients(event:MouseEvent):void
{
trace(ingredients.toString());
}
But what I would like to have, is a setup that listens for clicks on a series of objects, and then adds the name of a particular one when that one is clicked; or else I’ll just end up with alot of semi-identical and hard-to-manage code.
Is it clarified enough?
Else, tell me. I’d love to get hints on how to do this the smartest way.
Thanks.