3

In my job I'm embedding SWF files into HTML documents all the time. I often asked myself a few things:

Is it scaleMode="noscale" or scale="noscale"? And are the values case-sensitive? I saw a few code snippets like scale="noScale" etc.

How is the syntax in ActionScript? Is it the Camelcase noScale? I don't care about the HTML standards I'd just like to know how it is from the Flash developers perspective.

Anyone has a clue? I checked Google a lot of times but I have never found something like a conformance description. I just found the Adobe page that describes the parameters and values but that does not answer any of my questions.

Thanks a lot! :)

2 Answers 2

9

Found answer in Google in 3 seconds:

scale - Possible values: showall, noborder, exactfit, noscale. Specifies how Flash Player scales SWF content to fit the pixel area specified by the OBJECT or EMBED tag. default (Show all) makes the entire SWF file visible in the specified area without distortion, while maintaining the original aspect ratio of the movie. Borders can appear on two sides of the movie. noborder scales the SWF file to fill the specified area, while maintaining the original aspect ratio of the file. Flash Player can crop the content, but no distortion occurs. exactfit makes the entire SWF file visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur. noscale prevents the SWF file from scaling to fit the area of the OBJECT or EMBED tag. Cropping can occur.

More info here

Edit: I think case-sensitivity depends on the browser, but following xhtml standards you should always use lowercase.

Edit2: scaleMode on the other hand is a property of Stage object in ActionScript, so it is used to set scale mode in SWF movie, that is not embeded. When you embed the swf, that param is overriden with what you've set up in your HTML.

3
  • That's the page I wrote about. But it does not answer my questions. ;) There are scaleMode parameters all over the web. So what's the difference? And if there is no difference, what's the right (and up to date) one (also from the Flash developers perspective)? I will edit my question. And I don't need XHTML standards when using HTML5 but thanks anyways. :) Nov 7, 2011 at 14:37
  • Sorry, I misunderstood you at first. I have edited my answer.
    – package
    Nov 7, 2011 at 15:57
  • 2
    Found answer in SO in 2 seconds.
    – ericosg
    Jul 22, 2014 at 11:55
2

If you're setting your scale mode via ActionScript, you use the scaleMode property of the Stage object. If you're setting it via JavaScript or HTML markup, you use scale in a <param> node.

Regarding capitalization, Adobe's documentation for scaleMode (ActionScript) has used camel case consistently for as long as I can remember (at least the last 6 years). The current AS3 docs clearly use camel case. The article linked above is referring to scale in JavaScript/HTML, not ActionScript. It seems that camel case across-the-board is the safest route, you can be sure it will be supported.

Here are some scale examples using using SWFObject:

SWFObject dynamic:

var flashvars = {};
var params = { scale: "noScale" };
var attributes = {};
swfobject.embedSWF("/swf/sample.swf", "flash", "100%", "100%", "9", false, flashvars, params, attributes);

SWFObject static:

<object id="flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">
  <param name="movie" value="/swf/sample.swf" />
  <param name="scale" value="noScale" />
  <!--[if !IE]>-->
  <object type="application/x-shockwave-flash" data="/swf/sample.swf" width="100%" height="100%">
  <param name="scale" value="noScale" />
  <!--<![endif]-->
    <p>Place fallback content here for users who don't have Flash<p>
  <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
</object>

Examples and a description of the scale options:

http://learnswfobject.com/advanced-topics/100-width-and-height-in-browser/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.