I have two objects that appear randomly on stage, but i want them to never touch each other when they appear.
object1.x = Math.random() * stage.stageWidth;
object1.y = Math.random() * stage.stageHeight;
object2.x = Math.random() * stage.stageWidth;
object2.y = Math.random() * stage.stageHeight;
If you have only 2 objects that appears on the stage, then is easy. In EnterFrame event you just put an if condition
but if you have many objects, then you have to loop through all the objects and check the same condition.
Hope this helps!
Have a great day!