Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5847651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:44:54+00:00 2026-05-22T12:44:54+00:00

I’m trying to use the new(ish) AS3 global error handling class. I am trying

  • 0

I’m trying to use the new(ish) AS3 global error handling class. I am trying to use it within a Flex mxml application. I can’t get it to work at all. Below is an entire program that shows the problem. I set this to use Flash Player 10.2 and compiled with the Flex 4.5 SDK.

I’ve tried using Flex SDK 4.0 and 4.5 but I get the error in either case. I must be missing something obvious here. This is a normal Flex SWF file that will be shown on a web page. Assuming I could import the UncaughtErrorEvent, I would then do something like this to setup the event handler:

    if(systemManager.loaderInfo.hasOwnProperty("uncaughtErrorEvents")) {                   
        IEventDispatcher(
            systemManager.loaderInfo["uncaughtErrorEvents"]).addEventListener(
               "uncaughtError", uncaughtErrorHandler);
    }

this all seems horribly kludgy but I could live with that except that it doesn’t work! I’ve scoured the web and cannot find any docs or examples that explain how to make this work in my context. Any advice?

Complete program:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" applicationComplete="onApplicationComplete();"
                   >
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                private function onApplicationComplete() : void {
                    systemManager.loaderInfo.uncaughtErrorEvents.addEventListener("uncaughtError", uncaughtErrorHandler);
                }
                private function uncaughtErrorHandler(event:Event) : void {
                    trace(event.toString());
                }
            ]]>
        </fx:Script>
        <s:Button x="153" y="64" label="Trigger Error" id="triggerButton" click="throw new Error('myError')"/>
    </s:Application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:44:55+00:00Added an answer on May 22, 2026 at 12:44 pm

    Take from the API (which I recommend you look through next time):

    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/halo"
                           applicationComplete="applicationCompleteHandler();">
    
        <fx:Script>
            <![CDATA[
                import flash.events.ErrorEvent;
                import flash.events.MouseEvent;
                import flash.events.UncaughtErrorEvent;
    
                private function applicationCompleteHandler():void
                {
                    loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);
                }
    
                private function uncaughtErrorHandler(event:UncaughtErrorEvent):void
                {
                    if (event.error is Error)
                    {
                        var error:Error = event.error as Error;
                        // do something with the error
                    }
                    else if (event.error is ErrorEvent)
                    {
                        var errorEvent:ErrorEvent = event.error as ErrorEvent;
                        // do something with the error
                    }
                    else
                    {
                        // a non-Error, non-ErrorEvent type was thrown and uncaught
                    }
                }
    
                private function clickHandler(event:MouseEvent):void
                {
                    throw new Error("Gak!");
                }
            ]]>
        </fx:Script>
    
        <s:Button label="Cause Error" click="clickHandler(event);"/>
    </s:WindowedApplication>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.