views:

402

answers:

3

When embedding flash movies, you can specify a parameter indicating the "quality" of the movie's playback. This generally affects whether the Flash runtime will antialias your shapes and your video content. More info here.

Does anyone know the default value of this parameter? Adobe neglected to document the default value. Empirically, it appears to be "high" or "autohigh" on both Mac and Windows (independent of the browser), but I cannot discern which one.

A: 

According to SWFObject, default is high (for them): http://blog.deconcept.com/swfobject/

This page doesn't specify: http://kb2.adobe.com/cps/127/tn_12701.html.

Any reason why you can't just specify which value you want and remove all doubt? I wouldn't be surprised if it did vary between browsers and versions of the player (6-10). But then, I wouldn't be surprised if it was consistent and undocumented as well. :)

Glenn
Glenn, I'm looking to avoid making it explicit for two reasons: 1) a bizarre design constraint from an external party, and 2) to keep our embed snippets lean.
Phil Crosby
A: 

When you new a Flex project in Flex Builder, the generated html template (index.template.html) shows that quality is high (Using Flex SDK 3.3).

In Flash CS4, the default value in Publish setting (html) is also high.

As Jim said, you can show the quality value in runtime. Normal AS3 project you may use stage.quality. For Flex, here is the sample:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init();">
    <mx:Script>
     <![CDATA[
      import mx.controls.Alert;
      public function init():void {
       Alert.show(this.systemManager.stage.quality);
      }
     ]]>
    </mx:Script>
</mx:Application>
Andy Li
Thanks Andy. I'll take this snippet and run it against multiple platforms and flash combinations to determine if Adobe has been historically consistent.
Phil Crosby
Remember to tell us the result :)
Andy Li
+1  A: 

In summary: empirically, the default value for the quality parameter is "high", not "autohigh".

The code provided by Andi Li was a good start, but it doesn't actually tell you if the setting is "high" vs. "autohigh". Autohigh will modify the quality of the movie in real time as the framerate changes. If the framerate drops below a certain threshold, the Flash runtime will change the quality to "low".

I used the following code snippet which uses a heuristic to detect whether the setting is "high" or "autohigh" by drawing heavily and waiting for the quality reported by stage to transition from "high" to "low". If it doesn't transition, that means the quality is high, not autohigh.

Running this code in an embed without the quality parameter specified (so it will use the default value) had a measured quality value of high (not autohigh) on the following platforms:

OS: Win XP, Win 7, OSX
Browsers: IE6, IE7, IE8, FF3, FF3.5, Safari 3, Safari 4, Safari 4 on Windows XP
Flash versions: 9.0.28, 9.0.124 and Flash 10 (release, not debug versions)

Here's the experiment:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onCreationComplete();">
  <mx:Script>
    <![CDATA[
      import mx.containers.Box;
      import mx.controls.Alert;

      private var boxes:Array = [];

      public function onCreationComplete():void {
        this.qualityValue.text = this.systemManager.stage.quality;
        for (var i:int = 0; i < 2500; i++) {
          var box:Box = new Box();
          box.width = 300;
          box.height = 300;
          box.x = 200 + i;
          box.y = i;
          this.addChild(box);
          boxes.push(box);
        }
      }

      private function onEnterFrame(event:Event):void {
        for each (var box:Box in boxes)
          box.setStyle("backgroundColor", Math.random() * 100000);
        this.qualityValue.text = this.systemManager.stage.quality;
      }

      private function beginSlowdown():void {
        this.systemManager.stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
      }
    ]]>
  </mx:Script>
  <mx:VBox>

  <mx:Label text="Quality:"></mx:Label>
  <mx:Label id="qualityValue"></mx:Label>
  <mx:Button click="beginSlowdown()" label="Begin slowdown"></mx:Button>
  <mx:Label id="output"></mx:Label>
  </mx:VBox>
</mx:Application>
Phil Crosby