开发者

Change Width/Height of SWF

开发者 https://www.devze.com 2023-03-23 03:24 出处:网络
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'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,


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.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号