I'm just starting working with AS but I'm a pretty experienced programmer. AS syntax and Adobe Flash are often driving me crazy but usually after hours of days of struggling I get what I want. Not this time though.
In the game I'm making I have a global variable that counts your steps. I made a dynamic text field and as its variable I typed:
_global.mile
And now the fun part.
It's not refreshing. When I leave the frame and get back to it, it's updated, but it's not being updated all the time.
To test this, I put this code in onEnterFrame function:
ActionScript Code:
mile=_global.mile
_root.mile=mile
When I type in 'mile' in the 'variable' field of the dynamic text,
it works. I.e. it's being updated all the time, as the character is moving.
'_root.mile' also works.
'_global.mile' doesn't.
Of course I may assign all the global variables to local ones when I need to, but I'd still like to know why it's not working.
I've searched and searched and never found any info that dynamic text field shouldn't have global variables... Any ideas, please?