<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2japanesefull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" version="2.0">

<channel>
	<title>motion lab</title>
	
	<link>http://www.shin-go.net/motionlab</link>
	<description>3時のおやつよりactionscript</description>
	<pubDate>Wed, 28 Dec 2011 02:58:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/motionlab" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="motionlab" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>AS3で相対パスを絶対パスに変換する</title>
		<link>http://www.shin-go.net/motionlab/?p=449</link>
		<comments>http://www.shin-go.net/motionlab/?p=449#comments</comments>
		<pubDate>Wed, 07 Dec 2011 14:17:27 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[as3_studies]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=449</guid>
		<description><![CDATA[Flashのソーシャル連携で、リンクとかサムネイルのURLを投稿するときに、
内部的には相対パスで持っていたいけど、投稿するときは絶対パスで指定しなきゃいけない場合があって、他にはあんまり使い所が少なそうだけど、相対パスを絶対パスに変換する関数をつくってみた。
正規表現は苦手なので、Stringクラスの操作だけでごにょごにょやってます。
function relativeToAbsolute(baseURL:String, path:String):String {
	//pathが絶対パスの時はお帰りください
	if (path.substr(0, 4) == &#34;http&#34;) {
		return path;
	}
	var _ary:Array = baseURL.split(&#34;//&#34;);
	var ary:Array;
	var absolute:String;
	ary =_ary[1].split(&#34;/&#34;);
	if (ary.length&#62;1 &#38;&#38; ary[ary.length - 1].split(&#34;.&#34;).length&#62;1) {
		//末尾がファイル名で終わる時
		ary.pop();
	}else if (ary[ary.length - 1]==&#34;&#34;) {
		//末尾が/で終わるとき
		ary.pop();
	}
	if (path.charAt(0) == &#34;/&#34;) {
		//pathが「/」で始まる時
		absolute = _ary[0] + &#34;//&#34; + ary[0] + path;
	}else if (path.substr(0,2)==&#34;./&#34;) {
		//pathが「./」で始まる時
		absolute = _ary[0]+&#34;//&#34;+ary.join(&#34;/&#34;) + &#34;/&#34;;
	}else if (path.substr(0, 3) == &#34;../&#34;) {
		//pathが「../」で始まる時
		var i:int = 0;
		while [...]]]></description>
			<content:encoded><![CDATA[<p>Flashのソーシャル連携で、リンクとかサムネイルのURLを投稿するときに、<br />
内部的には相対パスで持っていたいけど、投稿するときは絶対パスで指定しなきゃいけない場合があって、他にはあんまり使い所が少なそうだけど、相対パスを絶対パスに変換する関数をつくってみた。<br />
正規表現は苦手なので、Stringクラスの操作だけでごにょごにょやってます。</p>
<pre class="box"><code>function relativeToAbsolute(baseURL:String, path:String):String {
	//pathが絶対パスの時はお帰りください
	if (path.substr(0, 4) == &quot;http&quot;) {
		return path;
	}
	var _ary:Array = baseURL.split(&quot;//&quot;);
	var ary:Array;
	var absolute:String;
	ary =_ary[1].split(&quot;/&quot;);
	if (ary.length&gt;1 &amp;&amp; ary[ary.length - 1].split(&quot;.&quot;).length&gt;1) {
		//末尾がファイル名で終わる時
		ary.pop();
	}else if (ary[ary.length - 1]==&quot;&quot;) {
		//末尾が/で終わるとき
		ary.pop();
	}
	if (path.charAt(0) == &quot;/&quot;) {
		//pathが「/」で始まる時
		absolute = _ary[0] + &quot;//&quot; + ary[0] + path;
	}else if (path.substr(0,2)==&quot;./&quot;) {
		//pathが「./」で始まる時
		absolute = _ary[0]+&quot;//&quot;+ary.join(&quot;/&quot;) + &quot;/&quot;;
	}else if (path.substr(0, 3) == &quot;../&quot;) {
		//pathが「../」で始まる時
		var i:int = 0;
		while (path.substr(i * 3, 3) == &quot;../&quot;) {
		ary.pop();
			i += 1;
		}
		absolute = _ary[0]+&quot;//&quot;+ary.join(&quot;/&quot;) + &quot;/&quot; + path.substr(i*3);
	}else {
		absolute = _ary[0]+&quot;//&quot;+ary.join(&quot;/&quot;) + &quot;/&quot; + path;
	}
	return absolute;
}
</code></pre>
<p>使い方はbaseURLに基準となるURLの絶対パス。<br />
pathに相対パスを指定すると、相対パスを適用した絶対パスが帰ってきます。</p>
<pre><code>relativeToAbsolute(&quot;http://www.shin-go.net/motionlab/?cat=8&quot;,&quot;hoge.html&quot;);
  // "http://www.shin-go.net/motionlab/hoge.html"

relativeToAbsolute(&quot;http://www.shin-go.net/motionlab/?cat=8&quot;,&quot;./&quot;);
  // "http://www.shin-go.net/motionlab/"

relativeToAbsolute(&quot;http://www.shin-go.net/motionlab/?cat=8&quot;,&quot;../&quot;);
  // "http://www.shin-go.net/"

relativeToAbsolute(&quot;http://www.shin-go.net/motionlab/?cat=8&quot;,&quot;../hoge.html&quot;);
  // "http://www.shin-go.net/hoge.html"

relativeToAbsolute(&quot;http://www.shin-go.net/motionlab/?cat=8&quot;,&quot;/hoge.html&quot;);
  // "http://www.shin-go.net/hoge.html"
</code></pre>
<p>といった感じで、htmlのaタグに使える相対パスならなんでもいけます。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=449</wfw:commentRss>
		</item>
		<item>
		<title>javascriptで別ウィンドウでPOST</title>
		<link>http://www.shin-go.net/motionlab/?p=441</link>
		<comments>http://www.shin-go.net/motionlab/?p=441#comments</comments>
		<pubDate>Tue, 29 Nov 2011 03:04:48 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=441</guid>
		<description><![CDATA[ボタンを押した時にPOST送信と別ウィンドウを開くとき、
POSTとwindow.openをそれぞれ別に実行するとどちらかが失敗することがあるので、
var html=&#34;&#34;;
html+='&#60;form name=&#34;my_form&#34; method=&#34;post&#34; action=&#34;window.php&#34; target=&#34;_blank&#34;&#62;';
html+='&#60;input type=&#34;hidden&#34; name=&#34;id&#34; value=&#34;123456&#34;&#62; ';
html+='&#60;input type=&#34;submit&#34; value=&#34;ウィンドウを開く&#34; /&#62;';
html+='&#60;/form&#62;';
$(&#34;div&#34;).append(html);

こんな感じで動的にformをつくってtarget=&#8221;_blank&#8221;を指定。
]]></description>
			<content:encoded><![CDATA[<p>ボタンを押した時にPOST送信と別ウィンドウを開くとき、<br />
POSTとwindow.openをそれぞれ別に実行するとどちらかが失敗することがあるので、</p>
<pre><code>var html=&quot;&quot;;
html+='&lt;form name=&quot;my_form&quot; method=&quot;post&quot; action=&quot;window.php&quot; target=&quot;_blank&quot;&gt;';
html+='&lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;123456&quot;&gt; ';
html+='&lt;input type=&quot;submit&quot; value=&quot;ウィンドウを開く&quot; /&gt;';
html+='&lt;/form&gt;';
$(&quot;div&quot;).append(html);
</code></pre>
<p>こんな感じで動的にformをつくってtarget=&#8221;_blank&#8221;を指定。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=441</wfw:commentRss>
		</item>
		<item>
		<title>links for 2011-09-01</title>
		<link>http://www.shin-go.net/motionlab/?p=431</link>
		<comments>http://www.shin-go.net/motionlab/?p=431#comments</comments>
		<pubDate>Thu, 01 Sep 2011 12:03:05 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[bookmark]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=431</guid>
		<description><![CDATA[

ギルティクラウン [ GUILTY CROWN ]
(tags: deltro anime)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.guilty-crown.jp/">ギルティクラウン [ GUILTY CROWN ]</a></div>
<div class="delicious-tags">(tags: <a href="http://www.delicious.com/shingo2000/deltro">deltro</a> <a href="http://www.delicious.com/shingo2000/anime">anime</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=431</wfw:commentRss>
		</item>
		<item>
		<title>links for 2011-08-18</title>
		<link>http://www.shin-go.net/motionlab/?p=430</link>
		<comments>http://www.shin-go.net/motionlab/?p=430#comments</comments>
		<pubDate>Thu, 18 Aug 2011 12:01:49 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[bookmark]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=430</guid>
		<description><![CDATA[

한국형 격투액션!! - 제4구역
(tags: game korea)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://zone4.nexon.com/main/index.aspx">한국형 격투액션!! - 제4구역</a></div>
<div class="delicious-tags">(tags: <a href="http://www.delicious.com/shingo2000/game">game</a> <a href="http://www.delicious.com/shingo2000/korea">korea</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=430</wfw:commentRss>
		</item>
		<item>
		<title>iframeのテスト</title>
		<link>http://www.shin-go.net/motionlab/?p=427</link>
		<comments>http://www.shin-go.net/motionlab/?p=427#comments</comments>
		<pubDate>Thu, 04 Aug 2011 11:13:44 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[others]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=427</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><iframe src="/motionlab/wp-content/uploads/2011/08/index.html"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=427</wfw:commentRss>
		</item>
		<item>
		<title>links for 2011-06-20</title>
		<link>http://www.shin-go.net/motionlab/?p=425</link>
		<comments>http://www.shin-go.net/motionlab/?p=425#comments</comments>
		<pubDate>Mon, 20 Jun 2011 12:02:59 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[bookmark]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=425</guid>
		<description><![CDATA[

funaction &#124; ファナクション
写真の切り替わり
(tags: products FORM::PROCESS)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.funaction.jp/">funaction | ファナクション</a></div>
<div class="delicious-extended">写真の切り替わり</div>
<div class="delicious-tags">(tags: <a href="http://www.delicious.com/shingo2000/products">products</a> <a href="http://www.delicious.com/shingo2000/FORM%3A%3APROCESS">FORM::PROCESS</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=425</wfw:commentRss>
		</item>
		<item>
		<title>傾いた矩形の内側か外側かの判定</title>
		<link>http://www.shin-go.net/motionlab/?p=422</link>
		<comments>http://www.shin-go.net/motionlab/?p=422#comments</comments>
		<pubDate>Thu, 09 Jun 2011 05:52:05 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[as3_studies]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=422</guid>
		<description><![CDATA[javascript でゲームを作るに当たって、汎用ライブラリをつくってるんだけど、
こういうちょっとした処理の検証はwonderflつかうと便利だなと実感。

傾いた矩形の内側か外側かの判定 - wonderfl build flash online
]]></description>
			<content:encoded><![CDATA[<p>javascript でゲームを作るに当たって、汎用ライブラリをつくってるんだけど、<br />
こういうちょっとした処理の検証はwonderflつかうと便利だなと実感。<br />
<script type="text/javascript" src="http://wonderfl.net/blogparts/uS0C/js"></script>
<p class="ttlBpWonderfl" style="width: 465px; margin: 0; text-align: right; font-size: 11px;"><a href="http://wonderfl.net/c/uS0C" title="傾いた矩形の内側か外側かの判定">傾いた矩形の内側か外側かの判定 - wonderfl build flash online</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=422</wfw:commentRss>
		</item>
		<item>
		<title>links for 2011-06-07</title>
		<link>http://www.shin-go.net/motionlab/?p=421</link>
		<comments>http://www.shin-go.net/motionlab/?p=421#comments</comments>
		<pubDate>Tue, 07 Jun 2011 12:03:06 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[bookmark]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=421</guid>
		<description><![CDATA[

[ SPACE SHOWER SWEET LOVE SHOWER 2011 ] SPACE SHOWER TV
かわいい。色使いとアニメーションとレイアウト
(tags: animation smokecolor layout)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.sweetloveshower.com/index.html">[ SPACE SHOWER SWEET LOVE SHOWER 2011 ] SPACE SHOWER TV</a></div>
<div class="delicious-extended">かわいい。色使いとアニメーションとレイアウト</div>
<div class="delicious-tags">(tags: <a href="http://www.delicious.com/shingo2000/animation">animation</a> <a href="http://www.delicious.com/shingo2000/smokecolor">smokecolor</a> <a href="http://www.delicious.com/shingo2000/layout">layout</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=421</wfw:commentRss>
		</item>
		<item>
		<title>links for 2011-06-06</title>
		<link>http://www.shin-go.net/motionlab/?p=420</link>
		<comments>http://www.shin-go.net/motionlab/?p=420#comments</comments>
		<pubDate>Mon, 06 Jun 2011 12:01:41 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[bookmark]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=420</guid>
		<description><![CDATA[

京急蒲田処女小説文藝大賞 &#124; cooked.jp
ヘンテコアニメーション
(tags: animation)


Play You. &#124; ポータブルオーディオプレーヤー WALKMAN “ウォークマン” &#124; ソニー
CDを積み重ねてグラフを表現。動きのバリエーション。
(tags: visualization 3d)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://www.cooked.jp/event/bunfree12/">京急蒲田処女小説文藝大賞 | cooked.jp</a></div>
<div class="delicious-extended">ヘンテコアニメーション</div>
<div class="delicious-tags">(tags: <a href="http://www.delicious.com/shingo2000/animation">animation</a>)</div>
</li>
<li>
<div class="delicious-link"><a href="http://www.sony.jp/walkman/playyou/w-records/">Play You. | ポータブルオーディオプレーヤー WALKMAN “ウォークマン” | ソニー</a></div>
<div class="delicious-extended">CDを積み重ねてグラフを表現。動きのバリエーション。</div>
<div class="delicious-tags">(tags: <a href="http://www.delicious.com/shingo2000/visualization">visualization</a> <a href="http://www.delicious.com/shingo2000/3d">3d</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=420</wfw:commentRss>
		</item>
		<item>
		<title>links for 2011-05-28</title>
		<link>http://www.shin-go.net/motionlab/?p=419</link>
		<comments>http://www.shin-go.net/motionlab/?p=419#comments</comments>
		<pubDate>Sat, 28 May 2011 12:01:48 +0000</pubDate>
		<dc:creator>shin-go</dc:creator>
		
		<category><![CDATA[bookmark]]></category>

		<guid isPermaLink="false">http://www.shin-go.net/motionlab/?p=419</guid>
		<description><![CDATA[

twitarium &#124; TOP
なんだか、Twitterの何かをビジュアライズしてるぽい
(tags: visualization)


]]></description>
			<content:encoded><![CDATA[<ul class="delicious">
<li>
<div class="delicious-link"><a href="http://twitarium.com/">twitarium | TOP</a></div>
<div class="delicious-extended">なんだか、Twitterの何かをビジュアライズしてるぽい</div>
<div class="delicious-tags">(tags: <a href="http://www.delicious.com/shingo2000/visualization">visualization</a>)</div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shin-go.net/motionlab/?feed=rss2&amp;p=419</wfw:commentRss>
		</item>
	</channel>
</rss>

