<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>QuicSRAM / ktu.jp &#187; as3</title>
	<atom:link href="http://www.ktu.jp/category/web-site/as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ktu.jp</link>
	<description>ktu.jp</description>
	<lastBuildDate>Tue, 18 Jan 2011 01:39:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>あるかないか判断して削除</title>
		<link>http://www.ktu.jp/2010/05/removechild/</link>
		<comments>http://www.ktu.jp/2010/05/removechild/#comments</comments>
		<pubDate>Wed, 12 May 2010 12:28:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.ktu.jp/?p=233</guid>
		<description><![CDATA[なんかよく忘れるんだよね。

if (contains(mc)) removeChild(mc);

]]></description>
			<content:encoded><![CDATA[<p>なんかよく忘れるんだよね。</p>
<pre class="brush: as3; title: ;">
if (contains(mc)) removeChild(mc);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ktu.jp/2010/05/removechild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[as3] 重複する配列を削除する</title>
		<link>http://www.ktu.jp/2010/03/as3-array/</link>
		<comments>http://www.ktu.jp/2010/03/as3-array/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 07:12:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.ktu.jp/?p=227</guid>
		<description><![CDATA[
private function xGetUniqueArray(_array:Array):Array {
	var result_array:Array = new Array();
	var oValues:Ob [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: as3; title: ;">
private function xGetUniqueArray(_array:Array):Array {
	var result_array:Array = new Array();
	var oValues:Object = new Object();
	var nLength:Number = _array.length;
	for (var i:Number = 0; i&lt;nLength; ++i) {
		var myValue:Object = _array[i];
		if (!oValues[myValue]) {
			oValues[myValue] = true;
			result_array.push(myValue);
		}
	}
	return result_array;
}
</pre>
<p>どこから探してきたんだっけな。。<br />
<a href="http://www.flash-jp.com/modules/newbb/viewtopic.php?topic_id=4242&#038;forum=6&#038;post_id=22405">Flash-jpだたー。</a></p>
<p>ついでにシャッフルも。</p>
<pre class="brush: as3; title: ;">
public function shuffle(array:Array):Array{
	return array.sort(function():int{return int(Math.random()*3)-1});
}
</pre>
<p><a href="http://wonderfl.net/code/8cfa39c9e91a268791142fe605c010dc30338588">１行でArrayをシャッフルする</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ktu.jp/2010/03/as3-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>クラスを文字列で参照したい</title>
		<link>http://www.ktu.jp/2010/02/%e3%82%af%e3%83%a9%e3%82%b9%e3%82%92%e6%96%87%e5%ad%97%e5%88%97%e3%81%a7%e5%8f%82%e7%85%a7%e3%81%97%e3%81%9f%e3%81%84/</link>
		<comments>http://www.ktu.jp/2010/02/%e3%82%af%e3%83%a9%e3%82%b9%e3%82%92%e6%96%87%e5%ad%97%e5%88%97%e3%81%a7%e5%8f%82%e7%85%a7%e3%81%97%e3%81%9f%e3%81%84/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 05:01:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.ktu.jp/?p=209</guid>
		<description><![CDATA[as3以前には良く使ってた手法。as3ではこんな感じでやるみたい。

import flash.utils.getDefinitionByName;
for (var i:int = 0; i&#60;3; i++) {
 [...]]]></description>
			<content:encoded><![CDATA[<p>as3以前には良く使ってた手法。as3ではこんな感じでやるみたい。</p>
<pre class="brush: as3; title: ;">
import flash.utils.getDefinitionByName;
for (var i:int = 0; i&lt;3; i++) {
  var name_str:String = &quot;Pen&quot;+i;
  var myClass:Class = Class(getDefinitionByName(name_str));
  var myInstance:MovieClip = new myClass();
  addChild(myInstance);
  // インスタンスの座標などを設定する処理
}
</pre>
<p><a href="http://f-site.org/articles/2008/01/17051234.html" target="_blank">F-site : クラスを文字列で参照したい</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ktu.jp/2010/02/%e3%82%af%e3%83%a9%e3%82%b9%e3%82%92%e6%96%87%e5%ad%97%e5%88%97%e3%81%a7%e5%8f%82%e7%85%a7%e3%81%97%e3%81%9f%e3%81%84/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3無名関数の破棄</title>
		<link>http://www.ktu.jp/2009/11/argumentscallee/</link>
		<comments>http://www.ktu.jp/2009/11/argumentscallee/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 11:01:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.ktu.jp/?p=187</guid>
		<description><![CDATA[
addEventListener(Event.ENTER_FRAME, function(e:Event):void {trace(&#34;ほげ&#34;)});
//
removeEventListener(Event.ENTER_FRAME, arguments.callee);

]]></description>
			<content:encoded><![CDATA[<pre class="brush: as3; title: ;">
addEventListener(Event.ENTER_FRAME, function(e:Event):void {trace(&quot;ほげ&quot;)});
//
removeEventListener(Event.ENTER_FRAME, arguments.callee);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ktu.jp/2009/11/argumentscallee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IOErrorがcatchできなかった</title>
		<link>http://www.ktu.jp/2009/11/ioerrornocatch/</link>
		<comments>http://www.ktu.jp/2009/11/ioerrornocatch/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 12:54:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.ktu.jp/?p=185</guid>
		<description><![CDATA[またまた1時間くらいはまったのでメモ。

var _loader:URLLoader = new URLLoader();
try{
　_loader.load(new URLRequest(&#34;xxx&#038;quot [...]]]></description>
			<content:encoded><![CDATA[<p>またまた1時間くらいはまったのでメモ。</p>
<pre class="brush: as3; title: ;">
var _loader:URLLoader = new URLLoader();
try{
　_loader.load(new URLRequest(&quot;xxx&quot;));
}catch (e:IOError){
　hoge();
}
</pre>
<p>といけるかと思いきや、いけず。<br />
こんな感じでやるみたい。</p>
<pre class="brush: as3; title: ;">
var _loader:URLLoader = new URLLoader();
_loader.addEventListener(IOErrorEvent.IO_ERROR, function():void{ hoge(); });
_loader.load(new URLRequest(&quot;xxx&quot;));
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ktu.jp/2009/11/ioerrornocatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>リンケージで作成したオブジェクトの中のオブジェクトにアクセス</title>
		<link>http://www.ktu.jp/2009/10/lnkage/</link>
		<comments>http://www.ktu.jp/2009/10/lnkage/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 02:58:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.ktu.jp/?p=162</guid>
		<description><![CDATA[かなり長い時間はまったのでメモメモ。
MCを作成して、リンケージ名を&#8221;OyaMC&#8221;とする。
その中にインスタンス名&#8221;koMC&#8221;を配置。

var oyaMC = new O [...]]]></description>
			<content:encoded><![CDATA[<p>かなり長い時間はまったのでメモメモ。</p>
<p>MCを作成して、リンケージ名を&#8221;OyaMC&#8221;とする。<br />
その中にインスタンス名&#8221;koMC&#8221;を配置。</p>
<pre class="brush: as3; title: ;">
var oyaMC = new OyaMC();
addChild(oyaMC);
oyaMC[&quot;koMC&quot;].alpha = 0;
</pre>
<p>半日くらいはまって、結局ダイナミックにオブジェクトを作成してたけどやっと解決。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ktu.jp/2009/10/lnkage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Soundの扱い</title>
		<link>http://www.ktu.jp/2009/08/soundpublish/</link>
		<comments>http://www.ktu.jp/2009/08/soundpublish/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 08:29:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.ktu.jp/?p=132</guid>
		<description><![CDATA[as3でサウンドをいじるのはだいぶ楽になって、ライブラリに入れておけば以下のコードだけでOK。

var seObj = new btnSe();
seObj.play();

ボタンを作って音を鳴らしたら、思い通りの音 [...]]]></description>
			<content:encoded><![CDATA[<p>as3でサウンドをいじるのはだいぶ楽になって、ライブラリに入れておけば以下のコードだけでOK。</p>
<pre class="brush: as3; title: ;">
var seObj = new btnSe();
seObj.play();
</pre>
<p>ボタンを作って音を鳴らしたら、思い通りの音が鳴らん。音自体は鳴ってる。<br />
なんだーと思ったら、サウンドが圧縮されてたのが問題。パブリッシュの設定のサウンドの圧縮をなしにしたところ、無事に思い通りの音が鳴った。<br />
にしても、MP3で圧縮して、ビットレート16kでも24kでも64kでも微妙に音が違って、そんなもんでも結構違うもんなんだなーと思った。たぶんボタン音じゃなくて、普通の曲とかだったらそれほどの違いが気にならないのかもしれないけど、「ピッ」くらいだとよく分かるのかも。<br />
これで30分はかかった･･･</p>
<p>もろもろ検索してたらカヤックさんで便利そうなクラスを見つけた。<br />
<a href="http://level0.kayac.com/2009/01/post_10.php" target="_blank">サウンドまわりの扱いがめんどくさいので。</a><br />
簡単な音の扱いは簡単にできそう。そうサウンドを扱わないと毎回SoundChannelとかSoundTransform面倒を調べるのも大変だしな。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ktu.jp/2009/08/soundpublish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

