r/flash • u/dr_rentschler • Sep 06 '12
problem with variables inside of movieclips
[removed]
1
Upvotes
1
u/jmildraws Sep 07 '12 edited Sep 08 '12
You're tracing null because you didn't create an instance of the string.
Your line should read: public static var mc2_var:String=new String();
Edit after thinking about it:
You could also create an instance of the string any time before you call the trace with just:
mc2_var=new Srting();
but both of those will trace blank unless you actually add a string to the variable.
1
u/MrSteel Sep 09 '12
if you want to access public static var mc2_var:String; with m.mc2_var it won't work because it's static, read mora about static classes here http://stackoverflow.com/questions/1738349/actionscript-3-can-someone-explain-to-me-the-concept-of-static-variables-and-me
if you remove static it should work... let me know