Be a Supporter!

As3 Hittestpoint Off-stage

  • 161 Views
  • 2 Replies
New Topic Respond to this Topic
coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
As3 Hittestpoint Off-stage 2013-10-25 18:46:19 Reply

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));

BBS Signature
kkots
kkots
  • Member since: Apr. 16, 2013
  • Offline.
Forum Stats
Supporter
Level 10
Blank Slate
Response to As3 Hittestpoint Off-stage 2013-10-25 19:37:16 Reply

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.


BBS Signature
coln
coln
  • Member since: Aug. 1, 2011
  • Offline.
Forum Stats
Member
Level 01
Musician
Response to As3 Hittestpoint Off-stage 2013-10-25 19:43:42 Reply

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. :)


BBS Signature