Images and javascript

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