Deprecated: Assigning the return value of new by reference is deprecated in /home/users/0/deca.jp-kawacci/web/blog/class/View.php on line 25

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/0/deca.jp-kawacci/web/blog/class/View.php on line 30

Warning: Cannot modify header information - headers already sent by (output started at /home/users/0/deca.jp-kawacci/web/blog/class/View.php:25) in /home/users/0/deca.jp-kawacci/web/blog/class/View.php on line 81
かわっちの日記::覚え書き

かわっちの日記

| VIEW | CALENDAR | ADMIN | TAGS | ARCHIVES |
覚え書き 17 years ago
記事の内容は、RuputerFanのブログをコピーした内容です。

開発中なら trace()で動作状況を確認することができるがオンラインコンテンツなどになるとそうもいかない。この方法を使うとクリップボードに出力できるのだそうな。これは便利。


class Log{
//ログ一覧
private static var logList:Array = new Array();

//コンストラクタ
private function Log(){}

//ログ設定
public static function set( str:String ):Void{
logList.push( str );
}

//ログをクリップボードへ出力
public static function put():Void{
System.setClipboard( logList.join( "\n" ) );
}

//ログ消去
public static function remove():Void{
logList = new Array();
}
}


上記のようなクラスを作り、下記のように使うとクリップボードに「test1」などが入るらしい。あとは適当なテキストエディタにペーストすればOK。


Log.set( "test1" );
Log.set( "test2" );
Log.put();