Skins by knatzz
Published on September 5, 2004 By knatzz In WinCustomize Talk
Hi,
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
Comments
on Sep 06, 2004
you could try adding the following code at the top of your script:

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.
on Sep 06, 2004
Thanks alot Tiggz, I really appreciate it!
I'm gonna try that now!
on Sep 06, 2004
I can't get it to work that way

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
on Sep 06, 2004
to change the hue on all states of an object use the following code:

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]