<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>getRIAed &#187; flex</title>
	<atom:link href="http://ravimarella.com/getriaed/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://ravimarella.com/getriaed</link>
	<description>flex,flash,AIR</description>
	<lastBuildDate>Wed, 28 Jul 2010 19:34:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>AS3 Singleton class with parameterised constructor</title>
		<link>http://ravimarella.com/getriaed/2010/02/23/as3-singleton-class-with-parameterised-constructor/</link>
		<comments>http://ravimarella.com/getriaed/2010/02/23/as3-singleton-class-with-parameterised-constructor/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 11:10:51 +0000</pubDate>
		<dc:creator>ravi</dc:creator>
				<category><![CDATA[Customization]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[singleton]]></category>

		<guid isPermaLink="false">http://ravimarella.com/getriaed/?p=128</guid>
		<description><![CDATA[As many of you already know, in AS3 there is no direct way to create singleton class i.e there is no keyword Singleton or any other equivalent keyword using which this can be accomplished. But there is a simple work around to create singleton class. The code below shows this: 1234567891011121314151617181920212223242526272829public class Services extends EventDispatcher [...]]]></description>
			<content:encoded><![CDATA[<p>As many of you already know, in AS3 there is no direct way to create singleton class i.e there is no keyword Singleton or any other equivalent keyword using which this can be accomplished. But there is a simple work around to create singleton class. The code below shows this:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Services extends <a href="http://www.google.com/search?q=eventdispatcher%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:eventdispatcher.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">EventDispatcher</span></a><br />
<span style="color: #000000;">&#123;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> getInstance<span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span><span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> Services<br />
<span style="color: #000000;">&#123;</span><br />
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> servicesLocator == <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
servicesLocator = <span style="color: #0033ff; font-weight: bold;">new</span> Services<span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0033ff; font-weight: bold;">return</span> servicesLocator;<br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Services<span style="color: #000000;">&#40;</span><span style="color: #004993;">url</span><span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
<br />
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> servicesLocator <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
<span style="color: #0033ff; font-weight: bold;">throw</span> <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=error%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:error.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Error</span></a><span style="color: #000000;">&#40;</span> <span style="color: #990000;">&quot;Only one Services instance should be instantiated&quot;</span> <span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span><br />
ENDPOINT_URL=<span style="color: #004993;">url</span><br />
gateway=<span style="color: #0033ff; font-weight: bold;">new</span> HTTPService<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
gateway.resultFormat=<span style="color: #990000;">&quot;e4x&quot;</span>;<br />
gateway.<span style="color: #004993;">url</span> = ENDPOINT_URL;<br />
gateway.<span style="color: #004993;">method</span> = <span style="color: #990000;">&quot;POST&quot;</span>;<br />
gateway.useProxy = <span style="color: #0033ff; font-weight: bold;">false</span>;<br />
gateway.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ResultEvent.RESULT, resultHandler<span style="color: #000000;">&#41;</span>;<br />
gateway.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>FaultEvent.FAULT, faultHandler<span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>the way to create object now is like this:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> servicesInstance<span style="color: #000000; font-weight: bold;">:</span>Services =Services.getInstance<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;serviceURL.php&quot;</span><span style="color: #000000;">&#41;</span>;</div></td></tr></tbody></table></div>
<p>we&#8217;re defining here a static function called getInstance which calls the constructor <em>only</em> if servicesLocator object is null or not initialized already. A sinlgeton class is particularly of high use for HTTPService object as it allows single point of handling all the requests in this way.</p>
]]></content:encoded>
			<wfw:commentRss>http://ravimarella.com/getriaed/2010/02/23/as3-singleton-class-with-parameterised-constructor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching Flex XMLListCollection using IViewCursor</title>
		<link>http://ravimarella.com/getriaed/2009/07/01/searching-flex-xmllistcollection-using-iviewcursor/</link>
		<comments>http://ravimarella.com/getriaed/2009/07/01/searching-flex-xmllistcollection-using-iviewcursor/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 09:01:40 +0000</pubDate>
		<dc:creator>ravi</dc:creator>
				<category><![CDATA[IViewCursor]]></category>
		<category><![CDATA[XMLListCollection]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[finAny()]]></category>
		<category><![CDATA[multiple fields]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://ravimarella.com/getriaed/?p=79</guid>
		<description><![CDATA[This post explains how to search a XmlListColelction for multiple fields using IViewCursor&#8217;s findAny() method . Recently in one of my projects, I&#8217;d to use the IViewCursor to search the XMLListCollection and faced some problems initially but implemented it successfully after doing some research. I&#8217;m posting the same example (-) the actual database contents&#8230;i&#8217;ll use [...]]]></description>
			<content:encoded><![CDATA[<p>This post explains how to search a XmlListColelction for multiple fields using IViewCursor&#8217;s findAny() method .</p>
<p>Recently in one of my projects, I&#8217;d to use the IViewCursor to search the XMLListCollection and faced some problems initially but implemented it successfully after doing some research. I&#8217;m posting the same example (-) the actual database contents&#8230;i&#8217;ll use sample XML files for the purpose of this example.</p>
<p>The scenario for which i&#8217;ve implemented this thing is as follows:<span id="more-79"></span></p>
<p>I&#8217;ve three tables users,courses and privileges. The users and courses tables contains the details of the existing courses and users and the privileges table contains the course&#8211;&gt;user mappings and access levels.</p>
<p>Now in flex, i&#8217;m using datagrid to show the privileges&#8230;and another form to create new priviliges. This form contains<br />
two list boxes for users and courses and checkboxes for each privilege.</p>
<p>So when the admin of my application selects a course and user and if that user has already has some privileges over that course, those privileges have to be shown by autoselcting the corresponding checkboxes.</p>
<p>So to match the selected user and course with the existing privileges, i&#8217;m using IViewCursor. but the IviewCursor&#8217;s findAny() method returns true if either course or user is found in the privileges list which is not exactly what i&#8217;m expecting&#8230;i.e return true only if a row contains both the selected user and course.</p>
<p>And here is the sample of the application:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_XMLListCollectionSearch_904318111"
			class="flashmovie"
			width="620"
			height="450">
	<param name="movie" value="http://ravimarella.com/getriaed/wp-content/uploads/2009/07/XMLListCollectionSearch.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://ravimarella.com/getriaed/wp-content/uploads/2009/07/XMLListCollectionSearch.swf"
			name="fm_XMLListCollectionSearch_904318111"
			width="620"
			height="450">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Right Click/Click on the view source button to view the source of this application.</p>
<p>Now some explanation:</p>
<p>The application contains a datagrid which shows the privileges of a particular user on a particular course and two list boxes showing all the available courses and users. When you select a user and a course, an Alert box appears if the selected user has some priviliges allocated to her on the selected course.</p>
<p>To do this, first of all i&#8217;ve stored my data in 3 XML files</p>
<ul>
<li>Privileges.xml contains the details of which user has what priviges on a course</li>
<li>Course.xml contains details of  courses available</li>
<li>users.xml contains details of all users available</li>
</ul>
<p>There is an XMLListCollection named privilegesModel in to which the privileges.xml is loaded. Once it is loaded, i&#8217;ve sorted the collection on the two criteria on which i&#8217;m going to search i.e user name and the course name like this:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">privilegesCollection.<span style="color: #004993;">source</span>=e.result.row;<br />
<br />
<span style="color: #6699cc; font-weight: bold;">var</span> sortValue<span style="color: #000000; font-weight: bold;">:</span>Sort=<span style="color: #0033ff; font-weight: bold;">new</span> Sort &nbsp; &nbsp;<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
sortValue.fields = <span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">new</span> SortField<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;user_name&quot;</span>,<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>,<span style="color: #0033ff; font-weight: bold;">new</span> SortField<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;course_name&quot;</span>,<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>;<br />
privilegesCollection.<span style="color: #004993;">sort</span>=sortValue;<br />
privilegesCollection.refresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div></td></tr></tbody></table></div>
<p><strong>Remember </strong></p>
<ul>
<li> you must sort the XmlListCollection if you want to user IViewCursor&#8217;s methods on it&#8230;otherwise flash will throw a runtime error saying that the collection is not sorted.</li>
<li>The sort must be on all the fields on which you&#8217;re going to search later. i.e here i&#8217;m searching for a row with both the coursename and user name&#8230;so, i must sort XMLListCollection on both username and coursename fields. If i sort it on just course name or user name and later search on both criteria, flex will return true for for any row with containing just the single field on which i&#8217;ve sorted &#8230; let&#8217;s assume that i&#8217;ve sorted on just the username liket this:</li>
</ul>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">privilegesCollection.<span style="color: #004993;">source</span>=e.result.row;<br />
<br />
<span style="color: #6699cc; font-weight: bold;">var</span> sortValue<span style="color: #000000; font-weight: bold;">:</span>Sort=<span style="color: #0033ff; font-weight: bold;">new</span> Sort &nbsp; &nbsp;<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
sortValue.fields = <span style="color: #000000;">&#91;</span><span style="color: #0033ff; font-weight: bold;">new</span> SortField<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;user_name&quot;</span>,<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>;<br />
privilegesCollection.<span style="color: #004993;">sort</span>=sortValue;<br />
privilegesCollection.refresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;</div></td></tr></tbody></table></div>
<p>and then i search the collection usign IViewCursor&#8217;s findAny method like this:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> searchObj<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Object</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Object</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
searchObj.user_name = usersListBox.selectedItem.user_name;<br />
searchObj.course_name =coursesListBox.selectedItem.course_name;<br />
<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>cursor.findAny<span style="color: #000000;">&#40;</span>searchObj<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;found&quot;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #0033ff; font-weight: bold;">else</span><br />
<span style="color: #000000;">&#123;</span><br />
Alert.<span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;not found&quot;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>then flex will show found Alert when ever you select a user present in the collection and any course&#8230;still confused?? watch this example:</p>
<p><a href="http://ravimarella.com/XmlListCollection/XMLListCollectionSearch.html" target="_blank">http://ravimarella.com/XmlListCollection/XMLListCollectionSearch.html</a></p>
<p>So you must sort the collection on all the fields for which you&#8217;re going to search otherwise the results will not be as expected.</p>
<p>Hope that post helps someone. Leave a comment if anypart of the post is still confusing..</p>
<p>Happy Flexing&#8230;<img class="wpml_ico" src="http://ravimarella.com/getriaed/wp-content/plugins/wp-monalisa/icons/wpml_mail.gif" alt="" /></p>
<p>Ravi.</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://ravimarella.com/getriaed/2009/07/01/searching-flex-xmllistcollection-using-iviewcursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding custom path to viewSource option of your flex application</title>
		<link>http://ravimarella.com/getriaed/2009/06/23/adding-custom-path-to-view-source-option-of-your-flex-application/</link>
		<comments>http://ravimarella.com/getriaed/2009/06/23/adding-custom-path-to-view-source-option-of-your-flex-application/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 08:59:25 +0000</pubDate>
		<dc:creator>ravi</dc:creator>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://ravimarella.com/getriaed/?p=73</guid>
		<description><![CDATA[Ok. Today i was trying to export the release build of a simple example i've done with the View Source option enabled. But the problem is the source path can only be relative to bin-release which wont work with the perma link system that i'm using with my wordpress blog which creates virtual links.]]></description>
			<content:encoded><![CDATA[<p>Ok. Today i was trying to export the release build of a simple example i&#8217;ve done with the View Source option enabled. But the problem is the source path can only be relative to bin-release which wont work with the perma link system that i&#8217;m using with my wordpress blog which creates virtual links.</p>
<p>At first i thought of giving a custom path value to the viewSourceURL property of the Application tag like this:</p>
<p><span id="more-73"></span></p>
<div class="codecolorer-container mxml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">viewSourceURL=&quot;http://ravimarella.com/getriaed/flexSource/Custom_View_Source_Publishing/index.html&quot;<span style="color: #ddbb00;">&amp;gt;</span></div></td></tr></tbody></table></div>
<p>and just export the release build without selecting the view source option. But the problem with this is Flex Builder automatically deletes the viewSourceURL variable and its value once it publishes the release build. So my options are to place the above code intact and just the debug version of the swf. But the debug version contain lot of unnecessary info and adds up to the file size ultimately. So this is the solution i came up with:</p>
<p>1. Add a new Right Click Context Menu item on the application&#8217;s CreationComplete event like this:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> viewSourceItem<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a> = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=contextmenuitem%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuitem.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuItem</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;View Source&quot;</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #6699cc; font-weight: bold;">var</span> contextMenuCustomItems<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Array</span></a> = application.<span style="color: #004993;">contextMenu</span>.<span style="color: #004993;">customItems</span>;<br />
contextMenuCustomItems.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>viewSourceItem<span style="color: #000000;">&#41;</span>;<br />
viewSourceItem.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=contextmenuevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:contextmenuevent.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">ContextMenuEvent</span></a>.<span style="color: #004993;">MENU_ITEM_SELECT</span>, showSource<span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> showSource<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
<span style="color: #004993;">navigateToURL</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=urlrequest%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:urlrequest.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">URLRequest</span></a><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;http://ravimarella.com/getriaed/flexSource/Custom_View_Source_Publishing/index.html&quot;</span><span style="color: #000000;">&#41;</span>,<span style="color: #990000;">&quot;_blank&quot;</span><span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>What this will do is add a new menuitem to the menu that appears when you Righ Click or Ctrl_+Click on Mac called &#8220;View Source&#8221; and up on clicking this menu item navigates to the URL mentioned. The menuitem name can be named ofcourse as anything you want.</p>
<p>2. Export the release build with viewsource option enabled. This step is just to gather the source files. You can skip this step and select the source files your self and place them in a single folder. I prefer the first method as flex published the index.html and uses a clean interface to navigate through and download different items of your source.</p>
<p>3. Now, you can edit the source code exported to remove the viewSourceURL option just for the sake of your users or keep it intact if you dont prefer to take the extra step and let your users see the extra ViewSource option which is not the one that you are actually using. Note that flex renames creates your mxml files as .mxml.html files&#8230;so to remove that ViewSourceURL option, just open the main application mxml file in any text editor and remove the code pertaining to the ViewSourceURL.</p>
<p>Now just upload the source code folder contents in the exactly same URL as mentioned above by you.</p>
<p>Thats it&#8230;now you are ready with a Custom and absolute path for your Source code.</p>
<p>Here is  sample that i&#8217;ve done:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Custom_View_Source_Publishing_1183786902"
			class="flashmovie"
			width="600"
			height="300">
	<param name="movie" value="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/Custom_View_Source_Publishing.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/Custom_View_Source_Publishing.swf"
			name="fm_Custom_View_Source_Publishing_1183786902"
			width="600"
			height="300">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Right Click any where on the application and click View Source option to see the source&#8230;</p>
<p><span style="text-decoration: underline;"><strong>REMEMBER</strong></span>, you&#8217;ve to export the release build twice&#8230;first time with the source code export option selected and second time without the sourcecode option so that the default viewsource option wont show up on right click&#8230;</p>
<p>Happy flexing..<img class="wpml_ico" src="http://ravimarella.com/getriaed/wp-content/plugins/wp-monalisa/icons/wpml_mail.gif" alt="" /></p>
<p>cheers,</p>
<p>ravi.</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://ravimarella.com/getriaed/2009/06/23/adding-custom-path-to-view-source-option-of-your-flex-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tooltip custom Placement on Flex Listbox rollover</title>
		<link>http://ravimarella.com/getriaed/2009/06/18/tooltip-custom-placement-on-flex-listbox-rollover/</link>
		<comments>http://ravimarella.com/getriaed/2009/06/18/tooltip-custom-placement-on-flex-listbox-rollover/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 10:44:36 +0000</pubDate>
		<dc:creator>ravi</dc:creator>
				<category><![CDATA[Listbox]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[tooltip]]></category>
		<category><![CDATA[Custom]]></category>

		<guid isPermaLink="false">http://ravimarella.com/getriaed/?p=14</guid>
		<description><![CDATA[The example below shows how to add a tooltip on roll over event of flex ListBox items. I don&#8217;t say that this is the perfect way to do this&#8230;but i&#8217;m happy as long as it serves me&#8230; 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ListBoxRollover_1496245566"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/ListBoxRollover.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/ListBoxRollover.swf"
			name="fm_ListBoxRollover_1496245566"
			width="400"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> just rollover any of the listbox items and it will [...]]]></description>
			<content:encoded><![CDATA[<p>The example below shows how to add a tooltip on roll over event of flex ListBox items. I don&#8217;t say that this is the perfect way to do this&#8230;but i&#8217;m happy as long as it serves me&#8230;<br />
<span id="more-14"></span><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ListBoxRollover_1032194339"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/ListBoxRollover.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/ListBoxRollover.swf"
			name="fm_ListBoxRollover_1032194339"
			width="400"
			height="300">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>just rollover any of the listbox items and it will show the index of that item. So once you&#8217;ve the index, i guess you can do any custom label operations.</p>
<p>Here is the source code for the above example:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span><br />
<span style="color: #0033ff; font-weight: bold;">import</span> mx.managers.ToolTipManager;<br />
<span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.ToolTip;<br />
<span style="color: #0033ff; font-weight: bold;">import</span> mx.events.ListEvent;<br />
<span style="color: #0033ff; font-weight: bold;">import</span> mx.events.ToolTipEvent;<br />
<span style="color: #0033ff; font-weight: bold;">import</span> mx.collections.ArrayCollection;<br />
<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> myDP<span style="color: #000000; font-weight: bold;">:</span>ArrayCollection = <span style="color: #0033ff; font-weight: bold;">new</span> ArrayCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;Ted Patrick&quot;</span>, blog<span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;http://www.onflex.org/&quot;</span><span style="color: #000000;">&#125;</span>,<br />
<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;Ryan Stewart&quot;</span>, blog<span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;http://blogs.zdnet.com/Stewart&quot;</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;Peter DeHann&quot;</span>, blog<span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;http://blog.flexexamples.com/&quot;</span><span style="color: #000000;">&#125;</span>,<br />
<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;Raghu&quot;</span>, blog<span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;http://raghuonflex.wordpress.com/&quot;</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span><span style="color: #004993;">name</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;Harish Sivaramakrishnan&quot;</span>, blog<span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">&quot;http://flexgeek.wordpress.com/&quot;</span><span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;<br />
<br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> tip<span style="color: #000000; font-weight: bold;">:</span>ToolTip<br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> itemRollOver<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ListEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
<br />
tip = ToolTipManager.createToolTip<span style="color: #000000;">&#40;</span>event.rowIndex<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;&quot;</span>,event.<span style="color: #004993;">currentTarget</span>.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>event.<span style="color: #004993;">currentTarget</span>.<span style="color: #004993;">width</span>,event.<span style="color: #004993;">currentTarget</span>.<span style="color: #004993;">mouseY</span><span style="color: #000000;">&#41;</span><span style="color: #0033ff; font-weight: bold;">as</span> ToolTip;<br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> itemRollOut<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>ListEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
ToolTipManager.destroyToolTip<span style="color: #000000;">&#40;</span>tip<span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">&gt;</span><br />
<br />
itemRollOver=<span style="color: #990000;">&quot;itemRollOver(event)&quot;</span> itemRollOut=<span style="color: #990000;">&quot;itemRollOut(event)&quot;</span><span style="color: #000000; font-weight: bold;">/&amp;</span>gt;</div></td></tr></tbody></table></div>
<p>Here is the post which explains a much simpler way to create tooltips but you cannot custom place these tooltips:</p>
<p><a href="http://raghuonflex.wordpress.com/2007/09/19/tooltips-for-combobox-items-or-list-items/">http://raghuonflex.wordpress.com/2007/09/19/tooltips-for-combobox-items-or-list-items/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ravimarella.com/getriaed/2009/06/18/tooltip-custom-placement-on-flex-listbox-rollover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cairngorm PHP Login</title>
		<link>http://ravimarella.com/getriaed/2009/06/17/3/</link>
		<comments>http://ravimarella.com/getriaed/2009/06/17/3/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 08:16:27 +0000</pubDate>
		<dc:creator>ravi</dc:creator>
				<category><![CDATA[cairngorm]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[HTTPService]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ravimarella.com/getriaed/?p=3</guid>
		<description><![CDATA[This example explains how to communicate with PHP using the cairngorm framework: 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Cairngorm_PHP_1007112396"
			class="flashmovie"
			width="500"
			height="300">
	<param name="movie" value="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/Cairngorm_PHP.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/Cairngorm_PHP.swf"
			name="fm_Cairngorm_PHP_1007112396"
			width="500"
			height="300">
	<!--<![endif]-->
		 
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object> This is a duplicate of this post by neil and full credit goes to him. I&#8217;ve posted it again coz the original post has some problems with flash embedding because of which the application is [...]]]></description>
			<content:encoded><![CDATA[<p>This example explains how to communicate with PHP using the cairngorm framework:<br />
<span id="more-3"></span><br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Cairngorm_PHP_842141706"
			class="flashmovie"
			width="500"
			height="300">
	<param name="movie" value="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/Cairngorm_PHP.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://ravimarella.com/getriaed/wp-content/uploads/2009/06/Cairngorm_PHP.swf"
			name="fm_Cairngorm_PHP_842141706"
			width="500"
			height="300">
	<!--<![endif]-->
		<a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><strong>This is a duplicate of <a href="http://nwebb.co.uk/blog/?p=117&amp;cpage=1" target="_blank">this post</a> by neil and full credit goes to him.</strong> I&#8217;ve posted it again coz the original post has some problems with flash embedding because of which the application is not working from the embedded swf.</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://ravimarella.com/getriaed/2009/06/17/3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
