This is a script that I have used on some of my themes It works fairly good but one draw back is that the button to roll or unroll has to be on the roll up object. I would like to have the button located on another object I have tried to modify the script my self with out any luck. I was wonder if any one can help me with this.. Also was wondering if the text can be made to fade in and out as the menu rolls up and down.. I know that this can be done, Question is can it be done in a way that it would be easy for other people to edit it so that they can add or subtract text from it... any help with this would be greatly appreciated
Dim ulRolledUpSize
Dim ulExpandedSize
Dim ulSpeed
Dim Lock
ulRolledUpSize = 42 'This sets the size you want your parent object to rollup to.
ulExpandedSize = 234 'This sets default the size you want your parent object to rolled down
ulSpeed = 30 'This sets the # of frames you want it to take to role up or down
Sub Object_OnScriptEnter
Object.StatePreempt = Object.PersistStorage("State")
End Sub
'****************************************************************************************************************
Sub Object_OnLButtonDown(x,y) 'When this object is clicked.
If Lock Then Exit Sub
If Object.PersistStorage("State") = "Up" Then 'Check to see if we are Rolled Down.
Rollup() 'If it is, Call the Rollup sub.
Else 'If Not
Rolldown() 'Call the Rolldown Sub.
End If
End Sub
'****************************************************************************************************************
Sub Rollup()
Lock = True
'ulExpandedSize = Object.Parent.Object.Height 'Set the current size as the Expanded size
Object.StatePreempt = "Down" 'Change the image state to 'down'
Object.PersistStorage("State") = "Down"
Do While Object.Parent.Object.Height > ulRolledUpSize 'Size the image down, in # of Frames set in ulSpeed
Object.Parent.Object.Height = Object.Parent.Object.Height - ((ulExpandedSize - ulRolledUpSize) / ulSpeed)
Object.Sleep 10 'Pause for a bit between frames.
Loop
Object.Parent.Object.Height = ulRolledUpSize 'Make sure the Final size is Correct.
Lock = False
End Sub
'****************************************************************************************************************
Sub Rolldown()
If Lock Then Exit Sub
Lock = True
Object.StatePreempt = "Up" 'Change the image state to 'up'
Object.PersistStorage("State") = "Up"
Do While Object.Parent.Object.Height < ulExpandedSize 'Size the image up, in # of Frames set in ulSpeed
Object.Parent.Object.Height = Object.Parent.Object.Height + ((ulExpandedSize - ulRolledUpSize) / ulSpeed)
Object.Sleep 10 'Pause for a bit between frames.
Loop
Object.Parent.Object.Height = ulExpandedSize 'Make sure the Final size is Correct.
Lock = False
End Sub