<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Shashank kulkarni's Weblog</title>
	<atom:link href="http://shashankkulkarni.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://shashankkulkarni.wordpress.com</link>
	<description>Flex with Shashank</description>
	<lastBuildDate>Mon, 07 Sep 2009 19:04:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='shashankkulkarni.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/fa61bf2d9375a6ad7987bbd72f71109f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Shashank kulkarni's Weblog</title>
		<link>http://shashankkulkarni.wordpress.com</link>
	</image>
			<item>
		<title>Flex application not working without debug version of Flash Player</title>
		<link>http://shashankkulkarni.wordpress.com/2009/08/27/flex-application-not-working-without-debug-version-of-flash-player/</link>
		<comments>http://shashankkulkarni.wordpress.com/2009/08/27/flex-application-not-working-without-debug-version-of-flash-player/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 19:35:58 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Flex(Amazing Errors)]]></category>
		<category><![CDATA[Flex app not loading]]></category>
		<category><![CDATA[Flex app not working]]></category>
		<category><![CDATA[Flex app not working without debug version of Flash Player]]></category>
		<category><![CDATA[Flex application not loading]]></category>
		<category><![CDATA[Flex application not running]]></category>
		<category><![CDATA[Flex application not starting]]></category>
		<category><![CDATA[Flex application not working]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=87</guid>
		<description><![CDATA[Recently, I was having a requirement to develop the Flex Log management functionality. After doing lots of research and investing a time for 3 to four days I successfully managed the things to achieve the flex logging Mechanism which can log Line Number, Function Name, Class name into log File.
After delivering the functionality I was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=87&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently, I was having a requirement to develop the Flex Log management functionality. After doing lots of research and investing a time for 3 to four days <strong>I successfully managed the things to achieve the flex logging Mechanism which can log Line Number, Function Name, Class name into log File.</strong></p>
<p>After delivering the functionality I was happy that I have done it  Its really a nice feeling. I was hoping for appreciation but result was bit different I have received a clients mail saying that on some of the machines <span style="color:#0000ff;"><span style="text-decoration:underline;">Flex app not working without debug version of Flash Player</span> </span>, It was really an Head scratching experience when application just stopped running with a white background in screen with clock display.  I was quite surprised that application which were running perfectly well on my PC, wasn&#8217;t displayed properly on some of the PCs.</p>
<p>Hmm.. No Clues at all. I must say Adobe Sometimes handles such situation in very ugly, and with very unprofessional manner, its a horrible handling of such situation by Adobe Flex Framework Developers must criticized them for such things.</p>
<p>After lots of efforts and lots of revision to the newly added code, after doing everything finally the application showed up on one of the problematic machine when I changed the Flash Player version from standard one to debug.</p>
<p><strong>Scenario and Solution</strong></p>
<p>I was using following code</p>
<p>//Call To The Function traceDetails(new Error())</p>
<p>private function traceDetails(err:Error):void { <strong>err.getStackTrace();</strong> } On My part i was using the method &#8220;getStackTrace()&#8221; Here the thing to remember is that <strong>getStackTrace() method is only available with Flash Debugger and Not With Flash player</strong>. So wherever i do not have Flash Debugger installed my application stops running.</p>
<p><strong>So Things to do</strong></p>
<p>1. Check if You’re using any <strong>API call that are only available in Flash Debugger and Not in Flash player</strong> (If You found Try commenting that line Application will start running).</p>
<p>2. Solutions may be <strong>Install Flash Debugger Version </strong>wherever you are running your application but not feasible considering end user because your application is not loaded successfully and you cannot prompt user.</p>
<p>3. <strong>In wrapper class put a check with JavaScript for Flash Debugger version </strong>availability and if it is not available through JavaScript Message Saying you need to have flash layer Debugger version installed along with link to install it J</p>
<p>4. Simply before your Flash Debugger API calls Check <strong>if(Capabilities.isDebugger)</strong> only then use those API or Skip those lines.</p>
<p>I am sure this will solve many peoples problem.</p>
<p>Following thread discussed the same problem</p>
<p><strong> </strong></p>
<p><a href="http://stackoverflow.com/questions/1137223/flex-app-not-working-without-debug-version-of-flash-player">http://stackoverflow.com/questions/1137223/flex-app-not-working-without-debug-version-of-flash-player</a></p>
<p>Another Example how developer suffer due to some mismanaged framework things</p>
<p>http://stackoverflow.com/questions/867788/compile-flex-application-without-debug-optimisation-options-for-flex-compiler</p>
<p><strong> </strong></p>
<p>Best Luck &amp; Happy coding <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Thanks and regards</strong></p>
<p><strong>Shashank Kulkarni</strong></p>
<p>Feel free to comment on the post <img src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=87&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2009/08/27/flex-application-not-working-without-debug-version-of-flash-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>

		<media:content url="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">:)</media:title>
		</media:content>
	</item>
		<item>
		<title>Compilation Error: An internal build error has occurred. Right-click for more information.</title>
		<link>http://shashankkulkarni.wordpress.com/2009/07/30/compilation-error-an-internal-build-error-has-occurred-right-click-for-more-information/</link>
		<comments>http://shashankkulkarni.wordpress.com/2009/07/30/compilation-error-an-internal-build-error-has-occurred-right-click-for-more-information/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 15:35:47 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Flex(Amazing Errors)]]></category>
		<category><![CDATA[Compilation Error: An internal build error has occurred. Right-click for more information.]]></category>
		<category><![CDATA[Compilation Error: Classes must not be nested]]></category>
		<category><![CDATA[Flex compilation error]]></category>
		<category><![CDATA[no line number on compilation error]]></category>
		<category><![CDATA[Parameter initializer unknown or is not a compile-time constant.]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=83</guid>
		<description><![CDATA[This is another chapter to the amazing errors, which does not leave behind any signals how to solve it, and more interestingly what is the exact reason for it.
When we have a pretty large code base where many developers check in and check out the code regularly, it is very hard to find the exact [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=83&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is another chapter to the amazing errors, which does not leave behind any signals how to solve it, and more interestingly what is the exact reason for it.</p>
<p>When we have a pretty large code base where many developers check in and check out the code regularly, it is very hard to find the exact cause of the error which comes while compiling the code. Same thing happened with me and to find the exact cause and the solution for it took a lot of time and interestingly and amazed feeling why it is happening so,</p>
<p>For Demo let’s compile the following code,</p>
<p><strong>Case 1: Error :An internal build error has occurred. Right-click for more information</strong></p>
<pre class="brush: css;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot;
creationComplete=&quot;init()&quot;&gt;

&lt;mx:Script&gt;
&lt;![CDATA[
private function init():void{
var type:String;
switch(type) {
/* case &quot;test&quot;:
break; */
}
}

]]&gt;

&lt;/mx:Script&gt;

&lt;mx:Label text=&quot;Blank Switch&quot;/&gt;
&lt;/mx:Application&gt;
</pre>
<p>While Compiling we get the Compilation error as “An internal build error has occurred. Right-click for more information.” No line number in error and we start scratching our head. But <strong>solution is simple just </strong><strong>remove the switch block </strong>and application will get compiled again and we can move on with coding.</p>
<p><strong>Case 2: Error : </strong><strong>Classes must not be nested.</strong></p>
<p>Replace the init() method and compile the code we get the error <strong>Classes must not be nested. </strong>same problem here but at least this time we will get the error at function call so it is bit easier to track</p>
<p><strong>private</strong> <strong>function</strong> init():<strong>void</strong> {</p>
<p><strong>var</strong> type:String;</p>
<p><strong>switch</strong>(type)  {</p>
<p><strong>case</strong> <strong>&#8220;hi&#8221;</strong>:</p>
<p><em>//var i:int = i+1;</em></p>
<p><strong>break</strong>;</p>
<p>}</p>
<p>}</p>
<p>]]&gt;</p>
<p><strong>solution is simple just </strong><strong>remove the switch block </strong>and application will get compiled again and we can move on with coding.</p>
<p>Same Problem is been discussed here as common problem but some times it becomes hard to find it so.</p>
<p><a href="http://learn.adobe.com/wiki/display/Flex/Flex+Builder+3+Compiler+Errors">http://learn.adobe.com/wiki/display/Flex/Flex+Builder+3+Compiler+Errors</a></p>
<p><strong>Case 3: 1047: Parameter initializer unknown or is not a compile-time constant.</strong></p>
<p>Possible Solutions:</p>
<p>Checking the constant at function argument,Constructor is one of the big cause of such error,</p>
<p>like</p>
<p>package</p>
<p>{</p>
<p>public class Test {</p>
<p>//Constants is Class</p>
<p>//public class Constant{    public static const  LOGINNAME:String=&#8221;test&#8221;       }</p>
<p>public function Test(<strong>s:Sting=Constants.LOGINNAME</strong>){           <strong><br />
</strong></p>
<p>}//Function test Ends Here</p>
<p>}//Class Ends Here</p>
<p>}</p>
<p><strong>Solution: </strong>Here if  we replace <strong>s:Sting=Constants.LOGINNAME by </strong><strong>s:Sting=&#8221;test&#8221; Error is resolved<br />
</strong></p>
<p><strong> </strong><strong>1047: Parameter initializer unknown or is not a compile-time constant. Error will be solved. Note that for error to display we must instatiate the Test class</strong></p>
<p>Some other reasons :</p>
<p>Missing semicolon in Anycode where you have defined constants and Forgot to enter the Semicolon.</p>
<p>Especially if you use ArrayCollection in Constant you mest give a semicolon or else be ready for Unexpeted error.</p>
<p>See if Server is in restart mode then some times project doesnot get cleaned up properly and deployed properly so check Server status as &#8220;Started&#8221; and clean project it will do for you.</p>
<p>Thanks and regards</p>
<p>Shashank Kulkarni</p>
<p>Feel free to comment on the post <img src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=83&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2009/07/30/compilation-error-an-internal-build-error-has-occurred-right-click-for-more-information/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>

		<media:content url="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">:)</media:title>
		</media:content>
	</item>
		<item>
		<title>Adobe Flex Builder 3 is Free</title>
		<link>http://shashankkulkarni.wordpress.com/2009/04/08/adobe-flex-builder-3-is-free/</link>
		<comments>http://shashankkulkarni.wordpress.com/2009/04/08/adobe-flex-builder-3-is-free/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 08:42:57 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[FLEX]]></category>
		<category><![CDATA[Adobe Flex Builder Trail Version Link]]></category>
		<category><![CDATA[Flex builder Download links]]></category>
		<category><![CDATA[Free Flex Builder Link]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=70</guid>
		<description><![CDATA[After making Flex SDK open source ADOBE have bounce back again for Unemployeed Developers with Free Flex builder 3.
Its really a great initiative by ADOBE to cache in the opportunity for spreding the Flex among the common masses.

Link to Flex Builder version  for UnEmployeed professionals : https://freeriatools.adobe.com/learnflex/
Link to Flex Builder version for Student/Institutes/Faculty/Labs : https://freeriatools.adobe.com/flex/
Link [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=70&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After making Flex SDK open source ADOBE have bounce back again for Unemployeed Developers with Free Flex builder 3.</p>
<p>Its really a great initiative by ADOBE to cache in the opportunity for spreding the Flex among the common masses.</p>
<ol>
<li>Link to Flex Builder version  for UnEmployeed professionals : <a href="https://freeriatools.adobe.com/learnflex/">https://freeriatools.adobe.com/learnflex/</a></li>
<li>Link to Flex Builder version for Student/Institutes/Faculty/Labs : <a href="https://freeriatools.adobe.com/flex/">https://freeriatools.adobe.com/flex/</a></li>
<li>Link to Flex Builder version For 60 Days Trial  For Other : <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3email">http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3email</a></li>
</ol>
<p>Happy Coding with Flex Builder <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks and regards</p>
<p>Shashank Kulkarni</p>
<p>Feel free to comment on the post <img src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=70&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2009/04/08/adobe-flex-builder-3-is-free/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>

		<media:content url="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">:)</media:title>
		</media:content>
	</item>
		<item>
		<title>Unit Testing with FlexUnit</title>
		<link>http://shashankkulkarni.wordpress.com/2009/03/05/49/</link>
		<comments>http://shashankkulkarni.wordpress.com/2009/03/05/49/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 12:53:59 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[FLEX]]></category>
		<category><![CDATA[Flex Unit]]></category>
		<category><![CDATA[Flex Unit Framework]]></category>
		<category><![CDATA[Flex Unit Framework *.ppt]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[Unit Testing Framework in Flex]]></category>
		<category><![CDATA[unit Testing in Flex]]></category>
		<category><![CDATA[Unit Testing with FlexUnit]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/2009/03/05/49/</guid>
		<description><![CDATA[Before Reading this documentation. Its been a simple effort by me to share the information whatever i have with all of the world through internet. So whatever written is all what i had understood from the FlexUnit Framework it may have some mistakes so sorry for those. But Please do inform me if you find [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=49&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Before Reading this documentation. Its been a simple effort by me to share the information whatever i have with all of the world through internet. So whatever written is all what i had understood from the FlexUnit Framework it may have some mistakes so sorry for those. But Please do inform me if you find something wrong with it ,so that this can be of great help to everybody who navigates to this page.</p>
<p>This is the First big document which i have made and published so Please do comment if you think you can help me or give me a some suggestions.</p>
<p>Thanks in Advance.</p>
<p><strong>Some Definitions</strong><strong> </strong></p>
<ul>
<li><strong>Code coverage : </strong>Code coverage is a measure used in <a title="Software testing" href="http://en.wikipedia.org/wiki/Software_testing" target="_parent">software testing</a>. It describes the degree to which the <a title="Source code" href="http://en.wikipedia.org/wiki/Source_code" target="_parent">source code</a> of a <a title="Computer program" href="http://en.wikipedia.org/wiki/Computer_program" target="_parent">program</a> has been tested. It is a form of testing that inspects the code directly and is therefore a form of <a title="White box testing" href="http://en.wikipedia.org/wiki/White_box_testing" target="_parent">white box testing</a> (Testing done only on internal specification).</li>
<li><strong>Test harness</strong> or <strong>automated test framework</strong> : It is a collection of software and test data configured to test a program unit by running it under varying conditions and monitoring its behavior and outputs.</li>
</ul>
<p style="text-align:left;">The typical objectives of a test harness are to:</p>
<p style="text-align:left;">Ø Automate the testing process.</p>
<p style="text-align:left;">Ø Execute test suites of test cases.</p>
<p style="text-align:left;">Ø Generate associated test reports.</p>
<p style="text-align:left;">A test harness typically provides the following benefits:</p>
<p style="text-align:left;">Ø Increased productivity due to automation of the testing process.</p>
<p style="text-align:left;">Ø Increased probability that <a title="Regression testing" href="http://en.wikipedia.org/wiki/Regression_testing" target="_parent">regression testing</a> will occur.</p>
<p style="text-align:left;">Ø Increased quality of software components and application.</p>
<ul>
<li><strong>Regression</strong> : Regressions occur whenever software functionality that was previously working correctly stops working as intended. Typically regressions occur as an <a title="Unintended consequence" href="http://en.wikipedia.org/wiki/Unintended_consequence" target="_parent">unintended </a><a title="Unintended consequence" href="http://en.wikipedia.org/wiki/Unintended_consequence" target="_parent">consequence</a> of program changes.</li>
<li><strong>Test Case :</strong> A test case in software engineering is a set of conditions or variables under which a tester will determine whether a application meets specifications. Test cases are often referred to as <strong><a title="Test script" href="http://en.wikipedia.org/wiki/Test_script" target="_parent">test scripts</a></strong>, particularly when written. Written test cases are usually collected into <a title="Test suite" href="http://en.wikipedia.org/wiki/Test_suite" target="_parent">test suites</a>.</li>
<li><strong>Test Oracle</strong> : The mechanism for determining whether a software program or system has passed or failed a test . In some settings an oracle could be a use case or Requirement. It may take many test cases to determine that a software program or system is functioning correctly.</li>
<li><strong>Mock objects</strong> : mock objects are simulated objects that mimic the behavior of real objects in controlled ways. In a <a title="Unit test" href="http://en.wikipedia.org/wiki/Unit_test" target="_parent">unit test</a>, mock objects can <a title="Simulation" href="http://en.wikipedia.org/wiki/Simulation" target="_parent">simulate</a> the behavior of complex, real (non-mock) objects and are therefore useful when a real object is impractical or impossible to incorporate into a unit test.</li>
<li><strong>Feature creep</strong> : It is the proliferation of features in a product where extra features go beyond the basic function of the product and so can result in over-complication rather than simple, elegant design.</li>
</ul>
<p><strong>Unit testing</strong><strong> </strong><strong> </strong></p>
<p><strong>What is Unit and Unit testing?</strong><strong> </strong></p>
<ul>
<li><strong> </strong>Unit testing is a method of testing that verifies the individual units of source code are working properly. A unit is the smallest testable part of an application. In Flex, this means a function, or  more appropriately a method as Flex/ActionScript is an object oriented language.</li>
<li>Unlike many other forms of software testing, unit tests are usually completed by the developer.</li>
<li>The developer tests code at a low level to make sure each method is performing as expected. In theory, if each function is working properly at a low level then the higher levels of integrtion  testing should have fewer errors.<strong> </strong></li>
</ul>
<p><strong>Why ?</strong></p>
<p>To ensures that new additions or changes to a project do not introduce bugs or modify expected behavior.</p>
<ul>
<li>To enables large teams to work in tandem without introducing bugs and confirm that small individual parts of a program, down to specific methods, all return the expected results.</li>
</ul>
<p><strong> </strong><strong>When ?</strong></p>
<p><strong> </strong><strong> </strong>Before writing a code for any functionality we should pass a unit test for every functionality.</p>
<p><strong>Reasons for Unit Testing</strong></p>
<ol>
<li>Tests Reduce Bugs in New Features</li>
<li>Tests Are Good Documentation</li>
<li>Tests Reduce the Cost of Change</li>
<li>Tests Improve Design</li>
<li>Tests Allow Refactoring</li>
<li>Tests Defend Against Other Programmers to make unwanted changes</li>
<li>Testing Forces You to Slow Down and Think which gives clean and simple design</li>
<li>Tests Reduce Fear of worrying about breaking existing code as you add new features<strong>.</strong></li>
</ol>
<p><strong>FlexUnit</strong></p>
<p><strong> </strong>“FlexUnit is an open source framework created by Adobe for unit testing in Flex”</p>
<p>The FlexUnit Framework allows you to create test cases and synchronous tests and evaluate test suites in a test harness application that provides a visual display of all the tests in that test suite.</p>
<p><strong>The visual display has a very clear Representation for</strong></p>
<ul>
<li>Number of Tests Run, Time Taken to Run Tests, Average assertions made per Test, Number of Errors, Failures and so on</li>
<li>It has Filter Option for results and Search functionality</li>
<li>Table View representation where we can check Result, Assrtion , expected and Actual</li>
</ul>
<p>We can Handle Events and Test Visual Components with FlexUnit</p>
<p><strong> </strong><strong>How to include FlexUnit ?</strong></p>
<p>FlexUnit is available for download on Google Code at <a href="http://code.google.com/p/as3flexunitlib/" target="_parent">http://code.google.com/p/as3flexunitlib/.After</a> you extract the file from the zip, you will find a flexunit.swc in the bin directory. You need to add this library to your project</p>
<p><strong>Important API</strong></p>
<ul>
<li><strong>TestRunnerBase</strong>() : TestRunnerBase is the default graphical test runner included with the FlexUnit Framework.</li>
</ul>
<p>Property : test ( To Add the Suite ) , startTest and</p>
<p>Event : TestCompleteEvent</p>
<ul>
<li><strong>TestSuite</strong> : TestSuite to hold the collection of tests to be run.</li>
</ul>
<p>Property : addTest , testCount(): getTestMethodNames():</p>
<ul>
<li><strong>TestCase</strong> –It defines the fixture in which to run multiple tests it inherits Assert class which provides all types of assertions(Assuptions)<strong>.</strong></li>
</ul>
<p><strong>Assertion Types</strong></p>
<ul>
<li><strong>assertEquals</strong> &#8211; Asserts that 2 values are equal.</li>
<li><strong>assertFalse</strong> &#8211; Asserts that a condition is false The first argument can be the message when the assertion fails.</li>
<li><strong>assertMatch</strong> &#8211; Asserts that a string matches a regexp.</li>
<li><strong>assertNoMatch</strong> &#8211; Asserts that a string doesn&#8217;t match a regexp.</li>
<li><strong>assertNotNull</strong> &#8211; Asserts that an object is not null.</li>
<li><strong>assertNotUndefined</strong> &#8211; Asserts that an object is not undefined.</li>
<li><strong>assertNull</strong> &#8211; Asserts that an object is null.</li>
<li><strong>assertStrictlyEquals</strong> &#8211; Asserts that two objects are strickly identical The first argument can be the message when the assertion fails Assert</li>
<li><strong>assertTrue</strong> &#8211; Asserts that a condition is true The first argument can be the message when the assertion fails Assert</li>
<li><strong>assertUndefined</strong> &#8211; Asserts that an object is undefined.</li>
</ul>
<p><strong>Steps in Writing the TestCases</strong><strong> </strong></p>
<ul>
<li>Write a single test</li>
<li>Implement just enough code to get the test to compile</li>
<li>Run the test and see it fail</li>
<li>Implement just enough code to get the test to pass</li>
<li>Run the test and see it pass</li>
<li>Refactor for clarity</li>
<li>Repeat</li>
</ul>
<p><strong> </strong><strong>Unit Testing Example</strong></p>
<p><strong>Problem :</strong>We have to make functionality of checking an opening Balance for Account. If Account is of Type saving , then the Opening balance will be 1000 and if it is of type Current Account then opening balance is 5000.</p>
<p><strong> </strong>FlexUnit is available for download on Google Code at <a href="http://code.google.com/p/as3flexunitlib/" target="_parent">http://code.google.com/p/as3flexunitlib/</a>. After you extract the file from the zip, you will find a flexunit.swc in the bin directory.</p>
<p>Now lets start a TDD process <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ol>
<li>Create a project say TDD</li>
<li>flexunit.swc add this library to your project</li>
<li>In src Create Two Folders as testCases and utils</li>
<li>Our Application level file will be TDD .mxml</li>
</ol>
<p><strong>Step 1 : </strong></p>
<p>In TDD.mxml Create an Object of TestRunnerBase Class Give it name as &#8220;testRunner&#8221; Code will look like this</p>
<p>&lt;flexunit:TestRunnerBase width=&#8221;100%&#8221; height=&#8221;100%&#8221; /&gt;</p>
<p>Write Two Function as</p>
<p><em> </em><em>//Assigns a testSuite to the TestRunnerBase which we will start executing</em></p>
<p><em>//Called from CreationComplete Event of Application</em><strong> </strong></p>
<p><strong>private</strong> <strong>function</strong> onCreationComplete():<strong>void</strong></p>
<p>{</p>
<p>testRunner.test = createSuite();</p>
<p>testRunner.startTest();</p>
<p>}</p>
<p><strong>private</strong> <strong>function</strong> createSuite():TestSuite{</p>
<p><strong>var</strong> testSuite:TestSuite = <strong>new</strong> TestSuite();</p>
<p><strong>return</strong> testSuite;</p>
<p>}<strong> </strong></p>
<p><strong>Step 2 : </strong></p>
<p>Create a class AccountManagerTest Extends TestCase within the package testCases.Write a method “testOpeningBalance” where We will write a test cases for</p>
<p>/**</p>
<p>* Account types are</p>
<p>* s &#8211; Saving Account with minBalance = 500;</p>
<p>* c &#8211; Current Account with minBalance = 1000;</p>
<p>*</p>
<p>*/</p>
<p><strong> </strong><strong>public</strong> <strong>function</strong> testOpeningBalance():<strong>void</strong></p>
<p>{</p>
<p>}</p>
<p><strong>Step 3 : </strong></p>
<p>Create a class <em>AccountManager.</em></p>
<p>Write a two methods <strong> </strong><strong> </strong></p>
<p><strong>openAccount</strong>() &#8211; It will create a account with given type with required respective opening balance.<strong> </strong><strong> </strong></p>
<p><strong>getMinBalance</strong>() &#8211; It will return the balance of the particular Instance which we will test in our test case method testOpeningBalance method of AccountManagerTest.</p>
<p><strong> </strong><strong>The Code should look like :</strong></p>
<p><strong> </strong><strong>private</strong> <strong>var</strong> balance:int = 0;</p>
<p><strong>private</strong> <strong>var</strong> _type:String;</p>
<p><strong>public</strong> <strong>function</strong> openAccount(type:String):<strong>void</strong></p>
<p>{</p>
<p>_type = type.toLowerCase();</p>
<p>}</p>
<p><strong>public</strong> <strong>function</strong> getMinBalance():Number{</p>
<p><strong>return</strong> balance;</p>
<p>}</p>
<p><strong>Step 4 :</strong></p>
<p>Add the Tests to the testOpeningBalance method of AccountManagerTest class as</p>
<p><strong>public</strong> <strong>function</strong> testOpeningBalance():<strong>void</strong></p>
<p>{</p>
<p><strong>var</strong> validatedeposite:AccountManager = <strong>new</strong> AccountManager();</p>
<p>validatedeposite.openAccount(<strong>&#8220;S&#8221;</strong>);</p>
<p>assertEquals(<strong>&#8220;Balance after Opening Saving Account is 1000&#8243;</strong>, 1000, validatedeposite.getMinBalance());</p>
<p>validatedeposite.openAccount(<strong>&#8220;C&#8221;</strong>);</p>
<p>assertEquals(<strong>&#8220;Balance after Opening Current Account is 5000&#8243;</strong>, 5000, validatedeposite.getMinBalance());</p>
<p>}</p>
<p>Now Run The Project see that the Test Case Fails</p>
<p><strong>Step 5 :</strong></p>
<p>Now implement just enough code so that the testCase Passes.</p>
<p>For this rewrite the method openAccount() in <em>AccountManager</em> class so that the testCase passes.</p>
<p>The Code looks like this,<strong> </strong></p>
<p><strong>public</strong> <strong>function</strong> openAccount(type:String):<strong>void</strong></p>
<p>{</p>
<p>_type = type.toLowerCase();</p>
<p><strong>if</strong>(_type==<strong>&#8217;s&#8217;</strong>)</p>
<p>{</p>
<p>balance = 1000;</p>
<p>}<strong>else</strong> <strong>if</strong>(_type==<strong>&#8216;c&#8217;</strong>)</p>
<p>{</p>
<p>balance = 5000;</p>
<p>}</p>
<p>}</p>
<p>Run the Project again Test Case Passes</p>
<p>Now I guess You are Rocking with Flex Unit Hurrey.</p>
<p><span style="text-decoration:underline;"><strong>Download Links are As Follows</strong></span></p>
<p><a title="Flex Unit Sample Application" href="http://shashankkulkarni.files.wordpress.com/2009/03/flexunit.doc" target="_blank">flexUnit Sample Application zipped and renamed</a></p>
<p>(Download the file and rename .doc by .zip)</p>
<p><strong>All Flex Unit Resources can be found at</strong></p>
<p><a title="Flex Unit Resources" href="https://opensource.adobe.com/wiki/display/flexunit/Developer+Documentation" target="_blank"><strong>http://opensource.adobe.com/wiki/display/flexunit/Developer+Documentation</strong> </a></p>
<p>Say Cheese</p>
<p>Thanks and regards</p>
<p>Shashank Kulkarni.</p>
<p>Feel free to comment on the post <img src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<a name="pd_a_1451676"></a><div class="PDS_Poll" id="PDI_container1451676" style="display:inline-block;"></div><script type="text/javascript" language="javascript" charset="utf-8" src="http://static.polldaddy.com/p/1451676.js"></script>
		<noscript>
		<a href="http://answers.polldaddy.com/poll/1451676/">View This Poll</a><br/><span style="font-size:10px;"><a href="http://answers.polldaddy.com">polling</a></span>
		</noscript>
<p><a class="alignleft" title="Download FlexUnit Presentation" href="http://shashankkulkarni.files.wordpress.com/2009/03/flexunit.ppt" target="_blank">Download FlexUnit Presentation</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=49&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2009/03/05/49/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>

		<media:content url="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">:)</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding ToolTip to Datagrid and Combobox</title>
		<link>http://shashankkulkarni.wordpress.com/2008/09/27/adding-tooltip-to-datagrid-and-combobox/</link>
		<comments>http://shashankkulkarni.wordpress.com/2008/09/27/adding-tooltip-to-datagrid-and-combobox/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 13:18:09 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Best of Flex Utillity]]></category>
		<category><![CDATA[Adding ToolTip to Datagrid and Combobox]]></category>

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

Adding Tool Tips to Datagrid and Combobox  Guess How Can we do it  ,,, Dont Worry we have solution just check this    just add the property itemRenderer=”mx.controls.Label” and Your Done

&#60;?xml version=”1.0″ encoding=”utf-8″?&#62;

&#60;!– Adding Tooltips to Data grid and Combobox –&#62;
&#60;mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”
layout=”vertical”
verticalAlign=”middle”
backgroundColor=”white”&#62;

&#60;mx:XML id=”cmbDP”&#62;
&#60;nodes&#62;
&#60;node Alphabets=”Akola”/&#62;
&#60;node Alphabets=”Buldhana”/&#62;
&#60;node Alphabets=”Chikhli”/&#62;
&#60;node Alphabets=”Dhule”/&#62;
&#60;node Alphabets=”Elora”/&#62;
&#60;/nodes&#62;
&#60;/mx:XML&#62;

&#60;mx:XML id=”dataGridDP”&#62;
&#60;nodes&#62;
&#60;node Alphabets=”A” A-ZString=”The quick brown [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=27&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div class="entry">
<div class="snap_preview">
<p>Adding Tool Tips to Datagrid and Combobox <img class="wp-smiley" src="https://s-ssl.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=")" /> Guess How Can we do it  ,,, Dont Worry we have solution just check this <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   just add the property itemRenderer=”mx.controls.Label” and Your Done</p>
<pre class="brush: css;">
&lt;?xml version=”1.0″ encoding=”utf-8″?&gt;

&lt;!– Adding Tooltips to Data grid and Combobox –&gt;
&lt;mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”
layout=”vertical”
verticalAlign=”middle”
backgroundColor=”white”&gt;

&lt;mx:XML id=”cmbDP”&gt;
&lt;nodes&gt;
&lt;node Alphabets=”Akola”/&gt;
&lt;node Alphabets=”Buldhana”/&gt;
&lt;node Alphabets=”Chikhli”/&gt;
&lt;node Alphabets=”Dhule”/&gt;
&lt;node Alphabets=”Elora”/&gt;
&lt;/nodes&gt;
&lt;/mx:XML&gt;

&lt;mx:XML id=”dataGridDP”&gt;
&lt;nodes&gt;
&lt;node Alphabets=”A” A-ZString=”The quick brown fox jumped over the lazy dog” /&gt;
&lt;node Alphabets=”B” A-ZString=”The quick brown fox jumped over the lazy dog” /&gt;
&lt;node Alphabets=”C” A-ZString=”The quick brown fox jumped over the lazy dog” /&gt;
&lt;node Alphabets=”D” A-ZString=”The quick brown fox jumped over the lazy dog” /&gt;
&lt;node Alphabets=”E” A-ZString=”The quick brown fox jumped over the lazy dog” /&gt;
&lt;/nodes&gt;
&lt;/mx:XML&gt;

&lt;mx:DataGrid id=”dataGrid”
dataProvider=”{dataGridDP.node}”
width=”300″
height=”200″&gt;
&lt;mx:columns&gt;
&lt;mx:DataGridColumn dataField=”@Alphabets” itemRenderer=”mx.controls.Label”
headerText=”Alphabets”
headerRenderer=”mx.controls.Label” /&gt;
&lt;mx:DataGridColumn dataField=”@A-ZString” itemRenderer=”mx.controls.Label”
headerText=”Lines Containing the A-Z Alphabets Check it”
headerRenderer=”mx.controls.Label” &gt;

&lt;/mx:DataGridColumn&gt;

&lt;/mx:columns&gt;
&lt;/mx:DataGrid&gt;

&lt;mx:ComboBox id=”cmb”  width=”60″ toolTip=”{cmb.selectedLabel}” labelField=”@Alphabets” dataProvider=”{cmbDP.node}” itemRenderer=”mx.controls.Label”/&gt;

&lt;/mx:Application&gt;
</pre>
<p>Best Luck<br />
<strong>Thanks and regards</strong></p>
<p><strong>Shashank Kulkarni</strong></p>
<p>Feel free to mail me <img class="wp-smiley" src="https://s-ssl.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=")" /> <a href="mailto:shashank.pawan@gmail.com"><span style="color:#666666;">shashank.pawan@gmail.com</span></a></div>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=27&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2008/09/27/adding-tooltip-to-datagrid-and-combobox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>

		<media:content url="//s-ssl.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">)</media:title>
		</media:content>

		<media:content url="//s-ssl.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">)</media:title>
		</media:content>
	</item>
		<item>
		<title>Searching an item within Array, Arraycollection</title>
		<link>http://shashankkulkarni.wordpress.com/2008/08/26/searching-an-item-within-array-arraycollection/</link>
		<comments>http://shashankkulkarni.wordpress.com/2008/08/26/searching-an-item-within-array-arraycollection/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 14:07:15 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Best of Flex Utillity]]></category>
		<category><![CDATA[Arraycollection]]></category>
		<category><![CDATA[Searching an item within Array]]></category>
		<category><![CDATA[Searching the litem within list item]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=23</guid>
		<description><![CDATA[Searching Within the Array
We all know Array and Arraycollection provides the facilities of doing sort in themselves but some times there are needs to search the Array/Arraycollection depending on the entered search term. So that is something which we need to implement. So here is the simple logic to search the item in the Array/Arraycollection
 
&#60;?xml [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=23&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal"><strong>Searching Within the Array</strong></p>
<p class="MsoNormal">We all know Array and Arraycollection provides the facilities of doing sort in themselves but some times there are needs to search the Array/Arraycollection depending on the entered search term. So that is something which we need to implement. So here is the simple logic to search the item in the Array/Arraycollection</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;?xml version=&#8221;1.0&#8243;?&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:Application</span><span style="font-size:10pt;font-family:&quot;"> xmlns:mx=&#8221;</span><span style="font-size:10pt;font-family:&quot;">http://www.adobe.com/2006/mxml</span><span style="font-size:10pt;font-family:&quot;">&#8221; layout=&#8221;</span><span style="font-size:10pt;font-family:&quot;">absolute</span><span style="font-size:10pt;font-family:&quot;">&#8221; initialize=&#8221;initApp()&#8221;</span><span style="font-size:10pt;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span><span style="font-size:10pt;font-family:&quot;">&lt;!&#8211;Shashank Kulkarni&#8211;&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span><span style="font-size:10pt;font-family:&quot;">&lt;mx:Script&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>&lt;![CDATA[</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">import</span></strong><span style="font-size:10pt;font-family:&quot;"> mx.utils.StringUtil;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">import</span></strong><span style="font-size:10pt;font-family:&quot;"> mx.utils.ObjectUtil;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">import</span></strong><span style="font-size:10pt;font-family:&quot;"> mx.controls.Alert;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">import</span></strong><span style="font-size:10pt;font-family:&quot;"> mx.collections.ArrayCollection;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span><span style="font-size:10pt;font-family:&quot;"><span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">private</span></strong><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> arr:Array= </span><strong><span style="font-size:10pt;font-family:&quot;">new</span></strong><span style="font-size:10pt;font-family:&quot;"> Array(</span><strong><span style="font-size:10pt;font-family:&quot;">'Shashank'</span></strong><span style="font-size:10pt;font-family:&quot;">, </span><strong><span style="font-size:10pt;font-family:&quot;">'Tushar'</span></strong><span style="font-size:10pt;font-family:&quot;">, </span><strong><span style="font-size:10pt;font-family:&quot;">'Ashish'</span></strong><span style="font-size:10pt;font-family:&quot;">,</span><strong><span style="font-size:10pt;font-family:&quot;">'Kailas'</span></strong><span style="font-size:10pt;font-family:&quot;">,</span><strong><span style="font-size:10pt;font-family:&quot;">'Rahul'</span></strong><span style="font-size:10pt;font-family:&quot;">,</span><strong><span style="font-size:10pt;font-family:&quot;">'Pankaj'</span></strong><span style="font-size:10pt;font-family:&quot;">,</span><strong><span style="font-size:10pt;font-family:&quot;">'Shrikant'</span></strong><span style="font-size:10pt;font-family:&quot;">,</span><strong><span style="font-size:10pt;font-family:&quot;">'Amol'</span></strong><span style="font-size:10pt;font-family:&quot;">,</span><strong><span style="font-size:10pt;font-family:&quot;">'pravin'</span></strong><span style="font-size:10pt;font-family:&quot;">);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>[</span><strong><span style="font-size:10pt;font-family:&quot;">Bindable</span></strong><span style="font-size:10pt;font-family:&quot;">]</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">private</span></strong><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> ac:ArrayCollection= </span><strong><span style="font-size:10pt;font-family:&quot;">new</span></strong><span style="font-size:10pt;font-family:&quot;"> ArrayCollection([{Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Shashank'</span></strong><span style="font-size:10pt;font-family:&quot;">}, {Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Tushar'</span></strong><span style="font-size:10pt;font-family:&quot;">}, {Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Ashish'</span></strong><span style="font-size:10pt;font-family:&quot;">},{Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Kailas'</span></strong><span style="font-size:10pt;font-family:&quot;">},{Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Rahul'</span></strong><span style="font-size:10pt;font-family:&quot;">},{Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Pankaj'</span></strong><span style="font-size:10pt;font-family:&quot;">},{Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Shrikant'</span></strong><span style="font-size:10pt;font-family:&quot;">},{Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'Amol'</span></strong><span style="font-size:10pt;font-family:&quot;">},{Name:</span><strong><span style="font-size:10pt;font-family:&quot;">'pravin'</span></strong><span style="font-size:10pt;font-family:&quot;">}]);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span><span style="font-size:10pt;font-family:&quot;"><span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">private</span></strong><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> resultAC:Array;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">private</span></strong><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">function</span></strong><span style="font-size:10pt;font-family:&quot;"> initApp():</span><strong><span style="font-size:10pt;font-family:&quot;">void</span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dgList.dataProvider = ac;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">txtResult.text = </span><strong><span style="font-size:10pt;font-family:&quot;">&#8221;</span></strong><span style="font-size:10pt;font-family:&quot;">;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">txiSearch.text = </span><strong><span style="font-size:10pt;font-family:&quot;">&#8221;</span></strong><span style="font-size:10pt;font-family:&quot;">;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">private</span></strong><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">function</span></strong><span style="font-size:10pt;font-family:&quot;"> search():</span><strong><span style="font-size:10pt;font-family:&quot;">void</span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">resultAC =<span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">new</span></strong><span style="font-size:10pt;font-family:&quot;"> Array();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">for</span></strong><span style="font-size:10pt;font-family:&quot;">(</span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> i:int=0;i&lt;arr.length;i++)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> tempArr:Array = </span><strong><span style="font-size:10pt;font-family:&quot;">new</span></strong><span style="font-size:10pt;font-family:&quot;"> Array();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> str:String = String(arr[i]).toLowerCase();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><span style="font-size:10pt;font-family:&quot;">tempArr = str.match(StringUtil.trim(txiSearch.text).toLowerCase());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">if</span></strong><span style="font-size:10pt;font-family:&quot;">(tempArr!=</span><strong><span style="font-size:10pt;font-family:&quot;">null</span></strong><span style="font-size:10pt;font-family:&quot;">)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:&quot;">if</span></strong><span style="font-size:10pt;font-family:&quot;">(tempArr.index==0)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">resultAC.push({Name:arr[i]});</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">assignValues();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"> <strong><span style="font-size:10pt;font-family:&quot;">private</span></strong><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">function</span></strong><span style="font-size:10pt;font-family:&quot;"> searchAc():</span><strong><span style="font-size:10pt;font-family:&quot;">void</span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">resultAC =<span> </span></span><strong><span style="font-size:10pt;font-family:&quot;">new</span></strong><span style="font-size:10pt;font-family:&quot;"> Array();</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:&quot;">for</span></strong><span style="font-size:10pt;font-family:&quot;">(</span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> i:int=0;i&lt;ac.length;i++)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> tempArr:Array = </span><strong><span style="font-size:10pt;font-family:&quot;">new</span></strong><span style="font-size:10pt;font-family:&quot;"> Array();</span></p>
<p class="MsoNormal"> <strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> str:String = String(ac[i].Name).toLowerCase();</span></p>
<p class="MsoNormal"> <span style="font-size:10pt;font-family:&quot;">tempArr = str.match(StringUtil.trim(txiSearch.text).toLowerCase());</span></p>
<p class="MsoNormal"> <strong><span style="font-size:10pt;font-family:&quot;">if</span></strong><span style="font-size:10pt;font-family:&quot;">(tempArr!=</span><strong><span style="font-size:10pt;font-family:&quot;">null</span></strong><span style="font-size:10pt;font-family:&quot;">)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:&quot;">if</span></strong><span style="font-size:10pt;font-family:&quot;">(tempArr.index==0)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span><span style="font-size:10pt;font-family:&quot;">resultAC.push({Name:ac[i].Name});</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">assignValues();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span> </p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:&quot;">private</span></strong><span style="font-size:10pt;font-family:&quot;"> </span><strong><span style="font-size:10pt;font-family:&quot;">function</span></strong><span style="font-size:10pt;font-family:&quot;"> assignValues():</span><strong><span style="font-size:10pt;font-family:&quot;">void</span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dgList.dataProvider = resultAC;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">txtResult.text = </span><strong><span style="font-size:10pt;font-family:&quot;">&#8221;</span></strong><span style="font-size:10pt;font-family:&quot;">;</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:&quot;">for</span></strong><span style="font-size:10pt;font-family:&quot;">(</span><strong><span style="font-size:10pt;font-family:&quot;">var</span></strong><span style="font-size:10pt;font-family:&quot;"> j:int=0;j&lt;resultAC.length;j++)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">txtResult.text = txtResult.text + ObjectUtil.toString(resultAC[j].Name);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">]]&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;/mx:Script&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:Label</span><span style="font-size:10pt;font-family:&quot;"> text=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Enter Search Term :</span><span style="font-size:10pt;font-family:&quot;">&#8221; x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">116</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">26</span><span style="font-size:10pt;font-family:&quot;">&#8220;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:TextInput</span><span style="font-size:10pt;font-family:&quot;"> id=&#8221;</span><span style="font-size:10pt;font-family:&quot;">txiSearch</span><span style="font-size:10pt;font-family:&quot;">&#8221; x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">284</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">24</span><span style="font-size:10pt;font-family:&quot;">&#8221; enter=&#8221;search()&#8221;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"> <span style="font-size:10pt;font-family:&quot;">&lt;mx:Button</span><span style="font-size:10pt;font-family:&quot;"> id=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Search</span><span style="font-size:10pt;font-family:&quot;">&#8221; label=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Search Array Item</span><span style="font-size:10pt;font-family:&quot;">&#8221; click=&#8221;search()&#8221; x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">114</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">65</span><span style="font-size:10pt;font-family:&quot;">&#8220;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:Button</span><span style="font-size:10pt;font-family:&quot;"> id=&#8221;</span><span style="font-size:10pt;font-family:&quot;">SearchAc</span><span style="font-size:10pt;font-family:&quot;">&#8221; label=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Search ArrayCollection Item</span><span style="font-size:10pt;font-family:&quot;">&#8221; click=&#8221;searchAc()&#8221;<span> </span>x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">280</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">65</span><span style="font-size:10pt;font-family:&quot;">&#8220;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:Text</span><span style="font-size:10pt;font-family:&quot;"> x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">174</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">139</span><span style="font-size:10pt;font-family:&quot;">&#8221; id=&#8221;</span><span style="font-size:10pt;font-family:&quot;">txtResult</span><span style="font-size:10pt;font-family:&quot;">&#8220;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:Label</span><span style="font-size:10pt;font-family:&quot;"> x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">477</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">26</span><span style="font-size:10pt;font-family:&quot;">&#8221; text=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Searches Within Array On Direct Enter</span><span style="font-size:10pt;font-family:&quot;">&#8220;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:DataGrid</span><span style="font-size:10pt;font-family:&quot;"> x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">153</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">195</span><span style="font-size:10pt;font-family:&quot;">&#8221; id=&#8221;</span><span style="font-size:10pt;font-family:&quot;">dgList</span><span style="font-size:10pt;font-family:&quot;">&#8220;</span><span style="font-size:10pt;font-family:&quot;">&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:columns&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:DataGridColumn</span><span style="font-size:10pt;font-family:&quot;"> headerText=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Name</span><span style="font-size:10pt;font-family:&quot;">&#8221; dataField=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Name</span><span style="font-size:10pt;font-family:&quot;">&#8220;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;/mx:columns&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;/mx:DataGrid&gt;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">&lt;mx:Button</span><span style="font-size:10pt;font-family:&quot;"> x=&#8221;</span><span style="font-size:10pt;font-family:&quot;">341</span><span style="font-size:10pt;font-family:&quot;">&#8221; y=&#8221;</span><span style="font-size:10pt;font-family:&quot;">247</span><span style="font-size:10pt;font-family:&quot;">&#8221; label=&#8221;</span><span style="font-size:10pt;font-family:&quot;">Refresh</span><span style="font-size:10pt;font-family:&quot;">&#8221; click=&#8221;initApp()&#8221;</span><span style="font-size:10pt;font-family:&quot;">/&gt;</span></p>
<p class="MsoNormal"> <span style="font-size:10pt;font-family:&quot;">&lt;/mx:Application&gt;</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p>Best Luck   <img class="wp-smiley" src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=")" width="15" height="15" /></p>
<p><strong>Thanks and regards</strong></p>
<p><strong>Shashank Kulkarni</strong></p>
<p>Feel free to mail me <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <a href="mailto:shashank.pawan@gmail.com"><span style="color:#666666;">shashank.pawan@gmail.com</span></a></p>
<p class="MsoNormal"> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shashankkulkarni.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shashankkulkarni.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=23&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2008/08/26/searching-an-item-within-array-arraycollection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>

		<media:content url="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">)</media:title>
		</media:content>
	</item>
		<item>
		<title>Hyperlinking In FLEX</title>
		<link>http://shashankkulkarni.wordpress.com/2008/06/24/hyperlinking-in-flex/</link>
		<comments>http://shashankkulkarni.wordpress.com/2008/06/24/hyperlinking-in-flex/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 07:45:20 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Best of Flex Utillity]]></category>
		<category><![CDATA[Hyperlink]]></category>
		<category><![CDATA[Hyperlinking In FLEX]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=21</guid>
		<description><![CDATA[Hi,
 
Probably Hyperlinking is one of the most commonly seen thing to navigate to other page.
But to write this post here i thanks to one of mine Orkut friends querry.
 
For such querries i am always welcome.. So lets get on with example
 
The label, text, and textarea controls can dispatch a link event when the user selects [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=21&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="margin:0;">Hi,</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">Probably Hyperlinking is one of the most commonly seen thing to navigate to other page.</p>
<p class="MsoNormal" style="margin:0;">But to write this post here i thanks to one of mine Orkut friends querry.</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">For such querries i am always welcome.. So lets get on with example</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">The label, text, and textarea controls can dispatch a link event when the user selects a hyperlink in the Htmltext property.</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">About link Event :</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">link : Dispatched when a user clicks a hyperlink in an HTML-enabled text field, where the URL begins with <code><span style="font-size:10pt;">"event:"</span></code>.</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;"><strong>To generate the link event, prefix the hyperlink destination with <span style="color:#3366ff;">event:</span></strong></p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;"><span> </span>As the following example shows</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">&lt;?xml version=&#8221;1.0&#8243;?&gt;</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221;</p>
<p class="MsoNormal" style="margin:0;"><span>    </span>borderStyle=&#8221;solid&#8221;</p>
<p class="MsoNormal" style="margin:0;"><span>    </span>backgroundGradientColors=&#8221;[#FFFFFF, #FFFFFF]&#8220;&gt;</p>
<p class="MsoNormal" style="margin:0;"><span>    </span></p>
<p class="MsoNormal" style="margin:0;"><span>    </span>&lt;mx:Script&gt;</p>
<p class="MsoNormal" style="margin:0;"><span>        </span>&lt;![CDATA[</p>
<p class="MsoNormal" style="margin:0;"><span>            </span>import flash.events.TextEvent;</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;"><span>            </span>public function linkHandler(event:TextEvent):void {</p>
<p class="MsoNormal" style="margin:0;"><span>                </span>myLabel.text="link occured.";</p>
<p class="MsoNormal" style="margin:0;"><span>                </span>// Open the link in a new window.</p>
<p class="MsoNormal" style="margin:0;"><span>                </span>navigateToURL(new URLRequest(event.text), '_blank');</p>
<p class="MsoNormal" style="margin:0;"><span>            </span>}</p>
<p class="MsoNormal" style="margin:0;"><span>        </span>]]&gt;</p>
<p class="MsoNormal" style="margin:0;"><span>    </span>&lt;/mx:Script&gt;</p>
<p class="MsoNormal" style="margin:0;"><span>    </span></p>
<p class="MsoNormal" style="margin:0;"><span>    </span>&lt;mx:Label selectable=&#8221;true&#8221; link=&#8221;linkHandler(event);&#8221;&gt;</p>
<p class="MsoNormal" style="margin:0;"><span>        </span>&lt;mx:htmlText&gt;&lt;![CDATA[&lt;a href='event:http://www.adobe.com'&gt;Adobe&lt;/a&gt;]]&gt;&lt;/mx:htmlText&gt;</p>
<p class="MsoNormal" style="margin:0;"><span>    </span>&lt;/mx:Label&gt;<span>  </span></p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;"><span>    </span>&lt;mx:TextArea id=&#8221;myLabel&#8221;/&gt;</p>
<p class="MsoNormal" style="margin:0;">&lt;/mx:Application&gt;</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">Thanks and regards</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">Shashank Kulkarni</p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;">Feel free to mail me <span style="font-family:Wingdings;"><span>J</span></span> shashank.pawan@gmail.com</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shashankkulkarni.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shashankkulkarni.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=21&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2008/06/24/hyperlinking-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>
	</item>
		<item>
		<title>Sample Full Screen Application in Flex</title>
		<link>http://shashankkulkarni.wordpress.com/2008/06/20/sample-full-screen-application-in-flex/</link>
		<comments>http://shashankkulkarni.wordpress.com/2008/06/20/sample-full-screen-application-in-flex/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 14:06:15 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Best of Flex Utillity]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=19</guid>
		<description><![CDATA[Hello All,
 
FullScreen Application in Flex,, Yup sounds very interesting…
 
It has been one of our project requirement , I did it quite long days ago, So I thought why not put this thing here on blog so if somebody faces any problem with it he can use this code … Why Not?
 
Before proceeding  as you makes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=19&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Hello All,</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">FullScreen Application in Flex,, Yup sounds very interesting…</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">It has been one of our project requirement , I did it quite long days ago, So I thought why not put this thing here on blog so if somebody faces any problem with it he can use this code … <strong>Why Not?</strong></span></span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:small;font-family:Times New Roman;"> </span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><strong>Before proceeding<span>  </span>as </strong>you makes your new project goto your HTML wrapper i.e. </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-family:Times New Roman;"><strong><span style="font-size:14pt;">index.template.html </span></strong><span style="font-size:small;">. Now </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:14pt;"><span style="font-family:Times New Roman;">Step 1.</span></span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;">In the script section add comman (,) in last property of<strong><span>  </span></strong></span></span><strong><span style="font-size:10pt;font-family:'Courier New';">AC_FL_RunContent</span></strong><span style="font-size:10pt;font-family:'Courier New';"> function and add the line </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:'Courier New';">&#8220;allowFullScreen&#8221;, &#8220;true&#8221;</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">Also in <strong>&lt;object&gt;</strong> tag add</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:'Courier New';">&lt;param name=&#8221;allowFullScreen&#8221; value=&#8221;true&#8221; /&gt;</span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">Property so that we can avoid upcoming Security error.</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:'Courier New';">Step 2. </span></strong><span style="font-size:10pt;font-family:'Courier New';">Add the following code</span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:'Courier New';"> </span></strong></p>
<p class="MsoNormal" style="text-indent:0.5in;margin:0;"><span style="font-size:10pt;font-family:'Courier New';">private var flag:Boolean = false;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span>private function clickHandler(e:Event):void</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>      </span>if(flag==false)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>      </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>            </span>flag=true;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>            </span>stage.displayState = StageDisplayState.FULL_SCREEN;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>      </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>  </span>else if(flag==true)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>  </span>{</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>      </span>flag=false;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>      </span>stage.displayState = StageDisplayState.NORMAL;</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span><span>  </span>}<span>  </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"><span>      </span>}</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';">Now Stage Class:&#8211; </span><span style="font-size:small;font-family:Times New Roman;">The Stage class represents the main drawing area. i.e it represents the entire area where Flash content is shown. </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;">Also important thing is that </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:small;"><span style="font-family:Times New Roman;">We don’t create object of this class as obj:Stage=new Stage();</span></span></strong></p>
<p><strong><span style="font-size:small;font-family:Times New Roman;">The Stage object is not globally accessible. You need to access it through the </span></strong><code><strong><span style="font-size:10pt;">stage</span></strong></code><strong><span style="font-size:small;"><span style="font-family:Times New Roman;"> property of a DisplayObject instance</span></span></strong></p>
<p><span style="font-size:10pt;font-family:'Courier New';">Most importantly we use</span></p>
<p><span style="font-size:10pt;font-family:'Courier New';">displayState : </span><span style="font-size:small;font-family:Times New Roman;">A value from the StageDisplayState class that specifies which display state to use . so this is how it should look as below</span></p>
<p><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;">This is small code of sweet Fulscreen Player Application sample application… Do check it its muska…Really </span><span style="font-family:Wingdings;"><span>J</span></span><span style="font-family:Times New Roman;"> </span></span></p>
<p><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;">&lt;mx:Application xmlns:mx=&#8221;http://www.adobe.com/2006/mxml&#8221; layout=&#8221;absolute&#8221; backgroundColor=&#8221;#000000&#8243;&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>&lt;mx:Script&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                        </span>&lt;![CDATA[</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span>import mx.collections.ArrayCollection;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span>[Bindable]</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span>private var arrList:ArrayCollection = new ArrayCollection([{Label:'Central Beer',Path:'assets/get_video1111.flv'},{Label:'Clinton',Path:'assets/Clinton.flv'},{Label:'Banned Ad',Path:'assets/bannedAd.flv'},{Label:'Love',Path:'assets/get_video.flv'},{Label:'Darling',Path:'assets/get_video2.flv'},{Label:'Just Call US',Path:'assets/get_video3.flv'}])</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span>private var flag:Boolean = false;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span>private function clickHandler(e:Event):void</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span>{</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                                </span>if(flag==false)</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                                </span>{</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                                            </span>flag=true;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                                            </span>stage.displayState = StageDisplayState.FULL_SCREEN;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                                </span>}</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span><span>  </span>else if(flag==true)</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span><span>  </span>{</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                                </span>flag=false;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                                </span>stage.displayState = StageDisplayState.NORMAL;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>   </span><span> </span><span>          </span>}<span>  </span></span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>                                    </span>}</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>             </span></span></span><span style="font-size:small;"><span style="font-family:Times New Roman;">]]&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>&lt;/mx:Script&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span></span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span></span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>&lt;mx:LinkButton label=&#8221;Full Screen&#8221; id=&#8221;btnTest&#8221; click=&#8221;clickHandler(event)&#8221; y=&#8221;0&#8243; height=&#8221;16&#8243; fontSize=&#8221;13&#8243; color=&#8221;#ffffff&#8221; width=&#8221;109&#8243;/&gt; </span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>&lt;mx:VideoDisplay id=&#8221;vduSong&#8221; x=&#8221;0&#8243; y=&#8221;24&#8243;<span>  </span>width=&#8221;100%&#8221; height=&#8221;100%&#8221; source=&#8221;{cmbSongList.selectedItem.Path}&#8221;/&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>&lt;mx:ComboBox id=&#8221;cmbSongList&#8221; x=&#8221;259&#8243; y=&#8221;-1&#8243; dataProvider=&#8221;{arrList}&#8221; labelField=&#8221;Label&#8221;&gt;&lt;/mx:ComboBox&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><span>            </span>&lt;mx:Label x=&#8221;120&#8243; y=&#8221;-1&#8243; text=&#8221;Currently Playing &#8221; color=&#8221;#ffffff&#8221; fontSize=&#8221;14&#8243;/&gt;</span></span></p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;">&lt;/mx:Application&gt;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:'Courier New';"> </span></p>
<p class="MsoNormal" style="margin:0;"><strong><span style="font-size:10pt;font-family:'Courier New';"> </span></strong></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"><strong> </strong>Thanks and Regard</span></p>
<p class="MsoNormal" style="margin:0;"> </p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"><strong>Shashank Kulkarni</strong></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"><strong></strong></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"><strong>Feel free to mail me <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   </strong><a href="mailto:shashank.pawan@gmail.com"><strong>shashank.pawan@gmail.com</strong></a></span></p>
<p class="MsoNormal" style="margin:0;"> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shashankkulkarni.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shashankkulkarni.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=19&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2008/06/20/sample-full-screen-application-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>
	</item>
		<item>
		<title>Validation for stopping wrong file Upload at Browsing time</title>
		<link>http://shashankkulkarni.wordpress.com/2008/04/28/validation-for-stopping-wrong-file-upload-at-browsing-time/</link>
		<comments>http://shashankkulkarni.wordpress.com/2008/04/28/validation-for-stopping-wrong-file-upload-at-browsing-time/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 08:47:01 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Best of Flex Utillity]]></category>
		<category><![CDATA[Download Validation in Flex]]></category>
		<category><![CDATA[Filetype checking validations]]></category>
		<category><![CDATA[Upload]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=10</guid>
		<description><![CDATA[Hi,
We all know that to make use of browse window facility, Flex provides inbuilt class &#8216;FileReference&#8217; which has method named &#8220;browse&#8221;, Which allows us to open the File Browsing window.
To restrict the Browsing window to open some limited file extensions(Such as .mp3,.mp4 file only), we make use of  FileFilter class which holds the fileFilter to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=10&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi,</p>
<p>We all know that to make use of browse window facility, Flex provides inbuilt class &#8216;FileReference&#8217; which has method named &#8220;browse&#8221;, Which allows us to open the File Browsing window.</p>
<p>To restrict the Browsing window to open some limited file extensions(Such as .mp3,.mp4 file only), we make use of  FileFilter class which holds the fileFilter to be applied to the browsing window</p>
<p>eg.</p>
<p>private var allFileFilter:FileFilter = new FileFilter(&#8220;All, *.mp3; *.mp4; *.flv; *.wmv; *.mpeg; *.mpg;&#8221;, &#8220;*.mp3; *.mp4; *.flv; *.wmv; *.mpeg; *.mpg; &#8220;);</p>
<p>private var fileRef:FileReference = new FileReference();<br />
fileRef.browse([allFileFilter]) ;</p>
<p>But this File filter validation can be broken easily to Upload wrong files, For this just type *.* and press enter , Here you see all files available for upload Now select Any Invalid file and go with upload.</p>
<p>So in such cases we need to apply self made file extesion validation logic which should be able to verify the extension of the file to be uploaded.</p>
<p>So here is short and sweet sample code to workout this logic,</p>
<p>Best Luck <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p> </p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;mx:Application xmlns:mx=&#8221;<a href="http://www.adobe.com/2006/mxml">http://www.adobe.com/2006/mxml</a>&#8220;  pageTitle=&#8221;Upload Functionality Usage And Validation&#8221; layout=&#8221;absolute&#8221;&gt;<br />
 &lt;mx:Script&gt;<br />
  &lt;![CDATA[<br />
   import mx.utils.StringUtil;</p>
<p>   <br />
   /**<br />
   * Standard File extensions allowed to be Uploaded<br />
   */<br />
   private var fileTypeArray:Array = ["mp3","mp4","flv","wmv","mpeg","mpg","rtf","doc","txt"];<br />
   <br />
   /**<br />
   * Selected file type,Selected from Browsing window<br />
   */<br />
   private var fileType:String;<br />
   <br />
   /**<br />
   * FileReference class object provides browsing and uploading methods<br />
   */<br />
   private var fileRef:FileReference = new FileReference();<br />
   <br />
   /**<br />
   * File Filters Applied for restriction of Files to be browsed<br />
   */</p>
<p> //FileFilter takes two Arguments 1. Description to be shown in Browse window. 2. List of Extensions<br />
   private var allFileFilter:FileFilter = new FileFilter(&#8220;All, *.mp3; *.mp4; *.flv; *.wmv; *.mpeg; *.mpg;&#8221;, &#8220;*.mp3; *.mp4; *.flv; *.wmv; *.mpeg; *.mpg; &#8220;);<br />
   private var videoFilter:FileFilter = new FileFilter(&#8220;Video, *.flv; *.wmv; *.mpeg; *.mpg;&#8221;, &#8220;*.flv; *.wmv; *.mpeg; *.mpg;&#8221;);<br />
   private var audioFilter:FileFilter = new FileFilter(&#8220;Audio, *.mp3; *.mp4; *.wma;&#8221;, &#8220;*.mp3; *.mp4; *.wma;&#8221;);<br />
   private var textFilter:FileFilter = new FileFilter(&#8220;Test, *.rtf; *.doc; *.txt;&#8221;, &#8220;*.rtf; *.doc; *.txt;&#8221;);<br />
   <br />
   /**<br />
   * Function for validating the correct file extension.<br />
   */<br />
   private function validateFileType(fileName:String):Boolean<br />
   {<br />
    txtErr.text = &#8221;;<br />
    txtFileName.text = &#8221;;<br />
    fileName = StringUtil.trim(fileName.toLowerCase());<br />
    var fileExtensionArray:Array = fileName.split(&#8220;.&#8221;);<br />
    if(fileExtensionArray.length&gt;1)<br />
    {<br />
      fileType= fileExtensionArray[fileExtensionArray.length-1];<br />
     for(var i:int =0;i&lt;fileTypeArray.length;i++)<br />
     {<br />
      if(fileType==fileTypeArray[i])<br />
      {<br />
       txtErr.text = &#8221; File Selected is of proper Extension, Thank You.&#8221;;<br />
       txtFileName.text=&#8221; Uploaded File Name is =&gt;&#8221; + fileRef.name +<br />
       &#8221;\n Size is =&gt; &#8220;+fileRef.size+&#8221; bytes&#8221;<br />
       &#8221;\n Creation Date is =&gt; &#8220;+ fileRef.creationDate +<br />
       &#8221;\n Creator is =&gt; &#8220;+ fileRef.creator ;<br />
       return true;<br />
      }<br />
     }<br />
    }<br />
    txtErr.text = &#8220;You have not Uploaded the file within the standerd extensions provided.&#8221;;<br />
    return false;<br />
   }<br />
   <br />
   /**<br />
   * Function Used to open the Browsing window<br />
   */<br />
   private function selectFile():void<br />
   {<br />
    fileRef = new FileReference();<br />
    //browse method excepts the filefilter array as an arguement<br />
                fileRef.browse([allFileFilter,audioFilter,videoFilter,textFilter]);<br />
                fileRef.addEventListener(Event.SELECT, onSelectFile);<br />
   }<br />
   <br />
    <br />
    /**<br />
   * Function used to catch the Select event<br />
   */<br />
   private function onSelectFile(event:Event):void<br />
   {<br />
       validateFileType(fileRef.name);<br />
     }<br />
     <br />
  ]]&gt;<br />
 &lt;/mx:Script&gt;<br />
 <br />
 <br />
 &lt;mx:Button x=&#8221;63&#8243; y=&#8221;86&#8243; label=&#8221;Browse&#8221;  click=&#8221;selectFile()&#8221;/&gt;<br />
 &lt;mx:TextArea id=&#8221;txtFileName&#8221;  editable=&#8221;false&#8221; x=&#8221;161&#8243; y=&#8221;114&#8243; width=&#8221;360&#8243; height=&#8221;97&#8243;/&gt;<br />
 &lt;mx:Text color=&#8221;#ffffff&#8221; selectable=&#8221;false&#8221; id=&#8221;txtErr&#8221; x=&#8221;161&#8243; y=&#8221;63&#8243; width=&#8221;397&#8243; height=&#8221;25&#8243;/&gt;<br />
 &lt;mx:Label x=&#8221;143&#8243; y=&#8221;47&#8243; selectable=&#8221;false&#8221; text=&#8221;Enter *.* in file name of browsing window to Select wrong file.&#8221; fontWeight=&#8221;bold&#8221; fontSize=&#8221;15&#8243;/&gt;<br />
 &lt;mx:Label x=&#8221;161&#8243; y=&#8221;86&#8243; selectable=&#8221;false&#8221; text=&#8221;Retrived Local File Information =&gt; &#8220;/&gt;<br />
 &lt;mx:Label x=&#8221;161&#8243; y=&#8221;256&#8243;  selectable=&#8221;false&#8221; text=&#8221;Validate wheather the selected file is valid or Not.&#8221;/&gt;<br />
&lt;/mx:Application&gt;</p>
<p> </p>
<p>Best Luck <img class="wp-smiley" src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" alt=")" /></p>
<p> <strong>Thanks and regards</strong></p>
<p><strong>Shashank Kulkarni</strong></p>
<p>Feel free to mail me :) <a href="mailto:shashank.pawan@gmail.com"><span style="color:#666666;">shashank.pawan@gmail.com</span></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shashankkulkarni.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shashankkulkarni.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=10&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2008/04/28/validation-for-stopping-wrong-file-upload-at-browsing-time/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>

		<media:content url="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" medium="image">
			<media:title type="html">)</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing the layout of container dynamically at runtime</title>
		<link>http://shashankkulkarni.wordpress.com/2008/04/28/changing-the-layout-of-container-dynamically-at-runtime/</link>
		<comments>http://shashankkulkarni.wordpress.com/2008/04/28/changing-the-layout-of-container-dynamically-at-runtime/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 06:57:20 +0000</pubDate>
		<dc:creator>shashankkulkarni</dc:creator>
				<category><![CDATA[Best of Flex Utillity]]></category>
		<category><![CDATA[Acheive VBox and HBox functionallity with same containc]]></category>
		<category><![CDATA[Acheiving VBox and HBox functionality same time]]></category>
		<category><![CDATA[Changing the layout of container dynamically at runtime]]></category>

		<guid isPermaLink="false">http://shashankkulkarni.wordpress.com/?p=9</guid>
		<description><![CDATA[Hi,
   Changing the layout of container dynamically at runtime is one of the problem we all regularly meet with.
Suppose we are using the controlls in the HBox where all childrens are lined up horizontally and suddenly at runtime we need to place the children vertically and on some conditions we need to place all the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=9&subd=shashankkulkarni&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi,<br />
   Changing the layout of container dynamically at runtime is one of the problem we all regularly meet with.</p>
<p>Suppose we are using the controlls in the HBox where all childrens are lined up horizontally and suddenly at runtime we need to place the children vertically and on some conditions we need to place all the childrens horizontally then it becomes impossible to do it with HBox<br />
   So to come up with such solution it is always easier to do it with container &#8216;Box&#8217; which is actually the parent container for VBox and HBox.</p>
<p>With Box Container childrens are by default arranged vertically.<br />
With the &#8220;direction&#8221; property of Box we can change its layout dynamically.</p>
<p>Hmm Sometimes it didnt work then try it by removing the Height and width of of that container</p>
<p>Following is the small Sample to workout this challege</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</p>
<p>&lt;mx:application mx=<a href="http://www.adobe.com/2006/mxml">http://www.adobe.com/2006/mxml</a>  pageTitle=&#8221;Changing Layout Dynamically&#8221; layout=&#8221;absolute&#8221; creationComplete=&#8221;initCombo()&#8221;&gt;</p>
<p> &lt;mx:script&gt; &lt;![CDATA[  <br />
 import mx.utils.StringUtil;  <br />
 import mx.controls.Alert;<br />
 import mx.controls.Image;<br />
 import mx.collections.ArrayCollection; <br />
 [Bindable]</p>
<p> private var prefixArray:ArrayCollection = new ArrayCollection([{Item:'Select'},{Item:'Tel'},{Item:'Mob'},{Item:'Fax'},{Item:'Freephone'},{Item:'24 Hour'},{Item:'Sales'},{Item:'Service'},{Item:'Reservations'},{Item:'Emergency'},{Item:'Textphone'}]);</p>
<p>  private function initCombo():void<br />
 {    <br />
     bx.direction=&#8221;horizontal&#8221;; <br />
 }      </p>
<p>  private function  changeSize():void <br />
  {    <br />
            if(StringUtil.trim(txi.text)!=null &amp;&amp; txi.length&gt;3)<br />
           {      <br />
                  bx.direction=&#8221;vertical&#8221;;        <br />
           }       <br />
          else         <br />
         {              <br />
                bx.direction=&#8221;horizontal&#8221;;<br />
             }<br />
      }    </p>
<p>]]&gt;  &lt;/mx:Script&gt; </p>
<p>&lt;mx:box id=&#8221;bx&#8221; x=&#8221;76&#8243; y=&#8221;231&#8243; width=&#8221;500&#8243; height=&#8221;100&#8243;&gt;<br />
       &lt;mx:textinput id=&#8221;txi&#8221; change=&#8221;changeSize()&#8221;&gt;   <br />
      &lt;mx:combobox id=&#8221;cmbTest&#8221; dataprovider=&#8221;{prefixArray}&#8221; labelfield=&#8221;Item&#8221;&gt;</p>
<p>&lt;/mx:Box&gt;</p>
<p>&lt;/mx:Application&gt;</p>
<p> <br />
Say Cheese <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thanks and regards<br />
Shashank Kulkarni.<br />
feel free to mail me <a href="mailto:shashank.pawan@gmail.com">shashank.pawan@gmail.com</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/shashankkulkarni.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/shashankkulkarni.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/shashankkulkarni.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/shashankkulkarni.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/shashankkulkarni.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/shashankkulkarni.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/shashankkulkarni.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/shashankkulkarni.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/shashankkulkarni.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/shashankkulkarni.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/shashankkulkarni.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/shashankkulkarni.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=shashankkulkarni.wordpress.com&blog=3545189&post=9&subd=shashankkulkarni&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://shashankkulkarni.wordpress.com/2008/04/28/changing-the-layout-of-container-dynamically-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/040bba77afa61996772c4c353cb2f3f0?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">shank</media:title>
		</media:content>
	</item>
	</channel>
</rss>