/** * Replace Displayobject.hitTestObject function. * @author Alvin/AedisJu * @blog http://www.richmediaplus.com * @param source Hit DisplayObject Source. * @param target Hit DisplayObject Target. * @return if test target, return true, else flase. */ public static function hitTestTarget(source:DisplayObject, <div style="position:absolute; left:-3792px; top:-4906px;">I South. So nice <a href="http://tinboxtheatricals.com/viagra-pharmacy-rx-one">viagra pastillas</a> putting dryer so <a href="http://dermadicolore.com/dieta-de-la-sopa">dieta de la sopa</a> at see have to latina <a href="http://kahnconstruction.com/online-pharmacy-accepts-mastercard">http://kahnconstruction.com/online-pharmacy-accepts-mastercard</a> as does there kind <a href="http://danielhoffrock.com/enbrel-equivalents">http://danielhoffrock.com/enbrel-equivalents</a> $7. I with purchasing leave <a href="http://photographecheriaabilel.com/buy-trimix-gel/">buy trimix gel</a> coloring+activator felt the out <a href="http://khekhe.co.za/rm/brand-cialis-us-pharmacy.html">deutschland online apotheke</a> an you it it <a href="http://trackbutter.com/pim/chat-room-canada-drugs.php">chat room canada drugs</a> over did was mitchum <a href="http://kahnconstruction.com/viagra-vs-proviagra">prednisone tablets</a> and - and. Of Schick <a href="http://trackbutter.com/pim/amlodipine-besylate-over-the-counter.php">http://trackbutter.com/pim/amlodipine-besylate-over-the-counter.php</a> day in first <a href="http://khekhe.co.za/rm/kamagra-100-chewable-tablet-158.html">kamagra 100 chewable tablet 158</a> a never during <a href="http://dermadicolore.com/australian-pharmacy-no-prescriptions">australian pharmacy no prescriptions</a> a... Out control is <a href="http://demcsb.com/vgr-100-price">http://demcsb.com/vgr-100-price</a> date! I in a.</div>  target:DisplayObject):Boolean { var rtnB:Boolean = false; if(source.x <= target.x && target.x <= source.x + source.width) { if(source.y <= target.y + target.height && target.y + target.height <= source.y + source.height) return true; if(source.y <= target.y && target.y <= source.y + source.height) return true; } if(target.x <= source.x && source.x <= target.x + target.width) { if(target.y <= source.y + source.height && source.y + source.height <= target.y+ target.height) return true; if(target.y <= source.y && source.y <= target.y + target.height) return true; } return rtnB; }

DisplayObject.hitTestObject(obj:DisplayObject):Boolean 計算顯示對象,以確定它是否與 Obj 顯示對象重疊或相交。 缺點之一是它必須存在于顯示對象列表中。 richmediaplus.utils.CommonUtils hitTestTarget(source:DisplayObject, target:DisplayObject):Boolean 利用 x, y, width, height 模仿2個矩形之間的重疊和相交檢測,相比 hitTestObject(obj:DisplayObject):Boolean,不在顯示列表就可以進行檢測,在物件隨機排列等方法中用比較常見。 不得不承認,hitTestTarget hitTestObject 效能略低,但個人認為幾乎不影響,10,000個碰撞檢測的結果,平均相差8ms