# UILoader Help

**URL:** <https://forum.kirupa.com/t/uiloader-help/303666>\
**Category:** flash\
**Created:** [January 24, 2010, 8:44pm UTC](https://forum.kirupa.com/t/uiloader-help/303666 "2010-01-24T20:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tripicreative](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@tripicreative](https://forum.kirupa.com/u/tripicreative)\
**Post date:** [January 24, 2010, 8:44pm UTC](https://forum.kirupa.com/t/uiloader-help/303666/1 "2010-01-24T20:44:14Z")

</div>

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);  
}

}
