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

problem with button and zoom on canvas

New Here ,
Mar 27, 2018 Mar 27, 2018

hello ... I am working on a canvas project .. the project consists of an interactive map WITH ZOOM .. I have the symbol "map", inside this symbol I have the map and 2 buttons

button 1: go to frame 15
button 2: return to frame 1

the problem is that the zoom is superimposed on me with the buttons. The buttons are hidden ... when I go to frame 15 it shows me some special routes

I would like to take out the buttons of the "map" symbol and place it in the main scene

the problem

being the button 1 in the main scene I do not know how to take me to frame 15 of the "map" symbol

this code works if the button is inside the map symbol, but it does not work if the buttons are in the main scene, outside the map symbol



this.btn_boton1.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_2.bind (this));

function fl_ClickToGoToAndStopAtFrame_2 ()
{
this.gotoAndStop (15);
}


this.btn_boton2.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_3.bind (this));

function fl_ClickToGoToAndStopAtFrame_3 ()
{
this.gotoAndStop (1);
}

340
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

Community Expert , Mar 28, 2018 Mar 28, 2018

Nice!

Set their visibility in the beginning and when the user clicks the buttons.

this.btn_boton1.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_2.bind(this));

function fl_ClickToGoToAndStopAtFrame_2()

{

     this.map.gotoAndStop(15); // it is in fact the 16th frame

     this.btn_boton1.visible = false;

     this.btn_boton2.visible = true;

}

this.btn_boton2.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_3.bind(this));

function fl_ClickToGoToAndStopAtFrame_3()

{

     this.map.gotoAndStop(1)

...
Translate
Community Expert ,
Mar 28, 2018 Mar 28, 2018

Hi.

Please try this:

this.btn_boton1.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_2.bind(this));

function fl_ClickToGoToAndStopAtFrame_2()

{

     this.map.gotoAndStop(15); // it is in fact the 16th frame

}

this.btn_boton2.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_3.bind(this));

function fl_ClickToGoToAndStopAtFrame_3()

{

     this.map.gotoAndStop(1); // it is in fact the 2nd frame

}

Regards,

JC

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 28, 2018 Mar 28, 2018

thanks for answering and helping JoãoCésar

yes, it works .. but it created another problem

the "button2" is now always visible and before that button was hidden, it was shown only in frame 15

how can I do to hide the "button2" in the main scene and activate it only by clicking on the "button1"

and, when I click on the "button2" hide it to itself and go back to the frame 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
Community Expert ,
Mar 28, 2018 Mar 28, 2018

Nice!

Set their visibility in the beginning and when the user clicks the buttons.

this.btn_boton1.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_2.bind(this));

function fl_ClickToGoToAndStopAtFrame_2()

{

     this.map.gotoAndStop(15); // it is in fact the 16th frame

     this.btn_boton1.visible = false;

     this.btn_boton2.visible = true;

}

this.btn_boton2.addEventListener ("click", fl_ClickToGoToAndStopAtFrame_3.bind(this));

function fl_ClickToGoToAndStopAtFrame_3()

{

     this.map.gotoAndStop(1); // it is in fact the 2nd frame

     this.btn_boton1.visible = true;

     this.btn_boton2.visible = false;

}

this.btn_boton1.visible = true;

this.btn_boton2.visible = false;

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 28, 2018 Mar 28, 2018
LATEST

JoãoCésar .... works very well

... thank you very much ..
send a new query about this project .. maybe you can help me

Title: Help with pop-up window - canvas

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