Any way I can set a hotspot to hide and show a static inventory? This is a part of a game toolbar that I will be merging with almost all the pages using Runtime Frames Merging.
In the project inventory settings, I have "Use drop-down inventory instead of static" unchecked (that is, inventory is set to static)
I have a script set for that same hotspot's VBScript code.
Below is the current code I am attempting to use, and the error message I'm getting.
"inven" is a global integer variable I set up, and the hotspot is set to invert the variable every time it is clicked.
Sub HideInventory
If inven = 0 then InventoryCanvasObject.visible=false
InventoryBackgroundObject.visible=false
For Each x in inventoryobject
x.visible=false
Next
End Sub
Sub ShowInventory
If inven = 1 then InventoryCanvasObject.visible=true
InventoryBackgroundObject.visible=true
For Each x in inventoryobject
x.visible=false
Next
End Sub
Error executing script.
The scripting message returned the following message.
Syntax error
I click "OK" and get this...
Error executing script.
The scripting message returned the following message.
Object doesn't support this property or method.
I know there is some problem with my own code, but I don't know what it is. Can anyone help?
-----------
EDIT: Ha ha ha!! I figured this one out, too. Boy, I tell you, I keep answering my own questions...
This is what the respective codes should read:
- Code: Select all
InventoryCanvasObject.visible=false
InventoryBackgroundObject.visible=false
For Each x in inventoryobject
x.visible=false
Next
- Code: Select all
InventoryBackgroundObject.visible=true
For Each x in inventoryobject
x.visible=true
Next
Do NOT use the "Sub" or "End Sub", and make sure there are no spaces before each line.[/code]