Looping thru 2 dim array

Hi experts:
I have an array in Actionscript 3.  

private var myArray:Array = [  [1.2,3.4],
                                               [7.8,10.4],
                                               [12.2,1.0]];

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];

etc.
   }

Thoughts?
snix123Asked:
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.
Example:
private var myPoint;

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

etc.
   }

Open in new window

0
 
snix123Author Commented:
Thank you...
0
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.