|
package lightbox
{
import flash.external.*;
import mx.formatters.*;
public class debug
{
// ***************************************************
// ログ表示
// ***************************************************
public static function firebug(data:Object):void {
// 日付編集用
var fmt:DateFormatter = new DateFormatter();
fmt.formatString = "YYYY/MM/DD HH:NN:SS";
var logdt:String = fmt.format( new Date );
try {
// JavaScript の呼び出し
ExternalInterface.call(
"console.log", logdt,
data+""
);
}
catch (error:Error) {
trace( logdt + " " + data );
}
}
// ***************************************************
// 開く( firefox 以外 )
// ***************************************************
public static function open():void {
try {
ExternalInterface.call(
"console.open"
);
}
catch (error:Error) {
trace( "AIR で ExternalInterface.call は使用できません" );
}
}
}
}
| |