<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Shacolon.com</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/" />
    <link rel="self" type="application/atom+xml" href="http://www.shacolon.com/atom.xml" />
   <id>tag:www.shacolon.com,2009://9</id>
    <link rel="service.post" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9" title="Shacolon.com" />
    <updated>2009-05-02T03:29:44Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type  3.33-ja</generator>
 
<entry>
    <title>Web開発者の日記</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/05/web.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=181" title="Web開発者の日記" />
    <id>tag:www.shacolon.com,2009://9.181</id>
    
    <published>2009-05-02T03:25:10Z</published>
    <updated>2009-05-02T03:29:44Z</updated>
    
    <summary>Web開発者の日記、はじめました。 自宅サーバーでやってます。主にActionS...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="Webのこと" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        <![CDATA[<a href="http://shacolon.ddo.jp/~aonori/">Web開発者の日記</a>、はじめました。

自宅サーバーでやってます。主にActionScript系です。書かれる内容のレベルは下級～中級クラス（と、自分では思ってます。）]]>
        
    </content>
</entry>
<entry>
    <title>ポリモーフィズム（多態性）</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/05/post_61.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=180" title="ポリモーフィズム（多態性）" />
    <id>tag:www.shacolon.com,2009://9.180</id>
    
    <published>2009-05-02T02:34:45Z</published>
    <updated>2009-06-01T00:31:16Z</updated>
    
    <summary>ポリモーフィズムってすばらしい。サブクラスはスーパークラスとして型宣言できるだけ...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        ポリモーフィズムってすばらしい。サブクラスはスーパークラスとして型宣言できるだけでなく、JavaやActionScriptにおいては、インターフェイスを使うことでその実装クラスがインターフェイスの型として宣言できるところがなんともすばらしい。「スーパークラスとして」というのは、要はMovieClipはSpriteの継承だからSprite型としても宣言できまっせという当たり前といえば当たり前な話なんだけど、すばらしいのはインターフェイス。
        インターフェイスは、多重継承を許さないJavaやActionScriptで使えるちょっと特殊な存在。インターフェイスにはメソッドのシグネチャー（名前、引数、戻り値の型）しか書かない（つまり中身の処理は書かない）、一見「え？」と思う内容なんだけど、そのインターフェイスを実装したクラスには、インターフェイスに書かれたメソッドを”必ず実装しなくてはならない”というルールが強いられる。（もしインターフェイスに書かれたメソッドを実装しなかった場合、コンパイル時にエラーが発生する。）

例え全く違うタイプのクラスを複数作った場合でも、同じインターフェイスが実装されていればそのインターフェイスのメソッドは”必ず実装されている”ことになるため、同じ型として宣言して、同じメソッドを呼び出すことができる。（例え処理の中身がコメントだけの空っぽメソッドだったとしても、処理の内容が全くことなるメソッドだったとしても、すべて「共通のメソッド名」で呼び出せることが約束される。）

型は違えど共通のメソッドを持っている。だったら、せめてその共通のメソッドだけは共通の型として扱えてもいいんじゃない？という親切設計なのだ。
    </content>
</entry>
<entry>
    <title>モス店員がめっさ噛んどった</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/03/post_60.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=179" title="モス店員がめっさ噛んどった" />
    <id>tag:www.shacolon.com,2009://9.179</id>
    
    <published>2009-03-30T14:32:18Z</published>
    <updated>2009-03-30T14:32:22Z</updated>
    
    <summary>モス行って持ち帰り注文して、来たと思ったらこれ↓ 「サウザンやさいす、しす、しつ...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ひとりごと" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        モス行って持ち帰り注文して、来たと思ったらこれ↓

「サウザンやさいす、しす、しつ、しす、しす、しすれ？しすれいしま、失礼しました。」

…どしたんや！（笑）
        
    </content>
</entry>
<entry>
    <title>Eventdispatcher#dispatchEvent()で独自のイベントを送出する</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/03/eventdispacherdispacheventiso2.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=178" title="Eventdispatcher#dispatchEvent()で独自のイベントを送出する" />
    <id>tag:www.shacolon.com,2009://9.178</id>
    
    <published>2009-03-23T14:15:47Z</published>
    <updated>2009-05-02T03:16:12Z</updated>
    
    <summary>イベントを送出するのに使うdispatchEventメソッド。引数にはEvent...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        イベントを送出するのに使うdispatchEventメソッド。引数にはEventオブジェクトを指定するんだけども、実はEventオブジェクトの定数を使わないでも任意の文字列を指定することで独自のイベントを送出できる。

イベントを発生させたいタイミングで
dispatchEvent( new Event(&quot;hoge&quot;) );
ってやれば、あらかじめ登録した任意文字列のリスナーでフックできる。
addEventListener(&quot;hoge&quot;, trace);
など。
        
    </content>
</entry>
<entry>
    <title>セッション管理</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/03/actionscript_30_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=177" title="セッション管理" />
    <id>tag:www.shacolon.com,2009://9.177</id>
    
    <published>2009-03-16T12:31:41Z</published>
    <updated>2009-05-02T03:16:40Z</updated>
    
    <summary>rootに変数作ってどこからでもアクセス可能なグローバル変数的なことやるのはなん...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        rootに変数作ってどこからでもアクセス可能なグローバル変数的なことやるのはなんか気持ち悪いと思った。

そこで以前ちょこっとやったサーブレットの「セッション」について思い出して、これをなんとかAS化できないかと思ったら意外とすんなり気持ち良く再現できた。やり方はSessionクラスをシングルトンで作って、Session#getSession()のファクトリメソッドに加えて、内部に連想配列を持たせてSession#setProperty()、Session#getProperty()を定義してプロパティ名と値を連想配列で関連付けてやればいい。

このとき、Sessionクラスはシングルトンとしてstatic変数に入れておくことで、Flashが終了するまでメモリに常駐して、共有される。まさにセッションそのもの。

ステキ。
        
    </content>
</entry>
<entry>
    <title>配列が早いか、XMLが早いか</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/03/actionscript_30_xml.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=176" title="配列が早いか、XMLが早いか" />
    <id>tag:www.shacolon.com,2009://9.176</id>
    
    <published>2009-03-15T00:19:02Z</published>
    <updated>2009-05-02T03:17:06Z</updated>
    
    <summary>なんかそろそろActionScriptっていうカテゴリがあってもいいような気がし...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        <![CDATA[なんかそろそろActionScriptっていうカテゴリがあってもいいような気がしてきた。

2,500件の商品名が書かれたシンプルなXMLから
・配列に格納して出力
・XMLを生成して出力
両方の速度差を検証してみた。
今回はネットブックを使用したため、デスクトップPCと比べるとかなり遅い結果になるはず。

<h3>配列に格納して出力した結果</h3>

XML取得完了: 146（ミリ秒）
配列作成（push）完了: 172（ミリ秒）
appendTextループ開始: 172（ミリ秒）
appendTextループ完了: 9511（ミリ秒）

<h3>XMLを生成して出力した結果</h3>

XML取得完了: 139（ミリ秒）
XMLツリー作成（appendChild）完了: 8118（ミリ秒）
appendTextループ開始: 8118（ミリ秒）
appendTextループ完了: 17492（ミリ秒）

appendText開始～完了までは配列、XMLそれぞれ9.339秒、9.374秒なのでそれほど差はなかった。大きく違うのは配列にpushする時間とXMLツリーを生成する時間の差。今回の検証ではなんと7.946秒もの差が出た。この差はかなりでかい。

結果としては値を取り出す速度は互角だが、XML#appendChild()よりもArray#push()の方が50倍近く速いということがわかった。当然、データを取得するリソースとしてすでにXMLを取得している場合はXML#appendChild()を使うこともないんだけど。]]>
        
    </content>
</entry>
<entry>
    <title>get/set</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/03/asgetset.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=175" title="get/set" />
    <id>tag:www.shacolon.com,2009://9.175</id>
    
    <published>2009-03-11T23:41:05Z</published>
    <updated>2009-05-02T03:20:33Z</updated>
    
    <summary>クラスのプロパティを外から変えた時にイベントを送出したいと思った。Java（Be...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        <![CDATA[クラスのプロパティを外から変えた時にイベントを送出したいと思った。Java（Bean）の影響もあってずっとゲッターとセッターを定義してやっとったんだけど、このたびgetとsetというAS独自の修飾子を習得した。

Aクラス内
private var _message:String;
public function set message(param:String):void
{
&nbsp;&nbsp;_message = param;
&nbsp;&nbsp;trace(param);
}

別のクラスで
Aインスタンス.message = "メッセージ";
やるとトレースされる。

つまりgetまたはset修飾子をつけた関数の関数名はそのまま変数名として扱われるわけですな。当然、関数がパブリックならパブリック変数として外部からの書き換えを許すわけです。これ簡単でステキ。]]>
        
    </content>
</entry>
<entry>
    <title>パフォーマンステスト</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2009/03/action_script_30_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=174" title="パフォーマンステスト" />
    <id>tag:www.shacolon.com,2009://9.174</id>
    
    <published>2009-03-08T12:42:23Z</published>
    <updated>2009-05-02T03:21:48Z</updated>
    
    <summary>繰り返し処理にはいろんな方法がある。おなじみのfor文から、for each.....</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        <![CDATA[繰り返し処理にはいろんな方法がある。おなじみのfor文から、for each..in文、while文など。配列から値を取り出して何かやる場合、どんな方法が一番速いんだろう？と思ってやってみた。

処理の内容は
1) 0～9999までの数値を配列にプッシュ。10000個の要素を持った配列ができる。
2) 配列の中身を順に取り出して、テキスト出力する。
3) すべての要素を出力したら終了。
これをそれぞれやり方を変えて3回測定する。

<h3>前処理</h3>

var array:Array = new Array();
for (var i:int = 0; i < 10000; i++ )
{
&nbsp;&nbsp;array.push(i);
}

<h3>速度テスト</h3>

<h4>[1]for文：いつものパターン</h4>

for ( var j:int = 0; j < array.length; j++ )
{
&nbsp;&nbsp;textarea.appendText(array[j] + "\n");
}

結果：
1回目測定:17.772秒
2回目測定:18.696秒
3回目測定:18.474秒
平均:18.314秒

<h4>[2]for文：IE+JSだと効果のあるパターン</h4>

for ( var j:int = 0; j < array.length; j++ )
{
&nbsp;&nbsp;var num:int = array[j];
&nbsp;&nbsp;textarea.appendText(num + "\n");
}

結果：
1回目測定:17.855秒
2回目測定:18.067秒
3回目測定:18.342秒
平均:18.088秒

<h4>[3]for文：lengthをあらかじめ変数に格納しておくパターン</h4>

for ( var j:int = 0,len:int = array.length; j < len; j++ )
{
&nbsp;&nbsp;var num:int = array[j];
&nbsp;&nbsp;textarea.appendText(num + "\n");
}

結果：
1回目測定:18.009秒
2回目測定:18.526秒
3回目測定:18.473秒
平均:18.336秒

<h4>[4]for each..in文</h4>

for each(var str:int in array)
{
&nbsp;&nbsp;textarea.appendText(str + "\n");
}

結果：
1回目測定:18.067秒
2回目測定:18.726秒
3回目測定:18.579秒
平均:18.457秒

<h4>[5]while文</h4>

var j:int = 0;
while (j < array.length)
{
&nbsp;&nbsp;textarea.appendText(array[j] + "\n");
&nbsp;&nbsp;j++;
}

結果：
1回目測定:18.226秒
2回目測定:18.652秒
3回目測定:18.623秒
平均:18.500秒

<h3>平均値</h3>

[1]18.314秒
[2]18.088秒
[3]18.336秒
[4]18.457秒
[5]18.500秒

結果としては[2]for文：IE+JSだと効果のあるパターンが一番速かった。ただ、一番遅かった[5]while文との差はわずか0.412秒しかなく、PCのヘルス状態にも左右されるためこれは誤差範囲なのかも。まぁ、最終的な結果としてはどれも変わらないといったところで、「慣れたやり方でできる」のが結論といったところでしょう。ちなみに今回はFlash Player 10.0 r12でテストしました。]]>
        
    </content>
</entry>
<entry>
    <title>今年もあとわずか</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2008/12/post_59.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=173" title="今年もあとわずか" />
    <id>tag:www.shacolon.com,2008://9.173</id>
    
    <published>2008-12-26T00:32:48Z</published>
    <updated>2008-12-26T00:32:52Z</updated>
    
    <summary>2008年はどんな年だっただろう？ 昨年と比較すると本の数が倍近く増えました。そ...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ひとりごと" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        2008年はどんな年だっただろう？

昨年と比較すると本の数が倍近く増えました。それほど知識を蓄えた年であり、学ぶべきことがたくさんみえた年でもありました。いろいろ焦りや挫折感を抱えながらなんとか耐え忍んでいるような状態ですが、一方で成長したところもあるので、一概に悪い年だったとは言えないかもしれません。

マイナスはプラスに転換できる。
来年またがんばりますか。
        
    </content>
</entry>
<entry>
    <title>ローカルフォントの取得</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2008/12/actionscript_30.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=172" title="ローカルフォントの取得" />
    <id>tag:www.shacolon.com,2008://9.172</id>
    
    <published>2008-12-18T00:35:23Z</published>
    <updated>2009-05-02T03:24:02Z</updated>
    
    <summary>Action Script 3.0でローカルフォントを取得するときは Font....</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        Action Script 3.0でローカルフォントを取得するときは Font.enumerateFonts(true); で取得する。引数はローカルからフォントを取得するかどうかを指定するもの。

フォントは一回呼び出せばメモリに展開されるのだと思ったら大間違いだった。というのも、フォント名を一覧するのにまずこのメソッドを呼び出してローカルフォントの配列を取得。次にforで回すんだけど、 回す回数と、フォント名を取得する箇所両方でそのまま使ったら激重になってしまった。

よくよく考えてみると、staticメソッドなのでメソッドを呼び出す度にフォントの配列を取得していたことに気づく…。要はforブロックの外で一旦変数に入れてしまえばいいわけでした。
        
    </content>
</entry>
<entry>
    <title>Flash Lite 3.0 テスト</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2008/12/flash_lite_30.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=171" title="Flash Lite 3.0 テスト" />
    <id>tag:www.shacolon.com,2008://9.171</id>
    
    <published>2008-12-13T05:10:28Z</published>
    <updated>2009-05-02T03:24:23Z</updated>
    
    <summary>http://shacolon.ddo.jp/~filehost/fltest/...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="ActionScript" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        http://shacolon.ddo.jp/~filehost/fltest/enterframe.swf
（ソース：http://shacolon.ddo.jp/~filehost/fltest/enterframe.fla）

・onEnterFrameが使えるか？
・onReleaseが使えるか？
・attachMovieが使えるか？
・setMaskが使えるか？
・座標取得できるか？
・アルファ値が使えるか？
・PCで表示できるか？

これ全部成功。

フィルターは使えないみたいだから
ActionScript2.0 + Flash Player 7と同等のことができると判断。
すてき・・・！！！
        
    </content>
</entry>
<entry>
    <title>イベントの送出</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2008/11/post_58.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=170" title="イベントの送出" />
    <id>tag:www.shacolon.com,2008://9.170</id>
    
    <published>2008-11-29T16:23:56Z</published>
    <updated>2008-11-29T16:33:45Z</updated>
    
    <summary>自作クラス内の処理の中で、あるタイミングでイベントを起こしたい時があります。例え...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="Webのこと" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        自作クラス内の処理の中で、あるタイミングでイベントを起こしたい時があります。例えば状態が変化したとき、 Event.CHANGE イベントを送出したい。そんな時は、 dispatchEvent メソッドを使います。

使い方は簡単で、送出したいタイミングで

　this.dispachEvent( new Event(Event.CHANGE) );

これでOK。
戻り値は Boolean（trueまたはfalse）で、イベントの送出に成功したら true 、失敗したら false を返します。
        
    </content>
</entry>
<entry>
    <title>未定義である可能性が高いメソッドの呼び出し - ActionScript</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2008/11/_actionscript.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=169" title="未定義である可能性が高いメソッドの呼び出し - ActionScript" />
    <id>tag:www.shacolon.com,2008://9.169</id>
    
    <published>2008-11-29T16:01:52Z</published>
    <updated>2008-11-29T16:23:41Z</updated>
    
    <summary>Flash Developで何をやっても「未定義である可能性が高いメソッドの呼び...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="Webのこと" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        <![CDATA[Flash Developで何をやっても「未定義である可能性が高いメソッドの呼び出し」というエラーが出続けていました。しまいにはStrictモードでコンパイルすることをやめてみると、コンパイルエラーはでなくなりましたが正常に動作しませんでした。なぜだー！と嘆いていると、あることに気づいたんです。

宣言している変数名と、インポートしているパッケージ名がかぶっている・・・！！

・・・これか？と思って変数名を変えてみたところ、無事に動きました。
あぁ～よかった。例えばこのような場合に起こります。

package
{
&nbsp;import flash.display.Sprite;
&nbsp;import shacolon.Hoge;

&nbsp;public class MyClass extends Sprite
&nbsp;{
&nbsp;&nbsp;public function MyClass() : void
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;var shacolon : Sprite = new Sprite();
&nbsp;&nbsp;&nbsp;shacolon.getChildAt(0);
&nbsp;&nbsp;}
&nbsp;}
}

→未定義である可能性が高い getChildAt の呼び出しです。]]>
        
    </content>
</entry>
<entry>
    <title>Flash Developでtrace()を実行するには</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2008/11/flash_developtrace.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=168" title="Flash Developでtrace()を実行するには" />
    <id>tag:www.shacolon.com,2008://9.168</id>
    
    <published>2008-11-24T06:04:42Z</published>
    <updated>2008-11-24T06:36:39Z</updated>
    
    <summary>Flash Developは、フリーの中で最強と言っても過言ではないほど、Fla...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="Webのこと" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        <![CDATA[<a href="http://www.flashdevelop.org/">Flash Develop</a>は、フリーの中で最強と言っても過言ではないほど、FlashとAIRの開発環境が整っています。ただし、Windows環境下で.NET Framework 2.0以降がインストールされている必要があるので注意が必要です。また、プロジェクトをビルド（またの名は「コンパイル」、「パブリッシュ」）するにはFlex SDKが必要になります。

無料でFlashやFlashベースのAIRが開発できてしまうなんて、いい時代になったもんです。（FlashがまだMacromedia製品だったときは、Flashの製品版を購入しないとswfにコンパイルできませんでした。）

ただ、このFlash Developにはちょっと問題もあって、デバッグ機能がありません。例外をスローしてもコンソール出力されないばかりか、Flashではお馴染みのtrace()すら使えないんです。こりゃ困った。ということでそれを解決するためには2つの方法があって・・・

　1. FlashConnect.trace() を使う
　2. デバッグ機能付きのFlash Playerを入手する

1は文字列の出力しかできないのに対し、2はオブジェクトを指定するとオブジェクトの型（例えば[String Object]など）を出力してくれるので、オススメは断然、後者です。ただ、デバッグ機能付きのFlash Playerを入手する必要があるため、ちょっと文字列が出てくればいいやという人は1でOKです。

1. FlashConnect.trace() を使う
org.flashdevelop.utils.FlashConnect をインポートするか、ソースコード内に直接書いちゃって、trace()メソッドを使用します。スタティックメソッド（静的メソッド）なので、インスタンスを生成する必要はありません。

import org.flashdevelop.utils.FlashConnect; でインポートして、
FlashConnect.trace() を使うか、
org.flashdevelop.utils.FlashConnect.trace(); で使います。

2. デバッグ機能付きのFlash Playerを入手する
<a href="http://www.adobe.com/support/flashplayer/downloads.html">http://www.adobe.com/support/flashplayer/downloads.html</a>
ここでスタンドアロンで動くデバッグ機能付きのFlash Playerを入手して、c:\Program Files\Adobe\Players かどっかに FlashPlayer.exe を入れておきます。
あとはWindowsのフォルダオプション（XPならコントロールパネルのフォルダオプションから、「ファイルの種類」（だったかな？）を選択。Vistaならコントロールパネルのプログラムから、「あるファイルの種類を特定のプログラムから開く」を選択する）で、拡張子「.swf」をさっき入手したFlash Playerで開くように設定を変更します。そしたら、Flash Developの方では単純に trace() を呼び出せばコンソールに出力されるようになります。
※swfを開くプログラムをデバッグ機能付きFlash Playerに変更しても出力されない場合、Flash Developの[Project]->[Properties]->[Test Movie]の設定を変更してみて下さい。

ちょっと面倒ですが、こうやってちょっとずつカスタマイズしていけば、かなり使い勝手のいい開発環境が無料で手に入ります。]]>
        
    </content>
</entry>
<entry>
    <title>Flash Develop でコンパイル時にエラー - Adobe AIR</title>
    <link rel="alternate" type="text/html" href="http://www.shacolon.com/2008/11/flash_develop_adobe_air.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://www.shacolon.com/cgi/mt/mt-atom.cgi/weblog/blog_id=9/entry_id=167" title="Flash Develop でコンパイル時にエラー - Adobe AIR" />
    <id>tag:www.shacolon.com,2008://9.167</id>
    
    <published>2008-11-23T18:21:51Z</published>
    <updated>2008-11-23T18:31:27Z</updated>
    
    <summary>Flex SDK 3.0から3.2にバージョンアップさせたところ、Flash D...</summary>
    <author>
        <name>あいろん</name>
        <uri>http://www.shacolon.com</uri>
    </author>
            <category term="Webのこと" />
    
    <content type="html" xml:lang="ja" xml:base="http://www.shacolon.com/">
        <![CDATA[Flex SDK 3.0から3.2にバージョンアップさせたところ、Flash DevelopでAIRのコンパイル時にエラー発生！DOS窓は一瞬で閉じてしまうため、あまりはっきり見えないけど下のようなエラーが出ている様子。

error while loading initial content.

このエラーについて調べたところ、QAサイトでこんなの見つけました。
<a href="http://bugs.adobe.com/jira/browse/FB-15687">http://bugs.adobe.com/jira/browse/FB-15687</a>
要は application-app.xml の名前空間を変更すればいいとのこと。

&lt;application xmlns="http://ns.adobe.com/air/application/1.0"&gt;
↑これをこれ↓に変えたら無事にコンパイルできました。
&lt;application xmlns="http://ns.adobe.com/air/application/1.5"&gt;

よかったよかった。]]>
        
    </content>
</entry>

</feed> 

