Hi,
I’m absolutely new to AS3 and I’m trying to convert my AS2 fla files to AS3 code.
Now one suggestion I’ve heard all the time is to keep ur code in one place, preferably at frame 1 of the main timeline.
Now that sound like a good idea to me, but here’s my question:
Is it possible to assign actions on frame 1 to an object that appears on stage on frame 90 ?
Assuming this is my simple code on frame 1, ‘box’ is a movieclip appearing on frame 90:
box.addEventListener(MouseEvent.CLICK, clickHandler);
box.buttonMode = true;
function clickHandler(evt:Object):void {
trace("You just clicked me!");
}
I tried that and it didn’t work, I had to place that code either on frame 90 or later, when that object already appeared in my flash movieclip…
–> which means I would have to split up my code for every object that appears later on stage - which is gonna be a lot of objects and then the code is gonna be scattered around like in AS2…
Is there any way to target that object and keeping my code on frame 1 ?
As always, thanx for your help and advise in advance !
Mike