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…
trace(numb);
(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.
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.
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?
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…