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

A dynamic link based on frameLabel ?

New Here ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Hello !
I start with Adobe Animate and try to create a dynamic link based on what is displayed on the screen.
"FLAC", "GAUCHE" and "DROITE" are each activated by buttons ...
If anyone can help me, I would be delighted !!!
THANK YOU SO MUCH

 

var _this = this;
var contenance = _this.FLAC.currentLabel
var num1 = _this.GAUCHE.currentLabel
var num2 = _this.DROITE.currentLabel

_this.CMD.on('click', function(){
window.open('https://website.com/produit/'+ contenance +'ml/?attribute_senteur-n1='+ num1 +'&attribute_senteur-n2='+ num2, '_blank');
});

 

 

 

TOPICS
Code , How to , Timeline

Views

633

Translate

Translate

Report

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

Explorer , Jun 02, 2020 Jun 02, 2020

Without the FLA, I can't be certain of how this is supposed to work, but shouldn't you check the currentLabel each time you click instead of just once before?

 

 

var _this = this;
_this.CMD.on('click', function(){
var contenance = _this.FLAC.currentLabel
var num1 = _this.GAUCHE.currentLabel
var num2 = _this.DROITE.currentLabel
window.open('https://website.com/produit/'+ contenance +'ml/?attribute_senteur-n1='+ num1 +'&attribute_senteur-n2='+ num2, '_blank');
})

 

Votes

Translate

Translate
Community Expert ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Hi.

 

The string concatenation that forms the URL seems to be correct.

 

Have you checked if the values you're getting from the labels are correct?

Votes

Translate

Translate

Report

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 ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

The link works but the values do not change whatever the image displayed in FLAC, GAUCHE and DROITE...

Is there something missing to update each of the "currentLabel" with each click?

Thank you !!

Votes

Translate

Translate

Report

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 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Without the FLA, I can't be certain of how this is supposed to work, but shouldn't you check the currentLabel each time you click instead of just once before?

 

 

var _this = this;
_this.CMD.on('click', function(){
var contenance = _this.FLAC.currentLabel
var num1 = _this.GAUCHE.currentLabel
var num2 = _this.DROITE.currentLabel
window.open('https://website.com/produit/'+ contenance +'ml/?attribute_senteur-n1='+ num1 +'&attribute_senteur-n2='+ num2, '_blank');
})

 

Votes

Translate

Translate

Report

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 ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

Indeed, it works!
Thank you very much, you save my day!
😉

Votes

Translate

Translate

Report

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 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

LATEST
Great! Glad I could help!

Votes

Translate

Translate

Report

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