8 Replies Latest reply on Mar 4, 2012 8:53 AM by kglad

    embedding swf in html with smaller size

    myqwer

      hi,

       

      I want to embed an swf file that is on a different server.

       

      The thing is that i want the swf to be shown at a smaller size (500X333 instead of 900X600 ).

       

      The problem is that when i change width&height, the swf gets cut-off instead of show shrinking it.

       

      I tried playing with the params, but couldn't get it to work.

       

      what am i suppose to set?

       

       

      Thank you

       

      p.s.

       

      I don't think it matters but it's a swf of a flex project.

        • 1. Re: embedding swf in html with smaller size
          kglad Adobe Community Professional & MVP

          use percents for the width and height instead of absolute values.

          • 2. Re: embedding swf in html with smaller size
            myqwer Level 1

            Thank you for your reply.

             

            Sadly, it still cuts the swf. I don't get it.

             

            Maybe there's something to do in the flex project itself?

            • 3. Re: embedding swf in html with smaller size
              kglad Adobe Community Professional & MVP

              copy and paste your html embed code using percents.

              • 4. Re: embedding swf in html with smaller size
                adninjastrator Level 4

                You can easily change the display size of the .swf by changing the dimensions in the <object> params. So depending on your HTML embed code, it would look something like this:

                <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="333" id="test" align="middle">

                or

                <object type="application/x-shockwave-flash" data="test.swf" width="500" height="333">

                or the display dimensions may be hard coded in the swfobject code in the <head>... would have to see the exact embed code to be sure.

                Best wishes,

                Adninjastrator

                • 5. Re: embedding swf in html with smaller size
                  myqwer Level 1

                  Hi,

                   

                  Here's the code that just cuts the swf and doesn't shrink it like i want.

                   

                  As I said it's a flex project. Can it be that the dimension are hard coded in the project itself (don't know if that what you meant)?

                   

                   

                   

                  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

                    width="500" height="333"

                                                codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">

                                                <param name="movie" value="swfFile.swf" />

                                                <param name="quality" value="high" />

                                                <param name="bgcolor" value="#869ca7" />

                                                <param name="allowScriptAccess" value="always" />

                                                <embed src="swfFile.swf" quality="high" bgcolor="#869ca7"

                                                          width="500" height="333" align="middle"

                                                          play="true"

                                                          loop="false"

                                                          quality="high"

                                                          allowScriptAccess="always"

                                                          type="application/x-shockwave-flash"

                                                          pluginspage="http://www.adobe.com/go/getflashplayer">

                                                </embed>

                            </object>

                  • 6. Re: embedding swf in html with smaller size
                    kglad Adobe Community Professional & MVP

                    you're not using a percent.

                    • 7. Re: embedding swf in html with smaller size
                      adninjastrator Level 4

                      Appreciate your comments kglad! and while I agree that you can also use percents, I disagree that you must use percent dimensions to resize.

                      I've never had problems using exact pixel dimensions to resize while using percents less than 100% can produce unexpected results.

                      Here is a page displaying an original 500x500 .swf and then resized using pixel dimension and resized using %.

                      The resizing code is the code used by myqwer above... works fine either way... just not the same result....

                      So while either method (pixel or %) works on most .swfs, something else is preventing it from working for myqwer.

                      http://www.sqis.net/resize_test2.html

                      myqwer, can you please post a link to the actual page, there may be something we are not seeing.

                      Best wishes,

                      Adninjastrator

                      • 8. Re: embedding swf in html with smaller size
                        kglad Adobe Community Professional & MVP

                        you're right.

                         

                        he should be using a scale parameter though i though showall was default:

                         

                        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

                          width="500" height="333"

                                                      codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">

                                                      <param name="movie" value="swfFile.swf" />

                                                      <param name="quality" value="high" />

                                                      <param name="bgcolor" value="#869ca7" />

                                                      <param name="allowScriptAccess" value="always" />

                        <param name="scale" value="showall" />

                                                      <embed src="swfFile.swf" quality="high" bgcolor="#869ca7"

                                                                width="500" height="333" align="middle"

                        scale="showall"

                                                                play="true"

                                                                loop="false"

                                                                quality="high"

                                                                allowScriptAccess="always"

                                                                type="application/x-shockwave-flash"

                                                                pluginspage="http://www.adobe.com/go/getflashplayer">

                                                      </embed>

                                  </object>