嵌入 Flash 电影时,您可以指定一个参数来指示电影播放的“质量”。这通常会影响 Flash 运行时是否会对您的形状和视频内容进行抗锯齿处理。更多信息在这里。
有谁知道这个参数的默认值?Adobe 忽略了记录默认值。根据经验,它在 Mac 和 Windows 上似乎都是“高”或“自动高”(独立于浏览器),但我无法辨别是哪一个。
总结:根据经验,质量参数的默认值是“high”,而不是“autohigh”。
Andi Li 提供的代码是一个好的开始,但它实际上并没有告诉您设置是“high”还是“autohigh”。Autohigh 将随着帧率的变化实时修改电影的质量。如果帧速率低于某个阈值,Flash 运行时会将质量更改为“低”。
我使用了以下代码片段,它使用启发式方法通过大量绘制并等待阶段报告的质量从“高”过渡到“低”来检测设置是“高”还是“自动高”。如果它没有过渡,则意味着质量很高,而不是 autohigh。
在没有指定质量参数的嵌入中运行此代码(因此它将使用默认值)在以下平台上测量的质量值为高(不是自动高):
操作系统:Win XP、Win 7、OSX
浏览器:IE6、IE7、IE8、FF3、FF3.5、Safari 3、Safari 4、Windows XP 上的 Safari 4
Flash 版本:9.0.28、9.0.124 和 Flash 10(发布,不是调试版本)
这是实验:
<?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>
根据 SWFObject,默认值很高(对他们来说):http ://blog.deconcept.com/swfobject/
此页面未指定: http: //kb2.adobe.com/cps/127/tn_12701.html。
为什么你不能只指定你想要的值并消除所有疑问?如果浏览器和播放器版本(6-10)之间确实存在差异,我不会感到惊讶。但是,如果它是一致的并且也没有记录,我不会感到惊讶。:)
当您在 Flex Builder 中新建一个 Flex 项目时,生成的 html 模板 (index.template.html) 显示质量很高(使用 Flex SDK 3.3)。
在 Flash CS4 中,发布设置 (html) 中的默认值也很高。
正如 Jim 所说,您可以在运行时显示质量值。您可以使用的普通 AS3 项目stage.quality
。对于 Flex,这里是示例:
<?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>