# Global Variables and Hair Loss - HELP

**URL:** <https://forum.kirupa.com/t/global-variables-and-hair-loss-help/183495>\
**Category:** flash\
**Created:** [March 27, 2006, 4:36pm UTC](https://forum.kirupa.com/t/global-variables-and-hair-loss-help/183495 "2006-03-27T16:36:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![geebee2](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@geebee2](https://forum.kirupa.com/u/geebee2)\
**Post date:** [March 27, 2006, 4:36pm UTC](https://forum.kirupa.com/t/global-variables-and-hair-loss-help/183495/1 "2006-03-27T16:36:07Z")

</div>

I am loosing my mind with this error - Both files are running on the same domain. I am simply calling a another movie within a movie using the global variable feature. Howver even hardcoding the variable **\_global.directionsText** the import-html.swf movie returns a undefined error

```auto

//Frame 1 - Actionscript from Calling Movie
_global.directionsText="[http://www.mysite.com/access_db/viki/narrative/myHTML.txt](http://www.mysite.com/access_db/viki/narrative/myHTML.txt)";

// Actionscript to open another movie
on(release) {
theEmptyMC.loadMovie("import-html.swf", 1);
}
 
///// FRame 1 Actionscript of import-html.swf movie
 
source =directionsText;
text_field.html = true;
txt_lv = new LoadVars();
txt_lv.onData = function (rawData) {
  
if (rawData) { // data has successfully loaded
    trace("data has loaded successfully");
 
 text_field.htmlText = rawData;
  } else { // data has not successfully loaded
   directionsText= "There are no directions for this Quiz";
   trace("error: the data did not load");
  } // end "if (success)"
}
  txt_lv.load(source);

```

---

<div class="post-metadata">

**Author:** ![BDore](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@BDore](https://forum.kirupa.com/u/BDore)\
**Post date:** [March 27, 2006, 9:10pm UTC](https://forum.kirupa.com/t/global-variables-and-hair-loss-help/183495/2 "2006-03-27T21:10:47Z")

</div>

try this:

```auto
//Frame 1 - Actionscript from Calling Movie
_global.directionsText="<a href="http://www.mysite.com/access_db/viki/narrative/myHTML.txt" target="_blank">http://www.mysite.com/access_db/viki...ive/myHTML.txt</a>";

// Actionscript to open another movie
on(release) {
theEmptyMC.loadMovie("import-html.swf", 1);
}
 
///// FRame 1 Actionscript of import-html.swf movie
 
source =directionsText;
text_field.html = true;
txt_lv = new LoadVars();
txt_lv.onData = function (rawData) {
  
if (rawData) { // data has successfully loaded
    trace("data has loaded successfully");
 
 text_field.htmlText = rawData;
  } else { // data has not successfully loaded
   _global.directionsText= "There are no directions for this Quiz";
   trace("error: the data did not load");
  } // end "if (success)"
}
  txt_lv.load(source);

```
