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

Simple buttons on a simple map (from a simple mind:)

New Here ,
Mar 01, 2018 Mar 01, 2018

Hello, I realize an interactive map of Morocco on Animate. About ten cities are pointed with, for each of them, a supposed button to reveal a small histogram. The code for the first city works normally : in the click the histogram appears correctly. On the other hand, the following city, with the same code (but names of ocurrence different) stops working.

Does anybody know the principle of coding the best adapted in this case? Thank you in advance for the answer. (May be an answer in french?:) 

For information here is code i used 

Capture d’écran 2018-02-28 à 09.39.11.png

270
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 01, 2018 Mar 01, 2018

the first problem i see is both buttons are calling the same function.  that can't be correct.

use different function names (eg, mrrakechF and cazablancaF) in the listener and function definition.

Translate
Community Expert ,
Mar 01, 2018 Mar 01, 2018

the first problem i see is both buttons are calling the same function.  that can't be correct.

use different function names (eg, mrrakechF and cazablancaF) in the listener and function definition.

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

Thank you Kglad for your help.

I'll try to night (after work) new function names. I am unfortunately not very talented in coding. If I understood you, I may try something like that ? :

this.bt_marrakech.addEventListener("click",mrrakechF .bind(this));

function mrrakechF( )

{

this.graph_marrakeche.play( )

}

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

yes.

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

ok thank you again !

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