Rectangle 27 0

actionscript 3 Flash AS3: Resize SWF but keep elements the same size?


Stage's resize event triggers every time the swf changes size, so you don't need to use ExternalInterface (it's less reliable and adds complexity). Also, you should set stage.scaleMode to "noScale" and stage.align to "TL" so the elements won't scale (you will do that manually) and they will be aligned to the top left corner (to maintain consistency with the display list).

Then, on each resize event you can check the new dimensions (stage.stageWidth and stage.stageHeight) and resize/relocate your elements individually (e.g. chatBox.height = stage.stageHeight)

Note