# AS3 - file on disk, size in bytes?

**URL:** <https://forum.kirupa.com/t/as3-file-on-disk-size-in-bytes/222099>\
**Category:** flash\
**Created:** [April 10, 2007, 8:50pm UTC](https://forum.kirupa.com/t/as3-file-on-disk-size-in-bytes/222099 "2007-04-10T20:50:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ignitrix](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ignitrix/32/2664_2.png) [@ignitrix](https://forum.kirupa.com/u/ignitrix)\
**Post date:** [April 10, 2007, 8:50pm UTC](https://forum.kirupa.com/t/as3-file-on-disk-size-in-bytes/222099/1 "2007-04-10T20:50:32Z")

</div>

I’m using Flash 9 Public Alpha, AS 3.0.

I have an image pre-loader that loads an uncertain number of external image files. I wish to show a progress bar based on the current bytes loaded vs the total bytes that need to be loaded for all images.

The problem I’m having is that the .[bytesTotal property of the [URL=“http://livedocs.adobe.com/labs/as3preview/langref/flash/display/Loader.html”]Loader (well, technically the [URL=“http://livedocs.adobe.com/labs/as3preview/langref/flash/display/LoaderInfo.html”]LoaderInfo](http://livedocs.adobe.com/labs/as3preview/langref/flash/display/LoaderInfo.html#bytesTotal)) class always returns 0 until the first ProgressEvent is dispatched, which doesn’t happen until after you begin loading the file. So I can’t figure out a good way to find out what the _grand total_ number of bytes that need to be loaded is unless I start all of my images loading simultaneously or somehow begin loading and then stop them from loading–either of which seems a poor solution to me.

I tried using the [File class to reference the .[URL=“http://livedocs.adobe.com/labs/as3preview/langref/flash/net/FileReference.html#size”]size](http://livedocs.adobe.com/labs/as3preview/langref/flash/filesystem/File.html) property, but this apparently only works in Flex, not in F9PA since the compiler didn’t recognize the File class.

Any suggestions? Thanks.  
~JC
