inheriting from array class


hi, want create array class extends functionality of base array.

 

i wrote this:

 

package {

       

    public class my_array extends array {

// (...)

 

    public function my_array(_long:int) {

            // (...)

            super(_long);

        }

 

    } // class

   

} // package

 

in other words, have call super constructor, , since when declare new array specify lenght of array, pass length of array super constructor.

 

nothing wrong far, when try use new array, this:

 

var test:my_array = new my_array(10);

test[0] = 1;

 

i error:

 

referenceerror: error #1056: cannot create property 0 on my_array.

    @ rob1_fla::maintimeline/frame1()

 

then replaced 'super' line in constructor of class one:

 

this = super(_long);

 

and one:

 

1050: cannot assign non-reference value.

 

so how extend array class, can use indexes of new array class?

 

tnx

make class dyanamic.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

after effects warning: unable to create drawing surface

Maximum number of authorizations reached!