Alert Box in actionscript 3

How do you display a alert box in ActionScript 3.  It use to be so easy any sample code.

stargateatlantisAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ckoningConnect With a Mentor Commented:
The best way to do that is with the ExternalInterface class. This is availible in both ActionScript 2 and ActionScript 3.

1) Write a function in JavaScript to call the alert() function, which actually creates the alert

function notify( str )
{
   alert(str);
}

2) Use the ExternalInterface class to call the function

ExternalInterface.call( "notify","Some Message");

Note that the JavaScript function must be defined before the SWF is embedded in the HTML.

For more information, see the help section in Flash or the livedocs website maintained by adobe.
0
 
joeboxCommented:
What actionscript enviorment are you programming in? Flash or Flex?
I favor flex and you can use Alert.show("string here");
0
 
ckoningCommented:
This solution was written for Flash 9 with ActionScript 3. I have since moved to flex development for a variety of reasons.
0
All Courses

From novice to tech pro — start learning today.