<?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>FlexOut</title>
	<atom:link href="http://flex.exposedout.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://flex.exposedout.net</link>
	<description>i am an itemrendrer in the making!</description>
	<lastBuildDate>Fri, 13 May 2011 10:05:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Export to Jpeg in flex.</title>
		<link>http://flex.exposedout.net/2011/05/13/export-to-jpeg-in-flex-using-screen-capture/</link>
		<comments>http://flex.exposedout.net/2011/05/13/export-to-jpeg-in-flex-using-screen-capture/#comments</comments>
		<pubDate>Fri, 13 May 2011 05:05:47 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[innovation]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[bitmapData]]></category>
		<category><![CDATA[ByteArray]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[JPEGencoder]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[save file]]></category>
		<category><![CDATA[save jpeg]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=343</guid>
		<description><![CDATA[There is always a need to way to export some sort of a report out to the user, previously I used the classical use of a serverside script in Java or PHP to enable user to take a screenshot of the component or the entire application. Since the flash player 10 provides the feature to [...]


Related posts:<ol><li><a href='http://flex.exposedout.net/2011/05/05/save-file-as-pdf-in-flex/' rel='bookmark' title='Permanent Link: Save file as PDF in flex'>Save file as PDF in flex</a></li>
<li><a href='http://flex.exposedout.net/2009/05/25/caching-images-in-flex/' rel='bookmark' title='Permanent Link: Caching images in Flex'>Caching images in Flex</a></li>
<li><a href='http://flex.exposedout.net/2008/09/09/uploads-file-via-httphttps/' rel='bookmark' title='Permanent Link: uploads file via http/https'>uploads file via http/https</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There is always a need to way to export some sort of a report out to the user, previously I used  the classical use of a serverside script in Java or PHP  to enable user to take a screenshot of the component or the entire application. Since the flash player 10 provides the feature to save local file using file reference I am going to exploit that feature and export some BITMAP content into a Jpeg file.</p>
<p>following is the code for taking a snapshot of the component on some event/action</p>
<p>Prerequisite for making this components work.</p>
<ul>
<li>Build project in <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">flex 4.0 + SDK</a></li>
<li>Use flash player 10 and above (MUST)</li>
<li>Include <a href="https://github.com/mikechambers/as3corelib">Corelib.swc</a> for JPEGEncoder to work</li>
</ul>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">//file reference declaration to enable user to save file to local system.</span><br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> file:FileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
<span style="color: #808080; font-style: italic;">//function can be called on button click or context menu click or any other interaction</span><br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> captureIt<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">var</span> df : DateFormatter = <span style="color: #000000; font-weight: bold;">new</span> DateFormatter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
df.<span style="color: #006600;">formatString</span> = <span style="color: #ff0000;">&quot;DD-MM-YY HH:NN&quot;</span><br />
<span style="color: #000000; font-weight: bold;">var</span> bitmapData:BitmapData = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">width</span>, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;<br />
bitmapData.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>,<span style="color: #000000; font-weight: bold;">new</span> Matrix<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> bitmap : Bitmap = <span style="color: #000000; font-weight: bold;">new</span> Bitmap<span style="color: #66cc66;">&#40;</span>bitmapData<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> jpg:JPEGEncoder = <span style="color: #000000; font-weight: bold;">new</span> JPEGEncoder<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> ba:ByteArray = jpg.<span style="color: #006600;">encode</span><span style="color: #66cc66;">&#40;</span>bitmapData<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> dt : <span style="color: #0066CC;">Date</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Date</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> dtStr : <span style="color: #0066CC;">String</span> = df.<span style="color: #006600;">format</span><span style="color: #66cc66;">&#40;</span>dt.<span style="color: #0066CC;">time</span><span style="color: #66cc66;">&#41;</span>;<br />
file.<span style="color: #006600;">save</span><span style="color: #66cc66;">&#40;</span>ba,<span style="color: #ff0000;">'Screenshot at'</span>+dt.<span style="color: #0066CC;">time</span>+<span style="color: #ff0000;">'.jpg'</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>Explanation</strong></p>
<p><strong>BitmapData ()</strong><br />
The BitmapData () function takes a height and width of the component which has to be converted to image, i have used <em>this </em> you can very well use any UIComponent or DisplayObject.</p>
<p><strong>bitmapData.draw(this,new Matrix ());</strong><br />
This is the place where the actual conversion takes place (where the bitmap data is drawn), Again you can use any UIComponent or DisplayObject in <em>this </em>place.</p>
<p><strong>Bitmap Encoding: jpg.encode (bitmapData);</strong><br />
The component or screen area to be captured  is converted into BITMAP data so that it could be encoded into Jpeg file format for saving it, you can also use a PNG or GIF encoder in this place as per your requirement. At this place the Bitmap data is encoded into a JPEG file format.</p>
<p><strong>var ba : ByteArray = jpg.encode (bitmapData);</strong><br />
Since BITMAP data cannot be saved directly to the local system we first convert it into a ByteArray.</p>
<p><strong>Date : dt.time</strong><br />
The date  is only used to give each screenshot a unique timestamps so that each time the function is called a new file is saved.</p>
<p><strong>file.save ( ba,&#8217;Screenshot at&#8217;+dt.time+&#8217;.jpg&#8217; );</strong><br />
Now we pass the byte array  to the file reference and also pass the name  by which the file has to be saved, as shown in the function above.</p>
<p>Vollia you can now save JPEG file to your local  file system via Flex without using any third party Serverside script to do so. No more HTTP request and error handling to take care of.</p>
<p><strong>GO MAKE THE WORLD A BETTER PLACE<br />
Say no to paper, No need to print  graphs when you can save them to jpeg </strong></p>


<p>Related posts:<ol><li><a href='http://flex.exposedout.net/2011/05/05/save-file-as-pdf-in-flex/' rel='bookmark' title='Permanent Link: Save file as PDF in flex'>Save file as PDF in flex</a></li>
<li><a href='http://flex.exposedout.net/2009/05/25/caching-images-in-flex/' rel='bookmark' title='Permanent Link: Caching images in Flex'>Caching images in Flex</a></li>
<li><a href='http://flex.exposedout.net/2008/09/09/uploads-file-via-httphttps/' rel='bookmark' title='Permanent Link: uploads file via http/https'>uploads file via http/https</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2011/05/13/export-to-jpeg-in-flex-using-screen-capture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Power of Flash Catalyst</title>
		<link>http://flex.exposedout.net/2011/05/12/power-of-flash-catalyst/</link>
		<comments>http://flex.exposedout.net/2011/05/12/power-of-flash-catalyst/#comments</comments>
		<pubDate>Thu, 12 May 2011 04:58:50 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[innovation]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[codeless]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Flex and the Facebook ActionScript 3 API]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[illustrator]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=331</guid>
		<description><![CDATA[Here is Kevin Lynch’s Keynote from the Web 2.0 conference where he shows how to build a full application using Illustrator, Flash Catalyst, Flex Builder, Flex and the Facebook ActionScript 3 API. Related posts:Flex Builder renamed Flash &#8220;like&#8221; charts for iPad and iPhone FrameworkQuest 2008 : Introduction


Related posts:<ol><li><a href='http://flex.exposedout.net/2009/05/20/flex-builder-renamed/' rel='bookmark' title='Permanent Link: Flex Builder renamed'>Flex Builder renamed</a></li>
<li><a href='http://flex.exposedout.net/2011/04/11/flash-charts-on-ipad-and-iphone/' rel='bookmark' title='Permanent Link: Flash &#8220;like&#8221; charts for iPad and iPhone'>Flash &#8220;like&#8221; charts for iPad and iPhone</a></li>
<li><a href='http://flex.exposedout.net/2009/01/16/frameworkquest-2008-introduction/' rel='bookmark' title='Permanent Link: FrameworkQuest 2008 : Introduction'>FrameworkQuest 2008 : Introduction</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here is Kevin Lynch’s Keynote from the Web 2.0 conference where he shows how to build a full application using Illustrator, Flash Catalyst, Flex Builder, Flex and the Facebook ActionScript 3 API.</p>
<p><object width="560" height="349"><param name="movie" value="http://www.youtube.com/v/tNAde32pWT0?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/tNAde32pWT0?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>


<p>Related posts:<ol><li><a href='http://flex.exposedout.net/2009/05/20/flex-builder-renamed/' rel='bookmark' title='Permanent Link: Flex Builder renamed'>Flex Builder renamed</a></li>
<li><a href='http://flex.exposedout.net/2011/04/11/flash-charts-on-ipad-and-iphone/' rel='bookmark' title='Permanent Link: Flash &#8220;like&#8221; charts for iPad and iPhone'>Flash &#8220;like&#8221; charts for iPad and iPhone</a></li>
<li><a href='http://flex.exposedout.net/2009/01/16/frameworkquest-2008-introduction/' rel='bookmark' title='Permanent Link: FrameworkQuest 2008 : Introduction'>FrameworkQuest 2008 : Introduction</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2011/05/12/power-of-flash-catalyst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save file as PDF in flex</title>
		<link>http://flex.exposedout.net/2011/05/05/save-file-as-pdf-in-flex/</link>
		<comments>http://flex.exposedout.net/2011/05/05/save-file-as-pdf-in-flex/#comments</comments>
		<pubDate>Thu, 05 May 2011 13:09:46 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[export pdf]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[save pdf]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=319</guid>
		<description><![CDATA[Saving content as PDF from flex had always been a hassle, We know that doing such file operations in AIR is much simpler but due to the file saving ability added in Flash player 10 One can easily save files to the local system. The next big question is how do i convert my content [...]


Related posts:<ol><li><a href='http://flex.exposedout.net/2011/05/13/export-to-jpeg-in-flex-using-screen-capture/' rel='bookmark' title='Permanent Link: Export to Jpeg in flex.'>Export to Jpeg in flex.</a></li>
<li><a href='http://flex.exposedout.net/2008/09/09/uploads-file-via-httphttps/' rel='bookmark' title='Permanent Link: uploads file via http/https'>uploads file via http/https</a></li>
<li><a href='http://flex.exposedout.net/2009/05/21/flex-regular-expression-cheatsheet/' rel='bookmark' title='Permanent Link: Flex regular expression cheatsheet'>Flex regular expression cheatsheet</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Saving content as PDF from flex had always been a hassle, We know that doing such file operations in AIR is much simpler but due to the file saving ability added in Flash player 10 One can easily save files to the local system.</p>
<p>The next big question is how do i convert my content  to PDF format so that it can be correctly  saved into the file. Well for that folks at <a href="http://alivepdf.bytearray.org/">AlivePDF</a> have done a gr8 job and now any one can encode their content into pdf and  offer for download. They have a  good documentation section which you can read and create more complex stuff.</p>
<p>For beginners i am writing a small example  in which i will let the user download a PDF with embedded text or the Image depending on his choice.</p>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&lt;</span>mx:application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;522&quot;</span><span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;</span>mx:script<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span> <span style="color: #66cc66;">!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #66cc66;">*</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #66cc66;">*</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #66cc66;">*</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">ByteArray</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">codec</span>.<span style="color: #006600;">JPEGEncoder</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">alivepdf</span>.<span style="color: #006600;">layout</span>.<span style="color: #006600;">Orientation</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">alivepdf</span>.<span style="color: #006600;">layout</span>.<span style="color: #0066CC;">Size</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">alivepdf</span>.<span style="color: #006600;">layout</span>.<span style="color: #006600;">Unit</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">alivepdf</span>.<span style="color: #006600;">pdf</span>.<span style="color: #006600;">PDF</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">alivepdf</span>.<span style="color: #006600;">saving</span>.<span style="color: #006600;">Method</span>;<br />
<br />
&nbsp; &nbsp; protected <span style="color: #000000; font-weight: bold;">var</span> fileRefPDF:PDF;<br />
<br />
&nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onSaveClicked<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><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; fileRefPDF = <span style="color: #000000; font-weight: bold;">new</span> PDF<span style="color: #66cc66;">&#40;</span>Orientation.<span style="color: #006600;">PORTRAIT</span>, Unit.<span style="color: #006600;">MM</span>, <span style="color: #0066CC;">Size</span>.<span style="color: #006600;">LETTER</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; fileRefPDF.<span style="color: #0066CC;">addPage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>check.<span style="color: #006600;">selected</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; fileRefPDF.<span style="color: #006600;">addImage</span><span style="color: #66cc66;">&#40;</span>pics<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; fileRefPDF.<span style="color: #006600;">addMultiCell</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">5</span>,myname.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; fileRefPDF.<span style="color: #006600;">addMultiCell</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">5</span>,myname.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> bytes:ByteArray = fileRefPDF.<span style="color: #006600;">save</span><span style="color: #66cc66;">&#40;</span>Method.<span style="color: #006600;">LOCAL</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> file:FileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; file.<span style="color: #006600;">save</span><span style="color: #66cc66;">&#40;</span>bytes,<span style="color: #ff0000;">&quot;Untitled.pdf&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<br />
<br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;/</span>mx:script<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:canvas id=<span style="color: #ff0000;">&quot;pics&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:image source=<span style="color: #ff0000;">&quot;@Embed('hello.jpg')&quot;</span> x=<span style="color: #ff0000;">&quot;198&quot;</span> y=<span style="color: #ff0000;">&quot;19&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;311&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;208&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:label <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Oh!! Hi,&quot;</span> x=<span style="color: #ff0000;">&quot;330&quot;</span> y=<span style="color: #ff0000;">&quot;166&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:label <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{myname.text}&quot;</span> x=<span style="color: #ff0000;">&quot;330&quot;</span> y=<span style="color: #ff0000;">&quot;184&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>mx:canvas<span style="color: #66cc66;">&gt;</span><br />
<br />
<br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:label top=<span style="color: #ff0000;">&quot;33&quot;</span> <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;14&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Save as PDF Test &quot;</span> &nbsp;fontWeight=<span style="color: #ff0000;">&quot;bold&quot;</span> fontSize=<span style="color: #ff0000;">&quot;15&quot;</span><span style="color: #66cc66;">/&gt;</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">button</span> click=<span style="color: #ff0000;">&quot;onSaveClicked(event)&quot;</span> label=<span style="color: #ff0000;">&quot;Save to PDF&quot;</span> id=<span style="color: #ff0000;">&quot;saveBtn&quot;</span> x=<span style="color: #ff0000;">&quot;14&quot;</span> y=<span style="color: #ff0000;">&quot;148&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:label <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;Enter your name:&quot;</span> y=<span style="color: #ff0000;">&quot;72&quot;</span> x=<span style="color: #ff0000;">&quot;14&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:textinput id=<span style="color: #ff0000;">&quot;myname&quot;</span> &nbsp;x=<span style="color: #ff0000;">&quot;14&quot;</span> y=<span style="color: #ff0000;">&quot;90&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>mx:checkbox id=<span style="color: #ff0000;">&quot;check&quot;</span> label=<span style="color: #ff0000;">&quot;Save image&quot;</span> selected=<span style="color: #ff0000;">&quot;false&quot;</span> &nbsp;x=<span style="color: #ff0000;">&quot;14&quot;</span> y=<span style="color: #ff0000;">&quot;121&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
<span style="color: #66cc66;">&lt;/</span>mx:application<span style="color: #66cc66;">&gt;</span></div></td></tr></tbody></table></div>
<p>the Screenshot of the same can be seen below.</p>
<p><a href="http://flex.exposedout.net/wp-content/uploads/2011/05/savepdf.png"><img src="http://flex.exposedout.net/wp-content/uploads/2011/05/savepdf.png" alt="" title="savepdf" width="541" height="280" class="aligncenter size-full wp-image-324" /></a></p>
<p>Note: please include the AlivePDF swc in your project. </p>
<p>I have just skimmed the surface of the ocean with the above code. but you can write  your own brew of concoction that could possibly bring WORLD PEACE  :)</p>
<p>(-_-) happy loafing ! </p>


<p>Related posts:<ol><li><a href='http://flex.exposedout.net/2011/05/13/export-to-jpeg-in-flex-using-screen-capture/' rel='bookmark' title='Permanent Link: Export to Jpeg in flex.'>Export to Jpeg in flex.</a></li>
<li><a href='http://flex.exposedout.net/2008/09/09/uploads-file-via-httphttps/' rel='bookmark' title='Permanent Link: uploads file via http/https'>uploads file via http/https</a></li>
<li><a href='http://flex.exposedout.net/2009/05/21/flex-regular-expression-cheatsheet/' rel='bookmark' title='Permanent Link: Flex regular expression cheatsheet'>Flex regular expression cheatsheet</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2011/05/05/save-file-as-pdf-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash &#8220;like&#8221; charts for iPad and iPhone</title>
		<link>http://flex.exposedout.net/2011/04/11/flash-charts-on-ipad-and-iphone/</link>
		<comments>http://flex.exposedout.net/2011/04/11/flash-charts-on-ipad-and-iphone/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 06:15:53 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[innovation]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[amcharts]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=309</guid>
		<description><![CDATA[We already know the huge gap thats been created by Apple not adopting &#8220;Flash&#8221; to run on there device. The end users and developer pay the toll as they have to adapt to this scenario and live with the limitation of either viewing their content in different visual component OR come up with a solution [...]


Related posts:<ol><li><a href='http://flex.exposedout.net/2011/05/12/power-of-flash-catalyst/' rel='bookmark' title='Permanent Link: Power of Flash Catalyst'>Power of Flash Catalyst</a></li>
<li><a href='http://flex.exposedout.net/2008/12/04/multi-language-support-in-flex/' rel='bookmark' title='Permanent Link: Multi Language-Support in flex'>Multi Language-Support in flex</a></li>
<li><a href='http://flex.exposedout.net/2011/05/13/export-to-jpeg-in-flex-using-screen-capture/' rel='bookmark' title='Permanent Link: Export to Jpeg in flex.'>Export to Jpeg in flex.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>We already know the huge gap thats been created by Apple not adopting &#8220;Flash&#8221; to run on there device. The end users and developer pay the toll as they have to adapt to this scenario and live with the limitation of either  viewing their content  in different visual component OR come up with a solution that works both for  Flash enabled device and non Flash device like  apple iPhone and iPad.</p>
<p>I am happy to announce that Folks at <strong>Amcharts </strong>are doing an awesome task for bridging the gap between flash users and non flash users by providing  a charing component  for  both kinds of devices.</p>
<p>Now you can seamlessly view  our data on both the device by using their FLASH/FLEX component or their JAVASCRIPT charting components.</p>
<p><strong>How can this be done?<br />
<em>Use the HTML wrapper to decide if the device  can handle flash or not. (can be done even with JS) Once you know what device you are running you can  choose which  kind of component to load. This gives you a seamless solution for your Business and YES it will support the normal flashbased platform as well as NON flash platforms</em></strong></p>
<p><em> </em></p>
<p><em>Important to note: you will have to follow the conventional MVC model to achieve. Keep VIEW and DATA separate.</em></p>
<ul>
<li>Find the latest version of the Javascript library at : <a title="AmCharts Javascript Charting Component" href="http://www.amcharts.com/javascript/" target="_blank">www.amcharts.com/javascript</a></li>
<li>You can also find the reference document at :  <a title="javascript_reference" href="http://www.amcharts.com/docs/v.2/bundle/javascript_reference" target="_blank">Javascript reference</a></li>
<li>For other AmCharts component  visit: <a title="AmCharts Charting/mapping Components" href="http://www.amcharts.com" target="_blank">www.amcharts.com</a></li>
</ul>
<p><a title="AmCharts Charting/mapping Components" href="http://www.amcharts.com" target="_blank"></a></p>
<p>&nbsp;</p>
<p>Thanks for coming up with this solution. You guys at AmCharts ROCK!!</p>


<p>Related posts:<ol><li><a href='http://flex.exposedout.net/2011/05/12/power-of-flash-catalyst/' rel='bookmark' title='Permanent Link: Power of Flash Catalyst'>Power of Flash Catalyst</a></li>
<li><a href='http://flex.exposedout.net/2008/12/04/multi-language-support-in-flex/' rel='bookmark' title='Permanent Link: Multi Language-Support in flex'>Multi Language-Support in flex</a></li>
<li><a href='http://flex.exposedout.net/2011/05/13/export-to-jpeg-in-flex-using-screen-capture/' rel='bookmark' title='Permanent Link: Export to Jpeg in flex.'>Export to Jpeg in flex.</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2011/04/11/flash-charts-on-ipad-and-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UI patterns</title>
		<link>http://flex.exposedout.net/2010/06/04/ui-patterns/</link>
		<comments>http://flex.exposedout.net/2010/06/04/ui-patterns/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 11:26:35 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[innovation]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=279</guid>
		<description><![CDATA[User needs: these are the UI patterns that the user uses as a tool to understand and interact with the data that has to be conveyed to the user. In short we can say these are the gadget which helps the user to understand raw data by converting them into something meaningful.  I have categorized the UI patterns [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><strong>User needs</strong>: these are the UI patterns that the user uses as a tool to understand and interact with the data that has to be conveyed to the user. In short we can say these are the gadget which helps the user to understand raw data by converting them into something meaningful.  I have categorized the UI patterns in the order of &#8220;user needs and actions&#8221;.</p>
<p><strong>Navigating around</strong><br />
· Accordion<br />
· Headerless Menu<br />
· Breadcrumbs<br />
· Directory Navigation<br />
· Doormat Navigation<br />
· Double Tab Navigation<br />
· Faceted Navigation<br />
· Fly-out Menu<br />
· Home Link<br />
· Icon Menu<br />
· Main Navigation<br />
· Map Navigator<br />
· Meta Navigation</p>
<p style="text-align: right;">Download detailed document: <a href="http://www.exposedout.net/download/UI_Patterns.doc">here</a><br />
<span id="more-279"></span></p>
<p style="text-align: left;">· Minesweeping<br />
· Panning Navigator<br />
· Overlay Menu<br />
· Repeated Menu<br />
· Retractable Menu<br />
· Scrolling Menu<br />
· Shortcut Box<br />
· Split Navigation<br />
· Teaser Menu<br />
· To-the-top Link<br />
· Trail Menu<br />
· Navigation Tree</p>
<p><strong>Basic interactions<br />
</strong>· Action Button<br />
· Guided Tour<br />
· Paging<br />
· Pulldown Button<br />
· Slideshow<br />
· Stepping<br />
· Wizard</p>
<p><strong>Searching<br />
</strong>· Advanced Search<br />
· Autocomplete<br />
· Frequently Asked Questions (FAQ)<br />
· Help Wizard<br />
· Search Box<br />
· Search Area<br />
· Search Results<br />
· Search Tips<br />
· Site Index<br />
· Site Map<br />
· Footer Sitemap<br />
· Tag Cloud<br />
· Topic Pages</p>
<p><strong>Dealing with data</strong><br />
· Carrousel<br />
· Table Filter<br />
· Collapsible Panels<br />
· Details On Demand<br />
· Collector<br />
· Inplace replacement<br />
· List Builder<br />
· List Entry View<br />
· Overview by Detail<br />
· Parts Selector<br />
· Tabs<br />
· Table Sorter<br />
· Thumbnail<br />
· View</p>
<p><strong>Personalizing</strong><br />
· Customizable Window<br />
· Login<br />
· Registration</p>
<p><strong>Shopping<br />
</strong>· Booking<br />
· Product Comparison<br />
· Product Advisor<br />
· Product Configurator<br />
· Purchase Process<br />
· Shopping Cart<br />
· Store Locator<br />
· Testimonials<br />
· Virtual Product Display</p>
<p><strong>Making choices</strong><br />
· Country Selector<br />
· Date Selector<br />
· Language Selector<br />
· Poll<br />
· Rating</p>
<p>Giving input<br />
· Comment Box<br />
· Constraint Input<br />
· Form</p>
<p><strong>Miscellaneous</strong><br />
· Footer Bar<br />
· Hotlist<br />
· News Box<br />
· News Ticker<br />
· Send-a-Friend Link</p>
<p><strong>Application needs</strong>: Patterns that help the application, or you the designer, communicate better with the user</p>
<p><strong>Drawing attention</strong><br />
· Captcha<br />
· Center Stage<br />
· Color Coded Section<br />
· Premium Content Lock<br />
· Grid-based Layout<br />
· Liquid Layout<br />
· Outgoing Links<br />
· Alternating Row Colors</p>
<p><strong>Feedback</strong><br />
· Input Error Message<br />
· Processing Page</p>
<p><strong>Simplifying interaction</strong><br />
· Enlarged Click area<br />
· Font Enlarger</p>
<p>Download detailed document: <a href="http://www.exposedout.net/download/UI_Patterns.doc">here</a></p>
<p>source : http://www.welie.com</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2010/06/04/ui-patterns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diagonol barChart</title>
		<link>http://flex.exposedout.net/2010/05/18/diagonol-barchart/</link>
		<comments>http://flex.exposedout.net/2010/05/18/diagonol-barchart/#comments</comments>
		<pubDate>Tue, 18 May 2010 07:51:30 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[barchart]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[diagonal bar chart]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=275</guid>
		<description><![CDATA[Its not the most practical component though but for a slick &#8220;Reports UI&#8221; I had to develop a diagonal bar chart component that can be used to display a barchart 45degrees to the horizontal axis. At first i thought of solving this by using a conventional Flex Barchart but it turned out to be too [...]


Related posts:<ol><li><a href='http://flex.exposedout.net/2008/08/06/flex-charting-annotation/' rel='bookmark' title='Permanent Link: Flex Charting Annotation'>Flex Charting Annotation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Its not the most practical component though but for a slick &#8220;Reports UI&#8221; I had to develop a diagonal bar chart component that can be used to display a barchart 45degrees to the horizontal axis. At first i thought of solving this by using a conventional Flex Barchart but it turned out to be too much of effort in styling the barchart to look  like the Screenshot, So i  went ahead and wrote diagonal barChart from scratch.</p>
<p style="text-align: center;"><a href="http://flex.exposedout.net/wp-content/uploads/2010/05/diagnolbar-chart.png"><img class="size-full wp-image-276 aligncenter" title="diagnolbar chart" src="http://flex.exposedout.net/wp-content/uploads/2010/05/diagnolbar-chart.png" alt="" width="268" height="233" /></a></p>
<p style="text-align: left;"><strong>Limitations :</strong><br />
1) Chart not re-sizable<br />
2) Chart written with embedded font (otherwise label cant be rotated).<br />
3) Chart cannot be configured with direction, barThickness  and barGap.</p>
<p><strong>Features:</strong><br />
1) &#8220;n&#8221; Diagonal  bars can be drawn on screen : i have tested it with 1000 but 50 bars are more practical.<br />
2) top 10 bars drawn + Others : this feature enables you to see top 10 bars with the rest of the bars clubbed into others<br />
3)sorted/unsorted bars by value.</p>
<p>well do try it out and if you like the widget do let me kno.</p>
<p>Source <a href="http://www.exposedout.net/flexSource/DiagonalBarChart.zip" target="_blank">here</a></p>
<p>Demo <a href="http://www.exposedout.net/flexSource/DiagonalBarChart.swf" target="_self">here</a></p>


<p>Related posts:<ol><li><a href='http://flex.exposedout.net/2008/08/06/flex-charting-annotation/' rel='bookmark' title='Permanent Link: Flex Charting Annotation'>Flex Charting Annotation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2010/05/18/diagonol-barchart/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Random color generator</title>
		<link>http://flex.exposedout.net/2010/05/18/random-color-generator/</link>
		<comments>http://flex.exposedout.net/2010/05/18/random-color-generator/#comments</comments>
		<pubDate>Tue, 18 May 2010 07:03:53 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[colorTransform]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[random color]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=273</guid>
		<description><![CDATA[I am sure there were many times in the past that you would have wanted to have a function that could return you random colors. Well at least i have faced this problem many times, Mostly when i am giving a demo for a new component which deals with various color ranges. Following is the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I am sure there were many times in the past that you would have wanted to have a function that could return you random colors. Well at least i have faced this problem many times, Mostly when i am giving a demo for a new component which deals with various color ranges.</p>
<p>Following is the code to generate Random colors:</p>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> redBias:<span style="color: #0066CC;">Number</span> = 0xFF;<br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> greenBias:<span style="color: #0066CC;">Number</span> = 0xFF;<br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> blueBias:<span style="color: #0066CC;">Number</span> = 0xFF;<br />
<br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> getRandomColor<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:uint<span style="color: #66cc66;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">var</span> ct:ColorTransform = <span style="color: #000000; font-weight: bold;">new</span> ColorTransform<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>redBias, <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>greenBias, <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>blueBias<span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">color</span>:uint = ct.<span style="color: #0066CC;">color</span>;<br />
<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">color</span>;<br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>you can also modify the above code to return you a  range in a specific color range this can be done by making any 2 colors constant instead of using a  random number. Well then enjoy the code and do post in any new cool things that you can do with this piece of code.</p>
<p>for more know-how read the following post : <a href="http://www.few.vu.nl/~eliens/assets/flex3/langref/flash/geom/ColorTransform.html">ColorTransform</a></p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2010/05/18/random-color-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inspectable : metatag that makes your code fool proof</title>
		<link>http://flex.exposedout.net/2010/05/10/inspectable-metatag-that-makes-your-code-fool-proof/</link>
		<comments>http://flex.exposedout.net/2010/05/10/inspectable-metatag-that-makes-your-code-fool-proof/#comments</comments>
		<pubDate>Mon, 10 May 2010 09:31:45 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[innovation]]></category>
		<category><![CDATA[code completion]]></category>
		<category><![CDATA[Inspectable]]></category>
		<category><![CDATA[metatags]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=268</guid>
		<description><![CDATA[If you are building a custom components which will be used by other developers &#60;mxml&#62; style  wont it be cool for them to see the  bindable properties in a popup selectable values (i.e. true/false) via code completion in Flex Builder. Plus it could  also to show in the Properties Panel in design view and the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you are building a custom components which will be used by other developers &lt;mxml&gt; style  wont it be cool for them to see the  bindable properties in a popup selectable values (i.e.  true/false) via code completion in Flex Builder. Plus it could  also to show in the  Properties Panel in design view and the teammate has the ability to choose a property value.</p>
<p>in short making your component FOOOL proof  ;). Well then &#8220;Inspectable&#8221; is your best friend.</p>
<p>Usage:</p>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#91;</span>Inspectable<span style="color: #66cc66;">&#40;</span> defaultValue=<span style="color: #000000; font-weight: bold;">false</span>,verbose=<span style="color: #cc66cc;">1</span>, category=<span style="color: #ff0000;">&quot;Other&quot;</span>, enumeration=<span style="color: #ff0000;">&quot;true,false&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><br />
<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;">var</span> aintThisCool : <span style="color: #0066CC;">Boolean</span>;</div></td></tr></tbody></table></div>
<p>If your like what you have read and want to learn more  follow the link:<a title="Adobe Livedocs" href="http://livedocs.adobe.com/flex/3/html/help.html?content=metadata_3.html" target="_blank">Flex Metatags</a></p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2010/05/10/inspectable-metatag-that-makes-your-code-fool-proof/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex component lifecycle and event flow explained</title>
		<link>http://flex.exposedout.net/2010/03/10/flex-component-lifecycle-and-event-flow-explained/</link>
		<comments>http://flex.exposedout.net/2010/03/10/flex-component-lifecycle-and-event-flow-explained/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 07:38:32 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[event flow]]></category>
		<category><![CDATA[lifecycle]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=287</guid>
		<description><![CDATA[Learned something new from Ted today Read original post by Ted here Flex is an event driven programming model and everything happens due to an event. Looking at the MXML code can confuse most of the developers unless they haven&#8217;t looked at the internal class of flex components. If we were to compare Flex, HTML [...]


Related posts:<ol><li><a href='http://flex.exposedout.net/2008/09/15/flex-component-lifecycle/' rel='bookmark' title='Permanent Link: Flex Component Lifecycle'>Flex Component Lifecycle</a></li>
<li><a href='http://flex.exposedout.net/2008/09/19/eventbubbles-eventcancelable-and-eventcurrenttarget/' rel='bookmark' title='Permanent Link: event.bubbles, event.cancelable, and event.currenttarget'>event.bubbles, event.cancelable, and event.currenttarget</a></li>
<li><a href='http://flex.exposedout.net/2008/09/16/event-propogation/' rel='bookmark' title='Permanent Link: Event Propogation'>Event Propogation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Learned something new from <a href="http://ted.onflash.org/">Ted </a>today<br />
Read original post by Ted <a href="http://ted.onflash.org/2007/02/flex-instantiation-life-cycle-and-event.php">here</a></strong></p>
<p>Flex is an event driven programming model and everything happens due to an event. Looking at the MXML code can confuse most of the developers unless they haven&#8217;t looked at the internal class of flex components. If we were to compare Flex, HTML and FLASH in terms of component instantiation.</p>
<ul>
<li> HTML instantiates top to  bottom</li>
<li>Flash executes across frames starting at Frame zero.</li>
<li> Flex on the other had is a bit different.</li>
</ul>
<p>When I started  learning Flex, I struggled with  understanding event flow and instantiation in MXML. I was puzzled  because I really didn&#8217;t understand how event chain started and what happened inside a component to make it finally render on screen. Initially I used to run into numerous runtime  null point exception since i used to think i could access a property of  an object  thinking it would have been created.</p>
<p>Anyhow the key is understanding the event basics and seeing the initialization and event flow, Lets look at a sample application that i have written to explain this. The structure of the application cann be understood by the following diagram.</p>
<p><a href="http://flex.exposedout.net/wp-content/uploads/2010/06/application-structure.png"><img class="alignnone size-medium wp-image-288" title="application structure" src="http://flex.exposedout.net/wp-content/uploads/2010/06/application-structure-300x138.png" alt="" width="300" height="138" /></a></p>
<p>With this Demo app there is no visual clue that you will get  as an output to understand the event flow and instantiation step. its the TRACE statements that are important to explain  how the event  flow and instantiation happens. Below is the code for the same.</p>
<p><span id="more-287"></span></p>
<p>Call the following functions in a dummy APP</p>
<ul>
<li>preinitialize = &#8220;preinit(event)&#8221;</li>
<li>initialize = &#8220;init(event)&#8221;</li>
<li>creationComplete = &#8220;handlecc(event)&#8221;</li>
</ul>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">//preinit trace function</span><br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> preinit<span style="color: #66cc66;">&#40;</span>event:FlexEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>flash.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">&quot;ms  &amp;gt;&amp;gt; preinitialize &quot;</span>+event.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #808080; font-style: italic;">//init trace function</span><br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span>event:FlexEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>flash.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">&quot;ms  &amp;gt;&amp;gt; initialize &quot;</span>+event.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #808080; font-style: italic;">//creation complete trace function</span><br />
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handlecc<span style="color: #66cc66;">&#40;</span>event:FlexEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>flash.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">&quot;ms  &amp;gt;&amp;gt; creationComplete &quot;</span>+event.<span style="color: #006600;">currentTarget</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>Download the source <a href="http://exposedout.net/download/component_lifecycle.rar">here</a></strong><br />
I have also Monkey-patched the following classes</p>
<ul>
<li> VBox</li>
<li>HBox</li>
<li>Button</li>
</ul>
<p>In all the above classes I have added a trace statement at  measure() updateDisplayList() and createChildren(). you can see get these files in the source attached.</p>
<p>The component lifecycle  happens  in the following order. Note: i am not explaining what these methods do, but in what order are they executed to give you the final result.</p>
<ol>
<li><strong><em>preInitialize()</em></strong></li>
<li><strong><em>createChildren()</em></strong></li>
<li><strong><em>initialize()</em></strong></li>
<li><strong><em>measure()</em></strong></li>
<li><strong><em>updateDisplayList()</em></strong></li>
<li><strong><em>creationComplete()</em></strong></li>
</ol>
<p>The order of instantiation can be understood by the trace log   if you compiled and  debugged the demoApp</p>
<ol>
<li><span style="color: #3366ff;"><em>250ms  &gt;&gt; preinitialize test0</em></span></li>
<li><span style="color: #3366ff;"><em>259ms  &gt;&gt; preinitialize test0.hbox</em></span></li>
<li><span style="color: #3366ff;"><em>262ms  &gt;&gt; preinitialize test0.hbox.can</em></span></li>
<li><span style="color: #3366ff;"><em>265ms  &gt;&gt; preinitialize test0.hbox.can.cbt1</em></span></li>
<li><span style="color: #3366ff;"><em>266ms  &gt;&gt; create Children &#8211; test0.hbox.can.cbt1</em></span></li>
<li><span style="color: #3366ff;"><em>273ms  &gt;&gt; initialize test0.hbox.can.cbt1</em></span></li>
<li><span style="color: #3366ff;"><em>275ms  &gt;&gt; preinitialize test0.hbox.can.cbt2</em></span></li>
<li><span style="color: #3366ff;"><em>276ms  &gt;&gt; create Children &#8211; test0.hbox.can.cbt2</em></span></li>
<li><span style="color: #3366ff;"><em>277ms  &gt;&gt; initialize test0.hbox.can.cbt2</em></span></li>
<li><span style="color: #3366ff;"><em>278ms  &gt;&gt; initialize test0.hbox.can</em></span></li>
<li><span style="color: #3366ff;"><em>279ms  &gt;&gt; create Children &#8211; test0.hbox.can</em></span></li>
<li><span style="color: #3366ff;"><em>281ms  &gt;&gt; preinitialize test0.hbox.vbox</em></span></li>
<li><span style="color: #3366ff;"><em>283ms  &gt;&gt; preinitialize test0.hbox.vbox.btn1</em></span></li>
<li><span style="color: #3366ff;"><em>284ms  &gt;&gt; create Children &#8211; test0.hbox.vbox.btn1</em></span></li>
<li><span style="color: #3366ff;"><em>285ms  &gt;&gt; initialize test0.hbox.vbox.btn1</em></span></li>
<li><span style="color: #3366ff;"><em>287ms  &gt;&gt; preinitialize test0.hbox.vbox.btn2</em></span></li>
<li><span style="color: #3366ff;"><em>288ms  &gt;&gt; create Children &#8211; test0.hbox.vbox.btn2</em></span></li>
<li><span style="color: #3366ff;"><em>289ms  &gt;&gt; initialize test0.hbox.vbox.btn2</em></span></li>
<li><span style="color: #3366ff;"><em>290ms  &gt;&gt; initialize test0.hbox.vbox</em></span></li>
<li><span style="color: #3366ff;"><em>291ms  &gt;&gt; create Children &#8211; test0.hbox.vbox</em></span></li>
<li><span style="color: #3366ff;"><em>292ms  &gt;&gt; initialize test0.hbox</em></span></li>
<li><span style="color: #3366ff;"><em>293ms  &gt;&gt; create Children &#8211; test0.hbox</em></span></li>
<li><span style="color: #3366ff;"><em>294ms  &gt;&gt; initialize test0</em></span></li>
<li><span style="color: #3366ff;"><em>310ms  &gt;&gt; measure &#8211; test0.hbox.can.cbt1</em></span></li>
<li><span style="color: #3366ff;"><em>312ms  &gt;&gt; measure &#8211; test0.hbox.can.cbt2</em></span></li>
<li><span style="color: #3366ff;"><em>313ms  &gt;&gt; measure &#8211; test0.hbox.vbox.btn1</em></span></li>
<li><span style="color: #3366ff;"><em>313ms  &gt;&gt; measure &#8211; test0.hbox.vbox.btn2</em></span></li>
<li><span style="color: #3366ff;"><em>315ms  &gt;&gt; measure &#8211; test0.hbox.can</em></span></li>
<li><span style="color: #3366ff;"><em>315ms  &gt;&gt; measure &#8211; test0.hbox.vbox</em></span></li>
<li><span style="color: #3366ff;"><em>317ms  &gt;&gt; measure &#8211; test0.hbox</em></span></li>
<li><span style="color: #3366ff;"><em>344ms  &gt;&gt; updateDisplayList &#8211; test0.hbox</em></span></li>
<li><span style="color: #3366ff;"><em>348ms  &gt;&gt; updateDisplayList &#8211; test0.hbox.can</em></span></li>
<li><span style="color: #3366ff;"><em>350ms  &gt;&gt; updateDisplayList &#8211; test0.hbox.vbox</em></span></li>
<li><span style="color: #3366ff;"><em>351ms  &gt;&gt; updateDisplayList &#8211; test0.hbox.can.cbt1</em></span></li>
<li><span style="color: #3366ff;"><em>356ms  &gt;&gt; updateDisplayList &#8211; test0.hbox.can.cbt2</em></span></li>
<li><span style="color: #3366ff;"><em>358ms  &gt;&gt; updateDisplayList &#8211; test0.hbox.vbox.btn1</em></span></li>
<li><span style="color: #3366ff;"><em>359ms  &gt;&gt; updateDisplayList &#8211; test0.hbox.vbox.btn2</em></span></li>
<li><span style="color: #3366ff;"><em>364ms  &gt;&gt; creationComplete test0.hbox.can.cbt1</em></span></li>
<li><span style="color: #3366ff;"><em>365ms  &gt;&gt; creationComplete test0.hbox.can.cbt2</em></span></li>
<li><span style="color: #3366ff;"><em>366ms  &gt;&gt; creationComplete test0.hbox.vbox.btn1</em></span></li>
<li><span style="color: #3366ff;"><em>367ms  &gt;&gt; creationComplete test0.hbox.vbox.btn2</em></span></li>
<li><span style="color: #3366ff;"><em>368ms  &gt;&gt; creationComplete test0.hbox.can</em></span></li>
<li><span style="color: #3366ff;"><em>370ms  &gt;&gt; creationComplete test0.hbox.vbox</em></span></li>
<li><span style="color: #3366ff;"><em>371ms  &gt;&gt; creationComplete test0.hbox</em></span></li>
<li><span style="color: #3366ff;"><em>373ms  &gt;&gt; creationComplete test0</em></span></li>
</ol>
<p>Just by looking at the trace log and the application structure image you can slowly start making out a pattern (<strong>preorder traversal</strong>). <em>preInitialize()</em> is called first  for the App then the first child(in our case only child HBOX) then its first child which is the CANVAS and finally the  first child of canvas that is C BUTTON 1  after this the <em>createChildren() </em>and <em>initialize()</em> of the  innermost left child is called  then moving on to its sibling  the <em>preInitialize(), createChildren() and initialize()</em> is called.  This  is followed till all the children have completed the <em>preInitialize(), createChildren() and initialize() </em>steps.</p>
<p>After this the <em>measure()</em> of all the child&#8217;s are called in a <strong>bottom up</strong> approach with left child priority.</p>
<p>After this the <em>updateDisplayList()</em> of all the children&#8217;s are aclled in a <strong> top down </strong>approach with left child priority.</p>
<p>Finally the creationComplete() of all the children are called  again in <strong>bottom up</strong> approach with left child priority.  Thus explaining why creationComplete() of the parent component is called at the very end.  the more you look at the log trace the more you will understand the flow.  Hope this effort of my explaining the instantiation process helped you out.</p>
<p><strong>Download the source <a href="http://exposedout.net/download/component_lifecycle.rar">here</a></strong></p>


<p>Related posts:<ol><li><a href='http://flex.exposedout.net/2008/09/15/flex-component-lifecycle/' rel='bookmark' title='Permanent Link: Flex Component Lifecycle'>Flex Component Lifecycle</a></li>
<li><a href='http://flex.exposedout.net/2008/09/19/eventbubbles-eventcancelable-and-eventcurrenttarget/' rel='bookmark' title='Permanent Link: event.bubbles, event.cancelable, and event.currenttarget'>event.bubbles, event.cancelable, and event.currenttarget</a></li>
<li><a href='http://flex.exposedout.net/2008/09/16/event-propogation/' rel='bookmark' title='Permanent Link: Event Propogation'>Event Propogation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2010/03/10/flex-component-lifecycle-and-event-flow-explained/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Always Call Super in Item Renderer&#8217;s Override Methods</title>
		<link>http://flex.exposedout.net/2010/03/03/always-call-super-in-item-renderers-override-methods/</link>
		<comments>http://flex.exposedout.net/2010/03/03/always-call-super-in-item-renderers-override-methods/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 05:13:48 +0000</pubDate>
		<dc:creator>Vikram singh</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[itemrendrer]]></category>
		<category><![CDATA[super]]></category>

		<guid isPermaLink="false">http://flex.exposedout.net/?p=260</guid>
		<description><![CDATA[Today I came across a bug where I was using an item renderer in a data grid and the row didn’t highlight when you mouse over it and wouldn’t get selected when you clicked on it (ie, moused over or clicked on the column, not the entire row). The item renderer consisted of 2 Label [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Today I came across a bug where I was using an item renderer in a data grid and the row didn’t highlight when you mouse over it and wouldn’t get selected when you clicked on it (ie, moused over or clicked on the column, not the entire row). The item renderer consisted of 2 Label component.</p>
<p>At first, it was tough to see what the problem could have been. The item renderer is very simple, I have used more complicated item renderers elsewhere that don’t have this problem. </p>
<p>That’s when I noticed that my data setter override didn’t look quite right:</p>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _data = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>,LOW_STATE<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>== <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>,NORMAL_STATE<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&amp;</span>lt;<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>,HIGH_STATE<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">text</span> = value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span>+<span style="color: #ff0000;">&quot;%&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>I was this close to trying to hack in something using the mouseover and mouseclick handlers, when I realized I just needed to do this little change : <strong>&#8220;super.data = value&#8221;</strong></p>
<div class="codecolorer-container actionscript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// the missing line that made all the difference</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">super</span>.<span style="color: #0066CC;">data</span> = value;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _data = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>,LOW_STATE<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>== <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>,NORMAL_STATE<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&amp;</span>lt;<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">setStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;color&quot;</span>,HIGH_STATE<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">text</span> = value<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;growth&quot;</span><span style="color: #66cc66;">&#93;</span>+<span style="color: #ff0000;">&quot;%&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>Apparently something in the super class&#8217;s data setter does something vitally important, and you really shouldn’t skip that. If you do, <strong>BAD stuff will happen</strong>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://flex.exposedout.net/2010/03/03/always-call-super-in-item-renderers-override-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

