I moved the code to the MC where the variable resides so I would not have this problem. The only problem now is that the loop keeps returning 0 for resident1
Before it was only returning a 6, which at least made me think that the loop was running, but after changing stuff it only returns a 0 so I think I broke it completely hehe. Man I wish I had some professional help with this, it is driving me crazy.
Is there a good tutorial for loops anywhere?
They seem simple enough, but I always have problems with them.
OK, I think I have it all figured out except the thing I originally posted about.
I am trying to set a variable in one MC from another MC. The way I have it is this:
Set Variable: /code:"ballpos" & resident2 = firsttarget
This does not work. It gives me an error when I click OK. If it were simply:
Set Variable: /code:ballpos2 or 3 or whatever it would work, but adding that variable (resident2) to the variable name screws it up. How do I write this?
I have been having enormous difficulties figuring out how to pass variables from MC to MC and different parts of the movie. There doesnt seem to be any type of global variable, which is a shame, but since you can supposedly reference any variable from anywhere just by including its path, all seemed well, until it didnt seem to work heh.
Here is the one specific problem I am having right now (and most of the problems I have encountered seem to be fixed simply by getting the syntax correct). Anyway, in one movie clip, I have a variable called 'ballpos1', 'ballpos2' etc... up to 'ballpos6'. In another movie clip, I have a loop that is trying to reference those variables using "ballpos" & num (where num is my loop variable). using this I would expect my loop to count through all my ballpos variables. the exact code is like this:
Loop While (num <= 6)
If ("ballpos" & num = btargets)
Set Variable: "resident1" = num
Set Variable: "num" = num + 1
That is how I have it right now. Since the ballpos variables are in another movie clip, I would suppose I would need to reference it somehow by saying:
/:"ballpos" & num
However this doesnt work.
Anyone know how to reference this variable??? In addidtion (hehe) for some reason "resident1" always ends up as 6, instead of catching when ballpos is equal to btargets and setting resident1 to that number. get it? Any help would be greatly appreciated and you can e-mail me at: