AS3 错误:通过静态类型为 Class 的引用访问可能未定义的属性STANDARD_OUTPUT_DATA



我有一个在Flex Builder 4.6中编译和运行的Flex AIR项目。我正在尝试创建一个将构建项目的 Ant 脚本。在这些行上,我收到以下错误:

        _process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
        _process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
        _process.addEventListener(NativeProcessExitEvent.EXIT, onNativeProcessExit);

我收到此错误:

[mxmlc] MyClass.as(190): col: 44 Error: Access of possibly undefined property STANDARD_OUTPUT_DATA through a reference with static type Class.
[mxmlc]             _process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
[mxmlc]                                                     ^
[mxmlc] MyClass.as(191): col: 44 Error: Access of possibly undefined property STANDARD_INPUT_PROGRESS through a reference with static type Class.
[mxmlc]             _process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);

据我所知,这些是在 frameworks/libs/air/airglobal.swc 中定义的。我想我把它包含在下面的编译器.external-library-path元素中。

我的 build.xml ant 脚本的编译目标如下所示:

<target name="compile" depends="init">
  <mxmlc file="${MAIN_SOURCE_FILE}" output="${DEPLOY_DIR}/${APP_NAME}.swf"
       services="${APP_ROOT}/services/flex/services-config.xml">
    <swf-version>13</swf-version>
    <locale>en_US</locale>
    <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
    <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
     <source-path path-element="${FLEX_HOME}/frameworks"/>
    <source-path path-element="${APP_ROOT}/../MyLib/src"/>
    <source-path path-element="${APP_ROOT}/src"/>
    <compiler.external-library-path dir="${FLEX_HOME}/frameworks" append="true">
        <include name="libs/air" />
        </compiler.external-library-path>
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
                    <include name="libs" />
                    <include name="../bundles/{locale}" />
                </compiler.library-path>
    <compiler.library-path dir="${APP_ROOT}" append="true">
                    <include name="libs" />
                    <include name="libs/player" />
                </compiler.library-path> 
    <define name="CONFIG::debugging" value="false"/>
     <compiler.debug>false</compiler.debug>             
  </mxmlc>

我认为您想将<load-config>更改为其中之一:

<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>

<load-config filename="${FLEX_HOME}/frameworks/airmobile-config.xml"/>

最新更新