Solved

Alert Box in actionscript 3

Posted on 2008-10-10
3
14,583 Views
Last Modified: 2013-11-11
How do you display a alert box in ActionScript 3.  It use to be so easy any sample code.

0
Comment
Question by:stargateatlantis
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
ckoning earned 500 total points
ID: 22694574
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
 

Expert Comment

by:joebox
ID: 24107085
What actionscript enviorment are you programming in? Flash or Flex?
I favor flex and you can use Alert.show("string here");
0
 
LVL 4

Expert Comment

by:ckoning
ID: 24154123
This solution was written for Flash 9 with ActionScript 3. I have since moved to flex development for a variety of reasons.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Action Script coding 1 181
Google Chrome Blank White Screens 13 302
EMET 5.2 / Adobe Flash 2 242
camtasia alternative that can record 3 hours video plus audio 24 126
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question