ActionScript3&Flex3 on Mac
ActionScript3を勉強中。
なんつーか、CS3とかFlex Builderとか高いけど、
とりあえずはIDEなしで。
FLEX3 SDKのダウンロード
http://www.adobe.com/products/flex/flexdownloads/
http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3
.bashrcへパスを通す
export PATH=/Library/Flex/flex_sdk_3.1.0.2710/bin:$PATH
rascatインストール
rascatを使うと、非常に楽にasのコンパイルができるようになるらしい。
さらにmongrelでサーバ起動してくれて、ブラウザで簡単にswfが確認できる。
rubyで動作、rubygemでインストール。
sudo gem install rascut --include-dependencies
コンパイル
macbook-okitsu:flex_test okitsu$ rascut -s HelloWorld.as
ハイフンsをつけると、サーバモード?になって、ブラウザで簡単にswfが確認できるようになる。すげーいい。
flex3対応のおまじない?
macbook-okitsu:flex_test okitsu$ rascut -s HelloWorld.as [11/09 00:11:26] Compile Start [11/09 00:11:27] Found update file(s)["./HelloWorld.as"] /Library/Ruby/Gems/1.8/gems/rascut-0.1.3/lib/rascut/fcsh_wrapper.rb:84:in `compile': Can't get Compile ID (RuntimeError) fcsh: コンパイルのターゲット ID として 1 が割り当てられました 設定ファイル "/Library/Flex/flex_sdk_3.1.0.2710/frameworks/flex-config.xml" をロードしています /Users/okitsu/flex_test/HelloWorld.swf (622 bytes) from /Library/Ruby/Gems/1.8/gems/rascut-0.1.3/lib/rascut/fcsh_wrapper.rb:74:in `synchronize' from /Library/Ruby/Gems/1.8/gems/rascut-0.1.3/lib/rascut/fcsh_wrapper.rb:74:in `compile' from /Library/Ruby/Gems/1.8/gems/rascut-0.1.3/lib/rascut/command.rb:60:in `run' from /Library/Ruby/Gems/1.8/gems/rascut-0.1.3/bin/rascut:10 from /usr/bin/rascut:19:in `load' from /usr/bin/rascut:19 macbook-okitsu:flex_test okitsu$
メッセージが日本語で、処理に失敗するらしい。
以下のコマンドを実行
export _JAVA_OPTIONS=-Duser.language=en/bin/