# \[AS3\] autosize and center Swf with maximum size restriction

**URL:** <https://forum.kirupa.com/t/as3-autosize-and-center-swf-with-maximum-size-restriction/321969>\
**Category:** flash\
**Created:** [May 5, 2011, 7:01pm UTC](https://forum.kirupa.com/t/as3-autosize-and-center-swf-with-maximum-size-restriction/321969 "2011-05-05T19:01:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaxx0rr](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jaxx0rr](https://forum.kirupa.com/u/jaxx0rr)\
**Post date:** [May 5, 2011, 7:01pm UTC](https://forum.kirupa.com/t/as3-autosize-and-center-swf-with-maximum-size-restriction/321969/1 "2011-05-05T19:01:52Z")

</div>

it resizes the swf only for users with small screens so it will not fill screen even if exported with 100x100%

I searched for this alot but managed to do it myself… in case anyone needs:

```auto

<table style="width:100%; height:100%;">
<tr>
<td style="width:100%; height:100%;">
    <div align="center" style="max-height:800px; width:100%; height:100%;">
        <div style="width:100%; height:100%; max-width:1500px;">

        //swf object comes here

        </div>
    </div>

    </td></tr></table>

```
