<?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 on: Deep Object Copy</title>
	<atom:link href="http://www.flexer.info/2007/10/25/deep-object-copy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info/2007/10/25/deep-object-copy/</link>
	<description>flex developers web corner</description>
	<pubDate>Fri, 21 Nov 2008 20:02:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: Virgil Cristea</title>
		<link>http://www.flexer.info/2007/10/25/deep-object-copy/#comment-884</link>
		<dc:creator>Virgil Cristea</dc:creator>
		<pubDate>Thu, 30 Oct 2008 15:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/10/25/deep-object-copy/#comment-884</guid>
		<description>You try to copy an AdvancedDataGridItemRenderer using the code provided for a bitmap. That will not work (as you saw it) because they are incompatible type. Instead use ObjectUtil.copy(). It should work ok. If you get an error when you recast the result back to your normal object use the register alias method explained above.</description>
		<content:encoded><![CDATA[<p>You try to copy an AdvancedDataGridItemRenderer using the code provided for a bitmap. That will not work (as you saw it) because they are incompatible type. Instead use ObjectUtil.copy(). It should work ok. If you get an error when you recast the result back to your normal object use the register alias method explained above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Belair</title>
		<link>http://www.flexer.info/2007/10/25/deep-object-copy/#comment-883</link>
		<dc:creator>Eric Belair</dc:creator>
		<pubDate>Thu, 30 Oct 2008 14:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/10/25/deep-object-copy/#comment-883</guid>
		<description>I tried using this to create a copy of an AdvancedDataGridItemRenderer instance, but I got a runtime error:

&lt;code&gt;
var dispObject:DisplayObject = DisplayObject(copyBitmap(DisplayObject(lineItemEntityRenderer)));

addChild(dispObject);

function copyBitmap(target:DisplayObject):Bitmap
{
    // Create the bitmap data object with the right size.
    var data:BitmapData = new BitmapData(target.width, target.height, true, 0);
    
    // Draw the target object into the bitmap data.
    data.draw(target);
    
    // Create a new bitmap object associated with this data.
    var bitmap:Bitmap = new Bitmap(data);
    
    return bitmap;
}
&lt;/code&gt;

Runtime Error:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Bitmap@11827bf1 to mx.core.IUIComponent.
	at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:3251]
	at mx.core::Container/addChildAt()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:2200]
	at mx.core::Container/addChild()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:2140]</description>
		<content:encoded><![CDATA[<p>I tried using this to create a copy of an AdvancedDataGridItemRenderer instance, but I got a runtime error:</p>
<p><code><br />
var dispObject:DisplayObject = DisplayObject(copyBitmap(DisplayObject(lineItemEntityRenderer)));</p>
<p>addChild(dispObject);</p>
<p>function copyBitmap(target:DisplayObject):Bitmap<br />
{<br />
    // Create the bitmap data object with the right size.<br />
    var data:BitmapData = new BitmapData(target.width, target.height, true, 0);</p>
<p>    // Draw the target object into the bitmap data.<br />
    data.draw(target);</p>
<p>    // Create a new bitmap object associated with this data.<br />
    var bitmap:Bitmap = new Bitmap(data);</p>
<p>    return bitmap;<br />
}<br />
</code></p>
<p>Runtime Error:</p>
<p>TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Bitmap@11827bf1 to mx.core.IUIComponent.<br />
	at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:3251]<br />
	at mx.core::Container/addChildAt()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:2200]<br />
	at mx.core::Container/addChild()[E:dev3.0.xframeworksprojectsframeworksrcmxcoreContainer.as:2140]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FLEX{er} &#187; Blog Archive &#187; [Transient] metadata Tag</title>
		<link>http://www.flexer.info/2007/10/25/deep-object-copy/#comment-5</link>
		<dc:creator>FLEX{er} &#187; Blog Archive &#187; [Transient] metadata Tag</dc:creator>
		<pubDate>Thu, 25 Oct 2007 14:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2007/10/25/deep-object-copy/#comment-5</guid>
		<description>[...] The [Transient] metadata tag can be used for classes that need to be on the server but also for other classes (when doing deep copies of them - I will write another post about object deep copy later - Here). [...]</description>
		<content:encoded><![CDATA[<p>[...] The [Transient] metadata tag can be used for classes that need to be on the server but also for other classes (when doing deep copies of them - I will write another post about object deep copy later - Here). [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
