1 Reply Latest reply on Jan 28, 2009 9:01 AM by yashirotu

    Need Help on Gauge's Data Binding plz!

    yashirotu
      Hi guys I'm new to actionscript and FLEX and am doing a demo app for boss where I'm asked to add ILOG widgets via actionscript during runtime. The data binding over gauges' value property didn't actually work.. and here's an example of what I wrote:
      -------------
      [Bindable]
      private var value1:Number;

      private function timerHandler( event:Event ) : void //the timer thread to generate random variables
      {
      ...
      value1 = Math.round(Math.random() * 100);
      ...
      }

      public function toggleGauge(event:Event):void
      {
      if(gaugeToggle.selected == false)
      gaugeBox.removeAllChildren();
      else {
      var g1:SimpleVerticalGauge = new SimpleVerticalGauge();
      g1.title = "Mary";
      g1.value = value1;
      gaugeBox.addChild(g1);
      }
      }
      ...
      <mx:CheckBox id="gaugeToggle" label="Vertical Gauge" selected="true" click="{toggleGauge(event)}"/>
      -----------------------------
      Now It is adding gauges runtime with actionscript that stumbled me. I have also declared the same gauge via MXML using "value='{value1}'" and that worked perfectly after program launches. Can anybody please suggest a solution to this? Much appreciated..