Forum Discussion
Storyline360, Animation and GSAP ( Greensock )
i basically have a function that gets everything from Storyline on start.getElementsFromStoryline( );
The function gets several preset values that cannot be get by selectors. Most of them are always the same in Storyline. Shapes, buttons, images... As all images are treated as SVG in Storyline and thus have a 'path' element all of them are put in a shapesCollection ( is a WebCollection ).
That i loop get the 'data-text-attribute' and detect the type, text or image.. and treat them differently.
var elText = el.getAttribute('data-acc-text');
When i detect its a image, i get the source's name and can replace it if i want.
if(elText.indexOf(".png")!=-1 || elText.indexOf(".jpg")!=-1 )// if the source is png or jpg...
{
imagesArray.push(i);
console.log("imagesArray: "+i+" / url: "+el.getElementsByTagName('image')[0].getAttribute('xlink:href'));
}
As said its tough...but it works. In my projects i have all my assets... images, shapes, SVG, paths, texts, buttons and UI-elements available to change/script with Javascript.
Making this function work properly cost my about 180 manhours work of my spare time so you know you have a tough road ahead trying this.
- zhongyuwu4 years agoCommunity Member
Thank you very much for the help! Math! I was able to change a single image for now with only the first slide. Going on a tough road is painful, but it is one of the best ways to learn. In this era, everyone wants more automation in the work to make it easier to implement. Nothing feels better to get the code working. Again thank you for your guidance and it really helps me a lot.
- PhilMayor4 years agoSuper Hero
:-)
- MathNotermans-94 years agoCommunity Member
Great zhongyu wu.
Do make a habit of commenting code properly because every update Articulate makes on Storyline...you have a chance your code will not work anymore.