# Loading a movie via xml and variables

**URL:** <https://forum.kirupa.com/t/loading-a-movie-via-xml-and-variables/163441>\
**Category:** flash\
**Created:** [September 22, 2005, 2:08pm UTC](https://forum.kirupa.com/t/loading-a-movie-via-xml-and-variables/163441 "2005-09-22T14:08:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![I\_be\_DoH32](https://avatars.discourse-cdn.com/v4/letter/i/9dc877/32.png) [@I\_be\_DoH32](https://forum.kirupa.com/u/I_be_DoH32)\
**Post date:** [September 22, 2005, 2:08pm UTC](https://forum.kirupa.com/t/loading-a-movie-via-xml-and-variables/163441/1 "2005-09-22T14:08:23Z")

</div>

I have recently started a new project in which nearly everything in the flash document is controlled by an xml sheet. I want to be able to use the xml to tell the flash how to path to certain locations. As an example:

I am using a variable created upon the loading of an xml sheet, called “mousepath”, to tell flash how to get to a mouse .swf movie. Here is the current code:

my\_xml = new XML();  
my\_xml.load(“my flash site.xml”);  
my\_xml.ignoreWhite = true;  
my\_xml.onLoad = function(loading) {  
if (loading) {  
my\_flash\_site = my\_xml.firstChild;  
mousepath = my\_flash\_site.firstChild.firstChild;  
this.mouse\_mc.loadMovie(mousepath, this.mouse\_mc.controller\_mc);  
}  
};

And the xml sheet:

\<?xml version=‘1.0’?\>  
\<my\_flash\_site\>  
\<mousepath\>  
\<![CDATA[mouse/mouse.swf]]\>  
\</mousepath\>  
\</my\_flash\_site\>

This, of course, doesn’t work. I have even run a trace, and it came up with:

mouse/mouse.swf

I input this into into the area where mousepath is, and the mouse.swf movie loads perfectly. I really would like for it to be able to load the path from the xml sheet, but it just won’t work. I could really use some help on this.
