Indexing instances of specific class inside MovieClip authored with Flash Pro


hi there.

 

i'm writing class extends movieclip , linked movieclip object authored via flash pro during development (father object).

 

the hierarchy of movieclip object hidden me - know may contain instances of other class authored during development , extends movieclip in same manner (son objects).

 

i have no information regarding names or hierarchical positions of these son objects inside father object.

 

now question is: how them listed?

 

so approach i've taken implement current events:

 

public class son extends movieclip

{

     public static const initialized : string = "son_initialized";

 

     public function son ()

     {

          this.dispatchevent (new event (initialized));

     }

}

 

public class father extends movieclip

{

     public var son : vector<son>;

 

     public function father ()

     {

          son = new vector<son> ();


          this.addeventlistener (son.initialized, this.onsoninitialized);

     }

 

     public function onsoninitialized (event : event)

     {

          this.son.push (event.target);

     }

}

 

well, code compiles no errors whatsoever, turns out onsoninitialized gets never called. assume that's because children constructors called ahead of parent one.

 

is there way them listed?

 

thanks in advance.

are trying list classes of children (or descendents) of father or trying less inheritance of father or else?



More discussions in ActionScript 3


adobe

Comments