# Conditional function and UILoader

**URL:** <https://forum.kirupa.com/t/conditional-function-and-uiloader/309543>\
**Category:** Uncategorized\
**Created:** [May 18, 2010, 1:12pm UTC](https://forum.kirupa.com/t/conditional-function-and-uiloader/309543 "2010-05-18T13:12:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikrobus11](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mikrobus11](https://forum.kirupa.com/u/mikrobus11)\
**Post date:** [May 18, 2010, 1:12pm UTC](https://forum.kirupa.com/t/conditional-function-and-uiloader/309543/1 "2010-05-18T13:12:18Z")

</div>

Hi there,

I have problem with conditional function and UILoader (interiorLoader).

the part of my code is now like this:

// button forward…  
forward\_btn.addEventListener(MouseEvent.CLICK, forward);  
function forward(e:MouseEvent):void {  
if (interiorLoader.source ==“interiors\_content1.swf”) {  
interiorLoader.load(new URLRequest(“interiors\_content1a.swf”));  
interiorLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);  
interiorLoader.addEventListener(Event.COMPLETE, completeHandler);  
forward\_btn.visible=false;  
back\_btn.visible=true;

} else {

if (interiorLoader.source==“interiors\_content2.swf”) {  
forward\_btn.visible=true;  
forward\_btn.visible=true;  
interiorLoader.load(new URLRequest(“interiors\_content2a.swf”));  
}  
}

When I used only source not load everything was working correctly

It should work like this:

If you press forward\_btn and in UILoader is interiors\_content1.swf it should load  
in UILoader file interiors\_content1a.swf etc…

Please help me…
