inheriting from array class
hi, I want to create my array class which extends the functionality of the base array.
I wrote something like this:
package {
public class my_array extends Array {
// (...)
public function my_array(_long:int) {
// (...)
super(_long);
}
} // class
} // package
in other words, I have to call the super constructor, and since when I declare a new array I specify the lenght of the array, I pass the length of the array to the super constructor.
Nothing wrong so far, but when I try to use my new array, like this:
var test:my_array = new my_array(10);
test[0] = 1;
I get this error:
ReferenceError: Error #1056: Cannot create property 0 on my_array.
at rob1_fla::MainTimeline/frame1()
then I replaced the 'super' line in the constructor of my class with this one:
this = super(_long);
and now I get this one:
1050: Cannot assign to a non-reference value.
so how do I extend the array class, so I can use the indexes of my new array class?
tnx
