Sounds like you're on the right track with using rectangles (masks) for the pages. If you're talking about THIS timer for mouse over/away issues, it won't keep the parent object from playing the mouse away animation unless the animation is scripted.
I'd recommend scripting the animation, instead of using the presets in the animation tab. HERE is a tutorial by RomanDA which explains how that works.
Without knowing your actual setup, I'm gonna hafta take a stab in the dark on the script.
First, make sure your rectangles are all children of the animation object (go to Properties > Summary and make sure child = yes. )
Next, set the animation tab as instructed in the tutorial above (set frames and check 'Scripted'. You won't be needing more than one state, BTW, so get rid of any extras.)
Okay, here comes the script. I've combined the mouse away/over script with one for scripted animation on timer (see the links above) This should go in the ANIMATION object:
Code: vbscript
- Dim totalframes
- Dim animdir
- Dim animspeed
- totalframes = 19 '--total number of frames in your animation
- animspeed = 20 '--speed (ms) to play animation
- 'Called when the script is executed
- Sub Object_OnScriptEnter
- object.CurrentFrame = 1'--number of frame that should show on start up
- End Sub
- 'Called on mouse over object and children
- Sub Object_OnMouseEnterEx(Obj)
- object.KillTimer 1
- animdir = "forward"
- object.SetTimer 2,animspeed
- End Sub
- 'Called on mouse awaay from object and children
- Sub Object_OnMouseLeaveEx(Obj)
- object.SetTimer 1,100
- End Sub
- 'Timer delay
- Sub Object_OnTimer1
- animdir = "back"
- object.SetTimer 2,animspeed
- object.KillTimer 1
- End Sub
- 'Play Animation
- Sub Object_OnTimer2
- Select Case animdir
- Case "forward"
- If object.CurrentFrame < totalframes Then object.CurrentFrame = object.CurrentFrame + 1 Else object.KillTimer 2
- Case "back"
- If object.CurrentFrame > 1 Then object.CurrentFrame = object.CurrentFrame - 1 Else object.KillTimer 2
- End Select
- End Sub
- 'Called when L-click on object or its children
- Function Object_OnLButtonUpEx(obj, x, y, dragged)
- If dragged Then Exit Function
- Select Case obj.name
- 'List your clickable child objects here
- Case "rectangle1", "rectangle2", "rectangle3"
- animdir = "back"
- object.SetTimer 2,animspeed
- End Select
- End Function
Major points:
-OnScriptEnter, set the current frame to the one you want showing when the object is at rest.
-OnLButtonUpEx will play the animation backwards when you click on any of your rectangles. Just list the names of each of your rectangles as seen in the code.
-Adjust the 'totalframes' and 'animspeed' variables at the top as needed.
I put together an example dxpack HERE .
Hope this helps...someone. 