5 Replies Latest reply on May 27, 2011 12:26 PM by adninjastrator

    swf adjustment in the browser


      I have a swf file (1024×768) opening the file in the browser,

      it is  centered & full screen but in a matter of second it changes

      to a  smaller size and moves to the top left corner !!





      p.s. I have bought a zoom/pan control from activeden, using it in my flash

      file is causing the problem, I have tried looking into actionscript xml & java file,

      included in the package, so far no luck!!


      Plzzzzz help Thanks

        • 1. Re: swf adjustment in the browser
          robdillon Most Valuable Participant

          The file looked fine to me. It did not resize after opening. Did you solve it?

          • 2. Re: swf adjustment in the browser
            TabriziS Level 1

            Thanks for your response, No the problem remains unsolved do you see it

            centered in the page?!!!!

            I'm viewing it on a 21" monitor and it's not centered! maybe on a smaller

            monitor it seems different

            • 3. Re: swf adjustment in the browser
              adninjastrator Level 4

              Here is something for you to play with... first be sure to use a DOCTYPE at the top:



              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <html xmlns="http://www.w3.org/1999/xhtml">
              <title>ZOOM / PAN Controls – with Dynamic Image and Settings</title>
              <script type="text/javascript" src="swfobject.js"></script>
              <style type="text/css">
              html, body{
              #zoomFlash {

              <body bgcolor="#3333CC">

                  <div id="zoomFlash">
                <script type="text/javascript">   
                   var so = new SWFObject("show_all.swf", "zoomFlash", "100%", "100%", "9", "#FFFFFF");
                    so.addParam("wmode", "opaque");
                 so.addParam("allowFullScreen", "true");
                 so.addParam("scale", "exactfit")   



              Change the name of the .swf to match your .swf file name. Test various other scaling params..

              For more on Flash "scaling" :


              Here are examples of different scaling parameters available in the Publish settings. You can also add these parameters directly in the html (<param name="scale" value="noscale"). All the examples replace the actual Flash dimensions with 100% for both width and height (width="100%" height="100%"). These examples use the old <object> and <embed> to illustrate the different ways to scale Flash. Once you understand how it works I’d recommend that you use swfobject to place the Flash in your final project.

              View the source code for each page to see the full code.




              "exactFit" scales the file to fit exactly within the confines of the screen, irregardless if the movie becomes consequently distorted. The original aspect ratio is not maintained. So round things are not round and squares are not square.




              "noScale" is the default setting, and causes the movie to be displayed at the originally designed dimensions.



              "noBorder" causes the movie to be scaled to what ever dimensions are needed to have no border surrounding the movie within the player, which consequently could result in some of the movie being cut off from view. In other words, the movie will maintain the original aspect ratio and will fill the screen completely. But if the movie has to be streched wider to fill both sides of the screen, it will also stretch taller, but then some of the top and the bottom of the movie may be cut off from view.




              "showAll" scales the movie to the size of the screen (which could cause pixelation if the file contains raster information), the difference between showAll and exactFit is that showAll mantains initial movie size proportions. Because it maintains the original aspect ratio, there can be space to the sides or the top and bottom. But everything always shows and they are not distorted. But notice the photo in the center, it becomes pixilated at larger screen resolutions.

              The trickiest part of trying to go full screen is that it’s difficult to make the Flash wider without making it taller also, that is, to maintain the correct proportions or aspect ratio of everything on the stage. These methods are just simple scaling accomplished with html. There are also methods to dynamically scale the stage and it’s elements using Actionscript… but that’s a much more complex undertaking.

              Best wishes,

              Eye for Video



              Best of luck on your project!

              1 person found this helpful
              • 4. Re: swf adjustment in the browser
                TabriziS Level 1

                Thanks a lot for the detailed response and your time,

                I tried your code & kept my fingures crossed, still the same

                result but I'll try reading your resources.


                It's coming from within the zoom package, whatever it is

                which I have to figure it out

                • 5. Re: swf adjustment in the browser
                  adninjastrator Level 4

                  Yes, I agree. By renaming the "zoom.swf" file to "zoom2.swf" (to prevent it from loading), your main holder .swf scales just fine.

                  Do you have the .fla for the zoom?

                  Something in there is fighting against what the browser is wanting to do... hhummmmm???


                  1 person found this helpful