<?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: The MXMLLoader Class &gt; Dynamic load MXML In Flex Builder 3</title>
	<atom:link href="http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/</link>
	<description>There is no universally agreed-upon biological definition of dreaming</description>
	<pubDate>Sun, 12 Oct 2008 19:06:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: david kaiser</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-478</link>
		<dc:creator>david kaiser</dc:creator>
		<pubDate>Sat, 27 Sep 2008 21:45:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-478</guid>
		<description>In the next to last paragraph, the posting removed a reference to the Script/CDATA mechanism for including Actionscript source.</description>
		<content:encoded><![CDATA[<p>In the next to last paragraph, the posting removed a reference to the Script/CDATA mechanism for including Actionscript source.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david kaiser</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-477</link>
		<dc:creator>david kaiser</dc:creator>
		<pubDate>Sat, 27 Sep 2008 21:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-477</guid>
		<description>Nice piece of work.  The example is easy to follow and I got it working in a matter of minutes.  

I tried to do this:
    var mxmlLoader:MXMLLoader = new MXMLLoader(mxml,this); 
    this.removeChild(mxmlLoader); 

naively assuming the mxmlLoader (extended from UIComponent) had been added as a child to "this."  A look at the source makes it clear that it's the components within the xml that are added as children and that the structure is maintained (i.e., you can remove everything by removing an uber-container that held all the components).   

Architecturally, an alternative to the approach of providing both the conversion and adding the child in one step would be to return the objects of type UIComponent which could be added when and where appropriate.   

As the author notes, not all components and attributes are handled.  

I am working on something where I need to receive dynamically a relatively small, simple piece of Flex code without any fore knowledge and execute it within the context of my app.  MXMLLoader works fine for the visual pieces and while Flex is able to bind "click" attributes to functions outside the MXMLLoader source, I need something equivalent to , which appears to be way outside of the approach that MXMLLoader takes using the manifest and getDefinitionByName(), etc. 

Thoughts anyone?  And thanks again to the author for a nicely done and nicely presented piece of code.</description>
		<content:encoded><![CDATA[<p>Nice piece of work.  The example is easy to follow and I got it working in a matter of minutes.  </p>
<p>I tried to do this:<br />
    var mxmlLoader:MXMLLoader = new MXMLLoader(mxml,this);<br />
    this.removeChild(mxmlLoader); </p>
<p>naively assuming the mxmlLoader (extended from UIComponent) had been added as a child to &#8220;this.&#8221;  A look at the source makes it clear that it&#8217;s the components within the xml that are added as children and that the structure is maintained (i.e., you can remove everything by removing an uber-container that held all the components).   </p>
<p>Architecturally, an alternative to the approach of providing both the conversion and adding the child in one step would be to return the objects of type UIComponent which could be added when and where appropriate.   </p>
<p>As the author notes, not all components and attributes are handled.  </p>
<p>I am working on something where I need to receive dynamically a relatively small, simple piece of Flex code without any fore knowledge and execute it within the context of my app.  MXMLLoader works fine for the visual pieces and while Flex is able to bind &#8220;click&#8221; attributes to functions outside the MXMLLoader source, I need something equivalent to , which appears to be way outside of the approach that MXMLLoader takes using the manifest and getDefinitionByName(), etc. </p>
<p>Thoughts anyone?  And thanks again to the author for a nicely done and nicely presented piece of code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DavidM</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-470</link>
		<dc:creator>DavidM</dc:creator>
		<pubDate>Wed, 10 Sep 2008 19:19:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-470</guid>
		<description>Very nice addition to the original work. Brilliant way of handling events for the components. Has anyone tried passing parameters from the created components? I was able to use e.currentTarget.label to pass information from a button back to the main application, but this is a sorely limiting hack. Any ideas?</description>
		<content:encoded><![CDATA[<p>Very nice addition to the original work. Brilliant way of handling events for the components. Has anyone tried passing parameters from the created components? I was able to use e.currentTarget.label to pass information from a button back to the main application, but this is a sorely limiting hack. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwall</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-390</link>
		<dc:creator>jwall</dc:creator>
		<pubDate>Wed, 18 Jun 2008 17:33:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-390</guid>
		<description>That is what I was thinking...thank you for the verification and thank you for sharing your insight and example.</description>
		<content:encoded><![CDATA[<p>That is what I was thinking&#8230;thank you for the verification and thank you for sharing your insight and example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Valadares</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-388</link>
		<dc:creator>Ivan Valadares</dc:creator>
		<pubDate>Wed, 18 Jun 2008 16:46:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-388</guid>
		<description>There’s no problem in adding the DataGrid, you just have to declare a variable of type Datagrid eg.“private var dataGrid:DataGrid;” in the MXMLLoader Class, the problem is the “mx:columns” and “mx:DataGridColumn headerText="Column 1" dataField="col1"” nodes, this is a problem because the class will try of instantiate a component of type columns and type DataGridColumn that doesn’t exists, like I said previous I didn’t try this class will all the components. The solution for this problem is to add a special case to see if the node if one of this types and then add the columns by code. If you need any help, e-mail me :)</description>
		<content:encoded><![CDATA[<p>There’s no problem in adding the DataGrid, you just have to declare a variable of type Datagrid eg.“private var dataGrid:DataGrid;” in the MXMLLoader Class, the problem is the “mx:columns” and “mx:DataGridColumn headerText=&#8221;Column 1&#8243; dataField=&#8221;col1&#8243;” nodes, this is a problem because the class will try of instantiate a component of type columns and type DataGridColumn that doesn’t exists, like I said previous I didn’t try this class will all the components. The solution for this problem is to add a special case to see if the node if one of this types and then add the columns by code. If you need any help, e-mail me <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwall</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-387</link>
		<dc:creator>jwall</dc:creator>
		<pubDate>Wed, 18 Jun 2008 15:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-387</guid>
		<description>Is it possible to use DataGrid components? When trying I receive errors like:

TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::DataGrid@151c7851 to mx.core.Container.

and

ReferenceError: Error #1065: Variable  is not defined.

What you are showing here seems very powerful!</description>
		<content:encoded><![CDATA[<p>Is it possible to use DataGrid components? When trying I receive errors like:</p>
<p>TypeError: Error #1034: Type Coercion failed: cannot convert mx.controls::DataGrid@151c7851 to mx.core.Container.</p>
<p>and</p>
<p>ReferenceError: Error #1065: Variable  is not defined.</p>
<p>What you are showing here seems very powerful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan Valadares</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-323</link>
		<dc:creator>Ivan Valadares</dc:creator>
		<pubDate>Wed, 14 May 2008 22:14:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-323</guid>
		<description>This loader does not parse all types of components, I didn’t add all of them because flex 3 have a lot of component. Probably you are adding a component that I didn’t import the reference but there’s no problem with it, it’s simple to add. Like Pedro said please post a Url with a zip contain the example you are trying to run I will take a look.</description>
		<content:encoded><![CDATA[<p>This loader does not parse all types of components, I didn’t add all of them because flex 3 have a lot of component. Probably you are adding a component that I didn’t import the reference but there’s no problem with it, it’s simple to add. Like Pedro said please post a Url with a zip contain the example you are trying to run I will take a look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Idoru</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-322</link>
		<dc:creator>Idoru</dc:creator>
		<pubDate>Wed, 14 May 2008 20:21:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-322</guid>
		<description>could you please post the files online so that we have a look?
It would generally seem as accessing it too early, or a typo, but do post the code :)</description>
		<content:encoded><![CDATA[<p>could you please post the files online so that we have a look?<br />
It would generally seem as accessing it too early, or a typo, but do post the code <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toby Beal</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-321</link>
		<dc:creator>Toby Beal</dc:creator>
		<pubDate>Wed, 14 May 2008 20:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-321</guid>
		<description>Oops. I guess it filtered the code from my example is there a way for me to post you the code?</description>
		<content:encoded><![CDATA[<p>Oops. I guess it filtered the code from my example is there a way for me to post you the code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toby Beal</title>
		<link>http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-320</link>
		<dc:creator>Toby Beal</dc:creator>
		<pubDate>Wed, 14 May 2008 20:18:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/2008/04/24/the-mxmlloader-class-dynamic-load-mxml/#comment-320</guid>
		<description>Thank you for this article. I've been playing around with your example as well as the original component that you mention and I seem to be stuck. Are you familiar with the following error and where I may have gone wrong? 

Thanks.

Error #1009:

[code]

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at MXMLLoader/createChildFromMXMLNode()[/Users/bealtr/Documents/Storage/Workspace/Flex Builder 3/MXML/src/MXMLLoader.as:111]
	at MXMLLoader()[/Users/bealtr/Documents/Storage/Workspace/Flex Builder 3/MXML/src/MXMLLoader.as:41]
	at MXML/init/onLoaded()[/Users/bealtr/Documents/Storage/Workspace/Flex Builder 3/MXML/src/MXML.mxml:25]
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/onComplete()


[/code]

Here's the code for my main mxml file. I've got both MXMLLoader.as and MXMLManifest.as in the source directory.

[code]


	
		
	
	
		
		
		
			
				
			
		
	
		


[/code]</description>
		<content:encoded><![CDATA[<p>Thank you for this article. I&#8217;ve been playing around with your example as well as the original component that you mention and I seem to be stuck. Are you familiar with the following error and where I may have gone wrong? </p>
<p>Thanks.</p>
<p>Error #1009:</p>
<p>[code]</p>
<p>TypeError: Error #1009: Cannot access a property or method of a null object reference.<br />
	at MXMLLoader/createChildFromMXMLNode()[/Users/bealtr/Documents/Storage/Workspace/Flex Builder 3/MXML/src/MXMLLoader.as:111]<br />
	at MXMLLoader()[/Users/bealtr/Documents/Storage/Workspace/Flex Builder 3/MXML/src/MXMLLoader.as:41]<br />
	at MXML/init/onLoaded()[/Users/bealtr/Documents/Storage/Workspace/Flex Builder 3/MXML/src/MXML.mxml:25]<br />
	at flash.events::EventDispatcher/dispatchEventFunction()<br />
	at flash.events::EventDispatcher/dispatchEvent()<br />
	at flash.net::URLLoader/onComplete()</p>
<p>[/code]</p>
<p>Here&#8217;s the code for my main mxml file. I&#8217;ve got both MXMLLoader.as and MXMLManifest.as in the source directory.</p>
<p>[code]</p>
<p>[/code]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
