<?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: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-6493813212534403279</id><updated>2011-09-17T03:51:52.831-07:00</updated><title type='text'>Arun.Flex</title><subtitle type='html'>This is Flex blog site for sharing the new concept of Adobe Flex technology and discuss about the new technology and analyze its new features and advantage over the existing technology.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5933178957220124845</id><published>2010-02-02T03:44:00.001-08:00</published><updated>2010-02-02T03:51:11.761-08:00</updated><title type='text'>Problem in adding the sprite class directly to canvas component in Flex</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;    we cannot directly added the sprite component to the Canvas component or any other Flex components; the main reason was all Flex omponent derived from the UIComponent. So it can support only to add the UIComponent to the flex component that are derived from the UIComponent. Its better way we can add the sprite component to the UIComponent and then we can add this UIComponent to the Canvas or other Flex components.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5933178957220124845?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5933178957220124845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/problem-in-adding-sprite-class-directly.html#comment-form' title='35 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5933178957220124845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5933178957220124845'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/problem-in-adding-sprite-class-directly.html' title='Problem in adding the sprite class directly to canvas component in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>35</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-7893519600977211450</id><published>2010-02-02T03:39:00.001-08:00</published><updated>2010-02-02T03:44:07.765-08:00</updated><title type='text'>Sprite Vs Shape</title><content type='html'>HI,&lt;br /&gt;&lt;div align="justify"&gt;    Sprite and Shape are the basic graphics component for draw the graphics. The important points to be noted as the shape class is cannot dispatch the common event like mouse or keyboard event. So if you need to perform any mouse related event to be perform then you can choose sprite instead of shape class; because the sprite class having the basic event like mouse and keyboard relate events.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-7893519600977211450?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/7893519600977211450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/sprite-vs-shape.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/7893519600977211450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/7893519600977211450'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/sprite-vs-shape.html' title='Sprite Vs Shape'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-477496327211933611</id><published>2010-02-02T03:35:00.000-08:00</published><updated>2010-02-02T03:37:47.497-08:00</updated><title type='text'>Create the custom HTTP Service class and return XML as output in AS3</title><content type='html'>Hi,&lt;br /&gt;  I am creating the custom HTTP service class for accessing URL and get the response from the server and return the result as xml format. Here i attached the code for that.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;package service&lt;br /&gt;{&lt;br /&gt;import flash.events.Event;&lt;br /&gt;import flash.net.URLLoader;&lt;br /&gt;import flash.net.URLRequest;&lt;br /&gt;import service.MessageService;&lt;br /&gt;import flash.net.URLVariables;&lt;br /&gt;import flash.net.navigateToURL;&lt;br /&gt;import flash.events.IOErrorEvent;&lt;br /&gt;import flash.net.URLRequestMethod;&lt;br /&gt;import flash.events.SecurityErrorEvent;&lt;br /&gt;public class URLService&lt;br /&gt;{&lt;br /&gt;private var _url:String;&lt;br /&gt;private var _callbackObject:Object;&lt;br /&gt;private var _callbackFunction:Function;&lt;br /&gt;private var _urlError:MessageService = new MessageService("URL Error","Warning");&lt;br /&gt;private var _ioError:MessageService = new MessageService("IO Error","Warning");&lt;br /&gt;private var _xmlError:MessageService = new MessageService("XML Error","Warning");&lt;br /&gt;private var _securityError:MessageService = new MessageService("Security Error","Warning");&lt;br /&gt;public function set url(val:String):void&lt;br /&gt;{&lt;br /&gt;if(_url != val)&lt;br /&gt;_url = val;&lt;br /&gt;}&lt;br /&gt;public function set callbackObject(val:Object):void&lt;br /&gt;{&lt;br /&gt;if(_callbackObject != val)&lt;br /&gt;_callbackObject = val;&lt;br /&gt;}&lt;br /&gt;public function set callbackFunction(val:Function):void&lt;br /&gt;{&lt;br /&gt;if(_callbackFunction != val)&lt;br /&gt;_callbackFunction = val;&lt;br /&gt;}&lt;br /&gt;public function URLService()&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;public function loadXML(urlVar:URLVariables = null,callbackObject:Object = null,callbackFunction:Function = null):void&lt;br /&gt;{&lt;br /&gt;if(_url &amp;amp;&amp;amp; _url != "")&lt;br /&gt;{&lt;br /&gt;var urlLoader:URLLoader = new URLLoader();&lt;br /&gt;var urlRequest:URLRequest = new URLRequest(_url);&lt;br /&gt;if(urlVar)&lt;br /&gt;{&lt;br /&gt;urlRequest.data = urlVar;&lt;br /&gt;urlRequest.method = URLRequestMethod.POST;&lt;br /&gt;}&lt;br /&gt;urlLoader.load(urlRequest);&lt;br /&gt;urlLoader.addEventListener(Event.COMPLETE,onComplete);&lt;br /&gt;urlLoader.addEventListener(IOErrorEvent.IO_ERROR,onIOError);&lt;br /&gt;urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onSecurityError);&lt;br /&gt;_callbackObject = callbackObject;&lt;br /&gt;_callbackFunction = callbackFunction;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;_urlError.show();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public function selfNavigation(urlVar:URLVariables = null):void&lt;br /&gt;{&lt;br /&gt;if(_url &amp;amp;&amp;amp; _url != "")&lt;br /&gt;{&lt;br /&gt;var urlRequest:URLRequest = new URLRequest(_url);&lt;br /&gt;if(urlVar)&lt;br /&gt;{&lt;br /&gt;urlRequest.data = urlVar;&lt;br /&gt;urlRequest.method = URLRequestMethod.POST;&lt;br /&gt;}&lt;br /&gt;navigateToURL(urlRequest,"_self");&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;_urlError.show();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private function onComplete(evt:Event):void&lt;br /&gt;{&lt;br /&gt;var _xml:XML = XML(evt.target.data);&lt;br /&gt;if(_callbackObject &amp;amp;&amp;amp; _callbackFunction != null)&lt;br /&gt;{&lt;br /&gt;_callbackFunction.call(_callbackObject,_xml);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;_xmlError.show();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private function onIOError(evt:IOErrorEvent):void&lt;br /&gt;{&lt;br /&gt;_ioError.show();&lt;br /&gt;}&lt;br /&gt;private function onSecurityError(evt:SecurityErrorEvent):void&lt;br /&gt;{&lt;br /&gt;_securityError.show();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; This is very nice class. So use this class and enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-477496327211933611?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/477496327211933611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/create-custom-http-service-class-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/477496327211933611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/477496327211933611'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/create-custom-http-service-class-and.html' title='Create the custom HTTP Service class and return XML as output in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-9154214641470485404</id><published>2010-02-02T03:29:00.000-08:00</published><updated>2010-02-02T03:34:46.926-08:00</updated><title type='text'>Dispatch custom event with values in AS3</title><content type='html'>Hi,&lt;br /&gt;     We can dispatch custom event with some values. The following steps we can send the values when dispatch the event. The Custom Dispatch Event class is created as follows&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;package service&lt;br /&gt;{&lt;br /&gt;import flash.events.Event;&lt;br /&gt;import flash.net.FileReference;&lt;br /&gt;public class UploadEvent extends Event&lt;br /&gt;{&lt;br /&gt;private var _data:Array;&lt;br /&gt;public function get data():Array&lt;br /&gt;{&lt;br /&gt;return _data;&lt;br /&gt;}&lt;br /&gt;public function set data(val:Array):void&lt;br /&gt;{&lt;br /&gt;if(_data != val)&lt;br /&gt;_data = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static const UPLOAD_FILE_COMPLETD:String = "UploadFileSelected";&lt;br /&gt;public function UploadEvent(type:String,arr:Array=null):void&lt;br /&gt;{&lt;br /&gt;this.data = arr;&lt;br /&gt;super(type);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Event dispatches by following way&lt;br /&gt;dispatchEvent(new UploadEvent(UploadEvent.UPLOAD_FILE_COMPLETD,data[Array]));&lt;br /&gt;&lt;br /&gt;Handler function for the dispatched event as follows&lt;br /&gt;[Event Dispatcher Instance].addEventListener(UploadEvent.UPLOAD_FILE_COMPLETD,onUpoadComplete);&lt;br /&gt;&lt;br /&gt;private function onUpoadComplete(evt:UploadEvent):void&lt;br /&gt;{&lt;br /&gt;  trace(evt.data);&lt;br /&gt;  //handle code here;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-9154214641470485404?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/9154214641470485404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/dispatch-custom-event-with-values-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/9154214641470485404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/9154214641470485404'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/dispatch-custom-event-with-values-in.html' title='Dispatch custom event with values in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5777219141556543501</id><published>2010-02-02T03:12:00.000-08:00</published><updated>2010-02-02T03:28:51.851-08:00</updated><title type='text'>Dispatch a custom event without any values in AS3</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;    We need to dispatch the custom event for perform certain custom function after certain activity may be happen. The custom dispatch event is very nice approach and it used the DOM for event handling. &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;The some points to be remember for dispatch the event&lt;/div&gt;&lt;div align="justify"&gt;1. The customevent class must be subclass of Event class i.e it extends from Event class&lt;/div&gt;&lt;div align="justify"&gt;2. We can send some data when custom event dispatches&lt;/div&gt;&lt;div align="justify"&gt;3. The event dispatcher class must support the feature of dispatch event. the UIComponent class supports its features otherwise we need to create the subclass of EventDispatcher class&lt;/div&gt;&lt;div align="justify"&gt;4. To capture the dispatched event and handle those event by handler function.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;Create the custom Dispatch event class without any values as follows&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;package service&lt;br /&gt;{&lt;br /&gt;import flash.events.Event;&lt;br /&gt;public class UploadEvent extends Event&lt;br /&gt;{&lt;br /&gt;public static const UPLOAD_FILE_COMPLETD:String = "UploadFileSelected";&lt;br /&gt;public function UploadEvent(type:String):void&lt;br /&gt;{&lt;br /&gt; super(type);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;Dispatch the custom Event by&lt;/div&gt;&lt;div align="justify"&gt;dispatchEvent(new UploadEvent(UploadEvent.UPLOAD_FILE_COMPLETD));&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;create the handler file for dispacthed custom event as follows&lt;/div&gt;&lt;div align="left"&gt;instance name[Event Dispatcher].addEventListener(UploadEvent.UPLOAD_FILE_COMPLETD,onUploadCompleted);&lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;private function onUploadCompleted(evt:UploadEvent):void&lt;/div&gt;&lt;div align="left"&gt;{&lt;/div&gt;&lt;div align="left"&gt;  //handling code here&lt;/div&gt;&lt;div align="left"&gt;}&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5777219141556543501?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5777219141556543501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/dispatch-custom-event-without-any.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5777219141556543501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5777219141556543501'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/dispatch-custom-event-without-any.html' title='Dispatch a custom event without any values in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-4985002596475147560</id><published>2010-02-02T01:56:00.000-08:00</published><updated>2010-02-02T03:00:31.603-08:00</updated><title type='text'>Call Flash function from Javascript</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;Most of the flash developer have the idea about ExternalInterface API for accessing the javascript function from Flash and it can be support to call Flash function from the javascript. From this feature we can control the functionality from the javascript. For accessing the flash function first we need to get the flash swf object instance and then call the flash function. Please note browser may be differ for getting the object from the web page. So use relevant tag for getting the swf object from HTML page. The javascript function can be added in inside of HEAD tag in the HTML /Web page as &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;function getFlashMovie(movieName)&lt;br /&gt;{&lt;br /&gt;var isIE = navigator.appName.indexOf("Microsoft") != -1;&lt;br /&gt;return (isIE) ? window[movieName] : document[movieName];&lt;br /&gt;}&lt;br /&gt;function loadLogo()&lt;br /&gt;{&lt;br /&gt;getFlashMovie("Flash Instance Name").UploadLogo();&lt;br /&gt;}&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;in Flash add the callbackfunction to the External Interface API as folows&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;ExternalInterface.addCallback("UploadLogo", UploadLogo);&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;public function UploadLogo():void  &lt;/div&gt;&lt;div align="justify"&gt;{   &lt;/div&gt;&lt;div align="justify"&gt;     //Your code here  &lt;/div&gt;&lt;div align="justify"&gt;}&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;The some of the points to be noted for acessing the flash functions as follows&lt;/div&gt;&lt;div align="justify"&gt;1.The flash function can be called from the javascript function must be public scope.&lt;/div&gt;&lt;div align="justify"&gt;2.Use the flash instance name as same as Object Tag id property as well as Embed Tag id and name property&lt;/div&gt;&lt;div align="justify"&gt;3. Object Tag id property and Embed Tag id as well as name property must be same name.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Then accessing the flash function from the javascript and control the swf functionality from javascript function.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-4985002596475147560?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/4985002596475147560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/call-flash-function-from-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4985002596475147560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4985002596475147560'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/call-flash-function-from-javascript.html' title='Call Flash function from Javascript'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-6650284208086261430</id><published>2010-02-02T01:47:00.000-08:00</published><updated>2010-02-02T01:54:53.836-08:00</updated><title type='text'>Create Custom controls in AS3</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;     I would like to create the controls dynamically using the actionscript. So i create the actionscript class for creating the Button, Text Field, and TextInput controls by using the AS3. Here i added the code for creating the controls in AS3.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="left"&gt;package util{ &lt;/div&gt;&lt;div align="left"&gt;import flash.geom.Matrix; &lt;/div&gt;&lt;div align="left"&gt;import flash.display.Sprite; &lt;/div&gt;&lt;div align="left"&gt;import flash.text.TextField; &lt;/div&gt;&lt;div align="left"&gt;import flash.text.TextFormat; &lt;/div&gt;&lt;div align="left"&gt;import fl.controls.ProgressBar; &lt;/div&gt;&lt;div align="left"&gt;import flash.text.TextFieldType; &lt;/div&gt;&lt;div align="left"&gt;import flash.display.SimpleButton; &lt;/div&gt;&lt;div align="left"&gt;import flash.text.TextFormatAlign; &lt;/div&gt;&lt;div align="left"&gt;import flash.display.GradientType; &lt;/div&gt;&lt;div align="left"&gt;import fl.controls.ProgressBarMode;&lt;/div&gt;&lt;div align="left"&gt; import flash.text.TextFieldAutoSize;  &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public class ControlUtils &lt;/div&gt;&lt;div align="left"&gt;{  &lt;/div&gt;&lt;div align="left"&gt;public function ControlUtils()  {  }    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public function createTextField(color:uint):TextField  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;var _txtFormat:TextFormat = new TextFormat();   &lt;/div&gt;&lt;div align="left"&gt;_txtFormat.font = "Arial";   &lt;/div&gt;&lt;div align="left"&gt;_txtFormat.size = 12.5;   &lt;/div&gt;&lt;div align="left"&gt;_txtFormat.bold = true;   &lt;/div&gt;&lt;div align="left"&gt;_txtFormat.color = color;      &lt;/div&gt;&lt;div align="left"&gt;var _txtField:TextField = new TextField();   &lt;/div&gt;&lt;div align="left"&gt;_txtField.autoSize = TextFieldAutoSize.CENTER;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.defaultTextFormat = _txtFormat;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.selectable = false;   return _txtField;  &lt;/div&gt;&lt;div align="left"&gt;}    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public function createInputBox(wid:int,hgt:int,bgColor:uint,borderColor:uint):TextField  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;var _txtField:TextField = new TextField();   &lt;/div&gt;&lt;div align="left"&gt;_txtField.type = TextFieldType.INPUT;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.background = true;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.border = true;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.width = wid;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.height = hgt;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.backgroundColor = bgColor;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.borderColor = borderColor;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.selectable = false;   &lt;/div&gt;&lt;div align="left"&gt;return _txtField;  &lt;/div&gt;&lt;div align="left"&gt;}    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public function createButton(buttonText:String,wid:int,hgt:int,color:Array,overColor:Array,txtColor:uint,cornerRadius:int=2):SimpleButton  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;var _colors:Array = [color[0],color[1]];   &lt;/div&gt;&lt;div align="left"&gt;var _alphas:Array = [1,1];   &lt;/div&gt;&lt;div align="left"&gt;var _ratios:Array = [0,255];   &lt;/div&gt;&lt;div align="left"&gt;var _matrix:Matrix = new Matrix();   &lt;/div&gt;&lt;div align="left"&gt;_matrix.createGradientBox(wid,hgt,Math.PI/2,0,0);      &lt;/div&gt;&lt;div align="left"&gt;var _btnUpState:Sprite = new Sprite();   &lt;/div&gt;&lt;div align="left"&gt;_btnUpState.graphics.lineStyle(1,_colors[0]);   &lt;/div&gt;&lt;div align="left"&gt;_btnUpState.graphics.beginGradientFill(GradientType.LINEAR,_colors,_alphas,_ratios,_matrix);   &lt;/div&gt;&lt;div align="left"&gt;if((_colors[0] == _colors[1]) &amp;amp;&amp;amp; (cornerRadius == 0))    &lt;/div&gt;&lt;div align="left"&gt;_btnUpState.graphics.drawRect(0,0,wid,hgt);   &lt;/div&gt;&lt;div align="left"&gt;else if((_colors[0] == _colors[1]) &amp;amp;&amp;amp; (cornerRadius &gt; 0))    &lt;/div&gt;&lt;div align="left"&gt;_btnUpState.graphics.drawRoundRect(-cornerRadius/2,0,wid-cornerRadius/2,hgt,cornerRadius,cornerRadius);   &lt;/div&gt;&lt;div align="left"&gt;else if(_colors[0] != _colors[1])    &lt;/div&gt;&lt;div align="left"&gt;_btnUpState.graphics.drawRoundRect(0,0,wid,hgt,cornerRadius,cornerRadius);   &lt;/div&gt;&lt;div align="left"&gt;_btnUpState.addChild(createButtonTextField(buttonText,txtColor,wid,hgt,cornerRadius));     &lt;/div&gt;&lt;div align="left"&gt; if(overColor == null)    &lt;/div&gt;&lt;div align="left"&gt;_colors = [color[1],color[0]];   &lt;/div&gt;&lt;div align="left"&gt;else    &lt;/div&gt;&lt;div align="left"&gt;_colors = [overColor[0],overColor[1]];       &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;var _btnOverState:Sprite = new Sprite();   &lt;/div&gt;&lt;div align="left"&gt;_btnOverState.graphics.lineStyle(1,_colors[0]);   &lt;/div&gt;&lt;div align="left"&gt;_btnOverState.graphics.beginGradientFill(GradientType.LINEAR,_colors,_alphas,_ratios,_matrix);   &lt;/div&gt;&lt;div align="left"&gt;if((_colors[0] == _colors[1]) &amp;amp;&amp;amp; (cornerRadius == 0))    &lt;/div&gt;&lt;div align="left"&gt;_btnOverState.graphics.drawRect(0,0,wid,hgt);   &lt;/div&gt;&lt;div align="left"&gt;else if((_colors[0] == _colors[1]) &amp;amp;&amp;amp; (cornerRadius &gt; 0))    &lt;/div&gt;&lt;div align="left"&gt;_btnOverState.graphics.drawRoundRect(-cornerRadius/2,0,wid-cornerRadius/2,hgt,cornerRadius,cornerRadius);   &lt;/div&gt;&lt;div align="left"&gt;else if(_colors[0] != _colors[1])    &lt;/div&gt;&lt;div align="left"&gt;_btnOverState.graphics.drawRoundRect(0,0,wid,hgt,cornerRadius,cornerRadius);   &lt;/div&gt;&lt;div align="left"&gt;_btnOverState.addChild(createButtonTextField(buttonText,txtColor,wid,hgt,cornerRadius));      &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;var _myButton:SimpleButton = new SimpleButton(_btnUpState,_btnOverState,_btnUpState,_btnUpState);   &lt;/div&gt;&lt;div align="left"&gt;_myButton.name = buttonText;   &lt;/div&gt;&lt;div align="left"&gt;return _myButton;  &lt;/div&gt;&lt;div align="left"&gt;}   &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt; private function createButtonTextField(Text:String,color:uint,wid:int,hgt:int,cornerRadius:int):TextField  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;var _txtField:TextField = new TextField();   &lt;/div&gt;&lt;div align="left"&gt;_txtField.autoSize = TextFieldAutoSize.LEFT;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.textColor = color;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.selectable = false;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.width = wid;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.height = hgt;      &lt;/div&gt;&lt;div align="left"&gt;var _txtFormat:TextFormat = new TextFormat();   &lt;/div&gt;&lt;div align="left"&gt;_txtFormat.align = TextFormatAlign.CENTER;   &lt;/div&gt;&lt;div align="left"&gt;Text = "&lt;b&gt;"+Text+"&lt;/b&gt;";   &lt;/div&gt;&lt;div align="left"&gt;_txtField.htmlText = "&lt;span style="font-family:'Arial';"&gt;"+Text+"&lt;/span&gt;";   &lt;/div&gt;&lt;div align="left"&gt;_txtField.x = (wid - _txtField.width)/2 - cornerRadius/2;   &lt;/div&gt;&lt;div align="left"&gt;_txtField.y = (hgt - _txtField.height)/2;   return _txtField;  &lt;/div&gt;&lt;div align="left"&gt;}    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public function createProgressBar(wid:int,hgt:int,barColor:Array,trackColor:uint):Preloader  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;var _progressBar:Preloader = new Preloader(wid,hgt,trackColor);   &lt;/div&gt;&lt;div align="left"&gt;_progressBar.barColor = barColor;   return _progressBar;  &lt;/div&gt;&lt;div align="left"&gt;} &lt;/div&gt;&lt;div align="left"&gt;}&lt;/div&gt;&lt;div align="left"&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-6650284208086261430?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/6650284208086261430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/create-custom-controls-in-as3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/6650284208086261430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/6650284208086261430'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/create-custom-controls-in-as3.html' title='Create Custom controls in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-9039550605756005681</id><published>2010-02-02T01:36:00.000-08:00</published><updated>2010-02-02T01:45:22.255-08:00</updated><title type='text'>Creating the custom preloader in AS3</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;     I am try to use the preloader component from Flash CS3. But it takes more size while creating the swf file. So i try to create the custom preloader class in AS3. Its very nice look and we can set the preloader bar style as gradient or normal style. In below i added the custom preloader class code. use this code and enjoy.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="left"&gt;package util&lt;/div&gt;&lt;div align="left"&gt;{ &lt;/div&gt;&lt;div align="left"&gt;import flash.geom.Matrix; &lt;/div&gt;&lt;div align="left"&gt;import flash.text.TextField; &lt;/div&gt;&lt;div align="left"&gt;import flash.display.Sprite; &lt;/div&gt;&lt;div align="left"&gt;import flash.display.Graphics;&lt;/div&gt;&lt;div align="left"&gt; import flash.display.GradientType; &lt;/div&gt;&lt;div align="left"&gt;import flash.display.SpreadMethod; &lt;/div&gt;&lt;div align="left"&gt;import flash.display.InterpolationMethod;  &lt;/div&gt;&lt;div align="left"&gt;public class Preloader extends Sprite &lt;/div&gt;&lt;div align="left"&gt;{  &lt;/div&gt;&lt;div align="left"&gt;private var _matrix:Matrix;  &lt;/div&gt;&lt;div align="left"&gt;private var _loadBar:Sprite;  &lt;/div&gt;&lt;div align="left"&gt;private var _progressBG:Sprite;  &lt;/div&gt;&lt;div align="left"&gt;private var _barColor:Array;  &lt;/div&gt;&lt;div align="left"&gt;private var _percLabel:TextField;  &lt;/div&gt;&lt;div align="left"&gt;private var _controlUtil:ControlUtils;  &lt;/div&gt;&lt;div align="left"&gt;private var _preloaderWidth:Number = 0;  &lt;/div&gt;&lt;div align="left"&gt;private var _preloaderHeight:Number = 0;  &lt;/div&gt;&lt;div align="left"&gt;private var _trackColor:uint = 0xFFFFFF;    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public function set barColor(val:Array):void  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;if(_barColor != val)    &lt;/div&gt;&lt;div align="left"&gt;_barColor = val;  &lt;/div&gt;&lt;div align="left"&gt;}    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public function Preloader(wid:Number,hgt:Number,trackColor:uint)  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;super();   &lt;/div&gt;&lt;div align="left"&gt;_matrix = new Matrix();   &lt;/div&gt;&lt;div align="left"&gt;_preloaderWidth = wid;   &lt;/div&gt;&lt;div align="left"&gt;_preloaderHeight = hgt;   &lt;/div&gt;&lt;div align="left"&gt;_trackColor = trackColor;   &lt;/div&gt;&lt;div align="left"&gt;_controlUtil = new ControlUtils();   &lt;/div&gt;&lt;div align="left"&gt;createBackground();  &lt;/div&gt;&lt;div align="left"&gt;}    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;private function createBackground():void  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;_progressBG = new Sprite();   &lt;/div&gt;&lt;div align="left"&gt;_progressBG.graphics.clear();   &lt;/div&gt;&lt;div align="left"&gt;_progressBG.graphics.lineStyle(0x000000,2);   &lt;/div&gt;&lt;div align="left"&gt;_progressBG.graphics.beginFill(_trackColor,1);   &lt;/div&gt;&lt;div align="left"&gt;_progressBG.graphics.drawRect(0,0,_preloaderWidth,_preloaderHeight);  &lt;/div&gt;&lt;div align="left"&gt; _progressBG.graphics.endFill();   &lt;/div&gt;&lt;div align="left"&gt;addChild(_progressBG);     &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt; _loadBar = new Sprite();   &lt;/div&gt;&lt;div align="left"&gt;_progressBG.addChild(_loadBar);   &lt;/div&gt;&lt;div align="left"&gt;_percLabel = _controlUtil.createTextField(0x000000);  &lt;/div&gt;&lt;div align="left"&gt; _progressBG.addChild(_percLabel);  &lt;/div&gt;&lt;div align="left"&gt; _percLabel.x = (_preloaderWidth - _percLabel.width)/2;   &lt;/div&gt;&lt;div align="left"&gt;this.width = _preloaderWidth;   &lt;/div&gt;&lt;div align="left"&gt;this.height = _preloaderHeight;  &lt;/div&gt;&lt;div align="left"&gt;}    &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;public function setLoadProgress(loaded:Number,total:Number):Boolean  &lt;/div&gt;&lt;div align="left"&gt;{   &lt;/div&gt;&lt;div align="left"&gt;var _percent:Number = loaded/total;   &lt;/div&gt;&lt;div align="left"&gt;var _val:Number = Math.round(_percent * 100);   &lt;/div&gt;&lt;div align="left"&gt;if(_val &lt;= 100)   &lt;/div&gt;&lt;div align="left"&gt;{    &lt;/div&gt;&lt;div align="left"&gt;_percLabel.text = _val+" %";    &lt;/div&gt;&lt;div align="left"&gt;var _tempValue:Number = Math.round(_percent * _preloaderWidth);    &lt;/div&gt;&lt;div align="left"&gt;_matrix.createGradientBox(_tempValue,_preloaderHeight,Math.PI/2,0,0);        &lt;/div&gt;&lt;div align="left"&gt;var _ratios:Array = [0,255];    &lt;/div&gt;&lt;div align="left"&gt;var _alphas:Array = [0.75,0.75];    &lt;/div&gt;&lt;div align="left"&gt;var _colors:Array = [_barColor[0],_barColor[1]];           &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;_loadBar.graphics.clear();    &lt;/div&gt;&lt;div align="left"&gt;if(_barColor.length &gt; 1)     &lt;/div&gt;&lt;div align="left"&gt;_loadBar.graphics.beginGradientFill(GradientType.LINEAR,_colors,_alphas,_ratios,_matrix);    &lt;/div&gt;&lt;div align="left"&gt;else    &lt;/div&gt;&lt;div align="left"&gt; _loadBar.graphics.beginFill(_barColor[0],0.7);    &lt;/div&gt;&lt;div align="left"&gt;_loadBar.graphics.drawRect(1,1,_tempValue-1,_preloaderHeight-1);    &lt;/div&gt;&lt;div align="left"&gt;_loadBar.graphics.endFill();        &lt;/div&gt;&lt;div align="left"&gt; &lt;/div&gt;&lt;div align="left"&gt;if(_val == 100)     &lt;/div&gt;&lt;div align="left"&gt;return true;   &lt;/div&gt;&lt;div align="left"&gt;}   &lt;/div&gt;&lt;div align="left"&gt;return false; &lt;/div&gt;&lt;div align="left"&gt; } &lt;/div&gt;&lt;div align="left"&gt;}&lt;/div&gt;&lt;div align="left"&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-9039550605756005681?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/9039550605756005681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2010/02/creating-custom-preloader-in-as3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/9039550605756005681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/9039550605756005681'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2010/02/creating-custom-preloader-in-as3.html' title='Creating the custom preloader in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-8702202732670297614</id><published>2009-11-23T22:27:00.000-08:00</published><updated>2009-11-23T22:33:11.756-08:00</updated><title type='text'>Custom indeterminate Preloader in Actionscript3 in Flex</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;   The custom inderterminate preloader can be build by actionscript only and it can be support for change the background and preloader color by set the style of the custom preloader class. The code as follows&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;package com&lt;br /&gt;{&lt;br /&gt;import mx.controls.Label;&lt;br /&gt;import mx.containers.VBox;&lt;br /&gt;import mx.controls.ProgressBar;&lt;br /&gt;import mx.managers.PopUpManager;&lt;br /&gt;import flash.display.DisplayObjectContainer;&lt;br /&gt;[Style(name="mapLoaderBackgroundColor",type="uint",format="Color",inherit="no")]&lt;br /&gt;[Style(name="maploaderProgressColor",type="uint",format="Color",inherit="no")]&lt;br /&gt;public class MapPreloader extends VBox&lt;br /&gt;{&lt;br /&gt;private var _progressBar:ProgressBar;&lt;br /&gt;private var _loadingLabel:Label;&lt;br /&gt;public function MapPreloader()&lt;br /&gt;{&lt;br /&gt;super();&lt;br /&gt;width = 250;&lt;br /&gt;height = 80;&lt;br /&gt;setStyle("paddingTop",20);&lt;br /&gt;setStyle("paddingBottom",10);&lt;br /&gt;setStyle("cornerRadius",10);&lt;br /&gt;setStyle("backgroundAlpha",1);&lt;br /&gt;setStyle("borderStyle","solid");&lt;br /&gt;setStyle("horizontalAlign","center");&lt;br /&gt;setStyle("verticalScrollPolicy","off");&lt;br /&gt;setStyle("horizontalScrollPolicy","off");&lt;br /&gt;}&lt;br /&gt;override protected function createChildren():void&lt;br /&gt;{&lt;br /&gt;super.createChildren();&lt;br /&gt;_progressBar = new ProgressBar();&lt;br /&gt;_progressBar.label = "";&lt;br /&gt;_progressBar.labelPlacement = "center";&lt;br /&gt;_progressBar.width = 200;&lt;br /&gt;_progressBar.indeterminate = true;&lt;br /&gt;_progressBar.setStyle("themeColor",0x333333);&lt;br /&gt;addChild(_progressBar);&lt;br /&gt;_loadingLabel = new Label();&lt;br /&gt;_loadingLabel.text = "Loading...";&lt;br /&gt;_loadingLabel.percentWidth = 100;&lt;br /&gt;_loadingLabel.setStyle("fontSize",12);&lt;br /&gt;_loadingLabel.setStyle("textAlign","center");&lt;br /&gt;addChild(_loadingLabel);&lt;br /&gt;}&lt;br /&gt;public function show(parent:DisplayObjectContainer):void&lt;br /&gt;{&lt;br /&gt;PopUpManager.addPopUp(this,DisplayObjectContainer(parent),true);&lt;br /&gt;}&lt;br /&gt;override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void&lt;br /&gt;{&lt;br /&gt;super.updateDisplayList(unscaledWidth,unscaledHeight);&lt;br /&gt;var _bgColor:uint = getStyle("mapLoaderBackgroundColor");&lt;br /&gt;setStyle("backgroundColor",_bgColor);&lt;br /&gt;var _progressColor:uint = getStyle("maploaderProgressColor");&lt;br /&gt;_progressBar.setStyle("themeColor",_progressColor);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The color of custom indeterminate preloader can be change by following way&lt;br /&gt;&lt;br /&gt;MapPreloader{&lt;br /&gt;mapLoaderBackgroundColor:#FF0000;&lt;br /&gt;maploaderProgressColor:#FFCC00;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-8702202732670297614?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/8702202732670297614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/11/custom-indeterminate-preloader-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8702202732670297614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8702202732670297614'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/11/custom-indeterminate-preloader-in.html' title='Custom indeterminate Preloader in Actionscript3 in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5895399050168668976</id><published>2009-11-23T22:15:00.000-08:00</published><updated>2009-11-23T22:23:40.890-08:00</updated><title type='text'>Send SMS to Mobile using Way2SMS webservice in Adobe Air</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;   I created one appication for send sms to mobile phones all over india. I use the way2sms service provider for send the message to mobile phone. Here i mention the code for send sms message to mobile phones.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="0xFFFFFF" width="500" height="380" showStatusBar="false"&lt;br /&gt;layout="vertical" verticalGap="4" verticalScrollPolicy="off" horizontalScrollPolicy="off" creationComplete="onInit()" showTitleBar="false"&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.events.CloseEvent;&lt;br /&gt;import mx.controls.Alert;&lt;br /&gt;import flash.net.navigateToURL;&lt;br /&gt;import mx.rpc.events.FaultEvent;&lt;br /&gt;import mx.rpc.events.ResultEvent;&lt;br /&gt;import mx.events.ValidationResultEvent;&lt;br /&gt;private var _dockImage:BitmapData;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;var _loader:Loader = new Loader();&lt;br /&gt;_loader.load(new URLRequest("images/systray_icon_16.png"));&lt;br /&gt;_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageLoaded);&lt;br /&gt;}&lt;br /&gt;private function onImageLoaded(evt:Event):void&lt;br /&gt;{&lt;br /&gt;_dockImage = evt.target.content.bitmapData;&lt;br /&gt;}&lt;br /&gt;private function onCloseApp(evt:Event):void&lt;br /&gt;{&lt;br /&gt;NativeApplication.nativeApplication.icon.bitmaps = [_dockImage];&lt;br /&gt;}&lt;br /&gt;public function onResponse(e:ResultEvent):void&lt;br /&gt;{&lt;br /&gt;if(e.result == "invalid login")&lt;br /&gt;txt_status.text = e.result.toString();&lt;br /&gt;else if(e.result == "done")&lt;br /&gt;txt_status.text = "Message was send successfully";&lt;br /&gt;else&lt;br /&gt;txt_status.text = e.result.toString();&lt;br /&gt;}&lt;br /&gt;public function onFault(e:FaultEvent):void&lt;br /&gt;{&lt;br /&gt;txt_status.text = "Message was not send";&lt;br /&gt;}&lt;br /&gt;private function sendMsg():void&lt;br /&gt;{&lt;br /&gt;WS.getOperation('sendSMSToMany').send();&lt;br /&gt;}&lt;br /&gt;private function redirectPage():void&lt;br /&gt;{&lt;br /&gt;navigateToURL(new URLRequest("http://wwwa.way2sms.com/jsp/UserRegistration.jsp"),"_POST");&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:WebService id="WS" wsdl="http://www.aswinanand.com/sendsms.php?wsdl" showBusyCursor="true"&amp;gt;&lt;br /&gt;&amp;lt;mx:operation name="sendSMSToMany" result="onResponse(event)" fault="onFault(event)"&amp;gt;&lt;br /&gt;&amp;lt;mx:request&amp;gt;&lt;br /&gt;&amp;lt;uid&amp;gt;&lt;br /&gt;{txt_user.text}&lt;br /&gt;&amp;lt;/uid&amp;gt;&lt;br /&gt;&amp;lt;pwd&amp;gt;&lt;br /&gt;{txt_pwd.text}&lt;br /&gt;&amp;lt;/pwd&amp;gt;&lt;br /&gt;&amp;lt;phone&amp;gt;&lt;br /&gt;{txt_mobile.text}&lt;br /&gt;&amp;lt;/phone&amp;gt;&lt;br /&gt;&amp;lt;msg&amp;gt;&lt;br /&gt;{txt_msg.text}&lt;br /&gt;&amp;lt;/msg&amp;gt;&lt;br /&gt;&amp;lt;/mx:request&amp;gt;&lt;br /&gt;&amp;lt;/mx:operation&amp;gt;&lt;br /&gt;&amp;lt;/mx:WebService&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox verticalGap="1" horizontalGap="3" width="100%"&amp;gt;&lt;br /&gt;&amp;lt;mx:Image source="@Embed(source='images/logo.jpg')"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Text text="Send SMS to Friends in India" fontSize="18" fontWeight="bold"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox verticalGap="1" width="100%" horizontalAlign="center"&amp;gt;&lt;br /&gt;&amp;lt;mx:Text id="txt_status" fontSize="16" fontWeight="bold" color="#FF0000"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:Form verticalGap="8" y="-30"&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Username:" fontSize="14" color="#0000FF" fontWeight="bold" width="98%"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="txt_user" fontSize="12" color="0x000000" fontWeight="normal" width="150" maxChars="10" restrict="0-9"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Password:" fontSize="14" color="#0000FF" fontWeight="bold" width="98%"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="txt_pwd" fontSize="12" color="0x000000" fontWeight="normal" width="150" displayAsPassword="true"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Mobile NO:" fontSize="14" color="#0000FF" fontWeight="bold" width="98%"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="txt_mobile" fontSize="12" color="0x000000" fontWeight="normal" width="150" maxChars="10" restrict="0-9"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Type Message:" fontSize="14" color="#0000FF" fontWeight="bold" width="98%"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextArea id="txt_msg" fontSize="12" color="0x000000" fontWeight="normal" width="180" height="80" maxChars="140"&lt;br /&gt;change="maxchar.text = '* maxchar 140('+txt_msg.text.length.toString()+')'"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Label id="maxchar" text="* maxchar 140(0)" fontSize="11" color="0xFF0000" fontWeight="normal"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem width="100%" paddingTop="10"&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox width="100%"&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="Send" click="sendMsg()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="Register Now" click="redirectPage()"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&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:WindowedApplication&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5895399050168668976?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5895399050168668976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/11/send-sms-to-mobile-using-way2sms.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5895399050168668976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5895399050168668976'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/11/send-sms-to-mobile-using-way2sms.html' title='Send SMS to Mobile using Way2SMS webservice in Adobe Air'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-2503256920045104838</id><published>2009-11-23T22:04:00.000-08:00</published><updated>2009-11-23T22:24:41.587-08:00</updated><title type='text'>Interact with PayPal in Flex3</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;Here i post the nice example for choose the book from the list and enter the quantity of the book that they want. Then pass the information to the paypal application and we can see the amount of product that we order from the flex application. In below i given the code for that.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import flash.net.navigateToURL;&lt;br /&gt;private var _cmbArr:Array;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;var _urlRequest:URLRequest = new URLRequest("xmls/bookList.xml");&lt;br /&gt;var _urlLoader:URLLoader = new URLLoader();&lt;br /&gt;_urlLoader.addEventListener(Event.COMPLETE,onXMLLoadComplete);&lt;br /&gt;_urlLoader.load(_urlRequest);&lt;br /&gt;}&lt;br /&gt;private function onXMLLoadComplete(evt:Event):void&lt;br /&gt;{&lt;br /&gt;_cmbArr = new Array();&lt;br /&gt;var _xml:XML = XML(evt.target.data);&lt;br /&gt;var _xmlList:XMLList = XMLList(_xml.book);&lt;br /&gt;_cmbArr.push("Select Product");&lt;br /&gt;for(var i:int=0;i&lt;_xmlList.length();i++)&lt;br /&gt;{&lt;br /&gt;_cmbArr.push({label:_xmlList[i].@name,id:_xmlList[i].@id,price:_xmlList[i].@price,tax:_xmlList[i].@tax,mail:_xmlList[i].@ordermail,thumb:_xmlList[i].@thumburl});&lt;br /&gt;}&lt;br /&gt;cmb_product.dataProvider = _cmbArr;&lt;br /&gt;}&lt;br /&gt;private function onProductChange(evt:Event):void&lt;br /&gt;{&lt;br /&gt;txt_prodid.text = cmb_product.selectedItem.id;&lt;br /&gt;txt_amt.text = cmb_product.selectedItem.price;&lt;br /&gt;txt_tax.text = cmb_product.selectedItem.tax;&lt;br /&gt;img_src.source = cmb_product.selectedItem.thumb;&lt;br /&gt;txt_desc.text = cmb_product.selectedItem.label;&lt;br /&gt;}&lt;br /&gt;private function makePayment():void&lt;br /&gt;{&lt;br /&gt;var url:String = "http://www.paypal.com/cgi-bin/webscr";&lt;br /&gt;var _urlRequest:URLRequest = new URLRequest(url);&lt;br /&gt;var _urlVar:URLVariables = new URLVariables();&lt;br /&gt;_urlVar.cmd = "_xclick";&lt;br /&gt;_urlVar.currency_code = "USD";&lt;br /&gt;_urlVar.business = cmb_product.selectedItem.mail;&lt;br /&gt;_urlVar.item_number = cmb_product.selectedItem.id;&lt;br /&gt;_urlVar.item_name = cmb_product.selectedItem.label;&lt;br /&gt;_urlVar.amount = cmb_product.selectedItem.price;&lt;br /&gt;_urlVar.quantity = txt_qty.text;&lt;br /&gt;_urlVar.tax = cmb_product.selectedItem.tax;&lt;br /&gt;_urlRequest.data = _urlVar;&lt;br /&gt;_urlRequest.method = URLRequestMethod.POST;&lt;br /&gt;navigateToURL(_urlRequest,"_parent");&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox paddingLeft="20" paddingTop="20"&amp;gt;&lt;br /&gt;&amp;lt;mx:Form backgroundColor="#FFFFFF" height="240"&amp;gt;&lt;br /&gt;&amp;lt;mx:Label width="100%" text="Product Catalogue" fontFamily="Arial" fontSize="15" fontWeight="bold" textAlign="center"/&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Choose Item :" fontFamily="Arial" fontSize="12"&amp;gt;&lt;br /&gt;&amp;lt;mx:ComboBox id="cmb_product" width="150" height="23" fontFamily="Arial" fontSize="12" change="onProductChange(event)"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Product ID :" fontFamily="Arial" fontSize="12"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="txt_prodid" editable="false" width="150" height="23"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Amount :" fontFamily="Arial" fontSize="12"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="txt_amt" editable="false" width="150" height="23"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Quantity :" fontFamily="Arial" fontSize="12"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="txt_qty" text="1" width="150" height="23"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:FormItem&amp;gt;&lt;br /&gt;&amp;lt;mx:FormItem label="Tax :" fontFamily="Arial" fontSize="12"&amp;gt;&lt;br /&gt;&amp;lt;mx:TextInput id="txt_tax" editable="false" width="150" height="23"/&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:Image source="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" width="60" maintainAspectRatio="true" horizontalCenter="0" verticalCenter="0" click="makePayment()"/&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:VRule height="100%" strokeColor="#CCCCCC"/&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox height="240" backgroundColor="#666666"&amp;gt;&lt;br /&gt;&amp;lt;mx:Image id="img_src" width="250" height="200" verticalAlign="bottom" horizontalAlign="center"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Text id="txt_desc" fontFamily="Arial" fontSize="12" textAlign="center" fontWeight="bold" color="#FFFFFF" width="100%" height="20"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;The sample xml file for accessing those above example as follows&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;BookList&amp;gt;&lt;br /&gt;&amp;lt;book id="201" name="Cool 3D" price="250" tax="2" ordermail="order@macromedia.com" thumburl="assets/images/cool3d.jpg"/&amp;gt;&lt;br /&gt;&amp;lt;book id="010" name="Dream Weaver" price="180" tax="4" ordermail="order@adobe.com" thumburl="assets/images/dreamweaver.gif"/&amp;gt;&lt;br /&gt;&amp;lt;book id="001" name="Dream WeaverMX" price="300" tax="2" ordermail="order@adobe.com" thumburl="assets/images/dreamweavermx.gif"/&amp;gt;&lt;br /&gt;&amp;lt;book id="413" name="Open Suse" price="280" tax="6" ordermail="order@sunsystems.com" thumburl="assets/images/opensuse.png"/&amp;gt;&lt;br /&gt;&amp;lt;book id="271" name="Software Application" price="320" tax="4" ordermail="order@microsoft.com" thumburl="assets/images/swapp.jpg"/&amp;gt;&lt;br /&gt;&amp;lt;/BookList&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-2503256920045104838?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/2503256920045104838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/11/interact-with-paypal-in-flex3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2503256920045104838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2503256920045104838'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/11/interact-with-paypal-in-flex3.html' title='Interact with PayPal in Flex3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-4243211910836711630</id><published>2009-11-23T21:57:00.000-08:00</published><updated>2009-11-23T22:25:05.462-08:00</updated><title type='text'>Rotate the Header Text in Datagrid in Flex3</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;Here is the nice example for rotate the header text of the datagrid. The custom class i created for rotate the header text of Datagrid. When we need to rotate the text we must embed the text otherwise it cannot be visible the header text after rotate it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" &amp;gt;&lt;br /&gt;&amp;lt;mx:Style&amp;gt;&lt;br /&gt;@font-face&lt;br /&gt;{&lt;br /&gt;src: url("/assets/fonts/trebucbd.ttf");&lt;br /&gt;fontFamily: "TrebuchetMSBold";&lt;br /&gt;fontWeight: bold;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/mx:Style&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import com.GridHeader;&lt;br /&gt;import mx.controls.dataGridClasses.DataGridColumn;&lt;br /&gt;import mx.rpc.events.HeaderEvent;&lt;br /&gt;import mx.controls.DataGrid;&lt;br /&gt;[Bindable]&lt;br /&gt;private var dp1:Array = [{Product: "ADBE", name: "Adobe Systems Inc.", price: 49.95},&lt;br /&gt;{Product: "MACR", name: "Macromedia Inc.", price: 39.95},&lt;br /&gt;{Product: "MSFT", name: "Microsoft Corp.", price: 25.95},&lt;br /&gt;{Product: "IBM", name: "IBM Corp.", price: 42.55}];&lt;br /&gt;[Bindable]&lt;br /&gt;private var dp2:Array = [{Product: "SOFT", name: "Software", price: 49.95},&lt;br /&gt;{Product: "HARD", name: "Hardware", price: 39.95},&lt;br /&gt;{Product: "NETW", name: "Network", price: 25.95}];&lt;br /&gt;private function onChangeProvider():void&lt;br /&gt;{&lt;br /&gt;if(dg.dataProvider.length == 4)&lt;br /&gt;dg.dataProvider = dp2;&lt;br /&gt;else if(dg.dataProvider.length == 3)&lt;br /&gt;dg.dataProvider = dp1;&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGrid id="dg" dataProvider="{dp1}"&amp;gt;&lt;br /&gt;&amp;lt;mx:columns&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGridColumn headerText="Product" dataField="Product" headerRenderer="com.GridHeader"/&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGridColumn headerText="Name" dataField="name" headerRenderer="com.GridHeader"/&amp;gt;&lt;br /&gt;&amp;lt;mx:DataGridColumn headerText="Price" dataField="price" headerRenderer="com.GridHeader"/&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:Button label="Change Provider" click="onChangeProvider()"/&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;The code for the custom class for rotate the text as follows&lt;br /&gt;&lt;br /&gt;package com&lt;br /&gt;{&lt;br /&gt;import flash.text.AntiAliasType;&lt;br /&gt;import flash.text.TextField;&lt;br /&gt;import flash.text.TextFieldAutoSize;&lt;br /&gt;import flash.text.TextFormat;&lt;br /&gt;import mx.containers.VBox;&lt;br /&gt;import mx.controls.listClasses.IListItemRenderer;&lt;br /&gt;public class GridHeader extends VBox implements IListItemRenderer&lt;br /&gt;{&lt;br /&gt;private var _lbl:TextField;&lt;br /&gt;public function GridHeader()&lt;br /&gt;{&lt;br /&gt;super();&lt;br /&gt;height = 60;&lt;br /&gt;setStyle("backgroundColor",0xFF0000);&lt;br /&gt;setStyle("verticalGap",2);&lt;br /&gt;}&lt;br /&gt;override protected function createChildren():void&lt;br /&gt;{&lt;br /&gt;super.createChildren();&lt;br /&gt;var _txtFormat:TextFormat = new TextFormat();&lt;br /&gt;_txtFormat.font = "TrebuchetMSBold";&lt;br /&gt;_txtFormat.size = 13;&lt;br /&gt;_txtFormat.bold = true;&lt;br /&gt;_txtFormat.color = 0x0000FF;&lt;br /&gt;_txtFormat.align = "center";&lt;br /&gt;_lbl = new TextField();&lt;br /&gt;_lbl.autoSize = TextFieldAutoSize.LEFT;&lt;br /&gt;_lbl.embedFonts = true;&lt;br /&gt;_lbl.antiAliasType = AntiAliasType.ADVANCED;&lt;br /&gt;_lbl.defaultTextFormat = _txtFormat;&lt;br /&gt;_lbl.rotation = 270;&lt;br /&gt;rawChildren.addChild(_lbl);&lt;br /&gt;}&lt;br /&gt;override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void&lt;br /&gt;{&lt;br /&gt;if(data.headerText != null data.headerText != "")&lt;br /&gt;{&lt;br /&gt;_lbl.text = data.headerText;&lt;br /&gt;_lbl.y = height-5;&lt;br /&gt;_lbl.x = (width - _lbl.width)/2;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-4243211910836711630?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/4243211910836711630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/11/rotate-header-text-in-datagrid-in-flex3.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4243211910836711630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4243211910836711630'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/11/rotate-header-text-in-datagrid-in-flex3.html' title='Rotate the Header Text in Datagrid in Flex3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5266159055660135734</id><published>2009-09-03T05:08:00.000-07:00</published><updated>2009-09-03T05:20:28.290-07:00</updated><title type='text'>Need 10 Explorer for Flex Developer</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;The below 10 Explorer are necessary for concentrate on design of Flex application interface and for the new flex developer it will guide to work on flex platform and to become a good user interface design in Flex platform. The necesary 10 Explorer are as follows and use it and enjoy&lt;br /&gt;&lt;br /&gt;01.&lt;a href="http://www.adobe.com/devnet/flex/tourdeflex/web/"&gt;Tour de Flex&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;02. &lt;a href="http://examples.adobe.com/flex3/componentexplorer/explorer.html"&gt;Component Explorer&lt;/a&gt;&lt;br /&gt;03. &lt;a href="http://examples.adobe.com/flex3/consulting/styleexplorer/Flex3StyleExplorer.html#"&gt;Style Explorer&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;04. &lt;a href="http://ryanswanson.com/regexp/#start"&gt;Regular Expression Explorer&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;05. &lt;a href="http://demo.quietlyscheming.com/ChartSampler/app.html"&gt;Charts Explorer&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;06. &lt;a href="http://www.efflex.org/category/orgefflexmxpairviewstackeffects/"&gt;Efflex Effects Explorer&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;07. &lt;a href="http://merhl.com/flex2_samples/filterExplorer/"&gt;Filter Explorer&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;08. &lt;a href="http://www.flexibleexperiments.com/Flex/PrimitiveExplorer/Flex2PrimitiveExplorer.html"&gt;Primitive Objects Explorer&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;09. &lt;a href="http://birdeye.googlecode.com/svn/trunk/qavis/examples/bin/QaVisExplorer.html#"&gt;Data Visualization Explorer&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;10. &lt;a href="http://www.wabysabi.com/flex/enhancedbuttonskin/"&gt;Button Skin Explorer&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5266159055660135734?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5266159055660135734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/09/need-10-explorer-for-flex-developer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5266159055660135734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5266159055660135734'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/09/need-10-explorer-for-flex-developer.html' title='Need 10 Explorer for Flex Developer'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-4268218593079876420</id><published>2009-09-03T04:03:00.000-07:00</published><updated>2009-09-03T05:42:48.346-07:00</updated><title type='text'>Free transform tool using Rectangle class in Flex3</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;I had seen lot of sites are using the already existing free transform tool and i found the bug on free transform tool component during resize but it cannot be restrict when mouse goes out of the stage area of the flash application. But based on the project that i am currently working as i need to restrict the resize of the component within the working area. Then i decided to develop a own free transform tool with the options as move and resize the component with eight corners. Finally i did and finish the concept of create the free transform tool and using the Rectangle class only used for manage the resize and move the free transform tool. This free transform tool move with in the boundary area and restrict the size into minimum size as well. The code for the free transform tool that i try out as below. &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.core.UIComponent;&lt;br /&gt;//For Resize corner Tabs&lt;br /&gt;private var _leftTopSprite:Sprite;&lt;br /&gt;private var _leftMiddleSprite:Sprite;&lt;br /&gt;private var _leftBottomSprite:Sprite;&lt;br /&gt;private var _topMiddleSprite:Sprite;&lt;br /&gt;private var _bottomMiddleSprite:Sprite;&lt;br /&gt;private var _rightTopSprite:Sprite;&lt;br /&gt;private var _rightMiddleSprite:Sprite;&lt;br /&gt;private var _rightBottomSprite:Sprite;&lt;br /&gt;//For variables declarations&lt;br /&gt;private var _curTab:Sprite;&lt;br /&gt;private var _sprite:Sprite;&lt;br /&gt;private var _resizeWidth:Number;&lt;br /&gt;private var _resizeHeight:Number;&lt;br /&gt;private var _resizeStartX:Number;&lt;br /&gt;private var _resizeStartY:Number;&lt;br /&gt;private var _resizeHolder:Sprite;&lt;br /&gt;private var _spriteHolder:Sprite;&lt;br /&gt;private var _resizeRect:Rectangle;&lt;br /&gt;private var _isResizeTab:Boolean = false;&lt;br /&gt;private var _prevSprite:Sprite = null;&lt;br /&gt;private var _currentSprite:Sprite = null;&lt;br /&gt;private var _resizeInterface:UIComponent;&lt;br /&gt;private static const HOTSPOT_MIN_SIZE:uint = 45;&lt;br /&gt;private static const RESIZE_MAXIMUM_WIDTH:uint = 850;&lt;br /&gt;private static const RESIZE_MAXIMUM_HEIGHT:uint = 550;&lt;br /&gt;//For setup the Interface&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;_resizeInterface = new UIComponent();&lt;br /&gt;_spriteHolder = new Sprite();&lt;br /&gt;_spriteHolder.graphics.clear();&lt;br /&gt;_spriteHolder.graphics.beginFill(0xFFFFFF,1);&lt;br /&gt;_spriteHolder.graphics.drawRect(0,0,RESIZE_MAXIMUM_WIDTH,RESIZE_MAXIMUM_HEIGHT);&lt;br /&gt;_spriteHolder.graphics.endFill();&lt;br /&gt;_resizeInterface.addChild(_spriteHolder);&lt;br /&gt;_sprite = drawSprite();&lt;br /&gt;_sprite.name = "s1";&lt;br /&gt;_spriteHolder.addChild(_sprite);&lt;br /&gt;_sprite = drawSprite();&lt;br /&gt;_sprite.name = "s2";&lt;br /&gt;_spriteHolder.addChild(_sprite);&lt;br /&gt;_sprite.x = 250;&lt;br /&gt;_sprite.y = 50;&lt;br /&gt;addChild(_resizeInterface);&lt;br /&gt;_resizeInterface.x = 50;&lt;br /&gt;_resizeInterface.y = 50;&lt;br /&gt;}&lt;br /&gt;private function drawSprite():Sprite&lt;br /&gt;{&lt;br /&gt;var _sp:Sprite = new Sprite();&lt;br /&gt;_sp.graphics.clear();&lt;br /&gt;_sp.graphics.beginFill(0xFF0000,0.8);&lt;br /&gt;_sp.graphics.drawRect(0,0,200,200);&lt;br /&gt;_sp.graphics.endFill();&lt;br /&gt;_sp.cacheAsBitmap = false;&lt;br /&gt;_sp.focusRect = false;&lt;br /&gt;_sp.addEventListener(MouseEvent.MOUSE_DOWN,onSpriteDown);&lt;br /&gt;addEventListener(MouseEvent.MOUSE_MOVE,onMoveSprite);&lt;br /&gt;_sp.addEventListener(MouseEvent.MOUSE_UP,onStopSprite);&lt;br /&gt;return _sp;&lt;br /&gt;}&lt;br /&gt;private function onSpriteDown(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;var _dragRect:Rectangle;&lt;br /&gt;_prevSprite = _currentSprite;&lt;br /&gt;var spr:Sprite = evt.target as Sprite;&lt;br /&gt;_currentSprite = spr;&lt;br /&gt;_resizeRect = spr.getBounds(spr.parent);&lt;br /&gt;if(_prevSprite != null &amp;amp;&amp;amp; _resizeHolder &amp;amp;&amp;amp; _prevSprite.name != _currentSprite.name)&lt;br /&gt;{&lt;br /&gt;if(_resizeHolder)&lt;br /&gt;{&lt;br /&gt;_prevSprite.removeChild(_resizeHolder);&lt;br /&gt;_isResizeTab = false;&lt;br /&gt;_resizeHolder = null;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(_prevSprite != null &amp;amp;&amp;amp; _prevSprite.name == _currentSprite.name)&lt;br /&gt;{&lt;br /&gt;stage.focus = _currentSprite;&lt;br /&gt;}&lt;br /&gt;if(_resizeHolder == null &amp;amp;&amp;amp; !_isResizeTab)&lt;br /&gt;{&lt;br /&gt;//For draw black line around selected sprite&lt;br /&gt;_resizeHolder = new Sprite();&lt;br /&gt;_resizeHolder.graphics.clear();&lt;br /&gt;_resizeHolder.graphics.lineStyle(1,0x000000);&lt;br /&gt;_resizeHolder.graphics.drawRect(0,0,_resizeRect.width,_resizeRect.height);&lt;br /&gt;_resizeHolder.graphics.endFill();&lt;br /&gt;_resizeHolder.cacheAsBitmap = false;&lt;br /&gt;//Left side resize tab&lt;br /&gt;_leftTopSprite = drawResizeTab();&lt;br /&gt;_leftTopSprite.name = "LT";&lt;br /&gt;_resizeHolder.addChild(_leftTopSprite);&lt;br /&gt;_leftTopSprite.x = - 10;&lt;br /&gt;_leftTopSprite.y = - 10;&lt;br /&gt;_leftTopSprite.buttonMode = true;&lt;br /&gt;_leftMiddleSprite = drawResizeTab();&lt;br /&gt;_leftMiddleSprite.name = "LM";&lt;br /&gt;_resizeHolder.addChild(_leftMiddleSprite);&lt;br /&gt;_leftMiddleSprite.x = - 10;&lt;br /&gt;_leftMiddleSprite.y = (_resizeRect.height - _leftMiddleSprite.height)/2;&lt;br /&gt;_leftMiddleSprite.buttonMode = true;&lt;br /&gt;_leftBottomSprite = drawResizeTab();&lt;br /&gt;_leftBottomSprite.name = "LB";&lt;br /&gt;_resizeHolder.addChild(_leftBottomSprite);&lt;br /&gt;_leftBottomSprite.x = - 10;&lt;br /&gt;_leftBottomSprite.y = _resizeRect.height - 10;&lt;br /&gt;_leftBottomSprite.buttonMode = true;&lt;br /&gt;//-----------------------&lt;br /&gt;//Right side resize tab&lt;br /&gt;_rightTopSprite = drawResizeTab();&lt;br /&gt;_rightTopSprite.name = "RT";&lt;br /&gt;_resizeHolder.addChild(_rightTopSprite);&lt;br /&gt;_rightTopSprite.x = _resizeRect.width - 10;&lt;br /&gt;_rightTopSprite.y = - 10;&lt;br /&gt;_rightTopSprite.buttonMode = true;&lt;br /&gt;_rightMiddleSprite = drawResizeTab();&lt;br /&gt;_rightMiddleSprite.name = "RM";&lt;br /&gt;_resizeHolder.addChild(_rightMiddleSprite);&lt;br /&gt;_rightMiddleSprite.x = _resizeRect.width - 10;&lt;br /&gt;_rightMiddleSprite.y = (_resizeRect.height - _rightMiddleSprite.height)/2;&lt;br /&gt;_rightMiddleSprite.buttonMode = true;&lt;br /&gt;_rightBottomSprite = drawResizeTab();&lt;br /&gt;_rightBottomSprite.name = "RB";&lt;br /&gt;_resizeHolder.addChild(_rightBottomSprite);&lt;br /&gt;_rightBottomSprite.x = _resizeRect.width - 10;&lt;br /&gt;_rightBottomSprite.y = _resizeRect.height - 10;&lt;br /&gt;_rightBottomSprite.buttonMode = true;&lt;br /&gt;//---------------&lt;br /&gt;//Top middle resize tab&lt;br /&gt;_topMiddleSprite = drawResizeTab();&lt;br /&gt;_topMiddleSprite.name = "TM";&lt;br /&gt;_resizeHolder.addChild(_topMiddleSprite);&lt;br /&gt;_topMiddleSprite.x = (_resizeRect.width - _topMiddleSprite.width)/2;&lt;br /&gt;_topMiddleSprite.y = - 10;&lt;br /&gt;_topMiddleSprite.buttonMode = true;&lt;br /&gt;//---------------------&lt;br /&gt;//Bottom middle resize tab&lt;br /&gt;_bottomMiddleSprite = drawResizeTab();&lt;br /&gt;_bottomMiddleSprite.name = "BM";&lt;br /&gt;_resizeHolder.addChild(_bottomMiddleSprite);&lt;br /&gt;_bottomMiddleSprite.x = (_resizeRect.width - _bottomMiddleSprite.width)/2;&lt;br /&gt;_bottomMiddleSprite.y = _resizeRect.height - 10;&lt;br /&gt;_bottomMiddleSprite.buttonMode = true;&lt;br /&gt;//---------------------&lt;br /&gt;spr.addChild(_resizeHolder);&lt;br /&gt;}&lt;br /&gt;//For set the boundary for hotspot drag area&lt;br /&gt;_dragRect = _spriteHolder.getBounds(_spriteHolder.parent);&lt;br /&gt;_dragRect.width = (_dragRect.width - _resizeRect.width)+20;&lt;br /&gt;_dragRect.height = (_dragRect.height - _resizeRect.height)+20;&lt;br /&gt;_currentSprite.startDrag(false,_dragRect);&lt;br /&gt;}&lt;br /&gt;private function drawResizeTab():Sprite&lt;br /&gt;{&lt;br /&gt;var _tab:Sprite = new Sprite();&lt;br /&gt;_tab.graphics.clear();&lt;br /&gt;_tab.graphics.beginFill(0xFFCC00,0.8);&lt;br /&gt;_tab.graphics.drawRect(0,0,20,20);&lt;br /&gt;_tab.graphics.endFill();&lt;br /&gt;_tab.addEventListener(MouseEvent.MOUSE_DOWN,onResizeTabDown);&lt;br /&gt;stage.addEventListener(MouseEvent.MOUSE_UP,onResizeTabUp);&lt;br /&gt;return _tab;&lt;br /&gt;}&lt;br /&gt;private function onMoveSprite(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;evt.updateAfterEvent();&lt;br /&gt;}&lt;br /&gt;private function onStopSprite(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;_currentSprite.stopDrag();&lt;br /&gt;removeEventListener(MouseEvent.MOUSE_MOVE,onMoveSprite);&lt;br /&gt;_currentSprite.addEventListener(MouseEvent.MOUSE_DOWN,onSpriteDown);&lt;br /&gt;}&lt;br /&gt;private function onResizeTabDown(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;evt.stopImmediatePropagation();&lt;br /&gt;var _tab:Sprite = evt.target as Sprite;&lt;br /&gt;_curTab = _tab;&lt;br /&gt;_resizeStartX = _resizeRect.x;&lt;br /&gt;_resizeStartY = _resizeRect.y;&lt;br /&gt;_resizeWidth = _resizeRect.x+_resizeRect.width;&lt;br /&gt;_resizeHeight = _resizeRect.y+_resizeRect.height;&lt;br /&gt;_tab.startDrag();&lt;br /&gt;stage.addEventListener(MouseEvent.MOUSE_MOVE,onSpriteResize);&lt;br /&gt;stage.addEventListener(MouseEvent.MOUSE_UP,onStopDrag);&lt;br /&gt;}&lt;br /&gt;private function onStopDrag(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;_curTab.stopDrag();&lt;br /&gt;stage.removeEventListener(MouseEvent.MOUSE_MOVE,onSpriteResize);&lt;br /&gt;_currentSprite.addEventListener(MouseEvent.MOUSE_DOWN,onSpriteDown);&lt;br /&gt;}&lt;br /&gt;private function onSpriteResize(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;if(_curTab.name == "BM")&lt;br /&gt;{&lt;br /&gt;_resizeRect.bottom = Math.min(RESIZE_MAXIMUM_HEIGHT,_spriteHolder.mouseY);&lt;br /&gt;}&lt;br /&gt;if(_curTab.name == "TM")&lt;br /&gt;{&lt;br /&gt;_resizeRect.top = Math.max(0,_spriteHolder.mouseY);&lt;br /&gt;}&lt;br /&gt;if(_curTab.name == "RM")&lt;br /&gt;{&lt;br /&gt;_resizeRect.right = Math.min(RESIZE_MAXIMUM_WIDTH,_spriteHolder.mouseX);&lt;br /&gt;}&lt;br /&gt;if(_curTab.name == "LM")&lt;br /&gt;{&lt;br /&gt;_resizeRect.left = Math.max(0,_spriteHolder.mouseX);&lt;br /&gt;}&lt;br /&gt;if(_curTab.name == "LT")&lt;br /&gt;{&lt;br /&gt;_resizeRect.top = Math.max(0,_spriteHolder.mouseY);&lt;br /&gt;_resizeRect.left = Math.max(0,_spriteHolder.mouseX);&lt;br /&gt;}&lt;br /&gt;if(_curTab.name == "RT")&lt;br /&gt;{&lt;br /&gt;_resizeRect.top = Math.max(0,_spriteHolder.mouseY);&lt;br /&gt;_resizeRect.right = Math.min(RESIZE_MAXIMUM_WIDTH,_spriteHolder.mouseX);&lt;br /&gt;}&lt;br /&gt;if(_curTab.name == "RB")&lt;br /&gt;{&lt;br /&gt;_resizeRect.bottom = Math.min(RESIZE_MAXIMUM_HEIGHT,_spriteHolder.mouseY);&lt;br /&gt;_resizeRect.right = Math.min(RESIZE_MAXIMUM_WIDTH,_spriteHolder.mouseX);&lt;br /&gt;}&lt;br /&gt;if(_curTab.name == "LB")&lt;br /&gt;{&lt;br /&gt;_resizeRect.bottom = Math.min(RESIZE_MAXIMUM_HEIGHT,_spriteHolder.mouseY);&lt;br /&gt;_resizeRect.left = Math.max(0,_spriteHolder.mouseX);&lt;br /&gt;}&lt;br /&gt;if(_resizeRect.width &lt;= HOTSPOT_MIN_SIZE &amp;amp;&amp;amp; _resizeRect.height &lt;= HOTSPOT_MIN_SIZE) { &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.width = HOTSPOT_MIN_SIZE; &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.height = HOTSPOT_MIN_SIZE; &lt;/div&gt;&lt;div align="justify"&gt;if(_curTab.name == "LT") { &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.x = _resizeWidth - _resizeRect.width; &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.y = _resizeHeight - _resizeRect.height;&lt;/div&gt;&lt;div align="justify"&gt; }&lt;/div&gt;&lt;div align="justify"&gt; if(_curTab.name == "RT") { &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.x = _resizeStartX; &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.y = _resizeHeight - _resizeRect.height; &lt;/div&gt;&lt;div align="justify"&gt;} &lt;/div&gt;&lt;div align="justify"&gt;if(_curTab.name == "LB") { &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.x = _resizeWidth - _resizeRect.width; &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.y = _resizeStartY; &lt;/div&gt;&lt;div align="justify"&gt;} &lt;/div&gt;&lt;div align="justify"&gt;} &lt;/div&gt;&lt;div align="justify"&gt;else if(_resizeRect.width &lt;= HOTSPOT_MIN_SIZE &amp;amp;&amp;amp; _resizeRect.height &gt; HOTSPOT_MIN_SIZE)&lt;br /&gt;{&lt;br /&gt;_resizeRect.width = HOTSPOT_MIN_SIZE;&lt;br /&gt;if(_curTab.name == "LT" _curTab.name == "LM")&lt;br /&gt;_resizeRect.x = _resizeWidth - _resizeRect.width;&lt;br /&gt;if(_curTab.name == "RT")&lt;br /&gt;_resizeRect.x = _resizeStartX;&lt;br /&gt;if(_curTab.name == "LB")&lt;br /&gt;_resizeRect.x = _resizeWidth - _resizeRect.width;&lt;br /&gt;}&lt;br /&gt;else if(_resizeRect.width &gt; HOTSPOT_MIN_SIZE &amp;amp;&amp;amp; _resizeRect.height &lt;= HOTSPOT_MIN_SIZE) { &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.height = HOTSPOT_MIN_SIZE; &lt;/div&gt;&lt;div align="justify"&gt;if(_curTab.name == "LT" _curTab.name == "TM") &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.y = _resizeHeight - _resizeRect.height; &lt;/div&gt;&lt;div align="justify"&gt;if(_curTab.name == "RT") &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.y = _resizeHeight - _resizeRect.height; &lt;/div&gt;&lt;div align="justify"&gt;if(_curTab.name == "LB") &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect.y = _resizeStartY; &lt;/div&gt;&lt;div align="justify"&gt;} &lt;/div&gt;&lt;div align="justify"&gt;_currentSprite.graphics.clear(); &lt;/div&gt;&lt;div align="justify"&gt;_currentSprite.graphics.beginFill(0xFF0000,0.8); &lt;/div&gt;&lt;div align="justify"&gt;_currentSprite.graphics.drawRect(0,0,_resizeRect.width,_resizeRect.height); _currentSprite.graphics.endFill(); &lt;/div&gt;&lt;div align="justify"&gt;_currentSprite.x = _resizeRect.x; &lt;/div&gt;&lt;div align="justify"&gt;_currentSprite.y = _resizeRect.y; &lt;/div&gt;&lt;div align="justify"&gt;_resizeHolder.graphics.clear(); &lt;/div&gt;&lt;div align="justify"&gt;_resizeHolder.graphics.lineStyle(1,0x000000); &lt;/div&gt;&lt;div align="justify"&gt;_resizeHolder.graphics.drawRect(0,0,_resizeRect.width,_resizeRect.height); _resizeHolder.graphics.endFill(); &lt;/div&gt;&lt;div align="justify"&gt;updatePosition(_resizeRect);&lt;/div&gt;&lt;div align="justify"&gt;evt.updateAfterEvent(); &lt;/div&gt;&lt;div align="justify"&gt;} &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;private function updatePosition(_rect:Rectangle):void&lt;/div&gt;&lt;div align="justify"&gt; { &lt;/div&gt;&lt;div align="justify"&gt;_leftTopSprite.x = - 10; _leftTopSprite.y = - 10; &lt;/div&gt;&lt;div align="justify"&gt;_leftMiddleSprite.x = - 10; &lt;/div&gt;&lt;div align="justify"&gt;_leftMiddleSprite.y = (_rect.height - _leftMiddleSprite.height)/2; &lt;/div&gt;&lt;div align="justify"&gt;_leftBottomSprite.x = - 10; &lt;/div&gt;&lt;div align="justify"&gt;_leftBottomSprite.y = _rect.height - 10; &lt;/div&gt;&lt;div align="justify"&gt;_rightTopSprite.x = _rect.width - 10; &lt;/div&gt;&lt;div align="justify"&gt;_rightTopSprite.y = - 10; &lt;/div&gt;&lt;div align="justify"&gt;_rightMiddleSprite.x = _rect.width - 10; &lt;/div&gt;&lt;div align="justify"&gt;_rightMiddleSprite.y = (_rect.height - _rightMiddleSprite.height)/2; &lt;/div&gt;&lt;div align="justify"&gt;_rightBottomSprite.x = _rect.width - 10; &lt;/div&gt;&lt;div align="justify"&gt;_rightBottomSprite.y = _rect.height - 10; &lt;/div&gt;&lt;div align="justify"&gt;_topMiddleSprite.x = (_rect.width - _topMiddleSprite.width)/2; &lt;/div&gt;&lt;div align="justify"&gt;_topMiddleSprite.y = - 10; &lt;/div&gt;&lt;div align="justify"&gt;_bottomMiddleSprite.x = (_rect.width - _bottomMiddleSprite.width)/2; _bottomMiddleSprite.y = _rect.height - 10; &lt;/div&gt;&lt;div align="justify"&gt;} &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;private function onResizeTabUp(evt:MouseEvent):void&lt;/div&gt;&lt;div align="justify"&gt;{ &lt;/div&gt;&lt;div align="justify"&gt;var _tab:Sprite = evt.target as Sprite; _tab.stopDrag(); &lt;/div&gt;&lt;div align="justify"&gt;_currentSprite.removeChildAt(0); &lt;/div&gt;&lt;div align="justify"&gt;_resizeRect = _currentSprite.getBounds(_currentSprite.parent); &lt;/div&gt;&lt;div align="justify"&gt;_currentSprite.addChild(_resizeHolder); &lt;/div&gt;&lt;div align="justify"&gt;stage.removeEventListener(MouseEvent.MOUSE_MOVE,onSpriteResize); &lt;/div&gt;&lt;div align="justify"&gt;} &lt;/div&gt;&lt;div align="justify"&gt;]]&amp;gt; &amp;lt;/mx:Script&amp;gt;&lt;/div&gt;&lt;div align="justify"&gt;&amp;lt;/mx:Application&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-4268218593079876420?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/4268218593079876420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/09/free-transform-tool-using-rectangle.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4268218593079876420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4268218593079876420'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/09/free-transform-tool-using-rectangle.html' title='Free transform tool using Rectangle class in Flex3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5825488948034810725</id><published>2009-07-23T05:13:00.000-07:00</published><updated>2009-07-23T05:17:38.627-07:00</updated><title type='text'>Enable and Disable ContextMenu in Flex with AS3</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;  We can enable and disable the context menu option from the context menu. In below example is very easy way to enable and disable the context menu option based on the context menu selection. Lets see the below example and enjoy&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.managers.FocusManager;&lt;br /&gt;import mx.core.UIComponent;&lt;br /&gt;private var _spr:Sprite;&lt;br /&gt;private var _contextMenu:ContextMenu;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;var ui:UIComponent = new UIComponent();&lt;br /&gt;_spr = new Sprite();&lt;br /&gt;_spr.graphics.clear();&lt;br /&gt;_spr.graphics.beginFill(0xFF0000,0.8);&lt;br /&gt;_spr.graphics.drawRect(0,0,200,200);&lt;br /&gt;_spr.graphics.endFill();&lt;br /&gt;ui.addChild(_spr);&lt;br /&gt;_spr.x = 20;&lt;br /&gt;_spr.y = 20;&lt;br /&gt;addChild(ui);&lt;br /&gt;loadContextMenu();&lt;br /&gt;}&lt;br /&gt;private function loadContextMenu():void&lt;br /&gt;{&lt;br /&gt;_contextMenu = new ContextMenu();&lt;br /&gt;_contextMenu.hideBuiltInItems();&lt;br /&gt;var _selAll:ContextMenuItem = new ContextMenuItem("Select All Hotspot");&lt;br /&gt;var _deSelAll:ContextMenuItem = new ContextMenuItem("Deselect All Hotspot");&lt;br /&gt;var _delAll:ContextMenuItem = new ContextMenuItem("Delete All Hotspot");&lt;br /&gt;_contextMenu.customItems.push(_selAll);&lt;br /&gt;_contextMenu.customItems.push(_deSelAll);&lt;br /&gt;_contextMenu.customItems.push(_delAll);&lt;br /&gt;_contextMenu.customItems[1].enabled = false;&lt;br /&gt;_contextMenu.customItems[2].enabled = false;&lt;br /&gt;_selAll.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelect);&lt;br /&gt;_delAll.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelect);&lt;br /&gt;_deSelAll.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelect);&lt;br /&gt;_spr.contextMenu = _contextMenu;&lt;br /&gt;}&lt;br /&gt;private function menuItemSelect(evt:ContextMenuEvent):void&lt;br /&gt;{&lt;br /&gt;var _custMenu:ContextMenuItem = evt.target as ContextMenuItem;&lt;br /&gt;if(_custMenu.caption == "Select All Hotspot")&lt;br /&gt;{&lt;br /&gt;_contextMenu.customItems[0].enabled = false;&lt;br /&gt;_contextMenu.customItems[1].enabled = true;&lt;br /&gt;_contextMenu.customItems[2].enabled = true;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;_contextMenu.customItems[0].enabled = true;&lt;br /&gt;_contextMenu.customItems[1].enabled = false;&lt;br /&gt;_contextMenu.customItems[2].enabled = false;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5825488948034810725?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5825488948034810725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/enable-and-disable-contextmenu-in-flex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5825488948034810725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5825488948034810725'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/enable-and-disable-contextmenu-in-flex.html' title='Enable and Disable ContextMenu in Flex with AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-4741957193004867195</id><published>2009-07-23T05:07:00.000-07:00</published><updated>2009-07-23T05:24:05.895-07:00</updated><title type='text'>Navigate same or new window from Flex application</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;In some Flex application need to navigate into flex application into other application. Those navigation can performs into the same window or new window by using the navigateToURL function from flash.net.navigateToURL. The below example contains two button for navigate to same as well as new window.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import flash.net.navigateToURL;&lt;br /&gt;private function onNavigateNew():void&lt;br /&gt;{&lt;br /&gt;navigateToURL(new URLRequest("http://www.google.com"),"POST");&lt;br /&gt;}&lt;br /&gt;private function onNavigateSame():void&lt;br /&gt;{&lt;br /&gt;navigateToURL(new URLRequest("http://ww.yahoo.com"),"_self");&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="200" height="200" paddingLeft="20" paddingTop="20"&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="New Window" click="onNavigateNew()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="Same Window" click="onNavigateSame()"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-4741957193004867195?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/4741957193004867195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/navigate-window-from-flex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4741957193004867195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4741957193004867195'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/navigate-window-from-flex.html' title='Navigate same or new window from Flex application'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5682868059634196557</id><published>2009-07-20T03:49:00.000-07:00</published><updated>2009-07-20T04:11:52.885-07:00</updated><title type='text'>Set the content at center position when browser resize in Flex with AS3</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;In the below example i used the document class in Flex. i.e script class access from the external actionscript file. The content in the flex application can be set at center position dynamically when the browser resized. Document class the .mxml and .as file for the main application at the same location under the src folder. It can be placed in other location too. The stage will be accessed after the function call applicationCompleted. So you can set the stage related functionality after the applicationCompleted function then only it can be set the stage releated functions otherwise it should be null and its relevant functionality cannot be set. Just see the below example &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%"&lt;br /&gt;creationComplete="onInit()" applicationComplete="onAppComplete()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script source="TextWorks.as"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/div&gt;&lt;br/&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;In above example the script tag refer the actionscript class. The actionscript class contains the entire main application scripts. TextWorks actionscript class coding as follows&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;import flash.display.Sprite;&lt;br /&gt;import flash.events.Event;&lt;br /&gt;import mx.core.UIComponent;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;private var _spr:Sprite;&lt;br /&gt;private var _ui:UIComponent;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;_ui = new UIComponent();&lt;br /&gt;_spr = new Sprite();&lt;br /&gt;_spr.graphics.clear();&lt;br /&gt;_spr.graphics.beginFill(0xFF0000,0.8);&lt;br /&gt;_spr.graphics.drawRect(0,0,200,200);&lt;br /&gt;_spr.graphics.endFill();&lt;br /&gt;_ui.addChild(_spr);&lt;br /&gt;addChild(_ui);&lt;br /&gt;}&lt;br /&gt;private function onAppComplete():void&lt;br /&gt;{&lt;br /&gt;stage.addEventListener(Event.RESIZE,onResize);&lt;br /&gt;_spr.x = (stage.stageWidth - _spr.width)/2;&lt;br /&gt;_spr.y = (stage.stageHeight - _spr.height)/2;&lt;br /&gt;_ui.width = stage.stageWidth;&lt;br /&gt;_ui.height = stage.stageHeight;&lt;br /&gt;}&lt;br /&gt;private function onResize(evt:Event):void&lt;br /&gt;{&lt;br /&gt;_spr.x = (stage.stageWidth - _spr.width)/2;&lt;br /&gt;_spr.y = (stage.stageHeight - _spr.height)/2;&lt;br /&gt;_ui.width = stage.stageWidth;&lt;br /&gt;_ui.height = stage.stageHeight;&lt;br /&gt;}&lt;/div&gt;&lt;br/&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Run this application and see the sprite content will be placed at center position dynamically when the browser resize.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5682868059634196557?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5682868059634196557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/set-content-at-center-position-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5682868059634196557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5682868059634196557'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/set-content-at-center-position-when.html' title='Set the content at center position when browser resize in Flex with AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-430235065806476285</id><published>2009-07-20T03:39:00.000-07:00</published><updated>2009-07-20T03:47:05.202-07:00</updated><title type='text'>Call Javascript function from Flex application</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;We can call the javascript function from Flex application to perform any specific activity that can be perfromed by the server. You can call the javascript function with parameters or without any parameter when function call. The parameters for the javascript function was separated by commas. The ExternalInterface class was used to call the javascript function from the flex application. The syntax for calling the javascript function as follows&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;ExternalInterface.call("Function Name","[parameters]");&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-430235065806476285?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/430235065806476285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/call-javascript-from-flex-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/430235065806476285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/430235065806476285'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/call-javascript-from-flex-application.html' title='Call Javascript function from Flex application'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-3265569225093396506</id><published>2009-07-13T01:44:00.000-07:00</published><updated>2009-07-13T01:54:47.061-07:00</updated><title type='text'>Save text file and jpeg image in Adobe Air</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt; In below example for save the text files and image files in Adobe Air. Adobe Air was easily interact with the system local files. In this example i saved the text file as well as image files and it has the format as .jpg. When need to save the text file first it check whether the file are exit or not. If the file cannot be found means then the text file content saved as a new file. This below example save the files using the File Stream class. Try the below example was very nice and intresting one.&lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.graphics.codec.PNGEncoder;&lt;br /&gt;import flash.filesystem.*;&lt;br /&gt;private var _stream:FileStream;&lt;br /&gt;private function saveFile():void&lt;br /&gt;{&lt;br /&gt;var file:File = File.desktopDirectory.resolvePath("Test.txt");&lt;br /&gt;_stream = new FileStream();&lt;br /&gt;_stream.open(file,FileMode.WRITE);&lt;br /&gt;_stream.writeUTFBytes(txt_area.text);&lt;br /&gt;_stream.close();&lt;br /&gt;}&lt;br /&gt;private function saveImage():void&lt;br /&gt;{&lt;br /&gt;var file:File = File.desktopDirectory.resolvePath("test.jpg");&lt;br /&gt;_stream = new FileStream();&lt;br /&gt;_stream.open(file,FileMode.WRITE);&lt;br /&gt;var _enc:PNGEncoder = new PNGEncoder();&lt;br /&gt;var _bitmap:BitmapData = new BitmapData(img.width,img.height,true);&lt;br /&gt;_bitmap.draw(img,new Matrix());&lt;br /&gt;var bytes:ByteArray = _enc.encode(_bitmap);&lt;br /&gt;_stream.writeBytes(bytes);&lt;br /&gt;_stream.close();&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox paddingTop="15" paddingLeft="15" paddingRight="15" paddingBottom="15"&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:Label text="About Yourself:"/&amp;gt;&lt;br /&gt;&amp;lt;mx:TextArea id="txt_area" width="250" height="125"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox width="100%" horizontalAlign="center"&amp;gt;&lt;br /&gt;&amp;lt;mx:Image id="img" source="Test.jpg" width="200" height="150" horizontalAlign="center"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="Save" click="saveFile()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="Save Image" click="saveImage()"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:WindowedApplication&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-3265569225093396506?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/3265569225093396506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/save-textfile-and-jpeg-image-in-adobe.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/3265569225093396506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/3265569225093396506'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/save-textfile-and-jpeg-image-in-adobe.html' title='Save text file and jpeg image in Adobe Air'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5458754034712736245</id><published>2009-07-08T23:48:00.000-07:00</published><updated>2009-07-13T01:38:48.424-07:00</updated><title type='text'>Resize Sprite using the bottom resize tab in Flex</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;  The below example for resize the sprite using the resize tab at the bottomright position. By using the tab button to resize the sprite as width and height and it cannot be allow to change the postion of x and y.Try the below example it very nice one for resize the sprite based on resize tab move position and updates its width and height.  &lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.core.UIComponent;&lt;br /&gt;private var _spr:Sprite;&lt;br /&gt;private var _rect:Rectangle;&lt;br /&gt;private var _resizeTab:Sprite;&lt;br /&gt;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;var ui:UIComponent = new UIComponent();&lt;br /&gt;_spr = new Sprite();&lt;br /&gt;_spr.graphics.clear();&lt;br /&gt;_spr.graphics.beginFill(0xFF0000,0.5);&lt;br /&gt;_spr.graphics.drawRect(0,0,200,200);&lt;br /&gt;_spr.graphics.endFill();&lt;br /&gt;ui.addChild(_spr);&lt;br /&gt;addChild(ui);&lt;br /&gt;ui.x = 50;&lt;br /&gt;ui.y = 20;&lt;br /&gt;&lt;br /&gt;_spr.addEventListener(MouseEvent.MOUSE_DOWN,onStartResize);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onStartResize(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;var _rect:Rectangle = _spr.getBounds(_spr.parent);&lt;br /&gt;if(!_resizeTab)&lt;br /&gt;{&lt;br /&gt;_resizeTab = new Sprite();&lt;br /&gt;_resizeTab.graphics.clear();&lt;br /&gt;_resizeTab.graphics.beginFill(0x0000FF,0.8);&lt;br /&gt;_resizeTab.graphics.drawRect(0,0,20,20);&lt;br /&gt;_resizeTab.graphics.endFill();&lt;br /&gt;&lt;br /&gt;_resizeTab.x = _rect.width - 10;&lt;br /&gt;_resizeTab.y = _rect.height - 10;&lt;br /&gt;&lt;br /&gt;_spr.addChild(_resizeTab);&lt;br /&gt;_resizeTab.cacheAsBitmap = false;&lt;br /&gt;_resizeTab.addEventListener(MouseEvent.MOUSE_DOWN,onResizeDown);&lt;br /&gt;_resizeTab.addEventListener(MouseEvent.MOUSE_UP,onResizeUp);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onResizeDown(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;var _sp:Sprite = evt.target.parent as Sprite;&lt;br /&gt;_rect = _sp.getBounds(_sp.parent);&lt;br /&gt;_resizeTab.startDrag();&lt;br /&gt;addEventListener(MouseEvent.MOUSE_MOVE,onMove);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onMove(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;var _sp:Sprite = _resizeTab.parent as Sprite;&lt;br /&gt;_rect.bottomRight = new Point(_sp.mouseX,_sp.mouseY);&lt;br /&gt;_sp.graphics.clear();&lt;br /&gt;_sp.graphics.beginFill(0xFF0000,0.4);&lt;br /&gt;_sp.graphics.drawRect(0,0,_rect.width,_rect.height);&lt;br /&gt;_sp.graphics.endFill();&lt;br /&gt;&lt;br /&gt;var summa:Rectangle = _resizeTab.getBounds(_resizeTab.parent);&lt;br /&gt;_resizeTab.x = _rect.width - (summa.width/2);&lt;br /&gt;_resizeTab.y = _rect.height - (summa.height/2);&lt;br /&gt;evt.updateAfterEvent();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onResizeUp(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;removeEventListener(MouseEvent.MOUSE_MOVE,onMove);&lt;br /&gt;_resizeTab.stopDrag();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5458754034712736245?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5458754034712736245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/resize-sprite-using-bottom-resize-tab.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5458754034712736245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5458754034712736245'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/resize-sprite-using-bottom-resize-tab.html' title='Resize Sprite using the bottom resize tab in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-918930332435118221</id><published>2009-07-08T23:39:00.000-07:00</published><updated>2009-07-13T01:43:29.494-07:00</updated><title type='text'>Load swf content into the Sprite in AS3</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;In some of the post has mention as cannot possible to load the swf content inside the Sprite using the Loader class in AS3. But i try to load the swf content into the sprite using the Loader class. In this below example to load the loader directly instead of adding the child as loader.content. If you are try to load the child as loader.content means it throws an error as AVM1 object voliation for load the AVM2 oject into AVM1 Object. So you can add the child of sprite as loader it can possible to load the swf content and you can work over that. &lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.core.UIComponent;&lt;br /&gt;import flash.events.KeyboardEvent;&lt;br /&gt;import mx.controls.SWFLoader;&lt;br /&gt;&lt;br /&gt;private var ui:UIComponent;&lt;br /&gt;private var _spr:Sprite;&lt;br /&gt;private var loader:Loader;&lt;br /&gt;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;ui = new UIComponent();&lt;br /&gt;_spr = new Sprite();&lt;br /&gt;ui.addChild(_spr);&lt;br /&gt;addChild(ui);&lt;br /&gt;&lt;br /&gt;loader = new Loader();&lt;br /&gt;loader.load(new URLRequest("test.swf"));&lt;br /&gt;loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onLoadComplete(e:Event):void&lt;br /&gt;{&lt;br /&gt;_spr.addChild(loader);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-918930332435118221?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/918930332435118221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/load-swf-content-into-sprite-in-as3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/918930332435118221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/918930332435118221'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/load-swf-content-into-sprite-in-as3.html' title='Load swf content into the Sprite in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5260665199040104973</id><published>2009-07-08T23:30:00.000-07:00</published><updated>2009-07-13T01:41:50.483-07:00</updated><title type='text'>Simple Slideshow with Fade Effect</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;In some of the slide show applications slide transition will be performed before the second image loaded. So the slide show application has blank screen without any images on screen after loading the second image then it start showing the image with effect. In below example avoid the blank screen and it will check whether the second image was loaded or not. If loaded the image it start the transition otherwise it remains on the first image to avoid the blank screen. In below example has avoid the blank screen and apply smooth fade effect when transistions.&lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.effects.Fade;&lt;br /&gt;import mx.controls.Button;&lt;br /&gt;import mx.containers.HBox;&lt;br /&gt;import mx.controls.ProgressBar;&lt;br /&gt;import mx.core.UIComponent;&lt;br /&gt;&lt;br /&gt;private var image_container:UIComponent;&lt;br /&gt;private var first_mc:Sprite;&lt;br /&gt;private var second_mc:Sprite;&lt;br /&gt;private var load_mc:Sprite;&lt;br /&gt;private var _selectedIndex:Number=0;&lt;br /&gt;private var timer:Timer;&lt;br /&gt;private var _imgArray:Array = ["http://www.digitalphotoartistry.com/rose1.jpg","http://blogs.warwick.ac.uk/images/spjyoung/2006/02/20/rose.jpg","http://www.mccullagh.org/db9/1ds2-2/rose-side-view.jpg"];&lt;br /&gt;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;image_container = new UIComponent();&lt;br /&gt;first_mc = new Sprite();&lt;br /&gt;image_container.addChild(first_mc);&lt;br /&gt;second_mc = new Sprite();&lt;br /&gt;image_container.addChild(second_mc);&lt;br /&gt;addChild(image_container);&lt;br /&gt;&lt;br /&gt;image_container.width = 400;&lt;br /&gt;image_container.height = 400;&lt;br /&gt;image_container.x = 20;&lt;br /&gt;image_container.y = 20;&lt;br /&gt;&lt;br /&gt;load_mc = first_mc;&lt;br /&gt;loadImage();&lt;br /&gt;startTimer();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function startTimer():void&lt;br /&gt;{&lt;br /&gt;timer = new Timer(5000);&lt;br /&gt;timer.addEventListener(TimerEvent.TIMER,loadImges);&lt;br /&gt;timer.start();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function loadImges(evt:TimerEvent):void&lt;br /&gt;{&lt;br /&gt;if(_selectedIndex &gt;= _imgArray.length-1)&lt;br /&gt;{&lt;br /&gt;_selectedIndex = -1;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;_selectedIndex++;&lt;br /&gt;loadImage();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function loadImage():void&lt;br /&gt;{&lt;br /&gt;var urlLoader:Loader = new Loader();&lt;br /&gt;var urlRequest:URLRequest =new URLRequest(_imgArray[_selectedIndex]);&lt;br /&gt;urlLoader.contentLoaderInfo.addEventListener(Event.OPEN,onImageOpen);&lt;br /&gt;urlLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageLoaded);&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;urlLoader.load(urlRequest);&lt;br /&gt;}&lt;br /&gt;catch(err:Error)&lt;br /&gt;{&lt;br /&gt;trace("Error");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onImageOpen(evt:Event):void&lt;br /&gt;{&lt;br /&gt;if(first_mc.numChildren &gt; 0)&lt;br /&gt;first_mc.removeChildAt(0);&lt;br /&gt;if(second_mc.numChildren &gt; 0)&lt;br /&gt;second_mc.removeChildAt(0);&lt;br /&gt;&lt;br /&gt;var num:Number = switchNumber(_selectedIndex);&lt;br /&gt;if(num == 1)&lt;br /&gt;{&lt;br /&gt;load_mc = first_mc;&lt;br /&gt;fadeOutImage(second_mc);&lt;br /&gt;fadeInImage(first_mc);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;load_mc = second_mc;&lt;br /&gt;fadeOutImage(first_mc);&lt;br /&gt;fadeInImage(second_mc);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onImageLoaded(evt:Event):void&lt;br /&gt;{&lt;br /&gt;load_mc.addChild(evt.target.content);&lt;br /&gt;load_mc.width = 380;&lt;br /&gt;load_mc.height = 300;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function switchNumber(num:Number):Number&lt;br /&gt;{&lt;br /&gt;var ind:Number = num%2;&lt;br /&gt;return (ind == 0)?1:2;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function fadeInImage(target:Sprite):void&lt;br /&gt;{&lt;br /&gt;var _fadeIn:Fade = new Fade(target);&lt;br /&gt;_fadeIn.alphaFrom = 0;&lt;br /&gt;_fadeIn.alphaTo = 1;&lt;br /&gt;_fadeIn.duration = 400;&lt;br /&gt;_fadeIn.play();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function fadeOutImage(target:Sprite):void&lt;br /&gt;{&lt;br /&gt;var _fadeOut:Fade = new Fade(target);&lt;br /&gt;_fadeOut.alphaFrom = 1;&lt;br /&gt;_fadeOut.alphaTo = 0;&lt;br /&gt;_fadeOut.duration = 400;&lt;br /&gt;_fadeOut.play();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5260665199040104973?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5260665199040104973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/simple-slideshow-with-fade-effect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5260665199040104973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5260665199040104973'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/simple-slideshow-with-fade-effect.html' title='Simple Slideshow with Fade Effect'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-8283217121552573873</id><published>2009-07-08T23:13:00.000-07:00</published><updated>2009-07-13T00:57:38.581-07:00</updated><title type='text'>Working with local system files in Flex3.2 SDK and FlashPlayer10</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;  In below example for accessing the local system xml files and read the xml content and set the input to the List control. The seelcted xml content as shown in Textarea control also. Whenever click the image from the List control its relevant image is shown. It must need the Flex sdk3.2 and Flash player10 then only access the function of the Flash player10 as load() and save() otherwise in the below example cannot be work.&lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.managers.PopUpManager;&lt;br /&gt;import flash.net.FileReference;&lt;br /&gt;import flash.utils.ByteArray;&lt;br /&gt;&lt;br /&gt;private var _fileBrowse:FileReference;&lt;br /&gt;private var _imgStr:String;&lt;br /&gt;private var _listProvider:Array;&lt;br /&gt;&lt;br /&gt;private function onClick():void&lt;br /&gt;{&lt;br /&gt;_fileBrowse = new FileReference();&lt;br /&gt;_fileBrowse.addEventListener(Event.CANCEL,onCancel);&lt;br /&gt;_fileBrowse.addEventListener(Event.SELECT,onFileSelect);&lt;br /&gt;_fileBrowse.browse();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onCancel(evt:Event):void&lt;br /&gt;{&lt;br /&gt;_fileBrowse = null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onFileSelect(evt:Event):void&lt;br /&gt;{&lt;br /&gt;_fileBrowse.addEventListener(Event.COMPLETE,onComplete);&lt;br /&gt;_fileBrowse.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);&lt;br /&gt;_fileBrowse.load();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onComplete(evt:Event):void&lt;br /&gt;{&lt;br /&gt;var _data:ByteArray = _fileBrowse.data;&lt;br /&gt;txt_area.text = _data.readUTFBytes(_data.bytesAvailable);&lt;br /&gt;_imgStr = txt_area.text;&lt;br /&gt;_fileBrowse = null;&lt;br /&gt;loadXML();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function ioErrorHandler(evt:IOErrorEvent):void&lt;br /&gt;{&lt;br /&gt;trace("Io Error");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function loadXML():void&lt;br /&gt;{&lt;br /&gt;var _xml:XML;&lt;br /&gt;_listProvider = new Array();&lt;br /&gt;&lt;br /&gt;if(_imgStr != "")&lt;br /&gt;{&lt;br /&gt;_xml = new XML(_imgStr);&lt;br /&gt;var _xmlList:XMLList = XMLList(_xml.image);&lt;br /&gt;for(var i:int=0;i&lt;_xmlList.length();i++)&lt;br /&gt;{&lt;br /&gt;_listProvider.push({label:_xmlList[i].@name,path:_xmlList[i].@path});&lt;br /&gt;}&lt;br /&gt;lst.dataProvider = _listProvider;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onItemClick():void&lt;br /&gt;{&lt;br /&gt;img.source = lst.selectedItem.path;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox paddingLeft="20" paddingTop="20"&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:TextArea id="txt_area" width="400" height="200"/&amp;gt;&lt;br /&gt;&amp;lt;mx:List id="lst" width="400" height="120" itemClick="onItemClick()"/&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="open" click="onClick()"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:Image id="img" width="400" height="400"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;br /&gt;The example xml as follows&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;images&amp;gt;&lt;br /&gt;&amp;lt;image name="image1" path="http://www.digitalphotoartistry.com/rose1.jpg"/&amp;gt;&lt;br /&gt;&amp;lt;image name="image2" path="http://blogs.warwick.ac.uk/images/spjyoung/2006/02/20/rose.jpg"/&amp;gt;&lt;br /&gt;&amp;lt;image name="image3" path="http://www.mccullagh.org/db9/1ds2-2/rose-side-view.jpg"/&amp;gt;&lt;br /&gt;&amp;lt;/images&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-8283217121552573873?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/8283217121552573873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/working-with-local-system-files-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8283217121552573873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8283217121552573873'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/working-with-local-system-files-in.html' title='Working with local system files in Flex3.2 SDK and FlashPlayer10'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-5171052998468060485</id><published>2009-07-08T23:08:00.000-07:00</published><updated>2009-07-13T01:39:58.092-07:00</updated><title type='text'>Hightlight the selection of Sprite in Flex</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;In Sprite highlighted by using the graphics for change the color selection. The getBounds() function was used to get the boundary area of the sprite based on that we can draw the graphics again with different selection color. After complete the graphics draw then placed the sprite by its position of x and y. Whenever need to change the color selection we must need redraw the sprite using the graphics. In the folowing example very nice one for selecting or highlighted the sprite based on mouse down event.&lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.core.UIComponent;&lt;br /&gt;&lt;br /&gt;private var _spr:Sprite;&lt;br /&gt;private var _curSpr:Sprite;&lt;br /&gt;private var _prevSpr:Sprite;&lt;br /&gt;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;var ui:UIComponent = new UIComponent();&lt;br /&gt;_spr = new Sprite();&lt;br /&gt;_spr.graphics.clear();&lt;br /&gt;_spr.graphics.beginFill(0xFF0000);&lt;br /&gt;_spr.graphics.drawRect(0,0,200,200);&lt;br /&gt;_spr.graphics.endFill();&lt;br /&gt;_spr.addEventListener(MouseEvent.MOUSE_DOWN,onSelect);&lt;br /&gt;_spr.x = 20;&lt;br /&gt;_spr.y = 30;&lt;br /&gt;ui.addChild(_spr);&lt;br /&gt;&lt;br /&gt;_spr = new Sprite();&lt;br /&gt;_spr.graphics.clear();&lt;br /&gt;_spr.graphics.beginFill(0xFF0000);&lt;br /&gt;_spr.graphics.drawRect(0,0,200,200);&lt;br /&gt;_spr.graphics.endFill();&lt;br /&gt;_spr.addEventListener(MouseEvent.MOUSE_DOWN,onSelect);&lt;br /&gt;ui.addChild(_spr);&lt;br /&gt;_spr.x = 230;&lt;br /&gt;_spr.y = 25;&lt;br /&gt;&lt;br /&gt;addChild(ui);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onSelect(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;_prevSpr = _curSpr;&lt;br /&gt;if(_prevSpr != null)&lt;br /&gt;setSelect(_prevSpr,0xFF0000);&lt;br /&gt;_curSpr = evt.target as Sprite;&lt;br /&gt;setSelect(_curSpr,0x00FF00);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function setSelect(spr:Sprite,color:uint):void&lt;br /&gt;{&lt;br /&gt;var rect:Rectangle = spr.getBounds(spr.parent);&lt;br /&gt;&lt;br /&gt;spr.graphics.clear();&lt;br /&gt;spr.graphics.beginFill(color);&lt;br /&gt;spr.graphics.drawRect(0,0,rect.width,rect.height);&lt;br /&gt;spr.graphics.endFill();&lt;br /&gt;&lt;br /&gt;spr.x = rect.x;&lt;br /&gt;spr.y = rect.y;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-5171052998468060485?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/5171052998468060485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/hightlight-selection-of-sprite-in-flex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5171052998468060485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/5171052998468060485'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/hightlight-selection-of-sprite-in-flex.html' title='Hightlight the selection of Sprite in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-2379688369222786265</id><published>2009-07-08T23:05:00.000-07:00</published><updated>2009-07-13T00:44:40.984-07:00</updated><title type='text'>Refresh Flex page using Javascript function in AS3</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;   In Flex once the values get updated we need to refresh the felx content dynamically. Here i did one example for refresh the flex page by calling the javascript function when click the button in flex application. Its very simple way to refresh the flex page whenever you wants by using the following javascript function calls.&lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import flash.net.navigateToURL;&lt;br /&gt;private function onRefresh():void&lt;br /&gt;{&lt;br /&gt;var ref:URLRequest = new URLRequest("javascript:location.reload(true)");&lt;br /&gt;navigateToURL(ref,"_self");&lt;br /&gt;}&lt;br /&gt;]]&gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:Button label="Refresh" click="onRefresh()"/&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-2379688369222786265?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/2379688369222786265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/refresh-flex-page-when-button-click.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2379688369222786265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2379688369222786265'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/refresh-flex-page-when-button-click.html' title='Refresh Flex page using Javascript function in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-4330128667819644205</id><published>2009-07-08T23:04:00.000-07:00</published><updated>2009-07-13T00:35:43.476-07:00</updated><title type='text'>Drag the Sprite using the Shift Key and Mouse Down event in AS3</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;  This following example for drag the sprite when holding the shift key in the Keyboard. The Shify key was released then the sprite cannot be moved furtur and it stop drag into the selected dragged area. The selected sprite should be focus then only it can work the functionality of the keyboard and check whether pressed the shift key or not. The Display object cannot be focus use the code as stage.focus property as currently selected Display object. This property helps to focus the current Display object selection and then drag the sprite based on Shift Key was pressed.&lt;/div&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="onKeySet()" creationComplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;import mx.core.UIComponent;&lt;br /&gt;private var _spr:Sprite;&lt;br /&gt;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;var ui:UIComponent = new UIComponent();&lt;br /&gt;_spr = new Sprite();&lt;br /&gt;_spr.graphics.clear();&lt;br /&gt;_spr.graphics.beginFill(0xFF0000,0.7);&lt;br /&gt;_spr.graphics.drawRect(0,0,500,500);&lt;br /&gt;_spr.graphics.endFill();&lt;br /&gt;ui.addChild(_spr);&lt;br /&gt;addChild(ui);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onKeySet():void&lt;br /&gt;{&lt;br /&gt;stage.addEventListener(KeyboardEvent.KEY_DOWN,onKeyDown);&lt;br /&gt;stage.addEventListener(KeyboardEvent.KEY_UP,onKeyUp);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onKeyDown(evt:KeyboardEvent):void&lt;br /&gt;{&lt;br /&gt;stage.focus = _spr;&lt;br /&gt;_spr.focusRect = false;&lt;br /&gt;if(evt.keyCode == 16)&lt;br /&gt;{&lt;br /&gt;_spr.addEventListener(MouseEvent.MOUSE_DOWN,onDownSprite);&lt;br /&gt;_spr.addEventListener(MouseEvent.MOUSE_UP,onUpSprite);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onKeyUp(evt:KeyboardEvent):void&lt;br /&gt;{&lt;br /&gt;if(evt.keyCode == 16)&lt;br /&gt;{&lt;br /&gt;_spr.removeEventListener(MouseEvent.MOUSE_DOWN,onDownSprite);&lt;br /&gt;_spr.removeEventListener(MouseEvent.MOUSE_UP,onUpSprite);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onDownSprite(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;_spr.addEventListener(MouseEvent.MOUSE_MOVE,onMoveSprite);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onMoveSprite(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;_spr.startDrag();&lt;br /&gt;evt.updateAfterEvent();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onUpSprite(evt:MouseEvent):void&lt;br /&gt;{&lt;br /&gt;_spr.stopDrag();&lt;br /&gt;_spr.removeEventListener(MouseEvent.MOUSE_MOVE,onMoveSprite);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-4330128667819644205?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/4330128667819644205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/shift-key-used-for-move-sprite.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4330128667819644205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/4330128667819644205'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/shift-key-used-for-move-sprite.html' title='Drag the Sprite using the Shift Key and Mouse Down event in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-9052412320583360651</id><published>2009-07-08T22:57:00.001-07:00</published><updated>2009-07-13T00:29:06.420-07:00</updated><title type='text'>Swap two xml nodes in XML</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;The following example explain about the swapping two nodes based on the node index value.The newly updated the swap xml is maintained in the main XML. The swap XML was considered as a new xml then only it should be swap properly in XML otherwise it cannot perfefectly swap and reflect the changes to the XML.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:application mx="http://www.adobe.com/2006/mxml" layout="absolute" creationcomplete="onInit()"&amp;gt;&lt;br /&gt;&amp;lt;mx:script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;private var _initXML:XML;&lt;br /&gt;private var _xmlList:XMLList;&lt;br /&gt;&lt;br /&gt;private function onInit():void&lt;br /&gt;{&lt;br /&gt;_initXML = XML("&lt;food&gt;&lt;fruits&gt;&lt;fruit name="'Apple'/"&gt;&lt;fruit name="'Orange'/"&gt;&lt;fruit name="'Grapes'/"&gt;&lt;fruit name="'Lemon'/"&gt;&lt;fruit name="'Mangoes'/"&gt;&lt;/fruits&gt;&lt;/food&gt;");&lt;br /&gt;_xmlList = XMLList(_initXML.Fruits.fruit);&lt;br /&gt;txt_area.text = _initXML.toXMLString();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onButtonClick():void&lt;br /&gt;{&lt;br /&gt;txt_area.text = swapXML(int(txt_old.text),int(txt_new.text));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function swapXML(ind1:int,ind2:int):XML&lt;br /&gt;{&lt;br /&gt;var xml1:XML = new XML(_xmlList[ind1]);&lt;br /&gt;var xml2:XML = new XML(_xmlList[ind2]);&lt;br /&gt;_xmlList[ind1] = xml2;&lt;br /&gt;_xmlList[ind2] = xml1;&lt;br /&gt;return _initXML;&lt;br /&gt;}&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:vbox paddingtop="10" paddingleft="10"&amp;gt;&lt;br /&gt;&amp;lt;mx:textarea id="txt_area" width="450" height="300"&amp;gt;&lt;br /&gt;&amp;lt;mx:hbox&amp;gt;&lt;br /&gt;&amp;lt;mx:text text="Old Depth:" width="100"&amp;gt;&lt;br /&gt;&amp;lt;mx:textinput id="txt_old" width="100"&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:hbox&amp;gt;&lt;br /&gt;&amp;lt;mx:text text="New Depth:" width="100"&amp;gt;&lt;br /&gt;&amp;lt;mx:textinput id="txt_new" width="100"&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;mx:hbox paddingleft="30"&amp;gt;&lt;br /&gt;&amp;lt;mx:button label="Change" click="onButtonClick()"&amp;gt;&lt;br /&gt;&amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-9052412320583360651?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/9052412320583360651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/swap-two-xml-nodes-in-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/9052412320583360651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/9052412320583360651'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/swap-two-xml-nodes-in-xml.html' title='Swap two xml nodes in XML'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-3186287427906031582</id><published>2009-07-08T00:31:00.000-07:00</published><updated>2009-07-08T22:49:43.468-07:00</updated><title type='text'>MouseMove problem in AS3</title><content type='html'>Hi,&lt;br /&gt;&lt;div style="text-align: justify;"&gt;   In Actionscript3 Mousemove  events assigned to the display objects it can be fired gradually when the mouse will be focused on the display object assigned to which it was assigned. When mouse goes off or outside of the display objects it stop firing the mousemove event. If you drag a display object using the mousemove event to stop functioning the mousemove event if you move the mouse too fast preventing the display object being dragged until the mouse is back over the display object.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-3186287427906031582?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/3186287427906031582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/mousemove-problem-in-as3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/3186287427906031582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/3186287427906031582'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/mousemove-problem-in-as3.html' title='MouseMove problem in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-1426292185350276801</id><published>2009-07-08T00:18:00.000-07:00</published><updated>2009-07-08T00:31:17.840-07:00</updated><title type='text'>Problem in accessing Webservice when send xml as input to Webservice class in AS3</title><content type='html'>Hi,&lt;br /&gt;&lt;div style="text-align: justify;"&gt;     I faced the problem when send the xml value as the input to the webservice class. I use e4x format for access the webservice. When xml as send as the input to the webservice class it cannot call the webservice class and report as warning message. Then i set the xmlSpecialCharsFilter function for the web service class and its change the value of object type to string value type and then send the value. After it call the webservice class successfully and return the result from the webservice class. The following way i can use to solve the problem for not accessing the webservice&lt;br /&gt;&lt;br /&gt; var webService:WebService = new WebService();&lt;br /&gt;  webService.xmlSpecialCharsFilter = filterVal;&lt;br /&gt;&lt;br /&gt;  The xmlSpecialCharsFilter as function it will filter the special characters and change the  object type values to string values. The filterVal function definition as follows&lt;br /&gt;&lt;br /&gt;private function filterVal(val:Object):String&lt;br /&gt;{&lt;br /&gt;        return val.toString();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-1426292185350276801?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/1426292185350276801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/07/problem-in-accessing-webservice-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/1426292185350276801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/1426292185350276801'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/07/problem-in-accessing-webservice-when.html' title='Problem in accessing Webservice when send xml as input to Webservice class in AS3'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-8248839191372863615</id><published>2009-06-29T10:23:00.000-07:00</published><updated>2009-06-29T10:28:41.804-07:00</updated><title type='text'>Dynamically draw ploygon in Flex</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;   In below example is very nice one for dynamically add the polygon based on the mouse click and it allows only for four sides. The below example code fully written in action script. &lt;/div&gt;&lt;br /&gt;                  private var drawPanel:Sprite;&lt;br /&gt;                  private var numSpot:Number = 0;&lt;br /&gt;                  private var line:Shape;&lt;br /&gt;                  private var _lineArr:Array;&lt;br /&gt;                  private function onDrawTriangle():void&lt;br /&gt;                  {&lt;br /&gt;                        var ui:UIComponent = new UIComponent();&lt;br /&gt;                        drawPanel = new Sprite();&lt;br /&gt;                        drawPanel.graphics.clear();&lt;br /&gt;                        drawPanel.graphics.lineStyle(2, 0xFF0000);&lt;br /&gt;                        drawPanel.graphics.beginFill(0xDEFACE);&lt;br /&gt;                        drawPanel.graphics.drawRect(0,0,300,300);&lt;br /&gt;                        drawPanel.graphics.endFill();&lt;br /&gt;                        ui.addChild(drawPanel);&lt;br /&gt;                        addChild(ui);&lt;br /&gt;                        ui.x = 20;&lt;br /&gt;                        ui.y = 20;&lt;br /&gt;                       &lt;br /&gt;                        _lineArr = new Array();&lt;br /&gt;                        line = new Shape();&lt;br /&gt;                        drawPanel.addEventListener(MouseEvent.CLICK,onAddPoint);&lt;br /&gt;                  }&lt;br /&gt;                 &lt;br /&gt;                  private function onAddPoint(evt:MouseEvent):void&lt;br /&gt;                  {&lt;br /&gt;                        if(numSpot &lt;= 4)&lt;br /&gt;                        {&lt;br /&gt;                              var point:Sprite = new Sprite();&lt;br /&gt;                              point.graphics.clear();&lt;br /&gt;                              point.graphics.lineStyle(0,0x0000FF);&lt;br /&gt;                              point.graphics.beginFill(0x0000FF);&lt;br /&gt;                              point.graphics.drawCircle(0,0,5);&lt;br /&gt;                              point.graphics.endFill();&lt;br /&gt;                             &lt;br /&gt;                              point.x = evt.localX;&lt;br /&gt;                              point.y = evt.localY;&lt;br /&gt;                              _lineArr.push({x:point.x,y:point.y});&lt;br /&gt;                              drawPanel.addChild(point);&lt;br /&gt;                              if(numSpot &gt; 0)&lt;br /&gt;                                    drawLine();&lt;br /&gt;                              numSpot++;&lt;br /&gt;                        }&lt;br /&gt;                  }    &lt;br /&gt;                 &lt;br /&gt;                  private function drawLine():void&lt;br /&gt;                  {&lt;br /&gt;                        line.graphics.clear();&lt;br /&gt;                        line.graphics.lineStyle(2,0x000000);&lt;br /&gt;                        if(_lineArr.length &gt; 2)&lt;br /&gt;                              line.graphics.beginFill(0xFF0000,0.5);&lt;br /&gt;                        line.graphics.moveTo(_lineArr[0].x,_lineArr[0].y);&lt;br /&gt;                        for(var i:int=1;i&lt;_lineArr.length;i++)&lt;br /&gt;                        {&lt;br /&gt;                              line.graphics.lineTo(_lineArr[i].x,_lineArr[i].y);&lt;br /&gt;                        }&lt;br /&gt;                        line.graphics.lineTo(_lineArr[0].x,_lineArr[0].y);&lt;br /&gt;                        if(_lineArr.length &gt; 2)&lt;br /&gt;                              line.graphics.endFill();&lt;br /&gt;                        drawPanel.addChildAt(line,0);&lt;br /&gt;                  }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-8248839191372863615?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/8248839191372863615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-draw-ploygon-in-flex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8248839191372863615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8248839191372863615'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-draw-ploygon-in-flex.html' title='Dynamically draw ploygon in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-2480802691251795284</id><published>2009-06-29T10:09:00.000-07:00</published><updated>2009-06-29T10:17:40.432-07:00</updated><title type='text'>Dynamically draw circle based on mouse move in Flex</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;  The circle dynamically drawn at mouse starting point and its size varies based on the mouse movement. In below example is for draw the circle dynamically in action script code in flex&lt;/div&gt;&lt;br /&gt;                  private var _cir:Sprite;&lt;br /&gt;                  private var _rect:Rectangle;&lt;br /&gt;                  private function onDrawCircle():void&lt;br /&gt;                  {&lt;br /&gt;                        var ui:UIComponent = new UIComponent();&lt;br /&gt;                        var drawPanel:Sprite = new Sprite();&lt;br /&gt;                        drawPanel.graphics.clear();&lt;br /&gt;                        drawPanel.graphics.lineStyle(2, 0xFF0000);&lt;br /&gt;                        drawPanel.graphics.beginFill(0xDEFACE);&lt;br /&gt;                        drawPanel.graphics.drawRect(0,0,300,300);&lt;br /&gt;                        drawPanel.graphics.endFill();&lt;br /&gt;                        ui.addChild(drawPanel);&lt;br /&gt;                        addChild(ui);&lt;br /&gt;                        ui.x = 20;&lt;br /&gt;                        ui.y = 20;&lt;br /&gt;                       &lt;br /&gt;                        _cir = new Sprite();&lt;br /&gt;                        _cir.graphics.clear();&lt;br /&gt;                        _cir.graphics.beginFill(0x00FF00,0.5);&lt;br /&gt;                        _cir.graphics.drawCircle(0,0,0);&lt;br /&gt;                        _cir.graphics.endFill();&lt;br /&gt;                        drawPanel.addChild(_cir);&lt;br /&gt;                        _cir.x = 10;&lt;br /&gt;                        _cir.y = 10;&lt;br /&gt;                        _rect = new Rectangle();&lt;br /&gt;                        addEventListener(MouseEvent.MOUSE_DOWN,onCircleDown);&lt;br /&gt;                        addEventListener(MouseEvent.MOUSE_UP,onCircleUp);&lt;br /&gt;                  }&lt;br /&gt;                 &lt;br /&gt;                  private function onCircleDown(evt:MouseEvent):void&lt;br /&gt;                  {&lt;br /&gt;                        var spr:Sprite = evt.target as Sprite;&lt;br /&gt;                        _rect = spr.getBounds(spr.parent);&lt;br /&gt;                        addEventListener(MouseEvent.MOUSE_MOVE,onCircleMove);&lt;br /&gt;                  }&lt;br /&gt;                 &lt;br /&gt;                  private function onCircleMove(evt:MouseEvent):void&lt;br /&gt;                  {&lt;br /&gt;                        var spr:Sprite = evt.target.parent as Sprite;&lt;br /&gt;                        _rect.bottomRight = new Point(spr.mouseX,spr.mouseY);&lt;br /&gt;                       &lt;br /&gt;                        _cir.graphics.clear();&lt;br /&gt;                        _cir.graphics.beginFill(0x00FF00,0.5);&lt;br /&gt;                        _cir.graphics.drawCircle(_rect.width/2, _rect.width/2, _rect.width/2);&lt;br /&gt;                        _cir.graphics.endFill();&lt;br /&gt;                  }&lt;br /&gt;                 &lt;br /&gt;                  private function onCircleUp(evt:MouseEvent):void&lt;br /&gt;                  {&lt;br /&gt;                        removeEventListener(MouseEvent.MOUSE_MOVE,onCircleMove);                 &lt;br /&gt;                  }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-2480802691251795284?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/2480802691251795284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-draw-circle-based-on-mouse.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2480802691251795284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2480802691251795284'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-draw-circle-based-on-mouse.html' title='Dynamically draw circle based on mouse move in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-2640081498102165503</id><published>2009-06-29T09:52:00.000-07:00</published><updated>2009-06-29T10:06:31.567-07:00</updated><title type='text'>Custom Webservice class for access web services</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;I am developed the web service class for accessing the webservice and webservice input as array values and this webservice class return the xml values to the call back function and based on the response we can proceed&lt;br /&gt;&lt;br /&gt;package service&lt;br /&gt;{&lt;br /&gt;import mx.managers.CursorManager;&lt;br /&gt;import mx.rpc.events.FaultEvent;&lt;br /&gt;import mx.rpc.events.ResultEvent;&lt;br /&gt;import mx.rpc.soap.LoadEvent;&lt;br /&gt;import mx.rpc.soap.WebService;&lt;br /&gt;&lt;br /&gt;public class URLWebService&lt;br /&gt;{&lt;br /&gt;private var _argValues:Array;&lt;br /&gt;private var _serviceURL:String = "";&lt;br /&gt;private var _operationName:String = "";&lt;br /&gt;private var _callbackObject:Object;&lt;br /&gt;private var _callbackFun:Function;&lt;br /&gt;private var webService:WebService;&lt;br /&gt;private var _showBusyCursor:Boolean = false;&lt;br /&gt;private var _isArguments:Boolean = false;&lt;br /&gt;&lt;br /&gt;private var _serviceError:MessageServices = new MessageServices("Service Load Problem","Warning");&lt;br /&gt;private var _webServiceURLError:MessageServices = new MessageServices("Webservice URL Error","Warning");&lt;br /&gt;&lt;br /&gt;public function get serviceURL():String&lt;br /&gt;{&lt;br /&gt;return _serviceURL;&lt;br /&gt;}&lt;br /&gt;public function set serviceURL(val:String):void&lt;br /&gt;{&lt;br /&gt;if(_serviceURL != val)&lt;br /&gt;_serviceURL = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get operationName():String&lt;br /&gt;{&lt;br /&gt;return _operationName;&lt;br /&gt;}&lt;br /&gt;public function set operationName(val:String):void&lt;br /&gt;{&lt;br /&gt;if(_operationName != val)&lt;br /&gt;_operationName = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get showBusyCursor():Boolean&lt;br /&gt;{&lt;br /&gt;return _showBusyCursor;&lt;br /&gt;}&lt;br /&gt;public function set showBusyCursor(val:Boolean):void&lt;br /&gt;{&lt;br /&gt;if(_showBusyCursor != val)&lt;br /&gt;_showBusyCursor = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get argValues():Array&lt;br /&gt;{&lt;br /&gt;return _argValues;&lt;br /&gt;}&lt;br /&gt;public function set argValues(val:Array):void&lt;br /&gt;{&lt;br /&gt;if(_argValues != val)&lt;br /&gt;_argValues = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get callbackObject():Object&lt;br /&gt;{&lt;br /&gt;return _callbackObject;&lt;br /&gt;}&lt;br /&gt;public function set callbackObject(val:Object):void&lt;br /&gt;{&lt;br /&gt;if(_callbackObject != val)&lt;br /&gt;_callbackObject = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get callbackFun():Function&lt;br /&gt;{&lt;br /&gt;return _callbackFun;&lt;br /&gt;}&lt;br /&gt;public function set callbackFun(val:Function):void&lt;br /&gt;{&lt;br /&gt;if(_callbackFun != val)&lt;br /&gt;_callbackFun = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get serviceError():MessageServices&lt;br /&gt;{&lt;br /&gt;return _serviceError;&lt;br /&gt;}&lt;br /&gt;public function set serviceError(val:MessageServices):void&lt;br /&gt;{&lt;br /&gt;if(_serviceError != val)&lt;br /&gt;_serviceError = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function get webServiceURLError():MessageServices&lt;br /&gt;{&lt;br /&gt;return _webServiceURLError;&lt;br /&gt;}&lt;br /&gt;public function set webServiceURLError(val:MessageServices):void&lt;br /&gt;{&lt;br /&gt;if(_webServiceURLError != val)&lt;br /&gt;_webServiceURLError = val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function URLWebService()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function load(argVal:Array=null,callbackObject:Object=null,callbackFunction:Function=null):void&lt;br /&gt;{&lt;br /&gt;if(_serviceURL &amp;amp;&amp;amp; _serviceURL != "")&lt;br /&gt;{&lt;br /&gt;if(argVal)&lt;br /&gt;{&lt;br /&gt;_argValues = argVal;&lt;br /&gt;_isArguments = true;&lt;br /&gt;}&lt;br /&gt;if(_showBusyCursor)&lt;br /&gt;{&lt;br /&gt;CursorManager.setBusyCursor();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;webService = new WebService();&lt;br /&gt;webService.wsdl = _serviceURL;&lt;br /&gt;webService[_operationName].resultFormat = "e4x";&lt;br /&gt;webService[_operationName].addEventListener(ResultEvent.RESULT,onResult);&lt;br /&gt;webService[_operationName].addEventListener(FaultEvent.FAULT,onFault);&lt;br /&gt;webService.addEventListener(LoadEvent.LOAD,onLoad);&lt;br /&gt;&lt;br /&gt;webService.loadWSDL();&lt;br /&gt;_callbackObject = callbackObject;&lt;br /&gt;_callbackFun = callbackFunction;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;_webServiceURLError.show();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onResult(evt:ResultEvent):void&lt;br /&gt;{&lt;br /&gt;if(_callbackObject &amp;amp;&amp;amp; _callbackFun != null)&lt;br /&gt;{&lt;br /&gt;var xml:XML = new XML(evt.result);&lt;br /&gt;var ResultXML:XML;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;ResultXML = XML(xml.*.*);&lt;br /&gt;if(_showBusyCursor)&lt;br /&gt;CursorManager.removeBusyCursor();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch(e:Error)&lt;br /&gt;{&lt;br /&gt;ResultXML = new XML("&lt;string&gt;Sucessfully Added&lt;/string&gt;");&lt;br /&gt;}&lt;br /&gt;_callbackFun.call(_callbackObject,ResultXML);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;_serviceError.show();&lt;br /&gt;webService[_operationName].removeEventListener(ResultEvent.RESULT,onResult);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onFault(evt:FaultEvent):void&lt;br /&gt;{&lt;br /&gt;_serviceError.show();&lt;br /&gt;webService[_operationName].removeEventListener(FaultEvent.FAULT,onFault);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private function onLoad(evt:LoadEvent):void&lt;br /&gt;{&lt;br /&gt;if(_isArguments)&lt;br /&gt;{&lt;br /&gt;_isArguments = false;&lt;br /&gt;var input:Object = new Object();&lt;br /&gt;for(var i:int=0;i&lt;_argValues.length;i++)&lt;br /&gt;{&lt;br /&gt;input[_argValues[i].name] = _argValues[i].value;&lt;br /&gt;}&lt;br /&gt;webService[_operationName].arguments = input;&lt;br /&gt;}&lt;br /&gt;webService[_operationName].send();&lt;br /&gt;webService.removeEventListener(LoadEvent.LOAD,onLoad);&lt;br /&gt;}&lt;br /&gt;}}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-2640081498102165503?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/2640081498102165503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/06/custom-webservice-class-for-access-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2640081498102165503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/2640081498102165503'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/06/custom-webservice-class-for-access-web.html' title='Custom Webservice class for access web services'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-3623831966673072521</id><published>2009-06-29T09:41:00.000-07:00</published><updated>2009-06-29T10:06:15.556-07:00</updated><title type='text'>Dynamically add or remove the ToggleButton controls in Flex</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;We can dynamically add the button controls into toggle button controls by following way&lt;br /&gt;&lt;br /&gt;var obj:Object = new Object();&lt;br /&gt;obj.icon = _iconArray[_buttonIndex];&lt;br /&gt;_buttonArray.push(obj);&lt;br /&gt;_togg.dataProvider = _buttonArray;&lt;br /&gt;&lt;br /&gt;as well as we can remove the button controls from the toggle buttoncontrols by following way&lt;br /&gt;&lt;br /&gt;_buttonArray.pop();&lt;br /&gt;_togg.dataProvider = _buttonArray;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-3623831966673072521?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/3623831966673072521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-add-and-remove-togglebutton.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/3623831966673072521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/3623831966673072521'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-add-and-remove-togglebutton.html' title='Dynamically add or remove the ToggleButton controls in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-1169159638746312557</id><published>2009-06-29T09:32:00.000-07:00</published><updated>2009-06-29T10:05:54.122-07:00</updated><title type='text'>Dynamically set ToggleButton contol in Flex</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;We can set the toggle button control dynamically based on the xml or array values. In below function use icon array as the array for the icon assets for the button controls and panel was the container for adding the ToggleButtonBar controls.&lt;br /&gt;&lt;br /&gt;private function onLoadTools():void&lt;br /&gt;{&lt;br /&gt;var _buttonArray:Array = new Array();&lt;br /&gt;var _togg:ToggleButtonBar = new ToggleButtonBar();&lt;br /&gt;_togg.direction = "vertical";&lt;br /&gt;_togg.toggleOnClick = false;&lt;br /&gt;for(var i:int=0;i&lt;_iconArray.length-1;i++)&lt;br /&gt;{&lt;br /&gt;var obj:Object = new Object();&lt;br /&gt;obj.icon = _iconArray[i];&lt;br /&gt;_buttonArray.push(obj);&lt;br /&gt;}&lt;br /&gt;_togg.dataProvider = _buttonArray;&lt;br /&gt;panel.addChild(_togg);&lt;br /&gt;_togg.addEventListener(ItemClickEvent.ITEM_CLICK,onToolsClick);&lt;br /&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-1169159638746312557?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/1169159638746312557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-set-toggle-button-contol.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/1169159638746312557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/1169159638746312557'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/06/dynamically-set-toggle-button-contol.html' title='Dynamically set ToggleButton contol in Flex'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-6947228736152377737</id><published>2009-06-29T09:12:00.000-07:00</published><updated>2009-06-29T09:20:33.982-07:00</updated><title type='text'>Flex Programming Architecture</title><content type='html'>Hi,&lt;br /&gt;&lt;div align="justify"&gt;        The Flex programming style may be varied based on the programmers. Some of the programmers are more familiar in writing coding in a class style and some of them familiar in writing the mxml components. Here i mention the some of the ways you can create the Flex programming&lt;/div&gt;&lt;br /&gt;1)the entire project can be coded in actionscript&lt;br /&gt;2)actionscript can be embedded into your MXML file using the &lt;?xml:namespace prefix = mx /&gt;&lt;mx:script&gt;tags&lt;br /&gt;3)actionscript can be used to create custom classes/components, and to extend any of the flex classes.&lt;br /&gt;4) actionscript functions can be called from within components declared with MXMLfor example: &lt;mx:button click="”myClickFunction();”/"&gt;&lt;br /&gt;&lt;/mx:button&gt;&lt;/mx:script&gt;&lt;mx:script&gt;&lt;mx:button click="”myClickFunction();”/"&gt;&lt;/mx:button&gt;&lt;/mx:script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-6947228736152377737?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/6947228736152377737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/06/flex-programming-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/6947228736152377737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/6947228736152377737'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/06/flex-programming-architecture.html' title='Flex Programming Architecture'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6493813212534403279.post-8503076193799312118</id><published>2009-06-08T01:43:00.000-07:00</published><updated>2009-06-29T09:19:14.588-07:00</updated><title type='text'>Access local files in Adobe Flex 3.2 sdk and FP10</title><content type='html'>&lt;div align="justify"&gt;Hi,&lt;br /&gt;The Flex3.2 sdk and Flash Player 10 will support for access local files in your system. The file stream class used to access the local system files as bytes array and File Reference class has new methods as load () for load the local system files and save () method for save the modified content into local system. These Load () and save () method only accessed by Flex3.2 sdk and FlashPlayer10 only. If you already have Flex3 sdk then you can upgrade Flex3.2 sdk or latest version of sdk and check whether you are using the FlashPlayer10 version or not. If you are not using the Flash player10 version then upgrade the Flash player also. Then you can play with accessing the local system files.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6493813212534403279-8503076193799312118?l=arunflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arunflex.blogspot.com/feeds/8503076193799312118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://arunflex.blogspot.com/2009/06/working-with-files-using-file-stream-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8503076193799312118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6493813212534403279/posts/default/8503076193799312118'/><link rel='alternate' type='text/html' href='http://arunflex.blogspot.com/2009/06/working-with-files-using-file-stream-in.html' title='Access local files in Adobe Flex 3.2 sdk and FP10'/><author><name>Arun S</name><uri>http://www.blogger.com/profile/02741218830525639161</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_oa0IIk8aWeE/Swt1jSckQUI/AAAAAAAAA-E/N3UNHQL7Wtc/S220/arun_thumb.jpg'/></author><thr:total>0</thr:total></entry></feed>
