This project demonstrates timeline navigation, key stroke detection, a basic URLRequest, context menu modification, and how to make an object annoyingly trail the mouse cursor. The code follows after the jump.
Content
Tagged: Actionscript
An EventListener listen for clicks for each of the four buttons, executing the corresponding function, which manipulates the X or Y value by 10. Is there a more efficient way to do this? btn_left.addEventListener(MouseEvent.CLICK, nudge_left); btn_right.addEventListener(MouseEvent.CLICK, nudge_right); btn_up.addEventListener(MouseEvent.CLICK, nudge_up); btn_down.addEventListener(MouseEvent.CLICK, nudge_down); function nudge_left(e:MouseEvent):void{ black_circle.x -= 10; } function nudge_right(e:MouseEvent):void{ black_circle.x += 10; } function nudge_up(e:MouseEvent):void{ [...]
The EventListener listens for every time Flash enters a new frame, and executes the function fly, which manipulates the X values of three objects on the stage.
I’m trying to wrap my head around Flash and basic Actionscript. So far, I have produced this exciting button, which loses 5% alpha for every click, and then restores alpha to 100% when the cursor leaves the button. Getting there!