Havaha Forums
You are not logged in.
How would you say if any movieclips are at a certain coordinate?
I want something like this:
if(anymovieclips.x==420){
do stuff
}Obviously though anymovieclips wouldn't be the right thing ![]()

Offline
you'll have to check for each Movieclip. Note, however, that the x and y properties on Movieclips are Numbers. That means mc.x == 420 has a VERY slight chance. You better do something like
for (..each movieclip) {
if (mc.x > 420 && mc.x < 421) {
//..
}
}
you should save all the movieclips you want to check in an array. If your movieclips are added during runtime (so, by code) you can also use:
for (var i:String in this) {
if (this[i] is MovieClip) {
var mc:MovieClip = this[i] as MovieClip;
if (mc.x > 420 && mc.x < 421) {
//do stuff
}
}
}
Offline
The array one would come in much more handy.
Thanks

Offline
I would pretend not to know a thing about you, I would speak perfect Finish and say, "Im sorry, were not selling cabbage inside of the hedge gardens."
HWYR to that?
www
Offline