1
votes

I'm trying to edit an HTML that uses swfobject to load a flash file.

What I'm trying to do is to reduce the size of the SWF file.

I've tried editing the height and width parameter within the swfobject(), but that didn't work.

I tried reducing the width height in the HTML css, but that also didn't work..

How can I pass a 'width' or a 'height' parameter to the swfobject so it will actually load the swf in a smaller or 'zoomed out' way?

Thanks,

2
on load of the swf scale the application to fit the container that it is loaded in.The_asMan

2 Answers

2
votes

Depending on which version of swfobject, and which embed method you are using it may vary slightly, but in general a call to swfobject.embedSWF looks like this:

swfobject.embedSWF(   "myMovie.swf", 
                      "divIdToReplace", 
                      "100%", 
                      "900", 
                      "9.0.0",
                      "expressInstall.swf", 
                      flashvars, params, attributes
                  );

In this example I have set my width to 100% and my height to 900 pixels. If you are doing the embed in another way, post some code and perhaps I can help.

** NOTE **
Just because you can resize the container doesn't automatically mean you can "zoom out" on the swf. If the swf has "no scale" set, then instead of zooming out, you will just be cropping the swf.

** EDIT **
You can try setting the params object to include scale:"default", like this for example:

var params = {
            menu: "false",
            salign: "LT",
            scale: "default",
            quality: "high"
};

This is the params object you would pass into embedSWF like I have shown above.

1
votes

You should create a container/wrapper for the SWF, set the width/height of the SWF to be 100%, then scale the container to whatever size you desire. This is covered in an older Stack Overflow post: Resize an SWF when loading it with SWFObject

Additional examples for using SWFObject and 100% scaling: http://learnswfobject.com/advanced-topics/100-width-and-height-in-browser/