Accessing last element of array dynamically?

Afternoon people,
Well, I;ve been bashing my face against this code now and still can;t get it to work.

I have been using

myArray[myArray.length] = blah+i

to successfully add values to an array.

Now it’s come to retrieving the last element and… the same notation seems to give me “undefined”… which is obviously hilarious. I could use some horrendous pop-> put back in array, keep copy for usage. But that seems frankly arse-about-face.

Tried

myArray["[myArray.length]"]
and
myArray[[myArray.length]]
and
var foo = myArray.length
trace(myArray[foo])

It looks like trace(this[“myArray[”+myArray.length"]") which would work if the array was publcly accessible but changing it to public just to get that to work is beyond my Occam’s razor. Must be a simpler explanation? Anyone care to enlighten me?

sobs