# Random loadMovie function - problem with location of external SWFs

**URL:** https://forum.kirupa.com/t/random-loadmovie-function-problem-with-location-of-external-swfs/143405
**Category:** Uncategorized
**Created:** [April 5, 2005, 6:05pm UTC](https://forum.kirupa.com/t/random-loadmovie-function-problem-with-location-of-external-swfs/143405 "2005-04-05T18:05:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![calitswa](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@calitswa](https://forum.kirupa.com/u/calitswa)
#### Post date: [April 5, 2005, 6:05pm UTC](https://forum.kirupa.com/t/random-loadmovie-function-problem-with-location-of-external-swfs/143405/1 "2005-04-05T18:05:27Z")

</div>

Hi,

I’m having a problem with embedding a Flash movie that loads an array of SWFs- specifically, ones that exist in the same movie as the .fla loader file.

When I move the external SWFs and .swf load\_movie file into a separate directory from the HTML file, they do not load properly. I get just a white window, and am not sure how to solve this .

[http://www.calit2.net/newwebsite/index\_css\_conversion3.html](http://www.calit2.net/newwebsite/index_css_conversion3.html)

When I keep the SWF movie clips and load\_movie.swf in the same (root) folder as the .html file, then everything loads properly, though. But this would extremely clutter up my directory!

The code is as follows:

MOVIE CLIP ON STAGE

```
                                                                                                                                                                                                                                                                                                                        Attach Code                                                                                      

```

onClipEvent(data){  
//test to make sure it’s completely loaded, when swf’s load this way onData is called with each ‘chunk’ of data  
if(bytesLoaded()==bytesTotal()){  
this.onEnterFrame=function(){  
if(\_currentframe==\_totalframes){  
\_root.loadNextMovie()  
}  
}

FIRST FRAME OF TIMELINE - ACTIONS LAYER

filename = [“agilent.swf”, “amcc.swf”, “ampersand.swf”, “alliance.swf”, “analog.swf”, “avalon.swf”, “att.swf”, “archventure.swf”, “boeing.swf”, “awarepoint.swf”, “broadcom.swf”, “bigbangwidth.swf”, “bluetitan.swf”, “butterfly.swf”, “broadleyjames.swf”, “calamp.swf”, “calbatech.swf”, “calient.swf”];  
loadNextMovie = function () {  
trace(“loadnext”);  
movieTarget.loadMovie(filename[random(filename.length)]);  
};  
loadNextMovie();  
}  
}

HTML CODE:

\<object classid=“clsid:d27cdb6e-ae6d-11cf-96b8-444553540000” codebase=“[http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0](http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0)” width=“168” height=“113” id=“load\_randomMX” align=“middle”\>  
\<param name=“allowScriptAccess” value=“sameDomain” /\>  
\<param name=“movie” value=“load/movie/load\_randomMX.swf” /\>  
\<param name=“quality” value=“high” /\>  
\<param name=“bgcolor” value="#ffffff" /\>  
\<embed src=“load\_movie/load\_randomMX.swf” quality=“high” bgcolor="#ffffff" width=“168” height=“113” name=“load\_randomMX” align=“middle” allowScriptAccess=“sameDomain” type=“application/x-shockwave-flash” pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” /\>  
\</object\>

I 'm not sure if there is a way in loadMovie to specify another folder, or the best way to solve this problem. I’m relatively new to Actionscript.

Any help is appreciated, thanks!
