3

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
}

This gives: apitester.mxml 1046: Type was not found or was not a compile-time constant: UncaughtErrorEvent. /apitester/src line 35 Flex Problem

According to Adobe it is available in flex and Air.

The Flex 4/Eclipse build path shows:

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

Any ideas?

wingnut
  • 1,193
  • 2
  • 16
  • 25
  • I just updated to flash builder 4.0.1 and same problem. I also checked the auto complete on import flash.events.xx and there is no UncaughtErrorEvent. how do I create a global exception handler in my app? – wingnut Oct 29 '10 at 18:26

2 Answers2

5

You need the Flex 4.1 SDK.

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

Also you need to specify to the flex compiler that you are require flash player 10.1 (not the minimum version required by the SDK which is 10.0) because earlier versions of the flash player do not support this.

Mark
  • 66
  • 3
1

You can simply add the playerglobal.swc from Flex SDK 4.1/frameworks/libs/player/10.1 to your build path. When you do so, you have to remove the linkage to the original framework playerglobal.swc

abedurftig
  • 1,118
  • 1
  • 12
  • 24