Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 LoaderInfo.width!=flex 3.5中的舞台宽度_Actionscript 3_Apache Flex_Actionscript_Flex3_Loaderinfo - Fatal编程技术网

Actionscript 3 LoaderInfo.width!=flex 3.5中的舞台宽度

Actionscript 3 LoaderInfo.width!=flex 3.5中的舞台宽度,actionscript-3,apache-flex,actionscript,flex3,loaderinfo,Actionscript 3,Apache Flex,Actionscript,Flex3,Loaderinfo,在flex 3.5中遇到奇怪的行为。下面是一个最低限度的代码: build.xml目标: <target name="player"> <mxmlc file="${APP_ROOT}/player.mxml" output="${APP_ROOT}/player_old.swf" keep-generated-actionscript="false" static-

在flex 3.5中遇到奇怪的行为。下面是一个最低限度的代码: build.xml目标:

<target name="player">
        <mxmlc
            file="${APP_ROOT}/player.mxml"
            output="${APP_ROOT}/player_old.swf"
            keep-generated-actionscript="false"
            static-link-runtime-shared-libraries="true"
            debug="false">
            <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
            <source-path path-element="${FLEX_HOME}/frameworks"/>
            <compiler.library-path dir="${APP_ROOT}" append="true">
                <include name="lib"/>
            </compiler.library-path>
        </mxmlc>
</target>
对象:

<object width="320" height="240" id="_261178285" name="_261178285" data="player_old.swf" type="application/x-shockwave-flash">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="quality" value="high">
<param name="cachebusting" value="true">
<param name="wmode" value="opaque">
<param name="flashvars" value="config={irrelevant}">
</object>
这会导致这样一种情况:添加到应用程序中的视频(包含在精灵中)仅显示为250x154左右的大小,因为500x375被压缩到页面上包含的320x240元素中

接下来的问题是:是否有可能以任何方式避免此错误,以便swf仍能使用flash 9.0.115版。我也不希望在build.xml文件中硬编码大小,因为播放器大小在短期内可能会改变


免责声明:我使用flex 3.5作为必须支持的flash player 9.0.115和必须支持的flash 9.0.115,因为公司客户(甚至9.0.115似乎要求太多了)。我还注意到我可以编译.as而不使用.mxml,但我把它原样放在这里。

看看resp。标签上的
scale
属性。

就像一个符咒。谢谢,非常感谢。
package {
import flash.display.Sprite;
import flash.media.Video;
import flash.events.*;

    public class PlayerApp extends Sprite {
        public function PlayerApp() {
            this.loaderInfo.addEventListener(flash.events.Event.INIT, init);
        }

        private function init(e:Event):void {
            this.addChild(new Video());
            trace("loaderInfo: "+root.loaderInfo.width+"x"+root.loaderInfo.height+"\n");
            trace("root stage: "+root.stage.width+"x"+root.stage.height+"\n");
        }
    }
}
<object width="320" height="240" id="_261178285" name="_261178285" data="player_old.swf" type="application/x-shockwave-flash">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="quality" value="high">
<param name="cachebusting" value="true">
<param name="wmode" value="opaque">
<param name="flashvars" value="config={irrelevant}">
</object>
loaderInfo: 500x375

root stage: 320x240