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

HTML5-Canvas gtoAndPlay not working

Explorer ,
Jun 11, 2017 Jun 11, 2017

Hi All,

I have two buttons on the stage. Instance names = "btn_begin" and "btn_touch" btn_begin works fine but I can't get the second one to work at all.

Frame name "gobabygo" is frame 1, and frame 200 also has a name "touchscreen1" I have tried both the name and number.

Here is my code,  it's sitting on frame 140.

======

this.stop();

this.btn_begin.addEventListener("click", fl_ClickToGoToAndPlayFromFrame_7.bind(this));

function fl_ClickToGoToAndPlayFromFrame_7()

{

    this.gotoAndPlay("gobabygo");

}

this.btn_touch.addEventListener("click", fl_ClickToGoToAndPlayFromFrame_8.bind(this));

function fl_ClickToGoToAndPlayFromFrame_8()

{

    this.gotoAndPlay(200);

}

======

Thanks! Any help is appreciated.

293
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

Enthusiast , Jun 11, 2017 Jun 11, 2017

That code is ok. Here is working example with your code https://ufile.io/6g9eb , check instance name of your btn_touch button.

Translate
Enthusiast ,
Jun 11, 2017 Jun 11, 2017

That code is ok. Here is working example with your code https://ufile.io/6g9eb , check instance name of your btn_touch button.

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 ,
Jun 11, 2017 Jun 11, 2017
LATEST

Thanks Marjam,

Yes. You were right. There was two instance names for the button. One name before the tween and another after the tween.

Thanks!

Dan

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