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

GotoandPlay function delay in Animate Java

Community Beginner ,
May 15, 2018 May 15, 2018

Hello!

I would like to start by saying this place has been very good to me in the past

several years. Thanks.

I have run into an issue, like many who are moving away from AS3 and into Java etc.

I have this code on a project

stop();

setTimeout(timedFunctionLoopB1B,6900);

function timedFunctionLoopB1B() {

    gotoAndStop("5");

}

Of course the project is in AS3.

I can not seem to find out how to duplicate the effect in Java script.

it's a simple....'Do not go to this frame for this many seconds' bit of code.

Not attached to any button functions or anything.

See It's just that Adobe Animate gives me unique questions for Java I can not ask someone who does not use

Adobe Animate.

Thanks in advance for any help.

I could not even find a simple code snippet for this in the code library.

802
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

correct answers 1 Correct answer

LEGEND , May 15, 2018 May 15, 2018

It's JavaScript, which is a bit different tJava, but it's quite like ActionScript. This would do the same thing as your example:

this.stop();

var self = this;

setTimeout(timedFunctionLoopB1B,6900);

function timedFunctionLoopB1B() {

    self.gotoAndStop("5");

}

'self' is just a variable to store the current level, so that when you say gotoAndStop() it knows what thing it is that you want to change.

Translate
LEGEND ,
May 15, 2018 May 15, 2018

It's JavaScript, which is a bit different tJava, but it's quite like ActionScript. This would do the same thing as your example:

this.stop();

var self = this;

setTimeout(timedFunctionLoopB1B,6900);

function timedFunctionLoopB1B() {

    self.gotoAndStop("5");

}

'self' is just a variable to store the current level, so that when you say gotoAndStop() it knows what thing it is that you want to change.

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 Beginner ,
May 15, 2018 May 15, 2018
LATEST

As always this place comes through!

Thank you very much it works great.

This one was bugging me.

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