Solved

Alert Box in actionscript 3

Posted on 2008-10-10
3
14,566 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now