Po Smedley's toggle question

This is the 3rd time I'm attempting to post this and hopefully there will be spaces where they are supposed to be

Try this:

1.Set Object B visible to "NO"
2.Insert script below in object A
3.Insert script below in object B but change

desktopx.Object("B") to desktopx.Object("A")



If object.Visible= True Then
desktopx.Object("B").visible= False
ElseIf object.Visible= False Then
desktopx.Object("B").visible= True
End If

Sub Object_OnLbuttonUp(x,y,dragged)
If Not dragged Then

desktopx.Object("B").visible= True
object.visible = False

End If
End Sub


Hope this helps.

EDIT: You can also use messages.

1. Create a 'mouse up' state for object A
2. In the 'mouse up' state add a message to 'hide' object A and 'show' object B.
3. Do the same for object B (i.e. hide B and show A)
2,064 views 6 replies
Reply #1 Top
Thanks. I won't get to try this until this afternoon, but I will try it. Question.... I don't understand the use of mesages...specifically how to write the message. 'hide' object A and 'show' object B. is that what I write exactly?
Reply #2 Top
Dude . . . forum did not like my image links to the photo album [going through SDC].
Apologies for the lack of line breacks and extra clicking to see the photos.

Poor forums.  

Reply #3 Top

Wow. Almost nothing in the Dev guide. Here are two objects A and B. I grouped them. Here is Objcet A states tab: Now we add a Mouse down state and add a message to send a Hide state to object B So we get this: Add a state to object B called Hide and set that state to do something (I had it change color) And there you have it:  

Reply #4 Top
Thanks Zubaz. I just got in, so I will try it tonight and let u know.
Reply #5 Top
..Okay! What I had to do was a small adjustment to what you layed out. When I used 'mouse down', it only made the other Obj go away until I lifted the mouse. Then it was back. However, by changing the 'mouse' down' to 'command execute' on each, I achieved what I was looking for. I had a feeling it would be that, and the message...but I had never worked with messages and thought it was something else you had to script. Thanks Zubaz. Now..one other thing and I think I have it licked. I don't want either to appear when you first load the desktop, but both do. I have a seperate toggle to open the main one. Do I need to script this. I think I may actually know how, since it was something I saw in a radio script I took apart.
Reply #6 Top
Glad I could help Po'.
What happens when both objects are not set as Visible on the Relations tab? Will your toggle work then?
I once had an object that I wanted to show on the screen on load then fade out after three seconds or so. Then be accesible through the system tray.

If you know any scripting like that+, I'd love to see it.

Posted via WinCustomize Browser/Stardock Central