2 Replies Latest reply on Aug 8, 2008 8:25 AM by Newsgroup_User

    Progaramatically declare Type

    Level 7
      Hi There

      consider this recursive function:

      private function
      for(var i:int=0;i<DObj.numChildren;i++){
      if (DObj.getChildAt(i) is IContent){
      //do the function
      var c:IContent = DObj.getChildAt(i) as IContent;
      }else if(DObj.getChildAt(i) is DisplayObjectContainer){
      //do the recursion

      it takes a display object container and recursively sends all children
      of a specific type to function f. What I would like to do is to pass
      the type of child that the method looks for so instead of

      it said

      I could the make it a nice static method for use in lots of different
      situations. Any ideas?

      Cheers Richard