0
Finding index of array item

/t5/animate-discussions/finding-index-of-array-item/td-p/134180
Dec 01, 2008
Dec 01, 2008
Copy link to clipboard
Copied
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!


TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/animate-discussions/finding-index-of-array-item/m-p/134181#M243255
Dec 01, 2008
Dec 01, 2008
Copy link to clipboard
Copied
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.
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/animate-discussions/finding-index-of-array-item/m-p/134182#M243257
Dec 02, 2008
Dec 02, 2008
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/animate-discussions/finding-index-of-array-item/m-p/134183#M243258
Dec 02, 2008
Dec 02, 2008
Copy link to clipboard
Copied
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

