如何在AS3中设置swf的宽度和高度?

Aus*_*Way 2 flash height actionscript-3 width

如何在AS3中设置swf的宽度和高度?

到目前为止这是我的代码:

package {

    import flash.display.Sprite;
    public class Game extends Sprite {

    }

}
Run Code Online (Sandbox Code Playgroud)

现在,加载时它处于某个任意默认大小.

如果我不能以这种方式改变尺寸,那么是否有任何简单的解决方法可以保持一致?

Kar*_*han 10

试试看

[SWF(backgroundColor="#000000", width="200", height="400", frameRate="29")]
Run Code Online (Sandbox Code Playgroud)

在上面的行

public class Game extends Sprite {
....
Run Code Online (Sandbox Code Playgroud)

当然,你可以设置backgroundColor,width,height等.无论你想要什么.

希望能帮助到你!