Published on September 14, 2006 By Murex In DesktopX
Looking for a script, That will show an icon on mouse over (A button) and hide the icon on mouse away.. I thought at one time I saw an object that would do this. If any one knows which object it was or knows where to find the script please let me know.. Thanks... I tried using the commands in desktopx to do this and it works fine, Until I tried to hide the object that the button an icon are on, Once you show the object again some of the other objects disappear or are in another location.. If any one knows of a fix I would really appreciate hearing from you...
Comments
on Sep 14, 2006
I don't really know whats happening in regards to objects moving or disappearing but... I do know about keeping certain objects hidden when not needed.. I usually do this with Text object used for tooltips.. see below for the script:

'This script is in the object you mouse over...
Sub Object_OnMouseEnter
Object.KillTimer 2
Object.SetTimer 1, 1
End Sub

Sub Object_OnTimer1
'Stops the timer once the Object has reached full opacity
If DesktopX.Object("YourHiddenObject").Opacity => 100 Then
Object.KillTimer 1
Else
'Fades in the Object
DesktopX.Object("YourHiddenObject").Opacity = DesktopX.Object("YourHiddenObject").Opacity + 1
End If
End Sub

Sub Object_OnMouseLeave
Object.KillTimer 1
Object.SetTimer 2,1
End Sub

Sub Object_OnTimer2
'Stops the timer once the Object has disappeared
If DesktopX.Object("YourHiddenObject").Opacity <= 0 Then
DesktopX.Object("YourHiddenObject").Visible = False
Object.KillTimer 1
Else
'Fades out the Object
DesktopX.Object("YourHiddenObject").Opacity = DesktopX.Object("YourHiddenObject").Opacity - 1
End If
End Sub

Don't forget to remove the Sub Object_OnScriptEnter routine and the Sub Object_OnScriptExit routines
on Sep 14, 2006
Wow Thanks for the fast response, And thank you for the script..I'm not sure what is wrong but the script seems to only work once. It will work again one time only. If I hit apply each time to any properties box. but will not work again unless I hit apply to any property box. Let me give a little more background to what I am trying to do. I have a menu object that has a pop out section that has a list of programs on it. there are 8 pop out menus. What I am trying to do is when I pass the mouse over a button it shows a corresponding Icon to show what menu you will get. This should work great but I can't seem to get it to work more then once.
Here is a copy of the script ... Looks to me like i entered it right
Thank you for your help...

'Called when the script is executed
Sub Object_OnMouseEnter
Object.KillTimer 2
Object.SetTimer 1, 1
End Sub

Sub Object_OnTimer1
'Stops the timer once the object has reached full opacity
If DesktopX.Object("icon Ie").Opacity => 100 Then
Object.KillTimer 1
Else
'Fades in the object
DesktopX.Object("icon Ie").Opacity = DesktopX.Object("icon Ie").Opacity +1

End If
End Sub

Sub Object_OnMouseLeave
Object.KillTimer 1
Object.SetTimer 2,1
End Sub

Sub Object_OnTimer2
'Stops the timer once the Object has disappeared
If DesktopX.Object("icon Ie").Opacity <= 0 Then
DesktopX.Object("icon Ie").Visible = False
Object.KillTimer 1
Else
'Fades out the Object
DesktopX.Object("icon Ie").Opacity = DesktopX.Object("icon Ie").Opacity - 1
End If
End Sub



on Sep 14, 2006
Ha Figured it out.. sorry about that I missed a bit to make the object Visible again...

Try this for Timer1

Sub Object_OnTimer1
'Stops the timer once the object has reached full opacity
If DesktopX.Object("icon Ie").Opacity => 1 Then
DesktopX.Object("icon Ie").Visible = True
ElseIf DesktopX.Object("icon Ie").Opacity => 100 Then
Object.KillTimer 1
Else
'Fades in the object
DesktopX.Object("icon Ie").Opacity = DesktopX.Object("icon Ie").Opacity +1
End If
End Sub

Try that
on Sep 14, 2006
The reason why I set the object visible is because.. Even with 0% Opacity (completley transparent) you can still click and activate the object making it hidden stops that happening
on Sep 14, 2006
Don't know what's wrong but now nothing will show....

copy of script did i do someting wrong that i cant see?


'Called when the script is executed
Sub Object_OnMouseEnter
Object.KillTimer 2
Object.SetTimer 1, 1
End Sub

Sub Object_OnTimer1
'Stops the timer once the object has reached full opacity
If DesktopX.Object("icon Ie").Opacity => 1 Then
DesktopX.Object("icon Ie").Visible = True
ElseIf DesktopX.Object("icon Ie").Opacity => 100 Then
Object.KillTimer 1
Else
'Fades in the object
DesktopX.Object("icon Ie").Opacity = DesktopX.Object("icon Ie").Opacity +1
End If
End Sub

Sub Object_OnMouseLeave
Object.KillTimer 1
Object.SetTimer 2,1
End Sub

Sub Object_OnTimer2
'Stops the timer once the Object has disappeared
If DesktopX.Object("icon Ie").Opacity <= 0 Then
DesktopX.Object("icon Ie").Visible = False
Object.KillTimer 1
Else
'Fades out the Object
DesktopX.Object("icon Ie").Opacity = DesktopX.Object("icon Ie").Opacity - 1
End If
End Sub



on Sep 15, 2006
Ok fixed it f0r sure this time..Honest;y I should test these things first lol

Sub Object_OnTimer1
'Stops the timer once the object has reached full opacity
DesktopX.Object("icon Ie").Visible = True
If DesktopX.Object("icon Ie").Opacity => 100 Then
Object.KillTimer 1
Else
'Fades in the object
DesktopX.Object("icon Ie").Opacity = DesktopX.Object("icon Ie").Opacity +1
End If
End Sub
on Sep 15, 2006
Just to make sure, I've uploaded a working version of the object for ya! Go here WWW Link
on Sep 15, 2006
Cyberium
The script works great. Thank you so much for taking the time and effort to help me out. I will give you full credit for your script when i release my theme..

Thanks again Murex
on Sep 15, 2006
Wooo Credit! Yeah! *Dances the Macarana*.. *ahem* Sorry.. Glad it works for you Can't wait to see the finished productÂ