A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Resize SWF

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702

    Resize SWF

    Has anyone had any success with resizing the SWF to fit the user's screen res?

    I tried that 100% but that seems to only work in IE.

    When I tried that in Firefox it made the site the size of a thumbnail.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,317
    Yeh my site is the same. It only works for IE, FF and NS dont seem to support the feature
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Here is a script I found on Dreamworks website. It resizes the flash movie to the user's resolution. Can anyone modify this to work with anyone elses website? I'm not much of a javascript person.
    Code:
    <script language="JavaScript">
    sw = 985; 
    sh = 600;
    if (screen.width >= 640) {sw = 580; sh = 353};
    if (screen.width >= 800) {sw = 720; sh = 438};
    if (screen.width >= 1024) {sw = 950; sh = 579};
    if (screen.width >= 1152) {sw = 1052; sh = 640};
    if (screen.width >= 1280) {sw = 1180; sh = 719};
    if (screen.width >= 1600) {sw = 1400; sh = 853};
    
    <!--
    var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
    // Handle all the FSCommand messages in a Flash movie.
    function dwmovies_v2_DoFSCommand(command, args) {
    	var dwmovies_v2Obj = isInternetExplorer ? document.all.dwmovies_v2 : document.dwmovies_v2;
    	//
    	// Place your code here.
    	//
    }
    // Hook for Internet Explorer.
    if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    	document.write('<script language=\"VBScript\"\>\n');
    	document.write('On Error Resume Next\n');
    	document.write('Sub dwmovies_v2_FSCommand(ByVal command, ByVal args)\n');
    	document.write('	Call dwmovies_v2_DoFSCommand(command, args)\n');
    	document.write('End Sub\n');
    	document.write('</script\>\n');
    }
    //-->
    </script>
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    TM & © 2005 DreamWorks LLC. All Rights Reserved.
    
    PLAY
    -->
    
    <div class="boundingbox" align="center" id="container">
    <script>
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + sw + '" height="' + sh + '" align="middle">');
          document.write('<param name="allowScriptAccess" value="sameDomain"/>');
          document.write('<param name="movie" value="dwintro.swf"/>');
    	  document.write('<param name="quality" value="best"/>');
          document.write('<param name="bgcolor" value="#000000"/>');
          document.write('<embed src="dwintro.swf" quality="best" bgcolor="#000000" width="' + sw + '" height="' + sh + '" swliveconnect="true" id="dwmovies_v2" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/></embed>');
    document.write('</object>');
    
    </script>
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

  4. #4
    Degenerate and baise art thou. docree's Avatar
    Join Date
    Feb 2001
    Location
    USA
    Posts
    390
    Please search, as mentioned in the sticky...
    Though, here's the answers.
    http://www.flashkit.com/board/showthread.php?t=628118
    ______________
    Also, you don't need a java script like that.
    [Unless, you have sites made for each specific size.]

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    I did search...Anyway, here is the solution.

    Set your sizes to 100%
    Both height and width. Make sure you change all four occurances.

    Then open the HTML file and delete the document type declaration. It will look like this.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    REMOVE IT COMPLETELY!
    Save the file and enjoy.
    It works in IE, Firefox and Netscape. I don't have any others to test it in.
    My Sites: Gaming Site Nightshade Studios MyKM Tutorials

    --------------------------------------------------
    What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape

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