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

Once again, we go to the Components panel and click-drag an instance of the Message Box over onto the stage. Recall that we set up a separate layer to accept the box.

As you see here, this places a translucent "placeholder" image on the stage, and I've plopped it right over the two buttons. And as with all of our objects on the stage, start by giving this instance a name. I called mine errBox because it will mostly display error messages to the user.

If the Properties panel is not open, click the message box to open it. Now you can enter text you want to appear in the title bar of the message box and the message to display in the box. When you click on "icon" you get a choice of five icons that you may include in the message box.

Clicking on "OK" the default button, will open a window with which you may add additional buttons to the box along with their labels.

You may also add a "Click Handler" function that will be shared by all buttons, in which case you would need to pass a parameter to that function for each button. In my implementation here, it is not necessary that we have a click handler function, but simply use the default, which changes the visibility of the message box to false making it invisible.

In fact, that's how I've implemented the message box. It's always there, just invisible until needed. While it's invisible between calls, various parameters are changed to prepare it for the next call. Remember too, that it's disabled while invisible-- although it can also be disabled while visible as well, something you'll see in our code.

So let's go to a little scripting and see how all this fits together.

» Level Intermediate

Added: 2002-05-07
Rating: 9 Votes: 81
(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.