<?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>sban</title>
	<atom:link href="http://sban.biz/feed" rel="self" type="application/rss+xml" />
	<link>http://sban.biz</link>
	<description>Focus on RIA</description>
	<lastBuildDate>Wed, 01 Sep 2010 08:01:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>跳桢</title>
		<link>http://sban.biz/386</link>
		<comments>http://sban.biz/386#comments</comments>
		<pubDate>Tue, 31 Aug 2010 16:00:37 +0000</pubDate>
		<dc:creator>sban</dc:creator>
				<category><![CDATA[AS3 Expert]]></category>
		<category><![CDATA[as3 expert]]></category>

		<guid isPermaLink="false">http://sban.biz/386</guid>
		<description><![CDATA[Flash Player 10更改了9的异步跳桢机制，这比开发者带来极大方便，利用这个改进，或许可以在AS3中实现阻塞编程。 1，Flash Player 9中的跳桢问题 Flash Player 9应当退出历史舞台了，余不待说，仅是异步跳桢这一个理由便充分了。在Flash Player 9中，以下代码将返回null: // go to a specific frame where myDisplayObject is located container.gotoAndStop ( 25 ); // output : null trace( container.myDisplayObject );//该对象位于第25桢中 而在Flash Player 10中，它却可以返回实例。 2，另一个Flash Player 9的关于gotoAndStop的bug 设主场景中有一mc，此mc中有两桢，第二桢代码为： trace(2) 主场景第一桢代码为： mc.gotoAndStop(2); 毫无疑问，输出应该是: 2 然而实际却是: 2 2 这是Flash Player 9的一个bug，在Flash Player 10中不存在这个问题。 3，Flash Player 9与10的跳桢区别 [...]]]></description>
			<content:encoded><![CDATA[<p>Flash Player 10更改了9的异步跳桢机制，这比开发者带来极大方便，利用这个改进，或许可以在AS3中实现阻塞编程。</p>
<p> <span id="more-386"></span>
</p>
<h3>1，Flash Player 9中的跳桢问题</h3>
<p>Flash Player 9应当退出历史舞台了，余不待说，仅是异步跳桢这一个理由便充分了。在Flash Player 9中，以下代码将返回null:</p>
<pre><span style="color: #008000">// go to a specific frame where myDisplayObject is located</span>
container.gotoAndStop ( 25 );
<span style="color: #008000">// output : null</span>
trace( container.myDisplayObject );//该对象位于第25桢中</pre>
<p>而在Flash Player 10中，它却可以返回实例。</p>
<h3>2，另一个Flash Player 9的关于gotoAndStop的bug</h3>
<p>设主场景中有一mc，此mc中有两桢，第二桢代码为：</p>
<pre>trace(2)</pre>
<p>主场景第一桢代码为：</p>
<pre>mc.gotoAndStop(2);</pre>
<p>毫无疑问，输出应该是:</p>
<p>2</p>
<p>然而实际却是:</p>
<p>2<br />
  <br />2</p>
<p>这是Flash Player 9的一个bug，在Flash Player 10中不存在这个问题。</p>
<h3>3，Flash Player 9与10的跳桢区别</h3>
<p>Flash Player 9的跳桢是异步的，而10的跳桢却是同步的。</p>
<p>当gotoAndStop发生时：</p>
<table border="1" cellspacing="0" cellpadding="2" width="545">
<tbody>
<tr>
<td valign="top" width="179">Flash Player 9</td>
<td valign="top" width="183">Flash Player 10</td>
<td valign="top" width="181">&#160;</td>
</tr>
<tr>
<td valign="top" width="179">对比桢差异，移除所有非动态添加的、在新桢中不存在的对象，移动播放头</td>
<td valign="top" width="183">对比桢差异，移除所有非动态添加的、在新桢中不存在的对象</td>
<td valign="top" width="181">非动态：非代码添加</td>
</tr>
<tr>
<td valign="top" width="179">执行gotoAndStop之后代码</td>
<td valign="top" width="183">添加静态对象，执行桢代码，移动播放头</td>
<td valign="top" width="181">&#160;</td>
</tr>
<tr>
<td valign="top" width="179">&#8230;.</td>
<td valign="top" width="183">执行gotoAndStop之后代码</td>
<td valign="top" width="181">&#160;</td>
</tr>
<tr>
<td valign="top" width="179">在一代代码执行周期中，在enterFrame事件监听中，添加静态对象，执行桢代码</td>
<td valign="top" width="183">&#160;</td>
<td valign="top" width="181">&#160;</td>
</tr>
</tbody>
</table>
<h3>4，Flash Player如何比对静态对象是否相同</h3>
<p>1) 如果静态对象在新桢中没有新的关键桢，则一定保留</p>
<p>2) 如果静态对象在新桢中有新的关键桢，但该对象未与任何类关联，则保留，否则移除</p>
<h3>5，两个版本跳桢的不同对桢周期的影响</h3>
<p>在Flash Player一个完整的桢周期中，共做两件事情：执行代码与渲染，又细分为五小步：</p>
<p>1) Player事件调度 – 比如Timer事件，鼠标事件，ENTER_FRAME事件，URLLoader事件等等。<br />
  <br />2) 用户代码执行 – <strong>所有侦听上一步相应事件的代码被执行</strong>。</p>
<p>3) RENDER事件调度 – 在用户代码执行期间调用stage.invalidate()会触发这一特殊事件。</p>
<p>4) 最后的用户代码执行 – 侦听上述第三步特殊事件的用户代码此时被执行。</p>
<p>5) Player更改显示列表。</p>
<p>在第2小步时，在Flash Player 9中，包括执行桢代码，这是由对enterFrame监听引起的；而在Flash Player 10中，同样的桢代码是在第1小步内执行完成的。Flash Player 10对跳桢的改进有利于减少桢周期中代码执行的环节。</p>
<p>&#160;</p>
<p><font color="#ff8888">sban</font> 2010/8/31 北京。转载请注明<a href="http://sban.biz/">作者</a>及<a href="http://sban.biz/">出处</a>，非商用。本文属于《<a href="http://sban.biz/as3-expert">AS3 Expert</a>》的一部分。</p>
]]></content:encoded>
			<wfw:commentRss>http://sban.biz/386/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为甘肃舟曲遇难者同胞致哀</title>
		<link>http://sban.biz/348</link>
		<comments>http://sban.biz/348#comments</comments>
		<pubDate>Sun, 15 Aug 2010 07:17:24 +0000</pubDate>
		<dc:creator>sban</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://sban.biz/?p=348</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://www.win7bar.net/uploads/allimg/100420/1_100420230255_1.gif" title="对甘肃舟曲泥石流遇难同胞的深切哀悼" class="alignnone" width="487" height="323" /></p>
]]></content:encoded>
			<wfw:commentRss>http://sban.biz/348/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a trapezoid box</title>
		<link>http://sban.biz/382</link>
		<comments>http://sban.biz/382#comments</comments>
		<pubDate>Sat, 07 Aug 2010 16:19:50 +0000</pubDate>
		<dc:creator>sban</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[away3d]]></category>

		<guid isPermaLink="false">http://sban.biz/382</guid>
		<description><![CDATA[As title, how to reate a trapezoid box with away3d? var v :View3D = new View3D({x:200, y:200, color:0xffff0000}); var cube : WireCube = new WireCube();//sban var cm: WireframeMaterial = new WireframeMaterial(0xffff0000); cm.wireAlpha=0.5; cube.material = cm; cube.rotationX=15; cube.v000.x -= 10; cube.v010.x -= 10; cube.v110.x += 10; cube.v100.x += 10; v.scene.addChild(cube); addChild(v); v.render(); sban 2010/8/7 Beijing]]></description>
			<content:encoded><![CDATA[<p>As title, how to reate a trapezoid box with away3d?</p>
<p> <span id="more-382"></span>
<pre>var v :View3D = <span style="color: #0000ff">new</span> View3D({x:200, y:200, color:0xffff0000});
var cube : WireCube = <span style="color: #0000ff">new</span> WireCube();//<a href="http://sban.biz/">sban</a>
var cm: WireframeMaterial = <span style="color: #0000ff">new</span> WireframeMaterial(0xffff0000);
cm.wireAlpha=0.5;
cube.material = cm;
cube.rotationX=15;
cube.v000.x -= 10;
cube.v010.x -= 10;
cube.v110.x += 10;
cube.v100.x += 10;
v.scene.addChild(cube);
addChild(v);
v.render();</pre>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image9.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb9.png" width="238" height="220" /></a> </p>
<p><a href="http://sban.biz/">sban</a> 2010/8/7 Beijing</p>
]]></content:encoded>
			<wfw:commentRss>http://sban.biz/382/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>create alpha 3d object</title>
		<link>http://sban.biz/379</link>
		<comments>http://sban.biz/379#comments</comments>
		<pubDate>Sat, 07 Aug 2010 15:56:05 +0000</pubDate>
		<dc:creator>sban</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[away3d]]></category>

		<guid isPermaLink="false">http://sban.biz/379</guid>
		<description><![CDATA[How to create a alpha 3d object with awayd? Becuse transparent, we can see it&#8217;s back outlines.If we use Cube create it like this: var v :View3D = new View3D({x:200, y:200, color:0xffff0000}); var cube :Cube = new Cube();//sban var cm: WireframeMaterial = new WireframeMaterial(0xffff0000); cm.wireAlpha=0.5; cube.material = cm; cube.rotationX=15; cube.rotationY=15; cube.rotationZ=15; v.scene.addChild(cube); addChild(v); v.render(); it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>How to create a alpha 3d object with awayd?</p>
<p> <span id="more-379"></span>
<p>Becuse transparent, we can see it&#8217;s back outlines.If we use Cube create it like this:</p>
<pre>var v :View3D = <span style="color: #0000ff">new</span> View3D({x:200, y:200, color:0xffff0000});
var cube :Cube = <span style="color: #0000ff">new</span> Cube();//<a href="http://sban.biz/">sban</a>
var cm: WireframeMaterial = <span style="color: #0000ff">new</span> WireframeMaterial(0xffff0000);
cm.wireAlpha=0.5;
cube.material = cm;
cube.rotationX=15;
cube.rotationY=15;
cube.rotationZ=15;
v.scene.addChild(cube);
addChild(v);
v.render();</pre>
<p>it&#8217;s NOT what we want</p>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image5.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb5.png" width="238" height="224" /></a> </p>
<p>This code can show the back outlines:</p>
<pre>cube.bothsides=<span style="color: #0000ff">true</span>;</pre>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image6.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb6.png" width="244" height="226" /></a> </p>
<p>But we can not remove the catercorner where each face. If we increase segment like this:</p>
<pre>cube.segmentsW=2;
cube.segmentsH=2;</pre>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image7.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb7.png" width="244" height="212" /></a> </p>
<p>My God!It dose not help much. Away3d use triangle to draw the segment in cube, in other words, every segment contains two triangles in cube. May be not we achieved with cube.So I sue WireCube as follows:</p>
<pre>var v :View3D = <span style="color: #0000ff">new</span> View3D({x:200, y:200, color:0xffff0000});
var cube : WireCube = <span style="color: #0000ff">new</span> WireCube();//<a href="http://sban.biz/">sban</a>
var cm: WireframeMaterial = <span style="color: #0000ff">new</span> WireframeMaterial(0xffff0000);
cm.wireAlpha=0.5;
cube.material = cm;
cube.rotationX=15;
cube.rotationY=15;
cube.rotationZ=15;
v.scene.addChild(cube);
addChild(v);
v.render();</pre>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image8.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb8.png" width="239" height="219" /></a> </p>
<p>Wire 3d object can not be set segment number.</p>
<p>BS:Outline property of the 3d object can highlight the bounds.</p>
<p><a href="http://sban.biz/">sban</a> 2010/8/7 北京</p>
]]></content:encoded>
			<wfw:commentRss>http://sban.biz/379/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>start with away3d flash engine</title>
		<link>http://sban.biz/366</link>
		<comments>http://sban.biz/366#comments</comments>
		<pubDate>Sat, 07 Aug 2010 09:01:46 +0000</pubDate>
		<dc:creator>sban</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[away3d]]></category>

		<guid isPermaLink="false">http://sban.biz/366</guid>
		<description><![CDATA[away3d official web: http://away3d.com/ Awayd is a great realtime 3d engine for flash application.This post demonstrates how to get started with away3d 3.5.Now, let us use away3d create a cube&#8230; &#160; 1,download the 3.5 version and import into your project 2,write the following code into your entry file: var v:View3D = new View3D({x:200, y:200, color:0xffff0000}); [...]]]></description>
			<content:encoded><![CDATA[<p>away3d official web: <a title="http://away3d.com/" href="http://away3d.com/">http://away3d.com/</a></p>
<p>Awayd is a great realtime 3d engine for flash application.This post demonstrates how to get started with away3d 3.5.Now, let us use away3d create a cube&#8230;</p>
<p> <span id="more-366"></span>
<p>&#160;</p>
<p>1,download the 3.5 version and import into your project   <br />2,write the following code into your entry file:</p>
<pre>var v:View3D = <span style="color: #0000ff">new</span> View3D({x:200, y:200, color:0xffff0000});
var cube:Cube = <span style="color: #0000ff">new</span> Cube({width:150, height:150, depth:150});
v.scene.addChild(cube);
addChild(v);
v.render();</pre>
<p>compile and run it, you will see:</p>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb.png" width="244" height="238" /></a> </p>
<p>It&#8217;s a cube, but it looks like a square.Insert the following code:</p>
<pre>cube.rotationX=15;
cube.rotationY=15;
cube.rotationZ=15;</pre>
<p>got this:</p>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb1.png" width="244" height="236" /></a> </p>
<p>The three-demensional coordinate is as follows</p>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb2.png" width="240" height="244" /></a> </p>
<p>If face the direction of the x, yaxis, the rotation is inverse hour, but the z is clockwize.Why not same?</p>
<p>View3D is a container used for storing camera, scene, session, renderer and clip references, and resolving mouse events. Every time after changing the properties of the 3d object, must explicitly call the view3d&#8217;s render method.</p>
<p>We cant paste a material to the cube faces like this</p>
<pre>cube.material = <span style="color: #0000ff">new</span> BitmapMaterial( (<span style="color: #0000ff">new</span> myTexture <span style="color: #0000ff">as</span> Bitmap).bitmapData );
...
[Embed (source=&quot;<span style="color: #8b0000">meta2.jpg</span>&quot;)]
<span style="color: #0000ff">private</span> var myTexture:Class;</pre>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb3.png" width="239" height="244" /></a> </p>
<p>or use BitmapFileMaterial:</p>
<pre>cube.material = <span style="color: #0000ff">new</span> BitmapFileMaterial(&quot;<span style="color: #8b0000">meta2.jpg</span>&quot;);</pre>
<p>Now, how to make the material looks a lit lax? clip the image or the bitmap.</p>
<pre>var b :Bitmap = <span style="color: #0000ff">new</span> myTexture <span style="color: #0000ff">as</span> Bitmap;
var bd :BitmapData = <span style="color: #0000ff">new</span> BitmapData(50,50);
bd.draw(b, <span style="color: #0000ff">null</span>, <span style="color: #0000ff">null</span>,<span style="color: #0000ff">null</span>,<span style="color: #0000ff">new</span> Rectangle(0,0,50,50));
cube.material = <span style="color: #0000ff">new</span> BitmapMaterial( bd );</pre>
<p><a href="http://sban.biz/wp-content/uploads/2010/08/image4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://sban.biz/wp-content/uploads/2010/08/image_thumb4.png" width="243" height="244" /></a> </p>
<p>source and demo download from here:</p>
<p><a title="http://sban.googlecode.com/svn/trunk/blog/away3d/CubeE.as" href="http://sban.googlecode.com/svn/trunk/blog/away3d/CubeE.as">http://sban.googlecode.com/svn/trunk/blog/away3d/CubeE.as</a></p>
<p><a title="http://sban.googlecode.com/svn/trunk/blog/away3d/CubeE.swf" href="http://sban.googlecode.com/svn/trunk/blog/away3d/CubeE.swf">http://sban.googlecode.com/svn/trunk/blog/away3d/CubeE.swf</a></p>
<p>away3d library download from here plz:</p>
<p><a title="http://away3d.com/download/away3d_3_5_0.zip" href="http://away3d.com/download/away3d_3_5_0.zip">http://away3d.com/download/away3d_3_5_0.zip</a></p>
<p><a href="http://sban.biz/">sban</a> 北京 2010/8/7</p>
]]></content:encoded>
			<wfw:commentRss>http://sban.biz/366/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->