<?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/"
	>

<channel>
	<title>theDeSilva.com&#187; Flex</title>
	<atom:link href="http://www.thedesilva.com/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedesilva.com</link>
	<description>Andrew de Silva</description>
	<lastBuildDate>Tue, 26 Apr 2011 20:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Firefox &#8211; Flash Debugger Player Crash</title>
		<link>http://www.thedesilva.com/2011/02/firefox-flash-debugger-player-crash/</link>
		<comments>http://www.thedesilva.com/2011/02/firefox-flash-debugger-player-crash/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 20:59:40 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=225</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>If you are using the Flash Debugger Player like I do to debug your work , you will soon to realized that the newer versions of Firefox tends to crash whenever the debugger prompts a warning. This is happening because Firefox will kill the debug session and cause it to crash Firefox. Here&#8217;s a solution [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>If you are using the Flash Debugger Player like I do to debug your work , you will soon to realized that the newer versions of Firefox tends to crash whenever the debugger prompts a warning. This is happening because Firefox will kill the debug session and cause it to crash Firefox. Here&#8217;s a solution to it</p>
<p>1. Goto addresss bar and type in about:config<br />
2. Click on the I’ll be careful, I promise button.<br />
3. Type dom.ipc.plugins.timeoutSecs<br />
4. Find value and double click and change the value to -1</p>
<p>Viola and now your flash debugger player will stop crashing each time it throws a warning as you have changed the default timeout value from 45 to unlimited.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2011/02/firefox-flash-debugger-player-crash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ReferenceError: Error #1069: Property startDrag not found on flash.text.TextField</title>
		<link>http://www.thedesilva.com/2010/08/referenceerror-error-1069-property-startdrag-not-found-on-flash-text-textfield/</link>
		<comments>http://www.thedesilva.com/2010/08/referenceerror-error-1069-property-startdrag-not-found-on-flash-text-textfield/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 19:22:43 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[error 1069]]></category>
		<category><![CDATA[startdrag]]></category>
		<category><![CDATA[stopdrag]]></category>
		<category><![CDATA[textfield]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=201</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>Here&#8217;s a quick solution to the error ReferenceError: Error #1069: Property startDrag not found on flash.text.TextField . This normally happens when you are trying to get the TextField to drag. &#160; textField.addEventListener&#40;MouseEvent.MOUSE_DOWN, drag&#41;; textField.addEventListener&#40;MouseEvent.MOUSE_UP, drop&#41;; &#160; // by setting mouseChildren = false it makes the drag function to use the container // of the movie [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>Here&#8217;s a quick solution to the error ReferenceError: Error #1069: Property startDrag not found on flash.text.TextField .  This normally happens when you are trying to get the TextField to drag.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">&nbsp;
<span style="color: #0066CC;">textField</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, drag<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">textField</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, drop<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// by setting mouseChildren = false it makes the drag function to use the container </span>
<span style="color: #808080; font-style: italic;">// of the movie clip rather than the compenent within the movieclip. </span>
<span style="color: #808080; font-style: italic;">// This is where the ReferenceError: Error #1069: Property startDrag </span>
<span style="color: #808080; font-style: italic;">// not found on flash.text.TextField is coming from </span>
&nbsp;
<span style="color: #0066CC;">textField</span>.<span style="color: #006600;">mouseChildren</span> = <span style="color: #000000; font-weight: bold;">false</span>;
<span style="color: #0066CC;">textField</span>.<span style="color: #006600;">text1</span>.<span style="color: #0066CC;">selectable</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> drag<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">startDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> drop<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  	<span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">stopDrag</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2010/08/referenceerror-error-1069-property-startdrag-not-found-on-flash-text-textfield/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch File to Copy Flex Release Build to Production Server</title>
		<link>http://www.thedesilva.com/2010/02/batch-file-to-copy-flex-release-build-to-production-server/</link>
		<comments>http://www.thedesilva.com/2010/02/batch-file-to-copy-flex-release-build-to-production-server/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 22:19:04 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[batch file]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=194</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>Here&#8217;s something that I always do when writing any sort of Flex Application. I&#8217;ll write a batch file that would allow me to quickly double click it and copy all of the files on the bin-release folder to the production server. This normally save me a lot of time as I don&#8217;t have to manually [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>Here&#8217;s something that I always do when writing any sort of Flex Application. I&#8217;ll write a batch file that would allow me to quickly double click it and copy all of the files on the bin-release folder to the production server. This normally save me a lot of time as I don&#8217;t have to manually look for the files and copy them to the server.</p>
<p>Here&#8217;s a quick way to create the batch file and edit it to do what you want to ,</p>
<ol>
<li> Open up Notepad in Windows. You can do this by navigating to Start &gt; Programs &gt; Accessories &gt; Notepad, or simply by entering notepad under Start &gt; Run.</li>
<li> Save your file before you start writing any code</li>
<li> Go to File &gt; Save As.</li>
<li> Click on the dropdown box &#8220;Save as type:&#8221; and select &#8220;All files&#8221; instead of Text (*.txt).</li>
<li> Add .bat to the end of your file name before you save. For example copy.bat.</li>
<li> Click on Save.</li>
</ol>
<p>Now a little batch commands to delete the files that exist on the production server first before we copy the files from the bin-release folder to the production server followed by opening the page using the default browser.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">REM Delete old production files
del \\production_server_name\production_folder\*.*
REM Copy over <span style="color: #E56717; font-weight: bold;">new</span> production files
copy *.* \\production_server_name\production_folder\
REM <span style="color: #151B8D; font-weight: bold;">Open</span> the location of the file using default browser
start www.production_server.com</pre></td></tr></table></div>

<p>The batch file should be located in the same folder as the files that you want to copy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2010/02/batch-file-to-copy-flex-release-build-to-production-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embeding Collada files on Flex</title>
		<link>http://www.thedesilva.com/2009/08/embeding-collada-files-on-flex/</link>
		<comments>http://www.thedesilva.com/2009/08/embeding-collada-files-on-flex/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 16:11:49 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[embed collada]]></category>
		<category><![CDATA[mimetype]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=163</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>Here&#8217;s how to embed collada files into your Flex. 1 2 3 4 5 6 7 &#160; &#91;Embed&#40;source=&#34;collada.dae&#34;, mimeType=&#34;application/octet-stream&#34;&#41;&#93; private var Model3D:Class; var byteArray:ByteArray = new Model3D&#40;&#41;; var collada:DAE = new DAE&#40;&#41;; collada.load&#40;byteArray, material&#41;; scene.addChild&#40;collada&#41;;]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>Here&#8217;s how to embed collada files into your Flex.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">&nbsp;
<span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;collada.dae&quot;</span>, mimeType=<span style="color: #ff0000;">&quot;application/octet-stream&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> Model3D:<span style="color: #000000; font-weight: bold;">Class</span>;
<span style="color: #000000; font-weight: bold;">var</span> byteArray:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> Model3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> collada:DAE = <span style="color: #000000; font-weight: bold;">new</span> DAE<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
collada.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>byteArray, material<span style="color: #66cc66;">&#41;</span>;
scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>collada<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2009/08/embeding-collada-files-on-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restart A Flex Web Application</title>
		<link>http://www.thedesilva.com/2009/05/restart-a-flex-web-application/</link>
		<comments>http://www.thedesilva.com/2009/05/restart-a-flex-web-application/#comments</comments>
		<pubDate>Thu, 14 May 2009 20:42:45 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=146</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>Here&#8217;s a quick way of restarting your Flex Application without reinitializing everything through a function navigateToURL&#40;new URLRequest&#40;Application.application.url&#41;, ‘_self’&#41;;]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>Here&#8217;s a quick way of restarting your Flex Application without reinitializing everything through a function</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">navigateToURL<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>Application.<span style="color: #006600;">application</span>.<span style="color: #0066CC;">url</span><span style="color: #66cc66;">&#41;</span>, ‘_self’<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2009/05/restart-a-flex-web-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Hand Cursor for Flex Component</title>
		<link>http://www.thedesilva.com/2009/04/creating-hand-cursor-for-flex-component/</link>
		<comments>http://www.thedesilva.com/2009/04/creating-hand-cursor-for-flex-component/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 20:48:16 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[hand cursor]]></category>
		<category><![CDATA[mouse cursor]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=140</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>In order to change the mouse cursor to a hand cursor when a mouse over a particular component in Flex Component you will need to set useHandCursor = true , however if you set this to true you will not be able to get the hand cursor unless you set another two properties on the [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>In order to change the mouse cursor to a hand cursor when a mouse over a particular component in Flex Component you will need to set useHandCursor = true , however if you set this to true you will not be able to get the hand cursor unless you set another two properties on the Flex component , buttonMode = true and mouseChildren = false. </p>
<p>Here&#8217;s an example</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> label:Label = <span style="color: #000000; font-weight: bold;">new</span> Label<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
label.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
label.<span style="color: #0066CC;">useHandCursor</span> = <span style="color: #000000; font-weight: bold;">true</span>;
label.<span style="color: #006600;">mouseChildren</span> = <span style="color: #000000; font-weight: bold;">false</span>;</pre></td></tr></table></div>

<p>Once you set all three property of the component you will have the hand cursor when the mouse moves over the flex component.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2009/04/creating-hand-cursor-for-flex-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MouseEvent.DOUBLE_CLICK Not Firing</title>
		<link>http://www.thedesilva.com/2009/03/mouseeventdouble_click-not-firing/</link>
		<comments>http://www.thedesilva.com/2009/03/mouseeventdouble_click-not-firing/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 00:36:20 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[double click]]></category>
		<category><![CDATA[MouseEvent.DOUBLE_CLICK]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=126</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>Recently I was working on a project that I was using MouseEvent.DOUBLE_CLICK and the darn thing wasn&#8217;t firing no matter how many times that I&#8217;ve clicked on it. After awhile I remember that most  Flex component actually have a doubleClickEnable property . Guess what was the result of the trace when I did 1 trace&#40;image.doubleClickEnabled&#41; [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flash_small.png" width="32" height="32" alt="" title="Flash" /><img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>Recently I was working on a project that I was using MouseEvent.DOUBLE_CLICK and the darn thing wasn&#8217;t firing no matter how many times that I&#8217;ve clicked on it. After awhile I remember that most  Flex component actually have a doubleClickEnable property . Guess what was the result of the trace when I did</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>image.<span style="color: #006600;">doubleClickEnabled</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">// this will return false</span></pre></td></tr></table></div>

<p>The simple solution for getting MouseEvent.DOUBLE_CLICK to work is to ensure that you set the property of doubleClickEnable to true</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">image.<span style="color: #006600;">doubleClickEnabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
image.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">DOUBLE_CLICK</span>, double_click<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2009/03/mouseeventdouble_click-not-firing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Warning: Unable to bind to property ‘XXX’ on class ‘XXX’</title>
		<link>http://www.thedesilva.com/2009/02/flex-warning-unable-to-bind-to-property-%e2%80%98xxx%e2%80%99-on-class-%e2%80%98xxx%e2%80%99/</link>
		<comments>http://www.thedesilva.com/2009/02/flex-warning-unable-to-bind-to-property-%e2%80%98xxx%e2%80%99-on-class-%e2%80%98xxx%e2%80%99/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 17:03:18 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=119</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>While working on a new project using Flex and Webservices, I got this annoying message when I&#8217;m trying to use dataprovider and custom ItemRenderer warning: unable to bind to property ‘xxx’ on class ‘xxx’ (class is not an IEventDispatcher) warning: unable to bind to property ‘xxx’ on class ‘xxx’ (class is not an IEventDispatcher) This [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>While working on a new project using Flex and Webservices, I got this annoying message when I&#8217;m trying to use dataprovider and custom ItemRenderer</p>
<p><em>warning: unable to bind to property ‘xxx’ on class ‘xxx’ (class is not an IEventDispatcher)<br />
warning: unable to bind to property ‘xxx’ on class ‘xxx’ (class is not an IEventDispatcher)</em><br />
This is happening because binding fails when using complex objects  , the compiler doesn&#8217;t know what kind of datatype that is being looped in the Repeater class and spits out a warning. Depending on what you are trying to do , sometimes it wont even spit out the data. The quick solution is to extend your class to Object and to make it bindable.</p>
<p>Here&#8217;s an example</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">thedesilva</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">rpc</span>.<span style="color: #006600;">soap</span>.<span style="color: #006600;">types</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #808080; font-style: italic;">/**
* Wrapper class for a operation required type
*/</span>
<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Magazine <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">Object</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #808080; font-style: italic;">/**
* Constructor, initializes the type class
*/</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Magazine<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> id:<span style="color: #0066CC;">String</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> imagename:<span style="color: #0066CC;">String</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">name</span>:<span style="color: #0066CC;">String</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2009/02/flex-warning-unable-to-bind-to-property-%e2%80%98xxx%e2%80%99-on-class-%e2%80%98xxx%e2%80%99/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tour de FLEX</title>
		<link>http://www.thedesilva.com/2008/11/tour-de-flex/</link>
		<comments>http://www.thedesilva.com/2008/11/tour-de-flex/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 17:01:26 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[flex components]]></category>
		<category><![CDATA[tour de flex]]></category>
		<category><![CDATA[tour de flex plugin]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=105</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>Here&#8217;s a really cool Flex learning tool called Tour de Flex. Tour de Flex is a desktop application for exploring Flex capabilities and resources, including the core Flex components, Adobe AIR and data integration, as well as a variety of third-party components, effects, skins, and more. It&#8217;s a really great application as it provides alot [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>Here&#8217;s a really cool Flex learning tool called Tour de Flex. Tour de Flex is a desktop application for exploring Flex capabilities and resources, including the core Flex components, Adobe AIR and data integration, as well as a variety of third-party components, effects, skins, and more.</p>
<p>It&#8217;s a really great application as it provides alot of examples with source code that will allow you to learn and also visualize the changes.  Below is a screenshot of Tour de FLEX Air Application</p>
<div id="attachment_106" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.thedesilva.com/wp-content/uploads/2008/11/tour_de_flex_air.png"><img class="size-medium wp-image-106" title="tour_de_flex_air" src="http://www.thedesilva.com/wp-content/uploads/2008/11/tour_de_flex_air-300x232.png" alt="Tour de FLEX Air Screen Short" width="300" height="232" /></a><p class="wp-caption-text">Tour de FLEX Air Screen Shot</p></div>
<p><span id="more-105"></span></p>
<p>The application is also available as a plugin to Flex Builder and Eclipse .  Once installed you can search by component name, tag or author and double-click any item in the results to immediately see the component in Tour de Flex.  The plugin provides a search interface to the 200+ samples in Tour de Flex . It&#8217;s pretty simple to install it on Flex Builder 3 . Here are the instructions to install it in Flex Builder</p>
<ol>
<li>Click on Help -&gt; Software Updates -&gt; Find and Install</li>
<li>Click on Search for New Feature to Install</li>
<li>Click on New Remote Site and enter <strong>http://tourdeflex.adobe.com/eclipse</strong> on the URL</li>
<li>You can type anything you want for the Name of the Remote Site. In my case I just put it as Adobe</li>
<div id="attachment_109" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.thedesilva.com/wp-content/uploads/2008/11/add_new_feature1.png"><img class="size-medium wp-image-109" title="Adding Tour de Flex to Flex Builder 3" src="http://www.thedesilva.com/wp-content/uploads/2008/11/add_new_feature1-300x278.png" alt="Adding Tour de Flex to Flex Builder 3" width="300" height="278" /></a><p class="wp-caption-text">Adding Tour de Flex to Flex Builder 3</p></div>
<li>Click OK and then click Finish</li>
<li>You will be presented with a list of new features that you can install , Select Tour de Flex and click Finish</li>
<li>Once installed, a new Tour de Flex view is available to add.</li>
<li>If you can&#8217;t find the Tour de Flex view on the Window preferences up top of your Flex Builder options then it could be hidden.  If that&#8217;s the case then follow on to the next step</li>
<li>Click Windows -&gt; Other View -&gt; Tour de Flex and you should be able to view the Tour de Flex Window which looks like below
<p><div id="attachment_110" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.thedesilva.com/wp-content/uploads/2008/11/eclipse-plugin-screenshot.png"><img class="size-medium wp-image-110" title="Tour de Flex Eclipse Plugin Screenshot" src="http://www.thedesilva.com/wp-content/uploads/2008/11/eclipse-plugin-screenshot-300x136.png" alt="Tour de Flex Eclipse Plugin Screenshot" width="300" height="136" /></a><p class="wp-caption-text">Tour de Flex Eclipse Plugin Screenshot</p></div></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2008/11/tour-de-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash 10 File Reference</title>
		<link>http://www.thedesilva.com/2008/11/flash-10-file-reference/</link>
		<comments>http://www.thedesilva.com/2008/11/flash-10-file-reference/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 20:43:09 +0000</pubDate>
		<dc:creator>Andrew de Silva</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[fileReference]]></category>
		<category><![CDATA[flash player 10]]></category>

		<guid isPermaLink="false">http://www.thedesilva.com/?p=87</guid>
		<description><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/>Prior to Flash Player 10 , if you need to write or read a file to a user system , you would need to bounce it off a server and then load it back to the user system before you can even access the file. This is no longer true in Flash Player 10 . [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.thedesilva.com/img/category_icon//flex-icon-small.png" width="32" height="32" alt="" title="Flex" /><br/><p>Prior to Flash Player 10 , if you need to write or read a file to a user system , you would need to bounce it off a server and then load it back to the user system before you can even access the file. This is no longer true in Flash Player 10 . The new API on FileReference class allows you to save and load file that is selected by the user , they are</p>
<p><strong>FileReference.load()</strong> &#8211; loads data from a file that is selected by the user</p>
<p><strong>FileReference.save()</strong> &#8211; save data to a file that is selected by the user</p>
<p>However , in order for the save() and load() to be called it need to be in response to a user interaction such as a button click and the location of the files cannot be exposed to Actionscript.</p>
<p><span id="more-87"></span></p>
<p>Below are the examples to use this new API</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #0066CC;">Button</span>;
<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">TextArea</span>;
&nbsp;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">FileReference</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
&nbsp;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">ByteArray</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> fileReference:FileReference;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> textArea:TextArea = <span style="color: #000000; font-weight: bold;">new</span> TextArea<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> loadButton:<span style="color: #0066CC;">Button</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Button</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> saveButton:<span style="color: #0066CC;">Button</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Button</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> myFilter:FileFilter = <span style="color: #000000; font-weight: bold;">new</span> FileFilter<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Text&quot;</span>,<span style="color: #ff0000;">&quot;*.txt&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	textArea.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">200</span>;
	textArea.<span style="color: #0066CC;">height</span> = <span style="color: #cc66cc;">200</span>;
	addChild<span style="color: #66cc66;">&#40;</span>textArea<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	saveButton.<span style="color: #006600;">label</span> = <span style="color: #ff0000;">&quot;Save&quot;</span>
	<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>saveButton<span style="color: #66cc66;">&#41;</span>;
	saveButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,saveFile<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	loadButton.<span style="color: #006600;">label</span> = <span style="color: #ff0000;">&quot;Upload Text File&quot;</span>
	<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>loadButton<span style="color: #66cc66;">&#41;</span>;
	loadButton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,loadFile<span style="color: #66cc66;">&#41;</span>;	
&nbsp;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> saveFile<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	fileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	fileReference.<span style="color: #006600;">save</span><span style="color: #66cc66;">&#40;</span>textArea.<span style="color: #0066CC;">text</span>,<span style="color: #ff0000;">&quot;test.txt&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> loadFile<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	fileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	fileReference.<span style="color: #006600;">browse</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>myFilter<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	fileReference.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SELECT</span>,selectFile<span style="color: #66cc66;">&#41;</span>;
	fileReference.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>,loadText<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> selectFile<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	fileReference.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> loadText<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">data</span>:ByteArray = fileReference.<span style="color: #0066CC;">data</span>;
	textArea.<span style="color: #0066CC;">text</span> = <span style="color: #0066CC;">data</span>.<span style="color: #006600;">readUTFBytes</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">bytesAvailable</span><span style="color: #66cc66;">&#41;</span>;
	fileReference = <span style="color: #000000; font-weight: bold;">null</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Of course you can also use Event Listeners to make sure that the file are properly loaded or if the user canceled the file browsing.</p>
<p>Here&#8217;s the working example</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_demo_1991483922"
			class="flashmovie"
			width="400"
			height="290">
	<param name="movie" value="http://www.thedesilva.com/wp-content/uploads/2008/11/demo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.thedesilva.com/wp-content/uploads/2008/11/demo.swf"
			name="fm_demo_1991483922"
			width="400"
			height="290">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><a title="Flash 10 File Reference" href="http://www.thedesilva.com/wp-content/uploads/2008/11/srcview/index.html" target="_blank">View Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedesilva.com/2008/11/flash-10-file-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

