3 Replies Latest reply on Feb 3, 2009 12:37 PM by rtalton

    DefaultTileListEffect  and filterFunction

    frenchi30 Level 1
      Hi there,
      So, I've been looking around everywhere only to find the same question as this...
      Why can't we apply a DefaultTileListEffect when we filter our TileList's dataProvider (ArrayCollection) with the filterFunction? Is there a reason why it was ommitted? So to recap, I have a TileList with a dataProvider that is an array collection. The tileList also has its itemsChangeEffect related to a defaultTileListEffect. The effect is never triggered when using the filterFunction on the arraycollection.. it works like a charm if I edit the arraycollection manually (like removeItemAt())....

      Is there a way to make it work with a workaround? Adobe, please let me know it's killing me

      thank-you!
        • 1. DefaultTileListEffect  and filterFunction
          rtalton Level 4
          Well, it does make sense to me. The effect runs when you delete or add an item in the data provider. It's not meant for filtering effects, because really the data have not been changed or deleted, its just being viewed differently (some items are hidden).

          Having said that, why don't you cook up an effect sequence for what you want to see happen, and then play when the filter function runs? You could fade out, then fade back in, etc. Should be pretty straightforward.
          • 2. Re: DefaultTileListEffect  and filterFunction
            frenchi30 Level 1
            Thanks for the explanation, never looked at it that way. Makes sense.

            So, you mean when I assign the filterFunction, I then would call my sequence.play ? Sorry, not sure how that would work.. would you happen to have an example please?

            thank-you!
            • 3. Re: DefaultTileListEffect  and filterFunction
              rtalton Level 4
              Since calling refresh on a dataprovider would trigger a "ListChange" event, you could listen for that, like:
              myDataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE,listChangeHandler);

              Assuming you're doing a fade out/fade in effect, create those separately, then work them into the flow of events where needed. The targets property of each effect can decide what to fade in/out.

              I've never tried this. I'd assume that the COLLECTION_CHANGE event is called AFTER the List is refreshed, so timing an effect could be an issue unless you fadeOut.play()---> effectEnd event--> call refresh method on dataProvider--> COLLECTION_CHANGE event--> listChangeHandler called--> fadeIn.play()