We can easily alert anything in java script. Is it possible to get this or similar alert in ActionScript ?
I have below test Class in Action Script. Trace does same as console.log() in java script. Is it possible to display messages in action script ?
package {
import flash.display.MovieClip;
public class ooas3 extends MovieClip{
public var color:String = "red";
public var num:Number = 100;
public function ooas3() {
theMovie_DoFSCommand(color,"ooas3 num is "+num);
}
function theMovie_DoFSCommand(color, args) {
if (command == "red") {
trace(command + " - " + args);
// Can above line is replaced by Alert similar to java Script Alert ?
}
}
}
}
As per the philipp's adivice I tested the below class on actionscript docs:
package {
import flash.text.TextField;
import flash.display.MovieClip;
import flash.external.ExternalInterface;
public class extint_test extends MovieClip {
public function extint_test() {
var isAvailable:Boolean = ExternalInterface.available;
var availTxt:TextField = new TextField();
availTxt.text = isAvailable.toString();
addChild(availTxt);
}
}
}
Above code alerts the "test" similar to javascript. This is a Flash Window that shows the message. But How to integrate similar code in my Class. i.e. How to do repalce trace ("something") with this Flash Alert window ?