我正在使用flexmojos 3.8和flex编译器4.1.0.16248
我的项目在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 Compiler 4.1应该知道UncaughtErrorEvent类型 - 它为什么会失败?
答案 0 :(得分:2)
您需要定位Flash Player 10.1而不是10.0
不确定如何在Maven中执行此操作,但这可能是您的问题。
答案 1 :(得分:1)
找到解决方案:
<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>