I’m scrolling a movie clip from about.swf
Now when about is loaded into my index.swf the scroller in about doesn’t work. I have a feeling I know the problem, because I am using _global. Now I used this because when I started using FMX 2004 the actionscript I previously used didn’t work anymore. Not too sure why. But anyway here is my code.
Using _global declares a global var which is accessible from anywhere in the movie using the syntax _global.
Using unqualified declaration (e.g. cat=“tabby”) will declare the variable on the current timeline - _root, _level3.catHolder, etc and you will need to address it using either a relative or absolute path.
hey thanks for your reply but you confused the f out of me right here: could you please explain more? sry i have been working very hard lately and it seems that my mind isn’t working the way it should be
Using unqualified declaration (e.g. cat=“tabby”) will declare the variable on the current timeline - _root, _level3.catHolder, etc and you will need to address it using either a relative or absolute path.
I built a MC controlled by two buttons to test your code and couldn’t see a need to use _global, but maybe I’m missing something.
As regards variable declaration:
If you declare a variable (or object) on a timeline without scoping it - e.g. howMany=78; then that variable is scoped to the timeline where it is declared - be that on the _root, nested within a MC instance, or on a particular _level.
If you wish to target that variable (or object) than you need to know the correct target path e.g. _root, _parent.MC1.MC2, _level3.MC1.
On the other hand if you declare a variable using _global then that variable is scoped to _global and the only valid target path to it from anywhere in any movie clip (no matter how deeply nested) is _global.