<?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>JActionScripters</title>
	<atom:link href="http://blog.jactionscripters.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jactionscripters.com</link>
	<description>More than 20 Japanese flash coders share the blog/ You will be junkie for this crazy Japanese Flash news</description>
	<lastBuildDate>Mon, 01 Feb 2010 00:02:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Calculation in the Utils3D.projectVectors() method</title>
		<link>http://blog.jactionscripters.com/2010/02/01/calculation-in-the-utils3d-projectvectors-method/</link>
		<comments>http://blog.jactionscripters.com/2010/02/01/calculation-in-the-utils3d-projectvectors-method/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 23:11:06 +0000</pubDate>
		<dc:creator>Fumio Nonaka</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=1073</guid>
		<description><![CDATA[The Utils3D.projectVectors() method projects a Vector of three-dimensional space coordinates to a Vector of two-dimensional space coordinates.  And the method also sets the t value of the uvt data.
The Utils3D.projectVectors() method calculates t value of the uvt data by the following formula:
t value = 1 / (Distance to the origin + z coordinate value)
Also, [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/Utils3D.html#projectVectors()" target="_blank"><em>Utils3D.projectVectors()</em> method</a> projects a Vector of three-dimensional space coordinates to a Vector of two-dimensional space coordinates.  And the method also sets the t value of the uvt data.</p>
<div id="attachment_1078" class="wp-caption alignnone" style="width: 325px"><img src="http://blog.jactionscripters.com/wp-content/uploads/2010/02/Utils3D_projectVectors1.gif" alt="Calculation in the Utils3D.projectVectors() method" title="Utils3D.projectVectors() method" width="315" height="180" class="size-full wp-image-1078" /><p class="wp-caption-text">Values for the calculation in the Utils3D.projectVectors() method</p></div>
<p>The <em>Utils3D.projectVectors() </em>method calculates t value of the uvt data by the following formula:</p>
<blockquote><p>t value = 1 / (Distance to the origin + z coordinate value)</p></blockquote>
<p>Also, the method calculates projected x and y values by the following formula:</p>
<blockquote><p>Projected x or y value = Three-dimensional space x or y coordinate * Focal length * t value</p></blockquote>
<p>The frame action below compares the results of calculation by the formulas above with the methods&#8217;.  And [Output] is as follows:</p>
<blockquote><p>0,0,0.0004  // uvt data<br />
0.0004  // Calculated t value<br />
20,20  // Projected x and y coordinates<br />
20  // Calculated two-dimensional space x or y coordinate  </p></blockquote>
<p><code-style></p>
<pre name="code" class="as3">
var myPerspective:PerspectiveProjection = new PerspectiveProjection();
var myMatrix3D:Matrix3D = new Matrix3D();
var nDistance:Number = 1000;  // Distance to the origin
var nX:Number = 100;  // Three-dimensional space x or y coordinate
var nZ:Number = 1500;  // Three-dimensional z coordinate
var vertices3D:Vector.&lt;Number&gt; = Vector.&lt;Number&gt;([nX, nX, nZ]);
var vertices2D:Vector.&lt;Number&gt; = new Vector.&lt;Number&gt;();
var uvtData:Vector.&lt;Number&gt; = Vector.&lt;Number&gt;([0, 0, 0]);
var nT:Number = 1/(nDistance + nZ);  // t value
myPerspective.focalLength = 500;  // Focal length 
myMatrix3D.appendTranslation(0, 0, nDistance);
myMatrix3D.append(myPerspective.toMatrix3D());
Utils3D.projectVectors(myMatrix3D, vertices3D, vertices2D, uvtData);
trace(uvtData);  // uvt data
trace(nT);  // Calculated t value
trace(vertices2D);  // Projected x and y coordinates
trace(nX * myPerspective.focalLength * nT);  // Calculated two-dimensional space x or y coordinate
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2010/02/01/calculation-in-the-utils3d-projectvectors-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Metronome app built with Flash CS5</title>
		<link>http://blog.jactionscripters.com/2010/01/25/iphone-metronome-app-built-with-flash-cs5/</link>
		<comments>http://blog.jactionscripters.com/2010/01/25/iphone-metronome-app-built-with-flash-cs5/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 07:35:18 +0000</pubDate>
		<dc:creator>Takayuki Fukatsu</dc:creator>
				<category><![CDATA[Showcase]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=1054</guid>
		<description><![CDATA[
I released Simple Metronome app that runs with Package for iPhone technology, CS5&#8217;s new feature. I just got permission to talk about the app.
Seems this is the first Flash made iPhone app from Japan.
This app is originally made for technical research, to understand animation speed and interactivity of flash for iPhone. The reason why I [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jactionscripters.com/wp-content/uploads/2010/01/simplemetronome_js.png" alt="simplemetronome_js" title="simplemetronome_js" width="640" height="380" class="alignnone size-full wp-image-1064" /></p>
<p>I released <a href="http://artandmobile.com/metronome/">Simple Metronome app</a> that runs with <a href="http://labs.adobe.com/technologies/flashcs5/appsfor_iphone/">Package for iPhone technology</a>, CS5&#8217;s new feature. I just got permission to talk about the app.</p>
<p>Seems this is the first Flash made iPhone app from Japan.<br/><br/></p>
<p>This app is originally made for technical research, to understand animation speed and interactivity of flash for iPhone. The reason why I made metronome is simply it needs accurate and smooth frame rate. Version 1.00 is minimum implementation, it will be updated step by step.</p>
<p>Some people said that flash is too slow for iPhone, however as far as I see this app, Flash is enough fast for actual project. It may be not for  3d game, but for utility app. Flash CS5 is still under development and I believe it will be much much faster when it is actually shipped.</p>
<p>The biggest advantage of Flash made iPhone app is that you can easily build both iPhone app and online demo. In iPhone app market, many people looking for the way to promote their application, however <strong>only flash developer can promote their app with working demo on the web site!!</strong>. It&#8217;s quite strong feature, isn&#8217;t it?  </p>
<p>This is sample project and I will make the source code open. It will be available when Flash CS5 is released. <img src='http://blog.jactionscripters.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2010/01/25/iphone-metronome-app-built-with-flash-cs5/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rotating an instance with the y axis</title>
		<link>http://blog.jactionscripters.com/2009/12/05/rotating-an-instance-with-the-y-axis/</link>
		<comments>http://blog.jactionscripters.com/2009/12/05/rotating-an-instance-with-the-y-axis/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 13:33:10 +0000</pubDate>
		<dc:creator>Fumio Nonaka</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=1017</guid>
		<description><![CDATA[Try to rotate a MovieClip instance named my_mc 80 degrees with the y axis.  The trace() function in the code below displays information in the [Output] panel as follows: 
80.00003182368921 1.3962639570236206


var nRotationY:Number = 80;
my_mc.rotationY = 0;
var myMatrix3D:Matrix3D = my_mc.transform.matrix3D;
myMatrix3D.prependRotation(nRotationY, Vector3D.Y_AXIS);
trace(my_mc.rotationY, myMatrix3D.decompose()[1].y);



Then change the number of degrees in the variable, nRotationY, to 100. The code [...]]]></description>
			<content:encoded><![CDATA[<p>Try to rotate a MovieClip instance named my_mc 80 degrees with the y axis.  The trace() function in the code below displays information in the [Output] panel as follows: </p>
<blockquote><p>80.00003182368921 1.3962639570236206</p></blockquote>
<p><code-style></p>
<pre name="code" class="as3">
var nRotationY:Number = 80;
my_mc.rotationY = 0;
var myMatrix3D:Matrix3D = my_mc.transform.matrix3D;
myMatrix3D.prependRotation(nRotationY, Vector3D.Y_AXIS);
trace(my_mc.rotationY, myMatrix3D.decompose()[1].y);
</pre>
<p></code></p>
<p><img src="http://blog.jactionscripters.com/wp-content/uploads/2009/12/rotationTest_80.gif" alt="Rotating an instance 80 degrees" title="Rotating an instance 80 degrees" width="270" height="235" class="alignnone size-full wp-image-1023" /></p>
<p>Then change the number of degrees in the variable, nRotationY, to 100. The code seems to rotate an instance 100 degrees. However, the number of degrees shown in the [Output] panel is still 80.</p>
<blockquote><p>80.00003182368921 1.3962639570236206</p></blockquote>
<p><code-style></p>
<pre name="code" class="as3">
var nRotationY:Number = 100;  // 80;
my_mc.rotationY = 0;
var myMatrix3D:Matrix3D = my_mc.transform.matrix3D;
myMatrix3D.prependRotation(nRotationY, Vector3D.Y_AXIS);
trace(my_mc.rotationY, myMatrix3D.decompose()[1].y);
</pre>
<p></code></p>
<p><img src="http://blog.jactionscripters.com/wp-content/uploads/2009/12/rotationTest_100.gif" alt="Rotating an instance 100 degrees" title="Rotating an instance 100 degrees" width="270" height="235" class="alignnone size-full wp-image-1035" /></p>
<p>The following code reveals the reason.</p>
<blockquote><p>0 80.00003182368921 0<br />
Vector3D(0, 1.3962639570236206, 0)<br />
180.00000500895632 80.00003182368921 180.00000500895632<br />
Vector3D(3.1415927410125732, 1.3962639570236206, 3.1415927410125732)</p></blockquote>
<p><code-style></p>
<pre name="code" class="as3">
var mySprite:Sprite = new Sprite();
var axis:Vector3D = Vector3D.Y_AXIS;  // Vector3D.X_AXIS  // Try to change this
mySprite.rotationY = 0;
var myMatrix3D:Matrix3D = mySprite.transform.matrix3D;
myMatrix3D.prependRotation(80, axis);
xTrace(mySprite);
myMatrix3D.prependRotation(20, axis);
xTrace(mySprite);
function xTrace(targetSprite:Sprite):void {
	trace(targetSprite.rotationX, targetSprite.rotationY, targetSprite.rotationZ);
	trace(targetSprite.transform.matrix3D.decompose()[1]);
}
</pre>
<p></code></p>
<p>When the <em>Matrix3D.prependRotation()</em> method rotates an instance 100 degrees with y axis, it is only rotated 80 degrees but is flipped with x and z axes.</p>
<p>The appearance of the instance is all right. But the number of degrees is not good. Besides, 100 degrees can be set with x or z axis. It means that the result of y axis is not consistent. Therefore, I suspect that this is a bug.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/12/05/rotating-an-instance-with-the-y-axis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Three types of transformation objects in the Transform class</title>
		<link>http://blog.jactionscripters.com/2009/10/14/three-types-of-transformation-objects-in-the-transform-class/</link>
		<comments>http://blog.jactionscripters.com/2009/10/14/three-types-of-transformation-objects-in-the-transform-class/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 09:25:07 +0000</pubDate>
		<dc:creator>Fumio Nonaka</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=985</guid>
		<description><![CDATA[The Transform class has several kinds of transformation objects as its properties.
The Transform class provides access to color adjustment properties and two- or three-dimensional transformation objects that can be applied to a display object.
I noticed three types of properties from the point of view of getting and seting their values.
The first example is the Transform.matrix [...]]]></description>
			<content:encoded><![CDATA[<p>The Transform class has several kinds of transformation objects as its properties.</p>
<blockquote><p>The Transform class provides access to color adjustment properties and two- or three-dimensional transformation objects that can be applied to a display object.</p></blockquote>
<p>I noticed three types of properties from the point of view of getting and seting their values.</p>
<p>The first example is the <em>Transform.matrix</em> property.  It does not provide its Matrix object reference but its copy.  It means that operations to the copy will not affect to the property&#8217;s Matrix object.  To set a Matrix object to the <em>Transform.matrix</em> property, the object should be assigned to the property.</p>
<p><code-style></p>
<pre name="code" class="as3">var mySprite:Sprite = new Sprite();
var myMatrix:Matrix = new Matrix();
mySprite.transform.matrix = myMatrix;
myMatrix.translate(100, 50);
trace(mySprite.transform.matrix);
// Output: (a=1, b=0, c=0, d=1, tx=0, ty=0)
mySprite.transform.matrix = myMatrix;
trace(mySprite.transform.matrix);
// Output: (a=1, b=0, c=0, d=1, tx=100, ty=50)
myMatrix = mySprite.transform.matrix;
myMatrix.scale(2, 1.5);
trace(mySprite.transform.matrix);
// Output: (a=1, b=0, c=0, d=1, tx=100, ty=50)
trace(mySprite.transform.matrix == myMatrix);  // Output: false</pre>
<p></code></p>
<p>The second example is the <em>Transform.matrix3D</em> property.  Unlike to the <em>Transform.matrix</em> property, a Matrix3D object&#8217;s reference is obtained from the property.    Therefore, once its reference is gotten, operations to the reference affects to the <em>Transform.matrix3D</em> property.</p>
<p><code-style></p>
<pre name="code" class="as3">var mySprite:Sprite = new Sprite();
var myMatrix3D:Matrix3D = new Matrix3D();
mySprite.transform.matrix3D = myMatrix3D;
myMatrix3D.prependTranslation(100, 50, 0);
trace(mySprite.transform.matrix3D.position);
// Output: Vector3D(100, 50, 0)
trace(mySprite.transform.matrix3D == myMatrix3D);  // Output: true</pre>
<p></code></p>
<p>The third one is the <em>Transform.perspectiveProjection</em> property. When a new PerspectiveProjection instance is assigned to the property, operations to the instance do not affect to the property as well as the <em>Transform.matrix</em> property. Then, try to get the object from the property and set it to a variable again. You can operate the variable as if it was the object reference of the property. However the variable&#8217;s object is not evaluated to be equal to the property&#8217;s value. It is a mysterious property, isn&#8217;t it.</p>
<p><code-style></p>
<pre name="code" class="as3">var mySprite:Sprite = new Sprite();
var myPerspective:PerspectiveProjection = new PerspectiveProjection();
mySprite.transform.perspectiveProjection = myPerspective;
myPerspective.fieldOfView = 20;
trace(mySprite.transform.perspectiveProjection.fieldOfView);  // Output: 55
myPerspective = mySprite.transform.perspectiveProjection;
myPerspective.fieldOfView = 100;
trace(mySprite.transform.perspectiveProjection.fieldOfView);  // Output: 100
trace(mySprite.transform.perspectiveProjection == myPerspective);
// Output: false</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/10/14/three-types-of-transformation-objects-in-the-transform-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionScript3/Flash10 software synthesizer SiON released</title>
		<link>http://blog.jactionscripters.com/2009/10/02/sion-released/</link>
		<comments>http://blog.jactionscripters.com/2009/10/02/sion-released/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 16:08:22 +0000</pubDate>
		<dc:creator>keim</dc:creator>
				<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=939</guid>
		<description><![CDATA[
Hello all, I&#8217;m kei mesuda aka keim japanese free-game home brewer.
I just release completely new software synthesizer named &#8220;SiON&#8221; (pronounced as &#8220;scion&#8221;), so let me introduce my work.
The SiON library works on ActionScript3/Flash10. This provides a simple sound synchronization with DisplayObject and an easy dynamic sound generation. You can generate various sounds without any mp3 [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-947" href="http://blog.jactionscripters.com/2009/10/02/sion-released/img0004/"><img class="alignnone size-full wp-image-947" title="SiON title" src="http://blog.jactionscripters.com/wp-content/uploads/2009/10/img0004.png" alt="SiON title" width="640" height="360" /></a></p>
<p>Hello all, I&#8217;m kei mesuda aka keim japanese free-game home brewer.</p>
<p>I just release completely new software synthesizer named &#8220;SiON&#8221; (pronounced as &#8220;scion&#8221;), so let me introduce my work.</p>
<p>The SiON library works on ActionScript3/Flash10. This provides a simple sound synchronization with DisplayObject and an easy dynamic sound generation. You can generate various sounds without any mp3 files and wave data. The musical sequence is represented as simple text data &#8220;Music Macro Language&#8221;. It makes your sounding SWF file very very small.</p>
<p>This library&#8217;s development center is <a href="http://www.libspark.org/wiki/keim/SiON_e" target="_blank">here</a> in <a href="http://www.libspark.org/wiki/WikiStart/en" target="_blank">spark project</a>. You can get newest version&#8217;s <a href="http://www.libspark.org/svn/as3/SiOPM/trunk/archive/sion057.swc" target="_self">swc file</a>, <a href="http://www.libspark.org/svn/as3/SiOPM/trunk/archive/sion057_asdoc.zip">asdoc</a> and <a href="http://www.libspark.org/svn/as3/SiOPM/trunk/src/">svn link</a>.</p>
<p><strong><br />
</strong></p>
<p><strong>- Demonstrations </strong></p>
<p>You can use SiON in <a href="http://wonderfl.net/">Wonderfl</a> and I posted some demonstrations.</p>
<ul>
<li><a href="http://wonderfl.net/code/b7ec8cd3801e3784dbbb4f5d2e68b15e9e384832">SiON Tenorion</a></li>
<li><a href="http://wonderfl.net/code/646e3b9efade64bd02a2a6797d74d17725e1b6bb">SiON KaosPad</a></li>
<li><a href="http://wonderfl.net/code/80621cb517f2691e07f1147272386ff83ecf2ebe">SiON Kaoscillator</a></li>
<li><a href="http://wonderfl.net/code/82e45099bf2f4d24451e00eb58e67835d927d405">Super Mario Synthesizer</a></li>
<li><a href="http://wonderfl.net/code/6a738c4f99a6c786421c38b4cce01e73c1c9bb89">SiON FM synthesizer WF-1</a></li>
</ul>
<p>Other works using SiON are shown in <a href="http://wonderfl.net/tag/sion">tag [SiON] in Wonderfl</a>. I plan to post some other works with SiON at wonderfl, please check <a href="http://wonderfl.net/user/keim_at_Si">my page</a> if you want more.</p>
<ul>
<li><a href="http://mmltalks.appspot.com/">MMLTalks</a></li>
</ul>
<p>And this is another demonstration for SiON. The <a href="http//mmltalks.appspot.com/">MMLTalks</a> is an MML hosting service powered by SiON. Here, you can listen many musics generated only by SiON software synthsizer without any mp3 files and wave data.</p>
<p><strong><br />
</strong></p>
<p><strong>- Synthesizer specifications</strong></p>
<p>The SiON software synthesizer is an extention of the sound chip YM2151s emulator. Currently, SiON includes 4 types of sound modules.</p>
<ol></ol>
<ul>
<li>Extended Emulators of various Frequency Modulation synthesizing sound chips; The emulation code is based on the time-proven emulators, MAME, fmgen and x68sound.dll. And the outputs of various sound chips (OPM,OPNA,OPL3,OPX,MA3) are reproducible by giving same parameters of actual equipments.</li>
</ul>
<ol></ol>
<ul>
<li>Simulator of PSG and wave memory sound chips; The SiONs Extended FM synth can simulate various PSG chips (AY-3-8910, DCSG, 2A03, SSG) and wave memory sound chips(SCC, C15, GameBoy).</li>
</ul>
<ol></ol>
<ul>
<li>Physical Modeling Guitar synthesizer; SiON also includes Guitar Physical modeling synthesizer based on Karplus strong algorism.</li>
</ul>
<ol></ol>
<ul>
<li>PCM sound module; The SiON handles MP3 sound (Sound Class) as a PCM sound modules source wave. This means you can control the pitch of MP3 file by musical sequence.</li>
</ul>
<ol></ol>
<p>The SiON can modify the output from these sound modules by low-pass filter with ADSR envelop, ring modulation, pitch/amplitude modulation.</p>
<p><strong> </strong></p>
<p><strong><br />
</strong></p>
<p><strong>- Sequencer specifications</strong></p>
<p>The SiON uses <a href="http://en.wikipedia.org/wiki/Music_Macro_Language">Music Macro Language (MML)</a> as a musical score data. The MML is a simple powerful language to represent musical sequence. For example, &#8220;[ccggaag2 ffeeddc2 | [ggffeed2]]&#8221; represents &#8220;the ABC song&#8221; in MML. The reference manual is <a href="http://mmltalks.appspot.com/document/siopm_mml_ref_05.html">here</a>, mml editor <a href="http://mmltalks.appspot.com/labo/mmleditor.html">here</a>, and you can refer MMLs of various great musics <a href="http://mmltalks.appspot.com/">here</a> in MMLTalks (and click rightmost button in song title).</p>
<p><strong> </strong></p>
<p><strong><br />
</strong></p>
<p><strong>- Effector specifications</strong></p>
<p>SiON includes many sound effectors like reverb, chorus, delay, wave shaper, various filters, speaker simulator and so on. These effectors can be control from MML. Please see the discriptions in the <a href="http://mmltalks.appspot.com/document/siopm_mml_ref_05.html">MML reference manual</a>.</p>
<p>Now detail discription is under construction, please check <a href="http://keim-at-si.blogspot.com/">my blog</a> or <a href="http://www.libspark.org/wiki/keim/SiON_e" target="_blank">development center</a>. And if you have any questions or comments, please leave comment on this post or contact me by e-mail (but sorry for my poor English..).</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 817px; width: 1px; height: 1px;">Sequencer specification.<br />
SiON uses Music Macro Language (MML) as a musical score data. The MML is a simple powerful language to represent musical sequence. For example, &#8220;[ccggaag2 ffeeddc2 | [ggffeed2]]&#8221; represents &#8220;the ABC song&#8221; in MML. Reference manual &lt;a href=&#8221;http://mmltalks.appspot.com/document/siopm_mml_ref_05.html&#8221;&gt;here&lt;/a&gt; and you can try to play mml &lt;a href=&#8221;http://mmltalks.appspot.com/labo/mmleditor.html&#8221;&gt;here&lt;/a&gt;.<br />
This site &lt;a href=&#8221;http://mmltalks.appspot.com/&#8221;&gt;MMLTalks&lt;/a&gt; is the MML hosting service powered by SiON, you can refer many MMLs to represent grate musics.</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/10/02/sion-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Genie effect with as3</title>
		<link>http://blog.jactionscripters.com/2009/09/09/genie-effect-with-as3/</link>
		<comments>http://blog.jactionscripters.com/2009/09/09/genie-effect-with-as3/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 08:01:14 +0000</pubDate>
		<dc:creator>Takayuki Fukatsu</dc:creator>
				<category><![CDATA[Experiment]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=934</guid>
		<description><![CDATA[Here is a Mac OSX like Genie effect made with AS3.
It&#8217;s basically made with Flash 10&#8217;s drawTriangles API &#038; Yoshihiro Shindo&#8217;s betweenAS3 tween library.
It&#8217;s just a initial sketch, but seems there is plenty of possibilities around the new bitmap drawing API.
]]></description>
			<content:encoded><![CDATA[<p>Here is a Mac OSX like <a href="http://fladdict.net/exp/ginnyeffect/">Genie effect made with AS3</a>.</p>
<p>It&#8217;s basically made with Flash 10&#8217;s drawTriangles API &#038; <a href="http://blog.jactionscripters.com/author/beinteractive/">Yoshihiro Shindo</a>&#8217;s <a href="http://www.libspark.org/svn/as3/BetweenAS3/tags/alpha-r3022/">betweenAS3 </a>tween library.</p>
<p>It&#8217;s just a initial sketch, but seems there is plenty of possibilities around the new bitmap drawing API.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/09/09/genie-effect-with-as3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>&#8220;Private&#8221; classes might cause a compile error</title>
		<link>http://blog.jactionscripters.com/2009/09/08/private-classes-might-cause-a-compile-error/</link>
		<comments>http://blog.jactionscripters.com/2009/09/08/private-classes-might-cause-a-compile-error/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 02:09:19 +0000</pubDate>
		<dc:creator>Fumio Nonaka</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=910</guid>
		<description><![CDATA[BeInteractive! (blog written by Yoshihiro Shindo) reported a bug of &#8220;private&#8221; classes (defined outside of the package block).  Two or more &#8220;private&#8221; classes might cause a compile error, which tells  that a local variable declared in a main class (inside the package) is undefined in Flash CS4 Professional.
1120: Access of undefined property s.
I [...]]]></description>
			<content:encoded><![CDATA[<p>BeInteractive! (blog written by <a href="http://blog.jactionscripters.com/author/beinteractive/" target="_blank">Yoshihiro Shindo</a>) reported <a href="http://www.be-interactive.org/index.php?itemid=434" target="_blank">a bug of &#8220;private&#8221; classes</a> (defined outside of the package block).  Two or more &#8220;private&#8221; classes might cause a <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/compilerErrors.html" target="_blank">compile error</a>, which tells  that a local variable declared in a main class (inside the package) is undefined in Flash CS4 Professional.</p>
<blockquote><p>1120: Access of undefined property s.</p></blockquote>
<div class="wp-caption alignnone" style="width: 515px"><img alt="Compile error #1120" src="http://www.fumiononaka.com/Drafts/wonderfl/wonderfl_images/02_01_OOP_and_Class_002.gif" title="Compile error #1120" width="505" height="395" /><p class="wp-caption-text">Compile error #1120</p></div>
<p>I found another condition of the error.  If a &#8220;private&#8221; class inherits a class other than Object the compile error will be prevented.</p>
<p><code-style></p>
<pre name="code" class="as3">package {
	import flash.display.Sprite;
	public class PrivateClassIssue extends Sprite {
		public function PrivateClassIssue() {
			var s:String = 'hello';
			trace(s);
		}
	}
}
class Foo {}
class Bar extends Array {}  // inherits Array class</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/09/08/private-classes-might-cause-a-compile-error/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Calculation of focalLength</title>
		<link>http://blog.jactionscripters.com/2009/09/06/calculation-of-focallength/</link>
		<comments>http://blog.jactionscripters.com/2009/09/06/calculation-of-focallength/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 13:44:41 +0000</pubDate>
		<dc:creator>Fumio Nonaka</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=861</guid>
		<description><![CDATA[[Help] of PerspectiveProjection.focalLength property says:
During the perspective transformation, the focalLength is calculated dynamically using the angle of the field of view and the stage&#8217;s aspect ratio (stage width divided by stage height).
However as far as I tested it, the stage height does not affect the result of focalLength property&#8217;s value.  It is calculated from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/PerspectiveProjection.html#focalLength" target="_blank">[Help] of <em>PerspectiveProjection.focalLength</em> property</a> says:</p>
<blockquote><p>During the perspective transformation, the focalLength is calculated dynamically using the angle of the field of view and the stage&#8217;s aspect ratio (stage width divided by stage height).</p></blockquote>
<p>However as far as I tested it, the stage height does not affect the result of focalLength property&#8217;s value.  It is calculated from only the stage width by the following formula:</p>
<blockquote><p>tan(fieldOfView/2) = (stageWidth/2)/focalLength<br />
focalLength = stageWidth/2 tan(fieldOfView/2)</p></blockquote>
<p><img src="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/images/frustum.jpg" alt="From [Help] of PerspectiveProjection" /><br />
*From <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/PerspectiveProjection.html" target="_blank">[Help] of PerspectiveProjection</a><br />
<div id="attachment_885" class="wp-caption alignnone" style="width: 444px"><img src="http://blog.jactionscripters.com/wp-content/uploads/2009/09/focallength.gif" alt="focal length and field of view" title="focal length and field of view" width="434" height="218" class="size-full wp-image-885" /><p class="wp-caption-text">focal length and field of view</p></div></p>
<p>Therefore the function below returns focal length by passing field of view.</p>
<p><code-style></p>
<pre name="code" class="as3">// Frame action
function getFocalLength(nFieldOfView:Number):Number {
	var falf_tan:Number = Math.tan(nFieldOfView / 2 * Math.PI / 180);
	return stage.stageWidth/2/falf_tan;
}</pre>
<p></code></p>
<hr width="100">
<p>[Note]: With <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Stage.html#scaleMode" target="_blank">Stage.scaleMode property</a> set to <em>StageScaleMode.NO_SCALE</em>, the value of <em>Stage.stageWidth</em> property can be changed when the browser window is resized.  However the <em>PerspectiveProjection.focalLength</em> would be calculated by the original width of the stage set with the [Property] inspector.</p>
<p>The revised function below can return the right result in the case:</p>
<p><code-style></p>
<pre name="code" class="as3">// Frame action
var originalMode:String = stage.scaleMode;
stage.scaleMode = StageScaleMode.EXACT_FIT;
var myStageWidth:int = stage.stageWidth;
stage.scaleMode = originalMode;
function getFocalLength(nFieldOfView:Number):Number {
	var falf_tan:Number = Math.tan(nFieldOfView / 2 * Math.PI / 180);
	// return stage.stageWidth/2/falf_tan;
	return myStageWidth/2/falf_tan;
}</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/09/06/calculation-of-focallength/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>BetweenAS3 Alpha r3022 now available</title>
		<link>http://blog.jactionscripters.com/2009/08/13/betweenas3-alpha-r3022-now-available/</link>
		<comments>http://blog.jactionscripters.com/2009/08/13/betweenas3-alpha-r3022-now-available/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 10:31:46 +0000</pubDate>
		<dc:creator>Yoshihiro Shindo</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Spark]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=858</guid>
		<description><![CDATA[BetweenAS3, fast, powerful and professional new tweening engine I&#8217;m developing (please see this page or this page), is still under development&#8230; But today, I announce &#8220;Alpha r3022&#8243; version for early betweeners!  
I don&#8217;t give assurance about quality, but many main features may works well. Please test and send feedback (bug report, request, etc) to [...]]]></description>
			<content:encoded><![CDATA[<p>BetweenAS3, fast, powerful and professional new tweening engine I&#8217;m developing (please see <a href="http://www.be-interactive.org/en.php?itemid=468">this page</a> or <a href="http://www.be-interactive.org/en.php?itemid=473">this page</a>), is still under development&#8230; But today, I announce &#8220;Alpha r3022&#8243; version for early betweeners! <img src='http://blog.jactionscripters.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I don&#8217;t give assurance about quality, but many main features may works well. Please test and send feedback (bug report, request, etc) to me.</p>
<p>You can checkout BetweenAS3 Alpha r3022 via SVN from:</p>
<ul>
<li><a href="http://www.libspark.org/svn/as3/BetweenAS3/tags/alpha-r3022/">http://www.libspark.org/svn/as3/BetweenAS3/tags/alpha-r3022/</a></li>
</ul>
<p>or download as ZIP or SWC from:</p>
<ul>
<li><a href="http://www.libspark.org/svn/as3/BetweenAS3/tags/alpha-r3022/release/">http://www.libspark.org/svn/as3/BetweenAS3/tags/alpha-r3022/release/</a></li>
</ul>
<p>Did you find text &#8220;fp9&#8243; in filename? There is good news. FlashPlayer9 version also available!!</p>
<p>Yesterday, version of BetweenAS3 in <a href="http://wonderfl.net/">Wonderfl</a> is r2505, but today, it was updated to r3022. You can enjoy new version in Wonderfl!! You can find BetweenAS3 samples in <a href="http://wonderfl.net/tag/BetweenAS3Tutorial">this &#8220;BetweenAS3Tutorial&#8221; tag page</a>.</p>
<p>Changes from r2505 to r3022 is the following:</p>
<pre> * [r3021] Created FlashPlayer9 version based on r3019.
 * [r3018] Fix: Error occurred when stopping or playing tween in event handlers.
 * [r3017] Added property for frame tween (_frame) and utility for convert frames and time (TimeUtil).
 * [r3016] Added ITween.togglePause
 * [r3009] [r3010] Supported physical tween. (BetweenAS3.physical)
 * [r3007] Added shortcuts for BetweenAS3.tween and BetweenAS3.bezier
  * BetweenAS3.to
  * BetweenAS3.from
  * BetweenAS3.bezierTo
  * BetweenAS3.bezierFrom
 * [r3005] Fix: Function specified in BetweenAS3.func will be called many times.
 * [r2998] Supported bezier tween. (BetweenAS3.bezier)
 * [r2996] Supported parallel and serial by passing Array parameter. (BetweenAS3.parallelTweens, BetweenAS3.serialTweens)
 * Changed internal architecture and package.
  * Supported inheriting event handlers when processing tweens by this change.
  * [r2994] Created IUpdater interface.
  * [r2694] Renamed BetweenEvent class to TweenEvent.
  * [r2692] Moved ITicker interface and TickerListener class to Core package.
  * [r2688] Created Core package.
  * [r2688] Removed ITweenTarget interface, integrated it to ITween interface and created IObjectTween interface.
  * [r2688] Created ITweenContainer (now ITweenGroup) interface.
 * [r2618] Moved a delay setting to the BetweenAS3.delay method for more flexibility.
 * [r2617] Changed the timing of calculating tween parameters to the first time of start playing the tween.
    Now sequence of tween using related value works fine.
     BetweenAS3.serial(
       BetweenAS3.tween(mc, {$x: 100}),
       BetweenAS3.tween(mc, {$x: 100})
     );
 * [r2600] Fix: Sometimes ReferenceError has occured while creating a tween.</pre>
<p>Here is FAQ:</p>
<pre> Q. How to do filter tween?
 A. Do the following:

     BetweenAS3.tween{mc, {_glowFilter: {blurX: 32, blurY: 32}}).play();

    The following properties for filter are supported.

     * _bevelFilter
     * _blurFilter
     * _colorMatrixFilter
     * _convolutionFilter
     * _displacementMapFilter
     * _dropShadowFilter
     * _glowFilter
     * _gradientBevelFilter
     * _gradientGlowFilter
     * _shaderFilter

 Q. How to do ColorTransform tween?
 A. Do the following:

     BetweenAS3.tween(mc, {transfrom: {colorTransfrom: {redOffset: 255}}}).play();

 Q. How to do SoundTransform tween?
 A. Do the following:

     BetweenAS3.tween(sc, {soundTransform: {volume: 0.0}}).play();

 Q. How to set delay?
 A. By using BetweenAS3.delay, add delay to tween.

     BetweenAS3.delay(BetweenAS3.tween(mc, {x: 100}), 1.0).play(); // Delay 1.0 sec

 Q. How to do bezier tween?
 A. Do the following. Pass control points in argument 4. Set Array of control points for each property.

     BetweenAS3.bezier(mc, {x: 385, y: 207}, null, {x: [58.05, 145.9, 246.7, 345.55], y: [61.4, 80.65, 167.05, 209.3]}).play();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/08/13/betweenas3-alpha-r3022-now-available/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting String to DataGridColumn.cellRenderer property</title>
		<link>http://blog.jactionscripters.com/2009/08/10/setting-string-to-datagridcolumncellrenderer-property/</link>
		<comments>http://blog.jactionscripters.com/2009/08/10/setting-string-to-datagridcolumncellrenderer-property/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 13:58:30 +0000</pubDate>
		<dc:creator>Fumio Nonaka</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=822</guid>
		<description><![CDATA[Reference of a class to render the items in a column can be set to DataGridColumn.cellRenderer property as the following frame action:

// Frame action
import fl.controls.DataGrid;
import fl.controls.dataGridClasses.DataGridColumn;
var myColmn:DataGridColumn = new DataGridColumn("data");
var myDataGrid:DataGrid = new DataGrid();
myDataGrid.addColumn(myColmn);
// myColmn.cellRenderer = "CustomCellRenderer";  // Error #2007
myColmn.cellRenderer = CustomCellRenderer;  // OK
myDataGrid.addItem({data: "test"});
addChild(myDataGrid);

[Help] also tells that the type of the property&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Reference of a class to render the items in a column can be set to <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/fl/controls/dataGridClasses/DataGridColumn.html#cellRenderer" target="_blank"><em>DataGridColumn.cellRenderer</em> property</a> as the following frame action:</p>
<p><code-style></p>
<pre name="code" class="as3">// Frame action
import fl.controls.DataGrid;
import fl.controls.dataGridClasses.DataGridColumn;
var myColmn:DataGridColumn = new DataGridColumn("data");
var myDataGrid:DataGrid = new DataGrid();
myDataGrid.addColumn(myColmn);
// myColmn.cellRenderer = "CustomCellRenderer";  // Error #2007
myColmn.cellRenderer = CustomCellRenderer;  // OK
myDataGrid.addItem({data: "test"});
addChild(myDataGrid);</pre>
<p></code></p>
<p>[Help] also tells that the type of the property&#8217;s value can be String. However setting a String class name causes Error #2007 like the below. The error would be shown if the comment-outed statement was validated instead in the sample above.</p>
<blockquote><p>TypeError:Error #2007:Parameter child must be non-null.</p></blockquote>
<p>I happened to see <a href="http://help.adobe.com/en_US/AS2LCR/Flash_10.0/00002146.html#3142008" target="_blank"><em>DataGridColumn.cellRenderer</em> property</a> in ActionScript 2.0 Components Language Reference.  It says that the property is &#8220;a linkage identifier for a symbol&#8221;.</p>
<p>Therefore, I tried to create an empty MovieClip symbol and to <a href="http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b8ea63-7fee.html" target="_balnk">set the class to [Class] of [Linkage]</a>. Then the String class name set to the property in the code above worked properly without an error. As my conclusion, a String class name might only be used for the class set to [Class] of [Linkage].</p>
<p><img src="http://www.fumiononaka.com/TechNotes/Images/FN0908002_001.gif" alt="Symbol Properties" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/08/10/setting-string-to-datagridcolumncellrenderer-property/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Resizing the drop down list of ComboBox when removeItem() is called</title>
		<link>http://blog.jactionscripters.com/2009/07/28/resizing-the-drop-down-list-of-combobox-when-removeitem-is-called/</link>
		<comments>http://blog.jactionscripters.com/2009/07/28/resizing-the-drop-down-list-of-combobox-when-removeitem-is-called/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 13:21:04 +0000</pubDate>
		<dc:creator>Fumio Nonaka</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=785</guid>
		<description><![CDATA[When items in a CombBox compnent instance are removed with ComboBox.removeItem() method, its size of drop down list will not be adjusted.  I suspect that this behavior might be a bug because ComboBox.removeItemAt() method properly reset its size.
 -> 
In order to set size of the drop down list properly call UIComponent.validateNow() method after [...]]]></description>
			<content:encoded><![CDATA[<p>When items in a CombBox compnent instance are removed with <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/fl/controls/ComboBox.html#removeItem()" target="_blank">ComboBox.removeItem() method</a>, its size of drop down list will not be adjusted.  I suspect that this behavior might be a bug because ComboBox.removeItemAt() method properly reset its size.</p>
<p><img src="http://blog.jactionscripters.com/wp-content/uploads/2009/07/combobox_removeitem_0011.gif" alt="Combobox.removeItem()" title="Combobox.removeItem()" width="100" height="82" class="alignnone size-full wp-image-788" /> -> <img src="http://blog.jactionscripters.com/wp-content/uploads/2009/07/combobox_removeitem_002.gif" alt="Combobox.removeitem()" title="Combobox.removeitem()" width="100" height="82" class="alignnone size-full wp-image-792" /></p>
<p>In order to set size of the drop down list properly call <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/fl/core/UIComponent.html#validateNow()" target="_blank">UIComponent.validateNow() method</a> after an item is removed with the method like the following code:</p>
<p><code-style></p>
<pre name="code" class="as3">// Frame action
import fl.controls.ComboBox;
var myComboBox:ComboBox = new ComboBox();
addChild(myComboBox);
myComboBox.addEventListener(Event.CHANGE, xSelected);
myComboBox.addItem({label:"Dreamweaver CS4", data:"html"});
myComboBox.addItem({label:"Fireworks CS4", data:"png"});
myComboBox.addItem({label:"Flash CS4 Professional", data:"fla"});
function xSelected(eventObject:Event):void {
	var myItem:Object = myComboBox.getItemAt(0);
	myComboBox.removeItem(myItem);
	myComboBox.validateNow();  // Insert this statement.
}</pre>
<p></code></p>
<p>In the ComboBox class ComboBox.removeItemAt() method calls <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/fl/core/UIComponent.html#invalidate()" target="?blank">UIComponent.invalidate() method</a> after deleting an item with List.removeItemAt() method.</p>
<p><code-style></p>
<pre name="code" class="as3">public function removeItemAt(index:uint):void {
	list.removeItemAt(index);
	invalidate(InvalidationType.DATA);
}</pre>
<p></code></p>
<p>However, ComboBox.removeItem() method does not call the method.</p>
<p><code-style></p>
<pre name="code" class="as3">public function removeItem(item:Object):Object {
	return list.removeItem(item);
}</pre>
<p></code></p>
<p>Therefore, UIComponent.invalidate() method could be used instead of UIComponent.validateNow() method.</p>
<p><code-style></p>
<pre name="code" class="as3">// Frame action
import fl.core.InvalidationType;
import fl.controls.ComboBox;
var myComboBox:ComboBox = new ComboBox();
addChild(myComboBox);
myComboBox.addEventListener(Event.CHANGE, xSelected);
myComboBox.addItem({label:"Dreamweaver CS4", data:"html"});
myComboBox.addItem({label:"Fireworks CS4", data:"png"});
myComboBox.addItem({label:"Flash CS4 Professional", data:"fla"});
function xSelected(eventObject:Event):void {
	var myItem:Object = myComboBox.getItemAt(0);
	myComboBox.removeItem(myItem);
	myComboBox.invalidate(InvalidationType.DATA);  // Insert this statement.
}</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/07/28/resizing-the-drop-down-list-of-combobox-when-removeitem-is-called/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing text in the Flash Timeline using JSFL</title>
		<link>http://blog.jactionscripters.com/2009/07/13/timeline-message-by-jsfl/</link>
		<comments>http://blog.jactionscripters.com/2009/07/13/timeline-message-by-jsfl/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 08:50:36 +0000</pubDate>
		<dc:creator>Yusuke Kamo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=776</guid>
		<description><![CDATA[
In my previous entry, I wrote about the Timeline message I made in JSFL for Geoff when he was here in Tokyo during our last User Group Meeting.
The 3 things I want to highlight from that are:
    * How it is possible to talk between JSFL and AS3
    * [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://log.xingxx.com/2009/05/29/title.png" alt="timeline message" /></p>
<p>In my previous entry, I wrote about the Timeline message I made in JSFL for Geoff when he was here in Tokyo during our last User Group Meeting.</p>
<p>The 3 things I want to highlight from that are:</p>
<p>    * How it is possible to talk between JSFL and AS3<br />
    * Rendering Particles in AS3<br />
    * Reaching the limits of JSFL</p>
<p>Taking that in consideration, let me try to explain in detail what it all means:</p>
<p>First of all, as I&#8217;ve already mentioned this, it is possible to communicate between JSFL and AS3.<br />
It&#8217;s very close to how you use ExternalInterface, and in a similar way, you can call from AS3 methods defined in JSFL, as well as calling JSFL methods defined in AS3.</p>
<p>The task then becomes splitting responsibilities properly, or &#8220;letting each object do by themselves what they are really good at doing&#8221;.<br />
Originally, JSFL was not a language thought for expression. So in a way you will very quickly find how limited it is. However, we can tweak things a little bit and try writing shapes that resemble type in the timeline by almost using only JSFL.<br />
One of the possible methods to create something like this would be by defining a very large range of variables representing each character. But this seems to be a very inefficient method of doing things.</p>
<p>Opposite to that, in AS3, expression is really one it&#8217;s most inherent characteristics.</p>
<p>In the following example, we create all the text character variables we need in AS3 and we then hand that over to JSFL as a package so it can handle that input.</p>
<p>The process goes as follows:</p>
<p>First as a precondition, we thing of 1 pixel as 1 frame. The coordinate origin is set at the top left.</p>
<p>    * In AS3 we measure the size of the Textfield and pass that to JSFL<br />
    * In JSFL we measure the biggest size needed to represent all text, and then create as many keyframes as needed to fit that.<br />
    * In AS3 we then copy the contents of the textfield into a BitmapData object.<br />
    * We then grab the output of that BitmapData, scan it, and grab all coordinates for each pixel we want to represent.<br />
    * Finally pass each of those coordinates to JSFL</p>
<p>Below is all the AS3 source.</p>
<p>When sending data to JSFL we make use of MMExeCute, but since its pretty awkward to use, we wrap that in our own MMExecute2.</p>
<p>To grab all data from our Bitmap we use getVector since it many times faster than trying to manipulate a ByteArray using getPixels.</p>
<p><code-style>
<pre name="code" class="as3">
package {
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Rectangle;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.text.Font;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import flash.utils.ByteArray;

	/**@author kamoyusuke */
	public class Message extends Sprite {

		public function Message():void {
			var loader:URLLoader = new URLLoader();
			loader.addEventListener(Event.COMPLETE, completeHandler);
			loader.load(new URLRequest("timelineMessage.xml"))
		}

		private function completeHandler(e:Event):void {
			XML.ignoreWhitespace = true;
			var xml:XML = new XML(e.target.data);

			var tf:TextField = new TextField();
			tf.defaultTextFormat = new TextFormat(xml.message[0].@font,Number(xml.message[0].@size));
			tf.autoSize = TextFieldAutoSize.LEFT;
			tf.text = xml.message[0];

			MMExecute2.setDefault(MMExecute2.CONFIG_JS_URI,"VisualizeTimeLine")
			MMExecute2.run("init", [Math.round(tf.height), Math.round(tf.width)]);

			//trace(Math.round(tf.width),Math.round(tf.height))

			var canvas:BitmapData = new BitmapData(tf.width, tf.height, false);

			canvas.draw(tf);

			var board:BitmapData = new BitmapData(tf.width, tf.height, false);
			var bm:Bitmap = addChild(new Bitmap(board)) as Bitmap;

			drawVector(canvas,board);
		}

		private function drawByteArray(canvas:BitmapData, board:BitmapData = null):void{
			var bytes:ByteArray = canvas.getPixels(canvas.rect);

			var color:uint, p:int;
			var _x:int;
			var _y:int = -1;
			for (bytes.position = 0; bytes.position &lt; bytes.length; color = bytes.readUnsignedInt()) {
				p = bytes.position / 4
				_x = p %canvas.width;
				_y  += !_x ? 1: 0;
				if (!color) {
					//board.setPixel(_x, _y,0)
					MMExecute2.run("setMotionTween",[Math.round(_y),Math.round(_x)]);
				}
			}
		}

		private function drawVector(canvas:BitmapData, board:BitmapData = null):void {
			var bytes:Vector. = canvas.getVector(canvas.rect);
			bytes.fixed = true;
			canvas.lock();

			var color:uint, i:int;
			var _x:int;
			var _y:int = -1;
			for (i; i &lt; bytes.length; i++) {
				color = bytes[i];
				_x = i %canvas.width;
				_y  += !_x ? 1: 0;
				if (!color) {
					//board.setPixel(_x,_y,0)
					MMExecute2.run("setMotionTween",[_y,_x]);
				}
			}
		}
	}

}</pre>
<p></code-style></p>
<p>Next is the source for the JSFL.</p>
<p>Once we call our init method in MMExecute2, we measure the height and with of the text we want to represent and we then create as many layers and blank frames we need in the document we are currently on. Finally, we delete all layers that where originally in the document. The next thing we call is setMotionTween. This method receives the bitmap data, scans it and whenever it finds a colored pixel it executes it on the set layer and frame number. The internal property being used Timeline.currentLayer sets the layer to be modified next. Timeline.createMotionTween then creates a motion tween from and to the frameIndex received.</p>
<p><code-style>
<pre name="code" class="as3">
var currentTimeline = fl.getDocumentDOM().getTimeline();
var layerHeight;
var frameLength;

function init(_layerHeight,_frameLength){
	layerHeight = _layerHeight;
	frameLength =  _frameLength;
	for(var i= 0;i$lt;layerHeight;i++){
		var targetLayer = currentTimeline.layers[currentTimeline.addNewLayer()];
		currentTimeline.convertToBlankKeyframes(0,frameLength+1)
	}
	currentTimeline.deleteLayer(currentTimeline.layers.length-1)
}

//指定フレームをモーショントゥイーンに設定
function setMotionTween(layerIndex,frameIndex){
	currentTimeline.currentLayer = layerIndex
	currentTimeline.createMotionTween(frameIndex,frameIndex)
}
</code-style></pre>
<p>So as you can see, it is possible to very easily cooperate between the two worlds and this opens the possibility to many more ideas.</p>
<p>This is for example how Kuler actually integrates with the Adobe CS family products.<br />
That said, since this is a method that has not been really designed for this sort of interaction, it is very possible that things will simply break when trying to push it too hard, so be advised!</p>
<p><img src="http://log.xingxx.com/2009/05/29/timelinemessage0.png" alt="" /></p>
<p>---------------------------------------------------------------------------</p>
<p>Thanks to him, I was able to open to the public.<br />
Against Mr. <a href="http://twitter.com/marumushi">Marcos</a>, and I am deeply grateful !!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/07/13/timeline-message-by-jsfl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>English front page of the Spark project is now updated!</title>
		<link>http://blog.jactionscripters.com/2009/07/02/english-front-page-of-the-spark-project-is-now-updated/</link>
		<comments>http://blog.jactionscripters.com/2009/07/02/english-front-page-of-the-spark-project-is-now-updated/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 06:33:23 +0000</pubDate>
		<dc:creator>Yoshihiro Shindo</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Spark]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=772</guid>
		<description><![CDATA[It was difficult to find cool new Spark project stuffs becuase English front page (Project list) no longer maintained&#8230;  
But now you can find some new stuffs because we updated the English front page today! It&#8217;s based on latest Japanese front page. Enjoy!  
]]></description>
			<content:encoded><![CDATA[<p>It was difficult to find cool new Spark project stuffs becuase <a href="http://www.libspark.org/wiki/WikiStart/en">English front page (Project list)</a> no longer maintained&#8230; <img src='http://blog.jactionscripters.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>But now you can find some new stuffs because we updated the English front page today! It&#8217;s based on <a href="http://www.libspark.org/">latest Japanese front page</a>. Enjoy! <img src='http://blog.jactionscripters.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/07/02/english-front-page-of-the-spark-project-is-now-updated/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Jikkyo Generator and Youtube API</title>
		<link>http://blog.jactionscripters.com/2009/06/25/jikkyo-generator-and-youtube-api/</link>
		<comments>http://blog.jactionscripters.com/2009/06/25/jikkyo-generator-and-youtube-api/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 07:33:19 +0000</pubDate>
		<dc:creator>bA</dc:creator>
				<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Download]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=741</guid>
		<description><![CDATA[
Hi, my name is Yasuhiko Nishimura and I am an interactive designer at Business Architects.
The Jikkyo Generator 2010 website build by us went live in May. 
The previous  version Jikkyo Generator 2008 was integrated with eyeVio for the videos but to enable more users to enjoy the website the new release features integration with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jactionscripters.com/wp-content/uploads/2009/06/capture.png" alt="Jikkyo Generator 2010" title="Jikkyo Generator 2010" width="640" height="396" class="alignnone size-full wp-image-742" /></p>
<p>Hi, my name is <a href="http://twitter.com/yasnis">Yasuhiko Nishimura</a> and I am an interactive designer at <a href="http://www.b-architects.com/">Business Architects</a>.<br />
The <a href="http://www.projectblue.sony.jp/jikkyo/">Jikkyo Generator 2010</a> website build by us went live in May. </p>
<p>The previous  version Jikkyo Generator 2008 was integrated with <a href="http://eyevio.jp/">eyeVio</a> for the videos but to enable more users to enjoy the website the new release features integration with <a href="http:///www.youtube.com/">YouTube</a>. </p>
<p>In this entry I will explain a bit more about the integration with the YouTube API.<br />
(This entry will be about AS2)</p>
<p><span id="more-741"></span></p>
<p><strong>0.Prepare to use the YouTube API.</strong></p>
<p>YouTube allows the use of the Data API or the Player API, however for a full Flash based site like this one you need to use the <a href="http://code.google.com/intl/en/apis/youtube/flash_api_reference.html">chromeless player</a> which allows you to create your own player. Also you need to have developer key to use the YouTube API.<br />
To get your developer key register at the following url: <a href="http://code.google.com/apis/youtube/dashboard/">http://code.google.com/apis/youtube/dashboard/</a></p>
<p><strong>1.Classes to use</strong></p>
<p>Source Code: <a href="http://www.b-architects.com/lab/YTPlayer_sample.zip">download from here</a>.<br />
(The sources comments are written in Japanese language)</p>
<p>The following 3 classes are used.</p>
<dl style="padding-left:2em;">
<dt><span style="font-family:monospace;color:#000;">com.b_architects.lab.youtube.YTPlayer</span></dt>
<dd style="text-indent:2em;">This class load the chromeless player.</dd>
<dt><span style="font-family:monospace;color:#000;">com.b_architects.lab.youtube.YTData</span></dt>
<dd style="text-indent:2em;">This class receives and manages the information abou the video from the Data API</dd>
<dt><span style="font-family:monospace;color:#000;">com.b_architects.lab.youtube.YTConstant</span></dt>
<dd style="text-indent:2em;">This contants class holds the developer key and other YouTube related  parameters.</dd>
</dl>
<p></p>
<p>Inside the <span style="font-family:monospace;color:#000;">YTConstant.as</span> the following need to be registered<br />
<span style="font-family:monospace;color:#000;">PRODUCT_NAME,CLIENT_ID,DEVELOPER_KEY</span><br />
(You can also initialize these at execution time without rewriting the sourcecode)</p>
<p><strong>2.Create and initialize the player</strong></p>
<p>To create a player execute the following command:</p>
<p><code-style>
<pre name="code" class="as3">
    YTPlayer.getPlayer(target:MovieClip);
</pre>
<p></code-style></p>
<p><span style="font-family:monospace;color:#000;">target</span> here is the <span style="font-family:monospace;color:#000;">MovieClip</span> instance which creates the player. First create an empty <span style="font-family:monospace;color:#000;">MovieClip</span> instance and the replace the <span style="font-family:monospace;color:#000;">__proto__</span> property with <span style="font-family:monospace;color:#000;">YTPlayer.prototype</span>. By doing so, you create an instance of the <span style="font-family:monospace;color:#000;">YTPlayer</span> from script without having to create linkage from the library. (You can also do this by setting up a linkage to the <span style="font-family:monospace;color:#000;">MovieClip</span> symbol from the library) </p>
<p>The <span style="font-family:monospace;color:#000;">YTPlayer</span> is embedding the chromeless player from the YouTube servers and might take some time to load.<br />
Once the player is loaded and ready to be used the <span style="font-family:monospace;color:#000;">YTPlayer.EVENT_PLAYER_READY</span> event is issued.</p>
<p>the actual code look like:</p>
<p><code-style>
<pre name="code" class="as3">
    import com.b_architects.lab.youtube.YTPlayer;
    var player:YTPlayer = YTPlayer.getPlayer(this);
    player.addEventListener(YTPlayer.EVENT_PLAYER_READY,onPlayerReady);
    function onPlayerReady(e:Object) {
        //The process for once the initialization is finished
    }
</pre>
<p></code-style></p>
<p>and the player is ready.</p>
<p><strong>3. Control and playback the video</strong></p>
<p>To playback the video execute the following code:</p>
<p><code-style>
<pre name="code" class="as3">
    player.loadVideoById("2L0nGWDPt6A");
</pre>
<p></code-style><br />
this exectution load the video based on the ID passed on the the <span style="font-family:monospace;color:#000;">loadVideoById</span>.</p>
<p>For other video controls reference the following url: <a href="http://code.google.com/intl/en/apis/youtube/flash_api_reference.html#Operations">http://code.google.com/intl/en/apis/youtube/flash_api_reference.html#Operations</a></p>
<p>The <span style="font-family:monospace;color:#000;">YTPlayer</span> implements the chromeless player's methods under the same method name.</p>
<p><strong>4. Load Youtube data</strong></p>
<p>By using the <span style="font-family:monospace;color:#000;">YTData</span> class you can check wether the video for that ID exists, if you can use the API or not, thumbnail path and other usefull information for creating the site. When passing the ID with the String to the constructor the data gets initialized. Once the initialization is done the <span style="font-family:monospace;color:#000;">YTData.VIDEO_CHECK</span> event is issued.</p>
<p>The basic usage is:<br />
<code-style>
<pre name="code" class="as3">
    import com.b_architects.lab.youtube.YTData;
    var data:YTData = new YTData("http://www.youtube.com/watch?v=2L0nGWDPt6A");
    data.addEventListener(YTData.VIDEO_CHECK,onChecked);
    function onChecked(e:Object):Void {
        trace(e.target.id);
    }
</pre>
<p></code-style></p>
<p><strong>5. Conclusion</strong></p>
<p>As stated above this is a general overview on how to use the YouTube API.<br />
The Jikkyo Generator website uses the concepts stated above as its core and has additional features such as playback control, adding narations and other playback functions. The YouTube API has been altered over the years and it can easily change again soon.<br />
When that change occures hopefully changes required on the website will be minimal because the API part stands alone from the website. </p>
<p>Although creating what we have created is not difficult it can be cumbersome and I hope by sharing this information it might benefit others.<br />
If you have a chance, try this out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/06/25/jikkyo-generator-and-youtube-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Particle Storm demo &amp; source</title>
		<link>http://blog.jactionscripters.com/2009/06/23/particle-storm-demo-source/</link>
		<comments>http://blog.jactionscripters.com/2009/06/23/particle-storm-demo-source/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 15:41:12 +0000</pubDate>
		<dc:creator>Takayuki Fukatsu</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[VisualSketch]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=736</guid>
		<description><![CDATA[FITC: Cool Japan side A / Particle sample of SMOKE &#8211; wonderfl build flash online
I think I have forgotton to post this experiment to JActionScripters.
Here is a playable demo &#038; source code that I showed on the FITC2009 session. Storm simulation with 10000 particle.
Basically all physic and mouse interaction is calculated with bitmap force map. [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;width:465px;"><iframe title="FITC: Cool Japan side A / Particle sample of SMOKE - wonderfl build flash online" src="http://wonderfl.net/blogparts/e5458ebf7b16817e3529321415c4f17ce965515a" width="465" height="490" style="border:1px black solid;"></iframe><a href="http://wonderfl.net/code/e5458ebf7b16817e3529321415c4f17ce965515a" title="FITC: Cool Japan side A / Particle sample of SMOKE - wonderfl build flash online">FITC: Cool Japan side A / Particle sample of SMOKE &#8211; wonderfl build flash online</a></div>
<p>I think I have forgotton to post this experiment to JActionScripters.<br />
Here is a <a href="http://wonderfl.net/code/e5458ebf7b16817e3529321415c4f17ce965515a">playable demo &#038; source</a> code that I showed on the FITC2009 session. Storm simulation with 10000 particle.</p>
<p>Basically all physic and mouse interaction is calculated with bitmap force map. Precalculating mouse interaction with bitmap is much faster than doing mouse distance with 10000 particles every frame.</p>
<p>You can also see stupid <a href="http://wonderfl.net/code/0108d7b3b7a336aa406134e62ae6a50736519c08">250000 particle version</a> here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/06/23/particle-storm-demo-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
