Skip to main content
December 2, 2008
Question

Finding index of array item

  • December 2, 2008
  • 1 reply
  • 469 views
I'm working in AS2 and have created an array of movie clips (symbol_box) with n ranging from 0 to 24. I want to be able to return the index of a movie clip (symbol_box) 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!
This topic has been closed for replies.

1 reply

Ned Murphy
Brainiac
December 2, 2008
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.
December 2, 2008
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
Ned Murphy
Brainiac
December 2, 2008
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.