<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>xingxx</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/" />
    <link rel="self" type="application/atom+xml" href="http://log.xingxx.com/atom.xml" />
    <id>tag:log.xingxx.com,2009-02-07://1</id>
    <updated>2010-03-06T04:32:45Z</updated>
    <subtitle>Flash + ActionScript3.0 / XHTML+CSS+Javascript / JSFL/</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.1</generator>

<entry>
    <title>JSFL :: MMExecute+fl.runScriptで関数呼び出し時、引数に改行コードが入るとエラー</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2010/03/jsfl-mmexecuteflrunscript.html" />
    <id>tag:log.xingxx.com,2010://1.111</id>

    <published>2010-03-06T04:07:03Z</published>
    <updated>2010-03-06T04:32:45Z</updated>

    <summary>MMExecuteとfl.runScriptを使うことで、SWFPnaelから外...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="JSFL" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="jsfl" label="jsfl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p>MMExecuteとfl.runScriptを使うことで、SWFPnaelから外部のJSFLを叩けることは、このブログでも以前取り上げました。</p>
<ul>
<li><a href="http://log.xingxx.com/2009/08/jsfl-swfpanelas3swfswfpanelcal.html">SWFPanel(AS3/SWF)のメソッドを呼び出すswfPanel.call</a></li>
<li><a href="http://log.xingxx.com/2009/05/swfpaneljsflmmexecute2.html">SWFPanel(AS3)とJSFLを連携するMMExecute2</a></li>
</ul>
<p>SWFPanel開発時には、多用することになるこの二つのメソッド。<br />
しかし、外部JSFLの関数を呼び出す際には注意が必要です。</p>

<h3>引数はString</h3>
<p><a href="http://help.adobe.com/ja_JP/AS3LCR/Flash_10.0/adobe/utils/package.html#MMExecute()">MMExecute</a>は第一引数にJSFLをStringで渡します。ということは、必然的に関数のパラメータもStringになります。</p>
<h3>改行コードが含まれていると</h3>
<p>やってしまいがちなのがこの問題です。SWFPanel側で何らかの処理をし、MMExecuteに引き渡す際、Stringに改行コードが混入していると、<em>エラー</em>が発生します。</p>

<pre name="code" class="js">

MMExecute("fl.runScript(fl.configURI+'Commands/test.jsfl','test','mes\nsage')")
//SyntaxError: unterminated string literal

</pre>]]>
        <![CDATA[<h3>エスケープ</h3>
<p>というわけで、MMexecuteで関数呼び出し、引数を渡す際は、必ずエスケープをするようにします。</p>
<h4>ActionScript 3.0</h4>
<p>as3では、トップレベル関数として、escape関数が用意されています。</p>
<pre name="code" class="js">
import adobe.utils.MMExecute;
var param:String = escape("mes\nsage");
MMExecute("fl.runScript(fl.configURI+'Commands/test.jsfl','test','"+param+"')")
</pre>
<h4>JSFL</h4>
<p>JSFL側では、unescape関数を使用して、引数を元に戻します。</p>
<pre name="code" class="js">
function test(str){
	fl.trace(unescape(str))
}
</pre>]]>
    </content>
</entry>

<entry>
    <title>links for 2010-03-04</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2010/03/links-for-20100304.html" />
    <id>tag:log.xingxx.com,2010://1.110</id>

    <published>2010-03-04T15:01:38Z</published>
    <updated>2010-03-04T15:01:38Z</updated>

    <summary>                 Flash Player の Mip マップサ...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="BookMark" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<ul class="delicious"><li>
                <div class="delicious-link"><a href="http://cuaoar.jp/2010/03/flash-player-mip.html">Flash Player の Mip マップサポートについて - akihiro kamijo</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/flash">flash</a> <a href="http://delicious.com/kaedeas/actionscript3.0">actionscript3.0</a> <a href="http://delicious.com/kaedeas/tips">tips</a>)</div>
            </li></ul>]]>
        
    </content>
</entry>

<entry>
    <title>links for 2010-03-03</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2010/03/links-for-20100303.html" />
    <id>tag:log.xingxx.com,2010://1.109</id>

    <published>2010-03-04T06:01:39Z</published>
    <updated>2010-03-04T06:01:39Z</updated>

    <summary>                 Support Details | Tech ...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="BookMark" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<ul class="delicious"><li>
                <div class="delicious-link"><a href="http://supportdetails.com/">Support Details | Tech Support Management</a></div>
                <div class="delicious-extended">動作環境がひとめでわかる</div>
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/development">development</a> <a href="http://delicious.com/kaedeas/debug">debug</a>)</div>
            </li><li>
                <div class="delicious-link"><a href="http://www.ajax.org/">Ajax.org - The real-time collaborative application platform</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/javascript">javascript</a> <a href="http://delicious.com/kaedeas/library">library</a>)</div>
            </li><li>
                <div class="delicious-link"><a href="http://www.adobe.com/jp/devnet/air/flex/articles/framerate_throttling.html">Adobe AIRでのCPU使用率の削減 | デベロッパーセンター</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/actionscript3.0">actionscript3.0</a> <a href="http://delicious.com/kaedeas/air">air</a> <a href="http://delicious.com/kaedeas/tips">tips</a>)</div>
            </li></ul>]]>
        
    </content>
</entry>

<entry>
    <title>Other :: Flash CS5 で 開発した iPhoneアプリ MiningMine</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2010/03/other-flasch-cs5-iphone-mining.html" />
    <id>tag:log.xingxx.com,2010://1.108</id>

    <published>2010-03-03T06:02:34Z</published>
    <updated>2010-03-03T06:02:34Z</updated>

    <summary> 次期Flash CS5 の目玉機能、搭載が予定されているpackager fo...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="other" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="flash" label="flash" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p><img src="http://a1.phobos.apple.com/us/r1000/022/Purple/e0/2b/7e/mzl.tnceggag.480x480-75.jpg" />
<img src="http://a1.phobos.apple.com/us/r1000/038/Purple/2c/43/8e/mzl.fuympqpk.480x480-75.jpg" /></p>

<p>次期Flash CS5 の目玉機能、搭載が予定されているpackager for iphone。FlashでiPhoneアプリが開発できるというなんともまぁ、夢のようなお話です。ご縁があってベータ版に参加させていただき、さっそく開発してみました。</p>





]]>
        <![CDATA[<h3>MiningMine</h3>
<p><a href="http://itunes.apple.com/jp/app/miningmine/id358072463?mt=8">http://itunes.apple.com/jp/app/miningmine/id358072463?mt=8</a></p>
<p>このゲームは、マインスイーパの拡張で、地雷を除去するのではなく、地雷を避けつつスタートからゴールまでの全てのパネルをあける、シンプルなゲームです。</p>

<h3>雑感</h3>
<p>packager for iphone 。すごいです。一言で申し上げるなら、Flash is universe。新たな可能性を感じさせます。本当に<em>Windowsだけ</em>でiPhoneアプリが作れてしまいます。ちなみに、制作時間は2日、審査に三日でした。Flash CS5の発売が楽しみですね。</p>]]>
    </content>
</entry>

<entry>
    <title>BetweenAS3がoverwriteに対応。</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2010/02/betweenas3overwrite.html" />
    <id>tag:log.xingxx.com,2010://1.107</id>

    <published>2010-02-15T11:02:08Z</published>
    <updated>2010-02-15T11:59:38Z</updated>

    <summary> swfobject.embedSWF(&quot;http://xingxx.com/b...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="ActionScript 3.0" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="actionscript30" label="ActionScript3.0" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<div style="margin:0.5em 30px 1em;">
<div id="tweener"></div>
<div id="betweenAS3_a"></div>
<div id="betweenAS3_b"></div>
</div>

<script language="javascript">
swfobject.embedSWF("http://xingxx.com/blog/2010/02/15/betweenas3_r3080.swf", "betweenAS3_a", "100", "150", "10.0.0");
swfobject.embedSWF("http://xingxx.com/blog/2010/02/15/tweener_13174.swf", "tweener", "100", "150", "10.0.0");
swfobject.embedSWF("http://xingxx.com/blog/2010/02/15/betweenas3_r3422.swf", "betweenAS3_b", "100", "150", "10.0.0");
</script>

<p>超高速なTweenライブラリとして有名な<a href="http://www.libspark.org/wiki/BetweenAS3/en">BetweenAS3</a>が念願のoverwriteに<a href="http://www.libspark.org/changeset/3422">対応</a>したようなので、さっそく試してみました。<br />
左がTweener,真ん中が変更前のBetweenAS3、そして右が今回アップデートされたBetweenAS3を使ったトゥイーンです。かなり単純なスクリプトで、ロールオーバーされたらalphaが0.5に、ロールアウトされたら1になります。</p>

<p>挙動をみてみると、変更前の真ん中のサンプルでは高速にロールオーバー・アウトを繰り返すとチカチカしますが、右の最新バージョンではTweener版同様、気持ちよくトゥイーンしてくれます。今までは適宜stop()させないといけなかったので、嬉しい修正ですね！</p>]]>
        
    </content>
</entry>

<entry>
    <title>JSFL :: 出力パネルを指定時間で自動消去 OutputClear</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2010/02/jsfl-outputclear.html" />
    <id>tag:log.xingxx.com,2010://1.106</id>

    <published>2010-02-15T10:22:13Z</published>
    <updated>2010-02-15T10:29:48Z</updated>

    <summary> traceを出し過ぎて、プレビューが重い事ってありますよね。 自分だけ作業して...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="JSFL" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="jsfl" label="jsfl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p><img alt="outputClear.jpg" src="http://log.xingxx.com/2010/02/15/outputClear.jpg" width="137" height="107" class="mt-image-none" style="" /></p>

<p>traceを出し過ぎて、プレビューが重い事ってありますよね。<br />
自分だけ作業しているときには全文検索でtrace全削除すればいいけど、複数人の場合にはそういうわけにもいきません。</p>

<p>trace文は消したくない！プレビューだけみたいのに重い。</p>

<p>そんなときのSWFPanelです。</p>

<p>ダウンロードは以下から。</p>
<ul>
<li><a href="http://www.libspark.org/wiki/OutputClear">http://www.libspark.org/wiki/OutputClear</a></li>
<li><a href="http://www.libspark.org/svn/mxp/OutputClear/trunk/outputclear.mxp">http://www.libspark.org/svn/mxp/OutputClear/trunk/outputclear.mxp</a></li>
</ul>]]>
        
    </content>
</entry>

<entry>
    <title>2.2</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2010/01/22.html" />
    <id>tag:log.xingxx.com,2010://1.105</id>

    <published>2010-01-19T15:00:00Z</published>
    <updated>2010-01-19T15:01:51Z</updated>

    <summary>22歳になりました。一年というのはとても早いものですね、、 昨年もあっという間で...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="other" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="other" label="other" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p>22歳になりました。一年というのはとても早いものですね、、<br />
昨年もあっという間でした。<br />
イベントや本の出版など、たくさんの方々にお世話になりました。<br />
皆様、本当にありがとうございました。本年もどうぞよろしくお願い致します！</p>

]]>
        <![CDATA[<p>さて、<a href="http://log.xingxx.com/2009/01/kaede210.html">去年の今日のエントリー</a>を振り返ってみます。</p>

<blockquote>
今年の目標は
<ul>
<li>温めているアレの完成</li>
<li>Rubyをかじりたい</li>
<li>Mac Book 買う</li>
</ul>
</blockquote>

<p>ということでした。<em>温めているアレ</em>というのは、<a href="http://log.xingxx.com/2009/08/actionscript-30-3.html">ActionScript 3.0エラーアーカイブス</a>ですね。この時はまだ発表もされておらず、頑張り時でした。お陰様で、ご好評頂いているようです。メインの本にはなり得ませんが、ご活用頂ければ幸いです:)</p>

<p>二つめのRuby。今年は基本的な言語構造やシンタックスを習得することができ、実務でも非常に役に立ちました。<a href="http://log.xingxx.com/2009/10/ruby-actionscript-30-ruby.html">Ruby :: ActionScript 3.0 とRubyの定義を見比べる - クラス編</a>では、なんとTwitterでRubyの生みの親、<a href="http://twitter.com/yukihiro_matz">まつもとひろゆき氏</a>に<a href="http://twitter.com/yukihiro_matz/status/5307046880">見て頂けた</a>ようで、大変光栄です。</p>

<p>三つ目のMacBook。新機が出次第買います！</p>

<p>というわけで、なんとか目標は達成できたのではないかと。</br>
で、今年の目標なんですが,,,
</p>

<ul>
<li>Flash for iphone !</li>
<li>Rails</li>
<li>go or python</li>
<li>英語</li>
</ul>

<p>こんな感じでゆるーく頑張うと思います～。特に英語は・・・。急務ですね。</p>

<p>それでは、今年もよろしくお願い致します！</p>]]>
    </content>
</entry>

<entry>
    <title>links for 2009-12-23</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/12/links-for-20091223.html" />
    <id>tag:log.xingxx.com,2009://1.104</id>

    <published>2009-12-23T15:02:12Z</published>
    <updated>2009-12-23T15:02:12Z</updated>

    <summary>                 Adobe Labs - Downloads:...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="BookMark" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<ul class="delicious"><li>
                <div class="delicious-link"><a href="http://labs.adobe.com/downloads/flashplayer10.html">Adobe Labs - Downloads: Flash Player 10.1</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/flash">flash</a> <a href="http://delicious.com/kaedeas/flashplayer">flashplayer</a>)</div>
            </li></ul>]]>
        
    </content>
</entry>

<entry>
    <title>FITC tokyo 2009 詳細レポート</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/12/fitc-tokyo-2009.html" />
    <id>tag:log.xingxx.com,2009://1.103</id>

    <published>2009-12-23T06:02:12Z</published>
    <updated>2009-12-23T06:02:12Z</updated>

    <summary>FITCはトロントをはじめ，シカゴ，ハリウッド，韓国，アムステルダムにおいて成功...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="Writing" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="writing" label="Writing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p><a href="http://www.fitc.ca/events/about/?event=104">FITC</a>はトロントをはじめ，シカゴ，ハリウッド，韓国，アムステルダムにおいて成功を収めたデザイン・テクノロジーイベント。</p>

<p>ついに東京上陸ということで大注目されていたFITC。もちろん参加させていただき、その詳細レポートを執筆しました。<a href="http://gihyo.jp/">gihyo.jp</a>にて掲載されています。１セッションずつ、ボリュームありますがお手透きに見ていただけましたら幸いです。</p>

<p><a href="http://gihyo.jp/news/report/01/fitc2009">一覧</a></p>
<ol>
<li><a href="http://gihyo.jp/news/report/01/fitc2009/0001">Lee Brimelow氏「Sneak Peek of Max 2009」Flash CS5などの新機能の紹介</a></li>
<li><a href="http://gihyo.jp/news/report/01/fitc2009/0002">Keith Peters氏「Making Tings Move」物理アニメーションの基礎</a></li>
<li><a href="http://gihyo.jp/news/report/01/fitc2009/0003">Mario Klingemann氏「Connectiong the Dots」数学とアートの共通点</a></li>
<li><a href="http://gihyo.jp/news/report/01/fitc2009/0004">Grant Skinner氏「Quick as a Flash」ActionScriptの最適化</a></li>
<li><a href="http://gihyo.jp/news/report/01/fitc2009/0005">Joshua Hirsch氏「Big Spaceship : Digital Creative Agency」品質は楽しむことから生まれる</a></li>
</ol>]]>
        
    </content>
</entry>

<entry>
    <title>links for 2009-12-03</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/12/links-for-20091203.html" />
    <id>tag:log.xingxx.com,2009://1.102</id>

    <published>2009-12-03T15:03:37Z</published>
    <updated>2009-12-03T15:03:37Z</updated>

    <summary>                 Flex itemRendererの理解 – ...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="BookMark" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<ul class="delicious"><li>
                <div class="delicious-link"><a href="http://www.adobe.com/jp/devnet/flex/articles/itemrenderers_pt1.html">Flex itemRendererの理解 – パート１：インラインレンダラ | Developer Center</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/flex">flex</a> <a href="http://delicious.com/kaedeas/tips">tips</a>)</div>
            </li></ul>]]>
        
    </content>
</entry>

<entry>
    <title>links for 2009-12-02</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/12/links-for-20091202.html" />
    <id>tag:log.xingxx.com,2009://1.101</id>

    <published>2009-12-03T06:03:38Z</published>
    <updated>2009-12-03T06:03:38Z</updated>

    <summary>                 stats - mrdoob - FPS, M...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="BookMark" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<ul class="delicious"><li>
                <div class="delicious-link"><a href="http://code.google.com/p/mrdoob/wiki/stats">stats - mrdoob - FPS, MS and MEM. All in one. - Project Hosting on Google Code</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/actionscript3.0">actionscript3.0</a> <a href="http://delicious.com/kaedeas/library">library</a>)</div>
            </li></ul>]]>
        
    </content>
</entry>

<entry>
    <title>links for 2009-11-26</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/12/links-for-20091126.html" />
    <id>tag:log.xingxx.com,2009://1.100</id>

    <published>2009-12-02T06:03:03Z</published>
    <updated>2009-12-02T06:03:03Z</updated>

    <summary>                 AS3 でメソッドチェーンしたくなる話 (2)...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="BookMark" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<ul class="delicious"><li>
                <div class="delicious-link"><a href="http://d.hatena.ne.jp/nitoyon/20091126/as3_method_chain_2">AS3 でメソッドチェーンしたくなる話 (2) - てっく煮ブログ</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/actionscript3.0">actionscript3.0</a> <a href="http://delicious.com/kaedeas/tips">tips</a>)</div>
            </li><li>
                <div class="delicious-link"><a href="http://myruby.seesaa.net/article/120476390.html">Ruby/TKのインストールとHello World!</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/ruby">ruby</a> <a href="http://delicious.com/kaedeas/tips">tips</a>)</div>
            </li><li>
                <div class="delicious-link"><a href="http://www.ruby-lang.org/ja/man/html/_C5BAC9D5A5E9A5A4A5D6A5E9A5EA.html">添付ライブラリ - Rubyリファレンスマニュアル</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/ruby">ruby</a> <a href="http://delicious.com/kaedeas/reference">reference</a>)</div>
            </li><li>
                <div class="delicious-link"><a href="http://pub.cozmixng.org/~kou/rexml-doc-ja/">REXML API document (ja)</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/ruby">ruby</a> <a href="http://delicious.com/kaedeas/reference">reference</a> <a href="http://delicious.com/kaedeas/library">library</a>)</div>
            </li><li>
                <div class="delicious-link"><a href="http://japan.internet.com/developer/20070703/27.html">REXML：RubyによるXML処理 - japan.internet.com デベロッパー</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/ruby">ruby</a> <a href="http://delicious.com/kaedeas/tips">tips</a> <a href="http://delicious.com/kaedeas/library">library</a>)</div>
            </li><li>
                <div class="delicious-link"><a href="http://www.nslabs.jp/ruby-rexml.rhtml">RubyでXML操作: Netsphere Laboratories</a></div>
                
                <div class="delicious-tags">(tags: <a href="http://delicious.com/kaedeas/ruby">ruby</a> <a href="http://delicious.com/kaedeas/tips">tips</a> <a href="http://delicious.com/kaedeas/library">library</a>)</div>
            </li></ul>]]>
        
    </content>
</entry>

<entry>
    <title>Writing :: Web Directions East 2009 レポート</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/11/writing-web-directions-east-20.html" />
    <id>tag:log.xingxx.com,2009://1.99</id>

    <published>2009-11-26T06:02:24Z</published>
    <updated>2009-11-26T06:02:24Z</updated>

    <summary> Web Directions East は、&quot;Webとビジネスを繋ぐ発想と創造...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="Event" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Writing" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="writing" label="Writing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p><a href="http://gihyo.jp/news/report/2009/11/1801"><img src="http://east.webdirections.org/wp-content/themes/wde/images/logo.png" /></a></p>

<p>Web Directions East は、"Webとビジネスを繋ぐ発想と創造"をテーマに、2008年より開催されているWEB業界者向けのイベント。マークアップエンジニアやJavascript経験者、Webデザイナー/ディレクターをターゲットとして、世界から招聘されたエキスパートが登壇することで有名です。</p>

<p>セッションは、HTMLやCSS、Javascript、もしくはワークフローに関することからデザイン/ビジネス
に至るまで様々です。</p>

<p>今回も昨年と同様、セッションの内容をレポートを執筆しました。</br>
ご興味のある方はお手透きにでもご一読ください！</p>
<ul>
<li><a href="http://gihyo.jp/news/report/2009/11/1801">「Web Directions East 2009」レポート（前編）</a>
<li><a href="http://gihyo.jp/news/report/2009/11/1901">「Web Directions East 2009」レポート（後編）</a></li>
</ul>]]>
        
    </content>
</entry>

<entry>
    <title>Ruby :: ActionScript 3.0 とRubyの定義を見比べる - クラス編</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/10/ruby-actionscript-30-ruby.html" />
    <id>tag:log.xingxx.com,2009://1.98</id>

    <published>2009-10-30T13:40:40Z</published>
    <updated>2009-10-30T13:56:34Z</updated>

    <summary> 日にちびちびとRubyを触ってます。そんな備忘録。 今回はAS3とRubyのク...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="ActionScript 3.0" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Ruby" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="actionscript30" label="ActionScript3.0" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ruby" label="ruby" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p>
日にちびちびとRubyを触ってます。そんな備忘録。
今回はAS3とRubyのクラス定義について見比べてみましょう。
</p>
]]>
        <![CDATA[<h3>クラス定義</h3>
<h4>ActionScript 3.0</h4>
<p>まずはおなじみのAS3のクラス定義です。class定義キーワードを使って、TestClassを定義します。クラス定義にあたってのポイントを列挙します。</p>
<ul>
	<li>ファイル名とクラス名は一致しなければならない。</li>
	<li>定義範囲は{}で決定。</li>
	<li>パッケージ</li>
	<li>アクセス制御指定子を省略した場合は、クラス、インスタンス変数・メソッドは自動的にinternalとなる。コンストラクタはpublicに設定される。</li>
	<li>変数にはvar宣言を付けなければならない。</li>
	<li>変数・定数・引数・戻り値には型を付けることが推奨されている。</li>
</ul>
<pre name="code" class="js">
package {
	
	class  TestClass{
		
		var name:String;
		
		function TestClass(name:String):void {
			this.name = name
		}
		
		function hello():String {
			return "hello" + name;
		}
		
	}
	
}
</pre>
<p>TestClassクラスはいたって単純で、コンストラクタで引数としてnameプロパティを受け取り、helloメソッドを実行すると、コンストラクタで設定されたnameプロパティの値を、返します。</p>
<p>これをRubyで表現するといかのようになります。</p>
<h4>Ruby</h4>
<pre name="code" class="ruby">
class TestClass

    def initialize(name);
    	@name = name.to_s;#インスタンス変数
    end

    def hello()
	    "hello #{@name} !";
    end

end
</pre>
<p>以下に相違点を列挙します。</p>
<ul>
	<li>ファイル名とクラス名は一致しない。慣習としてクラス名TestClassの場合、ファイル名はtest_class.rbというような形式になる。</li>
	<li>定義範囲は定義文-class endで決定。</li>
	<li>アクセス制御指定子を省略した場合は、クラス、メソッドは自動的にpublicとなる。</li>
	<li>インスタンス変数はそのままでは外部からアクセスできない</li>
	<li>initializeメソッドがコンストラクタ</li>
	<li>暗黙型変換はされないのでto_メソッドを使って任意の型に変換しなければいけない</li>
	<li>文字列内で#{}を使うことで、変数にアクセスしたり制御文を定義できる。</li>
	<li>インスタンス変数には@を付ける。特別な宣言分は必要なく、どこで定義してもインスタンス内から参照できる</li>
	<li>return文は省略でき、その場合は最終行の値を自動的に返す。</li>
	<li>型指定はない</li>
</ul>
<h3>アクセス制御</h3>
<p>外部からのアクセス方法について定義するアクセス制御指定子。ActionScript 3.0では、public,protected,internal,privateが存在しますが、パッケージが存在しないRubyはpublic,protected,privateの三つを使うことができます。前述で、メソッドのアクセス制御指定子は省略することができ、その場合はpublicに設定されると書きましたが注意が必要です。ActionScript 3.0では"対象のメソッドに対して付与する"イメージですが、Rubyは"実行時に制御を切り替える"イメージです。どういうことかというと、たとえば以下のような場合、メソッドaは、privateを付与されます。続くbメソッドでは、publicでなくprivateが付与されるわけです。つまり、制御指定子を宣言した時点で、制御指定子を省略した場合の挙動が変動します。続くメソッドcでは、再びアクセス制御指定子を使用してpublicに設定していますので、アクセス制御指定子が省略されたメソッドdはpublicが設定されます。</p>
<h4>ActionScript 3.0</h4>
<pre name="code" class="js">
private function a():String{
	return "a"
}

function b():String{//internalになる
	return "a"
}

protected function c():String{
	return "a"
}
</pre>
<h4>Ruby</h4>
<pre name="code" class="ruby">
 private
  def a()
    "a"
  end

  def b()//ここはprivate
    "b"
  end

  public
  def c()
    "c"
  end

  def d()
    "d"
  end
</pre>
<h3>アクセサ</h3>
<p>Rubyでは、インスタンス変数に外部からアクセスすることはできません。ActionScript3.0でいう、privateに設定されている状態だと考えてください。外部からインスタンス変数を読み込んだり書き込んだりしたい場合、アクセサを使用することが義務づけられます。</p>
<h4>ActionScript 3.0</h4>
<p>ActionScript 3.0でのアクセサは、メソッドを介して行われます。privateに設定したインスタンス変数を参照および、書き込む専用のメソッドを、get/setキーワードをそれぞれ使用して定義します。読み込み専用の場合には、getのみを定義します。</p>
<pre name="code" class="js">
private var _name:String;
		
public function get name():String { return _name; }

public function set name(value:String):void {
	_name = value;
}
</pre>
<h4>Ruby</h4>
<p>Rubyにおけるアクセサの定義は、attr_accessorメソッドを使用します。一見キーワードに見えますが、Moduleクラスに定義されているメソッドです。ちなみにRubyではメソッドの実行に()を使っても使わなくても構いません。このattr_accessorに指定される引数は、インスタンス変数ですが、ここではシンボルという任意の文字列と一対一に対応するオブジェクトで指定します。この方法を使うと一行で済み、無駄がありません。読み込み専用の場合は、attr_readerを使用します。</p>
<pre name="code" class="ruby">
class TestClass

    attr_accessor :name;#nameをアクセサに
    
    def initialize(name);
    	@name = name.to_s;#インスタンス変数
    end

    def hello()
	    "hello #{@name} !";
    end

end
</pre>
<h3>クラスの呼び出しと生成</h3>
<p>Rubyのクラスの呼び出しは、ActionScriptとさして代わりありません。基本的には、読み込んで、呼び出して、生成です。</p>
<h4>ActionScript 3.0</h4>
<pre name="code" class="js">
imoprt TestClass;
var test = new TestClass("tom");
tarce(test.hello());//hello tom !
test.name = "bob";
tarce(test.hello());//hello bob !
</pre>
<h4>Ruby</h4>
<pre name="code" class="ruby">
#main.rb
require "test_class.rb";
test = TestClass.new "tom";
p test.hello ;#"hello tom !"
test.name = "bob";
p test.hello ;#"hello bob !"
</pre>
<p>importの代わりに、requireメソッドを使用します。Rubyの全てのクラスはObjectを継承しており、Objectはkernelモジュールをインクルードしています。このモジュールで定義されているのがrequireです。引数にはクラス名ではなく、ファイル名を与えます。そして、クラスの生成です。ActionScript 3.0の場合にはnew 演算子をクラスの前で使用しますが、Rubyではnewメソッドが継承されています。生成したオブジェクトはnewで与えられた引数を自動的にinitialize()メソッドに委譲して実行します。三行目で実行されている pは、ActionScript 3.0でいうtraceで、出力用のメソッドです。</p>

<h3>まとめ</h3>
<p>RubyとActionScript 3.0の定義方法、少しの違いはあれど、さして抵抗は無いと思えます。Perlの代わりにと、まつもとゆきひろ氏が開発した言語、Ruby。Rubyを学習することで、ところどころにちりばめられた効率化のための欠片を垣間見ることが出来るかも知れません。</p>
<p>次回は継承とクラスメソッドについてご紹介します。</p>]]>
    </content>
</entry>

<entry>
    <title>ActionScript 3.0 :: マウスジェスチャー</title>
    <link rel="alternate" type="text/html" href="http://log.xingxx.com/2009/10/actionscript-30-4.html" />
    <id>tag:log.xingxx.com,2009://1.97</id>

    <published>2009-10-30T10:43:42Z</published>
    <updated>2009-10-30T10:53:30Z</updated>

    <summary> SparkProjectに、MouseGestureをアップしました。Mous...</summary>
    <author>
        <name>kaede</name>
        
    </author>
    
        <category term="ActionScript 3.0" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sparkproject" label="SparkProject" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://log.xingxx.com/">
        <![CDATA[<p>
SparkProjectに、MouseGestureを<a href="http://www.libspark.org/wiki/kaede/MouseGesture">アップ</a>しました。MouseGestureは、その名の通りマウスジェスチャーを手軽実装するためのライブラリです。ジェスチャーの挙動としては、Firefoxのアドオン、ALL in one Gestureが近いでしょう。基本的には、左クリックが押された瞬間から離されるまでの挙動をイベントとして送出します。タッチパッドを用いた少ないアクションが必要とされる案件で使えるかも知れません。以下はサンプルと使い方。</p>
]]>
        <![CDATA[<script language="javascript">
	swfobject.embedSWF("http://xingxx.com/shared/swf/mousegesture.swf", "mousegesture", "500", "250", "9.0.0");
</script>
<h3>サンプル</h3>
<div style="margin: 0.5em 30px 1em; width: 500px; text-align: left;border:solid 1px #000000">
<div id="mousegesture"></div>
</div>
<h3>使い方</h3>
<ul>
	<li>GesturePadインスタンスを表示リストの最上位に追加する。</li>
	<li>GesturePadインスタンスにMouseGestureEventをリスナー登録する</li>
</ul>
<h4>確認用テキストフィールド</h4>
<pre name="code" class="js">
var textfield:TextField = addChild(new TextField) as TextField;
textfield.textColor = 0;
textfield.autoSize = TextFieldAutoSize.LEFT;
</pre>
<p>まずは確認用のテキストフィールドを定義、表示リストに追加します。</p>
<h4>GesturePadクラスと描画ビットマップ</h4>
<pre name="code" class="js">
var gesturePad:GesturePad = addChild(new GesturePad) as GesturePad;
addChild(gesturePad.bitmap)
gesturePad.lineColor = 0;
</pre>
<p>GesturePadインスタンスを表示リストに追加します。任意でジェスチャーの軌道を記録したbitmapも表示リストに追加してください。GesturePad.bitmapは、自動的にジェスチャーを描画します。</p>
<h4>MouseGestureEvent</h4>
<pre name="code" class="js">
//全てのジェスチャーを受信したい場合
gesturePad.addEventListener(MouseGestureEvent.GESTURE, function(e:MouseGestureEvent) {
	textfield.text = e.gesture
	gesturePad.init();//描画を初期化
});
</pre>
<p>MouseGestureEventは、GesturePad上でMouseEvent.Downでジェスチャーの記録が開始され、MouseEvent.Upされた瞬間に送出されます。ジェスチャーの記録は、MouseGestureEvent.gestureにStringで格納されます。</p>
<p>ビットマップを表示リストに追加している場合、任意にinitで初期化することで、ビットマップの描画をクリアします。</p>
<h4>特定のジェスチャーのみ受信</h4>
<pre name="code" class="js">
gesturePad.addEventListener(MouseGestureEvent.LEFT+MouseGestureEvent.RIGHT, function(e:MouseGestureEvent) {
	trace("左右")
});
</pre>
<p>MouseGestureEventクラスに定義されている定数LEFT,RIGHT,UP,DOWNを組み合わせることで、特定のマウスジェスチャーのみ取得できます。</p>
<h4>サンプルソース</h4>
<pre name="code" class="js">
//確認用のテキストフィールド
var textfield:TextField = addChild(new TextField) as TextField;
textfield.textColor = 0;
textfield.autoSize = TextFieldAutoSize.LEFT;

//ジェスチャーパッドを表示リストに追加します。
var gesturePad:GesturePad = addChild(new GesturePad) as GesturePad;
//ジェスチャーを描画するビットマップを表示リストに追加します。ジェスチャーの挙動を確認したいとき用。強制ではありません。
addChild(gesturePad.bitmap)
gesturePad.lineColor = 0;

//全てのジェスチャーを受信したい場合
gesturePad.addEventListener(MouseGestureEvent.GESTURE, function(e:MouseGestureEvent) {
	textfield.text = e.gesture
	gesturePad.init();//描画を初期化
});

//特定のジェスチャーのみを受信したい場合		
gesturePad.addEventListener(MouseGestureEvent.LEFT+MouseGestureEvent.RIGHT, function(e:MouseGestureEvent) {
	trace("左右")
});
</pre>]]>
    </content>
</entry>

</feed>
