package site.utils { import flash.display.DisplayObject; import flash.geom.Point; /** * @author Gwenn Guihal * @date 2009 */ public class Coord { /** * Renvoie les coordonnées d'un clip par rapport à la scène * @param $mc Le clip * @return Les coordonées du clip par rapport à stage */ public static function getCoordGlobal($mc:DisplayObject):Point { var pt:Point = new Point(); return incrementeCoord($mc,pt); } private static function incrementeCoord($mc:DisplayObject,$pt:Point):Point { $pt.x += $mc.x; $pt.y += $mc.y; if ($mc.parent) { return incrementeCoord($mc.parent,$pt); } else { return $pt; } } } }