# Globals in as3

**URL:** <https://forum.kirupa.com/t/globals-in-as3/285638>\
**Category:** flash\
**Created:** [April 3, 2009, 10:11am UTC](https://forum.kirupa.com/t/globals-in-as3/285638 "2009-04-03T10:11:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RossKidd](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@RossKidd](https://forum.kirupa.com/u/RossKidd)\
**Post date:** [April 3, 2009, 10:11am UTC](https://forum.kirupa.com/t/globals-in-as3/285638/1 "2009-04-03T10:11:34Z")

</div>

Hi,

I have a flash site which is going to have a concertina menu and various other features. I need to know if the menu is active or inactive so am using a Global variables class to do this. I have a couple of questions.

(i) is this a legitimate technique, to have globals to store and share the state of the menu between all my classes(active or inactive)

(ii) What should (if anything) the globals class extend?

Also I create my global like this

package

{

public class MyGlobal

{

public var test:String;

}

}

And in my main timeline try and set it with

import MyGlobal;  
test =“hello”;

But get 1120: Access of undefined property test.

Thanks.
