Flex 4不会识别flash.events.UncaughtErrorEvent

win*_*nut 3 flexbuilder flex4

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
}
Run Code Online (Sandbox Code Playgroud)

这给出: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. 闪存integration.swc
  10. flex.swc
  11. utilities.swc

有任何想法吗?

Mar*_*ark 5

您需要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播放器不支持此功能.