Skip navigation
Currently Being Moderated

Change Event dispatched 2 times in List Component

Sep 24, 2010 1:52 PM


    Thanks for taking the time to read about my problem. I have a List component which has a simlpe array of strings as a dataprovider. I'm using the change event to call a method and I don't know why this method gets called 2 times.


¿Someone knows why this keeps happening?


Thanks for your help.


Sebastián Toro

  • Currently Being Moderated
    Sep 24, 2010 5:24 PM   in reply to sebastiantoro84

    Impossible to guess (show Your code ). I created a s:List component, set dataProvider and it works correctly (only one Alert appears when I select an item):



    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="" 
                   import mx.collections.ArrayCollection;
                   import mx.controls.Alert;
                   private var listFeed:ArrayCollection = new ArrayCollection(['A', 'B', 'C']);
                   protected function changeHandler(event:IndexChangeEvent):void {
         <s:List id="lista" dataProvider="{listFeed}"
    Mark as:
  • Currently Being Moderated
    Apr 18, 2013 9:27 AM   in reply to sebastiantoro84

    If an s:List, you put a IndexChangeEvent listener the event, and in that event, cast a filterFunction to the dataProvider of that List ...
    You will have to validate inside that function through property IndexChangeEvent newIndex of greater than or equal to ZERO.
    Because interestingly, the dataProvider of the List filter is invoked IndexChangeEvent again, but now the newIndex, give a value of "-1", leading with it the entire event, from null and associated with this throw this:
    Error # 1009: Can not access a property or method of a null object reference.
    When referring to the event ... :/

    Mark as:

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