# Preloader in CS3

**URL:** <https://forum.kirupa.com/t/preloader-in-cs3/271905>\
**Category:** flash\
**Created:** [September 30, 2008, 9:12am UTC](https://forum.kirupa.com/t/preloader-in-cs3/271905 "2008-09-30T09:12:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanCremona](https://avatars.discourse-cdn.com/v4/letter/i/65b543/32.png) [@IanCremona](https://forum.kirupa.com/u/IanCremona)\
**Post date:** [September 30, 2008, 9:12am UTC](https://forum.kirupa.com/t/preloader-in-cs3/271905/1 "2008-09-30T09:12:32Z")

</div>

if (newSlides.currentLoadingImage\<1) {  
[//loadingTxt.text](https://loadingTxt.text) = String("Loading “+(newSlides.currentLoadingImage+1)+” of “+Math.floor(event.bytesLoaded/1024)+ " kilobytes have loaded from “+Math.floor(event.bytesTotal/1024)+” total kilobytes”);  
addEventListener(Event.ENTER\_FRAME, loading);  
function loading(event:Event) {  
var bytestotal = event.bytesTotal;  
var bytesloaded = event.bytesLoaded;  
var sclbar = Math.round(bytesloaded\*100/bytestotal);  
custom\_animation.gotoAndPlay(sclbar);  
if (bytesloaded \>= bytestotal) {  
removeEventListener(Event.ENTER\_FRAME, loading);  
removeChild(custom\_animation);  
}

Hello,

I am trying to load use the code in the second line to generate animation for a bar loader that I have created in the \_root of the movie with instance name “custom\_animation”.

I keep getting the following errors:

1119: Access of possibly undefined property bytesTotal through a reference with static type flash.events:Event. (source: var bytestotal = event.bytesTotal;)  
1119: Access of possibly undefined property bytesLoaded through a reference with static type flash.events:Event. (source: var bytesloaded = event.bytesLoaded;)

Can someone figure out what is wrong here?

Thanks,  
Ian
