Can't "save" an image for a state

So object shows empty

I have an object that I want to use different images based on some condition. The problem is that DesktopX doesn't save images with the object if they don't belong to one of the states and I can't use the default states because they don't fit what I need. What ends up happening is that when the object needs to switch an image it becomes empty because it can't find an image and I have to manually show it where it is.

I tried creating custom states in the OnScriptEnter function by doing something like this:
Object.State = "stateA"
Object.States("StateA").Picture = imageA
Object.State = "stateB"
Object.States("StateB").Picture = imageB

And then when I need to change the image I do something like:
If something Then
Object.State = "stateA"
Object.Picture = imageA
Else
Object.State = "stateB"
Object.Picture = imageB
End If

Now, that just doesn't look right to me, but I've no idea what to do here

Anyway, it didn't work so I'd appreciate any help.
4,354 views 1 replies
Reply #1 Top
You can add your images as custom files by going into the 'Properties' dialog of the object then selecting the 'Summary' tab and clicking the 'Custom Files' button. Another dialog window will pop up and from there you can add any image you want.

As for your script: if you predefine the state image of the object why would you need to redefine the image again on state change? If you just need the image to change depending on some external variable (ie: media player stops, etc.) omit the code line Object.State = ... as it's not necessary unless another script needs to know what state it is.

I hope this is understandable and that it helps.