Forum Discussion
Storyline360, Animation and GSAP ( Greensock )
So this is the solution you want ;-)
https://360.articulate.com/review/content/07c6804a-d8cd-4d8a-add0-a8535d3bcd24/review
If you can add a acc-name to the textfields you want the text from... then this is the code to use.var player = GetPlayer();var myElement = document.querySelector("[data-acc-text='selectMe']");var someStr = gsap.getProperty(myElement, "textContent");player.SetVar("debugStr",someStr);console.log("correct textfield is: "+someStr);
If however you cannot add an acc-name to that particular textfield... go for the solution on the last slide...'eightSlide'. I add a textfield with the text 'dummy' in it ( you can make it invisible ) and in the code check for that. Like this...var player = GetPlayer();const collection = document.getElementsByClassName("vector-text-item");for(var i = 0; i < collection.length;i++){ var someStr = gsap.getProperty(collection[i], "textContent"); if(someStr=="dummy"){console.log("textfield above the one we need is: "+i+" and text is "+someStr);var layerNum = i-1; var correctStr = gsap.getProperty(collection[layerNum], "textContent"); console.log("text is: "+correctStr); } else{ }}
For your ease added the .story
Related Content
- 9 months ago
- 11 months ago
- 8 months ago
- 7 months ago