Groups | Blog | Home
all groups > flash actionscript > september 2004 >

flash actionscript : Movies that load other movies that load other ...


Thanehand
9/29/2004 10:43:08 PM
Given the directory and SWF structure:

\loadermovie.swf

\set1\set1main.swf
\set1\item1.swf
\set1\item2.swf

\set2\set2main.swf
\set2\item1.swf

Where loadermovie.swf loads set1movie.swf which in turn loads item1.swf and
item2.swf.

Is there a way to set a base path (similar to the BASE embed/object attribute)
progmatically for each setxmain.swf so that it looks in the correct
subdirectory for their dynamically loaded SWF files (itemx.swf) instead of the
root folder where loadermovie.swf is located?

I'm trying to create a controller SWF (loadermovie.swf) that loads these
dynamic SWF file sets which are created by another application. Any help or
recommendations are greatly appreciated.
_jrh_
9/29/2004 10:56:36 PM
You could set up a global variable on the main swf (loadermovie.swf) that
specifies paths.

_global.setPath = "/setNO/"

Then in the set1main.swf when you go to load them:

thisName = this._url;
thisNumber = thisName.charAt((thisName.indexOf("set")+3)); // number of set
via folder name
thisPath = setPath.split("NO").join(thisNumber); // replace NO with actual
number
loadMovie(thisPath+"item1.swf");

Give that a shot and let me know if it works.
Thanehand
9/29/2004 11:06:32 PM
_jrh_
9/29/2004 11:12:25 PM
Rothrock
9/30/2004 12:39:06 AM
Thanehand
9/30/2004 1:56:05 AM
AddThis Social Bookmark Button