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');
})
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?
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 !!
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');
})
Copy link to clipboard
Copied
Indeed, it works!
Thank you very much, you save my day!
😉
Copy link to clipboard
Copied