# Preloader making functions not work

**URL:** <https://forum.kirupa.com/t/preloader-making-functions-not-work/295821>\
**Category:** Uncategorized\
**Created:** [September 5, 2009, 12:34am UTC](https://forum.kirupa.com/t/preloader-making-functions-not-work/295821 "2009-09-05T00:34:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icekomo](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@icekomo](https://forum.kirupa.com/u/icekomo)\
**Post date:** [September 5, 2009, 12:34am UTC](https://forum.kirupa.com/t/preloader-making-functions-not-work/295821/1 "2009-09-05T00:34:08Z")

</div>

When I test the site with the preloader.swf file I made for it, it loads , but then some of my button functions do not work in the site. When I test the site fla file everything works fine. I have been trying things out with the preloader code, but not sure what would cause this.  
This is my preloader code:

var l:Loader = new Loader();  
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);  
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);  
l.load(new URLRequest(“sample.swf”));  
prog\_mc.stop();

function loop(event:ProgressEvent):void  
{  
var perc:Number = event.bytesLoaded / event.bytesTotal;  
prog\_mc.prog\_txt.text = Math.ceil(perc_100)+ “%”.toString();  
prog\_mc.loadBar\_mc.width = perc_295;  
}

function done(event:Event):void  
{  
removeChildAt(0);  
removeChild(prog\_mc);  
addChild(l);   
}

Thanks
