Page 1 of 1

Change image on mouseOver rectangle

Posted: Wed Nov 06, 2013 9:44 pm
by calmrr3
Hello,

I have a list of images numbered from 1-50 (1.jpg-50.jpg).
They form a 360 degree panorma.
When the card is opened the middle image (25.jpg) will be displayed.

Image

On the left of the image there is a rectangle and there is also one on the right hand side of the image.
I am trying to make it so that when the mouse is within the left hand rectangle the image displayed will change with the filename descending (25.jpg,24.jpg,23.jpg...1.jpg, then restart at 50.jpg,49.jpg etc) in order to create a stop-motion style effect of panning left.

Then I will repeat the with the right hand rectangle in order to give the effect of panning right.

I've had a go at guessing what the script applied to the left hand rectangle may look like (I've made some of it up as I don't know if there is a livecode equivalent of what I am trying to do).

Code: Select all

  on mouseOver
       send "showNext" to me in 0.2 seconds
       put the result into sMessageID
    end mouseOver

on mouseLeave
    if "showNext" is among the items of the pendingMessages then
       cancel sMessageID
    end if
end mouseLeave

    on showNext
        go to current image -1  
    end showNext
Thanks :)

Re: Change image on mouseOver rectangle

Posted: Wed Nov 06, 2013 10:05 pm
by dunbarx
I would use the "mouseMove" message, tracking the horizontal component of the mouseLoc. This can be scaled to access the 25 images, either on the low or high side of your baseline, and display that image in the center. Do you see? If the h-component is halfway through the left rectangle, this would scale to about the 12th image.

Craig