<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Deconstruction and reconstruction of a ByteArray</title>
	<atom:link href="http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/</link>
	<description></description>
	<lastBuildDate>Tue, 23 Feb 2010 03:58:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Adam</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2524</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 18 Feb 2009 16:44:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2524</guid>
		<description>Got it working: http://pastebin.sekati.com/?id=Anonymous@b5981-d3bbb812-t&amp;start=0

just add a video to the stage (name it vid) and play a netstream file (or live!) and add a movieclip next to it (name it mc2)

create some kind of interval sequence to trigger the myFunction function and thats that. 

once you see it works swap out myLoad function call for a localconnection call. take the myLoad function and put it in the target localconnection file.

Thanks again for this the possibilities are endless.</description>
		<content:encoded><![CDATA[<p>Got it working: <a href="http://pastebin.sekati.com/?id=Anonymous@b5981-d3bbb812-t&amp;start=0" rel="nofollow">http://pastebin.sekati.com/?id=Anonymous@b5981-d3bbb812-t&amp;start=0</a></p>
<p>just add a video to the stage (name it vid) and play a netstream file (or live!) and add a movieclip next to it (name it mc2)</p>
<p>create some kind of interval sequence to trigger the myFunction function and thats that. </p>
<p>once you see it works swap out myLoad function call for a localconnection call. take the myLoad function and put it in the target localconnection file.</p>
<p>Thanks again for this the possibilities are endless.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2523</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 18 Feb 2009 15:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2523</guid>
		<description>sorry sorry sorry... previous code was missing something. updated here: http://pastebin.sekati.com/?id=Anonymous@ad361-d3bbb812-t</description>
		<content:encoded><![CDATA[<p>sorry sorry sorry&#8230; previous code was missing something. updated here: <a href="http://pastebin.sekati.com/?id=Anonymous@ad361-d3bbb812-t" rel="nofollow">http://pastebin.sekati.com/?id=Anonymous@ad361-d3bbb812-t</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2522</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 18 Feb 2009 10:45:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2522</guid>
		<description>Whoops, looks like something happened to the function text when i posed. I put the code in a pastebin here: http://flash.pastebin.ca/1340937</description>
		<content:encoded><![CDATA[<p>Whoops, looks like something happened to the function text when i posed. I put the code in a pastebin here: <a href="http://flash.pastebin.ca/1340937" rel="nofollow">http://flash.pastebin.ca/1340937</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2521</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 18 Feb 2009 10:38:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2521</guid>
		<description>Hi Dennis thank you for this example I was very excited to see that I can send images over netconnection, Ive waited a long time for this. I created a mock up example that in this case doesnt use netconnection just to keep it simple and quicker for testing (though I did setup netconnection and it works, but having same issue with it too).

What i am attempting to do is to take an animation or in this case video and instead of
of sending only one image, to send a series of images. in this scenraio I take a 
snapshot of a netstream every few seconds and send to another function in teh same fla
another function where the pieces are put back together, turned back into a bitmap
and then display it in a movieclip next to the video object on the stage. i am able 
to do this with one frame successfully, however everytime another snapshot is taken, 
instead of it being the current image played in the video, somehow, it is the same image 
as the first snapshot. The problem escapes me. Any help would be greatly appreaciated.

on the stage i have a video playing a netstream named vid and the target movieclip named mc2
positioned right next to it, and a button i click which triggers the myFunction function.



var w=214;
var h=214;
function myFunction():void {
	var bmpData=new BitmapData(w,h,true);
	bmpData.draw(vid);
	var bytes:ByteArray=bmpData.getPixels(new Rectangle(0,0,w,h));
	var tempByteArray:ByteArray;
	var byteLimit:uint=uint(40000);
	if (bytes.length&gt;byteLimit) {
		var currentSize:uint=byteLimit;
		var position:uint=0;
		var totalSize:uint=0;
		while (totalSize byteLimit) {
				currentSize=byteLimit;
			}
		}
	}
}
function myLoad(bytes,bytesLength,w,h) {
	var byteArray:ByteArray=bytes as ByteArray;
	byteArraySnapShot = new ByteArray();
	byteArraySnapShot.length=bytesLength;
	byteArraySnapShot.position=0;
	byteArraySnapShot.writeBytes(byteArray);
	if (byteArraySnapShot.bytesAvailable==0) {
		var bitmapDataSnapShot:BitmapData=new BitmapData(w,h);
		byteArraySnapShot.position=0;
		bitmapDataSnapShot.setPixels(new Rectangle(0, 0, w, h),byteArraySnapShot);
		var bitmapSnapShot:Bitmap=new Bitmap(bitmapDataSnapShot);
		var snapShotImg=bitmapSnapShot;
		mc2.addChild(bitmapSnapShot);
	}
}</description>
		<content:encoded><![CDATA[<p>Hi Dennis thank you for this example I was very excited to see that I can send images over netconnection, Ive waited a long time for this. I created a mock up example that in this case doesnt use netconnection just to keep it simple and quicker for testing (though I did setup netconnection and it works, but having same issue with it too).</p>
<p>What i am attempting to do is to take an animation or in this case video and instead of<br />
of sending only one image, to send a series of images. in this scenraio I take a<br />
snapshot of a netstream every few seconds and send to another function in teh same fla<br />
another function where the pieces are put back together, turned back into a bitmap<br />
and then display it in a movieclip next to the video object on the stage. i am able<br />
to do this with one frame successfully, however everytime another snapshot is taken,<br />
instead of it being the current image played in the video, somehow, it is the same image<br />
as the first snapshot. The problem escapes me. Any help would be greatly appreaciated.</p>
<p>on the stage i have a video playing a netstream named vid and the target movieclip named mc2<br />
positioned right next to it, and a button i click which triggers the myFunction function.</p>
<p>var w=214;<br />
var h=214;<br />
function myFunction():void {<br />
	var bmpData=new BitmapData(w,h,true);<br />
	bmpData.draw(vid);<br />
	var bytes:ByteArray=bmpData.getPixels(new Rectangle(0,0,w,h));<br />
	var tempByteArray:ByteArray;<br />
	var byteLimit:uint=uint(40000);<br />
	if (bytes.length&gt;byteLimit) {<br />
		var currentSize:uint=byteLimit;<br />
		var position:uint=0;<br />
		var totalSize:uint=0;<br />
		while (totalSize byteLimit) {<br />
				currentSize=byteLimit;<br />
			}<br />
		}<br />
	}<br />
}<br />
function myLoad(bytes,bytesLength,w,h) {<br />
	var byteArray:ByteArray=bytes as ByteArray;<br />
	byteArraySnapShot = new ByteArray();<br />
	byteArraySnapShot.length=bytesLength;<br />
	byteArraySnapShot.position=0;<br />
	byteArraySnapShot.writeBytes(byteArray);<br />
	if (byteArraySnapShot.bytesAvailable==0) {<br />
		var bitmapDataSnapShot:BitmapData=new BitmapData(w,h);<br />
		byteArraySnapShot.position=0;<br />
		bitmapDataSnapShot.setPixels(new Rectangle(0, 0, w, h),byteArraySnapShot);<br />
		var bitmapSnapShot:Bitmap=new Bitmap(bitmapDataSnapShot);<br />
		var snapShotImg=bitmapSnapShot;<br />
		mc2.addChild(bitmapSnapShot);<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Avi Ku</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2517</link>
		<dc:creator>Avi Ku</dc:creator>
		<pubDate>Thu, 12 Feb 2009 16:53:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2517</guid>
		<description>Dennis thanks.
Is there a working copy of this</description>
		<content:encoded><![CDATA[<p>Dennis thanks.<br />
Is there a working copy of this</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Ahn</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2491</link>
		<dc:creator>Sam Ahn</dc:creator>
		<pubDate>Sun, 14 Dec 2008 16:50:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2491</guid>
		<description>When I gave Dennis this task, I did try using SO&#039;s for a little bit. It&#039;s been a while so I&#039;m shooting from the hip, but I remember when I was looking into detecting changes in an SO property it just didn&#039;t feel right. I think it is possible, but you might have to continually check for changes to the property manually which means continualy reading the SO. If there is an elegant solution to using SO&#039;s that&#039;d be good particularly for very large data. Otherwise Dennis&#039; solution works great ... I like how it feels lke asynchronous file i/o. If you couldn&#039;t tell, I&#039;m all about feelings.</description>
		<content:encoded><![CDATA[<p>When I gave Dennis this task, I did try using SO&#8217;s for a little bit. It&#8217;s been a while so I&#8217;m shooting from the hip, but I remember when I was looking into detecting changes in an SO property it just didn&#8217;t feel right. I think it is possible, but you might have to continually check for changes to the property manually which means continualy reading the SO. If there is an elegant solution to using SO&#8217;s that&#8217;d be good particularly for very large data. Otherwise Dennis&#8217; solution works great &#8230; I like how it feels lke asynchronous file i/o. If you couldn&#8217;t tell, I&#8217;m all about feelings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2486</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Thu, 11 Dec 2008 20:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2486</guid>
		<description>what are the security/domain limitations of a local shared object? i thought that there may be some restriction?

I had to send bitmapdata from an as2 module to an as3 app and hit the 40k limit let alone the headache that the AV1Movie &#039;black box&#039; class causes (i&#039;m actually glad as2 gets almost zero access to as3)... 

in the end i decided to move the bitmap editing logic from a hidious as2 module into my app and spent the whole night refactoring sloppy code...

@GMalartre: i am going to try out the shared object hack and see if i can actually build an api around it... it&#039;s bound to come in handy one of these days...

@Dennis i really like what you did with that bytearray... certainly something to consider using...

(you might find this funny... that nasty as2 module had a whopping 938 lines of procedural script in a single frame, i almost lost my mind...)</description>
		<content:encoded><![CDATA[<p>what are the security/domain limitations of a local shared object? i thought that there may be some restriction?</p>
<p>I had to send bitmapdata from an as2 module to an as3 app and hit the 40k limit let alone the headache that the AV1Movie &#8216;black box&#8217; class causes (i&#8217;m actually glad as2 gets almost zero access to as3)&#8230; </p>
<p>in the end i decided to move the bitmap editing logic from a hidious as2 module into my app and spent the whole night refactoring sloppy code&#8230;</p>
<p>@GMalartre: i am going to try out the shared object hack and see if i can actually build an api around it&#8230; it&#8217;s bound to come in handy one of these days&#8230;</p>
<p>@Dennis i really like what you did with that bytearray&#8230; certainly something to consider using&#8230;</p>
<p>(you might find this funny&#8230; that nasty as2 module had a whopping 938 lines of procedural script in a single frame, i almost lost my mind&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GMalartre</title>
		<link>http://www.themorphicgroup.com/blog/2008/12/02/deconstruction-and-reconstruction-of-a-bytearray/comment-page-1/#comment-2477</link>
		<dc:creator>GMalartre</dc:creator>
		<pubDate>Wed, 03 Dec 2008 03:04:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.themorphicgroup.com/blog/?p=59#comment-2477</guid>
		<description>Another possible way :

You could store the data in a LocalSharedObject without splitting it and listen for a change in the other applications.

Of course it mean some different handling, but in my case the LocalSharedObject is already a prerequist.</description>
		<content:encoded><![CDATA[<p>Another possible way :</p>
<p>You could store the data in a LocalSharedObject without splitting it and listen for a change in the other applications.</p>
<p>Of course it mean some different handling, but in my case the LocalSharedObject is already a prerequist.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
