Skip to main content
Known Participant
February 4, 2010
Answered

Simple way of mergin arrays?

  • February 4, 2010
  • 1 reply
  • 525 views

Hello, i have two arrays of DesplayObjects and i want to add all the objects in the second array to the end of the first array, i knew that i just can just do a loop and puch em into the array, but i wondered if there was a simple function for doing this?

Thanks?

This topic has been closed for replies.
Correct answer kglad

check the concat() method of arrays:

a1.concat(a2);

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 4, 2010

check the concat() method of arrays:

a1.concat(a2);

5millp0xAuthor
Known Participant
February 4, 2010

Thank you, am not telling you this often enough, and am feeling like a leech But You and some of the outher people here have realy saved my life several times this few mounth that i'w working width flash projects.

From the simple ones like this, to all the crasy ones

Thanks a lot man!

kglad
Community Expert
Community Expert
February 4, 2010

you're welcome.