1 Reply Latest reply on May 6, 2013 5:22 AM by Ned Murphy

    Understanding MCs/Textfield created by a variable

    JonnyDL Level 1

      I was hoping for some clarification on a concept. I'm using a variable to create multiple textfields, the varible will contain all the object data of the textfield created

      theWord = this.createTextField("Action_" +n, this.getNextHighestDepth(), 10, 10, 70, 30);

       

      I have a concatination so each textfield name is unique.

       

      My confusion is with the use of the variable. In other languges a variable can only hold one value. but in AS2 it appears (to me) I can have multiple textfields on the stage with/created using the same variable name? To go one step further with my confusion can you tween multiple textfiled under the sane tween name using the textfield var name(var sometween = (theWord..............), and delete them individually at the end of thier tween? Agian if the are all named by the same variable how dose it know? or to do something like this you need to use the instance names created.

       

       

      Hopefully my explanation of my confusion isn't confusing ;}

        • 1. Re: Understanding MCs/Textfield created by a variable
          Ned Murphy Adobe Community Professional & MVP

          You should show code the stands as an example of what you are having a problem with.  In general, you are right, variables cannot identify more than one object.  But it is possible to create an object and store it in such a manner that the variable/name used to create it is not used beyond that creation... any future reference to the object is likely via some other means of targeting the object, such as storing it on an array and using the array to target it.

          1 person found this helpful