Solved

Alert Box in actionscript 3

Posted on 2008-10-10
3
14,592 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

707 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