1 Reply Latest reply on Mar 15, 2011 1:46 PM by Ned Murphy

    substr method problem

    jaswerl Level 1

      This assignment

      is returning undefined:


      var str=activeCarton.toString.substr(0,2);


      where activeCarton is a variable referencing an array of movie clips. Does activeCarton contain the name of the mc or the index. How can I get the mc name string?

        • 1. Re: substr method problem
          Ned Murphy Adobe Community Professional & MVP

          It's not a substring problem... it's a string problem (or lack of).  Your array doesn't include things that can be converted to strings.  But the objects represented by the names you have in the array do have _name properties that are strings.  Try...


          var str=activeCarton._name.substr(0,2);