Mark - Thanks - I'll take a look at that.
- Tom mark_g_wales wrote: > > > > Tom, > > I tried to take an excerpt of some existing code so there may be more > imports, etc. that are needed. Hopefully this is the effect you were > looking for... > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml > <http://www.adobe.com/2006/mxml>" xmlns:local="*"> > > <mx:Script> > <![CDATA[ > import mx.containers.HBox; > import mx.containers.Panel; > import mx.controls.Label; > import mx.controls.Spacer; > import mx.controls.sliderClasses.Slider; > import mx.events.IndexChangedEvent; > import mx.events.SliderEvent; > import mx.controls.HSlider; > > public var oldValue:int = 0; > public var criteria:Array = new Array(); > public var criteriaValues:Array = new Array(); > > public function addSlider():void { > var hbox:HBox = new HBox(); > vbox.addChild(hbox); > > var hslider:HSlider = new HSlider(); > hslider.id = new String(criteria.length); > hslider.width = 400; > hslider.height = 20; > hslider.maximum = 100; > hslider.liveDragging = true; > hslider.setStyle("trackColors", [0x999999, 0x999999]); > hslider.addEventListener(SliderEvent.CHANGE, slideControl); > var sliderDO:DisplayObject = vbox.addChild(hslider); > criteria.push(sliderDO); > > var hsliderValue:Label = new Label(); > hsliderValue.id = new String(criteria.length); > hsliderValue.htmlText = "<font size='18'>0</font>"; > var hsliderValueDO:DisplayObject = hbox.addChild(hsliderValue); > criteriaValues.push(hsliderValueDO); > > var spacer:Spacer = new Spacer(); > spacer.height = 50; > vbox.addChild(spacer); > } > > public function slideControl(event:SliderEvent):void { > > var currentSlider:int = new Number(event.target.id); > > // Redraw the box for the slider on each change/move > vbox.graphics.beginFill(0x999999, 1.0); > vbox.graphics.drawRect(event.target.x, event.target.y, > event.target.width, 20); > vbox.graphics.beginFill(0xffcc00, 1.0); > vbox.graphics.drawRect(event.target.x, event.target.y, event.value > * .01 * event.target.width, 20); > > // Set display value for currently selected slider > var sliderValue:String = new String(event.value).substr(0,2); > criteriaValues[currentSlider].htmlText = "<font size='18'>" + new > String(event.value).substr(0,2) + "</font>"; > } > > ]]> > </mx:Script> > > <mx:VBox id="vbox" height="50%" width="100%" > > <mx:Button label="Add Slider" click="addSlider()" /> > <mx:Spacer height="50" /> > </mx:VBox> > > </mx:Application> > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com>] On > > Behalf Of Tom Fitzpatrick > > Sent: Monday, November 27, 2006 6:34 AM > > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > <mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Hands-on charts > > > > Flex charts work beautifully responding to dynamic changes in data. > > > > Using the current components, is there any way to use Flex charts to > > change data? > > > > As a conceptual model, I'm thinking of the way parametric equalizers > > work in some audio programs, where it's possible to drag nodes on a > > line > > > > graph vertically or horizontally to change the parametric data. > > > > - Tom > >