Highlighted

A dynamic link based on frameLabel ?

New Here ,
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');
});

 

 

 

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');
})

 

Topics

Code, How to, Timeline

Views

452

Likes

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

A dynamic link based on frameLabel ?

New Here ,
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');
});

 

 

 

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');
})

 

Topics

Code, How to, Timeline

Views

453

Likes

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
Adobe Community Professional ,
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?

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
New Here ,
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 !!

Likes

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
Reply
Loading...
Explorer ,
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');
})

 

Likes

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
Reply
Loading...
New Here ,
Jun 02, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Explorer ,
Jun 02, 2020

Copy link to clipboard

Copied

Great! Glad I could help!

Likes

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
Reply
Loading...