# How can I create a preloader for a file with document class

**URL:** <https://forum.kirupa.com/t/how-can-i-create-a-preloader-for-a-file-with-document-class/295262>\
**Category:** flash\
**Created:** [August 27, 2009, 10:50am UTC](https://forum.kirupa.com/t/how-can-i-create-a-preloader-for-a-file-with-document-class/295262 "2009-08-27T10:50:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackcoma](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@blackcoma](https://forum.kirupa.com/u/blackcoma)\
**Post date:** [August 27, 2009, 10:50am UTC](https://forum.kirupa.com/t/how-can-i-create-a-preloader-for-a-file-with-document-class/295262/1 "2009-08-27T10:50:52Z")

</div>

I’m working on an AS3 project, now the main file has a document class.  
How can I create a preloader for this file?

I tried to do in the document class, but since I declare global variables (which start different class) there, the loading only starts after they are loaded.

Isn’t there an easy solution like in AS2?  
Where you’d just put a scene of “Loading” as your first scene which loads your file from start to end no matter which size or what it’s loading?

Thanks
