Just by repeating the exercise 1 code and changing the movie clips names. also on this stage I have one of the object move in a different way.
I used a RollOver event. This makes the object move as the cursor goes over it.
Here is the code.
Square_mc.addEventListener(MouseEvent.ROLL_OVER, onRoll);
function onRoll(event:MouseEvent):void
{
event.target.x += 10
event.target.y += -25
event.target.rotation += -11;
}
Square_mc.buttonMode = true;
Tri_mc.addEventListener(MouseEvent.CLICK, onclicked);
function onclicked(event:MouseEvent):void
{
event.target.x += -5
event.target.y += 20
event.target.rotation += -10;
}
Tri_mc.buttonMode = true;
Str_mc.addEventListener(MouseEvent.CLICK, onclick2);
function onclick2(event:MouseEvent):void
{
event.target.y += -10
event.target.x += -10
event.target.rotation += -11
}
Str_mc.buttonMode = true;
Square2_mc.addEventListener(MouseEvent.CLICK, onclick3);
function onclick3(event:MouseEvent):void
{
event.target.x += 10
event.target.y += -40
event.target.rotation += -11;
}
Square2_mc.buttonMode = true;
In the next exercise I will be learning about keyboard events and how make object move by using the KEY_UP and KEY_DOWN properties.
also going to try making a return code for the Roll_Over event.
Once again wish me luck…..






