Well its pretty simple what i want - and i’m almost there. Basically i need a jpg as my background - and it works well.
The only problem is that sometimes when i test my site live - the preloader for the background image just blinks and then disappears straight away - and i have to refresh my page for the actual image to fade in.
It works fine when i test inside flash and it also works on some computers and on internet explorer - so i really have no idea what may cause the problem.
But, there could be some code that i’ve placed that has caused this possible error.
You can view the current site here
and here is the code that loads the jpg, its on frame 3, the final frame of the movie:
stop();
movieLoader.loadMovie("gallery3.swf");
Stage.scaleMode = "noScale";
var trialNavigation = new ContextMenu();
trialNavigation.hideBuiltInItems();
// Applying the new menu
_level0.menu = trialNavigation;
function loadImage() {
imageClip._alpha = 0;
imageClip.createEmptyMovieClip("holder", 999);
imageClip.holder.loadMovie("background.jpg");
this.onEnterFrame = function() {
BL = imageClip.holder.getBytesLoaded();
BT = imageClip.holder.getBytesTotal();
getPercent = BL/BT;
loadText = "loading background " + Math.round(getPercent*100)+"%";
if (BL == BT) {
loadText = "";
sl.onResize();
if(imageClip._alpha < 100)
{
imageClip._alpha = imageClip._alpha + 10;
}else{
delete this.onEnterFrame;
}
}
};
}
loadImage();
var sl:Object = new Object();
sl.onResize = function() {
//imageClip._width = Stage.width + 64;
//imageClip._height = imageClip._width*0.75;
imageClip._height = Stage.height + 64;
imageClip._width = imageClip._height*(4/3);
imageClip._x = 400 - imageClip._width/2;
imageClip._y = 300 - imageClip._height/2;
};
Stage.addListener(sl);