Occasionally you want to make an application or game that responds to its window being resized. This can be useful in a desktop environment (resizing the window) or in a browser (resizing the browser the swf is in).
First, write an event handler for the resizing event.
Next, write the event listener in the document class constructor.
Remember to call the event handler once at the end of your constructor. This resizes your content based on the initial size of the window. This isn't important in Air, because you control the initial size of the window, but in a browser you do not have control over the initial size of the window when the user reaches your swf.