<?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>ByteArray.org</title>
	<atom:link href="http://www.bytearray.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.bytearray.org</link>
	<description>Actionscript 3 Experiments and Flash Player news ;)</description>
	<lastBuildDate>Sat, 10 Jul 2010 16:43:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MicRecorder, a tiny microphone library [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1858</link>
		<comments>http://www.bytearray.org/?p=1858#comments</comments>
		<pubDate>Sat, 10 Jul 2010 16:16:12 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[ByteArray]]></category>
		<category><![CDATA[Flash Player]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1858</guid>
		<description><![CDATA[While working on the second chapter of "What can you do with bytes ?", I came up with a tiny helper class for developers who need to record audio easily from the microphone in their applications. Here is MicRecorder, which handles internally the ByteArray work with the Event.SAMPLE_DATA event dispatched by the Microphone object introduced [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bytearray.org/wp-content/uploads/2010/07/MicRecorder.png"></a><img class="alignleft" title="MicRecorder Library" src="http://www.bytearray.org/wp-content/uploads/2010/07/MicRecorder.png" alt="MicRecorder Library" width="179" height="53" />While working on the second chapter of <a title="What can you do with bytes ?" href="http://www.bytearray.org/?p=711" target="_blank">"What can you do with bytes ?"</a>, I came up with a tiny helper class for developers who need to record audio easily from the microphone in their applications.</p>
<p>Here is MicRecorder, which handles internally the ByteArray work with the Event.SAMPLE_DATA event dispatched by the Microphone object introduced in Flash Player 10.1 and the WAV packaging. The WAV encoder is bundled but any other encoder could be used in a near future <img src='http://www.bytearray.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Here is a little demo :</p>
<div id="flashcontent_1623589858" style="color: #800000;"> 			  A Flash animation should have appeared here, but it seems that your browser has an older version of the Flash Player or it is not installed at all. Please, install the <a href="http://www.adobe.com/go/getflashplayer" target="_blank">last release</a> of the Flash Player now, then reload this page. 			</div>
<p> 			<script type="text/javascript"> 				var so1623589858 = new SWFObject("http://bytearray.org/wp-content/projects/micrecorder/TestRecorder.swf", "movie1623589858", "320", "200", "9", "#ffffff"); 				so1623589858.addParam("menu", "false"); 				so1623589858.addParam("quality", "high"); 				so1623589858.addParam("scale", "noscale"); 				so1623589858.addParam("salign", "TL"); 				so1623589858.addParam("wmode", "opaque"); 				so1623589858.write("flashcontent_1623589858"); 			</script></p>
<p>To record audio from the Microphone in your application, just use those few lines :</p>
<pre class="brush: as3;">
// volume in the final WAV file will be downsampled to 50%
var volume:Number = .5;
// we create the WAV encoder to be used by MicRecorder
var wavEncoder:WaveEncoder = new WaveEncoder( volume );
// we create the MicRecorder object which does the job
var recorder:MicRecorder = new MicRecorder( wavEncoder );
// starts recording
recorder.record();
// stop recording
recorder.stop();
</pre>
<p>When recording starts a RecordingEvent.RECORDING event is dispatched giving infos about time. When recording it stopped an Event.COMPLETE is dispatched allowing you to retrieve the Micorder.output bytes and save the audio stream (in this case as a WAV) using a simple <a title="FileReference in Flash Player" href="http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html" target="_blank">FileReference</a> object :</p>
<pre class="brush: as3;">
recorder.addEventListener(RecordingEvent.RECORDING, onRecording);
recorder.addEventListener(Event.COMPLETE, onRecordComplete);

private function onRecording(event:RecordingEvent):void
{
     trace ( event.time );
}

private function onRecordComplete(event:Event):void
{
     fileReference.save ( recorder.output, &quot;recording.wav&quot; );
}
</pre>
<p>You can also replay what has been recorded by passing the raw WAV file to the WavSound object from the nice <a title="AS3WavSound Library" href="http://code.google.com/p/as3wavsound/" target="_blank">as3wavsound</a> library :</p>
<pre class="brush: as3;">
private function onRecordComplete(event:Event):void
{
     var player:WavSound = new WavSound(recorder.output);
     player.play();
}
</pre>
<p>The MicRecorder object relies by default on the default Microphone device available, but you can pass any Microphone instance as replacement when creating the MicRecorder object :</p>
<pre class="brush: as3;">
// a specific Microphone instance can be passed
var recorder:MicRecorder = new MicRecorder( wavEncoder, microphoneDevice );
</pre>
<p>You can download everything <a title="MicRecorder 1.0 Download" href="http://code.google.com/p/micrecorder/downloads/list" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1858</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Flash Player 3D Future session at Max 2010 [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1836</link>
		<comments>http://www.bytearray.org/?p=1836#comments</comments>
		<pubDate>Wed, 07 Jul 2010 12:46:06 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[ByteArray]]></category>
		<category><![CDATA[Discovering Actionscript 3]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flash on mobile]]></category>
		<category><![CDATA[Inside the Flash Player]]></category>
		<category><![CDATA[flash player actionscript 3d]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1836</guid>
		<description><![CDATA[If you are into 3d development for games, augmented reality or just interactive stuff like websites, you just can't miss the session entitled Flash Player 3D future scheduled for Max 2010 scheduled on October 27 at 11:00AM in room 503. Sebastian Marketsmueller (Flash Player engineer) will deep dive into the next generation 3D API coming [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bytearray.org/wp-content/uploads/2010/07/fp-3d-session.png"><img class="alignleft size-full wp-image-1837" title="Flash Player 3D Future" src="http://www.bytearray.org/wp-content/uploads/2010/07/fp-3d-session.png" alt="Flash Player 3D Future" width="457" height="489" /></a></p>
<p>If you are into 3d development for games, augmented reality or just interactive stuff like websites, you just can't miss the session entitled <em>Flash Player 3D future</em> scheduled for Max 2010 scheduled on <strong>October 27 at 11:00AM	in room 503</strong>. Sebastian Marketsmueller (Flash Player engineer) will deep dive into the next generation 3D API coming in a future version of the Flash Player.</p>
<p>Now you may wonder, what does this means, what kind of 3D are we talking about ?</p>
<p>What kind of API ? True textured z-buffered triangles ? GPU acceleration ? Even better ? What I can say is forget what you have seen before, it is going to be big <img src='http://www.bytearray.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>When this will be available ?</p>
<p>We will share plans with you at Max during this session, I tell you, some serious stuff is coming for 3D developers.</p>
<p>If you are also curious about the inner details of the Flash Player renderer, Lee Thomason (Flash Player architect) will delve into the details of the Flash Player renderer, and show how to optimize the rendering performance of your applications. Lee will cover mechanisms like the display list, text rendering, shaders, GPU hardware acceleration, and exclusive features coming in a future version of Flash Player (hehe).</p>
<p>After this session, Flash Player rendering will no longer be a mystery for you. This track called <em>Deep Dive into Flash Player Rendering</em> is scheduled on <strong>October 27 at 09:30AM in room 511A.</strong></p>
<p>I will be happy to meet you there at Max in Los Angeles and talk about our future plans and also get your feedbacks about the player around a fresh beer. I will post further details about all this in the following weeks.</p>
<p>If you haven't checked all the sessions available for Max this year check the <a title="Adobe Max 2010 Scheduler" href="http://max.adobe.com/schedule/by-session/" target="_blank">online scheduler</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1836</wfw:commentRss>
		<slash:comments>136</slash:comments>
		</item>
		<item>
		<title>Optimizing web content for Flash Player 10.1 [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1827</link>
		<comments>http://www.bytearray.org/?p=1827#comments</comments>
		<pubDate>Wed, 30 Jun 2010 16:05:53 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Discovering Actionscript 3]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Inside the Flash Player]]></category>
		<category><![CDATA[actionscript flash player 10.1 adobe android mobile]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1827</guid>
		<description><![CDATA[Last week I did an e-seminar about best practices when developing for Flash Player 10.1. The idea was to cover the new stuff in Flash Player 10.1 in terms of memory, cpu and other optimizations. For those who already saw the session called "Designing and developing for the Multiscreen web" that I did at Max [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">Last week I did an e-seminar about best practices when developing for Flash Player 10.1. The idea was to cover the new stuff in Flash Player 10.1 in terms of memory, cpu and other optimizations. For those who already saw the session called <a title="Designing and developing for the Multiscreen web" href="http://www.bytearray.org/?p=1020" target="_blank">"Designing and developing for the Multiscreen web"</a> that I did at Max '09, you will notice this session is a 2.0 version of the slides with some new and updated stuff and the designers optimizations section extended with content from the latest white paper I wrote related to <a title="Optimizing Flash Ads" href="http://www.bytearray.org/?p=1586" target="_blank">Flash ads</a>. I also had the time here to go into some details I could not cover in the past, cause this session is a re-recorded session from the Adobe e-seminar, so no "running out of time" issue.</div>
<p>This session sums up the two white papers I wrote lately on this topic. So if you did not read the papers or just want to share that with colleagues who did not want to read all that, this can be a good solution <img src='http://www.bytearray.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="800" height="500" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=12974053&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=e81010&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="800" height="500" src="http://vimeo.com/moogaloop.swf?clip_id=12974053&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=e81010&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/12974053">Best Practices in optimizing content for Flash Player 10.1</a> from <a href="http://vimeo.com/user1872626">Thibault Imbert</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1827</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Optimizing Flash Ads and some XFL Gourmet [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1800</link>
		<comments>http://www.bytearray.org/?p=1800#comments</comments>
		<pubDate>Mon, 07 Jun 2010 08:37:54 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Inside the Flash Player]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1800</guid>
		<description><![CDATA[I recently blogged about the Ads optimization topic. I finished writing a little whitepaper on this, covering mainly graphical optimizations with topics like shapes optimizations, framerate, the usage of video, filters and other graphical effects. The paper is mainly targeting designers and interactive designers rather than developers, which was more the audience of the previous [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="XFL-Gourmet" src="http://www.bytearray.org/wp-content/uploads/2010/06/chef.png" alt="XFL-Gourmet" width="149" height="281" />I recently <a title="Optimizing Flash Ads" href="http://www.bytearray.org/?p=1586" target="_blank">blogged</a> about the Ads optimization topic. I finished writing a little whitepaper on this, covering mainly graphical optimizations with topics like shapes optimizations, framerate, the usage of video, filters and other graphical effects. The paper is mainly targeting designers and interactive designers rather than developers, which was more the audience of the <a title="Optimizing Performance for the Adobe Flash Platform" href="http://www.bytearray.org/?p=1363" target="_blank">previous whitepaper</a> about general optimizations but mainly code oriented. However, this paper contains a little ActionScript section limited to the kind of code we may need in Ads.</p>
<p><strong>You can download the paper </strong><a title="Optimizing Flash Ads" href="http://www.bytearray.org/?p=1586" target="_blank"><strong>here</strong></a><strong> (bottom of the post). Or direct link <a title="Optimizing Flash Ads" href="http://www.bytearray.org/wp-content/projects/ads-optimizations/Ads%20Optimizations%20-%20v1.pdf" target="_self">here</a></strong><strong>.</strong><br />
If you guys can review it that would be great, if you find some errors, any topic por example to be added or changed.</p>
<p>By working on this whitepaper I thought it could be funny using the new XFL file format introduced in Flash Pro to actually audit Flash projects and highlight bad graphical practices. I started a little native tool called "XFL Gourmet" which does that for you, you just pass it an XFL project, it will parse it and output the result. Of course this is pretty raw for the moment, but with this XFL format, anything can be detected, even a non-optimized vector shape could be detected.</p>
<p>Here is a snapshot of the output on a project using a lof of bad things, like transformed and animated bitmap caching/filters or blend modes :</p>
<p><img class="alignnone" title="XFL-Gourmet Output" src="http://www.bytearray.org/wp-content/uploads/2010/06/xfl-gourmet1.png" alt="XFL-Gourmet Output" width="657" height="760" /></p>
<p>I will keep working on it and make it available with the source code so that you guys can modify it and code your own rules.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1800</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Profiling Flash Player Rendering [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1714</link>
		<comments>http://www.bytearray.org/?p=1714#comments</comments>
		<pubDate>Thu, 27 May 2010 07:59:12 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Inside the Flash Player]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1714</guid>
		<description><![CDATA[When developing Flash content, profiling the VM or custom code called can be done through the profiler bundled in Flash Builder or through the Flash Player configuration file (mm.cfg). Those give you low level details about the VM but does not give you an overview of what is happening behind the scenes concerning the rendering [...]]]></description>
			<content:encoded><![CDATA[<p>When developing Flash content, profiling the VM or custom code called can be done through the profiler bundled in Flash Builder or through the Flash Player configuration file (<a title="Flash Player mms.cfg" href="http://jpauclair.net/2010/02/10/mmcfg-treasure/" target="_blank">mm.cfg</a>). Those give you low level details about the VM but does not give you an overview of what is happening behind the scenes concerning the rendering steps for instance. In the team, we are thinking about a way to give you some more details concerning the rendering engine.</p>
<p>What is <strong>really</strong> being called ? And the time it took for it.</p>
<p>This would allow us to provide you a rendering profiler perfect for fine tuning. It could generate a heat map of the rendering operations to see which operation internally is costing too much CPU cycles. A perfect way to detect also some side-effects which were not supposed to be there but where finally injected through the development of the application. A filter, some nested bitmap caching, or some blend mode or even a transparent bitmap used where it should not.</p>
<p>To get those infos you can use <a title="Shark" href="http://developer.apple.com/tools/sharkoptimize.html" target="_blank">Shark</a> on MacOS or <a title="VTune" href="http://software.intel.com/en-us/intel-vtune/" target="_blank">VTune</a> on Windows and Linux. The idea is simple, you run it, start collecting samples and start your SWF.  Once you are done, you stop collecting and it gives you an output. Without the Flash Player with the debug symbols you will not see anything relevant, just symbol adresses but nothing humanly readable. Like the following image :</p>
<p><img class="alignnone size-full wp-image-1744" title="No Debug Symbols" src="http://www.bytearray.org/wp-content/uploads/2010/05/no-symbols.png" alt="No Debug Symbols" width="938" height="83" /></p>
<p>You can already see that some processes are costing more time than others. With the debug symbols (included to a special version of the debugging player), you can see all the internals. So let's say I use a BitmapData object to paint pixels in my application. The following output, shows me clearly that almost 18% of the processing time was taken by the BitmapData.setPixel32 which calls internally the AddDirtyRect API from SurfaceImage and the internal core BitmapDataObject class and its setPixel32 API :</p>
<p><img class="alignnone size-full wp-image-1763" title="BitmapData.setPixel" src="http://www.bytearray.org/wp-content/uploads/2010/05/set-pixels2.png" alt="BitmapData.setPixel" width="947" height="51" /></p>
<p>By the way, you can see that the AVM spend some time leveraging SSE2 instructions through the <a title="AVMCore class" href="http://hg.mozilla.org/tamarin-tracing/file/3f98dcd4a920/core/AvmCore.cpp" target="_blank">AVMCore</a> class. Same thing, let's say you have to audit a SWF to see if some bad practices are used there. In the following SWF, we see a PixelBlitThread which is the API used for bitmap caching, so there is a lot of chances that you would take a look at the code of this SWF to see if the bitmap caching is used properly and if memory is ok :</p>
<p><img class="alignnone size-full wp-image-1751" title="Bitmap Caching" src="http://www.bytearray.org/wp-content/uploads/2010/05/bitmap-caching.png" alt="Bitmap Caching" width="933" height="50" /></p>
<p>Pure jewel for advanced optimizations. We are thinking about approaches to make this available (not in this raw-technical format) to every Flash developer. Do not hesitate to share ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1714</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>SID LEE says welcome [by Didier Brun]</title>
		<link>http://www.bytearray.org/?p=1724</link>
		<comments>http://www.bytearray.org/?p=1724#comments</comments>
		<pubDate>Tue, 25 May 2010 11:20:08 +0000</pubDate>
		<dc:creator>Didier Brun</dc:creator>
				<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1724</guid>
		<description><![CDATA[Hello dear readers, I'm very proud to announce that I will join the SID LEE team in few weeks as an Head of Creative Technology (Europe). For those who don't now SID LEE , you can visit www.sidlee.com. I will be based at SID LEE Paris and will work closely with the others international offices [...]]]></description>
			<content:encoded><![CDATA[<p>Hello dear readers,</p>
<p>I'm very proud to announce that I will join the SID LEE team in few weeks as an Head of Creative Technology (Europe). For those who don't now SID LEE , you can visit <a title="www.sidlee.com" href="http://www.sidlee.com">www.sidlee.com</a>.</p>
<p><a href="http://www.sidlee.com"><img title="SID LEE" src="http://www.didierbrun.com/images/sidlee.png" alt="" width="400" height="232" /></a></p>
<p>I will be based at SID LEE Paris and will work closely with the others international offices : Montreal &amp; Amsterdam.</p>
<p>With new mobiles, touch devices, GPS, and all the innovations to come, the digital playground become more &amp; more amazing and I'm very happy to play now with SID LEE artisans.</p>
<p>SID LEE is very invested &amp; open-minded about sponsoring R&amp;D / innovation, so, I will continue to post &amp; share some open source cool shit on bytearray <img src='http://www.bytearray.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Stay tuned.</p>
<p>Didier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1724</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>ByteArray Access to NetStream in Flash Player 10.1 [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1689</link>
		<comments>http://www.bytearray.org/?p=1689#comments</comments>
		<pubDate>Wed, 12 May 2010 07:44:57 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[ByteArray]]></category>
		<category><![CDATA[Flash Player]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1689</guid>
		<description><![CDATA[There are moments like this, when you read the documentation of the Flash Player and you discover and nice new API that you have been waiting for such a long time. Do you see what I mean ? Yes, you read it right, ByteArray access to NetStream class is coming and it works beautifully in [...]]]></description>
			<content:encoded><![CDATA[<p>There are moments like this, when you read the documentation of the Flash Player and you discover and nice new API that you have been waiting for such a long time. Do you see what I mean ? Yes, you read it right, ByteArray access to NetStream class is coming and it works beautifully in Flash Player 10.1. As many of you, I was also <a title="ByteArray access to NetStream" href="http://bugs.adobe.com/jira/browse/FP-5" target="_blank">waiting</a> for this API when working on my <a title="FLVSlicer" href="http://www.bytearray.org/?p=955" target="_blank">FLV editing library</a> and this day has come.</p>
<p>The API is called <a title="NetStream.appendBytes()" href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/net/NetStream.html#appendBytes%28%29" target="_blank">appendBytes</a> on the NetStream class used in conjunction with the <a title="NetStreamAppendBytesAction" href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/net/NetStreamAppendBytesAction.html" target="_blank">NetStreamAppendBytesAction</a> class. It allows you to inject a ByteArray to the NetStream object and play the video. This API was designed originally for HTTP streaming, allowing forward seeking into HTTP delivered-video, but if you just load a ByteArray locally  through the FileReference API, voilà, you got local preview of video files without server round trip. If you read the <a title="appendBytes Documentation" href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/net/NetStream.html#appendBytes%28%29" target="_blank">documentation</a> you'll notice that the API only works for now with FLV header-based files, but all codecs are supported (Sorenson, H.264, On2 VP6 and even AAC audio).</p>
<p>Here is a little demo which illustrates the API in the Flash Player 10.1 (make sure you are using the Flash Player 10.1 RC4 available on <a title="Flash Player 10.1" href="http://labs.adobe.com/technologies/flashplayer10/" target="_blank">labs.adobe.com</a>) :</p>
<div id="flashcontent_236252091" style="color: #800000;"> 			  A Flash animation should have appeared here, but it seems that your browser has an older version of the Flash Player or it is not installed at all. Please, install the <a href="http://www.adobe.com/go/getflashplayer" target="_blank">last release</a> of the Flash Player now, then reload this page. 			</div>
<p> 			<script type="text/javascript"> 				var so236252091 = new SWFObject("http://www.bytearray.org/wp-content/projects/appendBytes/TestAppend.swf", "movie236252091", "400", "400", "9", "#ffffff"); 				so236252091.addParam("menu", "false"); 				so236252091.addParam("quality", "high"); 				so236252091.addParam("scale", "noscale"); 				so236252091.addParam("salign", "TL"); 				so236252091.addParam("wmode", "opaque"); 				so236252091.write("flashcontent_236252091"); 			</script></p>
<p>The API is really simple :</p>
<pre class="brush: as3;">// retrieve the FLV stream
var bytes:ByteArray = event.currentTarget.data;
// put the NetStream class into Data Generation mode
netstream.play(null);
// before appending new bytes, reset the position to the beginning
netstream.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
// append the FLV video bytes
netstream.appendBytes(bytes);
</pre>
<p>This will allow new kind of apps and remove one more limitation that we had in the past <img src='http://www.bytearray.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1689</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Optimizing Flash Ads [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1586</link>
		<comments>http://www.bytearray.org/?p=1586#comments</comments>
		<pubDate>Tue, 20 Apr 2010 06:50:51 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Books & Articles]]></category>
		<category><![CDATA[Flash Player]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1586</guid>
		<description><![CDATA[I am working on a new document on Flash Ads performance, the idea of this document is to focus on graphical optimizations, cause ActionScript is rarely (sometimes it is) in fault in ads, and mainly created by designers. Flash ads talks to anyone, we all see them when browsing different websites, some of them are [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1598" title="Optimizing Flash Ads" src="http://www.bytearray.org/wp-content/uploads/2010/04/front-opt-ads1.jpg" alt="Optimizing Flash Ads" width="250" height="354" /> I am working on a new document on Flash Ads performance, the idea of this document is to focus on graphical optimizations, cause ActionScript is rarely (sometimes it is) in fault in ads, and mainly created by designers. Flash ads talks to anyone, we all see them when browsing different websites, some of them are creative, some of them are not, some of them are optimized and some of them are not.</p>
<p>So what do I mean by saying optimized ?</p>
<p>As you can imagine, it is mainly related to CPU usage and memory, and how simple ads can sometimes require more CPU cycles than they should. So, I decided to browse the web for a day and gathered as much ads as possible, I had a large choice, and I decided to save different kind of ads, made of video, bitmaps, manually or programmatically animated. Let's just put this out there, the intention of this post is not to criticize people producing ads but better understand what kind of pitfalls designers and developers tend to fall into when producing ads and why. More than that, I am sure that most of these bad practices could be adressed by the tools by giving more feedback on how to produce optimized content.</p>
<p>First thing people tend to forget is how a shape can be simplified through tools like the <em>Simplify</em> tool in Adobe Illustrator or just through the <em>Smooth</em> tool in Flash Pro. A lot of control points can be removed from paths and dramatically reduce the size of the final SWF and improve rendering performance. Another issue, in order to bypass the size limitations and the usage of bitmaps, designers use dynamic filters for any effect they need. As you know it, filters are not CPU-friendly when overused, especially when nested and with attributes changing over frames. Each frame the filter has to be recalculated and this can slow down rendering performance and require extra CPU cycles. Same for transparency effects which can be avoided or truly removed by using opaque DisplayObjects (opaqueBackground).</p>
<p>Whatever coding environnement you use, assets may still be created inside of Flash, exported to SWC or SWF and then linked inside your project. For ads, most of the work is done in Flash Pro only, cause code used is not complex and can fit on the timeline only.</p>
<p>I am wondering what kind of things could be added to Flash Pro for for instance, to help designers and even developers to produce optimized assets in general.</p>
<p>Here are some features I thought about :</p>
<ul>
<li>Show Redraw Regions<em><img class="alignright size-full wp-image-1647" title="Shapes Simplified" src="http://www.bytearray.org/wp-content/uploads/2010/04/shapes-simplify1.jpg" alt="" width="300" height="248" /></em></li>
</ul>
<p><em>This should be enabled by default in the IDE (when playing animations on the Stage) and animators, designers, developers, would better understand what is wrong and costing CPU cycles for nothing. Ex : DisplayObjects hidden by others and still being renderered and not deactivated.<br />
</em></p>
<ul>
<li>Expose the opaqueBackground feature in Flash Pro IDE just like cache as bitmap.</li>
</ul>
<p><em>Sometimes transparency is not required, and designers could disable it by assigning a background color to any DisplayObject. This would make it easier for the Flash Player.<br />
</em></p>
<ul>
<li>Native Bitmap Rasterization</li>
</ul>
<p><em>You select a MovieClip and rasterize each frame as a bitmap, produce bigger SWF's in some cases, but blazing fast in terms of rendering. This could be performed at runtime by the player too, but a first step woul</em><em>d be doing it at authortime.<br />
</em></p>
<ul>
<li>Graphical effects presets for publishing</li>
</ul>
<p><em>I create and save a publishing profile for Nike and I say, disable all the filters, the transparency effects and instantly see performance differences by checking and unchecking effects between different publishing.</em></p>
<ul>
<li>History Panel 2.0</li>
</ul>
<p><em>The History panel in Flash CS5 would be enhanced by showing more than the size and time history but also average framerate, CPU and memory usage.</em><em><img class="alignright size-full wp-image-1651" title="Filtered Pig" src="http://www.bytearray.org/wp-content/uploads/2010/04/filtered-pig.png" alt="Filtered Pig" width="277" height="276" /></em></p>
<ul>
<li>Optimization Perspective and size limit</li>
</ul>
<p><em>The tool could have an optimization perspective, which would audit your graphics and let you know about potential graphics optimizations to reach a specific framerate and size, with text rendering, fonts, control points reduction, etc.). </em><em>It would allow you to specify a size limit and the tool would generate a report by saying you can compress that bitmap more, you can use device fonts here, etc.</em></p>
<ul>
<li>Having a "Warning Mode" for graphics.</li>
</ul>
<p><em>The tool shows you a heat map of the graphics in your app, showing where rendering time is spent. Warn about what is costing a lot in memory and CPU</em><em> like nested filters, animated filters, bad usage of cacheAsBitmap, non-simplified shapes, etc. This should be pretty cool in the profiler for Flash Builder too.</em></p>
<p>For the Flash Player, maybe an HTML tag (stricter than the <em>hasPriority</em> tag in Flash Player 10.1) which would restrict the SWF being played to consume a specific amount of memory and CPU, otherwise throttle down the SWF. Another solution would be automatically removing specific effects when the framerate and performance is critical ? Is that something you would prefer ?</p>
<p>Let me know if you think any topic should be covered in the whitepaper, I would be happy sharing your ideas about all that.</p>
<p><strong>Download the whitepaper <a title="Optimizing Flash Ads" href="http://www.bytearray.org/wp-content/projects/ads-optimizations/Ads%20Optimizations%20-%20v1.pdf" target="_blank">here</a></strong><strong>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1586</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>What can you do with bytes ? &#8211; The first bits [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1510</link>
		<comments>http://www.bytearray.org/?p=1510#comments</comments>
		<pubDate>Fri, 09 Apr 2010 12:15:39 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Books & Articles]]></category>
		<category><![CDATA[ByteArray]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1510</guid>
		<description><![CDATA[A year ago, I announced I would be working on a new open-source book called "What can you do with bytes?" distributed as a PDF (Note that the O'Reilly style cover on the left is just pure imagination and created to illustrate the PDF, no printed version planned). With some delay, due to many projects [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1547" title="What can you do with bytes ?" src="http://www.bytearray.org/wp-content/uploads/2010/03/wcydwb-cover.jpg" alt="What can you do with bytes ?" width="220" height="264" />A year ago, I announced I would be working on a new open-source book called <a title="What can you do with bytes ?" href="../?p=711" target="_blank">"What can you do with bytes?"</a> distributed as a PDF (Note that the O'Reilly style cover on the left is just pure imagination and created to illustrate the PDF, no printed version planned).</p>
<p>With some delay, due to many projects lately, here is the first chapter covering the basics of binary data in Flash. This first chapter covers all you need to know to get started, from the roots of binary to counting and thinking in binary with bitwise operators in ActionScript 3 and your first steps with the ByteArray class. Each concept is illustrated with real world examples so that you can really see and understand its usage. Those who read <a title="Pratique d'ActionScript 3" href="http://pratiqueactionscript3.bytearray.org/?page_id=4" target="_blank">"Pratique d'ActionScript 3"</a> will recognize some parts of the ByteArray chapter. I completely refactored it, translated it and included more technical details.</p>
<p>This chapter illustrates that the <a title="ByteArray API in AS3" href="http://livedocs.adobe.com/flex/3/langref/flash/utils/ByteArray.html" target="_blank">ByteArray</a> class can be used everyday even for simple stuff you did not imagine. I will post each chapter when they are available on the book page <a title="What can you do with bytes ?" href="../?p=711" target="_blank">here</a>. Grab this first one and let me know if you have any comments (errata or stuff you'd to like to add).</p>
<p>I am starting now the second chapter entitled <em>"Everyday bytes"</em> focused on using binary stuff on everyday life as an ActionScript 3 developer, from handling binary stream (XML, fonts, etc.) to RSL and runtime compression. This chapter should cover also the great <a title="AS3SWF" href="http://wiki.github.com/claus/as3swf/" target="_blank">AS3SWF</a> and <a title="FZip" href="http://codeazur.com.br/lab/fzip/" target="_blank">FZip</a> projects from <a title="Claus Wahlers" href="http://codeazur.com.br/lab/" target="_blank">Claus</a> and other funky byte-oriented libraries like <a title="AlivePDF" href="http://alivepdf.bytearray.org" target="_blank">AlivePDF</a>, or <a title="FLVSlicer" href="http://www.bytearray.org/?p=955" target="_blank">FLVSlicer</a> and more.</p>
<p><a title="What can you do with bytes ? - Download" href="http://www.bytearray.org/?p=711" target="_blank">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1510</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>New position at Adobe [ by Thibault Imbert ]</title>
		<link>http://www.bytearray.org/?p=1321</link>
		<comments>http://www.bytearray.org/?p=1321#comments</comments>
		<pubDate>Thu, 25 Feb 2010 14:05:23 +0000</pubDate>
		<dc:creator>Thibault Imbert</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash Player]]></category>

		<guid isPermaLink="false">http://www.bytearray.org/?p=1321</guid>
		<description><![CDATA[I am very happy to announce that I will be joining the Flash Player team as a product manager in the following months. I will be joining an exciting team in San Francisco and I will be reporting to Emmy Huang that you guys may know. Working in the Flash Player team has always been [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1356" title="Flash Bag!" src="http://www.bytearray.org/wp-content/uploads/2010/02/flash-bag.png" alt="Flash Bag!" width="200" height="214" />I am very happy to announce that I will be joining the Flash Player team as a product manager in the following months. I will be joining an exciting team in San Francisco and I will be reporting to <a title="Emmy Huang's blog" href="http://blogs.adobe.com/emmy/" target="_blank">Emmy Huang</a> that you guys may know. Working in the Flash Player team has always been like a dream for me, I feel like crazy right now ready to work hard on the future of the Flash Player. I got everything ready, my pens, rubber and ruler and a lot of ideas, from a language perspective but also in terms of Flash Player APIs.</p>
<p>As I was saying during my interviews, Flash Player is a lot more than a simple video player, you can have 4 people using the Flash Player differently, from cartoons, to games, to websites (with video streaming) with ActionScript on top of it to make all that interactive to pure ActionScript projects without any external asset. This is what we saw again at the <a title="Flash In the Can 2010" href="http://www.fitc.ca" target="_blank">FITC</a> this week in Amsterdam. So many people, using the same technology but differently. <a title="Erik Natzke" href="http://jot.eriknatzke.com/" target="_blank">Erik Natzke</a> will create amazing interactive design experiences and paintings, <a title="Chris Georgenes" href="http://www.keyframer.com/index.php/2009/12/11/grotto/" target="_blank">Chris Georgenes</a> will animate a cute little monster in a cartoon, and advanced ActionScript coders will do crazy frameworks, work on CPU emulation or <a title="Hobnox Audiotool" href="http://www.hobnox.com/audiotool.1046.de.html" target="_blank">runtime audio tools</a> or even complex data vizualisation applications for bank companies. To me, this is the power of the Flash technology, it talks to anyone, from design to code. I even met a team this year using Flash Professionnal, who did not even know what was a SWF, they were using the tool to animate and then export high definition PNG's to target HD TV's for broadcasting. The day after, I could meet a team who did not even know what was Flash Professional, and thought that Flash was just the Flash Player.</p>
<p>Oh there is a tool called Flash Pro ? Wow, did not know that <img src='http://www.bytearray.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>More generally, I also want the Flash Player to perform beautifully everywhere, and we are already stepping into this (See <a title="Tinic's Blog" href="http://www.kaourantin.net/2010/02/core-animation.html" target="_blank">Tinic's post</a> related to CoreAnimation). So many things come into my mind when I think about new stuff or improvements for an animator, an interactive designer or an ActionScript developer. I look forward to work with this incredible team and help driving the future of the Flash Player. Damn, I am excited! <img src='http://www.bytearray.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytearray.org/?feed=rss2&amp;p=1321</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
	</channel>
</rss>
