|
-
Preloader overlaps first frame of website
Hi there, my Flash (CS4/AS3) website has turned out to be pretty huge- it's my first site and I'm ok with it taking a while to load at this time.. planning to clean things up later but need it running in the meantime. I needed a preloader at the beginning, but as so many actions in the site were tied to frame numbers, I decided to make the index.html a swf containing only the preloader and a UI loader, which loads the main site. This works ok, except the site appears to load before the preloader is finished, so the loading bar overlaps the site and the site is only half functional during these few seconds. Anyone have any advice to keep the site from loading until the preloader finishes? The website is www.bespokeglasstile.com and the code I'm using for the preloader is below.
Thanks!!!
var imageURL:String = "bespoke_glass_tile.swf";
var request:URLRequest = new URLRequest(imageURL);
bgtUI.load(request);
progressBar.source = bgtUI;
progressBar.addEventListener(ProgressEvent.PROGRES S, progressHandler);
progressBar.addEventListener(Event.COMPLETE, completeHandler);
function progressHandler (event:ProgressEvent):void {
status_txt.text = int(event.currentTarget.percentComplete) + "%";
}
function completeHandler (event:Event): void {
progressBar.removeEventListener(ProgressEvent.PROG RESS, progressHandler);
progressBar.removeEventListener(Event.COMPLETE, completeHandler);
removeChild(progressBar);
status_txt.text = "";
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|