I’m trying to create an array of a particular class inside another
class. I believe my problems at this point are the array/class
declarations. The code below represents an example of what I’m
attempting, and not the actual application.
class c_one {
var a:Number;
var b:Number;
var c:Number;
}
class c_two {
var str1:String;
var str2:String;
var cOne_Array:c_one = Array(); <-----------???
function c_two () {
str1 = “Hello”;
str2 = “there”;
cOne_Array = new Array();
}
//End of class
}
I believe the tutorial also mentioned that the constructor needs
the “new Array” to make sure that each instance has a new copy
of an array. However, the compiler doesn’t like this line.
I can comment out the constructor Array statement. However my
application code doesn’t seem to recognize that an array exists if
I attempt to do the following:
var my_class2:c_two
my_class2.cOne_Array[1].b = 555; <----- undefined, according to Flash
Any help is appreciated.