collision detection top, bottom, sides of a square

How do you detect collisions of a individual sides for a square?

the following code works fine for let and right but i cannot figure top and bottom. any help would be appreciated…

(for detecting collisions from the side)

if (event.other.x < displayObj.x) then
   – object collided with was on left on this object

One way is to make the square a “multi-element” body. See this page:

http://docs.coronalabs.com/guide/physics/physicsBodies/index.html

…and scroll down to where it says Multi-Element Bodies.

Then this page:

http://docs.coronalabs.com/guide/physics/collisionDetection/index.html

…talks about Multi-Element Collisions (scroll down for that heading, too).

 Jay

spent over 15hrs trying to figure it out jay thanks heaps, really appreciate it.

One way is to make the square a “multi-element” body. See this page:

http://docs.coronalabs.com/guide/physics/physicsBodies/index.html

…and scroll down to where it says Multi-Element Bodies.

Then this page:

http://docs.coronalabs.com/guide/physics/collisionDetection/index.html

…talks about Multi-Element Collisions (scroll down for that heading, too).

 Jay

spent over 15hrs trying to figure it out jay thanks heaps, really appreciate it.