1

我正在使用带有 flex 编译器 4.1.0.16248 的 flexmojos 3.8

我的项目在 Flash Builder 中编译得很好,但是使用 flexmojos / maven 我得到以下错误:

Type was not found or was not a compile-time constant: UncaughtErrorEvent

Flex 代码如下所示:

loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);

Flex 编译器 4.1 应该知道 UncaughtErrorEvent 类型 - 为什么会失败?

4

2 回答 2

2

您需要以 Flash Player 10.1 而不是 10.0 为目标

不确定如何在 Maven 中执行此操作,但这可能是您的问题。

于 2011-04-28T15:29:12.840 回答
1

找到解决方案:

flexmojos 邮件列表

<dependency>
  <groupId>com.adobe.flex.framework</groupId>
  <artifactId>flex-framework</artifactId>
  <version>${flex.version}</version>
  <type>pom</type>
  <exclusions>
    <exclusion>
      <groupId>com.adobe.flex.framework</groupId>
      <artifactId>playerglobal</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>com.adobe.flex.framework</groupId>
  <artifactId>playerglobal</artifactId>
  <version>${flex.version}</version>
  <classifier>10.1</classifier>
  <type>swc</type>
</dependency>
<plugin>
    <groupId>org.sonatype.flexmojos</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        ...
        <targetPlayer>10.1</targetPlayer>
        ...
    </configuration>
</plugin> 
于 2011-04-29T08:39:56.810 回答