I want my SWF to fill the browser window, but it's not working in Chrome/FireFox unless the user manually resizes the browser.
I'm using Adobe's default, generated html + swfobject.js to show my SWF. In the html, I replaced all flashcontent heights and widths with 100%.
Unfortunately, in Chrome when you first open the page the Flash MovieClip doesn't fill the browser and instead retains it's default height and width. If the user resizes the browser window, everything works fine.
Is there a javascript trick or something I can do to make the Flash think it's being resized?
Thanks!
Clarification: I guess my first ask was not clear. I NEVER want scrollbars to appear. I want my application to scale and fill the browser window perfectly -- I want it to get really small if the browser is small and really big if the browser is big. Basically, I want my app to run like a normal Windows app, such as Visual Studio, but in a browser.
On FireFox and Chrome, swfobject doesn't raise an Event.RESIZE event on the flash side when the SWF first runs. Below is the new code I have for sizing my application to full browser on startup and on each resize. Basically, it triggers a fake resize when the application first loads.
private function initializeStage():void
{
this.stage.align = StageAlign.TOP_LEFT;
this.stage.scaleMode = StageScaleMode.NO_SCALE;
this.stage.addEventListener(Event.RESIZE, stageResizeHandler);
this.addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
}
private function addedToStageHandler(event:Event):void
{
this.removeEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
stageResizeHandler(null);
}
private function stageResizeHandler(event:Event):void
{
if (this._frameContainer != null) //_frame container is the sprite that contains my entire application.
{
this._frameContainer.width = this.stage.stageWidth;
this._frameContainer.height = this.stage.stageHeight;
}
}