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

my as3 code does not play on scene 2

Community Beginner ,
Dec 28, 2017 Dec 28, 2017

Copy link to clipboard

Copied

I have created a simple animation in the fist scene that goes to a navigation screen and stops. When the user clicks on the first button "Try Surfing Animation" it should go and play scene 2 which I have called TrySuf. I do not know why this code does not play on scene 2. I am using Adobe flash. I am using AS3 code. I have shared the file on my google drive. Please let me know if you cannot access it from google drive as I find an alternative way of demonstrating my file. Any help will be much appreciated.

https://drive.google.com/open?id=1lz1aaXx3RUjOQep9o8fna2-3Shpp-Yc8

Thank you in advance

TOPICS
ActionScript

Views

1.6K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Dec 29, 2017 Dec 29, 2017

Thanks!

The problem it's because you don't have a code to make your button do what you want.

In the last frame of your first scene, where there is a stop() function, replace the code there with this one:

import flash.events.MouseEvent;

function clickHandler(e:MouseEvent):void

{

    gotoAndPlay(1, "TrySurfing");

}

stop();

surfButton.addEventListener(MouseEvent.CLICK, clickHandler);

In the last frame of the second scene, the one with the surfing animation, put this code:

gotoAndPlay(11); // if you want to cr

...

Votes

Translate

Translate
Community Expert ,
Dec 28, 2017 Dec 28, 2017

Copy link to clipboard

Copied

Hi.

Please set your file sharing options to public so we can see what's going on.

Regards,

JC

Votes

Translate

Translate

Report

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 Beginner ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

Hi,

I have given anyone who has the link, full access, let me know if this is okay?

google drive does not always behave the way I want it to.

https://drive.google.com/file/d/1lz1aaXx3RUjOQep9o8fna2-3Shpp-Yc8/view?usp=sharing

Thank you

Votes

Translate

Translate

Report

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 ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

Thanks!

The problem it's because you don't have a code to make your button do what you want.

In the last frame of your first scene, where there is a stop() function, replace the code there with this one:

import flash.events.MouseEvent;

function clickHandler(e:MouseEvent):void

{

    gotoAndPlay(1, "TrySurfing");

}

stop();

surfButton.addEventListener(MouseEvent.CLICK, clickHandler);

In the last frame of the second scene, the one with the surfing animation, put this code:

gotoAndPlay(11); // if you want to create a loop for the surfing animation

OR

This one:

stop(); // if you want to stop the animation on the last frame.

By the way, very cool animation! Well done!

I hope it helps.

Regards,

JC

Votes

Translate

Translate

Report

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 Beginner ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

Strange, I thought I had put code on the work but the link on google drive had no code. Anyway there was a problem in the code which is now solved.

Thank you ever so much.

Votes

Translate

Translate

Report

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 ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

You're welcome!

Votes

Translate

Translate

Report

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 ,
Dec 03, 2018 Dec 03, 2018

Copy link to clipboard

Copied

hi .

i have a problem in action script coding.

when i create a button in scene 2 or 3 in my projects adobe animate show this error :

1120:Access of undefined property button_back

while i set instance name !!

this  code is ok in scene 1 but in other scenes show erro!!

Votes

Translate

Translate

Report

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 ,
Dec 03, 2018 Dec 03, 2018

Copy link to clipboard

Copied

Hi.

Are you using the 2019 version?

Please try disabling the advanced layers mode in the document settings (Ctrl/Cmd + J) and see if it will work.

Regards,

JC

Votes

Translate

Translate

Report

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 Beginner ,
Dec 04, 2018 Dec 04, 2018

Copy link to clipboard

Copied

I am using Adobe Animate CC 2019.

Votes

Translate

Translate

Report

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 ,
Dec 04, 2018 Dec 04, 2018

Copy link to clipboard

Copied

Hi.

Have you tried disabling the advanced layers mode in the document settings (Ctrl/Cmd + J)?

Please try this and see if it works.

Regards,

JC

Votes

Translate

Translate

Report

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 Beginner ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

LATEST

Thanks

Votes

Translate

Translate

Report

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 Beginner ,
Dec 04, 2018 Dec 04, 2018

Copy link to clipboard

Copied

I have same problem. My buttons don't work or the same error comes.

But my projects work on the previous versiyon animate CC, I have updated, so ıt didn't work.

Is there any changing settings.

Votes

Translate

Translate

Report

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