So I am building a portfolio site in Flash CS3 and have everything pretty much running except I can't get the preloader to work.
Here is the script I have so far:
//LOAD A RANDOM BACKGROUND
var randomNumber:Number = Math.ceil(Math.random()*10);
trace(randomNumber);
bkgdimage.source = "images/bkgd"+randomNumber+".jpg";
var myalphaTween:Tween = new Tween(bkgdimage, "alpha", Regular.easeOut, 0, 2, 1, true);
bkgdimage.addEventListener(ProgressEvent.PROGRESS, largeImagePreloader);
function largeImagePreloader(event
rogressEvent):void {
var percent:Number = Math.round((event.bytesLoaded*100)/event.bytesTotal);
percent_txt.text = percent + "%";
bkgdimage.addEventListener(Event.COMPLETE, fadeIn);
function fadeIn(e:Event):void {
}
}
but what happens is that after the background image loads, the percentage still stays there and won't go away. I would also prefer to have the preloader start before ANYTHING is loaded on the page.
Here is the site: www.MatthewOlson.net
The crossbar, and the four buttons always load first, with the background loading quickly afterwards. Can anyone help me out?
Here is the script I have so far:
//LOAD A RANDOM BACKGROUND
var randomNumber:Number = Math.ceil(Math.random()*10);
trace(randomNumber);
bkgdimage.source = "images/bkgd"+randomNumber+".jpg";
var myalphaTween:Tween = new Tween(bkgdimage, "alpha", Regular.easeOut, 0, 2, 1, true);
bkgdimage.addEventListener(ProgressEvent.PROGRESS, largeImagePreloader);
function largeImagePreloader(event
var percent:Number = Math.round((event.bytesLoaded*100)/event.bytesTotal);
percent_txt.text = percent + "%";
bkgdimage.addEventListener(Event.COMPLETE, fadeIn);
function fadeIn(e:Event):void {
}
}
but what happens is that after the background image loads, the percentage still stays there and won't go away. I would also prefer to have the preloader start before ANYTHING is loaded on the page.
Here is the site: www.MatthewOlson.net
The crossbar, and the four buttons always load first, with the background loading quickly afterwards. Can anyone help me out?