View Full Version : Is it possible to have a pop-up box in Flash CS3?
makimaki
08-04-2008, 12:06 PM
I'm creating a small program for an assignment and I need to know if it is possible to make a message box pop-up if say e.g a user enters the wrong details
more specifically, i want to make a message box appear saying: "You have not entered your details correctly, please re-enter them now"
If anyone can help, it is greatly appreciated
SergeantFlash
08-05-2008, 03:40 PM
You can use the code below:
import flash.external.ExternalInterface;
ExternalInterface.call("alert", "You have not entered your details correctly, please re-enter them now");
...but you can't change the title of the dialogue box. There is a tutorial about JavaScript and VBScript injection in ActionScript 3 HERE (http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in-ActionScript-3/Page1.html) that you can read if it helps.
makimaki
08-06-2008, 08:36 AM
That was helpful, I should have said it was in Actionscript 2.0 from the beginning though..Its slightly hard for me to explain, and apparently I cannot put the FLA file up on here...
On the first frame, I have a button to go to the next frame, which I want to not work unless you put in a username. The code at the moment looks like this:
beginPurchase.onPress = function() {
if (name == "") {
error = "Please Enter a Name to Continue";
} else {
beginPurchase.onPress = function() {
gotoAndStop("frame2");
};
}
};
The button works anyway, which it shouldnt, but it doesn't display an error message (In the error dynamic box)like it should. I just would rather have a pop-up message box saying "please enter your username to continue" as it would look much better.
If anyone can help with this they are a legend haha.:p
atomic
08-06-2008, 03:34 PM
Try this...
beginPurchase.onPress = function() {
if (name != undefined) {
gotoAndStop("frame2");
} else {
error = "Please Enter a Name to Continue";
}
};
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.