First, let me say I am sorry. A year or so ago, I wrote these VectorCollection classes. They are not spectacular works of art, they are very basic implementations required to use Vector inside of Flex components which are looking for IList and ICollectionView for their dataProviders. Vector has some performance advantages in some cases (for more details, take a look here. ) but overall, the big advantage to me is type safety. I know what should be in the Vector and flash knows if I mess that up. On the whole, these are simple implementations that don’t solve every problem I would love to solve if I had the Flash Player source and some time, but they will allow you to use Vectors more directly in Flex. So, if you find them useful, then enjoy. private var source:Vector.<uint>; source = new Vector.<uint>; private var vc:VectorListCollection; vc = new VectorListCollection( source ); var sort:Sort = new Sort(); var field:SortField = new SortField( null, false, false, true ); sort.fields = [field]; vc.sort = sort; vc.refresh(); File Available Here Cheers, Mike


    Nice. Gonna try and use this in a project I am currently working on!

    This looks great for putting that square peg into the round hole that is the dataProvider, but how do we type the VectorListCollection, or do you think that’s even necessary?

    private var typedVc : VectorListCollection.<MyType>;

    • by Tom Schober
    • 3:06 pm, June 28, 2010
    • Reply

Leave a Reply