<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Flexdream's Weblog &#187; Flex</title>
	<atom:link href="http://flexdream.wordpress.com/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexdream.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 10 Oct 2008 16:02:31 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='flexdream.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/097cffd631d55281da70e7b9e8023300?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Flexdream's Weblog &#187; Flex</title>
		<link>http://flexdream.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://flexdream.wordpress.com/osd.xml" title="Flexdream&#8217;s Weblog" />
		<item>
		<title>DataGrid ItemEditor with Two Input Fields</title>
		<link>http://flexdream.wordpress.com/2008/10/10/datagrid-itemeditor-with-two-input-fields/</link>
		<comments>http://flexdream.wordpress.com/2008/10/10/datagrid-itemeditor-with-two-input-fields/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 16:02:31 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=43</guid>
		<description><![CDATA[Several folks have been asking about how to have a DataGrid ItemEditor with two input fields (say you want to separately edit first name and last name or something like that).
It&#8217;s a bit tricky because of some missing pieces in the underlying Flash focus APIs and because of how Focus events work. Here is my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=43&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Several folks have been asking about how to have a DataGrid ItemEditor with two input fields (say you want to separately edit first name and last name or something like that).</p>
<p>It&#8217;s a bit tricky because of some missing pieces in the underlying Flash focus APIs and because of how Focus events work. Here is my take on how to do it. Usual caveats apply (i.e, code is not supported and may have bugs etc).</p>
<p><a href="http://blogs.adobe.com/aharui/DataGridMultiFieldEditor/DataGridMultiFieldEditor.zip">Download Source</a><br />
<a href="http://blogs.adobe.com/aharui/DataGridMultiFieldEditor/DataGridMultiFieldEditorTest.swf">Run Example</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=43&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/10/10/datagrid-itemeditor-with-two-input-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>Data Grid With CheckBox and ComboBox</title>
		<link>http://flexdream.wordpress.com/2008/10/10/data-grid-with-checkbox-and-combobox/</link>
		<comments>http://flexdream.wordpress.com/2008/10/10/data-grid-with-checkbox-and-combobox/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 15:53:07 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=40</guid>
		<description><![CDATA[&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&#62;
&#60;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; layout=&#8221;vertical&#8221;&#62;
&#60;mx:Script&#62;
&#60;![CDATA[
import mx.collections.ArrayCollection;
import mx.utils.ObjectProxy;
[Bindable] private var comboArr:ArrayCollection = new ArrayCollection([new ObjectProxy({"checked":true}),new ObjectProxy({"checked":true}),new ObjectProxy({"checked":false}),new ObjectProxy({"checked":true}),new ObjectProxy({"checked":false})]);
]]&#62;
&#60;/mx:Script&#62;
&#60;mx:DataGrid dataProvider=&#8221;{comboArr}&#8221;&#62;
&#60;mx:columns&#62;
&#60;mx:DataGridColumn headerText=&#8221;Check Box&#8221; dataField=&#8221;checked&#8221;&#62;
&#60;mx:itemRenderer&#62;
&#60;mx:Component&#62;
&#60;mx:Canvas&#62;
&#60;mx:CheckBox id=&#8221;checks&#8221; selected=&#8221;{data.checked}&#8221; change=&#8221;{data.checked = this.checks.selected}&#8221;/&#62;
&#60;/mx:Canvas&#62;
&#60;/mx:Component&#62;
&#60;/mx:itemRenderer&#62;
&#60;/mx:DataGridColumn&#62;
&#60;mx:DataGridColumn headerText=&#8221;Combo Box&#8221; dataField=&#8221;checked&#8221;&#62;
&#60;mx:itemRenderer&#62;
&#60;mx:Component&#62;
&#60;mx:Canvas&#62;
&#60;mx:ComboBox visible=&#8221;{data.checked}&#8221;&#62;
&#60;mx:dataProvider&#62;
&#60;mx:ArrayCollection&#62;
&#60;mx:source&#62;
&#60;mx:String&#62;Data1&#60;/mx:String&#62;
&#60;mx:String&#62;Data2&#60;/mx:String&#62;
&#60;mx:String&#62;Data3&#60;/mx:String&#62;
&#60;mx:String&#62;Data4&#60;/mx:String&#62;
&#60;mx:String&#62;Data5&#60;/mx:String&#62;
&#60;/mx:source&#62;
&#60;/mx:ArrayCollection&#62;
&#60;/mx:dataProvider&#62;
&#60;/mx:ComboBox&#62;
&#60;/mx:Canvas&#62;
&#60;/mx:Component&#62;
&#60;/mx:itemRenderer&#62;
&#60;/mx:DataGridColumn&#62;
&#60;/mx:columns&#62;
&#60;/mx:DataGrid&#62;
&#60;/mx:Application&#62;
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=40&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; layout=&#8221;vertical&#8221;&gt;<br />
&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
import mx.collections.ArrayCollection;<br />
import mx.utils.ObjectProxy;<br />
[Bindable] private var comboArr:ArrayCollection = new ArrayCollection([new ObjectProxy({"checked":true}),new ObjectProxy({"checked":true}),new ObjectProxy({"checked":false}),new ObjectProxy({"checked":true}),new ObjectProxy({"checked":false})]);<br />
]]&gt;<br />
&lt;/mx:Script&gt;</p>
<p>&lt;mx:DataGrid dataProvider=&#8221;{comboArr}&#8221;&gt;<br />
&lt;mx:columns&gt;<br />
&lt;mx:DataGridColumn headerText=&#8221;Check Box&#8221; dataField=&#8221;checked&#8221;&gt;<br />
&lt;mx:itemRenderer&gt;<br />
&lt;mx:Component&gt;<br />
&lt;mx:Canvas&gt;<br />
&lt;mx:CheckBox id=&#8221;checks&#8221; selected=&#8221;{data.checked}&#8221; change=&#8221;{data.checked = this.checks.selected}&#8221;/&gt;<br />
&lt;/mx:Canvas&gt;<br />
&lt;/mx:Component&gt;<br />
&lt;/mx:itemRenderer&gt;<br />
&lt;/mx:DataGridColumn&gt;<br />
&lt;mx:DataGridColumn headerText=&#8221;Combo Box&#8221; dataField=&#8221;checked&#8221;&gt;<br />
&lt;mx:itemRenderer&gt;<br />
&lt;mx:Component&gt;<br />
&lt;mx:Canvas&gt;<br />
&lt;mx:ComboBox visible=&#8221;{data.checked}&#8221;&gt;<br />
&lt;mx:dataProvider&gt;<br />
&lt;mx:ArrayCollection&gt;<br />
&lt;mx:source&gt;<br />
&lt;mx:String&gt;Data1&lt;/mx:String&gt;<br />
&lt;mx:String&gt;Data2&lt;/mx:String&gt;<br />
&lt;mx:String&gt;Data3&lt;/mx:String&gt;<br />
&lt;mx:String&gt;Data4&lt;/mx:String&gt;<br />
&lt;mx:String&gt;Data5&lt;/mx:String&gt;<br />
&lt;/mx:source&gt;<br />
&lt;/mx:ArrayCollection&gt;<br />
&lt;/mx:dataProvider&gt;<br />
&lt;/mx:ComboBox&gt;<br />
&lt;/mx:Canvas&gt;<br />
&lt;/mx:Component&gt;<br />
&lt;/mx:itemRenderer&gt;<br />
&lt;/mx:DataGridColumn&gt;<br />
&lt;/mx:columns&gt;<br />
&lt;/mx:DataGrid&gt;<br />
&lt;/mx:Application&gt;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=40&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/10/10/data-grid-with-checkbox-and-combobox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>Replicating click Event on a MouseOver event in Flex Accordion</title>
		<link>http://flexdream.wordpress.com/2008/10/10/replicating-click-event-on-a-mouseover-event-in-flex-accordion/</link>
		<comments>http://flexdream.wordpress.com/2008/10/10/replicating-click-event-on-a-mouseover-event-in-flex-accordion/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 13:09:36 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=37</guid>
		<description><![CDATA[The following code is solution to a problem where you need to make the accordion component’s MouseOver event to behave like a click event. The code will work only in the case if you have not given the names to the AccordionHeader explicitly. Check the solution out here

&#60;?xml version=”1.0″?&#62;
&#60;mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”&#62;
&#60;mx:Script&#62;
&#60;![CDATA[
public function onMouseOver(evt:MouseEvent):void{
var strName:String = evt.target.name;
var [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=37&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The following code is solution to a problem where you need to make the accordion component’s MouseOver event to behave like a click event. The code will work only in the case if you have not given the names to the AccordionHeader explicitly. Check the solution out here<br />
<code><br />
&lt;?xml version=”1.0″?&gt;<br />
&lt;mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”&gt;<br />
&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
public function onMouseOver(evt:MouseEvent):void{<br />
var strName:String = evt.target.name;<br />
var strLen:int = String("_header").length;<br />
if(strName.indexOf("_header") &gt; -1){<br />
accordion.selectedIndex = int(strName.substr(strLen,strName.length));<br />
}<br />
}<br />
]]&gt;<br />
&lt;/mx:Script&gt;<br />
&lt;mx:Panel title=”Accordion Container Example” height=”90%” width=”90%”<br />
paddingTop=”10″ paddingLeft=”10″ paddingRight=”10″ paddingBottom=”10″&gt;<br />
&lt;mx:Label width=”100%” color=”blue”<br />
text=”Select an Accordion navigator button to change the panel.”/&gt;<br />
&lt;mx:Accordion id=”accordion” width=”100%” height=”100%” mouseOver=”onMouseOver(event)” &gt;<br />
&lt;!– Define each panel using a VBox container. –&gt;<br />
&lt;mx:VBox label=”Accordion Button for Panel 1″&gt;<br />
&lt;mx:Label text=”Accordion container panel 1″/&gt;<br />
&lt;/mx:VBox&gt;<br />
&lt;mx:VBox label=”Accordion Button for Panel 2″&gt;<br />
&lt;mx:Label text=”Accordion container panel 2″/&gt;<br />
&lt;/mx:VBox&gt;<br />
&lt;mx:VBox label=”Accordion Button for Panel 3″&gt;<br />
&lt;mx:Label text=”Accordion container panel 3″/&gt;<br />
&lt;/mx:VBox&gt;<br />
&lt;/mx:Accordion&gt;<br />
&lt;mx:Label width=”100%” color=”blue”<br />
text=”Programmatically select the panel using a Button control.”/&gt;<br />
&lt;mx:HBox&gt;<br />
&lt;mx:Button label=”Select Panel 1″ click=”accordion.selectedIndex=0;”/&gt;<br />
&lt;mx:Button label=”Select Panel 2″ click=”accordion.selectedIndex=1;”/&gt;<br />
&lt;mx:Button label=”Select Panel 3″ click=”accordion.selectedIndex=2;”/&gt;<br />
&lt;/mx:HBox&gt;<br />
&lt;/mx:Panel&gt;<br />
&lt;/mx:Application&gt;</code></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=37&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/10/10/replicating-click-event-on-a-mouseover-event-in-flex-accordion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Data Grid Value on Button Click</title>
		<link>http://flexdream.wordpress.com/2008/10/10/get-data-grid-value-on-button-click/</link>
		<comments>http://flexdream.wordpress.com/2008/10/10/get-data-grid-value-on-button-click/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 13:04:20 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=28</guid>
		<description><![CDATA[&#60;?xml version=&#8221;1.0&#8243;?&#62;
&#60;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; width=&#8221;800&#8243;&#62;
&#60;mx:Script&#62;
&#60;![CDATA[
import mx.controls.Alert;
import mx.events.ListEvent;
import mx.collections.ArrayCollection;
[Bindable] private var employees:ArrayCollection = new ArrayCollection([{"name":"Christina Coenraets","phone":"555-219-2270","email":"ccoenraets@fictitious.com","active":"true"},{"name":"Joanne Wall","phone":"555-219-2012","email":"jwall@fictitious.com","active":"true"},{"name":"Maurice Smith","phone":"555-219-2012","email":"maurice@fictitious.com","active":"false"},{"name":"Mary Jones","phone":"555-219-2000","email":"mjones@fictitious.com","active":"true"}]);
private function dgItemClick(event:ListEvent):void{
if (event.columnIndex != 3) //to check if the button has not been clicked
loadItem(event.itemRenderer.data);
}
public function loadItem(dataObj:Object):void{
var str:String = &#8220;&#8221;;
for (var items:String in dataObj)
{
if (items != &#8220;mx_internal_uid&#8221;)//this is an extra unique id that Flex assigns by itself
str += items [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=28&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br />
&lt;mx:Application xmlns:mx=&#8221;<a href="http://www.adobe.com/2006/mxml" target="_blank">http://www.adobe.com/2006/mxml</a>&#8221; width=&#8221;800&#8243;&gt;<br />
&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
import mx.controls.Alert;<br />
import mx.events.ListEvent;<br />
import mx.collections.ArrayCollection;<br />
[Bindable] private var employees:ArrayCollection = new ArrayCollection([{"name":"Christina Coenraets","phone":"555-219-2270","email":"<a href="mailto:ccoenraets@fictitious.com" target="_blank">ccoenraets@fictitious.com</a>","active":"true"},{"name":"Joanne Wall","phone":"555-219-2012","email":"<a href="mailto:jwall@fictitious.com" target="_blank">jwall@fictitious.com</a>","active":"true"},{"name":"Maurice Smith","phone":"555-219-2012","email":"<a href="mailto:maurice@fictitious.com" target="_blank">maurice@fictitious.com</a>","active":"false"},{"name":"Mary Jones","phone":"555-219-2000","email":"<a href="mailto:mjones@fictitious.com" target="_blank">mjones@fictitious.com</a>","active":"true"}]);</p>
<p>private function dgItemClick(event:ListEvent):void{<br />
if (event.columnIndex != 3) //to check if the button has not been clicked<br />
loadItem(event.itemRenderer.data);<br />
}</p>
<p>public function loadItem(dataObj:Object):void{<br />
var str:String = &#8220;&#8221;;<br />
for (var items:String in dataObj)<br />
{<br />
if (items != &#8220;mx_internal_uid&#8221;)//this is an extra unique id that Flex assigns by itself<br />
str += items + &#8220;:&#8221; + dataObj[items] + &#8220;\n&#8221;;<br />
}<br />
Alert.show(str);<br />
}<br />
]]&gt;<br />
&lt;/mx:Script&gt;</p>
<p>&lt;mx:DataGrid id=&#8221;dg&#8221; width=&#8221;500&#8243; height=&#8221;200&#8243; rowCount=&#8221;5&#8243; dataProvider=&#8221;{employees}&#8221; itemClick=&#8221;dgItemClick(event)&#8221;&gt;<br />
&lt;mx:columns&gt;<br />
&lt;mx:DataGridColumn dataField=&#8221;name&#8221; headerText=&#8221;Name&#8221;/&gt;<br />
&lt;mx:DataGridColumn dataField=&#8221;phone&#8221; headerText=&#8221;Phone&#8221;/&gt;<br />
&lt;mx:DataGridColumn dataField=&#8221;email&#8221; headerText=&#8221;Email&#8221;/&gt;<br />
&lt;mx:DataGridColumn headerText=&#8221;"&gt;<br />
&lt;mx:itemRenderer&gt;<br />
&lt;mx:Component&gt;<br />
&lt;mx:Button label=&#8221;Select&#8221; click=&#8221;{outerDocument.loadItem(data)}&#8221;/&gt;<br />
&lt;/mx:Component&gt;<br />
&lt;/mx:itemRenderer&gt;<br />
&lt;/mx:DataGridColumn&gt;<br />
&lt;/mx:columns&gt;<br />
&lt;/mx:DataGrid&gt;</p>
<p>&lt;/mx:Application&gt;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=28&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/10/10/get-data-grid-value-on-button-click/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>MXML ActionScript Classes</title>
		<link>http://flexdream.wordpress.com/2008/08/10/mxml-actionscript-classes/</link>
		<comments>http://flexdream.wordpress.com/2008/08/10/mxml-actionscript-classes/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 14:44:08 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=20</guid>
		<description><![CDATA[

As you know, all MXML files are converted to ActionScript Classes which are later compiled in SWF file. If you want to view / study these automatically generated classes, you can use Compiler Argument -keep-generated-actionscript in Flex Builder Project.
In Flex Builder navigate to Project &#62; Properties &#62; Flex Compiler &#62; Additional compiler arguments and add [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=20&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div class="entry">
<div class="snap_preview">
<p class="MsoNormal">As you know, all MXML files are converted to ActionScript Classes which are later compiled in SWF file. If you want to view / study these automatically generated classes, you can use Compiler Argument -keep-generated-actionscript in Flex Builder Project.</p>
<p class="MsoNormal">In Flex Builder navigate to Project &gt; Properties &gt; Flex Compiler &gt; Additional compiler arguments and add following configuration: <strong>-keep-generated-actionscript</strong></p>
<p class="MsoNormal">This will create a folder named generated in project source folder which will have all ActionScript classes which Flex Builder automatically generates from MXML ({MXML file name}-generated).</p>
</div>
</div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexdream.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexdream.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=20&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/08/10/mxml-actionscript-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>Copying objects with Flash.utils.ByteArray</title>
		<link>http://flexdream.wordpress.com/2008/07/17/copying-objects-with-flashutilsbytearray/</link>
		<comments>http://flexdream.wordpress.com/2008/07/17/copying-objects-with-flashutilsbytearray/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 09:24:04 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=14</guid>
		<description><![CDATA[I have been exploring the ways to copy an Array object to a new Array with less of the effort. Reason being the following statements in ActionScript
var arrayA:Array = new Array(”Jack”,”Steve”,”Mark”,”Ted”);
var arrayB:Array = arrayA;

The above statements appears to create a copy of arrayA, however in the actual it creates a new reference to the arrayA [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=14&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have been exploring the ways to copy an Array object to a new Array with less of the effort. Reason being the following statements in ActionScript</p>
<p><em>var arrayA:Array = new Array(”Jack”,”Steve”,”Mark”,”Ted”);<br />
var arrayB:Array = arrayA;<br />
</em></p>
<p>The above statements appears to create a copy of <em>arrayA</em>, however in the actual it creates a new reference to the <em>arrayA</em> object. The problem is that if you execute any operation on <em>arrayB</em> object now it will impact the <em>arrayA</em> eventually. For example:</p>
<p><em>arrayB.pop();<br />
trace(arrayA);</em></p>
<p>The statement is supposed to trace “Jack,Steve,Mark,Ted” whereas it will trace “Jack,Steve,Mark”.</p>
<p>To overcome this problem we use the following methodology</p>
<p><em>var arrayA:Array = new Array(”Jack”,”Steve”,”Mark”,”Ted”);<br />
var arrayB:Array = new Array();<br />
for(var i:int = 0; i &lt; arrayA.length; i++) {<br />
arrayB[i] = arrayA[i];</em><em></em></p>
<p><em>}<br />
arrayB.pop();<br />
trace(arrayA);</em></p>
<p>Now it will trace the desired result i.e. “Jack,Steve,Mark,Ted” and if you trace <em>arrayB</em> then it will trace “jack,Steve,Mark”</p>
<p>This methodology is very good when you are dealing with single array objects but when it comes to Nested Arrays it is really a tedious job as you have to look for every inner object of an array if it is an Array type and then again create a new array and copy it’s element. To overcome this we can use now the <strong>ByteArray</strong> class of <em>Flash.utils</em> package</p>
<p>You can review the following code used to copy an array. There is a disadvantages of using the ByteArray and that is you will loose on some speed. The ByteArray.Read method is slower than copying an Array. You can see a benchmark here</p>
<p>——————————–<br />
Copying a 100000 elements array<br />
——————————–<br />
Copy with loops starts at :: 802504163<br />
Copy with loop ends at :: 802504210<br />
<strong>Time elapsed :: 47 milliseconds</strong><br />
Copy with ByteArray Starts at :: 802504257<br />
Copy with Byte Array :: 802504382<br />
<strong>Time elapsed :: 125 milliseconds</strong></p>
<p>There is certainly a significant amount of processing time which ByteArray take however it is eventually helping us out when it comes to copying nested objects.</p>
<p>Download the fla from <a title="Source Fla" href="http://www.flexcomps.com/experiments/ByteArrayCopy.zip" target="_blank">here</a>.</p>
<p>Here is the code for the same.</p>
<p>——————————————————–</p>
<p>——————————————————–</p>
<blockquote><p><span style="color:#0000ff;">import </span>flash.utils.ByteArray;</p>
<p>var tDate:Date = new Date();<br />
var iStartTime:uint;<br />
var iTime:uint;<br />
var byteArray:ByteArray = new ByteArray();</p>
<p>trace(”——————————–”);<br />
trace(”Copying a 100000 elements array “);<br />
trace(”——————————–”);<br />
//———- Create and Populate Array ———<br />
var arrayA:Array = new Array();<br />
for (var i:uint; i&lt;=100000; i++) {<br />
arrayA.push(Math.random()*i);<br />
if (i == 100000) {<br />
copyArray();<br />
}<br />
}</p>
<p>//———– Copy Array using Loops ——–</p>
<p>function copyArray():void {<br />
tDate = new Date();<br />
iStartTime = tDate.time;<br />
trace(”Copy with loops starts at :: ” + iStartTime);<br />
var arrayB:Array = new Array();<br />
var arr_len:uint = arrayA.length -1;<br />
for (var i:int = 0; i &lt;= arr_len; i++) {<br />
arrayB[i] = arrayA[i];<br />
if (i == arr_len) {<br />
tDate = new Date();<br />
iTime = tDate.time;<br />
trace(”Copy with loop ends at :: ” + iTime);<br />
trace(”Time elapsed :: ” + (iTime &#8211; iStartTime) + ” milliseconds”);<br />
copyWithByteArray();<br />
}<br />
}<br />
}<br />
//——- Function copy with Byte Array ———<br />
function copyWithByteArray():void {<br />
tDate = new Date();<br />
iTime = tDate.time;<br />
trace(”Copy with ByteArray Starts at :: ” + iTime);<br />
byteArray.writeObject(arrayA);<br />
byteArray.position = 0;<br />
var arrayB:Array = byteArray.readObject() as Array;<br />
tDate = new Date();<br />
var iByteArrTime:uint = tDate.time;<br />
trace(”Copy with Byte Array :: ” + iByteArrTime);<br />
trace(”Time elapsed :: ” + (iByteArrTime &#8211; iTime) + ” milliseconds”);<br />
}</p></blockquote>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexdream.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexdream.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=14&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/07/17/copying-objects-with-flashutilsbytearray/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>Check the Internet connectivity is present or not.</title>
		<link>http://flexdream.wordpress.com/2008/07/15/check-the-internet-connectivity-is-present-or-not/</link>
		<comments>http://flexdream.wordpress.com/2008/07/15/check-the-internet-connectivity-is-present-or-not/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 15:12:39 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=9</guid>
		<description><![CDATA[There are two ways to achive the same.
Method : 1)
 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; private var monitor:URLMonitor;
 &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; public function checkConnectionStatus():void
 &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; {
 &#160; &#160; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=9&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are two ways to achive the same.</p>
<p><b>Method : 1)<br />
</b> </p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; private var monitor:URLMonitor;<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public function checkConnectionStatus():void<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var checkUrl:URLRequest = new URLRequest(&#8220;<a target="_blank" rel="nofollow" href="http://www.google.com/">http://www.google.com</a>&#8220;);<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; monitor = new URLMonitor(checkUrl);<br />
 </p>
<p>monitor.addEventListener(StatusEvent.STATUS,updateConnectionStatus);<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; monitor.start();<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
 </p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public function updateConnectionStatus(event:StatusEvent):void<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; monitor.stop();<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(event.code == &#8220;Service.available&#8221;)<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Alert.show( &#8220;Online&#8221;);<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if(event.code == &#8220;Service.unavailable&#8221;)<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Alert.show(&#8220;Offline&#8221;);<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
 </p>
<p><b>Method 2) :<br />
</b> </p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;When you login to the application &nbsp;, If<br />
internet connection goes out or comes back , the below event will be<br />
fired, you can catch this event an call &nbsp; &nbsp;back the method described<br />
<br /> in MEthod 1)<br />
 </p>
<p>Application.application.addEventListener(Event.NETWORK_CHANGE,handleNetwork</p></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexdream.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexdream.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=9&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/07/15/check-the-internet-connectivity-is-present-or-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>Loading library assets from flash9 swf to Flex</title>
		<link>http://flexdream.wordpress.com/2008/07/09/loading-library-assets-from-flash9-swf-to-flex/</link>
		<comments>http://flexdream.wordpress.com/2008/07/09/loading-library-assets-from-flash9-swf-to-flex/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 09:48:01 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=7</guid>
		<description><![CDATA[This is a prototype to load external flash9 swf file into flex and using the library items from the swf. In given example we have two library symbols with linkage ids (”mc1″, “mc2″).
Just make sure when you create a movieclip from these definitions, you firstly add these to a UIComponent and then that component to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=7&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is a prototype to load external flash9 swf file into flex and using the library items from the swf. In given example we have two library symbols with linkage ids (”mc1″, “mc2″).</p>
<p>Just make sure when you create a movieclip from these definitions, you firstly add these to a UIComponent and then that component to stage or any container, otherwise there will be a conversion error you will be getting</p>
<p>You can download sources from <a href="http://www.flexcomps.com/experiments/LoadLib.zip" target="_blank">here</a></p>
<p>Following is the code for the same.</p>
<p>&lt;?xml version=”1.0″ encoding=”utf-8″?&gt;</p>
<p>&lt;mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” creationComplete=”init()” layout=”absolute”&gt;</p>
<p>&lt;mx:Script&gt;</p>
<p>&lt;![CDATA[</p>
<p><strong>import</strong> mx.core.UIComponent;</p>
<p><em>//-------- Declare Variables --------</em></p>
<p><strong>private</strong> <strong>var</strong> swfLoader:Loader;</p>
<p><strong>private</strong> <strong>var</strong> fileURL:URLRequest;</p>
<p><em>//----- Initialize Function ------------</em></p>
<p><strong>private</strong> <strong>function</strong> init():<strong>void</strong>{</p>
<p><em>//    Security.allowDomain("*");</em></p>
<p>swfLoader = <strong>new</strong> Loader();</p>
<p>_fileURL = <strong>new</strong> URLRequest(<strong>"sample.swf"</strong>);</p>
<p>configureListeners(swfLoader.contentLoaderInfo);</p>
<p><strong>try</strong>{</p>
<p>swfLoader.load(_fileURL);</p>
<p>}</p>
<p><strong>catch</strong>(e:IOErrorEvent){</p>
<p><strong>trace</strong>(e.toString());</p>
<p>}</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> configureListeners(dispatcher:IEventDispatcher):<strong>void</strong> {</p>
<p>dispatcher.addEventListener(Event.COMPLETE, onSWFLoaded);</p>
<p>dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);</p>
<p>dispatcher.addEventListener(Event.INIT, initHandler);</p>
<p>dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);</p>
<p>dispatcher.addEventListener(Event.OPEN, openHandler);</p>
<p>dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);</p>
<p>dispatcher.addEventListener(Event.UNLOAD, unLoadHandler);</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> completeHandler(event:Event):<strong>void</strong> {</p>
<p><strong>trace</strong>(<strong>"completeHandler: "</strong> + event);</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> httpStatusHandler(event:HTTPStatusEvent):<strong>void</strong> {</p>
<p><strong>trace</strong>(<strong>"httpStatusHandler: "</strong> + event);</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> initHandler(event:Event):<strong>void</strong> {</p>
<p><strong>trace</strong>(<strong>"initHandler: "</strong> + event);</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> ioErrorHandler(event:IOErrorEvent):<strong>void</strong> {</p>
<p><strong>trace</strong>(<strong>"ioErrorHandler: "</strong> + event);</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> openHandler(event:Event):<strong>void</strong> {</p>
<p><strong>trace</strong>(<strong>"openHandler: "</strong> + event);</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> progressHandler(event:ProgressEvent):<strong>void</strong> {</p>
<p><strong>trace</strong>(<strong>"progressHandler: bytesLoaded="</strong> + event.bytesLoaded + <strong>" bytesTotal="</strong> + event.bytesTotal);</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> unLoadHandler(event:Event):<strong>void</strong> {</p>
<p><strong>trace</strong>(<strong>"unLoadHandler: "</strong> + event);</p>
<p>}</p>
<p><em>//-----</em></p>
<p><strong>private</strong> <strong>function</strong> onSWFLoaded(event:Event):<strong>void</strong>{</p>
<p><strong>var</strong> mClip:Class = event.target.applicationDomain.getDefinition(<strong>"mc1"</strong>) <strong>as</strong> Class;</p>
<p><strong>var</strong> mClip1:Class = event.target.applicationDomain.getDefinition(<strong>"mc2"</strong>) <strong>as</strong> Class;</p>
<p><strong>var</strong> mClipInstance:MovieClip = <strong>new</strong> mClip() <strong>as</strong> MovieClip;</p>
<p><strong>var</strong> mClipInstance1:MovieClip = <strong>new</strong> mClip1() <strong>as</strong> MovieClip;</p>
<p><em>//trace(mClipInstance.totalFrames);</em></p>
<p><strong>var</strong> uiComp:UIComponent = <strong>new</strong> UIComponent();</p>
<p>uiComp.addChild(mClipInstance);</p>
<p>uiComp.addChild(mClipInstance1);</p>
<p>addChild(uiComp);</p>
<p>uiComp.x = 100;</p>
<p>uiComp.y = 100;</p>
<p>uiComp.getChildAt(0).x = 150;</p>
<p>}</p>
<p>]]&gt;</p>
<p>&lt;/mx:Script&gt;</p>
<p>&lt;/mx:Application&gt;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexdream.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexdream.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=7&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/07/09/loading-library-assets-from-flash9-swf-to-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
		<item>
		<title>Flex Component Life Cycle</title>
		<link>http://flexdream.wordpress.com/2008/06/29/flex-component-life-cycle/</link>
		<comments>http://flexdream.wordpress.com/2008/06/29/flex-component-life-cycle/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 21:01:17 +0000</pubDate>
		<dc:creator>flexdream</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://flexdream.wordpress.com/?p=3</guid>
		<description><![CDATA[The lifecycle of component in flex is certainly somewhat similar to the old V2 framework where you create a component holder, craetechildren, set-sizes and dispatch events. Following four methods plays a role for component rendering

commitProperties()
measure()
layoutChrome()
updateDisplayList()

Here is what I found after doing some studies. The most of the following part is taken from Adobe flex help [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=3&subd=flexdream&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">The lifecycle of component in flex is certainly somewhat similar to the old V2 framework where you create a component holder, craetechildren, set-sizes and dispatch events. Following four methods plays a role for component rendering</span></p>
<ol type="1">
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">commitProperties()</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">measure()</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">layoutChrome()</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">updateDisplayList()</span></li>
</ol>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Here is what I found after doing some studies. The most of the following part is taken from Adobe flex help however what I am trying to do here is to elaborate it more by putting up some comments to each step to make it clearer.</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Verdana;">The green comments shows the methods and events performed by or on component itself whereas the comments in blue represents the methods and events performed on or by the parent container.</span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Following steps are demonstrating the Button component life cycle</span></p>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;color:black;">Given if the component is going to be in      a container then the <strong>parent</strong> property of component will be referred to the container(</span><em><span style="font-size:10pt;font-family:Verdana;color:red;">DisplayObjectContainer</span></em><span style="font-size:10pt;font-family:Verdana;color:black;"> type)<br />
</span><em><span style="color:#333399;">//– A property for UIComponent      class</span></em></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Get the style settings of the component</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;color:black;">Dispatches the preinitialize event on the      component</span><span style="font-size:10pt;font-family:Verdana;color:silver;">. </span></li>
</ul>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><em><span style="color:green;">//– The preinitialize event(mx.events.FlexEvent) is triggered when the UIComponent is in a very raw stage and there is no children in existence at that time</span></em></p>
<ul>
<li><span style="font-size:10pt;font-family:Verdana;">Calls the component’s </span>createChildren()<span style="font-size:10pt;font-family:Verdana;"> method</span>.</li>
</ul>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><strong><em><span style="color:green;">createChildren</span></em></strong><em><span style="color:green;"> is a protected method of UIComponent class which we need to override when we create a subclass of the UIComponent. Also from within an override of the createChildren() method, you call the addChild() method to add each child object. </span></em></p>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><em><span style="color:green;">You do not call this method directly. Flex calls the createChildren() method in response to the call to the addChild() method to add the component to its parent.</span></em></p>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Calls the invalidateProperties(), invalidateSize(), and invalidateDisplayList() methods to trigger later calls to the commitProperties(), measure(), or updateDisplayList() methods during the next render event. </span></li>
</ul>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><strong><em><span style="color:green;">invalidateProperties</span></em></strong><em><span style="color:green;">() marks a component so that its commitProperties() method gets called during a later screen update.</span></em></p>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><strong><em><span style="color:green;">invalidateSize</span></em></strong><em><span style="color:green;"> () Marks a component so that its measure() method gets called during a later screen update.</span></em></p>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><strong><em><span style="color:green;">invalidateDisplayList</span></em></strong><em><span style="color:green;"> () Marks a component so that its updateDisplayList() method gets called during a later screen update. </span></em></p>
<p class="MsoNormal" style="line-height:150%;margin:0 17.25pt 0.0001pt 0.5in;"><span style="font-size:10pt;line-height:150%;font-family:Verdana;">The only exception to this rule is that Flex does not call the <strong>measure</strong>() method when the user sets the height and width of the component. </span></p>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Dispatches the initialize event on the component. At this time, all of the component’s children are initialized, but the component has not been sized or processed for layout. You can use this event to perform additional processing of the component before it is laid out. </span></li>
</ul>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><strong><em><span style="color:green;">Initizlize</span></em></strong><em><span style="color:green;"> event gets dispatched when the component has finished its construction and has all initialization properties set. </span></em></p>
<p class="MsoNormal" style="margin:0 17.3pt 0.0001pt 0.5in;"><em><span style="color:green;">After the initialization phase, properties are processed, the component is measured, laid out, and drawn. After which the creationComplete event is dispatched.</span></em></p>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Dispatches the childAdd event on the parent      container. </span></li>
</ul>
<p style="margin-left:0.5in;"><em><span style="color:#333399;">The childAdd event is dispatched when the addChild() or addChildAt() method is called. At the time when this event is sent, the child object has been initialized, but its width and height have not yet been calculated, and the child has not been drawn on the screen. If you want to be notified when the child has been fully initialized and rendered, then register as a listener for the child’s creationComplete event.</span></em></p>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Dispatches the initialize event on the parent      container. </span></li>
</ul>
<p style="margin-left:0.5in;"><em><span style="color:#333399;">Dispatched when the component has finished its construction and has all initialization properties set. After the initialization phase, properties are processed, the component is measured, laid out, and drawn, after which the <strong>creationComplete</strong> event is dispatched.</span></em></p>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">During the next render event, Flex performs the      following actions:</span>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Calls the component’s       commitProperties() method. </span><br />
<em><span style="color:green;">commitProperties() processes the properties set on the component. You do not call this method directly. Flex calls the commitProperties() method when you use the addChild() method to add a component to a container, or when you call the invalidateProperties() method of the component. Calls to the commitProperties() method occur before calls to the measure() method. This lets you set property values that might be used by the measure() method.</span></em></li>
</ul>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Calls the component’s       measure() method.</span><em><span style="color:green;"><br />
Measure() calculates the default size, and optionally the default minimum size, of the component. This is an advanced method that you might override when creating a subclass of UIComponent</span></em><em><span style="color:green;">. </span></em><br />
<em><span style="color:green;">The default implementation of measure() sets measuredWidth, measuredHeight, measuredMinWidth, and measuredMinHeight to 0. </span></em></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Calls the component’s       (<em>Adobe help mention this method is       in UIComponent where as it is in container class</em>) container’s       layoutChrome() method.</span><a name="210487"><em><span style="color:#333399;"><br />
The </span></em></a><em><span style="color:#333399;"><span style="text-decoration:none;color:#333399;">Container</span> class, and some subclasses of the Container class, use the <span style="text-decoration:none;color:#333399;">layoutChrome()</span> method to define the border area around the container. </span></em></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Calls the component’s       updateDisplayList() method. </span><a name="210535"></a><br />
<span><em><span style="color:green;">The </span></em></span><em><span style="color:green;"><span style="text-decoration:none;color:green;">updateDisplayList()</span> method sizes and positions the children of your component based on all previous property and style settings, and draws any skins or graphic elements that the component uses. The parent container for the component determines the size of the component itself. </span></em></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Dispatches the       updateComplete event on the component.</span><em><span style="color:green;"><br />
Dispatched when an object has had its commitProperties(), measure(), and updateDisplayList() methods called (if needed).<br />
</span></em><em><span style="color:green;">This is the last opportunity to alter the component before it is displayed. All properties have been committed and the component has been measured and layed out. </span></em></li>
</ul>
</li>
<li><span style="font-size:10pt;font-family:Verdana;">Flex dispatches additional render events if the commitProperties(), measure(), or updateDisplayList() methods call the invalidateProperties(), invalidateSize(), or invalidateDisplayList() methods. </span></li>
<li><span style="font-size:10pt;font-family:Verdana;">After the last render event occurs, Flex performs the      following actions: </span>
<ul>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Makes the component visible       by setting the visible property to true. </span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Dispatches the creationComplete event on the component. The component is sized and processed for layout. This event is only dispatched once when the component is created. </span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Dispatches the updateComplete event on the component. Flex dispatches additional updateComplete events whenever the layout, position, size, or other visual characteristic of the component changes and the component is updated for display. </span></li>
</ul>
</li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/flexdream.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/flexdream.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/flexdream.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/flexdream.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/flexdream.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/flexdream.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/flexdream.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/flexdream.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/flexdream.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/flexdream.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/flexdream.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/flexdream.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=flexdream.wordpress.com&blog=4101566&post=3&subd=flexdream&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://flexdream.wordpress.com/2008/06/29/flex-component-life-cycle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c4f63515266e3303f8db93bdbcf3775?s=96&#38;d=identicon" medium="image">
			<media:title type="html">flexdream</media:title>
		</media:content>
	</item>
	</channel>
</rss>