views:

26

answers:

1

I'm not really sure how to go about it, but I'd like to have the swf get as big as possible for each user without requiring scrolling. Of course it would stick to a certain ratio, currently I'm using 2:1 but that could be changed (maybe I should use 16:9 since it is the standard widescreen ratio).

I am only using Actionscript 3 for code and MXMLC for compiling.

+3  A: 

Simply display the SWF (inside of the html) with 100% width and 100% height. That way it will use all the available space.

Then make sure you are setting Stage.scaleMode to no StageScaleMode.NO_SCALE and make sure that your content is able to redraw its layout based on the actual available space. In MXML you can do that by using Boxes and percental sizing and/or absolute margin positioning (by setting top/right/bottom/left to a fixed value on at least two sizes). If you are constructing the layout using code, you can make use of Stage.stageWidth and Stage.stageHeight to calculate the correct sizes of your elements and use the Event.RESIZE event to get notified when the movie changes it size for whatever reason.

poke
So if I wanted my swf to have 32 tiles across, each tiles width should be set to stageWidth/32?
Austin Kelley Way
Yes, or in MXML you simply use a HBox and 32 tiles next to each other. Although it might be better to add some threshold to prevent those tiles from being too small or too big (depends on the application though), in which case the distribution of the tiles could dynamically change.
poke
Accepting your answer but would appreciate futher input: How would I go about changing the distribution of tiles dynamically? Would I have some higher level area over the tiled area that can change its own tile-resoltion?
Austin Kelley Way
I did a quick example on Wonderfl: http://wonderfl.net/c/cM9C. Hit the lower *right* fullscreen button to see the working example; simply resize your browser window to see the effect. I have used a fixed box size now, but you can also easily change that depending on the stage size.
poke