-
From a subroutine mc, I’ve set variables for games that live in the main movie as follows:
game1 = “/dog”
game2 = “/cat”
game3 = “/bird”
Can I then target those games from the same subroutines mc as follows ?
Set Property (“game1”,_x) = 100
Set Property (“game2”,_x) = 200
Set Property (“game3”,_x) = 300
I can’t seem to get it to work.
Can I alternatively use the following code?:
gameCount = 1
Set Property (“game” & gameCount,_x) = 100
gameCount = gameCount + 1
Set Property (“game” & gameCount,_x) = 200
gameCount = gameCount + 1
Set Property (“game” & gameCount,_x) = 300
Or should it be?:
gameCount = 1
Set Property (Eval (“game” & gameCount),_x) = 100
gameCount = gameCount + 1
Set Property (Eval (“game” & gameCount),_x) = 200
gameCount = gameCount + 1
Set Property (Eval (“game” & gameCount),_x) = 300
(I will be abbreviating this in a loop, but for now the problem is the targeting).
Thanks for any help.
DJ Rush
-
the correct syntax is:
Set Property (game1,_x) = 100
Set Property (game2,_x) = 200
Set Property (game3,_x) = 300
game1,game2 and game3 are variables therefore if you want to get there values they need to be expressions not strings!
if you need more let me know!
-
Guy,
Thanks for your help.
I had mistakenly told you that my code was:
game1 = "/dog"
etc.
In fact, it was:
"game1" = "/dog"
That is why I needed to refer to it as "game" and gameCount.
Anyway, I got it working using an Eval statement as follows:
Set Property ("Eval("game" & gameCount". X Position) = 100
The point is that I realise that I can use a variable in the target of a Set Property.
DJ Rush