2011年12月30日 星期五

FlashDevelop compile swfs using a single class file

標題很難下..XD
大家應該有遇過進行小測試時,只想隨便寫個 as
要怎麼測試,又不想特別開一個 Project
更不想開肥大的 Flash CS5 IDE
那怎麼辦呢??


幸好 FlashDevelop 很好用很強大
有 build current file 這個功能
Tools -> Flash Tools -> Build Current File
or Ctrl + F8

but..compile 出來怎麼沒有 trace output?
或是想要加入某個 library.swc?
那怎麼辦??

只要在 as 檔頭加入 MXMLC options
FlashDevelop 就會自動照著 compile 了。
/**
* @mxmlc -debug -o=bin/ClassName.swf
* //@mxmlc -o=bin/ClassName.swf -l=GATracking.swc
*/
package
{
import flash.display.Sprite;
public class ClassName extends Sprite
{
public function ClassName()
{
trace("ClassName");
graphics.beginFill(0x1234567, 1);
graphics.drawCircle(100, 100, 100);
graphics.endFill();
}
}
}
view raw gistfile1.as hosted with ❤ by GitHub


沒有留言:

張貼留言