<?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>RiaCodes &#187; Air</title>
	<atom:link href="http://www.riacodes.com/category/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.riacodes.com</link>
	<description>Resources, tutorials , tips &#38; tricks for RIA : Flex, Flash, Air, AS3</description>
	<lastBuildDate>Thu, 15 Jul 2010 16:11:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Watch Adobe Max 2009 Sessions</title>
		<link>http://www.riacodes.com/flex/watch-adobe-max-2009-sessions/</link>
		<comments>http://www.riacodes.com/flex/watch-adobe-max-2009-sessions/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 08:42:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Air]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.riacodes.com/?p=853</guid>
		<description><![CDATA[<img src="http://www.files.riacodes.com/flash_adobe-max2009/preview.jpg"/>]]></description>
			<content:encoded><![CDATA[<p>Watch and learn from videos of Adobe MAX 2009 sessions that are available for free at the Adobe TV.<br />
<span id="more-853"></span><br />
These sessions covers topics like </p>
<p>MAX 2009 DEVELOP<br />
<a href="http://tv.adobe.com/show/max-2009-develop/" target="_blank">http://tv.adobe.com/show/max-2009-develop/</a></p>
<ul>
<li>Practical Actionscript 3.0 For Flash CS3 and CS4</li>
<li>What&#8217;s new in Flash Player</li>
<li>Things every flash developer should know</li>
<li>Actionscript 3.0 Tastes Good (And is Good for You Too !)</li>
<li>The Advantages of Flex</li>
<li>Killer Text in Flash with The Text Layout Framework</li>
<li>What&#8217;s Coming in Adobe AIR 2</li>
</ul>
<p>MAX 2009 DESIGN<br />
<a href="http://tv.adobe.com/show/max-2009-design/" target="_blank">http://tv.adobe.com/show/max-2009-design/</a></p>
<ul>
<li>Secret Session : Flash Professional</li>
<li>Multi-Touch and the Flash Platform</li>
<li>Flash Professional, Flash Catalyst, and Flash Builder : Fact, Features and (Work)Flows</li>
</ul>
<p>and so much more &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riacodes.com/flex/watch-adobe-max-2009-sessions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Desktop RSS Reader with Air &amp; Flex</title>
		<link>http://www.riacodes.com/flex/desktop-rss-reader-with-air-flex/</link>
		<comments>http://www.riacodes.com/flex/desktop-rss-reader-with-air-flex/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 14:46:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Air]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.riacodes.com/?p=456</guid>
		<description><![CDATA[<img src="http://files.riacodes.com/air_flex_rss-reader/preview.jpg"/>]]></description>
			<content:encoded><![CDATA[<p>The following tutorial will teach you how to create a desktop RSS reader by using Air in Flex.</p>
<p><span id="more-456"></span></p>
<div class="demosource"><a href="http://files.riacodes.com/air_flex_rss-reader/AirRSSReader.air"><img src="http://www.riacodes.com/wp-content/themes/riacodes/images/icons/download.png" alt="Download Source" /></a></div>
<p>Here is a preview of what we are going to achieve.</p>
<p><img src="http://files.riacodes.com/air_flex_rss-reader/0.gif" alt="Screenshot"/></p>
<p><em>1.</em> In flex, create a new Air project named AirRSSReader, leave the name of the main MXML as it is and set its layout to vertical.</p>
<p><em>2.</em> Open the mxml application file. Set its size to 700&#215;450.<br />
Add an HTTPService component that we will use to load the RSS feed. Give it an id of &#8220;RSSFeed&#8221; and set its url property to the url of the RSS feed that you want to display.<br />
In our case, we choose the Yahoo Technology feed : <a href="http://rss.news.yahoo.com/rss/tech" target="_blank">http://rss.news.yahoo.com/rss/tech</a>.  We found the url at <a href="http://news.yahoo.com/rss" target="_blank">http://news.yahoo.com/rss</a><br />
Set the showBusyCursor property to true to display a busy cursor while the service is executing.<br />
For the result Event we call a resultHandler function that we will create next.</p>
<pre class="brush: xml;">
&lt;mx:HTTPService id=&quot;RSSFeed&quot; url=&quot;http://rss.news.yahoo.com/rss/tech&quot;
		result=&quot;resultHandler(event)&quot;/&gt;
</pre>
<p><em>3.</em> In the creationComplete event handler for the WindowedApplication container, invoke the service by calling the send() method.</p>
<pre class="brush: xml; highlight: [3];">
&lt;mx:WindowedApplication xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot;
	backgroundGradientAlphas=&quot;[1.0, 1.0]&quot; backgroundGradientColors=&quot;[#000000, #000000]&quot;
	width=&quot;700&quot; height=&quot;450
        creationComplete=&quot;RSSFeed.send();&quot; &gt;
</pre>
<p><em>4.</em> Open a Script tag to write actionscript code.<br />
In the resultHandler function, we want to retrieve the items from the RSS feed.<br />
To do so, first declare a Bindable ArrayCollection variable that will be used to store the datas. </p>
<pre class="brush: xml;">
&lt;mx:Script&gt;
		&lt;![CDATA[
			import mx.rpc.events.ResultEvent;
			import mx.collections.ArrayCollection;

			[Bindable]
			private var datas:ArrayCollection;

			private function resultHandler(event:ResultEvent):void{

			}

		]]&gt;
&lt;/mx:Script&gt;
</pre>
<p>You need to have in mind the structure of an rss file to retrieve the items. The stucture of the RSS looks like this : </p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot; ?&gt;
&lt;rss version=&quot;2.0&quot; xmlns:media=&quot;http://search.yahoo.com/mrss/&quot; xmlns:ynews=&quot;http://news.yahoo.com/rss/&quot;&gt;
&lt;channel&gt;
	&lt;title&gt;Yahoo! News: Technology News&lt;/title&gt;
	&lt;copyright&gt;Copyright (c) 2009 Yahoo! Inc. All rights reserved.&lt;/copyright&gt;
	&lt;link&gt;http://news.yahoo.com/i/738&lt;/link&gt;
	&lt;category&gt;technology&lt;/category&gt;
	&lt;description&gt;Technology News&lt;/description&gt;
	&lt;language&gt;en-us&lt;/language&gt;
	&lt;lastBuildDate&gt;Thu, 16 Jul 2009 14:02:39 GMT&lt;/lastBuildDate&gt;

	&lt;ttl&gt;5&lt;/ttl&gt;
	&lt;image&gt;
		&lt;title&gt;Yahoo! News&lt;/title&gt;
		&lt;width&gt;142&lt;/width&gt;
		&lt;height&gt;18&lt;/height&gt;
		&lt;link&gt;http://news.yahoo.com/i/738&lt;/link&gt;
		&lt;url&gt;http://l.yimg.com/a/i/us/nws/th/main_142b.gif&lt;/url&gt;
	&lt;/image&gt;

	&lt;item&gt;
		&lt;title&gt;Twitter hacked by old technique &amp;#151; again
		    (AP)
		&lt;/title&gt;
 		&lt;link&gt;http://us.rd.yahoo.com/dailynews/rss/tech/*http://news.yahoo.com/s/ap/2009
0716/ap_on_hi_te/us_tec_twitter_hacked&lt;/link&gt;
 		&lt;guid isPermaLink=&quot;false&quot;&gt;ap/20090716/us_tec_twitter_hacked&lt;/guid&gt;
		&lt;source&gt;AP&lt;/source&gt;
		&lt;category&gt;technology&lt;/category&gt;
		&lt;pubDate&gt;Thu, 16 Jul 2009 00:30:01 GMT&lt;/pubDate&gt;
		&lt;description&gt;AP - Breaking into someone's e-mail can be child's play for a determined hacker, as Twitter Inc. employees have learned the hard way again.&lt;/description&gt;
	&lt;/item&gt;
	&lt;item&gt;
		&lt;title&gt;Nokia posts 66 pct fall in Q2 profits, shares drop
		    (AP)
		&lt;/title&gt;
		 &lt;link&gt;http://us.rd.yahoo.com/dailynews/rss/tech/*http://news.yahoo.com/s/ap/2009
0716/ap_on_hi_te/eu_finland_earns_nokia&lt;/link&gt;
		 &lt;guid isPermaLink=&quot;false&quot;&gt;ap/20090716/eu_finland_earns_nokia&lt;/guid&gt;
		&lt;source&gt;AP&lt;/source&gt;
		&lt;category&gt;technology&lt;/category&gt;
		&lt;pubDate&gt;Thu, 16 Jul 2009 13:44:38 GMT&lt;/pubDate&gt;
		&lt;description&gt;AP - The world's top cell phone maker, Nokia Corp., on Thursday said second-quarter earnings fell 66 percent as the global recession sapped demand. The company scrapped its target to gain market share this year and its stock sagged.&lt;/description&gt;
	&lt;/item&gt;

  ...

&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<p>What interest us are the item element.<br />
Knowing the structure, we can now write the resultHandler function :</p>
<pre class="brush: xml;">
private function resultHandler(event:ResultEvent):void{
	datas = event.result.rss.channel.item;
}
</pre>
<p><em>5.</em> So far, the RSS datas are stored in the datas variable. To display them, add a Datagrid component and set its id to &#8220;news&#8221;.<br />
Bind its dataProvider to the datas variables.  </p>
<pre class="brush: xml;">
&lt;mx:DataGrid id=&quot;news&quot; dataProvider=&quot;{datas}&quot;
        width=&quot;650&quot; height=&quot;200&quot;&gt;
&lt;/mx:DataGrid&gt;
</pre>
<p>At this point, if you try to run the application  you should obtain something like this : </p>
<p><img src="http://files.riacodes.com/air_flex_rss-reader/1.gif" alt="Screenshot"/></p>
<p>All works fine, except that we don&#8217;t want to display all of theses datas in the datagrid. </p>
<p><em>6.</em> Within the datagrid, to display only the title and the publication date of each item, we add 2 DatagridColumn component inside a <mx:columns> tag.<br />
For the first DatagridColumn, set its headerText property to &#8220;Title&#8221;. Set its dataField to title.<br />
For the second DatagridColumn, set its headerText property to &#8221; Publication Date&#8221;. Set its dataField to pubDate.<br />
(<strong>Important </strong>: the values that we&#8217;ve set for the dataField of each DatagridColumn must match with the element name in the RSS structure)</p>
<pre class="brush: xml;">
&lt;mx:DataGrid id=&quot;news&quot;
		dataProvider=&quot;{datas}&quot; width=&quot;650&quot; height=&quot;200&quot;&gt;
		&lt;mx:columns&gt;
			&lt;mx:DataGridColumn dataField=&quot;title&quot; headerText=&quot;Title&quot; width=&quot;400&quot;/&gt;
			&lt;mx:DataGridColumn dataField=&quot;pubDate&quot; headerText=&quot;Publication Date&quot;/&gt;
		&lt;/mx:columns&gt;
&lt;/mx:DataGrid&gt;
</pre>
<p><em>7.</em> Now if you run the application, you should see this : </p>
<p><img src="http://files.riacodes.com/air_flex_rss-reader/2.gif" alt="Screenshot"/></p>
<p><em>8.</em> Next we want to show more stuff when the user clicks on an item of the datagrid.<br />
We will display the description of the article selected in the Datagrid and a Button that create a link to the full article.</p>
<p><em>9.</em> Beneath the Datagrid component, add a TextArea Component. To display the description, we bind its htmlText property with the description of the selectedItem of the datagrid.</p>
<pre class="brush: xml;">
&lt;mx:TextArea htmlText=&quot;{news.selectedItem.description}&quot;
		height=&quot;121&quot; width=&quot;420&quot; /&gt;
</pre>
<p><em>10.</em> Then add a Button component with a label of &#8220;Read Full Story&#8221;.<br />
For the click event, we call the navigateToURL function  with the link of the selectItem as parameter that we enclose in an URLRequest object.<br />
Also it might have a problem if the user clicks the button but has not yet selected an article within the datagrid. Indeed the news.selectedItem.link parameter would be null and this will cause an error. To avoid that, we set the enabled property to {news.selectedItem!=null}. If news.selectedItem!=null, the button is enabled else it is disabled.</p>
<pre class="brush: xml;">
&lt;mx:Button label=&quot;Read Full Story&quot;
		click=&quot;navigateToURL(new URLRequest(news.selectedItem.link));&quot;
		enabled=&quot;{news.selectedItem!=null}&quot;/&gt;
</pre>
<p><em>11.</em> Finally, we add a Style tag to add some CSS to make the application more pretty.</p>
<p><em>12.</em> Here&#8217;s the final code , run the application to test it.</p>
<pre class="brush: xml;">
&lt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:WindowedApplication xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot;
	backgroundGradientAlphas=&quot;[1.0, 1.0]&quot; backgroundGradientColors=&quot;[#000000, #000000]&quot;
	creationComplete=&quot;RSSFeed.send();&quot; width=&quot;700&quot; height=&quot;450&quot; viewSourceURL=&quot;srcview/index.html&quot;&gt;
		&lt;mx:Style&gt;
		DataGrid {
		   alternatingItemColors: #cccccc, #eff1f2;
		   rollOverColor: #999999;
		   textRollOverColor: #ffffff;
		   selectionColor: #666666;
		   color: #000000;
		   textSelectedColor: #ffffff;
		}

		Button {
		   color: #ffffff;
		   themeColor: #333333;
		}
	&lt;/mx:Style&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[
			import mx.rpc.events.ResultEvent;
			import mx.collections.ArrayCollection;

			[Bindable]
			private var datas:ArrayCollection;

			private function resultHandler(event:ResultEvent):void{
				datas = event.result.rss.channel.item;
			}

		]]&gt;
	&lt;/mx:Script&gt;

	&lt;mx:HTTPService id=&quot;RSSFeed&quot; url=&quot;http://rss.news.yahoo.com/rss/tech&quot;
		showBusyCursor=&quot;true&quot;
		result=&quot;resultHandler(event)&quot;/&gt;
	&lt;mx:DataGrid id=&quot;news&quot;
		dataProvider=&quot;{datas}&quot; width=&quot;650&quot; height=&quot;200&quot;&gt;
		&lt;mx:columns&gt;
			&lt;mx:DataGridColumn dataField=&quot;title&quot; headerText=&quot;Title&quot; width=&quot;400&quot;/&gt;
			&lt;mx:DataGridColumn dataField=&quot;pubDate&quot; headerText=&quot;Publication Date&quot;/&gt;
		&lt;/mx:columns&gt;
	&lt;/mx:DataGrid&gt;
	&lt;mx:TextArea htmlText=&quot;{news.selectedItem.description}&quot;
		height=&quot;150&quot; width=&quot;420&quot;/&gt;
	&lt;mx:Button label=&quot;Read Full Story&quot;
		click=&quot;navigateToURL(new URLRequest(news.selectedItem.link));&quot;
		enabled=&quot;{news.selectedItem!=null}&quot;/&gt;
&lt;/mx:WindowedApplication&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.riacodes.com/flex/desktop-rss-reader-with-air-flex/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Loading PDF files in Air with flex</title>
		<link>http://www.riacodes.com/flex/loading-pdf-files-in-air-with-flex/</link>
		<comments>http://www.riacodes.com/flex/loading-pdf-files-in-air-with-flex/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 11:31:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Air]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.riacodes.com/?p=91</guid>
		<description><![CDATA[<img src="http://www.files.riacodes.com/air_pdf-reader/preview.jpg"/>]]></description>
			<content:encoded><![CDATA[<p>Find how you can render PDF files in Air. This process is very simple and will be done in just a few minutes.<br />
<span id="more-91"></span></p>
<div class="demosource"><a href="http://www.files.riacodes.com/air_pdf-reader/src.zip"><img src="http://www.riacodes.com/wp-content/themes/riacodes/images/icons/download.png" alt="Download Source" /></a></div>
<p><img src="http://www.files.riacodes.com/air_pdf-reader/1.jpg" alt="Screenshot"/></p>
<p><em>1.</em> First, create a new Air project named PdfReader that will also create an mxml file named PdfReader.mxml.<br />
Open it so we can begin to edit our code.</p>
<p><em>2.</em> Like for the <a href=http://www.riacodes.com/flex/webbrowser-in-air-with-flex/>WebBrowser</a> we will use the HTML component. </p>
<p><em>3.</em> The only thing that we have to do is to check if the user has a correct version of Adobe Reader installed because if the user doesn’t have Acrobat Reader 8.1 or later that will not work.</p>
<p><em>4.</em> To do so, we have to detect the PDF capability  with the static property pdfCapability of the HTML class.<br />
The pdfCapability property can be one of the 5 values :</p>
<p><img src="http://www.files.riacodes.com/air_pdf-reader/2.jpg" alt="Screenshot"/></p>
<p>In our case we want to check the if the value is STATUS_OK</p>
<p><em>5.</em> So in our code, add an HTML component to the application and create a function detectPDF that if the PDF capability is OK the nit will set the location of the HTML component to the path of the pdf file else it will call the Alert method to display an error message.</p>
<p><em>6.</em> The whole code is as follow :</p>
<pre class="brush: xml;">
&lt;mx:WindowedApplication xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot;
    creationComplete=&quot;detectPDF()&quot; width=&quot;825&quot; height=&quot;625&quot;&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
        import mx.controls.Alert;

        private function detectPDF():void{
            if(HTML.pdfCapability== HTMLPDFCapability.STATUS_OK)
            {
            	reader.location = &quot;assets/test.pdf&quot;;
            }
            else{
            	Alert.show(&quot;Can't display PDF content&quot;,&quot;Problem&quot;);
            }
        }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:HTML id=&quot;reader&quot; width=&quot;100%&quot; height=&quot;100%&quot;/&gt;
&lt;/mx:WindowedApplication&gt;
</pre>
<p><em>7.</em> Run the application to test it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riacodes.com/flex/loading-pdf-files-in-air-with-flex/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Web browser in Air with flex</title>
		<link>http://www.riacodes.com/flex/webbrowser-in-air-with-flex/</link>
		<comments>http://www.riacodes.com/flex/webbrowser-in-air-with-flex/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 13:15:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Air]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.riacodes.com/?p=44</guid>
		<description><![CDATA[<img src="http://www.files.riacodes.com/air_web-browser/preview.jpg"/>]]></description>
			<content:encoded><![CDATA[<p>Learn how to create your own web browser by using the HTML component in AIR.<br />
<span id="more-44"></span></p>
<div class="demosource"><a href="http://www.files.riacodes.com/air_web-browser/src.zip"><img src="http://www.riacodes.com/wp-content/themes/riacodes/images/icons/download.png" alt="Download Source" /></a></div>
<p><img src="http://www.files.riacodes.com/air_web-browser/1.jpg" alt="Screenshot"/></p>
<p>The HTML component  displays full HTML content within your AIR applications. In this tutorial we are going to build our own web browser with an adress bar and forward and back history controls.</p>
<p><em>1.</em> To get started, create a new Air project named WebBrowser that will also create an mxml file named WebBrowser.mxml. Open it so we can begin to add our code and set the layout of the WindowedApplication to vertical.</p>
<p><em>2.</em> Insert the following code between the WindowedApplication tags :</p>
<pre class="brush: xml;">
&lt;mx:ApplicationControlBar dock=&quot;true&quot; fillAlphas=&quot;[1.0, 1.0]&quot;
        fillColors=&quot;[#0E0847, #FFFFFF]&quot;&gt;
		&lt;mx:Label text=&quot;AIR WEB BROWSER&quot; fontWeight=&quot;bold&quot;
                        fontSize=&quot;12&quot; color=&quot;#990000&quot;/&gt;
		&lt;mx:Label text=&quot;Enter URL:&quot;/&gt;
		&lt;mx:TextInput id=&quot;urlInput&quot;/&gt;
		&lt;mx:Button label=&quot;GO&quot;()&quot; /&gt;
		&lt;mx:Spacer width=&quot;100%&quot;/&gt;
		&lt;mx:Button label=&quot;Back&quot; /&gt;
		&lt;mx:Button label=&quot;Forward&quot;/&gt;
&lt;/mx:ApplicationControlBar&gt;
&lt;mx:HTML id=&quot;browser&quot; height=&quot;100%&quot; width=&quot;100%&quot;/&gt;
</pre>
<p>This is the base of our code. We have just added the controls and the HTML component.</p>
<p><em>3.</em> Let&#8217;s add the functions. To do so, first add a script tag and declare a variable myURL as a String and set it as [Bindable]. Next create a goToURL function that will change the location of the HTML component. The function will check if the &#8216;http&#8217; is already in the url that the user has typed and if not will add &#8216;http&#8217; at the beginning.<br />
The code looks like that:</p>
<pre class="brush: xml;">
&lt;mx:Script&gt;
	&lt;![CDATA[

          [Bindable]
          private var myURL:String = &quot;http://&quot;;

	  private function goToUrl():void{
		myURL = urlInput.text;
		if (myURL.substr(0,4) != &quot;http&quot;)
       		{
         		myURL = &quot;http://&quot; + myURL;
        	}
		browser.location = myURL;
	 }

         ]]&gt;
	&lt;/mx:Script&gt;
</pre>
<p><em>4.</em> Now we have to call the functions. Bind the text property of the TextInput to the variable myURL that we have declared before. The goToURL function will be called if the user press enter  on the textinput or click on the Go button. Finally the functions for the history controls are very simple , we use the historyBack and historyForward methods of the HTML component.<br />
So we have added to our code the following</p>
<pre class="brush: xml;">
&lt;mx:TextInput id=&quot;urlInput&quot; enter=&quot;goToUrl()&quot; text=&quot;{myURL}&quot;/&gt;
&lt;mx:Button label=&quot;GO&quot; click=&quot;goToUrl()&quot; /&gt;
&lt;mx:Button label=&quot;Back&quot; click=&quot;browser.historyBack()&quot; /&gt;
&lt;mx:Button label=&quot;Forward&quot; click=&quot;browser.historyForward()&quot;/&gt;
</pre>
<p><em>5.</em> The final code looks like beneath. Run the application to test it.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:WindowedApplication xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot;&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[

		[Bindable]
		 private var myUrl:String = &quot;http://&quot;;

		 private function goToUrl():void{
			myUrl = urlInput.text;
			if (myUrl.substr(0,4) != &quot;http&quot;)
       		{
         		myUrl = &quot;http://&quot; + myUrl;
        	}
			browser.location = myUrl;
		}

		]]&gt;
	&lt;/mx:Script&gt;

	&lt;mx:ApplicationControlBar dock=&quot;true&quot; fillAlphas=&quot;[1.0, 1.0]&quot;
                     fillColors=&quot;[#0E0847, #FFFFFF]&quot;&gt;
		&lt;mx:Label text=&quot;AIR WEB BROWSER&quot; fontWeight=&quot;bold&quot;
                       fontSize=&quot;12&quot; color=&quot;#990000&quot;/&gt;
		&lt;mx:Label text=&quot;Enter URL:&quot;/&gt;
		&lt;mx:TextInput id=&quot;urlInput&quot; enter=&quot;goToUrl()&quot; text=&quot;{myUrl}&quot;/&gt;
		&lt;mx:Button label=&quot;GO&quot; click=&quot;goToUrl()&quot; /&gt;
		&lt;mx:Spacer width=&quot;100%&quot;/&gt;
		&lt;mx:Button label=&quot;Back&quot; click=&quot;browser.historyBack()&quot; /&gt;
		&lt;mx:Button label=&quot;Forward&quot; click=&quot;browser.historyForward()&quot;/&gt;
	&lt;/mx:ApplicationControlBar&gt;

    &lt;mx:HTML id=&quot;browser&quot; height=&quot;100%&quot; width=&quot;100%&quot;/&gt;

&lt;/mx:WindowedApplication&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.riacodes.com/flex/webbrowser-in-air-with-flex/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
