fcwrap を動かすまでに必要なもの
AS3 (ActionScript 3) の開発を快適にするというfcwrap.とりあえず動かしてみた.AS3のコンパイルは時間がかかるので,fcwrap入れるとAS3のコンパイル&確認が楽になった.
- 前提
- fcshを入れる
- http://labs.adobe.com/wiki/index.php/Flex_Compiler_Shell
- zipを展開して,flex_sdk_2 のディレクトリにコピー.
- readline も入っておらず(つまり,コマンド履歴も,タブ補完も効かない),普通のshellコマンドも使えず,単独では使えなすぎる.
- gems 周り
$ sudo gem install hoe
$ sudo gem install mongrel
$ sudo gem install rack
-
-
- 一番最後のrackを知らず,rakeなら入っとるがな!と突っ込みを入れたのは内緒.
-
- 本命 fcwrap
$ svn co svn://rubyforge.org/var/svn/hotchpotch/fcwrap fcwrap
$ cd fcwrap
$ sudo rake install_gem
- 動かしてみる
- mxmlcとfcshが入っているディレクトリにはPATHが通っているとする.
- 以下の,HelloWorld.xmlとGreeter.asを作成する(http://www.adobe.com/support/documentation/jp/flex/index.html の「ActionScript 3.0のプログラミング」P27-28より)
- HelloWorld.xml
<?xml version="1.0" encoding="utf-8" ?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="vertical" creationComplete = "initApp()" > <mx:Script> <![CDATA[ public function initApp():void { mainTxt.text = Greeter.sayHello(); } ]]> </mx:Script> <mx:TextArea id = "mainTxt" width="400" /> </mx:Application>
-
- Greeter.as
package { public class Greeter { public static function sayHello():String { var greeting:String = "Hello World!!"; return greeting; } } }
-
- fcwrap 経由で監視する
$ fcwrap -s HelloWorld.mxml
-
-
- 勝手にコンパイルしてくれて,ログが表示される
-
[04/11 10:24:34] Start Rack::Handler::Mongrel http://0.0.0.0:3001/ [04/11 10:24:34] Found update files: Greeter.as HelloWorld.mxml [04/11 10:24:34] Compile Start [04/11 10:24:39] fcsh: Assigned 1 as the compile target id Loading configuration file /your/path/to/flex_sdk_2/frameworks/flex-config.xml /your/path/to/HelloWorld/HelloWorld.swf (133622 bytes)
-
-
- ブラウザでhttp://localhost:3001/ を覗くと
-