A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: A couple of Flash Issues...

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    3

    A couple of Flash Issues...

    I want to scale my swf file to be fullscreen and stretched according to the users' browser windows. In my HTML code, under the <object classid> tag, I have this for scale: <param name="scale" value="exactfit" />

    The only problem with this is that it stretches it without maintaining the dimensions. I basically would like to know if there's a way to lock the aspect ratio so that it won't distort. Thank you in advance!

    B

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    117
    use the javascript below and on each the width etc thats on each page for example on 1600.htm page the display script could be like

    <object width="400" height="400">
    <param name="movie" value="yourfile.swf">
    <embed src="yourfile.swf" width="400" height="400">
    </embed>
    </object>

    and on 1280.htm it would be like

    <object width="300" height="300">
    <param name="movie" value="yourfile.swf">
    <embed src="yourfile.swf" width="300" height="300">
    </embed>
    </object>

    for example,i hope you get what i mean :P the width and height wil change in ratio to each screen resolution

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    if (screen.width == '1600')
    {location.href='1600.htm'}
    
    if (screen.width == '1280')
    {location.href='1280.htm'}
    
    if (screen.width == '1152')
    {location.href='1042.htm'}
    
    if (screen.width == '1024')
    {location.href='1024.htm'}
    
    if (screen.width == '800')
    {location.href='800.htm'}
    
    if (screen.width == '640')
    {location.href='640.htm'}
    
    if (screen.width <= '639')
    {location.href='640.htm'}
    </SCRIPT>
    EDIT**********
    i think the embed src part on the html flash embed script stays the same as the flash file and the other values change

  3. #3
    Senior Member
    Join Date
    Mar 2010
    Posts
    157
    may sound noob, but can't you just say

    location.href = screen.width;

    ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center