21 Replies Latest reply on Nov 4, 2007 9:00 PM by kglad

    Need to find nearest movie clips

    dot-comet Level 1
      Hi all,

      I have an app which has between 30 and 200 nearly identical movie clips on the stage at any time.

      I need to get an array of the top 10 movie clips which have the closest global position (X/Y) to any given clip.

      Obviously I could do this with a lot of sorting. And I could do it with a server call, and use PHP, since it has advanced multidimensional array sorting methods. But I'd like to avoid server calls, as they will slow the app down.

      Is there some high-level way to do this in Actionscript? I'm using Flash MX (6).

      Perhaps collision detection methods can be used?

      Thanks in advance!! Kindest regards,