這裏的,我一直在試圖找出,但仍不能得到正確的方法來解決這個問題還沒有問題。沒有得到stage.stageWidth和stageHeight在Firefox 3.5
我在Mac上使用Firefox 3.5的時候,我可以看到我的菜單,顯示的是正確的關於顯示問題。菜單剛好位於它應該定位的位置上方。它適用於MACOSX上的Safari。 我的閃存大小是:1440x750
它看起來像Firefox無法識別stage.StageWidth和stage.StageHeight。它返回0。
一些建議實施是通過FlashVars電影的實際寬度和高度來傳遞。影片使用這些替代stage.stageWidth和stage.stageHeight
有沒有人有一個如何解決這個問題的代碼的例子? 讚賞點我出正確的方式
我使用與enterFrame事件方法的正確方法?
public function Main()
{
addEventListener(Event.ADDED_TO_STAGE, handleOnStage, false, 0, true);
}
private function handleOnStage(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, handleOnStage);
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, handleResizeObjectsOnStage, false, 0, true);
addEventListener(Event.ENTER_FRAME, handleObjectsOnStage, false, 0, true);
bottomBarMC.x = 0;
bottomBarMC.y = 0;
}
private function handleObjectsOnStage(event:Event):void
{
if (stage.stageWidth != 0 && stage.stageHeight != 0) {
removeEventListener(Event.ENTER_FRAME, handleObjectsOnStage);
initIntro();
initObjectsOnStage();
}
}
private function handleResizeObjectsOnStage(event:Event=null):void
{
if (stage.stageWidth != 0 && stage.stageHeight != 0) {
initObjectsOnStage();
}
}
private function initObjectsOnStage():void
{
// Resize dynamically bottomBarMC
bottomBarMC.width = stage.stageWidth;
bottomBarMC.height = stage.stageHeight;
addChild(bottomBarMC);
// Resize dynamically logo
logoMC.x = 40;
logoMC.y = stage.stageHeight - 100;
addChild(logoMC);
var loadIntro:Sprite = getCurrentMC();
//loadIntro.x = stage.stageWidth;
//loadIntro.y = 0;
addChild(loadIntro);
}
如果我想包括將Stage.align,在Stage.scaleMode和stage.addEventListener。 我應該把他們放在哪裏? stage.align = StageAlign.TOP_LEFT; stage.scaleMode \t = StageScaleMode.NO_SCALE; \t \t \t stage.addEventListener(Event.RESIZE,handleResizeObjectsOnStage,false,0,true); – Qpixo 2010-06-07 19:04:32
如果您正在使用外部AS文件,請將其放在文檔類的構造函數的頂部。 如果你只是在Flash IDE工作時間表,然後把它放在第1幀的主時間軸上。 – 2010-06-07 21:31:22