Let me help you Find that MovieClip
The Find class (download here) is a utility built to help you find a specific MovieClip based on it’s properties.
To use it you send a reference to the MovieClip that contains a group of MovieClips and depending on the method you use it will return a reference to what it found. For instance, if you have a MovieClip named container that contains lots of MovieClips and you want to know which one of those MovieClips is the furthest to the right – largest _x value – then call Find.farRight(container). Since the method returns a reference to what it found you would want to use it as such:
var farRight:MovieClip = polyGeekcom.utils.Find.farRight(container);
There is also a method called mcIndex which will look to see if the instance name of the MovieClip you send it ends with a number. If so then the method returns that number. For instance, if you have a MovieClip named clip_15 you could write:
var indexNum:Number = polyGeekcom.utils.Find.mcIndex(clip_15);
Of course you would probably be using this in an instance when the MovieClip in question was created dynamically and you didn’t know what its index number was. This method works no matter what the MovieClips’ name is as long as it ends with a number. It could be clip_15, clip-15 or even clip15 and it will still return the number 15.
Here is a quick list of the remaining methods.
top: find and return the clip with the smallest _y value
bottom: find and return the clip with the largest _y value
absBottom: find and return the clip that extends the furthest to the bottom, takes into account the height of the clip and assumes that the clips registration point is 0,0.
farLeft: find and return the clip with the smallest _x value
farRight: find and return the clip with the largest _x value
absFarRight: find and return the clip that extends the furthest to the right, takes into account the width of the clip and assumes that the clips registration point is 0,0.
largest: find and return the largest movieclip by area
smallest: find and return the smallest movieclip
dimmest: find and return the movieclip with the lowest _alpha setting
brightest: find and return the movieclip with the highest _alpha setting
Note: If there are two or more MCs that meet the criteria being searched for then these methods will return just one of them. However, that returned MC
will have the propertie ‘tie’ dynamically appeneded to it with a value of true. So, if you need to check for ties then simply ask:
if( myFoundMovieClip.tie ) {
// there are multiple MCs that met your criteria so do something about it
}







