[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Alert Box in actionscript 3

Posted on 2008-10-10
3
Medium Priority
?
14,614 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

834 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