views:

18

answers:

1

I have a <canvas> based game which I want to port to Air. The <canvas> is 480x480, now I want to make the window size fit to the canvas, normally one would do this with innerWidth and innerHeight. Even though air changes the values of both properties, the window size remains unchanged.

Of course, I could just specify the application size as 480x480, but unfortunately this includes the window chrome(title bar etc.), so it will break as soon as someone on another system runs it, and I don't want scrollbars to overlay my game.

A: 

OK, apparently the normal DOM interface isn't good enough for Adobe so they had to do their own thing here:

window.nativeWindow.stage.stageWidth

Is the equivalent of window.innerWidth, this is hardly documented anywhere, although the documentation mentions both stage and stageHeight, it never tells one to which objects these properties belong.

Ivo Wetzel
stage.nativeWindow.width = stage.nativeWindow.height = 480; it's totally documented: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/NativeWindow.html
TheDarkInI1978