>

Examples of event
programming in action!
















If you're having trouble viewing this you may need to update your Flash Player.

Get the latest versions here:   Windows     Mac OS X


Here are some examples that we created. Each of them displays a basic functionality of event driven programming.


To start, click on the Flash work!

Move Mr. Snowman with the arrow keys and jump with the space bar, but watch out for those edges!
Touching the Super Mushroom puts it in the box! (refresh page to restart)


Event Programmers often use the time to trigger events. Here we used Flash along with the time to bring this digital clock to life!




Things like our little ship game here show that an event (like your moving the space ship) can create a form of AI for the little bomb and skull things to follow you around the screen. Click on the flash and use the arrow keys to move your ship! If the ActionScript detects a hit in flash, your life will drop down. Once it reaches 0 you will get a gameover, but you can click the again buttom to restart.





Our final creation is a little quiz game using events. Really, you are the one who chooses to click the button and this will send you to an appropriate scene. Each button is loaded with the ActionScript:

on(release){
_root.gotoAndPlay(1)
}

This means, that on the release of your mouse, Flash goes to and plays a specific scene. This example would go to 1, but you can change that to wherever you want. You must also include a stop(); in each frame you have. Simply right click on the timeline on top to the right of the thing that says "Layer" and get the appropriate scene. Go down to actions and enter stop(); Really all you need to know how to do to make this work is create buttons. With the given ActionScript put into each of them you can go to any frame on the click of a button. If you're wondering how to make a new frame, right click the frame that's next in line from where you're working and choose "insert blank keyframe." Best of luck to all of you!




Home