did you try:
bufferTmp = new Array();
bufferTmp = buffer;
davepla - 29 Apr 2005 23:00 GMT
Yes, I tried declaring bufferTmp as an array but it keeps referencing buffer array
Jeckyl - 30 Apr 2005 02:42 GMT
What the does is create a new array, and assign a reference to it to
bufferTmp
Then it removes the reference to the new array (making it disappear) and
replaces it with a reference to bufferTmp .. do bufferTmp and buffer both
refer to the same array.

Signature
Jeckyl
> did you try:
>
> bufferTmp = new Array();
> bufferTmp = buffer;
Yup that is how it works in Flash. What you want to do is create a new blank
array and then step through and duplicate each element in the array.
//some arrray that already exists called myFirstArray
mySecondArray=new Array();
for(i in myFirstArray){
mySecondArray=myFirstArray;
}
At least I think it something like that. I didn't actually test it. Let me
know if that doesn't work for you.
NSurveyor - 30 Apr 2005 00:24 GMT
You cannot duplicate an array using bufferTmp = buffer; Bot bufferTmp and
buffer will still reference (point) to the exact same array. Strings and
Numbers can be duplicated in this way but I believe all the rest will just
"point" as they are not primitive. I would just use concat to duplicate it.
Something like:
bufferTmp = new Array();
bufferTmp = bufferTmp.concat(buffer);
kglad - 30 Apr 2005 01:43 GMT
or
buffertemp=buffer.concat();
davepla - 30 Apr 2005 15:12 GMT
Yes, you're right. It's the way many languages treat objects when you assign
them to a var/object, creating a reference to it instead a copy. I was looking
for something like duplicate function in Lingo:
bufferTmp = buffer.duplicate()
Finally I found that's what slice method do if you don't pass any parameter:
bufferTmp = buffer.slice()
Thanks to everybody for your help,
David P.