Problem reversing an array's contents

I seem to be having trouble reversing the contents of an array

this is the code:


stop();
// Attributes arrays
var nd:Array = new Array();
var ns:Array = new Array();
var sp:Array = new Array();
var idnum:Array = new Array();

// Load XML
var newsXML:XML = new XML();
newsXML.ignoreWhite = true;
newsXML.onLoad = function()
{
        trace("this " + this);
        var nodes:Array = this.firstChild.childNodes;
    trace("nodes: " + nodes);
    for(i=0;i < nodes.length; i++) 
        {
            idnum* = nodes*.attributes.id;
            trace("idnum*: " + idnum*);
            nd* = nodes*.attributes.date;
            trace("nd*: " + nd*);
            ns* = nodes*.attributes.story;
            trace("ns*: " + ns*);
            sp* = nodes*.attributes.spacer;
            trace("sp*: " + sp*);
        }
    // Display Text
    var stringCache:String;
    for(n=0; n < idnum.length; n++)
        {
            trace(idnum[n]);
            trace(nd[n]);
            trace(ns[n]);
            trace(sp[n]);
            theNews.text += nd[n] + "
" + ns[n] + "
" + sp[n] + "
" + "
";
        }
    theNews.text = stringCache;
    }
newsXML.load("updates/adNews.php");

i’ve tried changing the ‘for’ loops for both the ‘n’ and ‘i’ variables to decrement them and also tried idnum.reverse(); but i can;t get it to work.

It’s a news page so i’m basically trying to get the newest story(which is attached to the highest id number in the databse) to post first and then post the rest in descending order.

anyone have any suggestions?

thanks :slight_smile: