# MovieClipLoader not loading loaded swf's loadees

**URL:** <https://forum.kirupa.com/t/moviecliploader-not-loading-loaded-swfs-loadees/245995>\
**Category:** flash\
**Created:** [December 6, 2007, 4:09am UTC](https://forum.kirupa.com/t/moviecliploader-not-loading-loaded-swfs-loadees/245995 "2007-12-06T04:09:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrissyg](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@chrissyg](https://forum.kirupa.com/u/chrissyg)\
**Post date:** [December 6, 2007, 4:09am UTC](https://forum.kirupa.com/t/moviecliploader-not-loading-loaded-swfs-loadees/245995/1 "2007-12-06T04:09:07Z")

</div>

Something like that. I have a moviecliploader that loads a swf when a button is clicked. The swf it’s loading is a photo gallery that in turn loads images using its own moviecliploader.

They work great when I test the movie, and usually when I post all the files online, but when I just try to open the main swf file, the main swf loads the gallery swf, but the gallery swf won’t load its images.

Is this a problem with the code, do you think, or is this something that just doesn’t work unless it’s in a browser? I’m supposed to turn in the swfs (and flas) for my class, so I’m a little concerned that it’s going to appear to be not working. Here’s the relevant code (sorry it’s so long!):

## Main movie

this.createEmptyMovieClip(“loadit”, this.getNextHighestDepth());  
loadit.\_x = 215;  
loadit.\_y = 90;

var myLoader:MovieClipLoader = new MovieClipLoader();  
var myListener:Object = new Object();  
myLoader.addListener(myListener);

myListener.onLoadComplete = function(target\_mc:MovieClip) {  
TransitionManager.start(target\_mc,{type:Fade, duration:1});  
TransitionManager.start(target\_mc,{type:Zoom, direction:0, duration:2, easing:Strong.easeOut});  
}

swf2\_btn.onPress = function(){  
myLoader.loadClip(“mySwf\_cg.swf”,“loadit”);  
title\_txt.text = “Photo gallery”;  
}

## mySwf\_cg.swf code

import mx.transitions._;  
import mx.transitions.easing._;

var whichImage:Number = 0;  
var whichCaption:Number = 0;  
buttons.back\_btn.\_visible=false;

var picArray:Array = [‘parrot.jpg’, ‘texas.jpg’, ‘cadillac.jpg’, ‘camel.jpg’, ‘leaves.jpg’, ‘gates.jpg’, ‘birds.jpg’, ‘cat.jpg’, ‘crown.jpg’, ‘detergent.jpg’];

var captionArray:Array = [‘Parrot Eats a Peanut’, ‘Driving in Texas’, ‘Cadillac Ranch’, ‘Palo Duro Canyon’, ‘Autumn Leaves’, ‘The Gates’, ‘Birds on a Wire’, ‘Cat Licks Chops’, ‘Wearing a Crown’, ‘Detergent’];

this.createEmptyMovieClip(“loadit”, 1);  
loadit.swapDepths(buttons);  
var myLoader:MovieClipLoader = new MovieClipLoader();  
var myListener:Object = new Object();  
myLoader.addListener(myListener);  
myLoader.loadClip(“mySwfImages/”+picArray[whichImage],“loadit”);  
\_root.title\_txt.text = captionArray[whichCaption];

myListener.onLoadComplete = function(target\_mc:MovieClip) {  
TransitionManager.start(target\_mc, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});  
if(whichImage\>0){  
buttons.back\_btn.\_visible=true;  
} else {  
buttons.back\_btn.\_visible=false;  
}  
if(whichImage\<picArray.length-1){  
buttons.forward\_btn.\_visible=true;  
} else {  
buttons.forward\_btn.\_visible=false;  
}  
}

buttons.forward\_btn.onPress = function(){  
loadit.\_alpha=100;  
if(whichImage\<picArray.length-1){  
whichImage += 1;  
whichCaption += 1;  
myLoader.loadClip(“mySwfImages/”+picArray[whichImage],“loadit”);  
\_root.title\_txt.text = captionArray[whichCaption];  
}  
}

buttons.back\_btn.onPress = function(){  
loadit.\_alpha=100;  
if(whichImage\>0){  
whichImage -= 1;  
whichCaption -= 1;  
myLoader.loadClip(“mySwfImages/”+picArray[whichImage],“loadit”);  
\_root.title\_txt.text = captionArray[whichCaption];  
}  
}
