我有一个在 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 中定义的。我想我将它包含在下面的 compiler.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>