Copy link to clipboard
Copied
So I can't for the life of me find anything on this subject. - I'm 80% sure it's really straight forward.
Essentially I have 2 movie clips. One movie clip is named 'sidebar' the other is named 'maincontent'.
Inside 'sidebar' there's a button, and inside 'maincontent' there is some text that fades in after 24 frames.
So essentially, all i'm trying to do is click the button in the 'sidebar', which will play 'maincontent'.
I can't figure out how to exit 'sidebar' timeline and then tell it to target 'maincontent' timeline. Or maybe i'm setting up the project wrong.
All help greatly appreciated.
Cheers
Hi.
Try one of these:
AS3 documents:
import flash.events.MouseEvent;
function playMainContent(e:MouseEvent):void
{
MovieClip(root).maincontent.play();
}
sidebar.button.addEventListener(MouseEvent.CLICK, playMainContent);
HTML5 Canvas documents:
this.playMainContent = function(e)
{
exportRoot.maincontent.play();
};
this.sidebar.button.on("click", this.playMainContent);
Essentially what you have to do is to target the main timeline (MovieClip(root) for AS3 and exportRoot for HTML5) and then use dot notat
...Copy link to clipboard
Copied
Hi.
Try one of these:
AS3 documents:
import flash.events.MouseEvent;
function playMainContent(e:MouseEvent):void
{
MovieClip(root).maincontent.play();
}
sidebar.button.addEventListener(MouseEvent.CLICK, playMainContent);
HTML5 Canvas documents:
this.playMainContent = function(e)
{
exportRoot.maincontent.play();
};
this.sidebar.button.on("click", this.playMainContent);
Essentially what you have to do is to target the main timeline (MovieClip(root) for AS3 and exportRoot for HTML5) and then use dot notation to access the object you want.
I hope this helps.
Regards,
JC
Find more inspiration, events, and resources on the new Adobe Community
Explore Now