Binding properties of Flex objects to a variable.

private var allSegmentChartsOn:Boolean=true;

[Bindable]
public function set segmentChartsOn(value:Boolean):void {
allSegmentChartsOn = value;
}
public function get segmentChartsOn():Boolean {
return allSegmentChartsOn;
}

var myLineSeries:LineSeries = new LineSeries();
myLineSeries.visible = allSegmentChartsOn;

>> is there anyway I need to do in order the visibility should be changed as we change allSegmentChartsOn  variable in the code?
// Yes. This line takes care of that:

BindingUtils.bindProperty(myLineSeries, “visible”, this, “segmentChartsOn”);

The above line adapts the “visible” property of myLineSeries whenever the “segmentChartsOn” property of ‘this’ changes.

Tags: ,


Did You Enjoy This Post?

Subscribe to our blog through our RSS feed or email to receive updates on more posts like this.post on your favourite social networking or media site to let others know about this post. Help us generate more buzz by submitting/voting for this post with the following buttons.

Leave a Reply











request new questions/article: send email to freequestionbank at gmail dot com