SuperCat
SuperCat

Reputation: 43

AS3 Return Object currently under another Object without HitTestObject

Is it possible to return the Object that is underneath/in contact with another Object without using hitTestObject ? I'm wondering if I can remove the need to loop through an array of 'active' Objects and simply get the instance that's underneath at any given time. Possibly using as3 events ? many thanks SC

Upvotes: 0

Views: 167

Answers (2)

bitmapdata.com
bitmapdata.com

Reputation: 9600

Be carefully, using a getObjectsUnderPoint().

getObjectsUnderPoint() return types Array. this mean specify Point above all DisplayObjects return. sometimes you do not want to get the value. So the objects in the array must be verified. Faced this problem, especially DisplayObjects when they overlap or if you load the other swf

Upvotes: 0

khailcs
khailcs

Reputation: 318

You can use the getObjectsUnderPoint() method of the DisplayObjectContainer class.

Upvotes: 1

Related Questions