4 Replies Latest reply on Aug 18, 2006 10:52 AM by kglad

    targeting using a substring

    >Vee< Level 1
      I have an mc on the stage called car_mc which contains various mc's that are named:
      spkr-a-0_mc
      spkr-a-1_mc
      spkr-a-2_mc
      spkr-b-0_mc
      spkr-b-1_mc
      what i was trying to do is only target the substring "a" then have it perform an action, below is my script thats not working:
      for (obj in car_mc) {
      trace(obj);
      //spkr-a-1_mc
      if (typeof (car_mc[obj]) == "movieclip" and car_mc[obj]._name.substring(4, car_mc[obj]._name.indexOf("-")) == "a"){
      car_mc[obj].play();
      }
      }