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

  • Home
  • SEARCH
  • 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 102495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:58:29+00:00 2026-05-11T00:58:29+00:00

As far as I understand, binding to a var in ActionScript is carried out

  • 0

As far as I understand, binding to a var in ActionScript is carried out via events which are automatically fired when a var is changed. I have a few questions about this:

  1. What happens if the class doesn’t explicitly extend EventDispatcher? Is there is some sort of magic that goes on in the compiler which essentially makes the class an EventDispatcher?
  2. How does binding to static vars work? Is some sort of implicit static addEventListener() function added to the class?
  3. I’ve noticed that you can put [Bindable] on static vars but not static functions, why is this?

Edit:

Thanks to Christophe Herreman for his illuminating answer. However, I have a few follow-ons from my questions above. I wonder if anyone could fill in the gaps for me (I tried to number these questions 4, 5, 6 but they show up 1, 2, 3 for some reason!)

  1. I’ve added the -keep option to the compiler and looked at the generated binding code. Could anyone explain how this code is applied? The compiler seems to generate a class called BindableProperty for each class, which contains the getter and setter. How does this get folded into the class I wrote? The feature looks kind of like partial classes in C# – is this exclusively behind-the-scenes compiler functionality, or is it something I could use myself?

  2. The BindableProperty class still does not explicitly implement EventDispatcher, how does the generated class implement event dispatching?

  3. In question 3, I asked about binding to static functions, but I actually meant static getter and setter functions. This doesn’t seem to be allowed.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T00:58:29+00:00Added an answer on May 11, 2026 at 12:58 am

    bindings do indeed work via event dispatching. You can learn a lot from the generated Actionscript code by adding the -keep flag to the compiler settings.

    I’ll try to answer your questions.

    1. the compiler will pick up the [Bindable] metadata tag and will create a getter and setter for each property you marked as bindable. The getter will just return the value of the property. The setter will check if the new value differs from the original value and will dispatch a PropertyChange event if it does.

    2. the same as for instance properties basically, only now a static getter and setter are created. In addition, a mx.binding.StaticPropertyWatcher is created to watch changes in the static properties.

    3. when binding to a static method, you get the following warning: ‘[Bindable] requires an event name parameter when applied to a function that is not a getter or setter.’ The description pretty much says it all. Since you don’t have a ‘propertyChange’ event that is triggered specifically for this method, you have to dispatch a custom one yourself. That is [Bindable(event=’customEvent’)] and then dispatch that event from somewhere in your class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, so I have been trying to iron out this data binding for a
I understand that the binding form allows rebindable dynamic scoping in clojure. So far
As far as I understand, if I want to get my database under source
As far as I understand, https is http plus SSL/TLS. What do I need
As far as I understand, the onchange event of a text input element is
As far as I understand the serial port so far, transferring data is done
As far as I understand WebRequest.PreAuthenticate is almost always good. If I enable it
As far as I understand the branch-on-sign is the name of some kind of
As far as I understand Objective C / iOS is very dynamic language, so
As far as I understand, visitor pattern is often used to add methods to

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.