As3 Hittestpoint Off-stage
- coln
-
coln
- Member since: Aug. 1, 2011
- Offline.
-
- Forum Stats
- Member
- Level 01
- Musician
Does object.hitTestPoint(x,y,shapeFlag) work when the object is not on the stage? Say, if I create an object like this?
var object:Sprite = new someSpriteFromLibrary();
trace(sprite.hitTestPoint(5,10,true));
- kkots
-
kkots
- Member since: Apr. 16, 2013
- Offline.
-
- Forum Stats
- Supporter
- Level 10
- Blank Slate
hitTestPoint works when the object is invisible or off-stage
hitTestPoint is always false if the object is not added to the display list.
In AS2 hitTest always returned false if the object was very far (at -10000, +10000) from the stage. I think the same may happen in AS3.
- coln
-
coln
- Member since: Aug. 1, 2011
- Offline.
-
- Forum Stats
- Member
- Level 01
- Musician
At 10/25/13 07:37 PM, kkots wrote: hitTestPoint works when the object is invisible or off-stage
hitTestPoint is always false if the object is not added to the display list.
In AS2 hitTest always returned false if the object was very far (at -10000, +10000) from the stage. I think the same may happen in AS3.
I believe this is true. I was trying to test it and got "false" on an object that was not added to the display list, even though I knew the point should have returned "true."
Thanks for the reply, I just wanted to make sure. :)

