0
嗨,我想在Flash Builder中製作預加載器。我想在加載所有項目時縮放我的加載欄。但是當我開始我的遊戲時,它只是在白色屏幕上等待並跳過加載屏幕。誰能幫我解決這個問題As3預加載器問題
public class OYLoadManager extends Sprite
{
private var main:CagryInside;
//////////////////Load Manager Items/////////////////////////////
[Embed(source="../Resources/loadImages/loadBackground.png")]
private var loadBackgroundClass:Class;
private var loadBackground:Bitmap = new loadBackgroundClass() ;
[Embed(source="../Resources/loadImages/loadBar.png")]
private var loadBarClass:Class ;
private var loadBar : Bitmap = new loadBarClass() ;
private static const loadBarWidth:Number = 612;
private var loadManager:Loader = new Loader();
public function OYLoadManager(getMain:CagryInside)
{
main = getMain;
// Initializing Load Manager
loadBar.x = 226;
loadBar.y = 396;
loadBar.width = 0 ;
//Load Screen images
main.addChild(loadBackground);
main.addChild(loadBar);
//main.gameStateManager.selectGameStates(1);
loadManager.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loadScreen);
loadManager.contentLoaderInfo.addEventListener(Event.COMPLETE, finishProcess);
loadManager.load(new URLRequest("playerProductInstall.swf"));
}
public function finishProcess(event:Event):void{
// removeLoadManagerMenu();
main.gameStateManager.selectGameStates(1);
}
public function loadScreen(event:ProgressEvent):void{
var ratio:Number = event.bytesLoaded/event.bytesTotal;
//loadBar.width += loadBarWidth/loadedObjectNumber ;
loadBar.scaleX = ratio;
}