Getting an Array from a multi-dimentional Array within a Function
Don't know how to explain it but here, firstly, I can't get past. Also had this problem with another thing I was trying.
ReferenceError: Error #1056: Cannot create property 0 on Number.
I googled and found out about automatically declare stage instances, that was fine, I had the box checked.
Basically, it is failing at even the simplest. I have this function:
function getInfoOf(i) { // enemy count, info count
var _info:Array = new Array(3, 6);
// 0 is you
_info[0,Const.MAXHP] = 500;
_info[0,Const.CURRENTHP] = 500;
_info[0,Const.LEVEL] = 5;
_info[0,Const.EXP] = 5500;
_info[0,Const.NAME] = "You";
_info[0,Const.LINKEDMC] = "NONE";
// then a few more _info's.
}
Then, trying everything to get it to work, I stripped it so no returns. So in the code, in the init() part of the project (only called once), have getInfoOf(0), and tried any other numbers. I recieve that error, and cannot for the life of me figure out whats wrong (I have also tested the "Const"'s. they are integers, and I have tested using numbers in place of those. Still same error, it only goes away when I don't call the function at all.
Any help would be greatly appreciated.
Thanks.
Message was edited by: brokenhope The array is actually (3,6), messed that up.
