Ok, so one thing that has always bugged me about as3′s navigateToURL is its lack of control over the window that is opened, mainly that you can’t control the width and height. There are of course ways around this with javascript, but wouldn’t it be nice if you could do this from within as3, with no external dependencies! Well turns out you can do just that with this nifty little library.

Introducing AS3 Window.
You can download it via github.

In it’s simplest form, the following will open a new popup window with a width and height of 640×460 and will be placed 100 pixels from the left of the screen and 50 pixels from the top of the screen.

var window:Window = new Window();
window.width = 640;
window.height = 460;
window.x = 100;
window.y = 50;

You can close the window by calling the close() function.


[kml_flashembed publishmethod=”static” fversion=”10.0.0″ movie=”https://peteshand.net/media/swfs/AsWindow.swf” width=”550″ height=”40″ fid=”altContent” targetclass=”altContent” scale=”noborder” salign=”tl” wmode=”direct” allowfullscreen=”true” allowscriptaccess=”always” allowfullscreeninteractive=”true”]

Get Adobe Flash player


The library has numerous features, but I’ll leave that for another day.