Looping thru 2 dim array

Hi experts:
I have an array in Actionscript 3.  

private var myArray:Array = [  [1.2,3.4],

I would like to be able to get the first element, the point 1.2, 3.4, in a loop.  When I try this I get a large error.  

I would like to do this:
    for (var i:uint; i < myArray.length; i++) {
        point = myArray[i,0];
        point2 = myArray[i,1];


Who is Participating?
aikimarkConnect With a Mentor Commented:
I'm not sure of the exact syntax, but I think you're going to have to use an intermediate array to get at the data in the manner your code snippet suggests.
private var myPoint;

    for (var i:uint; i < myArray.length; i++) {
        myPoint = myArray[i];
        point = myPoint[0];
        point2 = myPoint[1];


Open in new window

snix123Author Commented:
Thank you...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.