# Global Variables and Text Boxes

**URL:** https://forum.kirupa.com/t/global-variables-and-text-boxes/49759
**Category:** flash
**Created:** [April 26, 2004, 3:20pm UTC](https://forum.kirupa.com/t/global-variables-and-text-boxes/49759 "2004-04-26T15:20:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chayes77](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@chayes77](https://forum.kirupa.com/u/chayes77)
#### Post date: [April 26, 2004, 3:20pm UTC](https://forum.kirupa.com/t/global-variables-and-text-boxes/49759/1 "2004-04-26T15:20:46Z")

</div>

I don’t see it documented anywhere, nor have I heard it mentioned but it  
appears that Flash has a problem displaying \_global variable values in  
dynamic text boxes when setting the var property in the property inspector.

I am not able to display the variable successfully using just the var  
property, but I can dynamically set it via ActionScript. Seems odd to me  
that it doesn’t work. It works as expected with timeline variables.

Also…can someone explain why you DON’T type \_global variables? In fact,  
you’ll get errors if you try to initialize a global variable as such:

var \_global.gPage:String = “Pong”;

I’ve seen it documented that it will give you an error or that it’s  
incorrect syntax for \_global variables, but not why they are defined  
differently.

I’m using Flash MX 2004 Pro using Actionscript 2 (haven’t tested others)

Thanks,

Chris Hayes  
Web & Multimedia Designer  
[www.SSElearn.com](http://www.SSElearn.com)
