I have a few different sections with images fading in with the UILoader with the code below. Everything appears fine on the surface. I click the button and a new image fades in with the loader. But if I click on a button before the image has fully faded in I get an endless amount of 1009 errors.
If I put my flashpage live on the web and click a button too early the image will fade in but you will also see an outline of the UILoader blink for a little bit. Any ideas how to fix this? Sorry if this is a novice question. Just started to learn Actionscript. Below is the code I’m using.
port5_mc.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(event:Event):void
{
port5_mc.removeEventListener(Event.COMPLETE, completeHandler);
port5_mc.alpha = 0;
this.addEventListener(Event.ENTER_FRAME, fadeIn);
}
function fadeIn(event:Event):void
{
port5_mc.alpha = port5_mc.alpha +0.05;
if (port5_mc.alpha >= 1) {
port5_mc.alpha = 1;
this.removeEventListener(Event.ENTER_FRAME, fadeIn);
}
}