Skip navigation
Currently Being Moderated

ENTER_FRAME Event Not Working

Jul 18, 2012 12:47 PM

Tags: #animation #motion #charts #enter_frame

I'm having an issue with getting the ENTER_FRAME event to work as expected. I have the following code but when I run my application the screen is totally blank.

 

 

[CODE]

<fx:Script>

     <![CDATA[

         

               //Fake Time Data Array

               [Bindable]

               private var timeOneArray:ArrayCollection = new ArrayCollection([

                    {time:1,day:1,A:10,B:15,C:20},

                    {time:1,day:2,A:15,B:10,C:5},

               ]);

 

          [Bindable]

          protected var timeTwoArray:ArrayCollection = new ArrayCollection([

               {time:2,day:1,A:30,B:35,C:40},

               {time:2,day:2,A:25,B:10,C:5},

          ]);

 

          [Bindable]

          protected var master:ArrayCollection = new ArrayCollection();

 

          protected function init(event:FlexEvent):void

          {

               master.addItem(timeOneArray);

               master.addItem(timeTwoArray);

               nodesChart.addEventListener(Event.ENTER_FRAME, onEnterFrame);

          }

 

           var index:int = 0;

 

          protected function onEnterFrame(event:Event):void

          {

                    var last:int = master.length-1;

                    if(index < last)

                    {

                              nodeChart.dataProvider = master.getItemAt(index + 1);

                              index = master.getItemIndex(nodesWipChart.dataProvider);

                    }

                    else

                    {

                              index = 0;

                              nodesWipChart.dataProvider = master.getItemAt(index);

                    }

          }

[/CODE]

 

I'm not sure what I'm missing but I'm sure I'm doing something wrong, as this is my first attempt to use the ENTER_FRAME event. Thanks.

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points