
During this weeks lesson we learnt how to add a button in which when the mouse performed specifics actions over the button the button responded.This is because we added text to the button in relation to the positioning of the mouse for example UP,DOWN,OVER,HIT.Using the codes we then created it so that when the button was pressed a message appeared saying that the button was pressed.
circlebutton.addEventListener( MouseEvent.MOUSE_UP, handleMouseUp);
function handleMouseUp(evt:MouseEvent):void
{trace("Button was pressed");
circlebutton.scaleX=2
circlebutton.scaleY=2
}
This is an example of the codes that i was using in todays lesson.
The scale x and y refers to the shape of the circle ie how big or smaller it will get.
No comments:
Post a Comment