I’m trying to make an object, a red circle move bounce to a random location within my stage onCLick, and display the message you touched my circle. I don’t quite know what i’m doing wrong.
Here is what i came up with
import flash.events.MouseEvent;
myCircle.addEventListener(MouseEvent.MOUSE_DOWN, onClick);
function onClick(e:MouseEvent):void
{
trace("you touched myCircle");
Math.floor(Math.random()*(1+High-Low))+Low;
}
var High = stage.stageWidth == 550, stage.stageHeight == 400;
var Low = stage.stageWidth == 0, stage.stageHeight == 0;
You need to set your circle’s new coordinates, use
xandyproperties for that.