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 7839953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:36:34+00:00 2026-06-02T15:36:34+00:00

The following code shoud throw an Error #1009: Cannot access a property or method

  • 0

The following code shoud throw an Error #1009: Cannot access a property or method of a null object reference:

var label:Label;
label.text = value;

However, it doesn’t if it’s inside of a setter which is set by MXML data binding:

public function set buggySetter(value:String):void {
    var label:Label;
    label.text = value; //will fail silently
}

To reproduce this weird behaviour, first, create a simple custom component by extending s:Label:

package {
    import spark.components.Label;

    public class BuggyLabel extends Label {
        public function set buggySetter(value:String):void {
            var label:Label;
            label.text = value; //will fail silently
        }
    }
}

Sectond, add BuggyLabel to an Application and bind buggySetter:

<fx:Script>
    <![CDATA[
        [Bindable]
        public var foo:String = 'NULL has no properties';
    ]]>
</fx:Script>

<local:BuggyLabel buggySetter="{foo}"/>

Why does this app fail silently?

  • 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-06-02T15:36:36+00:00Added an answer on June 2, 2026 at 3:36 pm

    The answer to that question is actually fairly short: it’s an architectural decision made by the Flex SDK engineers. If you take a look at the Flex source code, you’ll see a try ... catch block swallowing most errors thrown in a Binding.

    Pro: makes it easier to use bindings, since you don’t have to account for all possible faulty states

    Con: it can be harder to debug (though if you know this can happen and you have good unit tests, you can reduce frustration from that side to nearly zero)


    The source code I was talking about can be found in mx.binding.Binding (in the ‘framework’ project) in method wrapFunctionCall(). Here’s the relevant part:

        try {
           ...
        }
        catch(error:Error)
        {
            // Certain errors are normal when executing a srcFunc or destFunc,
            // so we swallow them:
            //   Error #1006: Call attempted on an object that is not a function.
            //   Error #1009: null has no properties.
            //   Error #1010: undefined has no properties.
            //   Error #1055: - has no properties.
            //   Error #1069: Property - not found on - and there is no default value
            // We allow any other errors to be thrown.
            if ((error.errorID != 1006) &&
                (error.errorID != 1009) &&
                (error.errorID != 1010) &&
                (error.errorID != 1055) &&
                (error.errorID != 1069))
            {
                throw error;
            }
            else
            {
                if (BindingManager.debugDestinationStrings[destString])
                {
                    trace("Binding: destString = " + destString + ", error = " + error);
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following coffeescript code: try do something catch error log something throw
The following code should display the id out of the JSON-object, which I got
From my understanding the following should properly throw a custom error from a WCF
Consider the following code: // this method should add numbers, the requirements are: //
I am getting the following error: InvalidURLError: ApplicationError: 1 Checked my code, and logged
I have the following javascript code to play some HTML5 sounds: var html5_audiotypes={ //define
The following code should show a certain track in iTunes: NSString* iTunesPath = [[NSWorkspace
The following code should pop up an alert box whenever I select a file
The following code should exhibit intended functionality: <head> <style> a:active { color:teal; } a:hover
I know that the following code should show and hide a tiny circular progress

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.