global from a movieclip timeline
Most of my flash work lives in the first frame. But today, I'm working with a movieclip's timeline. I kept trying to change the value of a global variable, declared on the main timeline, from the last frame of my movieclip. No luck.
Then I referenced the variable as _root.variable. Eureka!
Comments
Was it originally declared as _global? That's odd. I have had some weird experiences with _global as well.
Posted by: bembino | January 22, 2003 12:41 PM
Yep, it's declared as a global in one of the first lines of code on the first frame on the main timeline.
It was really weird. I tried adding _root, just to see if anything would happen. In this case, I was thinking about how I could "escape" from a moveclip, like I would if it was a function.
Posted by: Kristin | January 22, 2003 12:51 PM
I had never had that problem, if a variable was declared as _global, I was always able to change it using _global.thatVariable = "anotherValue"; which means I can always access that by just thatVariable.
Posted by: Brajeshwar | July 27, 2003 03:23 PM