Skip to main content
Inspiring
December 29, 2011
Answered

Arrays

  • December 29, 2011
  • 1 reply
  • 646 views

Simple question. I know how to get one element from the array. But I don't know let's say how to take 3 elements ( position 0,1,2). I don't know how to trace all the three together. help. I am getting errors all the time.

var myArray:Array = [1,2,3,4,5];

trace(myArray[0]);

trace(myArray[0], ?,?);

This topic has been closed for replies.
Correct answer Ned Murphy

trace(myArray[0], myArray[1],myArray[2]);

1 reply

SamsimmsAuthor
Inspiring
December 29, 2011

What I want to do is to acces 3 elements in the same time, instead of going one by one.

Ned Murphy
Ned MurphyCorrect answer
Legend
December 29, 2011

trace(myArray[0], myArray[1],myArray[2]);

SamsimmsAuthor
Inspiring
December 29, 2011

Thank you Ned. I wish you the best of everything fot next year.