Images and javascript
Mar 05, 2021
I have been searching for awhile on this subject, and it seems to be one that does not exist.
Has anyone figured out a way to get the imageID of objects on the current screen to pass to Javascript code? I know we can get/set variables from the current course, which I use frequently. I am looking to use JS to manipulate images without having to revert to creating a state or layer for each degree I wish to show.
For example: I have an arrow pointing up, upon sliding a bar, I wish to have the arrow rotate as the slider is moved, up to 360. So am I wrong in thinking I would need 359 new states and then use change state in 359 triggers to show the rotation? I'm thinking a 5 line JS script would be much faster.
Or if I'm totally off base or this is pie-in-the-sky wishing :)
Thanks!
5 Replies
Yes all that is possibly. Check for my posts on Gsap and javascript. Do share a sample and i can help
With the ability we have to customize dials, including the choice for pointer fills, I have to wonder if it wouldn't be a lot easier to use a dial, that uses the same variable as the slider.
Well, after waking up this morning, i figured this out in about 5 mins with the convert dial and slider options. I just had a bunch of old javascript I used with lectora and thought it would drop in, not there yet I guess. thanks.
The javascript code from Lectora probably works fine. I work(ed) with Lectora too a lot in the past. Main difference is with selecting elements on the screen in Storyline.
Yeah, that was what I had planned on, then realized all I needed was the convert to dial option. I'll work on the JS later if I need to to figure out getting the elementsids from SL. Thanks!