Saturday, August 7, 2010

Toggle Button in Flash AS 3.0

Click on the buttons in the image above to make each image dissappear and then reappear; and we can keep doing this endlessly.

We found out how to do this sort of thing in Flash Actionscript 3.0 by following the instructions in the following excellent YouTube video by "Flash Building":

The guy who made this video has an awesome website of Flash Actionscript 3.0 Tutorials. The place to go to get his complete toggle button lesson including Video, Resources, and AS 3.0 Code is here:

Flash Building Actionscript Toggle Button Tutorial

"In this free Flash AS3 instructional video and the free .fla source file download, beginners can learn how to use the flash button component to dynamically create buttons, place buttons, and make button component instances toggle property work. There are more properties for the button component instance that you can research to pinpoint the exact functionality you require in your application when using the button component."

We followed the instructions in the video, but Instead of drawing the oval shaped graphic, we set up the movie clip to be a photo as follows.

Another variation we did on the original Actionscript project was one where we made two different images continually swap with each other by using the toggle button functionality. We chose to use winning and losing AFL Football teams, but we could have also used Good and Evil, Happy and Sad, Big and Small, etc as our two contrasting images.

The following PDF document gives some review notes as well as the full Actionscript 3.0 Code for the toggle button projects shown in this Blog Post.

If you would like to have your own full size copy of this PDF, then simply click the save disk icon button on the PDF viewer, and you should be able to save it to your own hard disk.

Alternatively, you can view or save the full size PDF by clicking the link below:

Click here to open or save the “Toggle Button Notes” PDF

So Toggle Button is a great fun beginner's project for learning Actionscript 3.0 basics, so why not give it a go sometime, and try out some of the other Awesome FlashBuilder Tutorials at: on the awesome free "developphp" website.

Time for me to go back into "Hide Passy" mode for a while.

Big Passy Wasabi

No comments:

Post a Comment