Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Play a scene using buttons then go back to the first frame?

New Here ,
Mar 08, 2018 Mar 08, 2018

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

2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2018 Mar 08, 2018

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 ???

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 08, 2018 Mar 08, 2018

Oof, my bad. I'm using Adobe Flash Professional CS6, as I mentioned in the tags.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2018 Mar 08, 2018

"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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2018 Mar 12, 2018

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 15, 2018 Mar 15, 2018
LATEST

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");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines