Help with a script again.....
Tuesday, September 26, 2006 by Murex | Discussion: DesktopX
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
Reply #2 Tuesday, September 26, 2006 2:40 PM

Reply #3 Tuesday, September 26, 2006 3:18 PM
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
desktopx.Object("ROLLOBJ").StatePreempt = desktopx.Object("ROLLOBJ").PersistStorage("State")
End Sub
'****************************************************************************************************************
Sub Object_OnLButtonDown(x,y) 'When this object is clicked.
If Lock Then Exit Sub
If desktopx.Object("ROLLOBJ").PersistStorage("State") = "Up" Then
Rollup()
Else
Rolldown() 'Call the Rolldown Sub.
End If
End Sub
'****************************************************************************************************************
Sub Rollup()
Lock = True
desktopx.Object("ROLLOBJ").StatePreempt = "Down" 'Change the image state to 'down'
desktopx.Object("ROLLOBJ").PersistStorage("State") = "Down"
Do While Object.Parent.Object.Height > ulRolledUpSize
desktopx.Object("ROLLOBJ").Parent.Object.Height = desktopx.Object("ROLLOBJ").Parent.Object.Height - ((ulExpandedSize - ulRolledUpSize) / ulSpeed)
desktopx.Object("ROLLOBJ").Sleep 10 'Pause for a bit between frames.
Loop
desktopx.Object("ROLLOBJ").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"
End Sub
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Tuesday, September 26, 2006 12:19 PM
desktopx.object("name").
where "name" is the name of the object you want to control.
I would have ALL of the above code in the button, not the rollup/down object.
Assuming the ROLLUP objects' name is "ROLLOBJ"
It would change like this: (im not editing it all, but this should help)
Sub Object_OnScriptEnter
desktopx.Object("ROLLOBJ").StatePreempt = desktopx.Object("ROLLOBJ").PersistStorage("State")
End Sub
'****************************************************************************************************************
Sub Object_OnLButtonDown(x,y) 'When this object is clicked.
If Lock Then Exit Sub
If desktopx.Object("ROLLOBJ").PersistStorage("State") = "Up" Then
Rollup()
Else
Rolldown() 'Call the Rolldown Sub.
End If
End Sub
(i like indented IF's so i can see them closed)
'****************************************************************************************************************
Sub Rollup()
Lock = True
desktopx.Object("ROLLOBJ").StatePreempt = "Down" 'Change the image state to 'down'
desktopx.Object("ROLLOBJ").PersistStorage("State") = "Down"
Do While Object.Parent.Object.Height > ulRolledUpSize
desktopx.Object("ROLLOBJ").Parent.Object.Height = desktopx.Object("ROLLOBJ").Parent.Object.Height - ((ulExpandedSize - ulRolledUpSize) / ulSpeed)
desktopx.Object("ROLLOBJ").Sleep 10 'Pause for a bit between frames.
Loop
desktopx.Object("ROLLOBJ").Parent.Object.Height = ulRolledUpSize 'Make sure the Final size is Correct.
Lock = False
End Sub
Hope this makes some sense.
If not, email me the objects and ill make it work.
---- time for another tutorial? ----