<?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>beThinker Concepts - Knowledge in many different ways &#187; Flex</title>
	<atom:link href="http://www.bethinkerconcepts.com/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bethinkerconcepts.com</link>
	<description>beThinkerConcepts.com is a variaty of tutorials that help improve those beginner in web development.</description>
	<lastBuildDate>Mon, 29 Mar 2010 14:17:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Making Charts in Flex Builder 3</title>
		<link>http://www.bethinkerconcepts.com/2010/03/making-charts-in-flex-builder-3/</link>
		<comments>http://www.bethinkerconcepts.com/2010/03/making-charts-in-flex-builder-3/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 02:05:19 +0000</pubDate>
		<dc:creator>beThinker</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Area Charts]]></category>
		<category><![CDATA[Bar Charts]]></category>
		<category><![CDATA[Bubble Charts]]></category>
		<category><![CDATA[Candlestick Charts]]></category>
		<category><![CDATA[Charts]]></category>
		<category><![CDATA[Column Charts]]></category>
		<category><![CDATA[HighLowOpenClose Charts]]></category>
		<category><![CDATA[Line Charts]]></category>
		<category><![CDATA[Pie Charts]]></category>
		<category><![CDATA[Plot Charts]]></category>

		<guid isPermaLink="false">http://www.bethinkerconcepts.com/?p=67</guid>
		<description><![CDATA[Flex supports some of the most common types of two-dimensional charts (such as bar, column, and pie charts) and gives you a great of control over the appearance of charts. Charting is one type of data visualization in which you create two-dimensional representations of your data.
Simple chart shows a single data series, where a series [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bethinkerconcepts.com/wp-content/uploads/2010/03/barCharts.jpg"><img src="http://www.bethinkerconcepts.com/wp-content/uploads/2010/03/barCharts.jpg" alt="" title="barCharts" width="150" height="150" class="alignleft size-full wp-image-143" /></a>Flex supports some of the most common types of two-dimensional charts (such as bar, column, and pie charts) and gives you a great of control over the appearance of charts. Charting is one type of data visualization in which you create two-dimensional representations of your data.</p>
<p>Simple chart shows a single data series, where a series is a group of related data points. For example, a data series might be a company profits. Another chart might be add a second data series. You might include the percentage growth of profits over the same business quarters.</p>
<p>Now, I assumed that you already have a Flex Builder Professional installed in your pc or you can go to Adobe website.</p>
<p><span id="more-67"></span><br />
Flex charting controls lets you create some of the most common chart types, and also lets you customize the appearance of you charts. The charting controls are located in the mx.chart.* package.</p>
<p>The following tables lists the supported chart types, the name of the control class, and the name of the series class that you use to define what data appears in each chart.</p>
<table>
<tr>
<td><strong>Chart Type</strong></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><strong>Chart Control Class</strong></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><strong>Chart Series Class</strong></td>
</tr>
<tr>
<td>Area</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>AreaChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>AreaSeries</td>
</tr>
<tr>
<td>Bar</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>BarChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>BarSeries</td>
</tr>
<tr>
<td>Bubble</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>BubbleChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>BubbleSeries</td>
</tr>
<tr>
<td>Candlestick</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>CandlestickChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>CandlestickSeries</td>
</tr>
<tr>
<td>Column</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>ColumnChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>ColumnSeries</td>
</tr>
<tr>
<td>HighLowOpenClose</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>HLOChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>HLOSeries</td>
</tr>
<tr>
<td>Line</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>LineChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>LineSeries</td>
</tr>
<tr>
<td>Pie</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>PieChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>PieSeries</td>
</tr>
<tr>
<td>Plot</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>PlotChart</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>PlotSeries</td>
</tr>
</table>
<p>In this example, will be using the Bar chart but before we begin lets try to look the BarChart and BarSeries Class description.</p>
<p><strong>BarChart</strong><br />
The BarChart control represents data as a series of horizontal bars whose length is determined by values in the data. A BarChart control can represent different chart variations, including simple bars, clustered bars, stacked, 100% stacked, and high/low.</p>
<p>The BarChart control expects its <em>series </em>property to contain an array of BarSeries objects.</p>
<p>Stacked and 100% bar charts override the <em>minField </em>property of their BarSeries objects.</p>
<p><strong>BarSeries</strong><br />
Defines a data series for a BarChart control. By default, this class uses BoxItemRenderer class. Optionally, you can define an itemRenderer for the data series. The itemRenderer must implement the IDataRenderer interface.</p>
<p>yField &#8211; Specifies the field of the data provider that determines the y-axis location of the base of each bar in the chart. If you omit this property, Flex arranges the bars in the order of the data in the data provider.</p>
<p>xField &#8211; Specifies the field of the data provider that determines the x-axis location of the end of each bar.</p>
<p>miniField &#8211; Specifies the field of the data provider that determines the x-axis location of the base of a bar. This property has no effect in overlaid, stacked, or 100% stacked charts. For more information on using the minField property.</p>
<p>The following example creates a simple BarChart control:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><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 /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt; <br />
&nbsp; &nbsp; &lt;mx:Script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import mx.collections.ArrayCollection;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [Bindable]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public var expenses:ArrayCollection = new ArrayCollection([<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {Month:&quot;January&quot;, Profit:4400, Expenses:2000},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {Month:&quot;February&quot;, Profit:2600, Expenses:400},<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {Month:&quot;March&quot;, Profit:3300, Expenses:1000}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;<br />
&nbsp; &nbsp; &lt;/mx:Script&gt;<br />
&nbsp; &nbsp; &lt;mx:Panel title=&quot;Bar Chart&quot; horizontalAlign=&quot;left&quot; verticalAlign=&quot;top&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:BarChart id=&quot;myChart&quot; dataProvider=&quot;{expenses}&quot; showDataTips=&quot;true&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:verticalAxis&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:CategoryAxis dataProvider=&quot;{expenses}&quot; categoryField=&quot;Month&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:verticalAxis&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:series&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:BarSeries yField=&quot;Month&quot; xField=&quot;Profit&quot; displayName=&quot;Profit&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:BarSeries yField=&quot;Month&quot; xField=&quot;Expenses&quot; displayName=&quot;Expenses&quot;/&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:series&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mx:BarChart&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;mx:Legend dataProvider=&quot;{myChart}&quot;/&gt;<br />
&nbsp; &nbsp; &lt;/mx:Panel&gt;<br />
&lt;/mx:Application&gt;</div></td></tr></tbody></table></div>
<p>A bar chart is essentially a column chart rotated 90 degress clockwise; therefore, bar charts and column charts share many of the same characteristics. For more information please see the live doc in Adobe Flex, <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_01.html">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bethinkerconcepts.com/2010/03/making-charts-in-flex-builder-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML basics into Flex</title>
		<link>http://www.bethinkerconcepts.com/2009/06/xml-basics-into-flex/</link>
		<comments>http://www.bethinkerconcepts.com/2009/06/xml-basics-into-flex/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 03:03:52 +0000</pubDate>
		<dc:creator>beThinker</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[parsing data]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.bethinkerconcepts.com/?p=40</guid>
		<description><![CDATA[In this tutorial will teach you the basic on how to load an external XML file into Flex Builder 3 and then filter each result into labels.

Set up your workspace by open up the Flex Builder 3 and start a new MXML application. I have named mine XMLbasics for this example. Set the layout to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-41" title="xmlbasic" src="http://www.bethinkerconcepts.com/wp-content/uploads/2009/06/xmlbasic.jpg" alt="xmlbasic" width="150" height="150" />In this tutorial will teach you the basic on how to load an external XML file into Flex Builder 3 and then filter each result into labels.<br />
<strong></strong><br />
Set up your workspace by open up the Flex Builder 3 and start a new MXML application. I have named mine XMLbasics for this example. Set the layout to vertical and press the finish button.<br />
<strong></strong><br />
Before we can load an XML file we&#8217;ll need to have one. I&#8217;ve made one for this tutorial, <a href="http://www.bethinkerconcepts.com/live/XMLbasics/assets/content.xml">download here</a>.Now right click within your &#8220;src&#8221; folder and then select new folder &#8220;assets&#8221; and save your content.xml file or import the downloaded XML file into this folder. Once you&#8217;re done that and we&#8217;re ready to link this file into the Flex document.<br />
<strong></strong><br />
<span id="more-40"></span> </p>
<h2>How to Load the XML?</h2>
<p>MXML makes loading external files easy with the HTTPService tag. The HTTPService tag can have a single request tag under which the parameters can be specified. Insert the code below under the opening application tag.</p>
<div class="codecolorer-container xml 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="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HTTPService</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;assets/content.xml&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;siteData&quot;</span> <span style="color: #000066;">resultFormat</span>=<span style="color: #ff0000;">&quot;e4x&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
Now you just created an HTTP Service with an id of &#8220;siteData&#8221; which links to the XML file in the assets folder. The results are <a href="http://en.wikipedia.org/wiki/E4X">formatted in e4x</a>, which allow us to filter through the contents of the XML. In order for this url to be loaded, we must tell the application to send the request. Add the event &#8220;creationComplete&#8221; to the opening application tag.</p>
<div class="codecolorer-container xml 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="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span> <span style="color: #000066;">creationComplete</span>=<span style="color: #ff0000;">&quot;siteData.send()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
When the page loads the creationComplete is called. In the above code when the page is finished loading then the HTTPService named &#8220;siteData&#8221; should be sent. You can test you application now without errors if the XML is being loaded correctly.<br />
<strong></strong><br />
Will need a storage variable for XML data to store itself while we work it. Insert a script tag below the opening application tag and declare the following variable.</p>
<div class="codecolorer-container xml 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 /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp;<br />
&nbsp; &nbsp;<span style="color: #339933;">&lt;![CDATA[ </span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp;private var siteContent:XMLList; </span><br />
<span style="color: #339933;"> &nbsp; ]]&gt;</span> &nbsp;<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
XMLList type allows us to load XML data in and access each node. Now creat a function that will load data from the XML file and display it in labels. Insert the code below in the script tag.</p>
<div class="codecolorer-container actionscript 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 /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> showPage<span style="color: #66cc66;">&#40;</span>targetPage:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span> &nbsp;<br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Search for title of target page &nbsp;</span><br />
&nbsp; &nbsp; siteContent = siteData.<span style="color: #006600;">lastResult</span>.<span style="color: #006600;">page</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>location==targetPage<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">title</span>; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Show result in label &nbsp;</span><br />
&nbsp; &nbsp; headerText.<span style="color: #0066CC;">text</span>=siteContent; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Search for body text of target page &nbsp;</span><br />
&nbsp; &nbsp; siteContent = siteData.<span style="color: #006600;">lastResult</span>.<span style="color: #006600;">page</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>location==targetPage<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">text</span>; &nbsp;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//Show result in label &nbsp;</span><br />
&nbsp; &nbsp; bodyText.<span style="color: #0066CC;">text</span>=siteContent; &nbsp;<br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
Insert some components below the HTTPService tag for the results. Will add buttons to control navigation.</p>
<div class="codecolorer-container xml 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 /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:VBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Label</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;24&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;headerText&quot;</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Click a Button&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Label</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bodyText&quot;</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;The choice is yours!&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Home Page&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;showPage('home')&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;About Page&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;showPage('about')&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Contact Us&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;showPage('contact')&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:HBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:VBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
Run your application. If everything is working as it should. When a button is pressed the data from the XML file is loaded up for each page. Try loading a url of an image from an XML file with Flex Builder 3. XML has a wide number of posibilities to explore.</p>
<p>See the live demo, <a href="http://www.bethinkerconcepts.com/live/XMLbasics/XMLbasics.html" target="_blank">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bethinkerconcepts.com/2009/06/xml-basics-into-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding Browser into Flex 3</title>
		<link>http://www.bethinkerconcepts.com/2009/06/embedding-browser-into-flex-3/</link>
		<comments>http://www.bethinkerconcepts.com/2009/06/embedding-browser-into-flex-3/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 08:51:08 +0000</pubDate>
		<dc:creator>beThinker</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Desktop Application]]></category>

		<guid isPermaLink="false">http://www.bethinkerconcepts.com/?p=5</guid>
		<description><![CDATA[
This tutorial teaches you how to create Adobe Air(Adobe Integrated Runtime) Desktop application using Flex Builder 3. The Air Engine include integrated web browser kernel that is base on the web kit kernel same with Safari browser.The example below show you how to embed a browser into Adobe Flex 3.
First thing first, you must have [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-thumbnail wp-image-15 alignleft" title="AIR Application" src="http://www.bethinkerconcepts.com/wp-content/uploads/2009/06/air-150x150.jpg" alt="Air Application" width="150" height="150" /><br />
This tutorial teaches you how to create Adobe Air(Adobe Integrated Runtime) Desktop application using Flex Builder 3. The Air Engine include integrated web browser kernel that is base on the web kit kernel same with Safari browser.The example below show you how to embed a browser into Adobe Flex 3.</p>
<p>First thing first, you must have Adobe Flex Builder 3  and Adobe AIR in your system. If you don&#8217;t have one click this link <a href="http://www.adobe.com" target="_blank">www.adobe.com</a>.</p>
<p><span id="more-5"></span></p>
<p>Now, Create new MXML project File&gt;New or shortcut key ALT+SHIFT+N (windows) then chose Flex Project. And type project name, I use HtmlWindow then in Application type chose Desktop application (runs in Adobe AIR) and then click finish. You&#8217;ll see a code in your window just like below:</p>
<div class="codecolorer-container xml 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 /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:WindowedApplication</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:WindowedApplication<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
Then insert this code:</p>
<div class="codecolorer-container xml 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="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HTML</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myBrowser&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;http://www.bethinkerconcepts.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
The <strong>HTML</strong> control lets you display HTML content in your application,<strong> width</strong> and <strong>height </strong>is the size of your application, <strong>location</strong> property to specify the URL of an HTML page whose content is displayed in the control.<br />
<strong></strong><br />
Now, the code should look like this:</p>
<div class="codecolorer-container xml 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 /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:WindowedApplication</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HTML</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myBrowser&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span></span><br />
<span style="color: #009900;"><span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;http://www.bethinkerconcepts.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:WindowedApplication<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
Now lets test your application by pressing Run HTML button or go to RUN-&gt;RUN HTML or shorcut key CTRL+F11.</p>
<p>Next will add some navigation button, so that you can input url and also have a forward and back button. Ok now above HTML tag put a Horizontal Box. Inside that HBox tag, you&#8217;ll to have Label, TextInput and 3 buttons which is Go, Forward and Back. Your code should look like this:</p>
<p>For Label tag:</p>
<div class="codecolorer-container xml 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="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Label</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;ex:(http://www.google.com)url:&quot;</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
For textInput tag which have an id and called myText:</p>
<div class="codecolorer-container xml 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="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:TextInput</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myText&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
For 1st button which is label &#8220;Go There&#8221; and click attributes, location property will change the value of the control&#8217;s.</p>
<div class="codecolorer-container xml 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="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Go There&quot;</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;14&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;myBrowser.location=myText.text&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
For 2nd &amp; 3rd button which is label &#8220;Forward&#8221; and click attribute with historyForward() and historyBack() methods.</p>
<div class="codecolorer-container xml 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 /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Forward&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;myBrowser.historyForward()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Back&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;myBrowser.historyBack()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
Your code now should look like this:</p>
<div class="codecolorer-container xml 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 /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:WindowedApplication</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;vertical&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Label</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;ex:(http://www.google.com)url:&quot;</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:TextInput</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myText&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Go There&quot;</span> <span style="color: #000066;">fontSize</span>=<span style="color: #ff0000;">&quot;14&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;myBrowser.location=myText.text&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Forward&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;myBrowser.historyForward()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Back&quot;</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">&quot;myBrowser.historyBack()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:HBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:HTML</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myBrowser&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;http://www.focusoutsourcing.com&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> &nbsp; &nbsp; &nbsp; <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:WindowedApplication<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><strong></strong><br />
That&#8217;s it! Test again. I hope this tutorial is helpful to someone. Download the source file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bethinkerconcepts.com/2009/06/embedding-browser-into-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
