Solved

Flex Databind to Lineseries

Posted on 2009-05-06
4
455 Views
Last Modified: 2012-05-06
I'm creating lineseries using below code
var myLineSeries:LineSeries = new LineSeries();
myLineSeries.visible = allSegmentChartsOn;

I want the visible should be driven from allSegmentChartsOn boolean which is bindiable variable.
defined as :
[Bindable] private var allSegmentChartsOn:Boolean=true;

is there anyway I need to do in order the visibility should be changed as we change allSegmentChartsOn  variable in the code?
[Bindable] private var allSegmentChartsOn:Boolean=true;
var myLineSeries:LineSeries = new LineSeries();
myLineSeries.visible = allSegmentChartsOn;

Open in new window

0
Comment
Question by:SimonHowald
  • 2
  • 2
4 Comments
 

Author Comment

by:SimonHowald
ID: 24332994
any one?
0
 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 24333586
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.
0
 

Author Closing Comment

by:SimonHowald
ID: 31578862
You are a real Flex master!

Thanks!
0
 
LVL 37

Expert Comment

by:zzynx
ID: 24349506
Thanx 4 axxepting
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question