# Sleepless night. Why this array operation does not work?

**URL:** <https://forum.kirupa.com/t/sleepless-night-why-this-array-operation-does-not-work/270577>\
**Category:** flash\
**Created:** [September 11, 2008, 6:57am UTC](https://forum.kirupa.com/t/sleepless-night-why-this-array-operation-does-not-work/270577 "2008-09-11T06:57:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YakovZanardi](https://avatars.discourse-cdn.com/v4/letter/y/a4c791/32.png) [@YakovZanardi](https://forum.kirupa.com/u/YakovZanardi)\
**Post date:** [September 11, 2008, 6:57am UTC](https://forum.kirupa.com/t/sleepless-night-why-this-array-operation-does-not-work/270577/1 "2008-09-11T06:57:35Z")

</div>

Good morning,

I was wondering for hours searching for the bug, and I concluded that what makes everything fails is in the following code

this one works well:

[COLOR=navy](a for loop and a lot of other things, does no difference to the problem)[/COLOR]  
[COLOR=navy] } else {  
oxmlLink.id = nNoticias;  
oxmlLink.kinde = “noticia”;  
oxmlLink.nome = “noticia\_-\_”+nNoticias;  
nNoticias++;  
aNeoXML.push(oxmlLink);  
aNewsXML.push(oxmlLink);  
}  
}  
nav.gotoAndStop(2);  
}[/COLOR]

and this one does not:

[COLOR=darkred](a for loop and a lot of other things, does no difference to the problem)  
} else {  
oxmlLink.id = nNoticias;  
oxmlLink.kinde = “noticia”;  
oxmlLink.nome = “noticia\_-\_”+nNoticias;  
nNoticias++;  
aNeoXML.push(oxmlLink);  
aNewsXML.push(oxmlLink);  
}  
}  
var aTempArray:Array = []  
for(var al:Number = aNewsXML.length; al\>0;al–){  
TempArray.push(aNewsXML[al])  
}  
aNewsXML = TempArray[/COLOR]  
Somebody know why? Its like, I am copyng wrong an array?
