I set up a class like this
class Level extends System.ValueType{
//fields
var levelNo :int;
var levelPads :int; // number af pads for level
var levelName :String;
var levelStatus :int; // editing, testing, done
var levelExtra :String; // extras
//Constructor
public function SetLevel(lvn:int,lvp:int,lNm:String,lSt:int,lEx:String){
this.levelNo = lvn;this.levelPads = lvp;
this.levelName = lNm;this.levelStatus = lSt;
this.levelExtra = lEx;
}
}
then I declare the var like this
static var CustomLevels :Level = new Level();
Then i want this to be a dynamic array of Levels so I can use
CustomLevels[1].levelName = "Beginers Luck"
I will need to add and subtract to this array so I dont want a builtin array. How can I set this up? I have been getting splicing errors when I add brackets.
EDIT:
That fixes casting as Value type error but I still get 'levelName' is not a member of 'Object'.
static var CustomLevels = new Array();
CustomLevels.length = 1;
CustomLevels[0] = new Level() as Level;// -> Fixed this ERROR
CustomLevels[0] = InitLevel;
print(CustomLevels[0].levelName);// -> ERROR