# Why doesnt my swf play correctly when I load it externally?

**URL:** https://forum.kirupa.com/t/why-doesnt-my-swf-play-correctly-when-i-load-it-externally/220247
**Category:** flash
**Created:** [March 24, 2007, 3:13am UTC](https://forum.kirupa.com/t/why-doesnt-my-swf-play-correctly-when-i-load-it-externally/220247 "2007-03-24T03:13:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vthok](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@vthok](https://forum.kirupa.com/u/vthok)
#### Post date: [March 24, 2007, 3:13am UTC](https://forum.kirupa.com/t/why-doesnt-my-swf-play-correctly-when-i-load-it-externally/220247/1 "2007-03-24T03:13:41Z")

</div>

I am calling 2 external swf files in my main swf file (a preloader one and my flash intro swf).

If I play the intro swf by itself it works just fine (notice that the picture frame replaces the camera):

[http://filebox.vt.edu/users/gyanez/flash\_test/intro.html](http://filebox.vt.edu/users/gyanez/flash_test/intro.html)

However, if I call the main.swf inside index.html the intro.swf doesnt play fully (camera stays there and no picture frame):

[http://filebox.vt.edu/users/gyanez/flash\_test/index.html](http://filebox.vt.edu/users/gyanez/flash_test/index.html)

This is how I am loading my swfs in main.fla…you guys see anything wrong?

\*// create empty movie clips that act as containers for externally loaded SWF’s  
this.createEmptyMovieClip(“loader”, 50); // put loader on level 50 above all other loaded swfs  
this.createEmptyMovieClip(“intro”, 5); // put intro.swf on level 5

// initilize top left corner of both empty movie clips so they are directly above the centered stage  
loader.\_x=25;  
loader.\_y=25;  
intro.\_x=25;  
intro.\_y=25;

// create moviecliploader object and add a listener that monitors it  
var my\_mcl:MovieClipLoader = new MovieClipLoader();  
var mclListener:Object = new Object();  
my\_mcl.addListener(mclListener);

// load the following external swfs to their empty containers using the MCL object  
my\_mcl.loadClip(“preloader.swf”, loader);  
my\_mcl.loadClip(“intro.swf”, intro);

// when my\_mcl is loading something it will go to the preloader.swf that was loaded and pre-cache the other swfs you’re loading  
mclListener.onLoadProgress = function(target\_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {  
// turn on preloader swf visibility  
loader.\_visible = true;  
// figure out current % downloaded and then go to that frame (out of 100) in the preloader.swf  
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) \* 100);  
loader.preloader.gotoAndStop(preloadPercent);  
loader.percentDLed.text = preloadPercent + “%”;  
}

// when everything is loaded turn off preloader.swf and then play remaining swfs  
mclListener.onLoadComplete = function(target\_mc:MovieClip) {  
loader.\_visible = false;  
}  
\*
