Rahul dagli
Rahul dagli

Reputation: 155

How to control a movieclip from within another movieclip as3?

I have got two movieclips on the main timeline. First one is envelope_mc and second is bg_main. In envelope_mc timeline there is a button on 25th frame which plays ahead when clicked.

stop();

on_btn.addEventListener(MouseEvent.CLICK, playAhead);

function playAhead(event:MouseEvent):void
{
    play();
}

I have also got some animation on bg_main which I wan't to trigger on 30th frame (inside bg_main timeline) when button is clicked in envelope_mc timeline.

Upvotes: 0

Views: 9843

Answers (1)

Marty
Marty

Reputation: 39466

From anything added to the stage you're able to access the root timeline via:

MovieClip(root)

Meaning you can access your mentioned MovieClips like this:

MovieClip(root).envelope_mc;
MovieClip(root).bg_main;

Upvotes: 3

Related Questions