Ikonz101 wrote:I set the variable MVI in a merged frame as text not hotspot. The merged frame contains the score, time countdown, and how much score you need to obtain to go to the next level. Under the item that needs to be collected (hotspot) I put the code:
Text(7) = "Found" (Text 7 is MVI variable)
Under Frame Properties I put:
i = Action.GetMergedTextIndex
Text(7).Caption= "Rare Lamp" (This is what you see when the frame loads and when you find the item it changes to "Found")
But when you click to go to the next frame it changes back to "Rare Lamp" and doesn't stay as "Found". I know I am putting the code in the wrong spot somewhere. I made it this way so I can easily change the Most Valuable Item. So I made MVI variable as text and not a hotspot. All I want to do is change the text and keep it as "Found" when the item is found. And when you finish the level and go to the next level I can change the MVI variable to another item for example "Rare Stamp" or something else.
Thank You
Ikonz101
Text(7) isn't a variable. It's a text object.
You should set and maintain a separate variable for controlling the status of this text object or just check the value that the text object contains.
If you enter the frame with text(7).caption = "Rare Lamp" then every time you enter that frame it will be set to this text.
Since it appears you want to display "Found", here is what you need to do:
- Code: Select all
If text(7).caption <> "Found" then
text(7).caption = "Rare Lamp"
End If
This code should replace where you put the text(7).caption = "Rare Lamp" in the frame properties. Basically, you're checking if the caption has been set to Found. If it hasn't, then you display "Rare Lamp".
Hope this helps.