Po Smedley's toggle question

Tuesday, June 20, 2006 by sViz | Discussion: DesktopX

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)
PoSmedley
Reply #1 Wednesday, June 21, 2006 7:07 AM
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?
ZubaZ
Reply #2 Wednesday, June 21, 2006 8:14 AM
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.  

ZubaZ
Reply #3 Wednesday, June 21, 2006 8:14 AM

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:  

PoSmedley
Reply #4 Wednesday, June 21, 2006 6:43 PM
Thanks Zubaz. I just got in, so I will try it tonight and let u know.
PoSmedley
Reply #5 Wednesday, June 21, 2006 8:20 PM
..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.
ZubaZ
Reply #6 Wednesday, June 21, 2006 9:15 PM
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

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!



web-wc01