Flash 在开发flex应用程序时,如何将一些日志输出到控制台?
我是flex新手,正在尝试编写一些演示应用程序。现在我有一个非常新的问题:如何在flex应用程序中将一些日志输出到控制台(或其他我可以看到的地方) 在其他语言中,我可以使用:Flash 在开发flex应用程序时,如何将一些日志输出到控制台?,flash,apache-flex,debugging,logging,Flash,Apache Flex,Debugging,Logging,我是flex新手,正在尝试编写一些演示应用程序。现在我有一个非常新的问题:如何在flex应用程序中将一些日志输出到控制台(或其他我可以看到的地方) 在其他语言中,我可以使用: System.out.println("mylog"); console.log("mylog"); 但我不知道如何在flex中做到这一点。最简单的方法是使用“跟踪”,这是一个顶级函数,您可以在IDE和Flash调试播放器运行时使用它。另一种解决方案是ThunderBolt logger。您在这里有几个选项: trac
System.out.println("mylog");
console.log("mylog");
但我不知道如何在flex中做到这一点。最简单的方法是使用“跟踪”,这是一个顶级函数,您可以在IDE和Flash调试播放器运行时使用它。另一种解决方案是ThunderBolt logger。您在这里有几个选项:
trace()
- (使用
)minidugtarget
// var definition
private var t:Ttrace;
// Inside constructor
t = new Ttrace(true,"",true,false,"Debug console title",600,300);
t.ttrace("hello");
addChild(t);
// Var dump
t.ttrace("myvar = " + myVar);
// Warning
t.warn("warning");
// Error
t.error("An error has occured in .......");
Parmaters是:
Ttrace(
enabled:Boolean,
applicationName:String="",
useDebugBox:Boolean=false,
debugBoxVisible:Boolean=true,
debugBoxTitle:String="",
debugBoxWidth:Number=800,
debugBoxHeight:Number=400
)如前所述,您可以通过
import flash.external.ExternalInterface;
ExternalInterface.call("console.log", "YourString");