tags:

views:

330

answers:

2

How I actually merge both together?

one arraycollection would contain value of 0...30 with Object name "sxx" with another arraycollection retrieve from database.

A: 

Check the blog post, is this what u were asking for? http://stackoverflow.com/questions/2575158/merge-2-arraycollection-flex-3

nsdevaraj
Are you trying to make a smart infinite loop in here ? :)))
Adrian Pirvulescu
A: 

HI!

Solution 1:

private function mergeArrays(a:ArrayCollection, b:ArrayCollection):ArrayCollection
{
    for each(var item:Object in b)
    {
        a.addItem(item);
    }
    return a;
 }

Solution 2:

var a:ArrayCollection = new ArrayCollection([1,2]);
var b:ArrayCollection = new ArrayCollection([3,4]);

a = new ArrayCollection(a.toArray().concat(b.toArray()));

Have fun! :P

Adrian Pirvulescu