?
Solved

Flex Databind to Lineseries

Posted on 2009-05-06
4
Medium Priority
?
459 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

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

Accepted Solution

by:
zzynx earned 2000 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

777 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