Copy link to clipboard
Copied
So I tried using scenes because I thought it is much more convenient. But, uh, no. I think.
So here's my situation.
I have 5 scenes, all of them ends with the same frame(100).
The ButtonScene is only for the buttons. If Button1 were clicked, it's supposed to play Scene1 only, and then it will go back to the ButtonScene, where my buttons are staying.
Button2 will play Scene2, then go back to ButtonScene, etc.
I used code snippets because I'm not really into coding, "click and go to scene and play" actually works.
BUT I don't want to play the entire scene by clicking only one button.
I tried to do the answers in How to stop scenes from playing one after the other? and How do I automatically pause at the end of a scene? , but when I insert stop();, the entire swf will not play.
Thank you for the incoming answers. If my situation is not possible, can you guide me on how to do this? Thanks.
Moderator: Moved to Adobe Animate CC - General forum
Copy link to clipboard
Copied
Please post the name of the program you use so a Moderator may move this message
-A program would be Photoshop or Dreamweaver or Muse or Premiere Pro or ???
Copy link to clipboard
Copied
Oof, my bad. I'm using Adobe Flash Professional CS6, as I mentioned in the tags.
Copy link to clipboard
Copied
"actionscript 3 and buttons" is not a good tag. That's like... two tags.
Anyway, if you're actually using AS3, stop(); should be working to stop the current timeline.
Also you're just making your life harder by using scenes instead of movieclips.
Copy link to clipboard
Copied
So I tried again what you said and thanks for that.
stop();
btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_10);
function fl_ClickToGoToAndPlayFromFrame_10(event:MouseEvent):void
{
gotoAndPlay(1,"Scene 2");
}
This is what my code looks like, and as you said, I added stop(); in each end of each scene. If I Test my movie and when I click a button, it plays a scene and then the animation will stop. That's fine I like it. Aha. Aha.
But after that, nada. Nothing. You can only see a plain white stage.
However, I want to re-loop the first frame because that's where my buttons are. Buttons are importanter.
What code snippet can I add?
Copy link to clipboard
Copied
It sounds like you want to jump to the first frame of scene 1 and stop there if that is where the buttons are. Adapting the instruction you are currently using:
gotoAndStop(1, "Scene 1");
Find more inspiration, events, and resources on the new Adobe Community
Explore Now