Copy link to clipboard
Copied
i want to go From main timeline to symbol timeline
movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
function fl_ClickToGoToScene(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "blue");
}
Copy link to clipboard
Copied
You don't want to use the name of the current scene when you use gotoAndPlay() or gotoAndStop(). Try:
MovieClip(this.root).gotoAndPlay(1);
Using scenes is a very bad practice. It is a remnant from the very early versions of Flash.
Copy link to clipboard
Copied
I replied too quickly. You are editing a symbol, not a scene. In your example "blue" is a movieClip. If that is a movieClip with frames and you have it stopped on a frame and you want it to play through its timeline, then you should be using:
blue.play();
It's difficult to tell, the timeline shows the Library name for the movieClip, but not the instance name. You need to use the instance name, without quotation marks, followed by the command play(); to play the movieClip.
In any case, don't use scenes.
Copy link to clipboard
Copied
I tried to target a movieclip from inside another movieclip called ball and these dont work!
stop();
movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
function fl_ClickToGoToScene(event:MouseEvent):void
{
MovieClip(root).ballmc.play();
}
Copy link to clipboard
Copied
i want gotoandplay symbol timeline from main time line
Copy link to clipboard
Copied
If movieClip_1 and ballmc are both on the same timeline then something like this should work:
movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
function fl_ClickToGoToScene(event:MouseEvent):void
{
this.ballmc.play();
}
MovieClip(root) is not a valid reference in javascript. You can use this.parent to move up a level or exportRoot to get to the base level.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now