Categories

Partners
  • Website Templates

  • Design Feeds

  • Adobe Photoshop Tutorials

  • Website Templates, WordPress Themes

  • Website Templates

  • Flash Web Sites

  • Photoshop Templates

  • Photo Contests

  • Photo Tips
  • Search


    Advanced Search


    Partner Links
  • Adobe Photoshop Tutorials

  • Free Stock Photos and Images



  • Website Templates

    Using the Alert component
    Published  06/19/2006 | Macromedia Flash
       




    Using the Alert component

    Drag an Alert component onto the Stage. Then delete it. Then put this code on the main Timeline.

    1. import mx.controls.Alert;
    2. var listenerObj:Object = new Object();
    3. listenerObj.click = function(evt) {
    4.     switch (evt.detail) {
    5.     case Alert.OK :
    6.         trace("you hit \"OK\".");
    7.         break;
    8.     case Alert.CANCEL :
    9.         trace("you hit \"CANCEL\".");
    10.         break;
    11.     }
    12. };
    13. Alert.show("ALERT! Do you want to delete the Internet?", "Error", Alert.OK | Alert.CANCEL, this, listenerObj);
    Article Series
    This article is part 11 of a 13 part series. Other articles in this series are shown below:
    1. Flash FAQ - Introduction
    2. Streaming FLV files in Flash MX 2004
    3. Creating an XML Packet with Flash - the easy way
    4. Creating an XML Packet with Flash - the hard way
    5. Getting more colors for your Halo
    6. Loading in Images Using the MovieClipLoader Class
    7. Parsing an XML Packet in Flash
    8. Parsing XML in Flash Using the XMLConnector
    9. Sending an XML Packet to a Server-Side Page
    10. Using LoadVars.send Method to Exchange Data with a Server-Side Script
    11. Using the Alert component
    12. Using the LoadVars Class to Load Variables
    13. Using XPath in Flash MX 2004