<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6206378677057766593</id><updated>2024-10-06T22:44:07.546-07:00</updated><category term="Flex 3"/><category term="Actionscript 3.0"/><category term="AIR"/><category term="Android"/><category term="Create Air App for Android"/><category term="Flash"/><category term="Android Tutorial"/><category term="Application"/><category term="framework"/><category term="Adobe Air 2.5"/><category term="Adobe Flash Builder (code named Burrito)"/><category term="Air for Android"/><category term="Burrito"/><category term="Chart Component"/><category term="Flex 4"/><category term="HTTPService"/><category term="Java Script"/><category term="Pie Chart"/><category term="PureMVC"/><category term="Task Reminder Application"/><category term="Tutorial"/><category term="XML loading"/><category term="game"/><category term="ASDoc"/><category term="Air Tutorial"/><category term="Auto Fare"/><category term="Cairngrom"/><category term="Call"/><category term="CrossDomain"/><category term="Custom Event"/><category term="Design Pattern. AS3"/><category term="FlashVar"/><category term="Flex"/><category term="Flex 3 Issues."/><category term="Flex SDK Hero"/><category term="Google Maps"/><category term="Google Maps API for Flash"/><category term="Hero"/><category term="Meter Down."/><category term="Mobile Application"/><category term="Mobile Application Development"/><category term="Mumbai Auto Fare"/><category term="Mumbai Taxi Fare"/><category term="Number Slider Puzzle"/><category term="PXRuler V 1.0"/><category term="PhoneGap"/><category term="Pie Chart Interactive Label"/><category term="Pie Chart Label"/><category term="Pixel Rule"/><category term="Puzzle"/><category term="Rich Text Editor"/><category term="SMS"/><category term="Singleton Patter"/><category term="Spark"/><category term="States"/><category term="TV"/><category term="Taxi Fare"/><category term="To Do Task"/><category term="To Do Task V 2.0"/><category term="navigateToURL"/><title type='text'>Flex / Air / Flash Creation</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-6728144917277628482</id><published>2011-01-19T05:28:00.000-08:00</published><updated>2011-01-19T09:41:52.885-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="Create Air App for Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Mobile Application"/><category scheme="http://www.blogger.com/atom/ns#" term="Mobile Application Development"/><category scheme="http://www.blogger.com/atom/ns#" term="PhoneGap"/><title type='text'>Develop Android App using PhoneGap on Eclips</title><content type='html'>Developing cross platform application is on pick in today&#39;s world. PhoneGap plays major role in providing cross device development using html and javascript. Using PhoneGap you can develop applications for Android, iPhone, Blackberry and many more mobile OS. Good part is it packages the application in the native formate of the OS.&lt;br /&gt;&lt;br /&gt;Today I will walk you through the tutorial which will demonstrate the steps to develop the Android Hello World application.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;To Run this tutorial you need Android SDK and Android Emulator. Make sure you have created at least one Android virtual device (AVD). You will also need PhoneGap API. Download the latest copy of PhoneGap. For this tutorial we are only look in the Android development.&lt;br /&gt;&lt;br /&gt;Now we have all the required material available to develop First application for Android using PhoneGap First you need to set the Android SDK in Eclips, To do so click on Preferences &gt; Android. Set the Android sdk as shown below.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/PhoneGapAndroid/images/01.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Next we will create the new project. Click on File &gt; New &gt; Android Project&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/PhoneGapAndroid/images/02.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Now give all required details as shown in the below image to create the project and click finish.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/PhoneGapAndroid/images/03.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;We will require following two files, which was downloaded earlier&lt;br /&gt;1. Android/phonegap-0.9.3.jar&lt;br /&gt;2. Android/phonegap-0.9.3.js&lt;br /&gt;&lt;br /&gt;Create libs folder in the project and Place phonegap-0.9.3.jar in it. Also create the www folder within the assets folder and place the phonegap-0.9.3.js in it. (Refer below image)&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/PhoneGapAndroid/images/04.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Next we have to add phonegap-0.9.3.jar in library to access it in the application.&lt;br /&gt;Righ Click on project &gt; properties &gt; java Build Path. In the window click on Add Jars… button to add the phonegap-0.9.3.jar file. Navigate to the location of the jar file and click Ok. This will add your jar file in the library.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/PhoneGapAndroid/images/05.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Now, create index.html in your www folder and add following code&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;  &amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Hello World&amp;lt;/title&amp;gt;&lt;br /&gt;  &amp;lt;/head&amp;gt;&lt;br /&gt;  &amp;lt;body&amp;gt;&lt;br /&gt;  &amp;lt;h2&amp;gt;Hello World&amp;lt;/h2&amp;gt;&lt;br /&gt;  &amp;lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot; src=&quot;phonegap-0.9.3.js&quot;&amp;gt;&amp;lt;/script&amp;gt;      &lt;br /&gt;  &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;As we are using phoneGap, we will require some modification in main App.java file. Open the file and do following changes..&lt;br /&gt;1. Change the class&#39;s extend from Activity to DroidGap&lt;br /&gt;2. Replace the setContentView() line with super.loadUrl(&quot;file:///android_asset/www/index.html&quot;);&lt;br /&gt;3. Add import com.phonegap.*;&lt;br /&gt;Now your class should look like as follow.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush:actionscript3&quot;&gt;&lt;br /&gt;package com.shailesh;&lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;import com.phonegap.*;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class App extends DroidGap {&lt;br /&gt;    /** Called when the activity is first created. */&lt;br /&gt;    @Override&lt;br /&gt;    public void onCreate(Bundle savedInstanceState) {&lt;br /&gt;        super.onCreate(savedInstanceState);&lt;br /&gt;        super.loadUrl(&quot;file:///android_asset/www/index.html&quot;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Finally, lets add some permissions to the AndroidManifest.xml file to allow phonegap to run properly.&lt;br /&gt;Open up your manifest and paste the following information after the versionName but before the application tag:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush:xml&quot;&gt;&lt;br /&gt; &lt;supports-screens largescreens=&quot;true&quot; normalscreens=&quot;true&quot; smallscreens=&quot;true&quot; resizeable=&quot;true&quot; anydensity=&quot;true&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.CAMERA&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.VIBRATE&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.ACCESS_FINE_LOCATION&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.ACCESS_LOCATION_EXTRA_COMMANDS&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.READ_PHONE_STATE&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.INTERNET&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.RECEIVE_SMS&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.RECORD_AUDIO&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.MODIFY_AUDIO_SETTINGS&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.READ_CONTACTS&quot;&gt;&lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.WRITE_CONTACTS&quot;&gt;  &lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;&gt;  &lt;br /&gt;        &lt;uses-permission name=&quot;android.permission.ACCESS_NETWORK_STATE&quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now your xml should look like this.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/PhoneGapAndroid/images/06.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Now you can run you project as an Android Application. Right click the project and go to Run As and click Android Application. Eclipse might ask you to select an appropriate AVD. If there isn&#39;t one, then you&#39;ll need to create it before you can continue.&lt;br /&gt;&lt;br /&gt;There you go, you have done your first phoneGap application. It will load on the emulator.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/PhoneGapAndroid/images/07.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/6728144917277628482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2011/01/develop-android-app-using-phonegap-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/6728144917277628482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/6728144917277628482'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2011/01/develop-android-app-using-phonegap-on.html' title='Develop Android App using PhoneGap on Eclips'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-7927183685118457109</id><published>2010-12-05T23:03:00.000-08:00</published><updated>2010-12-06T00:56:46.655-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Adobe Flash Builder (code named Burrito)"/><category scheme="http://www.blogger.com/atom/ns#" term="Air for Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="Burrito"/><category scheme="http://www.blogger.com/atom/ns#" term="Call"/><category scheme="http://www.blogger.com/atom/ns#" term="Create Air App for Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex SDK Hero"/><category scheme="http://www.blogger.com/atom/ns#" term="Hero"/><category scheme="http://www.blogger.com/atom/ns#" term="navigateToURL"/><category scheme="http://www.blogger.com/atom/ns#" term="SMS"/><title type='text'>Calling and SMS through AIR application on Android Device</title><content type='html'>Adobe AIR 2.5 has support for two additional URI. Earlier we had mailto URI to navigate to system default email client. Similarly if you want to use system (Mobile) calling client you can do that using &lt;strong&gt;tel:&lt;/strong&gt; URI or if you want to use system(Mobile) SMS client you can do that using &lt;strong&gt;sms:&lt;/strong&gt; URI.&lt;br /&gt;&lt;br /&gt;In this article, I will walk you through how we can access the mobile default calling / SMS client. To understand this article one should have knowledge of AS3 and deploying AIR application on mobile.  If you are new to this technology (Air on Android). You can refer to my &lt;a href=&quot;http://shaileshmakwana.blogspot.com/2010/08/create-air-app-for-android-mobile.html&quot; target=&#39;_blank&#39;&gt;previous post &lt;/a&gt;to understand the deployment procedures.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;Adobe has launched preview released of Flash Builder Burrito with Hero Flex SDK. We will use Hero Flex SDK to create this simple application.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/CallSms/App.PNG&quot; border=&quot;0&quot; alt=&quot;&quot;/&gt;&lt;br /&gt;&lt;br /&gt;See code snipped for the application below.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush:xml&quot;&gt;&lt;br /&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;br /&gt;&lt;s:View xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot; &lt;br /&gt;  xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot; &lt;br /&gt;  xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot;&lt;br /&gt;  title=&quot;Dial or SMS&quot;&gt;&lt;br /&gt; &lt;s:layout&gt;&lt;br /&gt;  &lt;s:VerticalLayout &lt;br /&gt;   horizontalAlign=&quot;center&quot; &lt;br /&gt;   paddingTop=&quot;10&quot; paddingLeft=&quot;10&quot; paddingBottom=&quot;10&quot; paddingRight=&quot;10&quot;/&gt;&lt;br /&gt; &lt;/s:layout&gt;&lt;br /&gt;&lt;br /&gt; &lt;fx:Script&gt;&lt;br /&gt;  &lt;![CDATA[&lt;br /&gt;   &lt;br /&gt;   protected function callBtn_clickHandler(event:MouseEvent):void&lt;br /&gt;   {&lt;br /&gt;    navigateToURL(new URLRequest(&quot;tel:&quot;+telNumber.text));&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   protected function smsBtn_clickHandler(event:MouseEvent):void&lt;br /&gt;   {&lt;br /&gt;    navigateToURL(new URLRequest(&quot;sms:&quot;+telNumber.text));&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  ]]&gt;&lt;br /&gt; &lt;/fx:Script&gt;&lt;br /&gt;&lt;br /&gt; &lt;fx:Declarations&gt;&lt;br /&gt;  &lt;br /&gt; &lt;/fx:Declarations&gt;&lt;br /&gt; &lt;br /&gt; &lt;s:TextInput id=&quot;telNumber&quot; &lt;br /&gt;     width=&quot;100%&quot; &lt;br /&gt;     restrict=&quot;0-9&quot;/&gt;&lt;br /&gt; &lt;s:HGroup &lt;br /&gt;  width=&quot;100%&quot; &lt;br /&gt;  gap=&quot;5&quot; &lt;br /&gt;  paddingBottom=&quot;5&quot; paddingLeft=&quot;5&quot; paddingRight=&quot;5&quot; paddingTop=&quot;5&quot;&lt;br /&gt;  verticalAlign=&quot;middle&quot;  horizontalAlign=&quot;right&quot;&gt;  &lt;br /&gt;  &lt;s:Button id=&quot;callBtn&quot; &lt;br /&gt;      label=&quot;Call&quot; &lt;br /&gt;      click=&quot;callBtn_clickHandler(event)&quot;/&gt;&lt;br /&gt;  &lt;s:Button id=&quot;smsBtn&quot; &lt;br /&gt;      label=&quot;SMS&quot; &lt;br /&gt;      click=&quot;smsBtn_clickHandler(event)&quot;/&gt; &lt;br /&gt; &lt;/s:HGroup&gt; &lt;br /&gt;&lt;/s:View&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;If you notice in the script tag, There is a navigateToURL method executed on Clicking of Call / SMS button. &lt;br /&gt;&lt;br /&gt;Following code will trigger the default system calling client.&lt;br /&gt;&lt;pre class=&quot;brush:actionscript3&quot;&gt;&lt;br /&gt;navigateToURL(new URLRequest(&quot;tel:&quot;+telNumber.text));&lt;br /&gt;&lt;/pre&gt;This method will open up the dial panel of the mobile phone. See below image.&lt;br /&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/CallSms/dialpad.PNG&quot; border=&quot;0&quot; alt=&quot;&quot;/&gt;&lt;br /&gt;Following code will trigger the default system calling client.&lt;br /&gt;&lt;pre class=&quot;brush:actionscript3&quot;&gt;&lt;br /&gt;navigateToURL(new URLRequest(&quot;sms:&quot;+telNumber.text));&lt;br /&gt;&lt;/pre&gt;This method will open up the SMS panel of the mobile phone. See below image.&lt;br /&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/CallSms/SMS.PNG&quot; border=&quot;0&quot; alt=&quot;&quot;/&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Note: Body and subject attributes is not supported in sms: URI like we do for the mailto: URI due to the limited support from the android API.&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;I hope this will help you.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/7927183685118457109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/12/adobe-air-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7927183685118457109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7927183685118457109'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/12/adobe-air-2.html' title='Calling and SMS through AIR application on Android Device'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-4336271861717326842</id><published>2010-11-25T02:07:00.000-08:00</published><updated>2011-01-04T01:45:38.735-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Adobe Air 2.5"/><category scheme="http://www.blogger.com/atom/ns#" term="Adobe Flash Builder (code named Burrito)"/><category scheme="http://www.blogger.com/atom/ns#" term="Air for Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Auto Fare"/><category scheme="http://www.blogger.com/atom/ns#" term="Burrito"/><category scheme="http://www.blogger.com/atom/ns#" term="Create Air App for Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Meter Down."/><category scheme="http://www.blogger.com/atom/ns#" term="Mumbai Auto Fare"/><category scheme="http://www.blogger.com/atom/ns#" term="Mumbai Taxi Fare"/><category scheme="http://www.blogger.com/atom/ns#" term="Taxi Fare"/><title type='text'>Meter Down Application for Android: Developed using Flex Hero</title><content type='html'>Finally I got a chance to explore Adobe Flash Builder Burrito (Flex Hero SDK). It has support for developing Cross-platform Air application. Currently it is supporting Android only. Hope we will see all other Mobile, Tablets also covered in final version of Hero SDK.&lt;br /&gt;&lt;br /&gt;To do experiment, I had decided to develop an application. I want to develop an application which can be useful to the user. After thinking for enough hours, I have decided to develop an application which will help user to get the Mumbai Auto and Taxi Fare for the meter reading. I heard from my relatives, freinds that they had been cheated by Auto and Taxi driver for fares.&lt;br /&gt;&lt;br /&gt;Here it is &lt;strong&gt;Meter Down&lt;/strong&gt; application for Android Mobile OS. In this current version, I have covered only Mumbai city. May be I will add more cities in future. I will really appreciate if you can share the meter card for Auto or Taxi from your city.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;br /&gt;The current application is having feature of getting Regular as well as Night Fare for Auto and Taxi. The night fare will be calculated based on the mobile time. If it is between 12.00 AM to 5.00 AM, it will show night fare.&lt;br /&gt;&lt;br /&gt;You can download APK of this application from &lt;a href=&quot;http://www.shailesh.ihemant.com/AIR/MeterDown/MeterDown.apk&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can download Air Runtime APK (Runtime_Device_Froyo_20100826.apk) from &lt;a href=&quot;http://www.shailesh.ihemant.com/AIR/MeterDown/Runtime_Device_Froyo_20100826.apk&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: Change the file extention of downloaded file to .apk before installing on your device.&lt;br /&gt;&lt;br /&gt;I hope this will help you while you travel in MUMBAI by Auto / Taxi.&lt;div align=&quot;center&quot;&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/MeterDown/images/screenV.PNG&quot; /&gt;&lt;br&gt;&lt;br /&gt;&lt;img style=&quot;CURSOR: pointer&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/MeterDown/images/screenH.PNG&quot; /&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/4336271861717326842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/11/meter-down-application-for-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/4336271861717326842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/4336271861717326842'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/11/meter-down-application-for-android.html' title='Meter Down Application for Android: Developed using Flex Hero'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-928278875404743571</id><published>2010-11-01T04:26:00.000-07:00</published><updated>2010-11-01T04:35:42.300-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Adobe Air 2.5"/><category scheme="http://www.blogger.com/atom/ns#" term="AIR"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="TV"/><title type='text'>Adobe Air 2.5 now Available</title><content type='html'>Good news for the Air developers. Adobe has announced Adobe Air 2.5 availability at the Adobe MAX 2010. It has been announced that Air 2.5 will have multiple platform supports like Desktop, Mobiles, Tablets and TV.&lt;br /&gt;&lt;br /&gt;Adobe has also mention that Blackberry Tablet will also has Flash Player 10.1 and will also support Air applications. Some of the major manufacturers of electronics devices like HTC, Samsung, RIM, Motorola, Acer will have pre-installed Air runtime in their devices in early 2011.&lt;br /&gt;&lt;br /&gt;By mean of this, Developer can use their skills to develop multiple platform application, Which can be run on Desktops, Smart Phones, Tablets and also on TV. This sounds really cool to me. It would be fun to see your application running on multiple platform without doing much of changes.&lt;br /&gt;&lt;br /&gt;I am so excited about this, I have already started developing applications for the android.</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/928278875404743571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/11/adobe-air-25-now-available.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/928278875404743571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/928278875404743571'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/11/adobe-air-25-now-available.html' title='Adobe Air 2.5 now Available'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-8668901289062524928</id><published>2010-10-28T05:43:00.001-07:00</published><updated>2010-10-29T06:51:46.021-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flash"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Maps"/><category scheme="http://www.blogger.com/atom/ns#" term="Google Maps API for Flash"/><title type='text'>Google Maps in Flash</title><content type='html'>Google has very good map feature, Using that you can search for the places, you can get the directions, you can find interested places in the area, you can share your photos on the maps etc. All these you must have seen in the browser page. This might be developed using html and JavaScript.&lt;br /&gt;&lt;br /&gt;Now it is possible to have all above features in the flash using Google Maps API for Flash. Thanks to Google for providing free API to deal with maps. Believe me; it is very fast and so accurate. I really love it. Apart from the performance feature, using Google Maps API for Flash is so easy. You will learn that in this tutorial.&lt;br /&gt;&lt;br /&gt;I will not explain any flash related features in this tutorial, to execute this tutorial one need to have Flash Action Script 3.0 (AS3.0) knowledge.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;br /&gt;This tutorial is basically divided into two parts, first part will explain about setting up the Google Maps API in Flash CS3. (I am not using Flash CS5 for this tutorial, as my trial period is expired). Second part will explain about the integrating the Google Map API.&lt;br /&gt;In second part we will cover following features of the Google Maps API.&lt;br /&gt;&lt;br /&gt;Set the Map to particular location.&lt;br /&gt;Zoom feature.&lt;br /&gt;Setting Markers.&lt;br /&gt;&lt;br /&gt;To use the Google Maps in the flash you will require API. That you can download from &lt;a href=&quot;http://code.google.com/apis/maps/documentation/flash/&quot; target=&quot;_blank&quot;&gt;Google web site&lt;/a&gt;. In this page you will find the &lt;a href=&quot;http://maps.googleapis.com/maps/flash/release/sdk.zip&quot; target=&quot;_blank&quot;&gt;SDK&lt;/a&gt; link on the right side.&lt;br /&gt;Download the SDK and extract it. You will find two folders, docs and libs. Look inside the libs folder you will find the SWC file for the Flash(map_1_20.swc) as well as for the Flex(map_flex_1_20.swc).&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/Flash/Google%20Maps%20in%20Flash/images/sdkUnzip.png&quot; border=&quot;0&quot; alt=&quot;&quot;/&gt;&lt;br /&gt;&lt;br /&gt;For this tutorial we are using Flash, Hence we will use the map_1_20.swc file. You need to copy map_1_20.swc file to specific folder at following location to get it listed in the component window in Flash IDE.&lt;br /&gt;C:\Program Files\Adobe\Adobe Flash CS3\{language}\Configuration\Components\Google\&lt;br /&gt;Note: I have created Google Folder so that all Google API will can be placed at same location.&lt;br /&gt;Now if you run your Flash CS3. And check the components windows (Windows &amp;gt; Components). You will find the GoogleMpasLibrary component in Google tag(Refer below image). You have set the Google API in your Flash IDE.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/Flash/Google%20Maps%20in%20Flash/images/ComponentsWindow.png&quot; border=&quot;0&quot; alt=&quot;&quot;/&gt;&lt;br /&gt;&lt;br /&gt;Next you will require to have Google Maps API Key. To sign up for the key, click &lt;a href=&quot;http://code.google.com/apis/maps/signup.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt; and follow the instruction in the website. Once you have the generated key, Store it in the Locker (Just Kidding). Make sure you copy that so that you can use it for different applications.&lt;br /&gt;&lt;br /&gt;You are all set to develop a flash application using Google Map API.&lt;br /&gt;&lt;br /&gt;Open Flash CS3 IDE to start developing your Google Map Application. Now first thing, Open new Flash AS3 document. As a good practice, I always save that to my desire location. So first save the document and Name it as you like. I am naming it with GoogleMapExample.fla. Now next step is to utilize the Google Map API. To use the Google Map API open Components window and drop GoogleMapsLibrary to your stage. You will find only blue bounding box. Don’t worry, API will not show that bounding box it will handle it properly.&lt;br /&gt;&lt;br /&gt;Now as we have set the API for our application, It’s time to write some code. I have written following code to complete this application. Don’t worry I have added comments for each statement in the code.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;import com.google.maps.LatLng;&lt;br /&gt;import com.google.maps.Map;&lt;br /&gt;import com.google.maps.MapEvent;&lt;br /&gt;import com.google.maps.controls.ZoomControl; &lt;br /&gt;import com.google.maps.overlays.*;&lt;br /&gt;import com.google.maps.MapEvent;&lt;br /&gt;import com.google.maps.MapMouseEvent;&lt;br /&gt;import com.google.maps.InfoWindowOptions;&lt;br /&gt;&lt;br /&gt;//Map instance&lt;br /&gt;var map:Map = new Map();&lt;br /&gt;//Setting Google Map API key&lt;br /&gt;map.key = &quot;ENTER your GOOGLE MAP KEY&quot;;&lt;br /&gt;//Setting Sensor value, Set this true when you are using for GPS.&lt;br /&gt;map.sensor = &quot;false&quot;;&lt;br /&gt;//Setting the size of the Map&lt;br /&gt;map.setSize(new Point(stage.stageWidth, stage.stageHeight));&lt;br /&gt;//Adding Listener on Map Raeady.&lt;br /&gt;map.addEventListener(MapEvent.MAP_READY, onMapReady);&lt;br /&gt;//Adding map to the stage.&lt;br /&gt;this.addChild(map);&lt;br /&gt;&lt;br /&gt;//Marker instance&lt;br /&gt;var marker:Marker;&lt;br /&gt;&lt;br /&gt;//MapEvent.MAP_READY Handler, Fires when Map is ready&lt;br /&gt;function onMapReady(event:Event):void {&lt;br /&gt; //Seting the center of the Map using Latitude and longitude Object, Second parameter is for zoom level&lt;br /&gt; map.setCenter(new LatLng(19.17127500109175, 72.87111282348633), 10);&lt;br /&gt; //Adding Zoom Control to the map&lt;br /&gt; map.addControl(new ZoomControl());&lt;br /&gt; &lt;br /&gt; //Setting marker to the center of the Map. using Latitude and longitude Object, Second options is for the Marker option, Here we are getting MarkerOption object by calling custom function.&lt;br /&gt; marker = new Marker(new LatLng(19.17127500109175, 72.87111282348633), createMarkerOption(&#39;A&#39;));&lt;br /&gt; //Setting Marker on the Map&lt;br /&gt; map.addOverlay(marker); &lt;br /&gt; //Setting Click hander on the marker to show the information.&lt;br /&gt; marker.addEventListener(MapMouseEvent.CLICK, showInfoWindow)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//MapMouseEvent.CLICK Handler, Fires when user click on the Marker&lt;br /&gt;function showInfoWindow(e:MapMouseEvent):void&lt;br /&gt;{&lt;br /&gt; //Opening the Infomation Window, &lt;br /&gt; marker.openInfoWindow(new InfoWindowOptions({contentHTML:&quot;&lt;b&gt;Mumbai , Maharashtra, INDIA &lt;/b&gt;&quot;}));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Function to create the Marker Option. Label Paramer.&lt;br /&gt;function createMarkerOption(label:String):MarkerOptions&lt;br /&gt;{&lt;br /&gt; var options:MarkerOptions = new MarkerOptions({&lt;br /&gt;   //Stroke style&lt;br /&gt;   strokeStyle: {&lt;br /&gt;  color: 0x987654&lt;br /&gt;   },&lt;br /&gt;   //Fill color&lt;br /&gt;   fillStyle: {&lt;br /&gt;  color: 0x009933,&lt;br /&gt;  alpha: 0.8&lt;br /&gt;   },&lt;br /&gt;   &lt;br /&gt;   //label&lt;br /&gt;   label: label,&lt;br /&gt;   //Label Text Format&lt;br /&gt;   labelFormat: {&lt;br /&gt;  bold: true&lt;br /&gt;   },&lt;br /&gt;   //Marker Radius&lt;br /&gt;   radius: 11,&lt;br /&gt;   //Marker Shadow boolean&lt;br /&gt;   hasShadow: true,&lt;br /&gt;   //Marker Clickable booleam&lt;br /&gt;   clickable: true,&lt;br /&gt;   //Marker Draggable Boolean&lt;br /&gt;   draggable: false&lt;br /&gt; });&lt;br /&gt; &lt;br /&gt; return options;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this tutorial I have used Mumbai as a location, You can get your desire location Latitude and longitude by doing following steps.&lt;br /&gt;&lt;br /&gt;Step 1: Go to &lt;a href=&#39;http://maps.google.com&#39; target=&quot;_blank&quot;&gt;http://maps.google.com&lt;/a&gt;&lt;br /&gt;Step 2: Search for your desire place.&lt;br /&gt;Step 3: Paste below code in your browser adress bar.&lt;pre class=&quot;brush: actionscript3 &quot;&gt;javascript:void(prompt(&#39;&#39;,gApplication.getMap().getCenter()));&lt;/pre&gt;&lt;br /&gt;Step 4: This will prompt you with the Latitude and longitude values.&lt;br /&gt;&lt;br /&gt;The output will look like this. Click on the image to view the sample application.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.shailesh.ihemant.com/Flash/Google%20Maps%20in%20Flash/GoogleMapExample.html&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/Flash/Google%20Maps%20in%20Flash/images/Map Out put.png&quot; border=&quot;0&quot; alt=&quot;&quot;/&gt;&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/8668901289062524928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/10/google-maps-in-flash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/8668901289062524928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/8668901289062524928'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/10/google-maps-in-flash.html' title='Google Maps in Flash'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-3067237696459988701</id><published>2010-08-31T01:26:00.001-07:00</published><updated>2010-08-31T02:00:11.767-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AIR"/><category scheme="http://www.blogger.com/atom/ns#" term="Air Tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="Create Air App for Android"/><title type='text'>Create AIR App for Android Mobile</title><content type='html'>&lt;span xmlns=&quot;&quot;&gt; &lt;p&gt;The demand for smart phones has been increased rapidly. IPhone is one of my favorite smart phones. I really love it. Unfortunately I can&#39;t afford right now.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;While surfing for the smart phones on internet, I come across an open source OS developed by Google named Android. Recent version of Android (FROYO) has support for the AIR apps also. After doing some research and surfing, my preference for the IPhone has shifted to Android based phones. The support for the AIR has made me more curious to try out Android OS. Luckily Google has emulator for this. No need to spend lots of money in beginning.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After doing decent research, I had decided to give a try to develop AIR App for Android. I would like to share my experience through this tutorial, which will take you through the creation of Digital Watch AIR application for Android using Adobe Flash professional CS5 and testing it on the Emulator. &lt;span style=&quot;font-size:10;&quot;&gt;For this tutorial I will use the Flash &lt;/span&gt;professional &lt;span style=&quot;font-size:10;&quot;&gt;CS5&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Adobe and Google are working together to make this happen for android OS. Hope we don&#39;t have memory issue for the Android based mobiles.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To execute this tutorial you will require following things.&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Adobe Flash Professional CS5&lt;br /&gt;&lt;/li&gt;&lt;li&gt;AIRforAndroid_FlashCS5_ yyyymmdd.zxp&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:10;&quot;&gt;Android SDK – Android Emulator&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Runtime_Emulator_Froyo_yyyymmdd.apk&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;To get the AIRforAndroid_FlashCS5_20100826.zxp, you need to &lt;a href=&quot;https://prerelease.adobe.com/callout/default.html?callid=%7bAEF64EB4-A977-4317-909A-14AD8014BA21%7d&quot;&gt;register&lt;/a&gt; for the Adobe Prerelease site. After registration, download the AIRforAndroid_FlashCS5_20100826.zxp. To install this .zxp you will require Adobe Extension Manager.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After installing the Air for Android extension, when you open the Flash CS5 you will get the option for creating Flash file for android.&lt;br /&gt;&lt;/p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/forAndroidstartpage.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After opening the fla file, Save the fla file with DigitalWatch.fla name.&lt;br /&gt;I have created simple Digital Watch Application using Date and Timer class. For this application, I didn&#39;t create any classes. I have coded within the FLA. I know it is not good, But just for this tutorial, I have used my earlier code.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Download FLA from &lt;a href=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/SRC/DigitalWatch.fla&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Once you are set with the fla running successfully, without any error. You are ready to deploy that for the Android. Before doing this you need to make some configuration within the AIR Android Settings. To do so, Open File &amp;gt; Air Android Settings… This will open up a window to configure the Application for the Android.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/generalSettings.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;As shown in the above image, the default details for the Application appear as per the fla name. DigitalWatch.apk is the actual package file for the Android. This will be installed in the Android Device / Emulator. I have just made few changes, first for the App name: to &lt;strong&gt;&lt;em&gt;Digital Watch &lt;/em&gt;&lt;/strong&gt;and checked the &lt;strong&gt;&lt;em&gt;Auto Orientation&lt;/em&gt;&lt;/strong&gt; check boxes. If you notice, within the Include Files there are two files added DigitalWatch.swf and DigitalWatch-app.xml. These are the default files which require packaging the AIR app for android. You can add other files whichever are required for executing your application simply by clicking on the button above that.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/deploymentSettings.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;In the second Deployment tab you will find some more form items, Similar to AIR package, we have to provide the certificate for the Android package also. If you have any certification already created, Navigate to that file and provide the password. I will create a new certification just to explain. Click on the create button to create a new Certification file for the Air package. This will open another window, just fill all required details and save the file at your desired location. See below image for the details.&lt;br /&gt;&lt;br /&gt;After creating the certificate file, you need to add the password for that file in password field of the Development Tab. You need to do some more settings within this tab, Just click on the Release Radio button to create the release build. Also uncheck the two check boxes within the After Publishing area, this can be used when we have actual device connected with USB.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/certification.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;In the Third Icons tab, you have to provide icons of different sizes. Here for this tutorial I am not adding any icon, If you don&#39;t add any icons then it will take default android icons for your Air application.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/iconSetting.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;Click on publish button to publish the apk file for your AIR Application, Which will be installed on your Android Device or Emulator. We have completed first step of creating AIR app for Android, Now we need to deploy on the Android Device or Emulator. I am using Emulator for this tutorial, since I am not having any Android Device with 2.2 OS.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;Next step is to download the &lt;a href=&quot;http://developer.android.com/sdk/index.html&quot; target=&#39;_blank&#39;&gt;Android SDK&lt;/a&gt; and configure your emulator for the testing of your Air app. You can download that from the Adobe prerelease page. Download the android-sdk_r06-windows.zip and Runtime_Emulator_Froyo_20100802.apk for setting emulator. Unzip the android sdk to your system at your desired location. I always prefer to unzip that on c:\sdks\android\ location. Next you have to set the path environment variable for the android sdks like we do for the java. Following are the steps to set the path environment variable on windows.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Right-clicking on the My Computer icon and choose Properties from the menu.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Under the Advanced tab, click the Environment Variables button.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Select the Path entry in the System variables section of the Environment Variables dialog and click Edit.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;add the following text at the end of the current value:&lt;br /&gt;&#39;;C:\SDKs\AIR\bin;C:\SDKs\Android\tools&#39;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Click OK.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now you have set the environment variable for the Android SDK. You are all set to deploy your application on the android emulator. Next step is to open the emulator and creating the AVD &lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;(Android Virtual Device)&lt;/span&gt;.&lt;br /&gt;Now navigate to the tools folder in the android SDK folder, for my case C&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;:\sdks\android\tools. Once you are on this folder click on the android.bat file to start the AVD manager (Refer Below Image). Once the AVD manager open, you need to install all require packages. To install this, click on the Install Package and click on update all, this will update all required packages for the emulator. For Air application, we will require only 2.2 Froyo platforms.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/avdManager.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;&lt;br /&gt;After updating all packages, Next step is to create the AVD for your emulator. To do so, navigate to the virtual device tab and click on the new button. This will open up a window to set up the virtual device (Refer Below Image). Fill all required details as mentioned in the below image. Make sure you choose the Target as Android 2.2 – API Level 8. You can also set the hardware&#39;s as per your requirement, for this tutorial we don&#39;t required any specific hardware&#39;s, Hence we are keeping it as default. After filling all details click on CreateAVD button to create the new virtual device.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/newavdSetting.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now you are ready to upload your Air App on your virtual device and test. Select the myAVD from the list and click on the Start button to start the virtual device. This will open up a Launch Option window, Simple click launch to open the virtual device. This will open up the virtual device.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now you are all set to install your Air application. To install your application on emulator, you need to use command line functions of the android sdk. Open a command window and check whether your android sdk is set properly or not. To test this just type android on your command window, this will open up the AVD manager. If it is set properly, it will open the AVD manager if not, Set the android path environment variable as mention above. Once it is set and running properly, Check whether the device you have created are available to sdk or not, to test this type &#39;&lt;strong&gt;&lt;em&gt;adb devices&#39; &lt;/em&gt;&lt;/strong&gt;this will give you list of devices running.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now your devices are ready and running, next you have to install Air runtime in the emulator. To install this simply navigate to your folder in command window, where you have store your Air runtime apk file (Runtime_Emulator_.apk) As we are running our App on emulator we have to install Emulator apk. Execute &lt;strong&gt;&lt;em&gt;adb -e install -r Runtime_Emulator_Froyo_yyyymmdd.apk &lt;/em&gt;&lt;/strong&gt;command. This will give you success message. That means the Air runtime is installed successfully on your virtual device.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Remember in the above command –e stands for the emulator, when you are installing apk on emulator you have to use –e and when you are installing your apk on actual device you have to ue –d. Also the apk for the device is different than the emulator apk. To install in the apk on your device use &lt;strong&gt;&lt;em&gt;Runtime_Device_Froyo_20100802.apk &lt;/em&gt;&lt;/strong&gt;file. The command for installing apk on your device is &lt;strong&gt;&lt;em&gt;adb -d install -r Runtime_Device_Froyo_yyyymmdd.apk&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/airApiApkInstall.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;Next you can install your application using command line function. Simply navigate to your folder in command window, where you have store your apk file for AIR application. Execute following command &lt;strong&gt;&lt;em&gt;adb -e install -r DigitalWatch.apk &lt;/em&gt;&lt;/strong&gt;this will give you a success status as shown in below image. You have installed your Air app in the emulator.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/appApkInstall.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Go to AVD window and check in the menu screen, you will find the digitalwatch icon (Refer below image). &lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/emulatorMenu.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;Simple click on the icon, it will run your Digital Watch Air app on the emulator. It runs little slow on the emulator, but I am hoping that on actual device it will run faster.&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/appRuning.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:MS Shell Dlg 2;font-size:8;&quot;&gt;I hope, this tutorial will help you to try out Air on Android. Your suggestion and queries are welcome; Keep commenting to encourage me to write more blogs.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:MS Shell Dlg 2;font-size:8;&quot;&gt;Download the source and apk from &lt;a href=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/SRC/AirForAndroidSrc.zip&quot;&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/3067237696459988701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/08/create-air-app-for-android-mobile.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/3067237696459988701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/3067237696459988701'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/08/create-air-app-for-android-mobile.html' title='Create AIR App for Android Mobile'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-4626843142393965178</id><published>2010-08-27T05:08:00.001-07:00</published><updated>2010-08-27T05:12:47.878-07:00</updated><title type='text'>Adobe Air Launchpad</title><content type='html'>&lt;span xmlns=&#39;&#39;&gt;&lt;p&gt;Its good news for the Air Application developers. Days are gone now for configuring Air Specific features manually.&lt;br/&gt;&lt;br/&gt;Adobe has launched &lt;a href=&#39;http://labs.adobe.com/technologies/airlaunchpad/&#39; target=&#39;_blank&#39;&gt;&lt;strong&gt;Adobe Air Launchpad&lt;/strong&gt;&lt;/a&gt; recently. It is beta version.&lt;br/&gt;It is really nice Air Application. I was so excited to explore this tool. I had tried this and it worked well for me. Awesome tool, it will save your time.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Using Air Launchpad you can configure icons, window size, chrome type etc. there are many more. This app will generate the Air project for you with proper files. This will really help a developer to reduce the time for writing a code for the Air configuration in their application. I really love this app.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You can download the Adobe Air Launchpad from &lt;a href=&#39;http://labs.adobe.com/downloads/airlaunchpad.html&#39; target=&#39;_blank&#39;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p/&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/4626843142393965178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/08/adobe-air-launchpad.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/4626843142393965178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/4626843142393965178'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/08/adobe-air-launchpad.html' title='Adobe Air Launchpad'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-6458780367366725823</id><published>2010-07-29T05:18:00.001-07:00</published><updated>2010-08-31T01:49:47.828-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AIR"/><category scheme="http://www.blogger.com/atom/ns#" term="Application"/><category scheme="http://www.blogger.com/atom/ns#" term="Task Reminder Application"/><category scheme="http://www.blogger.com/atom/ns#" term="To Do Task V 2.0"/><title type='text'>Air: To Do Task Application V 2.0</title><content type='html'>&lt;span xmlns=&quot;&quot;&gt; &lt;p&gt;The demand for smart phones has been increased rapidly. IPhone is one of my favorite smart phones. I really love it. Unfortunately I can&#39;t afford right now.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;While surfing for the smart phones on internet, I come across an open source OS developed by Google named Android. Recent version of Android (FROYO) has support for the AIR apps also. After doing some research and surfing, my preference for the IPhone has shifted to Android based phones. The support for the AIR has made me more curious to try out Android OS. Luckily Google has emulator for this. No need to spend lots of money in beginning.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After doing decent research, I had decided to give a try to develop AIR App for Android. I would like to share my experience through this tutorial, which will take you through the creation of Digital Watch AIR application for Android using Adobe Flash professional CS5 and testing it on the Emulator. &lt;span style=&quot;font-size:10;&quot;&gt;For this tutorial I will use the Flash &lt;/span&gt;professional &lt;span style=&quot;font-size:10;&quot;&gt;CS5&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Adobe and Google are working together to make this happen for android OS. Hope we don&#39;t have memory issue for the Android based mobiles.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To execute this tutorial you will require following things.&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Adobe Flash Professional CS5&lt;br /&gt;&lt;/li&gt;&lt;li&gt;AIRforAndroid_FlashCS5_ yyyymmdd.zxp&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-size:10;&quot;&gt;Android SDK – Android Emulator&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Runtime_Emulator_Froyo_yyyymmdd.apk&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;To get the AIRforAndroid_FlashCS5_20100826.zxp, you need to &lt;a href=&quot;https://prerelease.adobe.com/callout/default.html?callid=%7bAEF64EB4-A977-4317-909A-14AD8014BA21%7d&quot;&gt;register&lt;/a&gt; for the Adobe Prerelease site. After registration, download the AIRforAndroid_FlashCS5_20100826.zxp. To install this .zxp you will require Adobe Extension Manager.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After installing the Air for Android extension, when you open the Flash CS5 you will get the option for creating Flash file for android.&lt;br /&gt;&lt;/p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/forAndroidstartpage.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;After opening the fla file, Save the fla file with DigitalWatch.fla name.&lt;br /&gt;I have created simple Digital Watch Application using Date and Timer class. For this application, I didn&#39;t create any classes. I have coded within the FLA. I know it is not good, But just for this tutorial, I have used my earlier code.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Download FLA from &lt;a href=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/SRC/DigitalWatch.fla&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Once you are set with the fla running successfully, without any error. You are ready to deploy that for the Android. Before doing this you need to make some configuration within the AIR Android Settings. To do so, Open File &amp;gt; Air Android Settings… This will open up a window to configure the Application for the Android.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/generalSettings.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;As shown in the above image, the default details for the Application appear as per the fla name. DigitalWatch.apk is the actual package file for the Android. This will be installed in the Android Device / Emulator. I have just made few changes, first for the App name: to &lt;strong&gt;&lt;em&gt;Digital Watch &lt;/em&gt;&lt;/strong&gt;and checked the &lt;strong&gt;&lt;em&gt;Auto Orientation&lt;/em&gt;&lt;/strong&gt; check boxes. If you notice, within the Include Files there are two files added DigitalWatch.swf and DigitalWatch-app.xml. These are the default files which require packaging the AIR app for android. You can add other files whichever are required for executing your application simply by clicking on the button above that.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/deploymentSettings.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;In the second Deployment tab you will find some more form items, Similar to AIR package, we have to provide the certificate for the Android package also. If you have any certification already created, Navigate to that file and provide the password. I will create a new certification just to explain. Click on the create button to create a new Certification file for the Air package. This will open another window, just fill all required details and save the file at your desired location. See below image for the details.&lt;br /&gt;&lt;br /&gt;After creating the certificate file, you need to add the password for that file in password field of the Development Tab. You need to do some more settings within this tab, Just click on the Release Radio button to create the release build. Also uncheck the two check boxes within the After Publishing area, this can be used when we have actual device connected with USB.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/certification.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;In the Third Icons tab, you have to provide icons of different sizes. Here for this tutorial I am not adding any icon, If you don&#39;t add any icons then it will take default android icons for your Air application.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/iconSetting.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;Click on publish button to publish the apk file for your AIR Application, Which will be installed on your Android Device or Emulator. We have completed first step of creating AIR app for Android, Now this we need to deploy on the Android Device or Emulator. I am using Emulator for this tutorial, since I am not having any Android Device with 2.2 OS.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;Next step is to download the Android SDK and configure your emulator for the testing of your Air app. You can download that from the Adobe prerelease page. Download the android-sdk_r06-windows.zip and Runtime_Emulator_Froyo_20100802.apk for setting emulator. Unzip the android sdk to your system at your desired location. I always prefer to unzip that on c:\sdks\android\ location. Next you have to set the path environment variable for the android sdks like we do for the java. Following are the steps to set the path environment variable on windows.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Right-clicking on the My Computer icon and choose Properties from the menu.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Under the Advanced tab, click the Environment Variables button.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Select the Path entry in the System variables section of the Environment Variables dialog and click Edit.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;add the following text at the end of the current value:&lt;br /&gt;&#39;;C:\SDKs\AIR\bin;C:\SDKs\Android\tools&#39;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Click OK.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now you have set the environment variable for the Android SDK. You are all set to deploy your application on the android emulator. Next step is to open the emulator and creating the AVD &lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;(Android Virtual Device)&lt;/span&gt;.&lt;br /&gt;Now navigate to the tools folder in the android SDK folder, for my case C&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;:\sdks\android\tools. Once you are on this folder click on the android.bat file to start the AVD manager (Refer Below Image). Once the AVD manager open, you need to install all require packages. To install this, click on the Install Package and click on update all, this will update all required packages for the emulator. For Air application, we will require only 2.2 Froyo platforms.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/avdManager.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;span style=&quot;font-family:Tahoma;font-size:10;&quot;&gt;&lt;br /&gt;After updating all packages, Next step is to create the AVD for your emulator. To do so, navigate to the virtual device tab and click on the new button. This will open up a window to set up the virtual device (Refer Below Image). Fill all required details as mentioned in the below image. Make sure you choose the Target as Android 2.2 – API Level 8. You can also set the hardware&#39;s as per your requirement, for this tutorial we don&#39;t required any specific hardware&#39;s, Hence we are keeping it as default. After filling all details click on CreateAVD button to create the new virtual device.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/newavdSetting.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now you are ready to upload your Air App on your virtual device and test. Select the myAVD from the list and click on the Start button to start the virtual device. This will open up a Launch Option window, Simple click launch to open the virtual device. This will open up the virtual device.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now you are all set to install your Air application. To install your application on emulator, you need to use command line functions of the android sdk. Open a command window and check whether your android sdk is set properly or not. To test this just type android on your command window, this will open up the AVD manager. If it is set properly, it will open the AVD manager if not, Set the android path environment variable as mention above. Once it is set and running properly, Check whether the device you have created are available to sdk or not, to test this type &#39;&lt;strong&gt;&lt;em&gt;adb devices&#39; &lt;/em&gt;&lt;/strong&gt;this will give you list of devices running.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now your devices are ready and running, next you have to install Air runtime in the emulator. To install this simply navigate to your folder in command window, where you have store your Air runtime apk file (Runtime_Emulator_.apk) As we are running our App on emulator we have to install Emulator apk. Execute &lt;strong&gt;&lt;em&gt;adb -e install -r Runtime_Emulator_Froyo_yyyymmdd.apk &lt;/em&gt;&lt;/strong&gt;command. This will give you success message. That means the Air runtime is installed successfully on your virtual device.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Remember in the above command –e stands for the emulator, when you are installing apk on emulator you have to use –e and when you are installing your apk on actual device you have to ue –d. Also the apk for the device is different than the emulator apk. To install in the apk on your device use &lt;strong&gt;&lt;em&gt;Runtime_Device_Froyo_20100802.apk &lt;/em&gt;&lt;/strong&gt;file. The command for installing apk on your device is &lt;strong&gt;&lt;em&gt;adb -d install -r Runtime_Device_Froyo_yyyymmdd.apk&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/airApiApkInstall.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;Next you can install your application using command line function. Simply navigate to your folder in command window, where you have store your apk file for AIR application. Execute following command &lt;strong&gt;&lt;em&gt;adb -e install -r DigitalWatch.apk &lt;/em&gt;&lt;/strong&gt;this will give you a success status as shown in below image. You have installed your Air app in the emulator.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/appApkInstall.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Go to AVD window and check in the menu screen, you will find the digitalwatch icon (Refer below image). Simple click on the icon, it will run your Digital Watch Air app on the emulator. It runs little slow on the emulator, but I am hoping that on actual device it will run faster.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img style=&quot;cursor:pointer;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/images/appRuning.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:MS Shell Dlg 2;font-size:8;&quot;&gt;I hope, this tutorial will help you to try out Air on Android. Your suggestion and queries are welcome; Keep commenting to encourage me to write more blogs.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family:MS Shell Dlg 2;font-size:8;&quot;&gt;Download the source and apk from &lt;a href=&quot;http://www.shailesh.ihemant.com/AIR/AIR%20on%20Android/SRC/AirForAndroidSrc.zip&quot;&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/6458780367366725823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/07/air-to-do-task-application-v-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/6458780367366725823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/6458780367366725823'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/07/air-to-do-task-application-v-20.html' title='Air: To Do Task Application V 2.0'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-7576790411615513633</id><published>2010-07-22T02:57:00.001-07:00</published><updated>2010-07-23T04:03:10.641-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AIR"/><category scheme="http://www.blogger.com/atom/ns#" term="Application"/><category scheme="http://www.blogger.com/atom/ns#" term="Pixel Rule"/><category scheme="http://www.blogger.com/atom/ns#" term="PXRuler V 1.0"/><title type='text'>Air: PXRuler V 1.0</title><content type='html'>&lt;p&gt;Have you ever get stuck to calculate the pixels of any of the on screen object? I did, In one of my project we have developed Geometry shapes in AS 3.0.  Since It was a Geometric shapes, shape size was very critical, We couldn&#39;t effort to have any shape with wrong length in values. For e.g. the size of the equilateral triangle has to be of same size. As a developer, it was easy to calculate the size while coding / debugging. But when it goes to the tester for testing, Testers had a tough time to calculate the length of these figures.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;And the search began to find the Pixel Ruler application. There are many free applications available.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I had a thought of doing this pixel ruler using AIR. As Air is very strong framework to create a desktop application. I decided to create using Flex.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;It is very simple to develop the ruler in Flex/Flash. Just to draw the rectangle and draw the markers on it. That&#39;s it.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Tester had a tough time to calculate the pixels for the Slant line. That is why I decided to have feature of rotation of ruler. This is one of the features of the &lt;strong&gt;PXRuler V 1.0. &lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Application Screen Shot&lt;br/&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 533px; height: 51px;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/PXRuler/PXRulerV1.0ScreenShot.png&quot; border=&quot;0&quot; alt=&quot;PXRuler V 1.0&quot; /&gt;&lt;br /&gt;   &lt;/p&gt;&lt;p&gt;Following are the features covered in PXRuler V 1.0&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Ruler scaling by dragging the &lt;strong&gt;Gripper button &lt;/strong&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 13px; height: 13px;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/PXRuler/Gripper.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;    &lt;/li&gt;&lt;li&gt;Ruler Rotation by dragging the &lt;strong&gt;Rotation button &lt;/strong&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 14px; height: 14px;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/PXRuler/Rotation.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Ruler Color change by clicking the &lt;strong&gt;Color button &lt;/strong&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 15px; height: 18px;&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/PXRuler/Color.png&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Setting Ruler horizontally / vertically by double clicking on it.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div align=&#39;center&#39;&gt;&lt;br /&gt;&lt;iframe Marginwidth=&quot;0&quot; Marginheight=&quot;0&quot; Frameborder=&quot;0&quot; width=&quot;215&quot; height=&quot;180&quot; align=&quot;center&quot; scrolling=&quot;no&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/PXRuler/BadgeInstaller/PXRulerInstaller.html&quot; padding=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/7576790411615513633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/07/air-pxruler-v-10.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7576790411615513633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7576790411615513633'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/07/air-pxruler-v-10.html' title='Air: PXRuler V 1.0'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-469244250795338071</id><published>2010-07-02T23:08:00.000-07:00</published><updated>2010-07-29T03:56:04.222-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AIR"/><category scheme="http://www.blogger.com/atom/ns#" term="Application"/><category scheme="http://www.blogger.com/atom/ns#" term="Task Reminder Application"/><category scheme="http://www.blogger.com/atom/ns#" term="To Do Task"/><title type='text'>Air: To Do Task Application</title><content type='html'>It has been busy month of June for me, I didn&#39;t got chance to blog much. Recently I got a time to develop Adobe AIR application. What a SDK for the Rich desktop Application, Air has very good features to play around with system functions, like docking on tray. I like inbuilt SQLLite very much. It will give you an opportunity to store user data very easily.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;br /&gt;While working on busy schedule, It is obvious that you will forgot some import task. I have been to similar situation recently. That gave me a chance to develop some task reminder application. And then AIR come to my mind, Since i am working on flash / flex technologies from last 10 years. AIR is best option to develop this.&lt;br /&gt;&lt;br /&gt;I have started working on the application with basic feature of writing Task, reminder for each task. It was looking very plain to me and then I decided to create custom skins for application. I am very happy that now it has very professional look. (this is what i feel) I hope even you will feel that too.&lt;br /&gt;&lt;br /&gt;Following are the features of the To Do Task V 1.0&lt;br /&gt;&lt;br /&gt;1. Adding task.&lt;br /&gt;2. Color individual task.&lt;br /&gt;3. Strikeout completed task.&lt;br /&gt;4. Delete completed task.&lt;br /&gt;5. Set reminder for each task.&lt;br /&gt;6. Snooze your task reminder.&lt;br /&gt;7. Docking on system tray.&lt;br /&gt;&lt;br /&gt;I would like you all to use this application in your daily busy schedule and share your thought. Any suggestions are welcome. Share an issue to me if you come across any. &lt;br /&gt;&lt;br /&gt;&lt;div align=&#39;center&#39;&gt;Install and explore &lt;span style=&quot;font-weight:bold;&quot;&gt;To Do Task&lt;/span&gt; Version 1.0.&lt;br /&gt;&lt;div align=&#39;center&#39;&gt;&lt;br /&gt;&lt;iframe Marginwidth=&quot;0&quot; Marginheight=&quot;0&quot; Frameborder=&quot;0&quot; width=&quot;215&quot; height=&quot;180&quot; align=&quot;center&quot; scrolling=&quot;no&quot; src=&quot;http://www.shailesh.ihemant.com/AIR/ToDoTask/batchInstall/index.html&quot; padding=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Application Screen Shot&lt;br&gt;&lt;img src=&quot;http://www.shailesh.ihemant.com/AIR/ToDoTask/batchInstall/ToDoScreenShot.jpg&quot; /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/469244250795338071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/07/air-to-do-task-application.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/469244250795338071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/469244250795338071'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/07/air-to-do-task-application.html' title='Air: To Do Task Application'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-7628523390280413798</id><published>2010-06-03T22:03:00.000-07:00</published><updated>2010-06-03T22:22:06.013-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cairngrom"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="framework"/><category scheme="http://www.blogger.com/atom/ns#" term="game"/><category scheme="http://www.blogger.com/atom/ns#" term="Number Slider Puzzle"/><category scheme="http://www.blogger.com/atom/ns#" term="Puzzle"/><title type='text'>Flex 3: Number Slider Puzzle Game Using Cairngorm Framework</title><content type='html'>It’s been long since I had written any post. After long rest, I had thought of creating Number Sliding Puzzle game using Cairngorm framework.&lt;br /&gt;&lt;br /&gt;I believe every one of us had played this game in our childhood, some of us still playing these puzzle. It is really refreshing playing and solving these puzzles. I really love it. I hope you will also enjoy playing this puzzle.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;You can get the source code by right clicking on the game page.&lt;br /&gt;&lt;br /&gt;&lt;div align=&#39;center&#39;&gt;&lt;a href=&quot;http://www.shailesh.ihemant.com/Flex%203/NumberSliderPuzzle/Application.html&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 276px; height: 320px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh15Qlag4se7ptzyuR97l9tSSTNaU__ZefR0cBZQIDf7Q5jyGFT8qiLJu2CpdOx2IZa_YKKPFz95RB8Ay_EvtsNFPDx8Q6OAOGHcA26AtCa-wUeg8yzYN3WgXlnsdJFWWFqklkWg4h-1NA/s320/numberSliderPuzzle.JPG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5478781248225532354&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/7628523390280413798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/06/flex-3-number-slider-puzzle-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7628523390280413798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7628523390280413798'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/06/flex-3-number-slider-puzzle-game.html' title='Flex 3: Number Slider Puzzle Game Using Cairngorm Framework'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh15Qlag4se7ptzyuR97l9tSSTNaU__ZefR0cBZQIDf7Q5jyGFT8qiLJu2CpdOx2IZa_YKKPFz95RB8Ay_EvtsNFPDx8Q6OAOGHcA26AtCa-wUeg8yzYN3WgXlnsdJFWWFqklkWg4h-1NA/s72-c/numberSliderPuzzle.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-4135158362578847472</id><published>2010-05-01T13:24:00.000-07:00</published><updated>2010-05-01T13:25:54.868-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flex 4"/><category scheme="http://www.blogger.com/atom/ns#" term="States"/><title type='text'>Flex 4: Adding States and changing properties,styles and events for states</title><content type='html'>Flash Builder 4 has improved a lot for developer and designer. It has ease out the syntax for working with states; now working with States is much easier and faster compare to Flex 3. In Flex 3, most of us used the design mode for working with states, I personally believed that writing code for states in Flex 3 was much more tedious and time consuming, and hence I had always used the Design mode.&lt;br /&gt;&lt;br /&gt;Now with the new release for Flex, Many things has improved for developers and designer. &lt;br /&gt;&lt;br /&gt;In this tutorial, I will walk you through the steps to use the code for working with states using Flash Builder 4. I will also explain how we can change the property and handle the events for two different states.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;We will create the simple example which will have two states; each state will have common components, Label and Button. Both components will have different values depending upon the current state.&lt;br /&gt;&lt;br /&gt;To start with first we will create the Flex project using Flash Builder 4. Once you are done open the application.mxml file.&lt;br /&gt;&lt;br /&gt;In this tutorial, we will have Lable stating the current state string and one button to change the states. To add this add following code just after the Application tag.&lt;br /&gt;&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;s:layout&amp;gt;&lt;br /&gt; &amp;lt;s:VerticalLayout horizontalAlign=&quot;center&quot; paddingTop=&quot;20&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/s:layout&amp;gt;&lt;br /&gt;&amp;lt;s:Label text=&quot;We are at state 1&quot; width=&quot;100%&quot; textAlign=&quot;center&quot;/&amp;gt;&lt;br /&gt;&amp;lt;s:Button label=&quot;Go To State 2&quot;/&amp;gt;&lt;/pre&gt;In above code snippet, we have set the VerticalLayout layout using &amp;lt;s:layout&amp;gt; tag. The syntax for setting Layout is also changed in Flex 4. Just after that, we have set the Label and Button spark component. Label has the value for current state information and button has label for moving to next state. &lt;br /&gt;&lt;br /&gt;We are done with creating default state, Now As mention earlier we will create two different states in this application. To do this we need to add following code just after the Application starting tag.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;s:states&amp;gt;&lt;br /&gt; &amp;lt;s:State name=&quot;State1&quot;/&amp;gt;&lt;br /&gt; &amp;lt;s:State name=&quot;State2&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/s:states&amp;gt; In the above code snippet, we have declared the two states using &amp;lt;s:states&amp;gt; tag. It is very simple, add as many child tag of &amp;lt;s:State&amp;gt; &lt;/pre&gt;within States tag. Add the name property for each state. For this tutorial we have mentioned State1 and State2.&lt;br /&gt;&lt;br /&gt;We are done with declaring two different states, but we need to change the properties and event handler for buttons for two different states. In Flex 4, we can change the properties of component for different states using (.) syntax followed by the state name attribute as shown here &amp;lt;B&amp;gt;style.stateName&amp;lt;/B&amp;gt; The properties, styles and events are declared without (.) and state name, will be considered for default state. We have created Label and button earlier, in which we haven’t mention the (.) and state name, Hence that will be considered for the default state. &lt;br /&gt;&lt;br /&gt;Now as we have initialize two different state, we have to change the values of Label and Button for different states. To change the values for State2, we will add the properties with (.) syntax followed by the state name. Update your &amp;lt;s:Label&amp;gt; and &amp;lt;s:Button&amp;gt; button tag as follow.&lt;br /&gt;&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;s:Label text=&quot;We are at state 1&quot; width=&quot;100%&quot; textAlign=&quot;center&quot; text.State2=&quot;We are at state 2&quot;/&amp;gt;&lt;br /&gt;&amp;lt;s:Button label=&quot;Go To State 2&quot; label.State2=&quot;Go To State 1&quot; click=&quot;currentState = &#39;State2&#39;&quot; click.State2=&quot;currentState = &#39;State1&#39;&quot;/&amp;gt;&lt;/pre&gt;You can see that we have change the text property of Label tag for State2 to &amp;lt;B&amp;gt;text.State2=&quot;We are at state 2&quot;&amp;lt;/B&amp;gt; Same way we have some event to navigate through the states. To do so, we have added an event for &amp;lt;s:Button&amp;gt;tag for both the states as &amp;lt;B&amp;gt;click=&quot;currentState = &#39;State2&#39;&quot; click.State2=&quot;currentState = &#39;State1&#39;&quot;&amp;lt;/B&amp;gt;. If you see above the syntax for changing the state is &amp;lt;B&amp;gt;currentState = &#39;State Name&#39;&amp;lt;/B&amp;gt;.&lt;br /&gt;&lt;br /&gt;Now we are done with our application. The final code for your application will look like this.&lt;br /&gt;&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;s:Application xmlns:fx=&quot;http://ns.adobe.com/mxml/2009&quot; &lt;br /&gt;      xmlns:s=&quot;library://ns.adobe.com/flex/spark&quot; &lt;br /&gt;      xmlns:mx=&quot;library://ns.adobe.com/flex/mx&quot; minWidth=&quot;955&quot; minHeight=&quot;600&quot;&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;s:states&amp;gt;&lt;br /&gt;  &amp;lt;s:State name=&quot;State1&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;s:State name=&quot;State2&quot;/&amp;gt;&lt;br /&gt; &amp;lt;/s:states&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;s:layout&amp;gt;&lt;br /&gt;  &amp;lt;s:VerticalLayout horizontalAlign=&quot;center&quot; paddingTop=&quot;20&quot;/&amp;gt;&lt;br /&gt; &amp;lt;/s:layout&amp;gt;&lt;br /&gt; &amp;lt;s:Label text=&quot;We are at state 1&quot; width=&quot;100%&quot; textAlign=&quot;center&quot; text.State2=&quot;We are at state 2&quot;/&amp;gt;&lt;br /&gt; &amp;lt;s:Button label=&quot;Go To State 2&quot; label.State2=&quot;Go To State 1&quot; click=&quot;currentState = &#39;State2&#39;&quot; click.State2=&quot;currentState = &#39;State1&#39;&quot;/&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/s:Application&amp;gt;&lt;/pre&gt;You are done, Just run your application and find the output.&lt;br /&gt;&lt;br /&gt;It is very simple and easy to work with states in Flex 4. I hope you like this tutorial.&lt;br /&gt;&lt;br /&gt;I will write another tutorial for states, in which I will include how we can add / remove components for states.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/4135158362578847472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/05/flash-builder-4-has-improved-lot-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/4135158362578847472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/4135158362578847472'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/05/flash-builder-4-has-improved-lot-for.html' title='Flex 4: Adding States and changing properties,styles and events for states'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-1791979500253590223</id><published>2010-04-30T11:47:00.000-07:00</published><updated>2010-04-30T12:34:08.515-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3 Issues."/><category scheme="http://www.blogger.com/atom/ns#" term="Rich Text Editor"/><title type='text'>Flex 3: RTE Bullet and Align button issue</title><content type='html'>While working with Rich Text Editor component of Flex 3, I cam across with strange issue. &lt;br /&gt;&lt;br /&gt;Try out following flow. On fresh launch change Font / Font Size / Font Color / Bold / Italic / Underline and then if you click on either alignment buttons or Bullet button. Ideally all formatting setting should retain and whatever you type should have these formatting. But it is failing. The formatting will revert back to the default values.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;br /&gt;I tried to find out the actual issue, In the &lt;strong&gt;RichTextEditor.mxml&lt;/strong&gt;, within the &lt;strong&gt;setTextStyles &lt;/strong&gt;function. New text format instance is been created in Bullet and align button click condition. This new TextFormat object overwrites the previously set formatting.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;else if (type == &quot;align&quot; || type == &quot;bullet&quot;)&lt;br /&gt;  {&lt;br /&gt;   if (beginIndex == endIndex)&lt;br /&gt;   {&lt;br /&gt;    tf = new TextFormat();&lt;br /&gt;   }&lt;/pre&gt;&lt;br /&gt;To overcome this issue I have written a fix in the mxml where RTE instance is been created. To fix this issue, I just had assigned the formatted values to the newly created TextFormat object, Doing this will retain the previously set formatting.&lt;br /&gt;Following is the code snippet for the fix.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;public function checkForFormating():void&lt;br /&gt;   {&lt;br /&gt;    var textField:IUITextField = textArea.getTextField();&lt;br /&gt;    var beginIndex:int = textField.selectionBeginIndex;&lt;br /&gt;    var endIndex:int = textField.selectionEndIndex;&lt;br /&gt;    if (beginIndex == endIndex)&lt;br /&gt;    {&lt;br /&gt;     var tf:TextFormat;&lt;br /&gt;     tf = textField.defaultTextFormat;&lt;br /&gt;&lt;br /&gt;     tf[&#39;font&#39;] = fontFamilyCombo.text;&lt;br /&gt;&lt;br /&gt;     var fontSize:uint = uint(fontSizeCombo.text);&lt;br /&gt;     if (fontSize &gt; 0)&lt;br /&gt;      tf[&#39;size&#39;] = fontSize;&lt;br /&gt;&lt;br /&gt;     tf[&#39;color&#39;] = uint(colorPicker.selectedColor);&lt;br /&gt;&lt;br /&gt;     tf[&#39;bold&#39;] = boldButton.selected;&lt;br /&gt;     tf[&#39;italic&#39;] = italicButton.selected;&lt;br /&gt;     tf[&#39;underline&#39;] = undoButton.selected;&lt;br /&gt;&lt;br /&gt;     if (alignButtons.selectedIndex == 0)&lt;br /&gt;      tf.align = &quot;left&quot;&lt;br /&gt;     else if (alignButtons.selectedIndex == 1)&lt;br /&gt;      tf.align = &quot;center&quot;&lt;br /&gt;     else if (alignButtons.selectedIndex == 2)&lt;br /&gt;      tf.align = &quot;right&quot;&lt;br /&gt;     else if (alignButtons.selectedIndex == 3)&lt;br /&gt;      tf.align = &quot;justify&quot;&lt;br /&gt;&lt;br /&gt;     tf[&#39;bullet&#39;] = bulletButton.selected;&lt;br /&gt;&lt;br /&gt;     if (lineSpaceButton.selectedIndex == 0)&lt;br /&gt;      tf.leading = &quot;2&quot;&lt;br /&gt;     else if (lineSpaceButton.selectedIndex == 1)&lt;br /&gt;      tf.leading = &quot;4&quot;&lt;br /&gt;     else if (lineSpaceButton.selectedIndex == 2)&lt;br /&gt;      tf.leading = &quot;8&quot;&lt;br /&gt;&lt;br /&gt;     textField.defaultTextFormat = tf;&lt;br /&gt;    }&lt;br /&gt;   }&lt;/pre&gt;In this function, basically i have reassign all the formatting based on the default formatting property. All you have to do is call this function on bullet / align button click. Add a Mouse Click listener and call this function on handler.&lt;br /&gt;&lt;br /&gt;This will resolve the issue. I have tested this and it works fine, Let me know if you find any issue in this.&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/1791979500253590223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-rte-bullet-button-issue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/1791979500253590223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/1791979500253590223'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-rte-bullet-button-issue.html' title='Flex 3: RTE Bullet and Align button issue'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-2895251060418609646</id><published>2010-04-28T10:59:00.001-07:00</published><updated>2010-04-28T11:27:11.212-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="CrossDomain"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="HTTPService"/><category scheme="http://www.blogger.com/atom/ns#" term="XML loading"/><title type='text'>Flex 3: Cross Domain XML Loading</title><content type='html'>Flash Player has security feature, This security is basically domain based. It will allow a swf from specific domain to load assets, data or it will allow communication between two swf files from that domain. When a particular swf file is loaded in flash player, Security sandbox is created for that particular domain. This mean swf file in that domain will have access to all assets, data of that sandbox.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;If a swf file from any particular domain wants a access to data or assets of any other domain, we need to have cross-domain policy file available on remote server. This&lt;strong&gt; crossdomain.xml&lt;/strong&gt; needs to be structure in predefined format, Which will be read by the swf player and depending upon the tags, it will allow access to that server.&lt;br /&gt;&lt;br /&gt;Following is the sample code for crossdomain.xml. &lt;br /&gt;&lt;pre class=&quot;brush: xml&quot;&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br /&gt;&amp;lt;cross-domain-policy&amp;gt;&lt;br /&gt; &amp;lt;!-- below tag will allow access from any domain. --&amp;gt;&lt;br /&gt; &amp;lt;allow-access-from domain=&quot;*&quot;/&amp;gt;&lt;br /&gt; &amp;lt;!-- below tag will allow access to www.shaileshmak.000fees.net domain. --&amp;gt;&lt;br /&gt; &amp;lt;allow-access-from domain=&quot;www.shaileshmak.000fees.net&quot;/&amp;gt;&lt;br /&gt; &amp;lt;!-- below tag will allow access to any sub domain of 000fees.net domain. --&amp;gt;&lt;br /&gt; &amp;lt;allow-access-from domain=&quot;*.000fees.net&quot;/&amp;gt; &lt;br /&gt; &amp;lt;!-- below tag will allow access to 105.216.0.40 ip. --&amp;gt;&lt;br /&gt; &amp;lt;allow-access-from domain=&quot;105.216.0.40&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/cross-domain-policy&amp;gt;&lt;/pre&gt;If a swf tries to access any data from other domain, swf player by default search for the crossdomain.xml file at root directory of the remote server. If the crossdomain.xml is placed other than the root directory, We can access that file using &lt;strong&gt;Security.loadPolicyFile();&lt;/strong&gt; function.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;e.g.&lt;/strong&gt; &lt;pre class=&quot;brush: actionscript3 &quot;&gt;Security.loadPolicyFile(http://www.shaileshmak.000fees.net/MyWork/crossdomain.xml);&lt;/pre&gt;Make sure you are loading this crossdomain.xml file, before loading the assets from the remote server.&lt;br /&gt;&lt;br /&gt;I have created a Flex example for loading xml into the datagrid, In this example, the data xml file is located at remote server and the swf file from different server is accessing this xml and loading it into the datagrid.&lt;br /&gt;&lt;br /&gt;Following is the sample code of the application.&lt;br /&gt; &lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; &lt;br /&gt;    layout=&quot;vertical&quot;&lt;br /&gt;    creationComplete=&quot;init()&quot;&amp;gt;&lt;br /&gt;    &lt;br /&gt; &amp;lt;mx:HTTPService id=&quot;service&quot;&lt;br /&gt;     showBusyCursor=&quot;true&quot; &lt;br /&gt;     url=&quot;http://shailesh.ihemant.com/employee.xml&quot; &lt;br /&gt;     resultFormat=&quot;object&quot;&lt;br /&gt;     result=&quot;serviceResultHandler(event)&quot;&lt;br /&gt;     fault=&quot;serviceFaultHandler(event)&quot;/&amp;gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import mx.collections.ArrayCollection;&lt;br /&gt;   import mx.controls.Alert;&lt;br /&gt;   import mx.rpc.events.FaultEvent;&lt;br /&gt;   import mx.rpc.events.ResultEvent;&lt;br /&gt;   &lt;br /&gt;   [Bindable]   &lt;br /&gt;   private var employeeCollection:ArrayCollection;&lt;br /&gt;   private function init():void&lt;br /&gt;   {&lt;br /&gt;    employeeCollection = new ArrayCollection();&lt;br /&gt;   }   &lt;br /&gt;      &lt;br /&gt;   private function serviceResultHandler(event:ResultEvent):void&lt;br /&gt;   {&lt;br /&gt;    employeeCollection = event.result.Employee_Info.Employee as ArrayCollection;   &lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function serviceFaultHandler(event:FaultEvent):void&lt;br /&gt;   {&lt;br /&gt;    Alert.show(event.toString());   &lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   private function getEmployeeHandler():void&lt;br /&gt;   {&lt;br /&gt;    service.send();&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:Button id=&quot;getEmployee&quot; &lt;br /&gt;      label=&quot;Get Employee&quot; &lt;br /&gt;      click=&quot;getEmployeeHandler();&quot;/&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;mx:DataGrid id=&quot;grid&quot; &lt;br /&gt;           width=&quot;80%&quot; &lt;br /&gt;           dataProvider=&quot;{employeeCollection}&quot;&amp;gt;&lt;br /&gt;  &amp;lt;mx:columns&amp;gt;&lt;br /&gt;   &amp;lt;mx:DataGridColumn dataField=&quot;Name&quot; headerText=&quot;Name&quot;/&amp;gt;&lt;br /&gt;   &amp;lt;mx:DataGridColumn dataField=&quot;Designation&quot; headerText=&quot;Designation&quot;/&amp;gt;&lt;br /&gt;   &amp;lt;mx:DataGridColumn dataField=&quot;Email&quot; headerText=&quot;Email&quot;/&amp;gt;&lt;br /&gt;  &amp;lt;/mx:columns&amp;gt;&lt;br /&gt; &amp;lt;/mx:DataGrid&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/pre&gt;Look at the &lt;a href=&quot;http://shaileshmak.000fees.net/MyWork/CrossDomainSharing/CrossDomainLoading.html&quot; target=&quot;_blank&quot;&gt;demo &lt;/a&gt;application.&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/2895251060418609646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/cross-domain-xml-loading.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/2895251060418609646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/2895251060418609646'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/cross-domain-xml-loading.html' title='Flex 3: Cross Domain XML Loading'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-8668112018064542719</id><published>2010-04-25T14:22:00.000-07:00</published><updated>2010-04-25T15:13:05.896-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flex 4"/><category scheme="http://www.blogger.com/atom/ns#" term="Spark"/><title type='text'>Flex 4: New components and containers</title><content type='html'>With the introduction to new Flash Builder 4 (Flex 4 - code base Gumbao), There are changes in the component architecture. Flex 4 SDK introduce number of new components and container with new architecture. This will make developers life much easier, as the skinning, effects and other customization now will be much straight forward. In Flex 4 new component they have introduced Spark Components.   &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;Following table list out the Flex 3 component and their Flex 4 Spark counter part.    &lt;br /&gt;    &lt;br /&gt;    &lt;table&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td&gt;Flex 3 MX Component&lt;/td&gt;          &lt;td&gt;Flex 4 spark Component &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.Button&lt;/td&gt;          &lt;td&gt;spark.components.Button&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.ButtonBar&lt;/td&gt;          &lt;td&gt;spark.components.ButtonBar &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.CheckBox&lt;/td&gt;          &lt;td&gt;spark.components.CheckBox &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.ComboBox&lt;/td&gt;          &lt;td&gt;spark.components.DropDownList (w/o editability) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.HorizontalList&lt;/td&gt;          &lt;td&gt;spark.components.List (with a HorizontalLayout) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.HRule&lt;/td&gt;          &lt;td&gt;spark.primitives.Line &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.HScrollBar&lt;/td&gt;          &lt;td&gt;spark.components.HScrollBar &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.HSlider&lt;/td&gt;          &lt;td&gt;spark.components.HSlider &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.Image&lt;/td&gt;          &lt;td&gt;spark.primitives.BitmapImage (w/o support for external images) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.LinkBar&lt;/td&gt;          &lt;td&gt;spark.components.ButtonBar (with a custom skin) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.LinkButton&lt;/td&gt;          &lt;td&gt;spark.components.Button (with a custom skin) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.List&lt;/td&gt;          &lt;td&gt;spark.components.List &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.NumericStepper&lt;/td&gt;          &lt;td&gt;spark.components.NumericStepper &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.RadioButton&lt;/td&gt;          &lt;td&gt;spark.components.RadioButton &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.RadioButtonGroup&lt;/td&gt;          &lt;td&gt;spark.components.RadioButtonGroup &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.TextArea&lt;/td&gt;          &lt;td&gt;spark.components.TextArea &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.TabBar&lt;/td&gt;          &lt;td&gt;spark.components.TabBar &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.TextInput&lt;/td&gt;          &lt;td&gt;spark.components.TextInput &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.TileList&lt;/td&gt;          &lt;td&gt;spark.components.List (with a TileLayout) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.ToggleButtonBar&lt;/td&gt;          &lt;td&gt;spark.components.ButtonBar &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.VideoDisplay&lt;/td&gt;          &lt;td&gt;spark.components.VideoPlayer &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.VRule&lt;/td&gt;          &lt;td&gt;spark.primitives.Line &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.VScrollBar&lt;/td&gt;          &lt;td&gt;spark.components.VScrollBar &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.controls.VSlider&lt;/td&gt;          &lt;td&gt;spark.components.VSlider &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.core.Application&lt;/td&gt;          &lt;td&gt;spark.components.Application &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.core.Window&lt;/td&gt;          &lt;td&gt;spark.components.Window &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.core.WindowedApplication&lt;/td&gt;          &lt;td&gt;spark.components.WindowedApplication &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.containers.ApplicationControlBar&lt;/td&gt;          &lt;td&gt;spark.components.Application (with the controlBarContent) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.containers.Canvas&lt;/td&gt;          &lt;td&gt;spark.components.Group &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.containers.ControlBar&lt;/td&gt;          &lt;td&gt;spark.components.Panel (with the controlBarContent property) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.containers.HBox&lt;/td&gt;          &lt;td&gt;spark.components.HGroup &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.containers.Panel&lt;/td&gt;          &lt;td&gt;spark.components.Panel &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.containers.Tile&lt;/td&gt;          &lt;td&gt;spark.components.Group (with a TileLayout) &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td&gt;mx.containers.VBox&lt;/td&gt;          &lt;td&gt;spark.components.VGroup &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;    &lt;br /&gt;These components/containers are developed based on the UIComponent. There are few components/containers who is not having Spark counterpart. Following table demonstrate the list of components/container without Spark counterpart.     &lt;br /&gt;    &lt;br /&gt;&lt;strong&gt;Flex 3 classes with no direct Flex 4 counterpart&lt;/strong&gt;     &lt;br /&gt;    &lt;br /&gt;mx.controls.Alert     &lt;br /&gt;mx.controls.ColorPicker     &lt;br /&gt;mx.controls.DataGrid     &lt;br /&gt;mx.controls.DateChooser     &lt;br /&gt;mx.controls.DateField     &lt;br /&gt;mx.controls.Menu     &lt;br /&gt;mx.controls.MenuBar     &lt;br /&gt;mx.controls.PopUpButton     &lt;br /&gt;mx.controls.PopUpMenuButton     &lt;br /&gt;mx.controls.ProgressBar     &lt;br /&gt;mx.controls.RichTextEditor     &lt;br /&gt;mx.controls.Tree     &lt;br /&gt;mx.containers.Accordion     &lt;br /&gt;mx.containers.DividedBox     &lt;br /&gt;mx.containers.Form     &lt;br /&gt;mx.containers.Grid     &lt;br /&gt;mx.containers.TabNavigator     &lt;br /&gt;mx.containers.TitleWindow     &lt;br /&gt;mx.containers.ViewStack     &lt;br /&gt;    &lt;br /&gt;I am very excited about new architecture in Flex 4. I know you all too.     &lt;br /&gt;    &lt;br /&gt;I will come up with some tutorial very soon in Flex 4.&lt;/span&gt;  </content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/8668112018064542719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-4-new-components-and-containers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/8668112018064542719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/8668112018064542719'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-4-new-components-and-containers.html' title='Flex 4: New components and containers'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-8636545160061961653</id><published>2010-04-24T02:00:00.000-07:00</published><updated>2010-04-24T03:51:09.488-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Custom Event"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial"/><title type='text'>Flex 3: Dispatch custom event</title><content type='html'>In this tutorial, I will walk through the Custom Even handling in Flex 3. Like Flex 3 inbuilt events, you can dispatch your custom event from the custom component. To do this we need to create an Custom Event class inherited from Flex based Event class. After this you can dispatch this custom event from your component or class using dispatch event function. Even you can add this event inline to your custom component tag in mxml file. To get the inline event property we need to set Metadata for the custom Event in component mxml. &lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;br /&gt;In this tutorial, we will create an application which will have login form. And on login we will dispatch the custom LOGIN Event. To complete this application it will need to create following files.&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Login.mxml&lt;/li&gt;&lt;br /&gt;&lt;li&gt;LoginEvent.as&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Main.mxml&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;To start with, we will create an flex application in Flex Builder. While creating the project give your main mxml application file name as &lt;strong&gt;Main.mxml&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Next, we will create the Login component, which will have the simple login form. This form will have two elements as, User Id: and Password:. To create this mxml component first we will set the folder structure to allocate the respective files. We will keep Component within &lt;strong&gt;src.view.components &lt;/strong&gt;folder, and custom events within &lt;strong&gt;src.event &lt;/strong&gt;folder.&lt;br /&gt;&lt;br /&gt;First create these folders in src folder as show in the below image.&lt;br /&gt;&lt;br /&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 173px; height: 168px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY8YZtlT5me7s_F94yNnonDxqshOt1DpkvN8FNTtrWECi6A5EBc7MoAjLHVOlozxC_FptX-OExrKe_ae-pn-PhRetqeZi5jGBk-YeEdujdSztEmyvaTQIUWsMBOaGw1I1YuNERlLPQEes/s320/CustomEventFolderStructor.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5463630383393215938&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Now we are ready with packages, Next we will create the MXML Component named &lt;strong&gt;Login.mxml&lt;/strong&gt; within the &lt;strong&gt;src.view.components &lt;/strong&gt;folder. This Login.mxml will be based on Panel with no default width and height.&lt;br /&gt;&lt;br /&gt;Replace following code to complete the Login Form.&lt;br /&gt;&lt;pre class=&quot;brush: xml&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Panel xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot; title=&quot;Login&quot; width=&quot;302&quot; height=&quot;152&quot;&amp;gt;&lt;br /&gt; &amp;lt;mx:Form width=&quot;100%&quot;&amp;gt;&lt;br /&gt;         &amp;lt;mx:FormItem label=&quot;User ID&quot;&amp;gt;&lt;br /&gt;            &amp;lt;mx:TextInput id=&quot;userid&quot; /&amp;gt;&lt;br /&gt;         &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;         &amp;lt;mx:FormItem label=&quot;Password&quot;&amp;gt;&lt;br /&gt;            &amp;lt;mx:TextInput id=&quot;password&quot; displayAsPassword=&quot;true&quot; /&amp;gt;&lt;br /&gt;         &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;         &amp;lt;mx:FormItem&amp;gt;&lt;br /&gt;            &amp;lt;mx:Button id=&quot;btnLogin&quot; label=&quot;Login&quot;  click=&quot;loginHandler()&quot;/&amp;gt;&lt;br /&gt;         &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;      &amp;lt;/mx:Form&amp;gt;&lt;br /&gt;&amp;lt;/mx:Panel&amp;gt;&lt;br /&gt;&lt;/pre&gt;In above code snippet, we have created the simple login Form containing two input field, User Id and Password respectively and one Login button.&lt;br /&gt;&lt;br /&gt;We need to dispatch custom Login Event on Login Button click, For this first we have to create LoginEvent class.&lt;br /&gt;Create LoginEvent class within &lt;strong&gt;src.events &lt;/strong&gt;package. Make sure you extend this class to flex inbuilt &lt;strong&gt;Event &lt;/strong&gt;class. There are few things we need to follow to create custom event.&lt;br /&gt;&lt;br /&gt;You are require to override the &lt;B&gt;Event.clone()&lt;/B&gt; method. This method will return the clone reference of your custom event i.e. &lt;B&gt;LoginEvent&lt;/B&gt;. &lt;br /&gt;You can create your custom properties that are required by the custom event. In our example &lt;strong&gt;LoginEvent &lt;/strong&gt;will need to have &lt;strong&gt;userId &lt;/strong&gt;and &lt;strong&gt;passWord&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;In &lt;B&gt;LoginEvent&lt;/B&gt; class add following code snippet to complete the CustomEvent class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;package events&lt;br /&gt;{&lt;br /&gt; import flash.events.Event;&lt;br /&gt;&lt;br /&gt; public class LoginEvent extends Event&lt;br /&gt; {&lt;br /&gt;  public static const LOGIN:String = &#39;login&#39;;&lt;br /&gt;  &lt;br /&gt;  public var userId:String = &#39;&#39;;&lt;br /&gt;  public var password:String = &#39;&#39;;&lt;br /&gt;  &lt;br /&gt;  public function LoginEvent(type:String, userId:String, password:String, bubbles:Boolean=false, cancelable:Boolean=false)&lt;br /&gt;  {&lt;br /&gt;   super(type, bubbles, cancelable);&lt;br /&gt;   &lt;br /&gt;   this.userId = userId;&lt;br /&gt;   this.password = password;&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  override public function clone():Event {&lt;br /&gt;            return new LoginEvent(type, userId, password);&lt;br /&gt;        }  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; In the above code snippet, We have created the static const for event type, this we will use when we will dispatch or add event. Also we have created the two public properties userId and password, which we will send along with event when we dispatch this event.&lt;br /&gt;&lt;br /&gt;Now we are ready with &lt;B&gt;LoginEvent&lt;/B&gt; class, next we have to dispatch this event when user clicks on the &lt;B&gt;Login&lt;/B&gt; button from the &lt;B&gt;Login.mxml&lt;/B&gt;. Open Login.mxml file and add click handler function for Login button. In this function we will dispatch the LoginEvent along with userId and password property. Add this function in your Script tag within &lt;strong&gt;Login.mxml&lt;/strong&gt; as shown below.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import events.LoginEvent;&lt;br /&gt;   private function loginHandler():void&lt;br /&gt;   {&lt;br /&gt;    this.dispatchEvent(new LoginEvent(LoginEvent.LOGIN),userid.text, password.text)&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &lt;br /&gt;&lt;/pre&gt; If you noticed in above code, we have dispatch the LoginEvent on loginHandler function. We are ready with custom login component which will dispatch the Login event. But to add this custom login Event inline to the Login tag we need to se the metadata in &lt;strong&gt;Login.mxml&lt;/strong&gt;. To do this add following code just above the Script tag.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&amp;lt;mx:Metadata&amp;gt;&lt;br /&gt; [Event(name=&quot;login&quot;, type=&quot;events.LoginEvent&quot;)]&lt;br /&gt;&amp;lt;/mx:Metadata&amp;gt;&lt;br /&gt;&lt;/pre&gt;Remember you the name what we have mention in the name property above will be used in the Login tag as inline event property.&lt;br /&gt;&lt;br /&gt;Now your complete Login.mxml will look like as below.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Panel xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot; title=&quot;Login&quot; width=&quot;302&quot; height=&quot;152&quot;&amp;gt;&lt;br /&gt; &amp;lt;mx:Metadata&amp;gt;&lt;br /&gt;  [Event(name=&quot;login&quot;, type=&quot;events.LoginEvent&quot;)]&lt;br /&gt; &amp;lt;/mx:Metadata&amp;gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import events.LoginEvent;&lt;br /&gt;   private function loginHandler():void&lt;br /&gt;   {&lt;br /&gt;    this.dispatchEvent(new LoginEvent(LoginEvent.LOGIN),userid.text, password.text)&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &amp;lt;mx:Form width=&quot;100%&quot;&amp;gt;&lt;br /&gt;         &amp;lt;mx:FormItem label=&quot;User ID&quot;&amp;gt;&lt;br /&gt;            &amp;lt;mx:TextInput id=&quot;userid&quot; /&amp;gt;&lt;br /&gt;         &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;         &amp;lt;mx:FormItem label=&quot;Password&quot;&amp;gt;&lt;br /&gt;            &amp;lt;mx:TextInput id=&quot;password&quot; displayAsPassword=&quot;true&quot; /&amp;gt;&lt;br /&gt;         &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;         &amp;lt;mx:FormItem&amp;gt;&lt;br /&gt;            &amp;lt;mx:Button id=&quot;btnLogin&quot; label=&quot;Login&quot;  click=&quot;loginHandler()&quot;/&amp;gt;&lt;br /&gt;         &amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;      &amp;lt;/mx:Form&amp;gt;&lt;br /&gt;&amp;lt;/mx:Panel&amp;gt;&lt;br /&gt;&lt;/pre&gt;Now we will add this custom component in the &lt;B&gt;Main.mxml&lt;/B&gt; file and we will check whether we are getting the &lt;B&gt;LOGIN&lt;/B&gt; event from &lt;B&gt;Login.mxml&lt;/B&gt; component. To do so add following code in your &lt;B&gt;Main.mxml&lt;/B&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application layout=&quot;vertical&quot; &lt;br /&gt; xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&lt;br /&gt; xmlns:components=&quot;view.components.*&quot;&amp;gt;&lt;br /&gt; &amp;lt;mx:Script&amp;gt;&lt;br /&gt;  &amp;lt;![CDATA[&lt;br /&gt;   import mx.controls.Alert;&lt;br /&gt;   import events.LoginEvent;&lt;br /&gt;   &lt;br /&gt;   private function loginHandler(event:LoginEvent):void&lt;br /&gt;   {&lt;br /&gt;    Alert.show(&#39;Loign Event Handled Successfully for user id &#39;+event.userId);&lt;br /&gt;   }&lt;br /&gt;  ]]&amp;gt;&lt;br /&gt; &amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &amp;lt;components:Login login=&quot;loginHandler(event)&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;/pre&gt;If you notice in above code, we have added custom Loign component. And if you see the namespace for Login tag is components. We have added metadata for login event in &lt;strong&gt;Login.mxml &lt;/strong&gt;and that we have used inline to the &lt;B&gt;&amp;lt;components:Login&amp;gt;&lt;/B&gt; tag.&lt;br /&gt;&lt;br /&gt;This is how we can use the Custom component in Flex. &lt;br /&gt;&lt;br /&gt;I hope this will help.&lt;br /&gt;&lt;br /&gt;View &lt;B&gt;&lt;a href=&quot;http://shaileshmak.000fees.net/MyWork/LoginCustomEvent/Main.html&quot; target=&quot;_blank&quot;&gt;Demo&lt;/a&gt;&lt;/B&gt; here.&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/8636545160061961653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-custom-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/8636545160061961653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/8636545160061961653'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-custom-event.html' title='Flex 3: Dispatch custom event'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY8YZtlT5me7s_F94yNnonDxqshOt1DpkvN8FNTtrWECi6A5EBc7MoAjLHVOlozxC_FptX-OExrKe_ae-pn-PhRetqeZi5jGBk-YeEdujdSztEmyvaTQIUWsMBOaGw1I1YuNERlLPQEes/s72-c/CustomEventFolderStructor.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-6341616416835592534</id><published>2010-04-19T12:35:00.000-07:00</published><updated>2010-04-21T04:11:19.776-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Script"/><title type='text'>Flex 3: Calling ActionScript Function from javaScript</title><content type='html'>In my earlier tutorial, we have seen how we can &lt;a href=&quot;http://shaileshmakwana.blogspot.com/2010/04/flex-3-calling-javascript-from-flex.html&quot; target=&quot;_blank&quot;&gt;call JavaScript function from Flex application&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Today I will explain reverse functionality of calling Action Script function from JavaScript. Using &lt;strong&gt;ExternalInterface &lt;/strong&gt;class of Flex library we can invoke Action Script function from JavaScript. To do this first we have to map the function in Action Script using &lt;strong&gt;addCallback&lt;/strong&gt; method. This is static method of class &lt;strong&gt;ExternalInterface&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;For this tutorial we will create an input Field and button in the html. To do this, first create a Flex project in Flex builder. Open your index.template.html form &lt;strong&gt;{project}/html-template/&lt;/strong&gt; folder. In this html page add following code just before the &lt;strong&gt;&amp;lt;/body&amp;gt;&lt;/strong&gt; tag.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml &quot;&gt;&lt;br /&gt;&amp;lt;div&amp;gt;First Name: &amp;lt;input type=&quot;text&quot; id=&quot;firstName&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;Last Name: &amp;lt;input type=&quot;text&quot; id=&quot;lastName&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;Country: &amp;lt;input type=&quot;text&quot; id=&quot;country&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&amp;lt;input type=&quot;button&quot; value=&quot;Send to Flex&quot; onclick=&quot;sendDataToFlex()&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;We have created three input fields for first name, last name and country, We have also added button. Clicking on this button, it will call the Action Script function.&lt;br /&gt;&lt;br /&gt;To make the html page proper. replace all ${width} by 600 and ${height} with 400. So that we can have flex swf size fix to 600x400.&lt;br /&gt;&lt;br /&gt;If you have notice, in above code snippet we are calling sendDataToFlex function on &lt;strong&gt;Send to Flex&lt;/strong&gt; button click. For that we have to write a function. To do this add following code before &lt;strong&gt;&amp;lt;noscript&amp;gt;&lt;/strong&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml &quot;&gt;&lt;br /&gt;&amp;lt;script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;function sendDataToFlex()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;Now in the blank function body, we will add code for calling Flex function. To do this first we need to have reference of flash object in html page. We can retrieve the flex swf object using following function. Add following code above &lt;strong&gt;function sendDataToFlex() &lt;/strong&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;function getFlexApp()&lt;br /&gt;{&lt;br /&gt;if(navigator.appName.indexOf(&quot;microsoft&quot;)!=-1)&lt;br /&gt;{&lt;br /&gt;return window[&#39;${application}&#39;];&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;returndocument[&#39;${application}&#39;];&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;This function will return the flex swf object reference. Now using this function we will call the function in Flex application.&lt;br /&gt;&lt;br /&gt;Now we need to write a function which will call the flex method. Add following code after getFlexApp function.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;function sendDataToFlex()&lt;br /&gt;{&lt;br /&gt;getFlexApp().addPerson(document.getElementById(&#39;firstName&#39;).value, document.getElementById(&#39;lastName&#39;).value, document.getElementById(&#39;country&#39;).value);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;In the above method we have taken Flex application reference using getFlexApp and we are calling addPerson method of flex application. For this method we require three parameters, Here we will pass the values of each text field we have created.&lt;br /&gt;&lt;br /&gt;Now we are done with creating Html file. Once you build your project, This template will create the html page in your output folder of project, by default it is bin-debug with all modification we made in the template.&lt;br /&gt;&lt;br /&gt;Next we have to move to MXML. Open your application mxml file. In this file we will create a data grid component in which all data comes from java script will populate. Following code will create the data grid in your application.&lt;br /&gt;&lt;pre class=&quot;brush: xml &quot;&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&lt;br /&gt;layout=&quot;vertical&quot;&lt;br /&gt;creationComplete=&quot;init();&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:DataGrid width=&quot;500&quot;&lt;br /&gt;height=&quot;250&quot;&lt;br /&gt;dataProvider=&quot;{persons}&quot;&amp;gt;&lt;br /&gt;&amp;lt;mx:columns&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGridColumn headerText=&quot;First Name&quot;&lt;br /&gt;dataField=&quot;firstName&quot;/&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGridColumn headerText=&quot;Last Name&quot;&lt;br /&gt;dataField=&quot;lastName&quot;/&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGridColumn headerText=&quot;Country&quot;&lt;br /&gt;dataField=&quot;country&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/mx:columns&amp;gt;&lt;br /&gt;&amp;lt;/mx:DataGrid&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;/pre&gt;We are ready with display component, Next we have to map JavaScript function using ExternalInterface.addCallback method. In this method we have to set two parameters, First will be the name what we will use in the JavaScript and next will be the function reference. Also we will create the function which will be called from JavaScript. In this function we will receive three parameters, add these values in persons array collection. This variable is binded with the data Grid. Updating this variable will add the values in Data greed. Add following code in the script tag of MXML file.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;import mx.collections.ArrayCollection;&lt;br /&gt;&lt;br /&gt;[Bindable]&lt;br /&gt;private var persons:ArrayCollection = new ArrayCollection();&lt;br /&gt;&lt;br /&gt;public function addPerson(firstName:String, lastName:String, country:String):void&lt;br /&gt;{&lt;br /&gt;persons.addItem({&#39;firstName&#39;: firstName, &#39;lastName&#39;: lastName, &#39;country&#39;: country});&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function init():void&lt;br /&gt;{&lt;br /&gt;ExternalInterface.addCallback(&#39;addPerson&#39;, addPerson);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Once it is set, we are all set to go. Build your project and check.&lt;br /&gt;&lt;br /&gt;Check out the &lt;a href=&quot;http://shaileshmak.000fees.net/MyWork/JavaScriptToFlex/JavaScriptToFlex.html&quot; target=&quot;_blank&quot;&gt;demo&lt;/a&gt; here&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/6341616416835592534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-calling-actionscript-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/6341616416835592534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/6341616416835592534'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-calling-actionscript-function.html' title='Flex 3: Calling ActionScript Function from javaScript'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-7420691554447363143</id><published>2010-04-17T08:47:00.001-07:00</published><updated>2010-04-20T07:06:34.094-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Script"/><title type='text'>Flex 3: Calling JavaScript from Flex</title><content type='html'>It is possible to communicate with the javascript functions reside in the html page from Flex. Flex library has an &lt;b&gt;ExternalInterface&lt;/b&gt; class which allow us to communicate with Flex and javaScript and vice versa. &lt;br /&gt;&lt;br /&gt;In this tutorial I will explain how you can communicate. You can call javaScript function which has no parameter, which has parameters and function which is returning values. I will cover function which will receive parameter in string format and returns the plain string. &lt;br /&gt;&lt;br /&gt;To start with, First create a flex project in the Builder. First we will create a javaScript function in the html page and then we will call that from the Flex application. Open your &lt;b&gt;index.template.html&lt;/b&gt; form {project}/html-template/ folder. In this html page add following code just before the &amp;lt;noscript&amp;gt; tag.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;&amp;lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;function flexTojavaScript(fromFlex)&lt;br /&gt;{&lt;br /&gt;alert(value);&lt;br /&gt;return &#39;Returning from JavaScript to Flex&#39;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;span class=&quot;fullpost&quot;&gt;In the above code I have created the Script tag and within that I have created a function named &lt;b&gt;&#39;flexTojavaScript&#39;&lt;/b&gt; which will receive a parameter named &lt;b&gt;&#39;fromFlex&#39;&lt;/b&gt;. This function will return plain text.&lt;br /&gt;&lt;br /&gt;That&#39;s it, we are done with the changes in html page.&lt;br /&gt;&lt;br /&gt;Now we will move to the flex application mxml. In this mxml, I have created a button which will call the clickHandler on clicking on it. From the click handler I have called the javascript function using ExternalInterface class. The value returned from the javascript is stored in the returnFromJavaScript variable.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;private function clickHandler():void&lt;br /&gt;{&lt;br /&gt;returnFromJavaScript=&#39;&#39;;&lt;br /&gt;returnFromJavaScript = ExternalInterface.call(&quot;flexTojavaScript&quot;, &quot;This is called from Flex&quot;);&lt;br /&gt;}&lt;/pre&gt;ExternalInterface class has static method named &lt;b&gt;&#39;call&#39;&lt;/b&gt;. using this function we can call the javaScript function. In this function you will find two parameter, first parameter is the name of the javaScript function as a string. You can also send the parameters. In the above code we are sending plain string to javaScript. As mention above the function is javaScript is returning string. Which we are storing in the application local variable. In this application I have crated the text which will show up the return value of javaScript function.&lt;br /&gt;&lt;br /&gt;That&#39;s it We are done with the changes. Just build your project and click on the button. You will find that javaScript alert will appear. Which will have the parameter text what we have sent from the Flex. On Clicking OK button of the alert prompt. You will find that the value which is returned from the javaScript will populate below the button.&lt;br /&gt;&lt;br /&gt;This is very simple method using which we can call the javaScript function from the Flex.&lt;br /&gt;&lt;br /&gt;I hope this will help you.&lt;br /&gt;&lt;br /&gt;In my next tutorial I will explain the revers of this, i.e. Calling Flex function from javaScript.&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/7420691554447363143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-calling-javascript-from-flex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7420691554447363143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7420691554447363143'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-calling-javascript-from-flex.html' title='Flex 3: Calling JavaScript from Flex'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-744485057609995704</id><published>2010-04-17T06:07:00.001-07:00</published><updated>2010-04-17T07:11:27.455-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FlashVar"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><title type='text'>Flex 3: setting data using FlashVars</title><content type='html'>If you want to set any variables from html page to your Flex application. You can do it by setting FlashVars in the html page. This data can be read in Flex at runtime by accessing Application.application.parameter property.&lt;br /&gt;&lt;br /&gt;Following example will demonstrate the steps to access the data in flex using FlashVars.&lt;br /&gt;&lt;br /&gt;First create an Flex project in the flex builder. Now you have to set the required data in your html file in which the Flex application is reside. To do this you have to add the FlashVars property in your html.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;Open your index.template.html form {project}/html-template/ folder. Why this file? Modifying this file will compile your actual html page with the latest changes you have made to this template file. Doing this you will have all your modification in the final compiled html file.&lt;br /&gt;&lt;br /&gt;Next you have to set the FlashVars property. This you have to do it at two places. First within the &amp;lt;object&amp;gt; tag you will find &amp;lt;embed&amp;gt; tag.In this tag there are few properties set for the application swf file like.src, quality, bgcolor etc. you need to add one more property here i.e.FlashVars.    Now identify the data which you want to pass to Flex application. And add that in above tag property(&amp;lt;object&amp;gt;&amp;lt;embed&amp;gt;) as follow.&lt;br /&gt;&lt;br /&gt;FlashVars=&quot;Name=Shailesh Makwana&amp;Age=32&amp;Qualification=B&#39;Com&amp;Experience=10 years&quot;&lt;br /&gt;&lt;br /&gt;Now your final code will look like this.    &lt;br /&gt;&lt;pre class=&quot;brush: html&quot;&gt;&lt;br /&gt;&amp;lt;noscript&amp;gt;&lt;br /&gt;   &amp;lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;&lt;br /&gt;   id=&quot;${application}&quot; width=&quot;${width}&quot; height=&quot;${height}&quot;&lt;br /&gt;   codebase=&quot;http://fpdownload.macromedia.com/get/flashplayer/current/swflash`.cab&quot;&amp;gt;&lt;br /&gt;   &amp;lt;param name=&quot;movie&quot; value=&quot;${swf}.swf&quot; /&amp;gt;&lt;br /&gt;   &amp;lt;param name=&quot;quality&quot; value=&quot;high&quot; /&amp;gt;&lt;br /&gt;   &amp;lt;param name=&quot;bgcolor&quot; value=&quot;${bgcolor}&quot; /&amp;gt;&lt;br /&gt;   &amp;lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&amp;gt;&lt;br /&gt;   &amp;lt;embed src=&quot;${swf}.swf&quot; quality=&quot;high&quot; bgcolor=&quot;${bgcolor}&quot;&lt;br /&gt;    width=&quot;${width}&quot; height=&quot;${height}&quot; name=&quot;${application}&quot; align=&quot;middle&quot;&lt;br /&gt;    play=&quot;true&quot;&lt;br /&gt;    loop=&quot;false&quot;&lt;br /&gt;    quality=&quot;high&quot;&lt;br /&gt;    allowScriptAccess=&quot;sameDomain&quot;&lt;br /&gt;    type=&quot;application/x-shockwave-flash&quot;&lt;br /&gt;    pluginspage=&quot;http://www.adobe.com/go/getflashplayer&quot;&lt;br /&gt;    FlashVars=&quot;Name=Shailesh Makwana&amp;Age=32&amp;Qualification=B&#39;Com&amp;Experience=10 years&quot;&amp;gt;&lt;br /&gt;   &amp;lt;/embed&amp;gt;&lt;br /&gt; &amp;lt;/object&amp;gt;&lt;br /&gt;&amp;lt;/noscript&amp;gt;&lt;br /&gt;&lt;/pre&gt;Second place where you have to add the flash var is at javascript block. If you look above you will find javascript block with if an else if condition. in the else if condition block you will find some property is been set. Here you have to add flashVars. &lt;br /&gt;&lt;br /&gt;Add following line of code as last parameter of AC_FL_RunContent function within else if block.  &lt;br /&gt;&quot;FlashVars&quot;, &quot;Name=Shailesh Makwana&amp;Age=32&amp;Qualification=B&#39;Com&amp;Experience=10 years&quot;  &lt;br /&gt;&lt;br /&gt;You must have noticed that the snippet of FlashVars here is little different than the first step. Also make sure you add the comma after last parameter before adding this FlashVars. This is the common mistake everyone does.  &lt;br /&gt;&lt;br /&gt;Now your code will look like this. &lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;AC_FL_RunContent(&lt;br /&gt;   &quot;src&quot;, &quot;${swf}&quot;,&lt;br /&gt;   &quot;width&quot;, &quot;${width}&quot;,&lt;br /&gt;   &quot;height&quot;, &quot;${height}&quot;,&lt;br /&gt;   &quot;align&quot;, &quot;middle&quot;,&lt;br /&gt;   &quot;id&quot;, &quot;${application}&quot;,&lt;br /&gt;   &quot;quality&quot;, &quot;high&quot;,&lt;br /&gt;   &quot;bgcolor&quot;, &quot;${bgcolor}&quot;,&lt;br /&gt;   &quot;name&quot;, &quot;${application}&quot;,&lt;br /&gt;   &quot;allowScriptAccess&quot;,&quot;sameDomain&quot;,&lt;br /&gt;   &quot;type&quot;, &quot;application/x-shockwave-flash&quot;,&lt;br /&gt;   &quot;pluginspage&quot;, &quot;http://www.adobe.com/go/getflashplayer&quot;,&lt;br /&gt;   &quot;FlashVars&quot;, &quot;Name=Shailesh Makwana&amp;Age=32&amp;Qualification=B&#39;Com&amp;Experience=10 years&quot;&lt;br /&gt; );&lt;/pre&gt;Now you are done with the html editing. When you will run the application from the builder. The output html file will have above changes.  &lt;br /&gt;&lt;br /&gt;Now, next we have to access these variables in the Flex. Open your main application MXML file. here you can access these flashVars using Application.application.parameters;. This parameter is of type object. Use these variable in your application wherever you need.  I have accessed these variable in creationComplete event. And assigned the respective variable value to the text component as follow.  &lt;br /&gt;&lt;pre class=&quot;brush: actionscript3 &quot;&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot; creationComplete=&quot;init();&quot;&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt; &amp;lt;![CDATA[&lt;br /&gt;&lt;br /&gt;  private function init():void&lt;br /&gt;  {&lt;br /&gt;   var flashVar:Object = Application.application.parameters;&lt;br /&gt;   &lt;br /&gt;   nameT.htmlText = &quot;&amp;lt;b&amp;gt;Name :&amp;lt;/b&amp;gt;&quot; +flashVar.Name;&lt;br /&gt;   ageT.htmlText = &quot;&amp;lt;b&amp;gt;Age :&amp;lt;/b&amp;gt;&quot; +flashVar.Age;&lt;br /&gt;   qualificationT.htmlText = &quot;&amp;lt;b&amp;gt;Qualification :&amp;lt;/b&amp;gt;&quot; +flashVar.Qualification;&lt;br /&gt;   experienceT.htmlText = &quot;&amp;lt;b&amp;gt;Experience :&amp;lt;/b&amp;gt;&quot; +flashVar.Experience;&lt;br /&gt;  }&lt;br /&gt; ]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt; &amp;lt;mx:VBox width=&quot;300&quot; height=&quot;100%&quot;&amp;gt;&lt;br /&gt;  &amp;lt;mx:Text id=&quot;nameT&quot; width=&quot;100%&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;mx:Text id=&quot;ageT&quot; width=&quot;100%&quot; /&amp;gt; &lt;br /&gt;  &amp;lt;mx:Text id=&quot;qualificationT&quot; width=&quot;100%&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;mx:Text id=&quot;experienceT&quot; width=&quot;100%&quot; /&amp;gt;  &lt;br /&gt; &amp;lt;/mx:VBox&amp;gt; &lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;After compiling this project, you will see that all variable what we have set in the html is now displayed in the Flex application. I hope this will help you.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/744485057609995704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-setting-data-using-flashvars.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/744485057609995704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/744485057609995704'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-setting-data-using-flashvars.html' title='Flex 3: setting data using FlashVars'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-3768301635127944138</id><published>2010-04-16T08:05:00.000-07:00</published><updated>2010-04-16T08:45:01.291-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern. AS3"/><category scheme="http://www.blogger.com/atom/ns#" term="Singleton Patter"/><title type='text'>SingleTon design pattern in AS3</title><content type='html'>Singleton patter is very useful pattern when you need to have only one object of any class in application. You can enforce this by creating a singleton class.&lt;br /&gt;&lt;br /&gt;We cannot directly restrict the user to create multiple object of any class in AS3, Since AS3 doesn&#39;t support private or protected constructor. AS3 constructor can always be public. So how we can restrict user for creating an object from outside. There is a work around to this. We can achieve this by creating an enforcer class in the same class file. And we will pass the reference of this enforcer class in the constructor of Singleton class. Since the enforce class can be access by same class only. No one can create the singleton class object outside that class.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;Following example explain how we can achieve using AS3.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;package &lt;br /&gt;{&lt;br /&gt; public class Singleton&lt;br /&gt; {&lt;br /&gt;  private static var _instance:Singleton;&lt;br /&gt;&lt;br /&gt;  public function Singleton (enforcer:Enforcer)&lt;br /&gt;  {&lt;br /&gt;   if(!enforcer)&lt;br /&gt;    throw(new Error(&quot;The Class cannot be instantiated.&quot;));&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public static function getInstance():ModelLocator&lt;br /&gt;  {&lt;br /&gt;   if(!_instance)&lt;br /&gt;    _instance = new ModelLocator(new Enforcer())&lt;br /&gt;&lt;br /&gt;   return _instance;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Enforcer&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Create a class which will receive a parameter as enforcer class. And create the enforcer class within the same class below the package block. This enforcer class can only be access by the Singleton class only. &lt;br /&gt;&lt;br /&gt;As Singleton class object require Enforcer object reference as a paramer, it cannot be created from outside from the Singleton class. We are checking in Singleton constructor body that if enforcer is null, it will throw an error.&lt;br /&gt;&lt;br /&gt;This class can be access only by calling getInstance Static method.&lt;br /&gt;&lt;br /&gt;To access this class reference use following code snipped.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;var singleton: Singleton = Singleton.getInstance();&lt;/pre&gt;&lt;br /&gt;I hope this will help you in your development.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Singleton patter is very useful pattern when you need to have only one object of any class in application. You can enforce this by creating a singleton class.&lt;br /&gt;&lt;br /&gt;We cannot directly restrict the user to create multiple object of any class in AS3, Since AS3 doesn&#39;t support private or protected constructor. AS3 constructor can always be public. So how we can restrict user by creating an object from outside. There is a work around to this. We can achieve this by creating an enforcer class in the same class file. and we will pass the reference of this enforcer class in the constructor of Singleton class. Since the enforce class can be access by same class only. No one can create the singleton class object outside that class.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/3768301635127944138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/singleton-in-as3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/3768301635127944138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/3768301635127944138'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/singleton-in-as3.html' title='SingleTon design pattern in AS3'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-2986332581493668291</id><published>2010-04-16T01:47:00.001-07:00</published><updated>2010-04-16T08:32:28.670-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASDoc"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><title type='text'>AS Doc Creation from Flex Builder 3.</title><content type='html'>Flex builder has capability of generating ASDoc using an exe, which will generate the ASDoc for your codes. But how? I didn&#39;t find any documention in the help of flex builder. So I am writting this for all, who are looking for.&lt;br /&gt;&lt;br /&gt;It is very simple. Following steps demonstrate how we can set the ASDoc compliar in Flex builder 3.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1&lt;/strong&gt;. Set up the external tool in builder by clicking Run &gt; External Tools &gt; Open External Tool Dialog. Or you can get it from tool bar. Click on the following icon in tool bar.&lt;br /&gt;&lt;img style=&quot;WIDTH: 42px; HEIGHT: 28px; CURSOR: hand&quot; id=&quot;BLOGGER_PHOTO_ID_5460654679608316210&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTWpNk3dLWBTCoPj5GGpLwFO6FAMZCHBIo9OGp7Jh2q9xNT5VcTvExP4Z3cJdMjSXyZj2L97ROCRmINWyO8yrDw3ulr05qwEonRqZytOT5HwQky8ep_MibdLJTU5bT1xAUCE1bKi101Ag/s320/icon.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;This will pop up External Tools dialog box.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;strong&gt;Step 2&lt;/strong&gt;. Click on the new launch configration button from the top left&lt;br /&gt;&lt;img style=&quot;WIDTH: 29px; HEIGHT: 28px; CURSOR: hand&quot; id=&quot;BLOGGER_PHOTO_ID_5460654840679982562&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJjbA597udsE0wj4I26X8G2MpSxICal4yGIsPXDa8jibqRcPjWVt_sic4p11ZARRaSx2otQP2PnKUlCOtLWfVBjx189YKQAdhZz3M_bNUiIlDgT1OELQXeWMhJybebORSwyv_XUjFXuHQ/s320/new.jpg&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 3&lt;/strong&gt;. Give it name whatever you fill approricate.&lt;br /&gt;In the location field click on browse button and search for the asdoc exe in the SDK folder. by default it reside at C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin\asdoc.exe in windows.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 4&lt;/strong&gt;. Point your project folder. In the working directory field type &lt;strong&gt;&lt;span style=&quot;color:#66ffff;&quot;&gt;${project_loc} –&lt;/span&gt;&lt;/strong&gt; this will point to your current project.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 5&lt;/strong&gt; : Set up the arguments. Inn the arguments field add following arguments.&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#33ffff;&quot;&gt;-source-path src&lt;br /&gt;-doc-sources src&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;This assumes that you set up your projects with the default source folder called src. It’ll look into your project folder’s src for generating ASDoc.&lt;br /&gt;&lt;br /&gt;Thats it, you have setup your ASDoc generation tool. Now just click on the Run button to Generate the Doc. This will create athe ASDoc in &lt;span style=&quot;color:#33ffff;&quot;&gt;asdoc-output&lt;/span&gt; folder within your current folder structure.&lt;br /&gt;&lt;br /&gt;I hope this will help you.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/2986332581493668291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/as-doc-creation-from-flex-builder-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/2986332581493668291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/2986332581493668291'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/as-doc-creation-from-flex-builder-3.html' title='AS Doc Creation from Flex Builder 3.'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTWpNk3dLWBTCoPj5GGpLwFO6FAMZCHBIo9OGp7Jh2q9xNT5VcTvExP4Z3cJdMjSXyZj2L97ROCRmINWyO8yrDw3ulr05qwEonRqZytOT5HwQky8ep_MibdLJTU5bT1xAUCE1bKi101Ag/s72-c/icon.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-7486812973354924058</id><published>2010-04-10T23:47:00.001-07:00</published><updated>2010-04-16T08:31:16.378-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="framework"/><category scheme="http://www.blogger.com/atom/ns#" term="HTTPService"/><category scheme="http://www.blogger.com/atom/ns#" term="PureMVC"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="XML loading"/><title type='text'>Flex 3: PureMVC tutorial</title><content type='html'>&lt;a onclick=&quot;window.open(&#39;http://shaileshmak.000fees.net/MyWork/FlexPureMVCExample/PureMVCExample.html&#39;, &#39;_blank&#39;, &#39;height=500&#39;, &#39;width=300&#39;)&quot;&gt;&lt;img style=&quot;TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 110px; CURSOR: hand&quot; id=&quot;BLOGGER_PHOTO_ID_5458821610231079154&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI5rT6dz5-dH7wPQkhqlCkOAfqzl7HomiXUsXwS0xE4md02vPY5nJEWqIj4sHk2q7irL-4N3MGB7DnZzzv7xvBrgODe_sTNJYhfmjHVg8rVoOUy0Pme9LlbE9pxlmhbZQjFlLn4uGXy7w/s320/screenShot.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;PureMVC is free framework which you can use to develop the MVC structured project. As name suggest pureMVC is a framework which is based on the &lt;strong&gt;M&lt;/strong&gt;odel, &lt;strong&gt;V&lt;/strong&gt;iew and &lt;strong&gt;C&lt;/strong&gt;ontroller. Where you can isolate your business logic with your view elements.&lt;/p&gt;&lt;p&gt;Today I got an opportunity to write a tutorial on Flex development using pureMVC framework. In this tutorial I will walk through the development process using pureMVC framework. The project which I will explain here will have simple data population on datagrid from the XML using HTTPService.&lt;/p&gt;&lt;p&gt;Before we get going, you’ll need the following&lt;/p&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3&quot;&gt;Flex SDK 3&lt;/a&gt;. Its free! &lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://www.adobe.com/products/flex/&quot;&gt;Flex Builder 3&lt;/a&gt; &lt;/li&gt;&lt;li&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://trac.puremvc.org/PureMVC_AS3/wiki/Downloads&quot;&gt;PureMVC&lt;/a&gt;&lt;/li&gt;framework library. &lt;span class=&quot;fullpost&quot;&gt;&lt;p&gt;Before I start this tutorial, I assume that you have knowledge about AS3 and Flex. Also you have knowledge of using Flex Builder 3.&lt;/p&gt;&lt;p&gt;Now we are ready with all required tools. we can start with actual project development. First we will setup the project in Flex Build. Then we will set the packages and folders.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create flex project in Flex Builder 3 and name it SimplePureMVCExample &lt;/li&gt;&lt;li&gt;add the pureMVC framework library in the lib folder ( add PureMVC_AS3_2_0_4.swc in lib folder of the project). (Refer below image). &lt;/li&gt;&lt;li&gt;Within src folder of the project, create following packages for Model, View and Controller. (Refer below image.)&lt;br /&gt;&lt;br /&gt;com.sm.pureMVC.model.&lt;br /&gt;com.sm.pureMVC.view.&lt;br /&gt;com.sm.pureMVC.controller. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij7L-8jffzCdSa6FTJwWr-HFqvAbLJXh8y3vQhNfSZKHEl0BfiYuxNoIlqtOR3huVB0nC-ACbd7Ml6zqFADzGGJ0JfrQ76rKHnWvhCiNvhIlbB82zEF7mz5ggZZjzt2D1v5WbyjMQaGlY/s1600-h/folderStructure%5B2%5D.jpg&quot;&gt;&lt;img style=&quot;BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px&quot; title=&quot;folderStructure&quot; border=&quot;0&quot; alt=&quot;folderStructure&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6FVBynCqXKl4utIxaLiEvr8xTMep8xfzP4uemGlb8JSbnFuq_pjg2raK3Qig2VnHfj0fw7wyt5meDdT_LzB_ztks-eQMWLUR8Bg0dfn8l2QA_XI-Ed52jFTCzW0kvR8XBjq4JV3b6e7Y/?imgmax=800&quot; width=&quot;218&quot; height=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Now we have all folder ready. I will explain what each folder will have.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Controller&lt;/strong&gt; – will have all command classes. Which will use to communicate between Model(Proxy) and view(Mediator)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Model&lt;/strong&gt; – will have all business logic classes. Which will process business logic and send the notification.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;View&lt;/strong&gt; – will have all mediator classes which will listen to all visual elements.&lt;/p&gt;&lt;p&gt;Application developed using pureMVC framework needs to have an entry point which will startup the pureMVC framework. For this we need to create an ApplicationFacade class. Which will be a heart of the application. &lt;/p&gt;&lt;p&gt;First we will create an application mxml file which will send a startup notification. which will start the pureMVC.&lt;/p&gt;Following is the code of main application class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;br /&gt;&lt;?xml:namespace prefix = mx /&gt;&lt;mx:application layout=&quot;vertical&quot; mx=&quot;http://www.adobe.com/2006/mxml&quot; creationcomplete=&quot;init()&quot; components=&quot;com.sm.pureMVC.view.components.*&quot; viewsourceurl=&quot;srcview/index.html&quot;&gt;&lt;br /&gt; &lt;mx:script&gt;&lt;br /&gt;&lt;br /&gt; &lt;/mx:script&gt;&lt;br /&gt; &lt;mx:button id=&quot;getEmployee&quot; label=&quot;Get Employee&quot;&gt;&lt;/mx:button&gt;&lt;br /&gt; &lt;?xml:namespace prefix = components /&gt;&lt;components:employeedetail id=&quot;employeeList&quot;&gt;&lt;/components:employeedetail&gt;&lt;br /&gt;&lt;/mx:application&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;If you noticed I have called the startup method on creationComplete event. In this method i have passed the reference of application. The startup method is been called by accessing single tone class ApplicationFacade.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;private function init():void&lt;br /&gt;{&lt;br /&gt;    ApplicationFacade.getInstance().startup(this);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;This Application mxml has the reference of two visual elements. i.e. Button and Custom component Employee Detail. Which is just an data grid, which will hold the details about the employee. This we will used later with Mediators.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;&lt;mx:button id=&quot;getEmployee&quot; label=&quot;Get Employee&quot;&gt;&lt;/mx:button&gt;&lt;br /&gt;&lt;components:employeedetail id=&quot;employeeList&quot;&gt;&lt;/components:employeedetail&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Now we will move to the next class. i.e. ApplicationFacade. This is a single tone class. This class will extend the Facade class of pureMVC frame work and implement IFacade. This is mandatory that Application Facade class should extend the Facade class of framework and implement the IFacade interface. &lt;/p&gt;&lt;p&gt;Following is the code sample of Application Facade class.&lt;/p&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;package com.sm.pureMVC {&lt;br /&gt; import com.sm.pureMVC.controller.LoadCommand;&lt;br /&gt; import com.sm.pureMVC.controller.StartupCommand;&lt;br /&gt;&lt;br /&gt; import org.puremvc.as3.interfaces.IFacade;&lt;br /&gt; import org.puremvc.as3.patterns.facade.Facade;&lt;br /&gt; import org.puremvc.as3.patterns.observer.Notification;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @author SM&lt;br /&gt;  */&lt;br /&gt; public class ApplicationFacade extends Facade implements IFacade {&lt;br /&gt;&lt;br /&gt;  public static const NAME : String = &#39;ApplicationFacade&#39;;&lt;br /&gt;  public static const STARTUP : String = NAME + &#39;Startup&#39;;&lt;br /&gt;  public static const LOAD : String = NAME + &#39;Load&#39;;&lt;br /&gt;  public static const DATA_LOADED : String = NAME + &#39;dataLoaded&#39;;&lt;br /&gt;&lt;br /&gt;  public static function getInstance() : ApplicationFacade {&lt;br /&gt;   if(instance == null)instance = new ApplicationFacade();&lt;br /&gt;   return instance as ApplicationFacade;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override protected function initializeController() : void {&lt;br /&gt;   super.initializeController();&lt;br /&gt;   registerCommand(STARTUP, StartupCommand);&lt;br /&gt;   registerCommand(LOAD, LoadCommand);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public function startup(application : PureMVCExample) : void&lt;br /&gt;  {&lt;br /&gt;   sendNotification(STARTUP, application);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override public function sendNotification(notificationName : String, body : Object = null, type : String = null) : void {&lt;br /&gt;   notifyObservers(new Notification(notificationName, body, type));&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;In this class you have noticed that, there are few const declared in the beginning. These are the names of the commands. Which will be access during sending notification.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  public static const NAME : String = &#39;ApplicationFacade&#39;;&lt;br /&gt;  public static const STARTUP : String = NAME + &#39;Startup&#39;;&lt;br /&gt;  public static const LOAD : String = NAME + &#39;Load&#39;;&lt;br /&gt;  public static const DATA_LOADED : String = NAME + &#39;dataLoaded&#39;;&lt;br /&gt;&lt;/pre&gt;The initialize Controller method will used to register all controllers(Commands).This is an overridden method of Facade class. and this will call the super method and then it will register all controllers. To register the command we will use the registerCommand method and we will pass two parameters. First is Name of the command and second is the command class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  override protected function initializeController() : void {&lt;br /&gt;   super.initializeController();&lt;br /&gt;   registerCommand(STARTUP, StartupCommand);&lt;br /&gt;   registerCommand(LOAD, LoadCommand);&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;The startup public method will be called from the main application mxml file. and this will send a notification of STARTUP command. and it will also send the reference to the main application. This notification will execute the Startup command.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  public function startup(application : PureMVCExample) : void&lt;br /&gt;  {&lt;br /&gt;   sendNotification(STARTUP, application);&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Now we have send the STARTUP notification. We will need to create an StartupCommand class within com.sm.pureMVC.controller package. This class will extend the SImpleCommand of pureMVC framework and implements the ICommand. This is the entry command which will initiate the Proxy and Mediator. Whenever the startup notification is send it will trigger the execute method of Startup Command &lt;/p&gt;&lt;p&gt;Following is the code sample of StartupCommand class.&lt;/p&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;package com.sm.pureMVC.controller {&lt;br /&gt;&lt;br /&gt; import com.sm.pureMVC.model.EmployeeServiceProxy;&lt;br /&gt; import com.sm.pureMVC.view.ApplicationMediator;&lt;br /&gt;&lt;br /&gt; import org.puremvc.as3.interfaces.INotification;&lt;br /&gt; import org.puremvc.as3.patterns.command.SimpleCommand;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @author SM&lt;br /&gt;  */&lt;br /&gt; public class StartupCommand extends SimpleCommand {&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * Initialize the model and views&lt;br /&gt;   */&lt;br /&gt;  override public function execute(notification:INotification):void&lt;br /&gt;  {&lt;br /&gt;   facade.registerProxy(new EmployeeServiceProxy());&lt;br /&gt;   facade.registerMediator(new ApplicationMediator(notification.getBody() as PureMVCExample));&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The execute overridden method will have the code for initializing the EmployeeServiceProxy proxy and ApplicationMediator mediator. The application reference passed along with startUp Notification can be accessed by notification parameter of execute method. i.e by notification.getBody(); and this will be passed to the Mediator as a parameter.&lt;/p&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  override public function execute(notification:INotification):void&lt;br /&gt;  {&lt;br /&gt;   facade.registerProxy(new EmployeeServiceProxy());&lt;br /&gt;   facade.registerMediator(new ApplicationMediator(notification.getBody() as PureMVCExample));&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;Now we are ready with startup command class. Lets move to create EmployeeServiceProxy class. We will create this proxy class in com.sm.pureMVC.model package.This class will hold the logic of loading XML using http Service. In this class we will create the service which will load the employee.xml on call of onLoad method from outside. On http Service result we will send the notification of DATA_LOADED along with an array collection. This will be listen by EmployeeDetailMediator class employee datagrid component. &lt;p&gt;&lt;/p&gt;&lt;p&gt;Following is the code sample of EmployeeServiceProxy class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;   package com.sm.pureMVC.model&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; import com.sm.pureMVC.ApplicationFacade;&lt;br /&gt;&lt;br /&gt; import mx.collections.ArrayCollection;&lt;br /&gt; import mx.controls.Alert;&lt;br /&gt; import mx.rpc.events.FaultEvent;&lt;br /&gt; import mx.rpc.events.ResultEvent;&lt;br /&gt; import mx.rpc.http.mxml.HTTPService;&lt;br /&gt;&lt;br /&gt; import org.puremvc.as3.interfaces.IProxy;&lt;br /&gt; import org.puremvc.as3.patterns.proxy.Proxy;&lt;br /&gt;&lt;br /&gt; public class EmployeeServiceProxy extends Proxy implements IProxy&lt;br /&gt; {&lt;br /&gt;  public static const NAME:String = &#39;EmployeeProxy&#39;;&lt;br /&gt;&lt;br /&gt;  private var serv:HTTPService;&lt;br /&gt;&lt;br /&gt;  public function EmployeeServiceProxy(data:Object = null)&lt;br /&gt;  {&lt;br /&gt;   super(NAME, data);&lt;br /&gt;   setService()&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private function setService():void&lt;br /&gt;  {&lt;br /&gt;   serv = new HTTPService();&lt;br /&gt;   serv.url=&quot;assets/data/employee.xml&quot;&lt;br /&gt;            serv.resultFormat=&quot;object&quot;&lt;br /&gt;            serv.addEventListener(ResultEvent.RESULT,servResultHandler);&lt;br /&gt;            serv.addEventListener(FaultEvent.FAULT,servFaultHandler);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private function servResultHandler(event:ResultEvent):void&lt;br /&gt;  {&lt;br /&gt;   sendNotification(ApplicationFacade.DATA_LOADED, event.result.Employee_Info.Employee as ArrayCollection); &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private function servFaultHandler(event:FaultEvent):void&lt;br /&gt;  {&lt;br /&gt;   Alert.show(event.toString()); &lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public function loadData():void&lt;br /&gt;  {&lt;br /&gt;   serv.send();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override public function getProxyName():String&lt;br /&gt;  {&lt;br /&gt;   return EmployeeServiceProxy.NAME;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;   &lt;/pre&gt;&lt;br /&gt;Declare the proxy name const in the beginning. This cont can be used, when we have to access the proxy class using retriveProxy method of Facade class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;   public static const NAME:String = &#39;EmployeeProxy&#39;;&lt;br /&gt;&lt;/pre&gt;The setService method will be called from the constructor and it will initialize the http service and set the required properties and listeners.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  private function setService():void&lt;br /&gt;  {&lt;br /&gt;   serv = new HTTPService();&lt;br /&gt;   serv.url=&quot;assets/data/employee.xml&quot;&lt;br /&gt;   serv.resultFormat=&quot;object&quot;&lt;br /&gt;   serv.addEventListener(ResultEvent.RESULT,servResultHandler);&lt;br /&gt;   serv.addEventListener(FaultEvent.FAULT,servFaultHandler);&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;The loadData method will be called from the outside. This method will send the http service request. The result/fault of the request will be handle in the respective handler methods.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;   public function loadData():void&lt;br /&gt;  {&lt;br /&gt;   serv.send();&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;The servResultHandler will triggered on result of service. This function will send the notification for data loaded along with the data object. This notification will be listen by the interested mediators(in this project EmployeeDetailMediator).&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  private function servResultHandler(event:ResultEvent):void&lt;br /&gt;  {&lt;br /&gt;   sendNotification(ApplicationFacade.DATA_LOADED, event.result.Employee_Info.Employee as ArrayCollection); &lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;Now we have set the proxy class. we will move to create the application mediator class in the com.sm.pureMVC.view package.&lt;br /&gt;&lt;br /&gt;This class will extend the Proxy Class and implement the IProxy interface. This class will register the EmployeeDetailMediator and set the listener of button to load the xml. &lt;p&gt;&lt;/p&gt;Following is the code sample of EmployeeServiceProxy class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt; package com.sm.pureMVC.view&lt;br /&gt;{&lt;br /&gt; import com.sm.pureMVC.ApplicationFacade;&lt;br /&gt;&lt;br /&gt; import flash.events.MouseEvent;&lt;br /&gt;&lt;br /&gt; import org.puremvc.as3.interfaces.IMediator;&lt;br /&gt; import org.puremvc.as3.interfaces.INotification;&lt;br /&gt; import org.puremvc.as3.patterns.mediator.Mediator;&lt;br /&gt;&lt;br /&gt; public class ApplicationMediator extends Mediator implements IMediator&lt;br /&gt; {&lt;br /&gt;  public static const NAME:String = &#39;ApplicationMediator&#39;;&lt;br /&gt;&lt;br /&gt;  public function ApplicationMediator(viewComponent:Object=null)&lt;br /&gt;  {&lt;br /&gt;   super(ApplicationMediator.NAME, viewComponent);&lt;br /&gt;   facade.registerMediator(new EmployeeDetailMediator(application.employeeList));&lt;br /&gt;   application.getEmployee.addEventListener(MouseEvent.CLICK, getEmployeeClickHandler);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override public function getMediatorName():String&lt;br /&gt;  {&lt;br /&gt;   return ApplicationMediator.NAME;;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private function get application():PureMVCExample&lt;br /&gt;  {&lt;br /&gt;   return viewComponent as PureMVCExample;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private function getEmployeeClickHandler(event:MouseEvent):void&lt;br /&gt;  {&lt;br /&gt;   sendNotification(ApplicationFacade.LOAD);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Declare the Mediator name const in the beginning. This cont can be used, when we have to access the mediator class using retriveMediator method of Facade class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;public static const NAME:String = &#39;ApplicationMediator&#39;;&lt;br /&gt;&lt;/pre&gt;The application reference passed with ApplicationMediator will be stored in the viewComponent property of the class. In the constructor we will register another mediator i.e. EmployeeDetailMediator and we will pass the reference of the employee detail component to this mediator as a parameter. This will map the employee detail component with EmployeeDetailMediator.&lt;br /&gt;&lt;br /&gt;Also we will add the listener to the getEmployee button which is present in the application mxml.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  public function ApplicationMediator(viewComponent:Object=null)&lt;br /&gt;  {&lt;br /&gt;   super(ApplicationMediator.NAME, viewComponent);&lt;br /&gt;   facade.registerMediator(new EmployeeDetailMediator(application.employeeList));&lt;br /&gt;   application.getEmployee.addEventListener(MouseEvent.CLICK, getEmployeeClickHandler);&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;On getEmployee button click handler we will send the notification of Load command. This will be listen by the LoadCommand.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  private function getEmployeeClickHandler(event:MouseEvent):void&lt;br /&gt;  {&lt;br /&gt;   sendNotification(ApplicationFacade.LOAD);&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;Now we will create the LoadCommand class in com.sm.pureMVC.controller package. Like Startup command this command class will also extend the SimpleCommand and implements the ICommand. This class will execute when Load notification is sent. In this application the load notification is been sent from the getEmployee click handler. &lt;p&gt;&lt;/p&gt;Following is the code sample of EmployeeServiceProxy class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;package com.sm.pureMVC.controller&lt;br /&gt;{&lt;br /&gt; import com.sm.pureMVC.model.EmployeeServiceProxy;&lt;br /&gt;&lt;br /&gt; import org.puremvc.as3.interfaces.ICommand;&lt;br /&gt; import org.puremvc.as3.interfaces.INotification;&lt;br /&gt; import org.puremvc.as3.patterns.command.SimpleCommand;&lt;br /&gt;&lt;br /&gt; public class LoadCommand extends SimpleCommand implements ICommand&lt;br /&gt; {&lt;br /&gt;  public function LoadCommand()&lt;br /&gt;  {&lt;br /&gt;   super();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override public function execute(notification:INotification):void&lt;br /&gt;  {&lt;br /&gt;   var employeeProxy:EmployeeServiceProxy = facade.retrieveProxy(EmployeeServiceProxy.NAME) as EmployeeServiceProxy;&lt;br /&gt;   employeeProxy.loadData();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;The execute overridden method will have the code for calling loadData method of EmployeeServiceProxy class. If you have noticed here we hate retrieve the reference of EmployeeServiceProxy class using retrieveProxy method of facade class. To retrieve the reference we have passed the EmployeeServiceProxy name const. This will intimate facade that the request is for EmployeeServiceProxy class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;    override public function execute(notification:INotification):void&lt;br /&gt;  {&lt;br /&gt;   var employeeProxy:EmployeeServiceProxy = facade.retrieveProxy(EmployeeServiceProxy.NAME) as EmployeeServiceProxy;&lt;br /&gt;   employeeProxy.loadData();&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;Now we are ready with Load command class, next we will create the EmployeeDetailMediator class. This class will extend the Mediator and implement the IMediator interface. Remember we have register this mediator in the ApplicationMediator class constructor and we have passed the reference of employee detail component to this.&lt;br /&gt;&lt;br /&gt;In this class we have to listen to DATA_LOADED notification, which was sent from the EmployeeServiceProxy class result handler method. and set the employee data to the data grid which was passed along with DATA_LOADED notification.&lt;br /&gt;&lt;br /&gt;Following is the code sample of EmployeeServiceProxy class. &lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;package com.sm.pureMVC.view&lt;br /&gt;{&lt;br /&gt; import com.sm.pureMVC.ApplicationFacade;&lt;br /&gt; import com.sm.pureMVC.view.components.EmployeeDetail;&lt;br /&gt;&lt;br /&gt; import mx.collections.ArrayCollection;&lt;br /&gt;&lt;br /&gt; import org.puremvc.as3.interfaces.IMediator;&lt;br /&gt; import org.puremvc.as3.interfaces.INotification;&lt;br /&gt; import org.puremvc.as3.patterns.mediator.Mediator;&lt;br /&gt;&lt;br /&gt; public class EmployeeDetailMediator extends Mediator implements IMediator&lt;br /&gt; {&lt;br /&gt;  public static const NAME:String = &#39;EmployeeDetailMediator&#39;;&lt;br /&gt;&lt;br /&gt;  public function EmployeeDetailMediator(viewComponent:Object=null)&lt;br /&gt;  {&lt;br /&gt;   super(EmployeeDetailMediator.NAME, viewComponent);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override public function getMediatorName():String&lt;br /&gt;  {&lt;br /&gt;   return EmployeeDetailMediator.NAME;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private function get employeeDetail():EmployeeDetail&lt;br /&gt;  {&lt;br /&gt;   return viewComponent as EmployeeDetail;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override public function listNotificationInterests():Array&lt;br /&gt;  {&lt;br /&gt;   return [ ApplicationFacade.DATA_LOADED];&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  override public function handleNotification(notification:INotification):void&lt;br /&gt;  {&lt;br /&gt;   switch (notification.getName()) {&lt;br /&gt;    case ApplicationFacade.DATA_LOADED:&lt;br /&gt;     employeeDetail.employee.dataProvider = notification.getBody() as ArrayCollection;&lt;br /&gt;     break;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;To listen to the notification in mediator we have to follow few steps. First we have to add the notification which are interested by this mediator using listNotificationInterests method. In this overridden method we will return the array of notification names which will be interested by this mediator class.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  override public function listNotificationInterests():Array&lt;br /&gt;  {&lt;br /&gt;   return [ ApplicationFacade.DATA_LOADED];&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;Now, after adding the interested notification. we will create the function which will execute respective functionality for interested notification. The handleNotification overridden method will have the code for executing specific functionality for each notification. If the mediator is interested in multiple notification. that can be listen using switch case loop.&lt;br /&gt;&lt;br /&gt;In this function, within DATA_LOADED case we will set the employee data grid data provider. Remember we have sent the data object reference along with the DATA_LOADED notification. We will access this data object by getBody method of notification.&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;  override public function handleNotification(notification:INotification):void&lt;br /&gt;  {&lt;br /&gt;   switch (notification.getName()) {&lt;br /&gt;    case ApplicationFacade.DATA_LOADED:&lt;br /&gt;     employeeDetail.employee.dataProvider = notification.getBody() as ArrayCollection;&lt;br /&gt;     break;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;That’s it. we have complete the simple flex application using pureMVC framework. I hope this tutorial will help you to understand the flow of developing the flex application using pureMVC. If you have any question, Kindly let me know I will try to answer you question.&lt;br /&gt;&lt;br /&gt;Summary of development.&lt;/p&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Call startup method of ApplicationFacade class from the application mxml file.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Send the startup notification from the ApplicationFacade class.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Initialize the ApplicationMediator and EmployeeServiceProxy in the Startup command.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add the get employee button listener in the ApplicationMediator class.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Send notification of LOAD command from the ApplicationMediator class&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Initialize the EmployeeDetailMediator mediator in the ApplicationMediator class.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add logic of xml loading using httpService in the EmployeeServiceProxy class.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Send notification of DATA_LOADED from the EmployeeServiceProxy class.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Handle DATA_LOADED notification in EmployeeDetailMediator class.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;a href=&quot;http://shaileshmak.000fees.net/MyWork/FlexPureMVCExample/srcview/SimplePureMVCExample.zip&quot;&gt;Download the complete source zip file&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/7486812973354924058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-puremvc-tutorial.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7486812973354924058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7486812973354924058'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-puremvc-tutorial.html' title='Flex 3: PureMVC tutorial'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI5rT6dz5-dH7wPQkhqlCkOAfqzl7HomiXUsXwS0xE4md02vPY5nJEWqIj4sHk2q7irL-4N3MGB7DnZzzv7xvBrgODe_sTNJYhfmjHVg8rVoOUy0Pme9LlbE9pxlmhbZQjFlLn4uGXy7w/s72-c/screenShot.jpg" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-2240110854127222231</id><published>2010-04-09T10:01:00.001-07:00</published><updated>2010-04-16T08:33:35.121-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Chart Component"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="Pie Chart"/><category scheme="http://www.blogger.com/atom/ns#" term="Pie Chart Interactive Label"/><category scheme="http://www.blogger.com/atom/ns#" term="Pie Chart Label"/><title type='text'>Flex 3: Pie Chart interactive Label</title><content type='html'>&lt;p&gt;I have started exploring Flex 3 pie chart component few days back and i realize that the labels for pie chart is not interactive. There is no inbuilt events for pie chart label. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;To make the label interactive of pie chart component i have extend the pie chart component. But It was really strange that there was no direct reference available to individual labels. Instead there is a reference to the labelContainer who hold all the labels. To achieve the label reference i have added the listener to the label container and check the current target is label field or not. and Then i have dispatched the custom label event.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a onclick=&quot;window.open(&amp;#39;http://shaileshmak.000fees.net/MyWork/LabelEventPieChart/PieChartLabelEvent.html&amp;#39;, &amp;#39;_blank&amp;#39;, &amp;#39;height=500&amp;#39;, &amp;#39;width=300&amp;#39;)&quot;&gt;&lt;img style=&quot;TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 291px; DISPLAY: block; HEIGHT: 174px; CURSOR: hand&quot; id=&quot;BLOGGER_PHOTO_ID_5458185705540045074&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp3WkNXHoMFXqBn-uPp-3V4wVnA337-ullGk7ksfA3a5Kfz0PKLQgWLWj5RiOw9hURw08-lpuksqGEpvWXUVi4vrhum1gXuASAv4CX40D3QTrBw5QtvLwmALaYAfxyzQzQjaTsilsl10A/s320/snapShot.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;p&gt;Following snippet is for the custom pie chart component which i have extend from Pie chart.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;File Name ClickableLabelPieChart.mxml&lt;/p&gt;&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;br /&gt;&lt;mx:PieChart xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; creationComplete=&quot;addLabelEvents()&quot;&gt;&lt;br /&gt; &lt;mx:Metadata&gt;&lt;br /&gt;  [Event(name=&quot;labelClick&quot;, type=&quot;events.ChartLabelEvent&quot;)]&lt;br /&gt;  [Event(name=&quot;labelDoubleClick&quot;, type=&quot;events.ChartLabelEvent&quot;)]&lt;br /&gt;  [Event(name=&quot;labelMouseDown&quot;, type=&quot;events.ChartLabelEvent&quot;)]&lt;br /&gt;  [Event(name=&quot;labelMouseUp&quot;, type=&quot;events.ChartLabelEvent&quot;)]&lt;br /&gt;  [Event(name=&quot;labelRollOver&quot;, type=&quot;events.ChartLabelEvent&quot;)]&lt;br /&gt;  [Event(name=&quot;labelRollOut&quot;, type=&quot;events.ChartLabelEvent&quot;)]&lt;br /&gt;  [Event(name=&quot;labelMouseMove&quot;, type=&quot;events.ChartLabelEvent&quot;)]&lt;br /&gt; &lt;/mx:Metadata&gt;&lt;br /&gt; &lt;br /&gt; &lt;mx:Script&gt;&lt;br /&gt;  &lt;![CDATA[&lt;br /&gt;   import mx.core.UITextField;&lt;br /&gt;   import mx.charts.series.PieSeries;&lt;br /&gt;   import events.ChartLabelEvent;&lt;br /&gt;   &lt;br /&gt;   [Bindable]&lt;br /&gt;   private var pieSeries:PieSeries;&lt;br /&gt;   &lt;br /&gt;   private function addLabelEvents():void&lt;br /&gt;   {&lt;br /&gt;    pieSeries = this.series[0];&lt;br /&gt;    if (pieSeries)&lt;br /&gt;    {&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.CLICK, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.DOUBLE_CLICK, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.MOUSE_DOWN, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.MOUSE_MOVE, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.MOUSE_OUT, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.MOUSE_OVER, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.MOUSE_UP, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.ROLL_OUT, dispatchLabelEventHandler);&lt;br /&gt;     pieSeries.labelContainer.addEventListener(MouseEvent.ROLL_OVER, dispatchLabelEventHandler);&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;   private function dispatchLabelEventHandler(event:MouseEvent):void&lt;br /&gt;   {&lt;br /&gt;    &lt;br /&gt;    if(event.target is UITextField == false)&lt;br /&gt;     return;&lt;br /&gt;     &lt;br /&gt;    var currentLabel:UITextField = event.target as UITextField&lt;br /&gt;    var chartEventType:String = &#39;&#39;;&lt;br /&gt;    switch(event.type)&lt;br /&gt;    {&lt;br /&gt;     case MouseEvent.CLICK:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_CLICK;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.DOUBLE_CLICK:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_DOUBLE_CLICK;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.MOUSE_DOWN:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_MOUSE_DOWN;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.MOUSE_MOVE:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_MOUSE_MOVE;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.MOUSE_OUT:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_MOUSE_OUT;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.MOUSE_OVER:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_MOUSE_OVER;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.MOUSE_UP:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_MOUSE_UP;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.ROLL_OUT:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_ROLL_OUT;&lt;br /&gt;      break;&lt;br /&gt;     case MouseEvent.ROLL_OVER:&lt;br /&gt;      chartEventType = ChartLabelEvent.LABEL_ROLL_OVER;&lt;br /&gt;      break;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    this.dispatchEvent(new ChartLabelEvent(chartEventType, currentLabel));   &lt;br /&gt;   }&lt;br /&gt;  ]]&gt;&lt;br /&gt; &lt;/mx:Script&gt;&lt;br /&gt;&lt;/mx:PieChart&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I have used the custom event for label. For that i have created an Custom Event class based on MouseEvent&lt;br /&gt;&lt;br /&gt;File Name ChartLabelEvent.as&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt;&lt;br /&gt;package events&lt;br /&gt;{&lt;br /&gt; import flash.display.InteractiveObject;&lt;br /&gt; import flash.events.Event;&lt;br /&gt; import flash.events.MouseEvent;&lt;br /&gt; import flash.geom.Point;&lt;br /&gt; &lt;br /&gt; import mx.core.UITextField;&lt;br /&gt;&lt;br /&gt; public class ChartLabelEvent extends MouseEvent&lt;br /&gt; {&lt;br /&gt;  public static const LABEL_CLICK:String = &quot;labelClick&quot;;&lt;br /&gt;&lt;br /&gt;  public static const LABEL_DOUBLE_CLICK:String = &quot;labelDoubleClick&quot;;&lt;br /&gt;&lt;br /&gt;  public static const LABEL_MOUSE_DOWN:String = &quot;labelMouseDown&quot;;&lt;br /&gt;&lt;br /&gt;  public static const LABEL_MOUSE_MOVE:String = &quot;labelMouseMove&quot;;&lt;br /&gt;  &lt;br /&gt;  public static const LABEL_MOUSE_OUT:String = &quot;labelMouseOut&quot;;&lt;br /&gt;  &lt;br /&gt;  public static const LABEL_MOUSE_OVER:String = &quot;labelMouseOver&quot;;&lt;br /&gt;&lt;br /&gt;  public static const LABEL_ROLL_OUT:String = &quot;labelRollOut&quot;;&lt;br /&gt;&lt;br /&gt;  public static const LABEL_ROLL_OVER:String = &quot;labelRollOver&quot;;&lt;br /&gt;&lt;br /&gt;  public static const LABEL_MOUSE_UP:String = &quot;labelMouseUp&quot;;&lt;br /&gt;&lt;br /&gt;  private var _labelField:UITextField;&lt;br /&gt;&lt;br /&gt;  public function ChartLabelEvent(type:String, labelField:UITextField = null, triggerEvent:MouseEvent=null)&lt;br /&gt;  {&lt;br /&gt;   var relPt:Point;&lt;br /&gt;   if (triggerEvent &amp;&amp; triggerEvent.target)&lt;br /&gt;   {&lt;br /&gt;    relPt = target.globalToLocal(triggerEvent.target.localToGlobal(&lt;br /&gt;     new Point(triggerEvent.localX, triggerEvent.localY)));&lt;br /&gt;   }&lt;br /&gt;   else&lt;br /&gt;   {&lt;br /&gt;       if(target)&lt;br /&gt;     relPt = new Point(target.mouseX,target.mouseY);&lt;br /&gt;    else&lt;br /&gt;     relPt = new Point(0,0);&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   var bubbles:Boolean = true;&lt;br /&gt;   var cancelable:Boolean = false;&lt;br /&gt;   var relatedObject:InteractiveObject = null;&lt;br /&gt;   var ctrlKey:Boolean = false;&lt;br /&gt;   var shiftKey:Boolean = false;&lt;br /&gt;   var altKey:Boolean = false;&lt;br /&gt;   var buttonDown:Boolean = false;&lt;br /&gt;   var delta:int = 0;&lt;br /&gt;    &lt;br /&gt;   if(triggerEvent)&lt;br /&gt;   {&lt;br /&gt;          bubbles = triggerEvent.bubbles;&lt;br /&gt;    cancelable = triggerEvent.cancelable;&lt;br /&gt;    relatedObject = triggerEvent.relatedObject;&lt;br /&gt;    ctrlKey = triggerEvent.ctrlKey;&lt;br /&gt;    altKey = triggerEvent.altKey;&lt;br /&gt;    shiftKey = triggerEvent.shiftKey;&lt;br /&gt;    buttonDown = triggerEvent.buttonDown;&lt;br /&gt;    delta = triggerEvent.delta;&lt;br /&gt;   }&lt;br /&gt;   super(type, bubbles, cancelable, relPt.x, relPt.y, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta);&lt;br /&gt;     &lt;br /&gt;   this.labelField = labelField;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public override function clone():Event&lt;br /&gt;  {&lt;br /&gt;   return new ChartLabelEvent(type, labelField, this);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  public function get labelField():UITextField&lt;br /&gt;  {&lt;br /&gt;   return _labelField;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public function set labelField(value:UITextField):void&lt;br /&gt;  {&lt;br /&gt;   _labelField = value;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Finally the application mxml. In this file i have added the custom Pie chart component and added all label mouse events on creation complete. On the mouse handler function, I have changed the Label color on roll over and roll out with background. On click the color of lable changes to green.&lt;br /&gt;&lt;br /&gt;PieChartLabelEvent.mxml&lt;br /&gt;&lt;pre class=&quot;brush: actionscript3&quot;&gt;&lt;br /&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;br /&gt; &lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; xmlns:component=&quot;component.*&quot; creationComplete=&quot;init()&quot;&gt;&lt;br /&gt;  &lt;mx:Script&gt;&lt;br /&gt;   &lt;![CDATA[&lt;br /&gt;    import mx.graphics.SolidColor;&lt;br /&gt;    import mx.collections.ArrayCollection;&lt;br /&gt;    import events.ChartLabelEvent;&lt;br /&gt;    private function init():void&lt;br /&gt;    {&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_CLICK, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_DOUBLE_CLICK, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_MOUSE_DOWN, chartLabelMouseHandler);&lt;br /&gt;     //labelPieChart.addEventListener(ChartLabelEvent.LABEL_MOUSE_MOVE, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_MOUSE_OUT, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_MOUSE_OVER, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_MOUSE_OVER, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_MOUSE_UP, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_ROLL_OUT, chartLabelMouseHandler);&lt;br /&gt;     labelPieChart.addEventListener(ChartLabelEvent.LABEL_ROLL_OVER, chartLabelMouseHandler);&lt;br /&gt;    }&lt;br /&gt;    private function chartLabelMouseHandler(event:ChartLabelEvent):void&lt;br /&gt;    {&lt;br /&gt;     trace(event.labelField);&lt;br /&gt;     if(event.type == ChartLabelEvent.LABEL_MOUSE_OVER)&lt;br /&gt;     {&lt;br /&gt;      event.labelField.background = true;&lt;br /&gt;      event.labelField.backgroundColor = 0xFF0000;&lt;br /&gt;      event.labelField.textColor = 0xffff00;&lt;br /&gt;     }else if(event.type == ChartLabelEvent.LABEL_MOUSE_OUT)&lt;br /&gt;     {&lt;br /&gt;      event.labelField.background = false;&lt;br /&gt;      event.labelField.textColor = 0x000000;&lt;br /&gt;     }else if(event.type == ChartLabelEvent.LABEL_CLICK)&lt;br /&gt;     {&lt;br /&gt;      var color:uint = event.labelField.textColor != 0x00ff00 ? 0x00ff00 : 0x000000;&lt;br /&gt;      event.labelField.textColor = color;&lt;br /&gt;     }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;  [Bindable]&lt;br /&gt;    private var fragments:ArrayCollection = new ArrayCollection([&lt;br /&gt;      { Country: &quot;USA&quot;, Gold: 35},&lt;br /&gt;               { Country: &quot;China&quot;, Gold: 32},&lt;br /&gt;               { Country: &quot;India&quot;, Gold: 5},&lt;br /&gt;               { Country: &quot;Brazil&quot;, Gold: 15},&lt;br /&gt;               { Country: &quot;Russia&quot;, Gold: 27}&lt;br /&gt;      ]);&lt;br /&gt;      &lt;br /&gt;    [Bindable]&lt;br /&gt;    private var _fillList:Array = [&lt;br /&gt;            new SolidColor(0xFF5B5B,0.9),&lt;br /&gt;            new SolidColor(0xA9FE5C,0.9),&lt;br /&gt;            new SolidColor(0xFEBD5C,0.9),&lt;br /&gt;            new SolidColor(0xFF8040,0.9),&lt;br /&gt;            new SolidColor(0x5BFFCA,0.9),&lt;br /&gt;            ];&lt;br /&gt;      &lt;br /&gt;     private function displayGold(data:Object, field:String, index:Number, percentValue:Number):String {&lt;br /&gt;              var temp:String= (&quot; &quot; + percentValue).substr(0,6);&lt;br /&gt;              return data.Country + &quot;: &quot; + &quot;Total Gold: &quot; + Math.round(data.Gold);&lt;br /&gt;          }&lt;br /&gt;   ]]&gt;&lt;br /&gt;  &lt;/mx:Script&gt;&lt;br /&gt;  &lt;mx:Stroke id = &quot;callouts&quot;&lt;br /&gt;       weight = &quot;2&quot;&lt;br /&gt;       color = &quot;0x999999&quot;&lt;br /&gt;       alpha = &quot;.8&quot;&lt;br /&gt;       caps = &quot;square&quot;/&gt;&lt;br /&gt;  &lt;!-- This Stroke is used to separate the wedges in the pie. --&gt;&lt;br /&gt;  &lt;mx:Stroke id = &quot;radial&quot;&lt;br /&gt;       weight = &quot;1&quot;&lt;br /&gt;       color = &quot;0xFFFFCC&quot;&lt;br /&gt;       alpha = &quot;.5&quot;/&gt;&lt;br /&gt; &lt;br /&gt;  &lt;!-- This Stroke is used for the outer border of the pie. --&gt;&lt;br /&gt;  &lt;mx:Stroke id = &quot;pieborder&quot;&lt;br /&gt;       color = &quot;0x000000&quot;&lt;br /&gt;       weight = &quot;2&quot;&lt;br /&gt;       alpha = &quot;.5&quot;/&gt; &lt;br /&gt;  &lt;component:ClickableLabelPieChart id=&quot;labelPieChart&quot;&lt;br /&gt;                dataProvider = &quot;{fragments}&quot;&lt;br /&gt;                showDataTips = &quot;true&quot;&lt;br /&gt;                selectionMode = &quot;single&quot;&lt;br /&gt;                height = &quot;100%&quot;&lt;br /&gt;                width = &quot;100%&quot;&gt;&lt;br /&gt;      &lt;component:series&gt;&lt;br /&gt;       &lt;mx:PieSeries field = &quot;Gold&quot;&lt;br /&gt;            nameField = &quot;Country&quot;&lt;br /&gt;            labelPosition = &quot;callout&quot;&lt;br /&gt;            selectable = &quot;true&quot;&lt;br /&gt;            labelFunction = &quot;displayGold&quot;&lt;br /&gt;            calloutStroke = &quot;{callouts}&quot;&lt;br /&gt;            radialStroke = &quot;{radial}&quot;&lt;br /&gt;            stroke = &quot;{pieborder}&quot;&lt;br /&gt;            fills = &quot;{_fillList}&quot;/&gt;&lt;br /&gt;      &lt;/component:series&gt;&lt;br /&gt;     &lt;/component:ClickableLabelPieChart&gt;&lt;br /&gt;     &lt;br /&gt;  &lt;br /&gt; &lt;/mx:Application&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can use these mouse event to make the label draggable. I will explain this in my next post where i will create an application which will have a functionality of changing the label by dragging from the list.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/2240110854127222231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-pie-chart-interactive-label.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/2240110854127222231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/2240110854127222231'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/flex-3-pie-chart-interactive-label.html' title='Flex 3: Pie Chart interactive Label'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp3WkNXHoMFXqBn-uPp-3V4wVnA337-ullGk7ksfA3a5Kfz0PKLQgWLWj5RiOw9hURw08-lpuksqGEpvWXUVi4vrhum1gXuASAv4CX40D3QTrBw5QtvLwmALaYAfxyzQzQjaTsilsl10A/s72-c/snapShot.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-930124918227046374</id><published>2010-04-09T07:50:00.000-07:00</published><updated>2010-04-30T22:42:55.261-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chart Component"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex 3"/><category scheme="http://www.blogger.com/atom/ns#" term="Pie Chart"/><title type='text'>Draggable Wedges in Pie chart</title><content type='html'>Its been too long since I had wrote a blog.   &lt;br /&gt;Today I got a chance and I am writing this for Flex pie chart draggable wedge.   &lt;br /&gt;  &lt;br /&gt;Flex has very good library of components. This is one of that and I have extended the pie chart component to make the wedges interactive and draggable. Flex pie chart component doesn&#39;t have this feature. So I tried to make one.   &lt;br /&gt;  &lt;br /&gt;For developing this I have created draggable points at the end of each wedge. And on dragging, it will change the value of that wedge and its related wedge.   &lt;br /&gt;  &lt;br /&gt;Comments are welcome   &lt;br /&gt;&lt;br /&gt;&lt;div align=&#39;center&#39;&gt; &lt;a href=&quot;http://shaileshmak.000fees.net/MyWork/DraggbleWedgePieChart/DraggablePieChart.html&quot; target=&#39;_blank&#39;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 320px; height: 212px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNTgFvPUTTwlqafbb8L2tVup46RiLpH93oV43Xb0Y2o0FypUSCg2z-_7Pb-Tt7SeQJkMUV2-CrATIeWCIvUo8Dn5MkBu_kH0EH-Mq5yl7fse4Etv9sjQ6RoFKj1buBCgn5y4h8hAmZzg4/s320/draggableWedge.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5466172563687717874&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/930124918227046374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/draggable-wedges-in-pie-chart.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/930124918227046374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/930124918227046374'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2010/04/draggable-wedges-in-pie-chart.html' title='Draggable Wedges in Pie chart'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNTgFvPUTTwlqafbb8L2tVup46RiLpH93oV43Xb0Y2o0FypUSCg2z-_7Pb-Tt7SeQJkMUV2-CrATIeWCIvUo8Dn5MkBu_kH0EH-Mq5yl7fse4Etv9sjQ6RoFKj1buBCgn5y4h8hAmZzg4/s72-c/draggableWedge.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6206378677057766593.post-7338555874146218991</id><published>2009-07-11T08:39:00.000-07:00</published><updated>2010-04-16T08:40:26.747-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Actionscript 3.0"/><category scheme="http://www.blogger.com/atom/ns#" term="Flash"/><category scheme="http://www.blogger.com/atom/ns#" term="framework"/><category scheme="http://www.blogger.com/atom/ns#" term="game"/><category scheme="http://www.blogger.com/atom/ns#" term="PureMVC"/><title type='text'>Typing exercise game using Pure MVC</title><content type='html'>I really like the &lt;a href=&quot;http://puremvc.org/&quot;&gt;pureMVC&lt;/a&gt; framework, I hope you will also like this.  &lt;br /&gt;  &lt;br /&gt;It is really amazing framework, Easy to use and nicely developed.  &lt;br /&gt;  &lt;br /&gt;I tried developing one game using this framework. It took little while initially but once I got hands to this it was really easy.  &lt;br /&gt;  &lt;br /&gt;I have developed a typing exercise game, in which random character will dropped from the top; user has to type the right character to earn the score. Currently this game is covering only characters which are not case sensitive. I am upgrading this game to make this case sensitive; also I am planning to add numbers and special characters.  &lt;br /&gt;  &lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;This game has few features like, score display, target hit display, user life display etc. Once the character reaches to certain point color will turn to red, which indicates the risk of loosing that character.   &lt;br /&gt;  &lt;br /&gt;This game has four levels, after each level the speed for characters increase. Score 5 can be earned by hitting each characters  &lt;br /&gt;  &lt;br /&gt;Suggestion are welcome.  &lt;br /&gt;  &lt;br /&gt;&lt;a onclick=&quot;window.open(&amp;#39;http://shaileshmak.000fees.net/MyWork/KeyStore/KeyStoreApp.html&amp;#39;, &amp;#39;_blank&amp;#39;, &amp;#39;height=500&amp;#39;, &amp;#39;width=400&amp;#39;)&quot;&gt;   &lt;br /&gt;&lt;img style=&quot;text-align: center; margin: 0px auto 10px; width: 320px; display: block; height: 318px; cursor: hand&quot; id=&quot;BLOGGER_PHOTO_ID_5357235566277922530&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDqOwh2hBTLGpEGJT8iWzG3ZcGu9n3teuKxQiOgXcDNfEyyKITWz_N9f-8qTE2Ik3uK8N1uLXTG8nZQkTarIL1IFVfulNxs9u3hhyq-GIp-DF5lfanagFwMKKhNulbcNHuQiY1J6vffnE/s320/KeyStoreApp.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://shaileshmakwana.blogspot.com/feeds/7338555874146218991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://shaileshmakwana.blogspot.com/2009/07/pure-mvc-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7338555874146218991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6206378677057766593/posts/default/7338555874146218991'/><link rel='alternate' type='text/html' href='http://shaileshmakwana.blogspot.com/2009/07/pure-mvc-game.html' title='Typing exercise game using Pure MVC'/><author><name>Shailesh</name><uri>http://www.blogger.com/profile/16323675086696599104</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='18' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgna3oT2JRNrYVr70k_0emLCdSV5JK_mmaASQk5RwxMw1cNDJDoQL7RiaaPkh_DrQqXCm5Fo5W8r3QN2FsjdSfU5EtYA-AiJ4nyRzjGhWq6h5_LaTGSi-pL_Z_pI1q1cw/s220/ForBlog.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDqOwh2hBTLGpEGJT8iWzG3ZcGu9n3teuKxQiOgXcDNfEyyKITWz_N9f-8qTE2Ik3uK8N1uLXTG8nZQkTarIL1IFVfulNxs9u3hhyq-GIp-DF5lfanagFwMKKhNulbcNHuQiY1J6vffnE/s72-c/KeyStoreApp.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>