animFlipState
An 'flip' style animation for an object. Provide the name of one of the objects states to the funtion and the object will 'flip' from it's current state image to it's new state image.
Sub animStateFlip(objName,newStateName)
If DesktopX.IsObject(objName) = False then Exit Sub
Set obj = DesktopX.Object(objName)
frames = 5
objLeftOriginal = obj.Left
objWidthOriginal = obj.Width
widthStep = objWidthOriginal/frames
For a = 1 to frames
newWidth = obj.Width - widthStep
obj.Width = newWidth
newLeft = obj.Left + widthStep/2
obj.Left = newLeft
Next
obj.Width = 0
obj.State = newStateName
For a = 1 to frames
newWidth = obj.Width + widthStep
obj.Width = newWidth
newLeft = obj.Left - widthStep/2
obj.Left = newLeft
Next
obj.Width = objWidthOriginal
obj.State = objLeftOriginal
End Sub