Image mouse over script required

Hi Guys hoping someone out there can help.

I'm in the process of designing my first desktop but I'm having a few issues with scripting a mouse over. I've managed to write a script that puts text up on a mouse over in a different location. What I currently have is a series of buttons that shortcut to several places. I also have a seperate image elsewhere on the desktop. What I'm after is a script to change the unrelated image with a new image when I mouse over the button!!

Please help as I'm going bald with frantic hair pulling trying to sort this.

Cheers in advance
KCologne
1,008 views 3 replies
Reply #1 Top
As usual there are a number of ways you could do this. I think the key thing you probably need to know is how to access objects' properties from another object's script. The particular syntax depends on the property being changed. If you want to change a base property of an object you can use DesktopX.Object("Name").Property. If you want to access a variable or a script defined function, you'll need to use DesktopX.ScriptObject("Name").Property.

But that may be more info than you need. One way to do this is to set up the separate image objects with different images for different states. Create an object and give it two custom states in the panels. Name the states "Default" and "MouseOverBtn1" for clarity, and assign each state the image you wish it to diplay when in that state. Give this object an Object ID, "My ImageObject"

Now, in your button object script you'll add these bits:
Sub Object_OnMouseEnter
DesktopX.Object("MyImageObject").State = "MouseOverBtn1"
End Sub

Sub Object_OnMouseLeave
DesktopX.Object("MyImageObject").State = "Default"
End Sub

And, of course, if you desire a different image to be shown when you mouse over a different button, you can create a third state in the image object, and use a similar script in the second button (change over state to "MouseOverBtn2" for example).

I hope that helps to get you started, and that it's not too late to save some of yuor hair!
Reply #2 Top
Note: if you are changing the properties of the object that host the script you can use: Object.State = "MouseOverBtn1"
Reply #3 Top
Thanx Guys. I've got it working and it looks good.

Cheers for your input. At least I still have enough hair for a comb-over!!