2011-10-05 58 views

回答

1

你需要在HTML標籤中將flash寬度和高度設置爲100%,並且監聽Event.RESIZE處理程序以手動縮放和移動內容(如果需要)(使用stage.stageWidth/stage.stageHeight獲取新的尺寸)。

您還需要設置將scaleMode到一些有用的東西,如:stage.scaleMode = StageScaleMode.NO_SCALE;

3

喜歡的東西:

HTML:

<!doctype html> 
<html> 
    <head> 
     <title>Example</title> 

     <meta charset="utf-8"> 
     <link rel="stylesheet" type="text/css" href="your_styles.css"> 
    </head> 
    <body> 
     <object> 
      <embed src="your_flash.swf" /> 
     </object> 
    </body> 
</html> 

CSS:

html, 
body 
{ 
    height: 100%; 
    padding: 0px; 
} 

body{ overflow: hidden; } 

object, 
embed 
{ 
    width: 100%; 
    height: 100%; 
} 

AS3:

package 
{ 
    import flash.display.Sprite; 
    import flash.display.StageScaleMode; 
    import flash.display.StageAlign; 

    public class Document extends Sprite 
    { 
     /** 
     * Constructor 
     */ 
     public function Document() 
     { 
      stage.scaleMode = StageScaleMode.NO_SCALE; 
      stage.align = StageAlign.TOP_LEFT; 
     } 
    } 
} 
+0

謝謝,但我不斷收到錯誤封郵件像「1083:語法錯誤:包是意外」 – Marcus

+0

這個代碼進入一個外部.as文件,然後選擇爲.fla文件的文檔類。它沒有進入時間表。 – Marty

相關問題