4 Replies Latest reply on Nov 1, 2009 11:02 PM by BaliHi

    Creating series with effects via Actionscript causes effect to repeat endlessly




      I've been trying to add effects to programmatically generated series.  I can create everything fine, but when the effect is applied, it repeats over and over.  In the example below, my line series slide on to the chart (that's good), but then disappear and slide onto the chart again, and again, and again.  It should only run the effect once, and then stop.


      Any ideas?  The code below reproduces the problem.

      thanks for any help,



      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
          <mx:Button click="run()" />
          <mx:CartesianChart id='mainChart'>
          <mx:horizontalAxisRenderer ><mx:AxisRenderer axis="{offsetAxis}" fontWeight="bold" /></mx:horizontalAxisRenderer>
          <mx:verticalAxisRenderer><mx:AxisRenderer axis="{returnAxis}" fontWeight="bold"/></mx:verticalAxisRenderer>
          <mx:horizontalAxis ><mx:LinearAxis id="offsetAxis"/></mx:horizontalAxis>
          <mx:verticalAxis><mx:LinearAxis id='returnAxis'/></mx:verticalAxis>
                  import mx.charts.series.LineSeries;
                  import mx.charts.effects.SeriesSlide;
                  import mx.collections.ArrayCollection;
                  [Bindable] private var testData:ArrayCollection = new ArrayCollection(
                  private function run():void {
                      var slideIn:SeriesSlide = new SeriesSlide();
                      slideIn.duration = 2000;
                      slideIn.type = 'show';
                      slideIn.elementOffset = 0;


                      var ls:LineSeries = new LineSeries();
                      ls.dataProvider = new ArrayCollection();
                      ls.horizontalAxis = offsetAxis;
                      ls.verticalAxis = returnAxis;
                      mainChart.series = [ls];              




                  private function setData(obj:LineSeries,data:ArrayCollection,xField:String,yField:String):void {
                      obj.xField = xField;
                      obj.yField = yField;
                      obj.dataProvider = data;