First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
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!

Comments

  • 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: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.