Accessing values in multi-dimensional arrays


hello, created 2 dimensioned array, not sure if done in correct way works this:

var arrlines:array = new array(new array()); arrlines.pop(); // because creates empty value begin 

 

anyway, not sure how access individual values within array.

 

arrlines.push([100, 200],[300, 400]); // creates 2 compartments each 2 sub compartments trace(arrlines[0]); //displays 100, 200 

 

how make trace 100 or 200?

 

thanks.

use:

 

 

var arrlines:array = new array(); //arrlines.pop(); // because creates empty value begin 

 

 

 

arrlines.push([100, 200],[300, 400]); // creates 2d array trace(arrlines[0][0]); //displays 100
trace(arrlines[0][1]); //200
trace(arrlines[1][0]); //300
trace(arrlines[1][1]); //400

 

 

 

thanks.



More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support