aodz

Posts Tagged ‘bindable

the Bindable tag is widely used in flex and in simpleterms its used to bind an entity to other entity if there is a change in the source.
The tag can have the following form:

[Bindable]
public var foo;

The Flex compiler automatically generates an event named propertyChange for the property. If the property value remains the same on a write, Flex does not dispatch the event or update the property.

You can also specify the event name, as the following example shows:

[Bindable(event=”fooChanged”)]
public var foo;

In this case, you are responsible for generating and dispatching the event, typically as part of some other method of your class. You can specify a [Bindable] tag that includes the event specification if you want to name the event, even when you already specified the [Bindable] tag at the class level.

In order for binding to work you need to make sure changes to the data are known to the framework. Unlike most of dynamic languages implementations, ActionScript 3 is built for speed and heavily utilizes direct access to the properties and methods. In this situation the only way for data to notify the world about the changes is to embed the code to fire change events.

Flex compiler helps in a big way by introducing [Bindable] and [Managed] tags. If you prefix your variable with [Bindable] tag, compiler does the following:
1. Inspects every public property and setter of you variables class and generates wrapper getters/setters that adds event notification.
2. Every time “bindable” property is being used, compiler references these getters/setters instead of original properties

Advertisements
Tags: ,

I have moved to a different location

check out my new home Flexout

calendar

November 2017
M T W T F S S
« May    
 12345
6789101112
13141516171819
20212223242526
27282930  

Blog Stat

  • 83,759 Hop's so far!!!

follow me

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Archives

Linkedin Blogger Twitter Youtube Orkut

latest flickr photos

top rated