我們可以在java腳本中輕鬆地發出警報。是否有可能在ActionScript中獲得這個或類似的警報?ActionScript中的JavaScript警報
我有以下測試類在行動腳本。 Trace與java腳本中的console.log()相同。是否可以在操作腳本中顯示消息?
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 ?
}
}
}
}
由於按照菲利普的adivice我測試下面的類上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);
}
}
}
上面的代碼提示「測試」類似的JavaScript。這是一個顯示消息的Flash窗口。但如何在我的類中集成類似的代碼。即如何使用此Flash警報窗口來修改trace ("something")
?
是看到這一點:http://code.google.com/p/flash-console/| - | http://labs.findsubstance.com/2008/02/26/firebugs-console-log-flash-debugging-made-easy/ http://code.google.com/p/flash-tracer/ | - | https://addons.mozilla.org/fr/firefox/addon/flashtracer/ – mgraph 2012-03-19 14:07:01
+1。謝謝mgraph – 2012-03-20 05:31:18