Hello there. I am working on a project where I load .swf files into another file through a UILoader.
However, when I load a particular file that has some of the images off of the workspace, the UILoader displays them. I realize that is kind of cryptic to understand, but basically stuff that should not be displayed is being displayed. Here is the AS I am using in the UILoader file, which has 3 loaders for a Displayed, Next and Previous. I will also show a screenshot of what is going wrong.
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var current:int = 0;
var limit:int = 15;
nextBUT.addEventListener(MouseEvent.CLICK,nxt);
prevBUT.addEventListener(MouseEvent.CLICK,prv);
loader.load(new URLRequest(current+".swf"));
next_loader.load(new URLRequest((current+1)+".swf"));
next_loader.visible = false;
prev_loader.load(new URLRequest((limit-1)+".swf"));
prev_loader.visible = false;
var changing_pnl:Boolean = false;
function nxt(e:Event):void
{
// DUN TOUCH
if(changing_pnl)
{
return;
}
changing_pnl = true;
nextBUT.removeEventListener(MouseEvent.CLICK,nxt);
prevBUT.removeEventListener(MouseEvent.CLICK,prv);
current++;
loadCurrent(1);
}
function prv(e:Event):void
{
if(changing_pnl)
{
return;
}
changing_pnl = true;
nextBUT.removeEventListener(MouseEvent.CLICK,nxt);
prevBUT.removeEventListener(MouseEvent.CLICK,prv);
current--;
loadCurrent(-1);
}
function loadCurrent(dir:int):void
{
if(current < 0)
{
current = limit-1;
}
else if(current >= limit)
{
current = 0;
}
if(dir == 1)
{
next_loader.visible = true;
}
else
{
prev_loader.visible = true;
}
loader.load(new URLRequest(current+".swf"));
loader.addEventListener(ProgressEvent.PROGRESS, progress_handler);
loader.addEventListener(Event.COMPLETE, fade_finished);
trace(current);
}
function progress_handler(e:Event):void
{
loader.alpha -= .3;
}
function fade_finished(e:Event):void
{
loader.alpha = 1;
if(current == 0)
{
prev_loader.load(new URLRequest((limit-1)+".swf"));
}
else
{
prev_loader.load(new URLRequest((current-1)+".swf"));
}
prev_loader.visible = false;
if(current == limit-1)
{
next_loader.load(new URLRequest("0.swf"));
}
else
{
next_loader.load(new URLRequest((current+1)+".swf"));
}
next_loader.visible = false;
nextBUT.addEventListener(MouseEvent.CLICK,nxt);
prevBUT.addEventListener(MouseEvent.CLICK,prv);
changing_pnl = false;
}
[URL=“http://img534.imageshack.us/img534/4241/flafile.png”]
Photo of FLA file (Clicking the images cause the pictures off the workspace to move to the workspace)
Problem that occurs (the images on the right, that are off the workspace are displayed)
My professor isnt sure why this is happening, and I have spent time trying to fix it but to no avail. Any help would be appreciated.
Also, if it matters, there is no AS on the images being loaded into the UILoader, it is just behaviors that cause MotionTweens.