# 1009 error after putting the preloader

**URL:** <https://forum.kirupa.com/t/1009-error-after-putting-the-preloader/280300>\
**Category:** Uncategorized\
**Created:** [January 25, 2009, 10:47pm UTC](https://forum.kirupa.com/t/1009-error-after-putting-the-preloader/280300 "2009-01-25T22:47:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![innnnnah](https://avatars.discourse-cdn.com/v4/letter/i/c89c15/32.png) [@innnnnah](https://forum.kirupa.com/u/innnnnah)\
**Post date:** [January 25, 2009, 10:47pm UTC](https://forum.kirupa.com/t/1009-error-after-putting-the-preloader/280300/1 "2009-01-25T22:47:36Z")

</div>

Hi,

i’ve put simple preloader on frame 1.  
since then i get an 1009 error message.  
I debugged the file and it seems like it is referring to ‘franklin\_button’  
but this is the button on the stage.  
i’ve checked the instance name thousand times and it is correct name.

yet without the preloader, the whole thing works find without a problem.  
I do not see where it should have gone wrong. Please help!

frame 1(preloader script)  
stop();  
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS,checkLoadProgress);  
function checkLoadProgress(event:ProgressEvent):void {  
var progressPercentComplete:Number=(event.bytesLoaded / event.bytesTotal)\*100;  
loaded\_txt.text=String(Math.floor(progressPercentComplete))+" %";  
if (progressPercentComplete==100) {  
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS,checkLoadProgress);  
play();  
}  
}

frame 2(main script)  
stop();

var franklin:franklin\_descprtion = new franklin\_descprtion();  
var tour:tour\_d = new tour\_d();  
var clock:clock\_d = new clock\_d();  
var identity:identity\_d = new identity\_d();  
var buio:buio\_d = new buio\_d();

this.franklin\_button.addEventListener(MouseEvent.MOUSE\_OVER, mouseOverHandler);  
function mouseOverHandler(event:MouseEvent):void {  
this.franklin.x=264.6;  
this.franklin.y=36.6;  
addChild(franklin);

}  
this.franklin\_button.addEventListener(MouseEvent.MOUSE\_OUT, mouseOutHandler);  
function mouseOutHandler(event:MouseEvent):void {  
this.removeChild(franklin);  
}

this.franklin\_button.addEventListener(MouseEvent.MOUSE\_DOWN, mouseDownHandler);  
function mouseDownHandler(event:MouseEvent):void {  
var jscommand1:String=“window.open(‘[http://www.0303pm.net/motion/frank.mov’,‘win’,'height=350,width=300,toolbar=no,scrollbars=yes](http://www.0303pm.net/motion/frank.mov','win','height=350,width=300,toolbar=no,scrollbars=yes)’);”;  
var url1:URLRequest=new URLRequest(“javascript:”+jscommand1+" void(0);");  
navigateToURL(url1, “\_blank”);  
}

this.identity\_button.addEventListener(MouseEvent.MOUSE\_OVER, mouseOverHandler\_1);  
function mouseOverHandler\_1(event:MouseEvent):void {  
this.identity.x=196.9;  
this.identity.y=91.6;  
this.addChild(this.identity);

}

this.identity\_button.addEventListener(MouseEvent.MOUSE\_OUT, mouseOutHandler\_1);  
function mouseOutHandler\_1(event:MouseEvent):void {  
this.removeChild(this.identity);  
}

this.identity\_button.addEventListener(MouseEvent.MOUSE\_DOWN, mouseDownHandler\_1);  
function mouseDownHandler\_1(event:MouseEvent):void {  
var jscommand1:String=“window.open(‘[http://www.0303pm.net/motion/identity.mov’,‘win’,'height=350,width=300,toolbar=no,scrollbars=yes](http://www.0303pm.net/motion/identity.mov','win','height=350,width=300,toolbar=no,scrollbars=yes)’);”;  
var url1:URLRequest=new URLRequest(“javascript:”+jscommand1+" void(0);");  
navigateToURL(url1, “\_blank”);  
}

this.buio\_button.addEventListener(MouseEvent.MOUSE\_OVER, mouseOverHandler\_2);  
function mouseOverHandler\_2(event:MouseEvent):void {  
this.buio.x=558.5;  
this.buio.y=314.6;  
this.addChild(this.buio);  
}  
this.buio\_button.addEventListener(MouseEvent.MOUSE\_OUT, mouseOutHandler\_2);  
function mouseOutHandler\_2(event:MouseEvent):void {  
this.removeChild(this.buio);  
}

this.buio\_button.addEventListener(MouseEvent.MOUSE\_DOWN, mouseDownHandler\_2);  
function mouseDownHandler\_2(event:MouseEvent):void {  
var jscommand1:String=“window.open(‘[http://www.0303pm.net/motion/buio.avi’,‘win’,'height=350,width=300,toolbar=no,scrollbars=yes](http://www.0303pm.net/motion/buio.avi','win','height=350,width=300,toolbar=no,scrollbars=yes)’);”;  
var url1:URLRequest=new URLRequest(“javascript:”+jscommand1+" void(0);");  
navigateToURL(url1, “\_blank”);

}

this.tour\_button.addEventListener(MouseEvent.MOUSE\_OVER, mouseOverHandler\_3);  
function mouseOverHandler\_3(event:MouseEvent):void {

```
this.tour.x=212.5;
this.tour.y=359;
this.addChild(this.tour);

```

}

this.tour\_button.addEventListener(MouseEvent.MOUSE\_OUT, mouseOutHandler\_3);  
function mouseOutHandler\_3(event:MouseEvent):void {  
this.removeChild(this.tour);  
}

this.tour\_button.addEventListener(MouseEvent.MOUSE\_DOWN, mouseDownHandler\_3);  
function mouseDownHandler\_3(event:MouseEvent):void {  
var jscommand:String=“window.open(‘[http://www.0303pm.net/motion/tour.avi’,‘win’,'height=350,width=300,toolbar=no,scrollbars=yes](http://www.0303pm.net/motion/tour.avi','win','height=350,width=300,toolbar=no,scrollbars=yes)’);”;  
var url:URLRequest=new URLRequest(“javascript:”+jscommand+" void(0);");  
navigateToURL(url, “\_blank”);  
}

this.clock\_button.addEventListener(MouseEvent.MOUSE\_OVER, mouseOverHandler\_4);  
function mouseOverHandler\_4(event:MouseEvent):void {  
this.clock.x=985.8;  
this.clock.y=270.5;  
addChild(this.clock);  
}

this.clock\_button.addEventListener(MouseEvent.MOUSE\_OUT, mouseOutHandler\_4);  
function mouseOutHandler\_4(event:MouseEvent):void {  
this.removeChild(this.clock);  
}

this.clock\_button.addEventListener(MouseEvent.MOUSE\_DOWN, mouseDownHandler\_4);

```
function mouseDownHandler_4(event:MouseEvent):void {

```

var jscommand1:String=“window.open(‘[http://www.0303pm.net/motion/clock.mov’,‘win’,'height=350,width=300,toolbar=no,scrollbars=yes](http://www.0303pm.net/motion/clock.mov','win','height=350,width=300,toolbar=no,scrollbars=yes)’);”;  
var url1:URLRequest=new URLRequest(“javascript:”+jscommand1+" void(0);");  
navigateToURL(url1, “\_blank”);  
}

p.s. i also tried to seperate them on different scenes but this doesn’t work either.
