Rectangle intersection problem

Hi,

I have created two movie clips mc1 and mc2. MC2 is a dragable movieclip. I want that whenever mc2 hit mc1, it automatically place mc2 beside mc1. I mean to say that they cant overlap each other.

I have tried so many thing but cant get it right. So i thought you peoples can help me.

I have attached two pics which show what i want.

Plz help me.

Thanks