Preloader/Full Screen Issue
this page im working on: www.houseofopama.com/temp.html . loading opama.swf preloader.swf , using code can have full screen background image. however, background image covers preloader while loading. & loaded movie centered , scaled. can me this???
here's code:
var l:loader = new loader(); l.contentloaderinfo.addeventlistener(progressevent.progress, loop); l.contentloaderinfo.addeventlistener(event.complete, done); l.load(new urlrequest("opama.swf")); stage.align = stagealign.bottom; function loop(e:progressevent):void { var perc:number = e.bytesloaded / e.bytestotal; percent.text = math.ceil(perc*100).tostring(); } function done(e:event):void { removechildat(0); percent = null; addchild(l); } var loader:loader = new loader(); var mc:movieclip = new movieclip(); stage.scalemode = stagescalemode.no_scale stage.align = stagealign.top_left; loader.load(new urlrequest("http://www.houseofopama.com/jpeg-tile.jpg")); loader.contentloaderinfo.addeventlistener(event.complete, c); function c(event:event):void { mc.addchild(loader); this.addchild(mc); mc.width = stage.stagewidth mc.height = stage.stageheight stage.addeventlistener(event.resize, r); } function r(event:event):void { mc.width = stage.stagewidth mc.height = stage.stageheight mc.x = 0; mc.y = 0; }
***kglad, know u know do, if u see this***
1. use addchild(percent) whenever want move percent top of parent's displaylist.
2. center loaded image/swf when loading complete:
loader.x=(stage.stagewidth-loader.width)/2;
loader.y=(stage.stageheight-loader.height)/2;
More discussions in ActionScript 3
adobe
Comments
Post a Comment