<?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-7920400656283946410</id><updated>2011-11-27T15:26:15.584-08:00</updated><category term='Accordion'/><category term='hierarchical'/><category term='background'/><category term='multicolor'/><category term='Tree control'/><category term='gradient'/><category term='flex'/><category term='XMLListCollection'/><category term='Opaque'/><title type='text'>Magical Flex</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-7470274855307921404</id><published>2010-07-09T22:59:00.000-07:00</published><updated>2010-07-09T23:00:51.390-07:00</updated><title type='text'>Working with PDFs on Actionscript using AlivePDF</title><content type='html'>Recented I came across &lt;a href="http://www.alivepdf.org/"&gt;AlivePDF&lt;/a&gt; library for Flex/AIR which allows you to generate PDF's 100% client-side.&lt;br /&gt;There are a bunch of &lt;a href="http://www.alivepdf.org/?page_id=5"&gt;tutorials&lt;/a&gt; to get started with AlivePDF. AlivePDF comes with a SWC that you can include in your Flex application, or an Actionscript package you can import to your AS code. Here's a brief, condensed example of how I used AlivePDF in my Flash AIR project. &lt;br /&gt;import org.alivepdf.*;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;// setup pdf&lt;br /&gt;var myPDF : PDF = new PDF ( Orientation.PORTRAIT, Unit.MM, Size.LETTER );&lt;br /&gt;&lt;br /&gt;myPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );&lt;br /&gt;&lt;br /&gt;myPDF.addPage();&lt;br /&gt;&lt;br /&gt;// add a background image&lt;br /&gt;myPDF.addImage (myBackgroundMovieClip, 1 , null, null, false, ImageFormat.JPG, 100, 0, 0, 0, 0);&lt;br /&gt;&lt;br /&gt;// add headline&lt;br /&gt;myPDF.textStyle ( new RGBColor ( 41, 58, 140 ) );&lt;br /&gt;myPDF.setFont( FontFamily.HELVETICA, Style.BOLD );&lt;br /&gt;myPDF.setFontSize ( 18 );&lt;br /&gt;myPDF.setXY( 10, 40 );&lt;br /&gt;myPDF.addMultiCell ( 300, 1, "This is my PDF Headline" );&lt;br /&gt;&lt;br /&gt;// add text message&lt;br /&gt;myPDF.textStyle ( new RGBColor ( 0, 0, 0 ) );&lt;br /&gt;myPDF.setFont( FontFamily.HELVETICA, Style.BOLD );&lt;br /&gt;myPDF.setFontSize ( 14 );&lt;br /&gt;myPDF.setXY( 10, 50 );&lt;br /&gt;myPDF.addMultiCell ( 300, 4, "This is my text….lots of text…" );&lt;br /&gt;&lt;br /&gt;// save PDF to the desktop&lt;br /&gt;var f : FileStream = new FileStream();&lt;br /&gt;var file : File = File.desktopDirectory.resolvePath("MyPDF.pdf");&lt;br /&gt;f.open( file, FileMode.WRITE);&lt;br /&gt;var bytes : ByteArray = myPDF.savePDF(Method.LOCAL);&lt;br /&gt;f.writeBytes(bytes);&lt;br /&gt;f.close();     &lt;br /&gt;&lt;/pre&gt;Notice I'm using the method addMultiCell to add text. This may seem odd, but what this allows me to do is add a block of text that wordwraps. If I use addText then I only get a single line. &lt;br /&gt;&lt;br /&gt;AlivePDF is definitely still young and I've run into a few oddities (read bugs). I logged a bug on the Google project site and within no time at all received a note saying the issue had been resolved and would be released in the next build. Nice!&lt;br /&gt;&lt;br /&gt;The Google project site provides a few examples in addition to the samples provided in the download. And the documentation is fairly helpful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-7470274855307921404?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/7470274855307921404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/07/working-with-pdfs-on-actionscript-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/7470274855307921404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/7470274855307921404'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/07/working-with-pdfs-on-actionscript-using.html' title='Working with PDFs on Actionscript using AlivePDF'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-2321216993245109787</id><published>2010-07-02T03:35:00.001-07:00</published><updated>2010-07-02T05:11:38.578-07:00</updated><title type='text'>My favorite links of Adobe AIR 2.0 resources</title><content type='html'>&lt;a href="http://blogs.adobe.com/air/2010/06/introducing_air_2.html"&gt;What's new in Adobe AIR 2.0&lt;/a&gt;&lt;br /&gt;&lt;a href="http://arno.org/arnotify/2009/10/max-2009-adobe-air-2-0-and-iphone-support/"&gt;Adobe AIR 2.0 and iPhone&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.adobe.com/devnet/air/flex/quickstart/interacting_with_native_process_02.html"&gt;Interacting with a native process&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blog.omarfouad.com/?p=239"&gt;The ServerSocket Class and Socket Communication&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-2321216993245109787?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/2321216993245109787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/07/my-favorite-links-of-adobe-air-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/2321216993245109787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/2321216993245109787'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/07/my-favorite-links-of-adobe-air-20.html' title='My favorite links of Adobe AIR 2.0 resources'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-6283241050175271665</id><published>2010-03-11T02:48:00.000-08:00</published><updated>2010-03-11T02:48:26.120-08:00</updated><title type='text'>Flex Builder Source Code Formatter Plugin</title><content type='html'>A colleague recently pointed me towards &lt;a href="http://sourceforge.net/projects/flexformatter/"&gt;Flex Formatter&lt;/a&gt; – a new (and open source) source code formatter plugin for Flex Builder.  The plugin is very easy to use right out of the box and it comes with two commands, Format Selection and Indent Selection. Both commands are accessed by toolbar items.  The “Indent” command only affects leading whitespace on lines, while “Format” affects newlines and internal line spacing as well.  For those of you who work in organzations where there are strict code formatting policies, there are extensive options that you can set to customize the tool for your work group.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-6283241050175271665?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/6283241050175271665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/03/flex-builder-source-code-formatter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/6283241050175271665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/6283241050175271665'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/03/flex-builder-source-code-formatter.html' title='Flex Builder Source Code Formatter Plugin'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-6005465528533857943</id><published>2010-01-19T05:16:00.000-08:00</published><updated>2010-01-19T05:20:19.529-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tree control'/><category scheme='http://www.blogger.com/atom/ns#' term='XMLListCollection'/><category scheme='http://www.blogger.com/atom/ns#' term='hierarchical'/><title type='text'>Dynamically populate Tree control with XMLListCollection</title><content type='html'>For those who think it a tough thing to bind controls to hierarchical data (like me) I am posting my source code to dynamically populate hierarchical data in Tree control using an XMLListCollection object.&lt;br /&gt;&lt;br /&gt;First of all, create a Tree object in markup&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;&amp;lt;mx:Tree height=&amp;quot;100%&amp;quot;  labelField=&amp;quot;@label&amp;quot; width=&amp;quot;175&amp;quot; showRoot=&amp;quot;false&amp;quot;  id=&amp;quot;treeMenu&amp;quot;  &amp;gt; &amp;lt;/mx:Tree&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next, create a private variable myTreeCollectionof XMLListCollection and set dataProvider property of the Tree to 'myTreeCollection'&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;[Bindable] public var myTreeCollection:XMLListCollection;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:Tree height=&amp;quot;100%&amp;quot; dataProvider=&amp;quot;{myTreeCollection}&amp;quot;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, we are ready to add hierarchical to the XMLListCollection object.&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;import mx.collections.XMLListCollection;&lt;br /&gt;[Bindable]&lt;br /&gt;private var myTreeCollection:XMLListCollection;&lt;br /&gt;private function init():void&lt;br /&gt;{&lt;br /&gt; if(myTreeCollection == null)&lt;br /&gt; myTreeCollection = new XMLListCollection();&lt;br /&gt;       &lt;br /&gt; var xmlString:String = &amp;quot;&amp;lt;Item label=&amp;#39;Level-1&amp;#39;&amp;gt;&amp;quot;   &lt;br /&gt;         &amp;quot;&amp;lt;Item label=&amp;#39;Level-2&amp;#39;/&amp;gt;&amp;quot; &amp;quot;&amp;lt;/Item&amp;gt;&amp;quot;;&lt;br /&gt; var item:XMLList = new XMLList(xmlString);&lt;br /&gt; myTreeCollection.addItem(item);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that in markup of Tree, we have set labelField propperty to '@label'. It tells the runtime to bind the tree node with 'label' attribute of corresponding dataprovider XML node. An XML attribute is indicated with "@" prefix.&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://arpit.6te.net/magicalFlex/Tree.swf" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="100" width="250"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-6005465528533857943?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/6005465528533857943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/01/dynamically-populate-tree-control-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/6005465528533857943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/6005465528533857943'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/01/dynamically-populate-tree-control-with.html' title='Dynamically populate Tree control with XMLListCollection'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-4167246701580425304</id><published>2010-01-13T01:59:00.000-08:00</published><updated>2010-01-13T03:31:59.545-08:00</updated><title type='text'>TabBar with multicolored tabs</title><content type='html'>&lt;embed src="http://arpit.6te.net/magicalFlex/tab_colors.swf" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" height="200" width="300"&gt;&lt;/embed&gt; &lt;br /&gt;&lt;br /&gt;Tabs of TabBar component can be a tweaked to produce tabs of different colors. &lt;br /&gt;The trick is to iterate through the datasource of TabBar, pick the tabs one by one and set the properties - backgroundColor, fillAlphas and fillColors.&lt;br /&gt;&lt;br /&gt;Here is the quick code&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" &lt;br /&gt;backgroundColor="#D1D1D1"  &gt;&lt;br /&gt;&lt;mx:Style&gt;&lt;br /&gt;Canvas&lt;br /&gt;{&lt;br /&gt;borderStyle: applicationControlBar; &lt;br /&gt;fillColors:  #FFB600,#FFFFFF; &lt;br /&gt;fillAlphas: 0.4, 1.0; &lt;br /&gt;highlightAlphas: 0, 0;  &lt;br /&gt;} &lt;br /&gt;&lt;/mx:Style&gt;&lt;br /&gt;&lt;mx:Canvas id="canvasMain" width="600" cornerRadius="5" height="80%" backgroundColor="#FFFFFF" x="66" y="56"&gt;&lt;br /&gt;&lt;mx:TabBar id="tabContainer" creationComplete="onTabCreated()" itemClick="onItemClick(event)" &gt;&lt;br /&gt;&lt;mx:Array&gt;&lt;br /&gt;&lt;mx:Object label="Tab-1"/&gt;&lt;br /&gt;&lt;mx:Object label="Tab-2"/&gt; &lt;br /&gt;&lt;mx:Object label="Tab-3"/&gt;&lt;br /&gt;&lt;/mx:Array&gt;&lt;br /&gt;&lt;/mx:TabBar&gt;&lt;br /&gt;&lt;/mx:Canvas&gt;&lt;br /&gt;&lt;mx:Script&gt;&lt;br /&gt;&lt;br /&gt;import mx.events.ItemClickEvent;&lt;br /&gt;private function onItemClick(event:ItemClickEvent):void&lt;br /&gt;{&lt;br /&gt;var colorArray:Array = ["#FFB600", "#FFFF00", "#80FF4D"];&lt;br /&gt;canvasMain.setStyle("backgroundColor", colorArray[event.index]);&lt;br /&gt;}&lt;br /&gt;private function onTabCreated():void&lt;br /&gt;{&lt;br /&gt;var colorArr:Array = ["haloOrange", "yellow", "haloGreen"];&lt;br /&gt;var len:int = tabContainer.dataProvider.length;&lt;br /&gt;var tab:Object;&lt;br /&gt;&lt;br /&gt;for(var i:int = 0; i&lt; len; i++)&lt;br /&gt;{&lt;br /&gt;tab = tabContainer.getChildAt(i);&lt;br /&gt;tab.setStyle("fillColors", [colorArr[i], "white"]);&lt;br /&gt;tab.setStyle("fillAlphas", [1.0, 1.0]);&lt;br /&gt;tab.setStyle("backgroundColor", colorArr[i]);&lt;br /&gt;tab.width = 200;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/mx:Script&gt;&lt;br /&gt;&lt;/mx:Application&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-4167246701580425304?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/4167246701580425304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/01/tabbar-with-multicolored-tabs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/4167246701580425304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/4167246701580425304'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/01/tabbar-with-multicolored-tabs.html' title='TabBar with multicolored tabs'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-8347347363764373444</id><published>2010-01-12T04:30:00.000-08:00</published><updated>2010-01-12T23:02:52.404-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Opaque'/><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='background'/><category scheme='http://www.blogger.com/atom/ns#' term='gradient'/><title type='text'>Opaque background with gradient</title><content type='html'>Using fillAphas with fillColors we can create attractive opaque gradient backgrounds backgrounds in Flex.&lt;br /&gt;&lt;br /&gt;While I am still in the middle of my googling for the precise documentation of fillAlphas property, I could have learn that fillAlphas perpery is an array of two numeric elements between 0 and 1 which indicates opacity of the two parts of the correspoding Flex component . fillAlphas works hand-to-hand with fillColors as if there is no gradient, we do not need to adjust the opacity of different parts of the component.&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;&lt;br /&gt; &lt;mx:Style&gt;&lt;br /&gt;  Canvas&lt;br /&gt;  {&lt;br /&gt;   fillAlphas: 1, 1; &lt;br /&gt;   fillColors:  #FFFFFF,#D00808;  &lt;br /&gt;   borderStyle: applicationControlBar;    &lt;br /&gt;  } &lt;br /&gt; &lt;/mx:Style&gt;&lt;br /&gt; &lt;mx:Canvas width="80%" height="80%" backgroundColor="#FFFFFF" x="66" y="56"&gt;&lt;br /&gt; &lt;/mx:Canvas&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and here's how it looks like-&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_8W4aFuulEZs/S01v6LJZ2FI/AAAAAAAACVQ/K_6tq8lHaT8/s1600-h/opaque.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 184px;" src="http://1.bp.blogspot.com/_8W4aFuulEZs/S01v6LJZ2FI/AAAAAAAACVQ/K_6tq8lHaT8/s320/opaque.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5426116171266644050" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-8347347363764373444?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/8347347363764373444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/01/opaque-background-with-gradient.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/8347347363764373444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/8347347363764373444'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/01/opaque-background-with-gradient.html' title='Opaque background with gradient'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8W4aFuulEZs/S01v6LJZ2FI/AAAAAAAACVQ/K_6tq8lHaT8/s72-c/opaque.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-6777645774509405476</id><published>2010-01-11T06:03:00.000-08:00</published><updated>2010-01-11T06:15:35.008-08:00</updated><title type='text'>Calculate Google Page Rank with Flex/AIR</title><content type='html'>While working on the development of an SEO tool in AIR, I needed to calculate Google Page Rank for a website with given URL.&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/aspnet/Google_Pagerank.aspx"&gt;This&lt;/a&gt; article was what I started with. But mimicking the hashing algorithm developed by &lt;a href="http://www.burtleburtle.net/bob/hash/perfect.html" rel="nofollow" title="Perfect Hashing Algorythm by Bob Jenkins"&gt;Bob Jenkins&lt;/a&gt; from C# to ActionScript was not a good idea that my deadlines could allow.&lt;br /&gt;&lt;br /&gt;I still Googled and fortunately found &lt;a href="http://w3c.us/experience-menu/38-actionscript/49-get-google-pagerank-in-actionscript"&gt;this&lt;/a&gt; one. Here is a summary of the article from &lt;span class="createby"&gt;Louis Lee (not sure he's the original author).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="createby"&gt; Download &lt;a href="http://www.filefactory.com/file/a186ggd/n/FetchPR.as"&gt;FetchPR.as&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="createby"&gt;Add it to your project.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-stretch: normal;font-family:'Times New Roman';font-size:7pt;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span&gt;Initialize the FetchPR’s instance.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Set the callback function of FetchPR&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-stretch: normal;font-family:'Times New Roman';font-size:7pt;"  &gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span&gt;Call FetchPR’s &lt;span style="font-weight: bold;"&gt;getPR&lt;/span&gt; function to get a url’s PR.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;Sample code&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;&lt;br /&gt;import scripts.FetchPR;&lt;br /&gt;import mx.managers.CursorManager;&lt;br /&gt;private var fetchprinstance:FetchPR = new FetchPR();&lt;br /&gt;&lt;br /&gt;private function getPageRank():void&lt;br /&gt;{&lt;br /&gt; CursorManager.setBusyCursor();&lt;br /&gt; fetchprinstance.callback = setResult;&lt;br /&gt; fetchprinstance.getPR(urlbox.text);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public function setResult(pr:Number):void&lt;br /&gt;{&lt;br /&gt; result.text = "PageRank is: " + pr.toString();&lt;br /&gt; CursorManager.removeBusyCursor();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-6777645774509405476?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/6777645774509405476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/01/calculate-google-page-rank-with-flexair.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/6777645774509405476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/6777645774509405476'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/01/calculate-google-page-rank-with-flexair.html' title='Calculate Google Page Rank with Flex/AIR'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7920400656283946410.post-8311423780706526980</id><published>2010-01-11T02:45:00.000-08:00</published><updated>2010-01-11T04:48:08.205-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Accordion'/><category scheme='http://www.blogger.com/atom/ns#' term='multicolor'/><title type='text'>Flex accordion with multiple color tabs</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_8W4aFuulEZs/S0sdzHnCKWI/AAAAAAAACUo/eiPIaYYghTA/s1600-h/image1.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 220px; height: 163px;" src="http://4.bp.blogspot.com/_8W4aFuulEZs/S0sdzHnCKWI/AAAAAAAACUo/eiPIaYYghTA/s320/image1.JPG" alt="" id="BLOGGER_PHOTO_ID_5425462940151196002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I thought it would be good to start with sharing my recent research on coloring the Accordion tabs. Here is the MXML:  &lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:style&amp;gt;&lt;br /&gt;     AccordionHeader&lt;br /&gt;     {&lt;br /&gt;       fillAlphas: 1, 1;&lt;br /&gt;       cornerRadius: 4;&lt;br /&gt;       downSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;       overSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;       upSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;       selectedDownSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;       selectedOverSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;       selectedUpSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;       disabledSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;       selectedDisabledSkin: ClassReference("mx.skins.halo.ButtonSkin");&lt;br /&gt;    }&lt;br /&gt;&amp;lt;/mx:style&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mx:accordion x="0" id="accMain" width="88%" height="88%" backgroundalpha="0" creationcomplete="accordionInit()"&lt;br /&gt; rotation="0"&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox label="Google Page Rank" width="100%" height="100%" backgroundAlpha="0" backgroundColor="#FFFFFF" paddingTop="10" paddingLeft="10"&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;mx:HBox width="100%"  &amp;gt;&lt;br /&gt;    &amp;lt;mx:Text  text="URL:"/&amp;gt; &amp;lt;mx:TextInput  id="urlbox" backgroundAlpha="0.1"  width="345"/&amp;gt;&lt;br /&gt; &amp;lt;/mx:HBox&amp;gt;&lt;br /&gt; &amp;lt;mx:HBox width="100%"&amp;gt;&lt;br /&gt;  &amp;lt;mx:Button label="Get PR!" click="getPageRank();" /&amp;gt;&lt;br /&gt; &amp;lt;/mx:HBox&amp;gt;&lt;br /&gt; &amp;lt;mx:HBox width="100%" &amp;gt;&lt;br /&gt;   &amp;lt;mx:Text text="PageRank is:"  id="result"/&amp;gt;&lt;br /&gt; &amp;lt;/mx:HBox&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox label="Other" width="100%" height="100%" backgroundColor="#FFFFFF"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox label="Other" width="100%" height="100%" backgroundColor="#FFFFFF"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox label="Other" width="100%" height="100%" backgroundColor="#FFFFFF"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox label="Other" width="100%" height="100%" backgroundColor="#FFFFFF"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox label="Other" width="100%" height="100%" backgroundColor="#FFFFFF"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;mx:VBox label="Other" width="100%" height="100%" backgroundColor="#FFFFFF"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mx:VBox&amp;gt;&lt;br /&gt;&amp;lt;/mx:accordion&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here is the actionscript:&lt;br /&gt;&lt;pre name="code" class="Cpp"&gt;&lt;br /&gt;private function accordionInit():void&lt;br /&gt;{&lt;br /&gt;accMain.getHeaderAt(0).setStyle("fillColors", ["#6E0404", "#6E0404"]);&lt;br /&gt;accMain.getHeaderAt(0).setStyle("themeColor", "#6E0404");&lt;br /&gt;accMain.getHeaderAt(0).setStyle("color", "#FFFFFF");&lt;br /&gt;&lt;br /&gt;accMain.getHeaderAt(1).setStyle("fillColors", ["#A30505", "#A30505"]);&lt;br /&gt;accMain.getHeaderAt(1).setStyle("themeColor", "#A30505");&lt;br /&gt;accMain.getHeaderAt(1).setStyle("color", "#FFFFFF");&lt;br /&gt;&lt;br /&gt;accMain.getHeaderAt(2).setStyle("fillColors", ["#E30707", "#E30707"]);&lt;br /&gt;accMain.getHeaderAt(2).setStyle("themeColor", "#E30707");&lt;br /&gt;accMain.getHeaderAt(2).setStyle("color", "#FFFFFF");&lt;br /&gt;&lt;br /&gt;accMain.getHeaderAt(3).setStyle("fillColors", ["#F93737", "#F93737"]);&lt;br /&gt;accMain.getHeaderAt(3).setStyle("themeColor", "#F93737");&lt;br /&gt;accMain.getHeaderAt(3).setStyle("color", "#FFFFFF");&lt;br /&gt;&lt;br /&gt;accMain.getHeaderAt(4).setStyle("fillColors", ["#FB6F6F", "#FB6F6F"]);&lt;br /&gt;accMain.getHeaderAt(4).setStyle("themeColor", "#FB6F6F");&lt;br /&gt;accMain.getHeaderAt(4).setStyle("color", "#FFFFFF");&lt;br /&gt;&lt;br /&gt;accMain.getHeaderAt(5).setStyle("fillColors", ["#FC9898", "#FC9898"]);&lt;br /&gt;accMain.getHeaderAt(5).setStyle("themeColor", "#FC9898");&lt;br /&gt;accMain.getHeaderAt(5).setStyle("color", "#FFFFFF");&lt;br /&gt;&lt;br /&gt;accMain.getHeaderAt(6).setStyle("fillColors", ["#FDC9C9", "#FDC9C9"]);&lt;br /&gt;accMain.getHeaderAt(6).setStyle("themeColor", "#FDC9C9");&lt;br /&gt;accMain.getHeaderAt(6).setStyle("color", "#FFFFFF");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7920400656283946410-8311423780706526980?l=magicalflex.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://magicalflex.blogspot.com/feeds/8311423780706526980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://magicalflex.blogspot.com/2010/01/flex-accordion-with-multiple-color-tabs.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/8311423780706526980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7920400656283946410/posts/default/8311423780706526980'/><link rel='alternate' type='text/html' href='http://magicalflex.blogspot.com/2010/01/flex-accordion-with-multiple-color-tabs.html' title='Flex accordion with multiple color tabs'/><author><name>Arpit Khandelwal</name><uri>http://www.blogger.com/profile/05954405367025998346</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_8W4aFuulEZs/S0sdzHnCKWI/AAAAAAAACUo/eiPIaYYghTA/s72-c/image1.JPG' height='72' width='72'/><thr:total>3</thr:total></entry></feed>
