Need some DesktopX scripting Help
Sunday, September 5, 2004 by knatzz | Discussion: WinCustomize Talk
I'm trying to make a 2-state button object change it's hue and the hue of
several other objects in the theme. I don't know any programming whatsoever,
but I've been able to modify martin's script from the digital clock object
to the hue specifications I want. I've got it so that if you click the
object, it's hue will change. How can I get a single object to change the
hue of all the other objects (with the other objects not changing hue when they're clicked?
Any help is much appreciated.
Thanks
Reply #2 Monday, September 6, 2004 1:52 AM
I'm gonna try that now!
Reply #3 Monday, September 6, 2004 4:41 AM
Dim backoption
Sub Object_OnScriptEnter
backoption = 1
End Sub
Function Object_OnLButtonUp(x,y,dragged)
If dragged = False Then
backoption = backoption + 1
If backoption > 4 Then
backoption = 1
End If
Select Case backoption
Case 1
Object.State = "Black"
Object.Hue = 0
Case 2
Object.State = "Colored"
Object.Hue = 158
Case 3
Object.Hue = 120
Case 4
Object.Hue = 28
End Select
End If
End Function
That script allows for any single state object I've tried to adjust it's own hue accordingly when it's clicked, but I can't get it to work for 2-state objects (I have some buttons with mouseovers and only the mouseover state will change) I think I see what you mean about the list of objects, but I couldn't get that to work either.
Basically what I want to do is what you did with K-Display, except 1 button changes the colors of many objects, including itself. Thanks again for any help

Reply #4 Monday, September 6, 2004 7:00 AM
DesktopX.Object.("myobject").States("").Hue = 158
if you can't get the array deal to work then just change each objects' hue one by one rather than loop thru them
[Message Edited]
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 Monday, September 6, 2004 1:37 AM
Dim theobjects
theobjects=Array("obj1","obj2","obj3")
where obj1, obj2 etc are the names of the objects whose hue you wish to change
then later on in the script, just after where you're adjusting the hue of the object add the following code:
For x = 0 to UBound(theobjects)
desktopx.object(theobject(x)).hue=thehuevalue
Next
where thehuevalue is, you've guessed it, the value of the hue.
The For...Next loop will cycle thru all the object names in the array you defined at the top of the script and adjust each one's hue by turn.