XML.onLoad = function(){ //blah-blah... traceArray() } function traceArray(){ trace(myArray.length) }