Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 03-09-2012, 06:27 PM   #1
predi22
Member
 
predi22's Avatar
 
Join Date: Mar 2012
Location: Newtown, PA
Posts: 86
Default Dynamic Text not working with globals??

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?
predi22 is offline   Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:01 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.