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

All my buttons link to the same URL

New Here ,
Oct 19, 2019 Oct 19, 2019

using Animate (version 19.2.1) I have created several buttons using this action :

this.***.addEventListener("click", fl_ClickToGoToWebPage);
 
function fl_ClickToGoToWebPage() {
window.open("https://www.***********/", "_top");
}
it works well but all my buttons goes to the same url despite having edited the url and the button name eachtime.
all the buttons follow this action:
animateproblem.png
ps: I have also tried to put it online and it doesn't work in wordpress either
 
Does anyone know this problem ? thanks in advance for the help 🙂
TOPICS
ActionScript , Code , Error , How to , Other
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
Community Expert ,
Oct 19, 2019 Oct 19, 2019

if you use the snippets, you need different button listeners calling different functions, if you want to use different urls.  eg.

 

this.button_1.addEventListener("click",gotoURL_1.bind(this));

this.button_2.addEventListener("click",gotoURL_2.bind(this));

 

function gotoURL_1(){

window.open("http://www.adobe.com");

}

function gotoURL_2(){
window.open("http://www.kglad.com");
}

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 ,
Oct 19, 2019 Oct 19, 2019

thank you very much !

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 ,
Oct 19, 2019 Oct 19, 2019
LATEST

you're welcome.

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