From: bmohnsen on
How do you test to see if one object is inside of another.

One object is a movable bitmap.
The other object is an invisible shape.


From: Mike Blaustein on
Check out the intersect() command in the help. It will tell you if one
rect intersects another, and it will tell you the rect of the intersection.

if sprite(1).rect.intersect(sprite(2).rect)>rect(0,0,0,0) then
--there is some intersection
end if


if sprite(1).rect.intersect(sprite(2).rect)=sprite(1).rect then
--sprite 1 is ENTIRELY inside of sprite 2
end if


if sprite(1).rect.intersect(sprite(2).rect)=sprite(2).rect then
--sprite 2 is ENTIRELY inside of sprite 1
end if
From: alchemist on
You mean something like:

myRect= sprite(1).rect.intersect( sprite(2).rect )
if myRect.width then
-- do stuff
end if

Or, if by inside you meant.. well, inside:
if myRect.width= sprite(2).width and myRect.height=sprite(2).height then
.....

Assuming that sprite 2 is the smaller of the two sprites.


"bmohnsen" <webforumsuser(a)macromedia.com> wrote in message
news:g34dph$anc$1(a)forums.macromedia.com...
> How do you test to see if one object is inside of another.
>
> One object is a movable bitmap.
> The other object is an invisible shape.
>
>


From: fazstp on
You could try sprite within or sprite intersects

if sprite( 1 ).within( 2 ) then
-- it's within
else
-- it's not
end if