Skip to main content
December 31, 2010
Answered

Couple of quick questions

  • December 31, 2010
  • 1 reply
  • 799 views

Hi.  Just got a few things I am trying to work out.  Firstly, say I produce an swf and in the actionscript I have a link to an xml file.  Say I then load this swf within my main swf which is in a different folder, does the url need to be relative from the main swf?  It works on its own, but when I load the swf within my main one, I get a url issue.

Secondly, I am calling a load of swf's up within my main swf through buttons, I have a button home.  The home button is basically the main swf as it is, with nothing loaded.  I use an XML file to load up my other files e.g.

<item href="Assets/Work/Portfolio.swf">Portfolio</item>

When it comes to loading my main swf for when someone clicks the home button, is it a case of just providing a url to the main swf?  I though It would have been silly reloading the main swf, as then I would imagine all the preloading needs to be performed again.  Is there away to do this a different way?

cheers

This topic has been closed for replies.
Correct answer kglad

your paths are relative to the main swf's embedding html file.

usually, you would unload whatever's been loaded to return to the main swf as it appeared with it (the main swf) initially loaded.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
December 31, 2010

your paths are relative to the main swf's embedding html file.

usually, you would unload whatever's been loaded to return to the main swf as it appeared with it (the main swf) initially loaded.

December 31, 2010

So if I had an action event on all my buttons, and in it I had

myLoader.x = 18;
myLoader.y = 145;
addChild(myLoader);
var url:URLRequest = new URLRequest(e.target.href);
myLoader.load(url);

Whats the process of unloading whatevers there?  I dont really know whats there because I dont know what would have been loaded beforehand.

kglad
Community Expert
Community Expert
December 31, 2010

myLoader.unload();

or better if publishing for fp10:

myLoader.unloadAndStop();