First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Thomas Watson | Website: http://hikercentral.net

This is sort of a follow-up to my previous tutorial on CGI Forms with Flash MX and the UI Components Set#2. I used the message box in that tutorial, but only with a single button. An email from a reader of that tutorial prompted me to take a closer look at the message box and how to use it with multiple buttons.

First if you don't have Components Set, go here. and get it. Install using the new version of Macromedia Exchange, which you can also download from that page.

Macromedia has issued very sparse documentation on these components, I guess leaving it up to us users to figure out how to use them. Perhaps one day they'll issue some tech notes or something, but in the meantime, here's what I've discovered. And I'll say up front, this may not be the most efficient way, but it works. I saw some hints along the way that makes me think there could be another way-- that there could be some methods that provide more direct access, but none that I could get to work.

timeline First here's what my timeline looks like. Just four layers. One for "actions", one for "functions", one for the "message box", and one for a dynamic text box that will display some feedback.

This could all be done in a couple of frames, but I like a little room to move around in. Some of the layers could be combined as well, but again, I like to have my projects organized so that I know where everything is, and can find them six months from now!

Go to frame 5 in the "action" layer and add a keyframe. For the action in that frame add stop();.

Next, drag a message box from the "Components" panel on to the stage and open the "Properties" panel. Just fill what you want for "Title", "Icon", and "Message."

Now click on the icon on the "Buttons" line to open the dialog which allows you to add buttons to the message box. For this tutorial I added two more to the existing one, changing it's name in the process. My buttons are "Yes", "No", and "Maybe." Next type in a name for your "close handler." This can be any name that makes sense to you. I called my "myCloseHandler."

After filling in the properties, be sure and give this message box an instance name. We have to do this to be able to talk to it in action scripts. I called this one "myBox."

Next, lock and hide the message box. In the center of the stage, right where the message box displays, add a small dynamic text box. Give it an instance name (mine is "ansrBox"). For this test, we don't need to assign a variable, although you likely will in "real" applications.

Next Page->
» Level Intermediate

Added: 2002-05-17
Rating: 7 Votes: 12
(10 being the highest)
» Author
Tom Watson is a Flash developer currently residing in Nashville, Tennessee. He's been an independant contractor in the computer business since 1989, working on web projects since the web was introduced to the Internet in 1994.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.