【问题标题】:Flex 4 wont recognise flash.events.UncaughtErrorEventFlex 4 无法识别 flash.events.UncaughtErrorEvent
【发布时间】:2010-10-29 15:53:00
【问题描述】:

test.mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" x="0" y="0" width="703" height="609"  xmlns:ns1="*" >
<mx:Script>
<![CDATA[
import flash.events.*;
// stuff
private function onUncaughtError(e:UncaughtErrorEvent):void {
//Do Stuff
}

这给出: apitester.mxml 1046:找不到类型或不是编译时常量:UncaughtErrorEvent。 /apitester/src 第 35 行 Flex 问题

根据Adobe,它可以在 flex 和 Air 中使用。

Flex 4/Eclipse 构建路径显示:

Flex 4.0

  1. playerglobal.swc
  2. textLayout.swc
  3. osmf.swc
  4. framework.swc
  5. spark.swc
  6. sparkskins.swc
  7. rpc.swc
  8. datavisualisation.swc
  9. flash-integration.swc
  10. flex.swc
  11. utilities.swc

有什么想法吗?

【问题讨论】:

  • 我刚刚更新到 flash builder 4.0.1 和同样的问题。我还检查了 import flash.events.xx 的自动完成,没有 UncaughtErrorEvent。如何在我的应用中创建全局异常处理程序?

标签: flex4 flexbuilder


【解决方案1】:

您需要 Flex 4.1 SDK。

见:http://flassari.is/2010/06/global-error-handling-with-flash-player-10-1/

您还需要向 flex 编译器指定您需要 flash player 10.1(不是 SDK 所需的最低版本,即 10.0),因为早期版本的 flash player 不支持此功能。

【讨论】:

    【解决方案2】:

    您可以简单地将来自 Flex SDK 4.1/frameworks/libs/player/10.1 的 playerglobal.swc 添加到您的构建路径中。这样做时,您必须删除与原始框架 playerglobal.swc 的链接

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-14
      • 1970-01-01
      • 1970-01-01
      • 2023-03-30
      相关资源
      最近更新 更多