I bet the problem is path related. If you have a holder movie that's
running, which is loading the 2 SWFs, then the paths to the config XML
files would be relative to the holder movie's path, not the SWFs your
loading (I'm pretty sure that's true). Your base class is probably
using the same relative path to load it, assuming the current path is
the SWF's directory, though that may not be the case.
Maybe try adding a parameter to the loading of the movie that takes
the relative path to use? For example, if your directory structure
was this:
mainMovie.swf
test1/test.swf
test1/config.xml
test2/test.swf
test2/config.xml
main movie would do somewhere in its code (pseudocode as my brain
isn't completely functioning yet):
var test1 = loadMovie(...);
var test2 = loadMovie(...);
test1.loadConfig('test1/');
test2.loadConfig('test2/');
Then your loadConfig function would prepend the path to the name of
the config file, allowing it to get the right one.
-Andy
On 3/28/07, Russell Sprague <[EMAIL PROTECTED]> wrote:
I have two sections of my app in separate swf files that have very
similar functionality, but have different content. The 2 swf files are
generated from the same fla file. I built a core class that controls
the creation of the menu and loading the content. The menu data and
content is in an xml file called config.xml that I load into the core
class. I attached the core class to the main movie clip in my fla. I
then exported the 2 swfs, put them in their own folders, in which there
was a folder called config that held the config.xml that went with the
section. What I found is it would work fine when I loaded the first swf,
but when I loaded the second, it is still referencing the data for the
first movie. So even though it was a different swf file, the content
was the same. The swf were loaded into the same holder movie, so I
thought this might be the problem. I changed my root movie ot created a
new emptyMovieClip each time a section was loaded, and delete the old
one, but that didn't solve the issue. The only way I found around this
was to create two subclass files that extend the main class, overriding
the function that loads the xml file, and rename the xml files to be
specific to the swf.
My question is, is this normal behavior? How can I get rid of the class
and/or data from memory so the new data will load?
Thanks
Russ
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com