Sunday, June 29, 2008

Expand to Fill Browser

Here's how to make a dcr expand to fill a browser window. The settings in the embed tag cause the size of the stage to expand to fill 100% of the width and height of the browser. In the code of the movie, you must watch for changes in the stage.rect and then resize your 3d sprite accordingly. In the case where the whole stage is filled by a single 3d sprite, this is trivial.

This will cause the 3d sprite to completely fill the browser. On resize, all 2d interface overlay will need to reposition themselves so that they remain anchored to the corners or sides of the scene.


Shockwave settings.


fcSprite_StretchToStage behavior


Live example: http://forgefx.com/posts/stagestretch/StageStretch.htm
Example dir: http://forgefx.com/posts/stagestretch/StageStretch.zip