What I was trying to mention in my earlier post was, what if I did that AND then the targeted frame in the movie clip had interractivity assigned to it's objects.
Right...
You can do that as well. Just like I'm pulling the names.
Using the getChildAt() method.
So, if you were trying to attach a CLICK mouse event to a movieclip on frame 2 of another movieclip (instance name interface), you might do something like this:
Code:
instance.gotoAndPlay(2);
instance.getChildAt(0).addEventListener(MouseEvent.CLICK, onClick);
Of course, this doesn't guarantee that you're accessing the right movieclip. If the gotoandPlay doesn't complete on time, it will add the actions to the child at level0 on the first frame.
You could also use addFrameScript():
Code:
interface.addFrameScript(2, frame2);
function frame2() {
interface.buttonOnFrame2.addEventListener(MouseEvent.CLICK, onClick);
}
Bookmarks