# Why don't these Globals Work?

**URL:** https://forum.kirupa.com/t/why-dont-these-globals-work/100065
**Category:** Uncategorized
**Created:** [January 25, 2004, 7:30pm UTC](https://forum.kirupa.com/t/why-dont-these-globals-work/100065 "2004-01-25T19:30:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![santamonica](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@santamonica](https://forum.kirupa.com/u/santamonica)
#### Post date: [January 25, 2004, 7:30pm UTC](https://forum.kirupa.com/t/why-dont-these-globals-work/100065/1 "2004-01-25T19:30:25Z")

</div>

I’m having trouble communicating globals bewteen a main swf and a loaded swf.

Someone posted code that works for them, but not for me:

In global1.swf:

stop();  
\_global.testValue=5;  
\_global.theThing=“Hello there world!”;  
loadMovieNum(“global2.swf”, 10);

In global2.swf:

stop();  
trace(\_global.testValue);  
if(\_global.testValue==5){  
\_global.testValue+=3;  
trace(\_global.theThing);  
}

The trace in global2.swf gives me “undefined” so the trace in the “if” statement doesn’t appear at all.

Does the code work for you?  
What could I be doing wrong?
