hi, I’m having trouble assigning an array and populating it.
Currently I am just tying to populate an array with information from another, but with the aim to learn to use a 2-dimensional array.
At the moment I am just trying to push all my (map1 then map2 ect) values into one long array.
So I have the array :
var myMap1 : Array = [Vector2(1,1), Vector2(2,1), Vector2(3,1), Vector2(4,1), Vector2(5,1), Vector2(6,1), Vector2(7,1)];
and I’m trying to populate : var myMap : Array;
My first question is, what is the difference between :
var myWhat : Array; // i think this makes an array of no length
var myWhat : Array[];
var myWhat : Array = []; // i think this makes an array of no length
var myWhat : Array[] = new Array [5]; // i think this makes an array of nulls, length of 5 (5 places)
My second question is , why doesn’t either of these work ?
for (i=0; i < myMap1.length; i++) {
myMap _= myMap1*;*_
myWeight = myWeight1*;*
* }*
* for (i=0; i < myMap1.length; i++) {*
_ myMap.Push(myMap1*);
myWeight.Push(myWeight1);
}*
thanks in advance._