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

can't get gotoAndPlay work in HTML canvas

Explorer ,
Jan 03, 2017 Jan 03, 2017

on 1st frame of stage I have a symbol on the canvas.  The symbol has a this.stop(); on first frame of it. 

How can I get this to play from code on stage? 

this.symbolName.gotoAndPlay(2);  //doesn't work

var self = this;

self.symbolName.gotoAndPlay(2) // doesn't work

What am I doing wrong?

451
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 , Jan 03, 2017 Jan 03, 2017

Did you actually name your symbol instance "symbolName"?

If you do console.log(self.symbolName) does it display the symbol or undefined?

Do you understand that in a Canvas document gotoAndPlay(2) will actually go to the third frame of a clip?

If your gotoAndPlay code is on the same frame where the clip first appears, it will fail because the clip hasn't fully initialized yet.

Translate
LEGEND ,
Jan 03, 2017 Jan 03, 2017

Did you actually name your symbol instance "symbolName"?

If you do console.log(self.symbolName) does it display the symbol or undefined?

Do you understand that in a Canvas document gotoAndPlay(2) will actually go to the third frame of a clip?

If your gotoAndPlay code is on the same frame where the clip first appears, it will fail because the clip hasn't fully initialized yet.

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
Explorer ,
Jan 03, 2017 Jan 03, 2017
LATEST

The code was on the same frame as where the clip first appears.  I didn't know this was how it worked.  Thank you

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