Iterating a Filtered Collection

Okay, nothing profound here but thought I’d post as it’s a common question.

If you have filtered a collection,

ex

var ac:ArrayCollection = new ArrayCollection();
...
...
ac.filterFunction = myFilter
ac.refresh()

but you’d like to iterate over / access the unfiltered collection, simply use the .list property


var items:IList = ac.list

cheers

Josh

RSL Loading Multiple Dynamic Modules

So I ran into a Flex bug recently documented here .

If your using the framework RSL (Runtime Shared Library) and loading modules, you should read the latter link. I was loading multiple modules and noticed that that they all didn’t necessary load. A little searching and I stumbled upon the open bug in JIRA.

One suggested work around was to load the modules sequentially. This works but doesn’t make for the best user experience. In my case the modules were being loaded dynamically and added to a viewstack. I opted to create a ‘lazy module loader’ component that loads the module on creationComplete().

I filled my viewstack with these components, made sure the viewstacks creation policy was set to ‘auto’ and voila, every things is working great. Of course one could avoid this component and add each module to the viewstack directly – in my use case I don’t want the main app to have to compile in [i.e. bloat] all [any of] the modules when, depending on the users auth they modules may not be used.