|
-
HI,
I just want to detect collision between two circles not with there bounding boxes but there actual shapes using shapeFlag property of flash.
I came acros this thread actual wherein the discussion is alrady on.
Anyway
we all know this is right
onCliEvent(enterFrame){
if(hitTest(_root._xmouse,_root._ymouse,true)){
trace(Hit is on);
}
}
This works fine with the _xmouse and _ymouse property.
But what If I want to do this witha movie clip but checking the actual shape of the movieclip not the bounding box.
something like :
onCliEvent(enterFrame){
if(hitTest(_root.mov._x,_root.mov._y,true)){
trace(Hit is on);
}
}
This also works but it works only when the center of the "mov" clip which is basically a circle is hit by the host movie clip i:e _x and _y of mov.
I want it to happen when the mov actaully collides iwth the host movielcip
So I treid
onCliEvent(enterFrame){
if(hitTest(_root.mov._x-_root.mov._width/2,_root.mov._x-
_root.mov._width/2,_root.mov._y-_root.mov._height/2,_root.mov._y+
_root.mov._height/2){
trace(Hit is on);
}
}
This is to detect the actual collison of the mov movie clip.
But this isnt happening.
Also I have heard that this type of hitTest method in flash consumes quiet an amount of memory resulting in lower fps.
Pls guide me if I am wrong somewhere.
thx
Where is this Flash Rocket Taking us ^|^
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|