views:

141

answers:

1

how i suppose to do to read global variable in actionscript 2.0?

i've declared _global.MyVar="dummyContent";

may i write MyVar="anotherContent";? or it should _global.MyVar="anotherContent"?

A: 

The latter is correct, unless you're in the same scope as the global was declared I believe, so:

Diff scope: _root > nested mc > nested mc > nested mc > nested mc: _global.MyVar = "anotherContent" ;

Same scope: _root: MyVar = "anotherContent" ;

Though for consistency, perhaps use _global.MyVar = "anotherContent", so you always know you're setting a global var.

d

Danjah
wow, great explaination, thanks ^^
Rizki
no worries, feel free to make this Q answered, i've noticed people dont always, ive been trying to be a bigger part of the community here (without having to forum-slave myself), and some privs arent available til i get 10 and then 15 rep points it seems.
Danjah
Yes, Rikzi, you might like to press the big check-mark button, to assign this as the accepted answer for your question.
fenomas

related questions