Netjera wrote:Can anyone tell me what's wrong with this please? It's giving me an "Expected end of line" error.
Dim Upper = 0
Action.CreateTimedEvent .1, "Hotspot(1).top = Upper + 1", TRUE
Those are the only two lines of code. What I'm trying to do is move the hotspot by 1 on the Y access every .1 second. I have no idea if this will work or not, because I might be misunderstanding what the "Top" attribute of the hotspot represents.
Is there a complete hotspot reference anywhere, which lists all the hotspot attributes and describes what they do? Thanks!
You should definitely try the plugin, it should save you a lot of time.
Still, if you wish to know why your code didn't work as expected, it's probably because it has some math problems
first of all, the code you've written continuously asigns the value 1 to the hotspot's top property. What you really wanted was probably to increase it every time. To do that it should be looking like this:
Dim Upper = 0
Hotspot(1).top = Hotspot(1).top+Upper : Upper = Upper + 1
still, this wouldn't do the trick, since the top property works with twips and you probably wanted to measure in pixels. So in order to convert pixels to twips you need to multiply by the number of the twips each pixel has, which normally equals 15
So finally the right code is:
CreateTimedEvent 0.1, "Hotspot(1).top = Hotspot(1).top+Upper : Upper = Upper + 1",true