<?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>Flex Drive</title>
	<atom:link href="http://mayurthakor.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mayurthakor.wordpress.com</link>
	<description>Throgh the Up&#039;s and Down&#039;s in the world of Flex</description>
	<lastBuildDate>Thu, 10 Nov 2011 09:39:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mayurthakor.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/c699f489a899b8f3bd83add1292a2e2d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Flex Drive</title>
		<link>http://mayurthakor.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mayurthakor.wordpress.com/osd.xml" title="Flex Drive" />
	<atom:link rel='hub' href='http://mayurthakor.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Flash to Focus on PC Browsing and Mobile Apps; Adobe to More Aggressively Contribute to HTML5</title>
		<link>http://mayurthakor.wordpress.com/2011/11/10/flash-to-focus-on-pc-browsing-and-mobile-apps-adobe-to-more-aggressively-contribute-to-html5/</link>
		<comments>http://mayurthakor.wordpress.com/2011/11/10/flash-to-focus-on-pc-browsing-and-mobile-apps-adobe-to-more-aggressively-contribute-to-html5/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 09:39:27 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=255</guid>
		<description><![CDATA[So its official now&#8230;Flash for mobile is going for a huge stop &#8230;&#8230; read the full story here.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=255&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So its official now&#8230;Flash for mobile is going for a huge stop &#8230;&#8230; read the full story <a href="http://blogs.adobe.com/conversations/2011/11/flash-focus.html">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/255/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=255&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/11/10/flash-to-focus-on-pc-browsing-and-mobile-apps-adobe-to-more-aggressively-contribute-to-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating Singleton class in AS 3.0</title>
		<link>http://mayurthakor.wordpress.com/2011/08/02/creating-singleton-class-in-as-3-0/</link>
		<comments>http://mayurthakor.wordpress.com/2011/08/02/creating-singleton-class-in-as-3-0/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 12:49:10 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[Singleton]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=247</guid>
		<description><![CDATA[How to create a singleton class? Here is an example. Let’s say we have a normal class like “Cricketer”. Now to make this class singleton, add following piece of code. Let’s see how we can utilize this feature in our application.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=247&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How to create a singleton class? Here is an example.</p>
<p>Let’s say we have a normal class like “Cricketer”.</p>
<p><pre class="brush: xml;">
package components
{
	public class Car{

		private var _carName:String;
		private var _carColor:String;
		private var _carPrize:int;

		/**
		 * CONSTRUCTOR
		 */

		public function Car(){}

		/**
		 * GETTERS AND SETTERS
		 */

		public function get carName():String{return _carName;}
		public function set carName(value:String):void{_carName = value;}
		public function get carColor():String{return _carColor;}
		public function set carColor(value:String):void{_carColor = value;}
		public function get carPrize():int{return _carPrize;}
		public function set carPrize(value:int):void{_carPrize = value;}

	}
}
</pre></p>
<p>Now to make this class singleton, add following piece of code.</p>
<p><pre class="brush: xml;">
package components
{

	public class Car{

		private var _carName:String;
		private var _carColor:String;
		private var _carPrize:int;

		protected static var _instance:Car;

		//Making singlton
		public static function getInstance():Car
		{
			if (_instance == null)
			{
				_instance = new Car();
			}
			return _instance;
		}

		/**
		 * CONSTRUCTOR
		 */

		public function Car(){}

		/**
		 * GETTERS AND SETTERS
		 */

		public function get carName():String{return _carName;}
		public function set carName(value:String):void{_carName = value;}
		public function get carColor():String{return _lastName;}
		public function set carColor(value:String):void{_lastName = value;}
		public function get carPrize():int{return _carPrize;}
		public function set carPrize(value:int):void{_carPrize = value;}

	}
}
</pre></p>
<p>Let’s see how we can utilize this feature in our application.</p>
<p><pre class="brush: xml;">
protected function checkSinglton(event:FlexEvent):void
{
	// TODO Auto-generated method stub
	//A First Cricketer
	var car:Car = Car.getInstance();
	car.carName= &quot;Tata Indigo Marina&quot;;
	car.carColor = &quot;0xEBEBEB&quot;;
	car.carPrize = 570000;

	trace (&quot;My First Car: &quot;+car.carName + &quot;having color of &quot; + car.carColor + &quot; which cost me around &quot; + car.carPrize.toString());

	//A new cricketer ? or not ?
	var secondCricketer:Cricketer = Cricketer.getInstance();
	trace (&quot;Second Cricketer : &quot;+cricketer.firstName + &quot; &quot; +cricketer.lastName &quot; &quot; +cricketer.type);
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=247&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/08/02/creating-singleton-class-in-as-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
		<item>
		<title>Replacing Strings in AS 3.0 with Regex</title>
		<link>http://mayurthakor.wordpress.com/2011/07/21/replacing-strings-in-as-3-0-with-regex/</link>
		<comments>http://mayurthakor.wordpress.com/2011/07/21/replacing-strings-in-as-3-0-with-regex/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 07:30:53 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[AS 3.0]]></category>
		<category><![CDATA[Replace]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=219</guid>
		<description><![CDATA[Here we are replacing a sub String with in a string using a RegEx. The resultant would be something like this. The big bug bit the little beetle, but the Seattle beetle bit the big bug back<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=219&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here we are replacing a sub String with in a string using a RegEx.</p>
<p><pre class="brush: xml;">
var sampleString:String = &quot;The big bug bit the little beetle, but the little beetle bit the big bug back.&quot;;

var pattern:RegExp = /little/gi;
sampleString = sampleString.replace(pattern, &quot;Seattle&quot;);
trace(sampleString);
</pre></p>
<p><span class="Apple-style-span" style="font-family:Consolas, Monaco, monospace;font-size:12px;line-height:18px;white-space:pre;"><span class="Apple-style-span" style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:13px;line-height:19px;white-space:normal;">The resultant would be something like this.</span></span></p>
<p>The big bug bit the little beetle, but the Seattle beetle bit the big bug back</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=219&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/07/21/replacing-strings-in-as-3-0-with-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
		<item>
		<title>Encrypted Local Storage</title>
		<link>http://mayurthakor.wordpress.com/2011/07/07/encrypted-local-storage/</link>
		<comments>http://mayurthakor.wordpress.com/2011/07/07/encrypted-local-storage/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 09:22:45 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[Air only]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=214</guid>
		<description><![CDATA[Using Encrypted Local storage for your AIR application has its own pros and cons. One should take enough care for which purpose it is being used. Although this feature is supported by most of the OS, still it is not available for the Mobile applications. EncryptedLocalStore isSupported is the property you can use to check [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=214&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Using Encrypted Local storage for your AIR application has its own pros and cons. One should take enough care for which purpose it is being used. Although this feature is supported by most of the OS, still it is not available for the Mobile applications.</p>
<p>EncryptedLocalStore isSupported is the property you can use to check whether ELS is supported or not.</p>
<p>ELS is strongly recommended to use as a private cache for the application. It should conatain only those information which needs to be secured from other users of the system or for Application specific user information.</p>
<p>ELS data can get lost due to few reasons like</p>
<p>-         Change in the Publisher ID as a result of the update.</p>
<p>-         User could uninstall the application &amp; delete the ELS data.</p>
<p>How to storr file inELS ?</p>
<p>I am initiating the process by clicking let’s say “save” button.</p>
<p><pre class="brush: xml;">
protected function saveButton_clickHandler( event:MouseEvent ):void
{
	resultLabel.text = &quot;&quot;;
	EncryptedLocalStore.reset();

	var file : File = File.documentsDirectory;
	file.browseForOpen(&quot;Save file to Encrypted Location&quot;);
	file.addEventListener(Event.SELECT,saveFile);
}
</pre></p>
<p>Now the “saveFile” function will work after the file has been selected by the user.</p>
<p>The target property will give us the instance of the File class, selected by user. Next, it creates an instance of the FileStream class that will be used to stream the bytes from the file into a ByteArray. Next, the filename is stored because it will be used as the key for the Encrypted Local Store. Finally, the value is stored in the Encrypted Local Store.</p>
<p><pre class="brush: xml;">
protected function saveFile( event:Event ):void
{
	var file = File(event.target);
	var stream :FileStream = new FileStream();

	var fileData : ByteArray = new ByteArray();
	stream.open(file,FileMode.READ);
	stream.readBytes(fileData,0,file.size);
	stream.close();
	fileName = file.name;

	EncryptedLocalStore.setItem(fileName,fileData);

	resultLabel.text = &quot;File saved to encrypted local store&quot;
}
</pre></p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/214/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/214/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/214/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=214&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/07/07/encrypted-local-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
		<item>
		<title>Handle nested ArrayCollection with ObjectHierarchicalData for Advance DataGrid</title>
		<link>http://mayurthakor.wordpress.com/2011/06/28/handle-nested-arraycollection-with-objecthierarchicaldata-for-advance-datagrid/</link>
		<comments>http://mayurthakor.wordpress.com/2011/06/28/handle-nested-arraycollection-with-objecthierarchicaldata-for-advance-datagrid/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 10:11:13 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
		
		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=211</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=211&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: xml;">
package
{
	import flash.events.EventDispatcher;
	import mx.collections.IHierarchicalData;
	[DefaultProperty(&quot;source&quot;)]
	public class ObjectHierarchicalData extends EventDispatcher implements
		IHierarchicalData {
		private var _source:Object;
		public function ObjectHierarchicalData() {}
		/* in our simple system, only parents with their type set to
		'parent' can have children */
		public function canHaveChildren(node:Object):Boolean
		{
			return ( node.type == 'parent' );
		}
		/* for any given node, determine whether that node has any children by
		looking through all the other nodes for that node's ID as a parentTask */
		public function hasChildren(node:Object):Boolean
		{
			var obj:Object;
			for each( obj in source )
			{
				if( obj.parentTask == node.objId )
					return true;
			}
			return false;
		}
		/* for any given node, return all the nodes that are children of that
		node in an array */
		public function getChildren(node:Object):Object
		{
			var parentId:String = node.objId;
			var children:Array = [];
			var obj:Object;
			for each( obj in source )
			{
				if( obj.parentTask == parentId )
					children.push( obj );
			}
			return children;
		}
		public function getData(node:Object):Object
		{
			var obj:Object;
			var prop:String;
			for each( obj in source )
			{
				for each( prop in node )
				{
					if( obj[prop] == node[prop] )
						return obj;
					else
						break;
				}
			}
			return null;
		}
		/* we want to return every obj that is a root object, which
		in this case is going to be all nodes that have a parent node
		of '0' */
		public function getRoot():Object
		{
			var rootsArr:Array = [];
			var obj:Object;
			for each( obj in source )
			{
				if( obj.parentTask == &quot;0&quot; )
				{
					rootsArr.push( obj );
				}
			}
			return rootsArr;
		}
		public function getParent(node:Object):*
		{
			var obj:Object;
			for each( obj in source )
			{
				if( obj.parentTask == node.parentTask )
					return obj;
			}
			return null;
		}
		public function get source():Object
		{
			return _source;
		}
		public function set source( value:Object ):void
		{
			_source = value;
		}
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=211&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/06/28/handle-nested-arraycollection-with-objecthierarchicaldata-for-advance-datagrid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
		<item>
		<title>Spark Datagrid in Mobile – Basics Part 1</title>
		<link>http://mayurthakor.wordpress.com/2011/06/21/spark-datagrid-in-mobile-%e2%80%93-basics-part-1/</link>
		<comments>http://mayurthakor.wordpress.com/2011/06/21/spark-datagrid-in-mobile-%e2%80%93-basics-part-1/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 12:02:15 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[ArrayList]]></category>
		<category><![CDATA[Datagrid]]></category>
		<category><![CDATA[runtime]]></category>
		<category><![CDATA[Spark]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=203</guid>
		<description><![CDATA[Here is the code created to use Spark DataGrid in Mobile application. The new Spark Datagrid gives so much freedom to a designer that it can revamp the entire look and feel of a datagrid. Although ADOBE discourages the use of Datagrid in Mobile application, I decided to give it a go just for exploring [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=203&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is the code created to use Spark DataGrid in Mobile application. The new Spark Datagrid gives so much freedom to a designer that it can revamp the entire look and feel of a datagrid. Although ADOBE discourages the use of Datagrid in Mobile application, I decided to give it a go just for exploring purpose.</p>
<p>Let’s jump on the example directly.</p>
<p>The Example is a Checklist for your day to day work. This article is the first installment of the entire series of Checklist application development. Here, I will add <strong><span style="text-decoration:underline;">the contents in the datagrid</span></strong> at runtime which includes checkbox and a text.</p>
<p>Here, I have a mobile project with a Datagrid named “dgTaskGrid”.</p>
<p><pre class="brush: xml;">
&lt;s:DataGrid id=&quot;dgTaskGrid&quot; skinClass=&quot;skins.DatagridSkin&quot;
					width=&quot;100%&quot; height=&quot;100%&quot;
					 verticalScrollPolicy=&quot;on&quot; /&gt;
</pre></p>
<p>Let’s create an arrayCollection “taskItems” in the script part, which will be a Dataprovider for the Grid .</p>
<p>private var taskItems : ArrayCollection = new ArrayCollection();</p>
<p>In the declarations tab, I have a ArrayList named “checkList” which will have a two GridColumn child inside it.</p>
<p><pre class="brush: xml;">
&lt;s:ArrayList id=&quot;checkList&quot;&gt;
	&lt;s:GridColumn width=&quot;50&quot;&gt;
		&lt;s:itemRenderer&gt;
		&lt;fx:Component&gt;
			&lt;s:GridItemRenderer textAlign=&quot;center&quot; &gt;
				&lt;s:CheckBox label=&quot;&quot; selected=&quot;{data.isFinished}&quot; horizontalCenter=&quot;0&quot;/&gt;
			&lt;/s:GridItemRenderer&gt;
			&lt;/fx:Component&gt;
				&lt;/s:itemRenderer&gt;
			&lt;/s:GridColumn&gt;
			&lt;s:GridColumn headerText=&quot;&quot;
				  dataField=&quot;text&quot;/&gt;
		&lt;/s:ArrayList&gt;
</pre></p>
<p>I have added checkbox component in the GridItemRenderer of the first column and second column will represent my text for the new task to be added.</p>
<p>I need to set the dataProvider and columns property of the grid “dgTaskGrid” to feed in the data. So updated Datagrid will have following code.</p>
<p><pre class="brush: xml;">
&lt;s:DataGrid id=&quot;dgTaskGrid&quot;
	    skinClass=&quot;skins.DatagridSkin&quot;
	    width=&quot;100%&quot; height=&quot;100%&quot;
	    dataProvider=&quot;{taskItems}&quot;
	    columns=&quot;{checkList}&quot;
	    verticalScrollPolicy=&quot;on&quot; /&gt;

</pre></p>
<p>If you look closely to my sample application, I am adding a row in the Datagrid at rumtime when I click the “Add” button. All I have to do is create an object which will include my new task text. Following is the code of the same.</p>
<p><pre class="brush: xml;">
protected function btnAddTask_clickHandler(event:MouseEvent):void
{
	var taskItem : Object = new Object();
	taskItem.text = txtTaskName.text;
	taskItem.isFinished = false;
	taskItems.addItem(taskItem);
	txtTaskName.text = &quot;&quot;;
}
</pre></p>
<p>This includes pretty much everything to display the newly added task in the Datagrid.</p>
<p>Now, something about the <strong>styling part</strong> where I don’t want to show the usual look of the datagrid that includes the rows and columns.</p>
<p>For this purpose I have created a styleClass for the spark Datagrid where I have disable the following skin.</p>
<p>-        columnSeparator</p>
<p>-        rowSeparator</p>
<p>-        headerSeparator</p>
<p>Moreover, I  don’t have anything to show in the header part of the grid. So I am just setting the visible property of <strong><span style="text-decoration:underline;">”GridColumnHeaderGroup”</span></strong> to make it disappear.</p>
<p>That’s it. You can see how the application looks in the below screen shot when add a list of tasks to be completed.</p>
<p>&nbsp;</p>
<p><a href="http://mayurthakor.wordpress.com/2011/06/21/spark-datagrid-in-mobile-%e2%80%93-basics-part-1/list-2/" rel="attachment wp-att-205"><img class="alignnone size-full wp-image-205" title="list" src="http://mayurthakor.files.wordpress.com/2011/06/list1.jpg?w=496&#038;h=820" alt="" width="496" height="820" /></a></p>
<p>&nbsp;</p>
<pre></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/203/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=203&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/06/21/spark-datagrid-in-mobile-%e2%80%93-basics-part-1/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>

		<media:content url="http://mayurthakor.files.wordpress.com/2011/06/list1.jpg" medium="image">
			<media:title type="html">list</media:title>
		</media:content>
	</item>
		<item>
		<title>ASyncToken and IResponder in Flex</title>
		<link>http://mayurthakor.wordpress.com/2011/06/20/188/</link>
		<comments>http://mayurthakor.wordpress.com/2011/06/20/188/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 05:49:54 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[ASyncToken]]></category>
		<category><![CDATA[IResponder]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=188</guid>
		<description><![CDATA[You want to call a set of Webservices one after another. A usual approach will be using result event of the first one to call the next one. Well more better way of doing the same thing is using the Asynctocken and Responer interfaces which can track objects and pass parameters to the co-dependent services. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=188&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You want to call a set of Webservices one after another. A usual approach will be using result event of the first one to call the next one.</p>
<p>Well more better way of doing the same thing is using the Asynctocken and Responer interfaces which can track objects and pass parameters to the co-dependent services. Let’s have a sample.</p>
<p>For a demo purpose I am using following Dictionary Webservice.</p>
<p><span style="text-decoration:underline;"><a href="http://services.aonaware.com/DictService/DictService.asmx">http://services.aonaware.com/DictService/DictService.asmx</a></span></p>
<p>This Webservice gives an API for dictionary purpose. For quicker way, I am using wizard to call the webservice. Just add the wsdl and there you go.</p>
<p><a href="http://mayurthakor.wordpress.com/2011/06/20/188/wizard-2/" rel="attachment wp-att-190"><img class="alignnone size-full wp-image-190" title="Wizard" src="http://mayurthakor.files.wordpress.com/2011/06/wizard1.jpg?w=600&#038;h=560" alt="" width="600" height="560" /></a></p>
<p>Next step is to call the webservice function on creationComplete() event of the application.</p>
<p><pre class="brush: xml;">
&lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot;
			   xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot;
			   xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot; minWidth=&quot;955&quot; minHeight=&quot;600&quot;
			   creationComplete=&quot;application1_creationCompleteHandler(event)&quot;&gt;
			private var dict : DictService = new DictService();
			private var token:AsyncToken;
			private var responder:mx.rpc.Responder;

			protected function application1_creationCompleteHandler(event:FlexEvent):void
			{
				// TODO Auto-generated method stub
				token = dict.DictionaryList();
				responder = new mx.rpc.Responder(onResult, onFault)
				token.addResponder(responder);

			}
			public function onResult(event:ResultEvent):void
			{

			}
			public function onFault(event:FaultEvent):void
			{

			}
		]]&gt;
	&lt;/fx:Script&gt;

	&lt;fx:Declarations&gt;
		&lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt;
	&lt;/fx:Declarations&gt;
&lt;/s:Application&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/188/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=188&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/06/20/188/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>

		<media:content url="http://mayurthakor.files.wordpress.com/2011/06/wizard1.jpg" medium="image">
			<media:title type="html">Wizard</media:title>
		</media:content>
	</item>
		<item>
		<title>Bind Array in AS 3.0 &#8211; Can we do it?</title>
		<link>http://mayurthakor.wordpress.com/2011/06/17/can-we-bind-array-in-as-3-0/</link>
		<comments>http://mayurthakor.wordpress.com/2011/06/17/can-we-bind-array-in-as-3-0/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 10:19:31 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=182</guid>
		<description><![CDATA[No we can’t. We all have loved Arraycollection so much that we almost forget about Array. All those push() and pop() methods got obsolete against addItem() and removeItem(). Even I also got stumbled upon when one of my friend ask me about this. Offcourse, ArrayCollection is much more developer friendly. So better to stick to that. :)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=182&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>No we can’t.</p>
<p>We all have loved Arraycollection so much that we almost forget about Array.</p>
<p>All those push() and pop() methods got obsolete against addItem() and removeItem().</p>
<p>Even I also got stumbled upon when one of my friend ask me about this.</p>
<p>Offcourse, ArrayCollection is much more developer friendly. So better to stick to that. :)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=182&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/06/17/can-we-bind-array-in-as-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
		<item>
		<title>GIF animation in AIR</title>
		<link>http://mayurthakor.wordpress.com/2011/06/17/gif-animation-in-air/</link>
		<comments>http://mayurthakor.wordpress.com/2011/06/17/gif-animation-in-air/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 05:24:14 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Air only]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[GIF]]></category>
		<category><![CDATA[Image]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=173</guid>
		<description><![CDATA[To display the GIF animation in an air application here is a way to embed in an HTML component. First of all create a HTML component object on your desired event. I have placed itunder creationComplete(); “startAnimation” function will trigger the do the trick here. Just set the desired height and width for the HTML [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=173&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To display the GIF animation in an air application here is a way to embed in an HTML component.</p>
<p>First of all create a HTML component object on your desired event. I have placed itunder creationComplete();</p>
<p><pre class="brush: xml;">
public function loadImage():void{
     var cuteDog:HTML = startAnimation(&quot;assets/images/dog.gif&quot;);
     cuteDog.height = 80;
     cuteDog.width = 80;
     parentContainer.addElement(cuteDog);
}
</pre></p>
<p>“startAnimation” function will trigger the do the trick here.</p>
<p><pre class="brush: xml;">
public function startAnimation(url:String):HTML
{
     var gifLoader:HTML = new HTML();
     gifLoader.location=url;
     gifLoader.reload();
     return gifLoader;
}
</pre></p>
<p>Just set the desired height and width for the HTML component and its parent component. Finally call the addElement() to add in application.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=173&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/06/17/gif-animation-in-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Context Menu with Air</title>
		<link>http://mayurthakor.wordpress.com/2011/04/14/custom-context-menu-with-adobe-air/</link>
		<comments>http://mayurthakor.wordpress.com/2011/04/14/custom-context-menu-with-adobe-air/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 13:15:45 +0000</pubDate>
		<dc:creator>Mayur</dc:creator>
				<category><![CDATA[Action Script 3.0]]></category>
		<category><![CDATA[Air only]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[context menu]]></category>
		<category><![CDATA[contextMenu.addItemAt]]></category>
		<category><![CDATA[Custom]]></category>
		<category><![CDATA[getTextField()]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[mx.internal]]></category>
		<category><![CDATA[NativeMenuItem]]></category>
		<category><![CDATA[TextArea]]></category>
		<category><![CDATA[TextField]]></category>

		<guid isPermaLink="false">http://mayurthakor.wordpress.com/?p=147</guid>
		<description><![CDATA[What if you want to create a custom context menu for say a &#8220;Canvas&#8221; or a &#8220;TextInput&#8221; ? To develop a custom context menu for a component we first need to understand the mx.internal property of a UI component. Here I am taking a TextInput for an example. Let’s say you have a requirement to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=147&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What if you want to create a custom context menu for say a &#8220;Canvas&#8221; or a &#8220;TextInput&#8221; ?</p>
<p>To develop a custom context menu for a component we first need to understand the <strong>mx.internal</strong> property of a UI component. Here I am taking a TextInput for an example.</p>
<p>Let’s say you have a requirement to edit the font style in TextInput when you right click on a TextInput’s text area. By default context menu will come with a predefined set of options like Cut, Copy, Paste etc.  But here we need to add one more custom feature “Fonts” in the context menu.</p>
<p>To get this done, we need to reach to the “TextField” of a TextInput. We can get this object by using mx.internal property of a TextInput.</p>
<p><pre class="brush: xml;">

var txt:TextField = messageView.txtChatMessage.mx_internal::getTextField() as TextField;

</pre></p>
<p>mx.internal is basically those properties of an objext which has a scope of change in future. So these properties are kept hidden and not available to us. To get access these peroperties just add following piece of line at the beging of your class at import level.</p>
<p><pre class="brush: xml;">

use namespace mx_internal;

</pre></p>
<p>Now we have a full access to the TextField object of a TextArea. Following method  createCustomContextMenu() has been called on the right click of a TextArea component.</p>
<p><pre class="brush: xml;">
private function createCustomContextMenu () : void
{
     var txt:TextField = messageView.txtChatMessage.mx_internal::getTextField() as TextField;
}
</pre></p>
<p>Now create an object of NativeMenuItem, which will represents our customMenuItem. You need to add an event listener also for the same. You would also like to give a “name” to you Context Menu item together with some “data”  using the “name” and “data” property respectively.Finally you need to add this item in your components contextmenu object. Following is an updated version of the createCustomContextMenu() method.</p>
<p><pre class="brush: xml;">
private function createCustomContextMenu() : void
{

     var txt:TextField = messageView.txtChatMessage.mx_internal::getTextField() as TextField;

     var suggestedWord:NativeMenuItem = new NativeMenuItem(suggestionArray[iCount].toString());

     suggestedWord.addEventListener(Event.SELECT,onWordItemSelect);

     suggestedWord.data = &quot;You menu item Label&lt;strong&gt;&quot;&lt;/strong&gt;;

     suggestedWord.name = suggestionArray[iCount].toString();

     txt.contextMenu.addItemAt(suggestedWord,0);

}
</pre></p>
<p>In this example I am adding my custom Menu Item at 0th location i.e. the first position. This location can be changed using “&#8221;addItemAt()” method of you context menu object.</p>
<p>There are other useful properties available like checked, enabled, mnemonicIndex etc. to be used if required.</p>
<p>You can get a better idea of all these option from livedoc’s following link.</p>
<p><a href="http://livedocs.adobe.com/flex/3/html/help.html?content=Menus_2.html">http://livedocs.adobe.com/flex/3/html/help.html?content=Menus_2.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mayurthakor.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mayurthakor.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mayurthakor.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mayurthakor.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mayurthakor.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mayurthakor.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mayurthakor.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mayurthakor.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mayurthakor.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mayurthakor.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mayurthakor.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mayurthakor.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mayurthakor.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mayurthakor.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mayurthakor.wordpress.com&amp;blog=4948241&amp;post=147&amp;subd=mayurthakor&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mayurthakor.wordpress.com/2011/04/14/custom-context-menu-with-adobe-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/beac872e7c6d00b344edca5735b8aa07?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Mayur</media:title>
		</media:content>
	</item>
	</channel>
</rss>
