Hi, im trying to use the global variable declaration. I searched through some of the other threads and found some asking the same things, but doing what they say i still couldn’t get it to work. Up to know i’ve been using the x coordinate of a movie clip to pass variables between different movies, and i thought it was time to learn properly! Just to get it to work, im trying a flash file with two movies in the root. one movie defines a glabal variable on load;
_global.numb = 6;
and then im trying to just get the other to trace it on enter frame, so the code attatched to the other movie (on enterframe) is…
(and i tried trace(_global.numb) as well, but i was under the impression that you only had to define it as being a property once.). All that happens when i run the movie is nothing is traced.
Im not too hot at flash, so i might be doing something really stupid, but i’d really appreciate if anyone could help. Thanks very much.
woah! that smiley is wkd smart!
_global has been introdiced with Flash MX :beam:
Arg… I’m late…
Yup… global can be used only in FMX…
If you were to do it in F5, you can just create bunch of variables in the main timeline and use it like that…
_root.numb = 6;
dudes! thanks so much. The best response possible - its not that you can’t do it, its just that it cant be done!
thanksq very much - everythings fallen into place. :beam:
The closest thing to this in Flash 5 would be to put the references inside objects that you can access anywhere, for instance a constructor. The Object class constructor, for instance.
Yes… Object… Right… That might be closer than using _root… But then, what is object??? Stop confusing me… :beam:
Well, it’s supposed to be the Object class constructor. I’ve never actually tried this, but it should work :sigh: maybe…
It can be any class, really. It’s just that Object is the most basic one.
Yes… That should work perfectly… I remember that I had an object which contains all the viable variables that I was dealing with for the project… :cowboy:
oooh, thanks, i’ll have to try that. So whats the deal with the _root.varname then? is that ok? I’ve tried using that and it seemed to work. Where/would that break down?
■■■■! these are some good smileys!
Oh… That _root.varName should work perfectly…
I was just trying to tell you the easy way to do it and ilyaslamasse was trying to tell you the most similar thing in F5 to _global since _global didn’t exist in F5…
cool, i see. thanks very much for your help