3 Replies Latest reply on Dec 2, 2008 1:32 PM by Ned Murphy

    Finding index of array item

    Rick_Cope Level 1
      I'm working in AS2 and have created an array of movie clips (symbol_box[n]) with n ranging from 0 to 24. I want to be able to return the index of a movie clip (symbol_box[n]) when it is clicked so I can use it to access another movie clip in a second array. I need to be able to get the value of n... i.e. the index of the clicked clip. Any ideas? I'm sure it is simple!
        • 1. Re: Finding index of array item
          Ned Murphy Adobe Community Professional & MVP
          What exactly does the array contain... what are the values?

          I'm thinking that you need to assign the index value to the movieclip somehow/sometime, so that it has an immediate answer when clicked on, but there may be another option depending on what you use store in the array.
          • 2. Re: Finding index of array item
            Rick_Cope Level 1
            Hi Ned
            The array is simply an array of boxes (movie clips as rectangles). They are indexed from 0 to 25. I want to able to get Flash to return the index to me as an integer when the movie clip is clicked so I can then use it to refer to other resources (parallel arrays of other objects) in the project. I've done it once before in Flash 8 successfully but I'm blowed if I can find the project I did it in! Hope this makes sense. Rick
            • 3. Re: Finding index of array item
              Ned Murphy Adobe Community Professional & MVP
              I'm still back at my question... what is being stored? Is it the instance names or just mc objects that have nothing uniquely identifiable between them? Describe a little about the mc's themselves as far as how they are created and how they are added into the array... I'm just trying to find (or define) some handle for being able to grab a hold of a specific one, which is what you may need to be able to identify which is which.