3 Replies Latest reply on May 19, 2010 9:03 AM by FlashGodThe2nd

    recusive function crawling through movieclips

    FlashGodThe2nd Level 1

      Hi!

       

      I have this function to find occurences of misstyped varaible names (with wrong lower / upper case). I have a movieclip called "debug" where I define and call this funciton ("getCase(_level0)"). But It never finds my testttt variable - If I put the test varaible in _level0 the variable is found.

       

      Any Ideas  what I do wrong here?

       

       

          var targetsCase_ary:Object =  new Object();

       

          var targetsLower_ary:Object =  new Object();
         
          testttt = 1
          testttT = 1
         
          function getCase(clip:MovieClip, recu:Number){
              if (recu==undefined) recu = 1;
              var n:String;
              for (n in clip){
                  var sPath:String = clip._target + "." + n;
                  var sPathLower:String = sPath.toLowerCase ();
                 
                  //trace(sPathLower + " " + sPath);
                 
                  if (targetsCase_ary[sPath]!=undefined){
                      // existiert
                  }else {
                      // existiert noch nicht - prüfen auf großkleinschreibung
                      if (targetsLower_ary[sPathLower]!=undefined){
                          //clip.onEnterFrame = blinkBlink;
                          trace("CASE: " + sPath);
                      }
                      targetsCase_ary[sPath] = 1
                      targetsLower_ary[sPathLower] = 1
                      //trace(targetsLower_ary.length + " " + sPathLower + " " + targetsCase_ary.length + " " + sPath  )
                  }
                 
                  //if (typeof clip[n] == "movieclip"){
                      trace("a " + n + " " + recu)
                      getCase(clip[n],recu+1);
                      trace("b " + n + "\n")
                  //}
              }
          }