<?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"
	>
<channel>
	<title>Comments for Dan Schultz, Intrigue Media</title>
	<atom:link href="http://www.intriguemedia.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.intriguemedia.net</link>
	<description>All things Flex, AIR, Application Architecture and Cayri from Dan Schultz</description>
	<pubDate>Wed, 20 Aug 2008 22:47:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>Comment on When to Use Weak References by Dan Schultz</title>
		<link>http://www.intriguemedia.net/2007/09/24/when-to-use-weak-references/#comment-294</link>
		<dc:creator>Dan Schultz</dc:creator>
		<pubDate>Thu, 07 Aug 2008 21:44:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/?p=28#comment-294</guid>
		<description>@Jdog, when working with compositions of objects, such as display objects.  I usually follow a principle of the parent always managing its children.  In the example you provided, the parent would call dispose() on any objects that it contains.  When the dispose() method is called on the children, the children would then call dispose() on any of its children, and so on.

For Mixbook.com, I have a Page class which manages an array of text and image items.  When a user deletes an image item, the page component calls ImageItem.dispose().  Inside here, I clean up any listeners to the system manager, and explicitly dispose of the BitmapData that the item is using – which frees the memory of the bitmap immediately, instead of waiting till the next garbage sweep.

Another example of dispose(), is the LoadManager class that is used throughout Mixbook.com.  This class essentially controls anything from preloading images, to loading stylesheets and fonts – where each type of loadable item has its own class.  Based upon where the user is in the book, requests to load items are being either added or removed from the LoadManager class.  When a load item is removed from the LoadManager, the LoadManager calls dispose() on the item, which cleans up any resources its using.  Such as calling Loader.close().

So the dispose() method simply acts as an interface that the parent can use to say to its children, "Hey, I know the life of this object is finished, clean up any references/resources it's using."</description>
		<content:encoded><![CDATA[<p>@Jdog, when working with compositions of objects, such as display objects.  I usually follow a principle of the parent always managing its children.  In the example you provided, the parent would call dispose() on any objects that it contains.  When the dispose() method is called on the children, the children would then call dispose() on any of its children, and so on.</p>
<p>For Mixbook.com, I have a Page class which manages an array of text and image items.  When a user deletes an image item, the page component calls ImageItem.dispose().  Inside here, I clean up any listeners to the system manager, and explicitly dispose of the BitmapData that the item is using – which frees the memory of the bitmap immediately, instead of waiting till the next garbage sweep.</p>
<p>Another example of dispose(), is the LoadManager class that is used throughout Mixbook.com.  This class essentially controls anything from preloading images, to loading stylesheets and fonts – where each type of loadable item has its own class.  Based upon where the user is in the book, requests to load items are being either added or removed from the LoadManager class.  When a load item is removed from the LoadManager, the LoadManager calls dispose() on the item, which cleans up any resources its using.  Such as calling Loader.close().</p>
<p>So the dispose() method simply acts as an interface that the parent can use to say to its children, &#8220;Hey, I know the life of this object is finished, clean up any references/resources it&#8217;s using.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on When to Use Weak References by Jdog</title>
		<link>http://www.intriguemedia.net/2007/09/24/when-to-use-weak-references/#comment-293</link>
		<dc:creator>Jdog</dc:creator>
		<pubDate>Thu, 07 Aug 2008 20:09:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/?p=28#comment-293</guid>
		<description>Do you have an example of IDisposable? How or when do you call the Dispose() function? What if your component is nested and you only want to call it when the nested components parents,parent is removed from the stage?</description>
		<content:encoded><![CDATA[<p>Do you have an example of IDisposable? How or when do you call the Dispose() function? What if your component is nested and you only want to call it when the nested components parents,parent is removed from the stage?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on When to Use Weak References by Dan Schultz</title>
		<link>http://www.intriguemedia.net/2007/09/24/when-to-use-weak-references/#comment-292</link>
		<dc:creator>Dan Schultz</dc:creator>
		<pubDate>Sat, 02 Aug 2008 00:06:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/?p=28#comment-292</guid>
		<description>@Anonymous, thanks for bringing this to my attention.  I'm in the process of writing a post about references in general, encompassing strong, weak, soft, and phantom references.

@Larry, I think you got it :-).  When B adds a listener to A, A is holding a reference to B.  Because of this, B will not be garbage collected until A is removed from memory, or B removes its listener from A, or the only references to A are weak, which triggers A to be removed from memory.

Yes, you are right when you say that removing listeners is not necessary for memory leak prevention.  As long as all the listeners you add to object A are weak.</description>
		<content:encoded><![CDATA[<p>@Anonymous, thanks for bringing this to my attention.  I&#8217;m in the process of writing a post about references in general, encompassing strong, weak, soft, and phantom references.</p>
<p>@Larry, I think you got it :-).  When B adds a listener to A, A is holding a reference to B.  Because of this, B will not be garbage collected until A is removed from memory, or B removes its listener from A, or the only references to A are weak, which triggers A to be removed from memory.</p>
<p>Yes, you are right when you say that removing listeners is not necessary for memory leak prevention.  As long as all the listeners you add to object A are weak.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on When to Use Weak References by Larry</title>
		<link>http://www.intriguemedia.net/2007/09/24/when-to-use-weak-references/#comment-290</link>
		<dc:creator>Larry</dc:creator>
		<pubDate>Fri, 01 Aug 2008 15:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/?p=28#comment-290</guid>
		<description>This stuff makes my head hurt, but your article helped organize the ideas for me. I had to step back and think about what I was doing when I add an event listener to an object.

Basically, if object B adds a listener to object A, the result is that A has a
reference to B. This means that B cannot be garbage collected, even if it is no 
longer used.

Now, if B is otherwise a target for garbage collection, it is certainly no
longer interested in events from A. 

So, it seems to me like the weak reference option is there to protect you from
not cleaning up. Instead of removing event listeners from B, you just 
rely on the weak reference because you know that if object B is otherwise
a candidate for removal, it certainly isn't interested in events anymore.

If my analysis is correct, the only time you need a strong reference to an
event listener is when you think that this single reference to your object
is the only thing keeping it from being kicked out. But how
often does that happen? If nobody has a reference to an object, that
object is doing nothing, so it won't be missed.

Seems to me that weak references to event listeners should always
be safe. I'm not sure that removing listeners is necessary for memory
leak prevention.

Someone please correct me if I'm wrong.</description>
		<content:encoded><![CDATA[<p>This stuff makes my head hurt, but your article helped organize the ideas for me. I had to step back and think about what I was doing when I add an event listener to an object.</p>
<p>Basically, if object B adds a listener to object A, the result is that A has a<br />
reference to B. This means that B cannot be garbage collected, even if it is no<br />
longer used.</p>
<p>Now, if B is otherwise a target for garbage collection, it is certainly no<br />
longer interested in events from A. </p>
<p>So, it seems to me like the weak reference option is there to protect you from<br />
not cleaning up. Instead of removing event listeners from B, you just<br />
rely on the weak reference because you know that if object B is otherwise<br />
a candidate for removal, it certainly isn&#8217;t interested in events anymore.</p>
<p>If my analysis is correct, the only time you need a strong reference to an<br />
event listener is when you think that this single reference to your object<br />
is the only thing keeping it from being kicked out. But how<br />
often does that happen? If nobody has a reference to an object, that<br />
object is doing nothing, so it won&#8217;t be missed.</p>
<p>Seems to me that weak references to event listeners should always<br />
be safe. I&#8217;m not sure that removing listeners is necessary for memory<br />
leak prevention.</p>
<p>Someone please correct me if I&#8217;m wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on When to Use Weak References by Anonymous</title>
		<link>http://www.intriguemedia.net/2007/09/24/when-to-use-weak-references/#comment-289</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 15 Jul 2008 04:03:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/?p=28#comment-289</guid>
		<description>Hi Dan, you didn't really spell out when not to use weak references.  I got the impression that all listeners should be weak references reading this and still have no idea when not to use weak reference (or when strong reference is highly preferred over weak)</description>
		<content:encoded><![CDATA[<p>Hi Dan, you didn&#8217;t really spell out when not to use weak references.  I got the impression that all listeners should be weak references reading this and still have no idea when not to use weak reference (or when strong reference is highly preferred over weak)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Embedding Cayri on Your Website by Nick</title>
		<link>http://www.intriguemedia.net/2007/09/12/embedding-cayri-on-your-website/#comment-288</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 11 Jul 2008 02:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/?p=27#comment-288</guid>
		<description>Purely beautiful!!!  I would also benefit from a callsign "limit". maybe it could be put in the url for the iFrame, so the src would read, http://www.cayri.org/?network=vatsim&#38;limit=CALLSIGN HERE

Then in program add (something to the lines of) if(isset(limit)) ONLY DISPLAY FLIGHTS CONTAINING limit VALUE

Thats how I would do it (But I am a noob :-) )

None the less, Beautiful!</description>
		<content:encoded><![CDATA[<p>Purely beautiful!!!  I would also benefit from a callsign &#8220;limit&#8221;. maybe it could be put in the url for the iFrame, so the src would read, <a href="http://www.cayri.org/?network=vatsim&amp;limit=CALLSIGN" rel="nofollow">http://www.cayri.org/?network=vatsim&amp;limit=CALLSIGN</a> HERE</p>
<p>Then in program add (something to the lines of) if(isset(limit)) ONLY DISPLAY FLIGHTS CONTAINING limit VALUE</p>
<p>Thats how I would do it (But I am a noob <img src='http://www.intriguemedia.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<p>None the less, Beautiful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Saving Flex&#8217;s Application State to a Database by amarjit jha</title>
		<link>http://www.intriguemedia.net/2008/03/10/saving-flexs-application-state-to-a-database/#comment-287</link>
		<dc:creator>amarjit jha</dc:creator>
		<pubDate>Fri, 27 Jun 2008 10:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/2008/03/10/saving-flexs-application-state-to-a-database/#comment-287</guid>
		<description>It's not working at all.

The fact id that I convert an object to byte array  but when i am trying to convert the byte array back to the object it's not working properly.

It's returning an object but it's losing some properties.If you can kindly help me on that with some code. 

you have been very helpful thanks for your time. thanks a lot.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not working at all.</p>
<p>The fact id that I convert an object to byte array  but when i am trying to convert the byte array back to the object it&#8217;s not working properly.</p>
<p>It&#8217;s returning an object but it&#8217;s losing some properties.If you can kindly help me on that with some code. </p>
<p>you have been very helpful thanks for your time. thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The New Cayri by Diego</title>
		<link>http://www.intriguemedia.net/2007/05/30/the-new-cayri/#comment-286</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Fri, 27 Jun 2008 02:12:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/?p=12#comment-286</guid>
		<description>@Dan Schultz Thank you so much!</description>
		<content:encoded><![CDATA[<p>@Dan Schultz Thank you so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Saving Flex&#8217;s Application State to a Database by Dan Schultz</title>
		<link>http://www.intriguemedia.net/2008/03/10/saving-flexs-application-state-to-a-database/#comment-285</link>
		<dc:creator>Dan Schultz</dc:creator>
		<pubDate>Wed, 25 Jun 2008 18:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/2008/03/10/saving-flexs-application-state-to-a-database/#comment-285</guid>
		<description>@amarjit,

Oh dear, I forgot to mention that you need to put the [RemoteClass] metatag in the ObjectState class.  I've updated this post to reflect this.

If that doesn't work, I would try opening up your debugger and making sure that the length of your returned byte array is larger than 0.  Also, I've never tried this with an HTTPService, only Flash Remoting, so this might be the crux of the problem too.

Definitely try the [RemoteClass] metatag first though.  I'm almost certain that's the root of the problem.

Tell me what you come up with ;)</description>
		<content:encoded><![CDATA[<p>@amarjit,</p>
<p>Oh dear, I forgot to mention that you need to put the [RemoteClass] metatag in the ObjectState class.  I&#8217;ve updated this post to reflect this.</p>
<p>If that doesn&#8217;t work, I would try opening up your debugger and making sure that the length of your returned byte array is larger than 0.  Also, I&#8217;ve never tried this with an HTTPService, only Flash Remoting, so this might be the crux of the problem too.</p>
<p>Definitely try the [RemoteClass] metatag first though.  I&#8217;m almost certain that&#8217;s the root of the problem.</p>
<p>Tell me what you come up with <img src='http://www.intriguemedia.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Saving Flex&#8217;s Application State to a Database by amarjit jha</title>
		<link>http://www.intriguemedia.net/2008/03/10/saving-flexs-application-state-to-a-database/#comment-284</link>
		<dc:creator>amarjit jha</dc:creator>
		<pubDate>Wed, 25 Jun 2008 05:06:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.intriguemedia.net/2008/03/10/saving-flexs-application-state-to-a-database/#comment-284</guid>
		<description>Hi Dan Schultz
Actually i am saving the byte array to database with the help of httpservice but i am not able to decode the byte array back to the object of class "objectstate" defined.

I have tried the class MyCompContainer and the method retrievedMementoHandler but not been able to convert the byte array to objectstate type object.Please help.

Thanks and regards</description>
		<content:encoded><![CDATA[<p>Hi Dan Schultz<br />
Actually i am saving the byte array to database with the help of httpservice but i am not able to decode the byte array back to the object of class &#8220;objectstate&#8221; defined.</p>
<p>I have tried the class MyCompContainer and the method retrievedMementoHandler but not been able to convert the byte array to objectstate type object.Please help.</p>
<p>Thanks and regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
