<?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>Flex Tutorial &#187; Flash Builder 4</title>
	<atom:link href="http://flextutorial.org/tag/flash-builder-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://flextutorial.org</link>
	<description>Rich Internet Application Development by Adobe Flex</description>
	<lastBuildDate>Fri, 11 Dec 2009 05:54:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flex 101 with Flash Builder 4</title>
		<link>http://flextutorial.org/2009/07/24/flex-101-with-flash-builder-4/</link>
		<comments>http://flextutorial.org/2009/07/24/flex-101-with-flash-builder-4/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 22:30:39 +0000</pubDate>
		<dc:creator>Bryan</dc:creator>
				<category><![CDATA[Adobe Flex Introduction]]></category>
		<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Flex 101]]></category>

		<guid isPermaLink="false">http://flextutorial.org/?p=1035</guid>
		<description><![CDATA[Recently I came cross an excellent article, which gave a crash course in using Flash Builder 4 to develop Flex applications. With the permission of the original site (http://www.packtpub.com, author: Romin Irani), I post it on FlexTutorial.org. For the purpose of easy reading, I divided the original article into 4 parts. I hope this will [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I came cross an excellent article, which gave a crash course in using Flash Builder 4 to develop Flex applications.  With the permission of the original site (http://www.packtpub.com, author: Romin Irani), I post it on FlexTutorial.org.  For the purpose of easy reading, I divided the original article into 4 parts. I hope this will provide first hand information to anyone interested in RIA (Rich Internet Application) development.</p>
<p><span id="more-1035"></span></p>
<hr size="1" noshade="noshade" /><a title="Flex 101 with Flash Builder 4 – Part 1" href="http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-1"><strong>Flex 101 with Flash Builder 4 &#8211; Part 1</strong></a></p>
<p><a title="Flex 101 with Flash Builder 4 – Part 2" href="http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2"><strong>Flex 101 with Flash Builder 4 &#8211; Part 2</strong></a></p>
<p><a title="Flex 101 with Flash Builder 4 – Part 3" href="http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3"><strong>Flex 101 with Flash Builder 4 &#8211; Part 3</strong></a></p>
<p><a title="Flex 101 with Flash Builder 4 – Part 4" href="http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4"><strong>Flex 101 with Flash Builder 4 &#8211; Part 4</strong></a></p>
<p><strong>About the Author</strong></p>
<p>Romin Irani is a software developer at heart, who has been developing software for 15 years and still wakes up every morning to learn something new in the changing world of software development. He has been a big fan of all things related to Flex, ever since he came across it 3 years back.</p>
<hr size="1" noshade="noshade" />
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><strong>Flex 3 with Java</strong></a></div>
<table border="0" cellspacing="5" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="99" valign="top"><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><img title="Flex 3 with Java" src="/wp-content/uploads/2009/07/flex-3-with-Java.jpg" border="0" alt="Flex 3 with Java" width="99" height="123" /></a></td>
<td valign="top">Develop rich internet applications quickly and easily using Adobe Flex 3, ActionScript 3.0 and integrate with a Java backend using BlazeDS 3.2</p>
<ul>
<li>A step-by-step tutorial for developing web applications using Flex 3, ActionScript 3.0, BlazeDS 3.2, and Java</li>
<li>Build efficient and seamless data-rich interactive applications in Flex using a combination of MXML and ActionScript 3.0</li>
<li>Create custom UIs, Components, Events, and Item Renders to develop user friendly applications</li>
<li>Build an end-to-end Flex e-commerce application using all major features of Flex covered throughout the book</li>
</ul>
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank">http://www.packtpub.com/flex-3-with-java/book</a></div>
</td>
</tr>
</tbody>
</table>
<hr size="1" noshade="noshade" />
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://flextutorial.org/2009/07/24/flex-101-with-flash-builder-4/&amp;t=Flex+101+with+Flash+Builder+4&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://flextutorial.org/2009/07/24/flex-101-with-flash-builder-4/&amp;title=Flex+101+with+Flash+Builder+4&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript">tweetmeme_url='http://flextutorial.org/2009/07/24/flex-101-with-flash-builder-4/'; tweetmeme_style = 'normal';tweetmeme_source = 'flextutorial'; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://flextutorial.org/2009/07/24/flex-101-with-flash-builder-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex 101 with Flash Builder 4 – Part 4</title>
		<link>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4/</link>
		<comments>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 12:36:40 +0000</pubDate>
		<dc:creator>Bryan</dc:creator>
				<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Flex 101]]></category>

		<guid isPermaLink="false">http://flextutorial.org/?p=1000</guid>
		<description><![CDATA[Using Flash Builder Data Services In this section, we will write the same application that we have written in part one. However this time we will not write the code ourselves instead we&#8217;ll let the Flash Builder generate the code for us. Flash Builder comes with powerful new features that ease integration with external services. [...]]]></description>
			<content:encoded><![CDATA[<h2>Using Flash Builder Data Services</h2>
<p>In this section, we will write the same application that we have written in part one. However this time we will not write the code ourselves instead we&#8217;ll let the Flash Builder generate the code for us. Flash Builder comes with powerful new features that ease integration with external services. It can auto generate client code that can invoke external services for us and bind the results to existing User Interface components.</p>
<p><span id="more-1000"></span></p>
<p>Let us look at building the same application that we developed in the previous section via the new Data Services and Binding wizardry that Flash Builder provides.</p>
<p>Let us create a new Flex Project as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image29.PNG" alt="" /></p>
<p>Name this Flex Project as <strong>YahooNewsWithDataServices </strong>as shown below. We will go with the default settings for the other fields. Click on <strong>Finish </strong>button.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image30.PNG" alt="" /></p>
<p>You will get the standard boilerplate code that is produced for the main Application MXML file—<strong>YahooNewsWithDataServices.mxml</strong>. Switch to the <strong>Design </strong>View and the <strong>Properties </strong>tab as shown below. Modify the values for the Layout to <strong>spark.layouts.VerticalLayout</strong> and the <strong>Width </strong>and <strong>Height </strong>to <strong>100%</strong>. This means that the main Application window will occupy the maximum area available on your screen and by choosing a Vertical Layout, all visual components dragged to the main Application Canvas will be arranged in a vertical fashion.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image31.PNG" alt="" /></p>
<p>Stay in <strong>Design </strong>view. From the <strong>Components </strong>Tab shown below select <strong>Data Controls ? DataGrid</strong></p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image32.PNG" alt="" /></p>
<p>Drag it onto the canvas on the right side. It will appear as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image33.PNG" alt="" /></p>
<p>Keep the DataGrid selected and go to the <strong>Properties </strong>Tab as shown below. Give it an <strong>ID </strong>value of <strong>dgYahooNews</strong>. Set its <strong>Width </strong>and <strong>Height </strong>to <strong>100%</strong> so that it will occupy the entire parent container like the Application Window. Then click on the <strong>Configure Columns</strong> button.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image34.PNG" alt="" /></p>
<p>Clicking on the <strong>Configure Columns</strong> button will bring up the current columns that are added by default. The screenshot is shown below. We do not need any of these columns at this point. So select each of the columns and click on the <strong>Delete </strong>button. Finally click on the <strong>OK </strong>button.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image35.PNG" alt="" /></p>
<p>Save your work at this point through the <strong>Ctrl-S</strong> key combination.</p>
<p>At this point in time, we will simply create an Application screen with a datagrid on it. Now we need to connect it to the Yahoo News Service and bind the datagrid rows/columns to the data being returned from the Service. In the previous section, we had seen how to do this by writing code. In this case, we will let Flash Builder generate the connectivity code and also do the binding for us.</p>
<p>First step is to select the <strong>Connect to Data/Service</strong> option from the main menu as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image36.PNG" alt="" /></p>
<p>This will bring up the wizard as shown in the following screenshot. Flash Builder allows us to connect to several types of backend systems. In our case, we wish to connect to the Yahoo Most Emailed News RSS Service that is available at: <a href="http://rss.news.yahoo.com/rss/mostemailed" target="_blank">http://rss.news.yahoo.com/rss/mostemailed</a>.</p>
<p>So we will choose the HTTP Service as shown below and click on the <strong>Next </strong>button.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image37.PNG" alt="" /></p>
<p>The next step will be a configuration screen, where we will provide the following information:</p>
<ol>
<li><strong>Service Name</strong>: Give the Service a name that you like which u can refer to later. We name it <strong>YahooNewsService</strong>.</li>
<li><strong>Operations</strong>: We give an operation name called <strong>getNews</strong>. The HTTP Method is GET and in the field for URL, you need to provide the RSS Feed URL <a href="http://rss.news.yahoo.com/rss/mostemailed" target="_blank">http://rss.news.yahoo.com/rss/mostemailed</a></li>
</ol>
<p style="margin-left: 40px; margin-right: 40px;"><em>You can enter more than one operation name here. Alternately, if you were invoking a HTTP Service using the POST method, you could even specify the Parameters by adding parameters via the <strong>Add </strong>button.</em></p>
<hr size="1" noshade="noshade" />
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><strong>Flex 3 with Java</strong></a></div>
<table border="0" cellspacing="5" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="99" valign="top"><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><img title="Flex 3 with Java" src="/wp-content/uploads/2009/07/flex-3-with-Java.jpg" border="0" alt="Flex 3 with Java" width="99" height="123" /></a></td>
<td valign="top">Develop rich internet applications quickly and easily using Adobe Flex 3, ActionScript 3.0 and integrate with a Java backend using BlazeDS 3.2</p>
<ul>
<li>A step-by-step tutorial for developing web applications using Flex 3, ActionScript 3.0, BlazeDS 3.2, and Java</li>
<li>Build efficient and seamless data-rich interactive applications in Flex using a combination of MXML and ActionScript 3.0</li>
<li>Create custom UIs, Components, Events, and Item Renders to develop user friendly applications</li>
<li>Build an end-to-end Flex e-commerce application using all major features of Flex covered throughout the book</li>
</ul>
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank">http://www.packtpub.com/flex-3-with-java/book</a></div>
</td>
</tr>
</tbody>
</table>
<hr size="1" noshade="noshade" />Click on <strong>Finish</strong>. This will display a Message window as shown below which tells you that there is still some incomplete work or a few last steps remaining before you can complete the definition of the service and bind it to a UI Component (in our case it is the DataGrid). Click on <strong>OK </strong>to dismiss the message.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image38.PNG" alt="" /></p>
<p>Once again, switch to <strong>Design </strong>view and click on the button for the Data Provider shown below. What we are going to do is associate/bind the result of the Service invocation to the Data Grid via the data provider.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image39.PNG" alt="" /></p>
<p>This will bring up the <strong>Bind To Data</strong> window as show below. It should be clear to you by now that we can select the Service and the Operation whose result we wish to bind to our data grid. Flash Builder automatically shows us the Service Name and an Operation name. If there are more Services defined, it will allow to select the appropriate Service and its respective operations.</p>
<p>Note that it asks us to <strong>Configure Return Type</strong> as shown. This is because Flash Builder needs to understand the data that is going to be returned by the Service invocation and also to help it map the result data types to appropriate Action Script Data structures.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image40.PNG" alt="" /></p>
<p>Click on the <strong>Configure Return Type</strong> button. This will bring up the <strong>Configure Operation Return Type</strong> window. Give a name for the Custom Data Type as we have given below and click on the <strong>Next </strong>button.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image41.PNG" alt="" /></p>
<p>The next step is to specify the kind of data that will be returned. Flash Builder simplifies this by allowing us to give the complete URL so that it can invoke it and determine the structure that is returned. If you already have a sample response, you could even choose the third option. In our case, we will go with the second option of entering a complete URL as shown below. We also specify the RSS Feed url.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image42.PNG" alt="" /></p>
<p>Click on the <strong>Next </strong>button. This will invoke the RSS Feed and retrieve the HTTP Response. Since the response returned is in XML, Flash Builder is able to generically map it to a tree-like structure as shown below. The structure is a typical RSS XML structure. The root node that is <strong>rss </strong>is shown in the Select Node and all its children nodes are shown in the grid below.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image43.PNG" alt="" /></p>
<p>Since we are only interested in the RSS items and extracting out the title and category, we first navigate and choose the <strong>item </strong>field in the<strong> Select Node</strong> field. This will show all the children nodes for the <strong>item </strong>field as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image44.PNG" alt="" /></p>
<p>Delete all the fields except for <strong>title </strong>and <strong>category</strong>. To delete a field, select it and click on the Delete button.</p>
<p>Click on the <strong>Finish </strong>button. This will bring up the original <strong>Bind To Data</strong> form. Click on the <strong>OK </strong>button.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image45.PNG" alt="" /></p>
<p>We are all set now. Save your work and click on the <strong>Run </strong>button from the main toolbar. Flash Builder will launch the application. The Data Grid on creation will invoke the HTTP Service and the items will be retrieved. The title and category fields are shown for each news item as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image46.PNG" alt="" /></p>
<h2>Summary</h2>
<p>This article provided an introduction to Flex 4 via its development environment Flash Builder. While the applications that we covered in the article are not too practical, it should give you a glimpse of the power of the Flex framework and its tools and loads of developer productivity that is one of its key strengths. Interested readers are encouraged to use this as a starting point in the world of developing Rich Internet Applications with Flex.</p>
<hr size="1" noshade="noshade" />
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><strong>Flex 3 with Java</strong></a></div>
<table border="0" cellspacing="5" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="99" valign="top"><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><img title="Flex 3 with Java" src="/wp-content/uploads/2009/07/flex-3-with-Java.jpg" border="0" alt="Flex 3 with Java" width="99" height="123" /></a></td>
<td valign="top">Develop rich internet applications quickly and easily using Adobe Flex 3, ActionScript 3.0 and integrate with a Java backend using BlazeDS 3.2</p>
<ul>
<li>A step-by-step tutorial for developing web applications using Flex 3, ActionScript 3.0, BlazeDS 3.2, and Java</li>
<li>Build efficient and seamless data-rich interactive applications in Flex using a combination of MXML and ActionScript 3.0</li>
<li>Create custom UIs, Components, Events, and Item Renders to develop user friendly applications</li>
<li>Build an end-to-end Flex e-commerce application using all major features of Flex covered throughout the book</li>
</ul>
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank">http://www.packtpub.com/flex-3-with-java/book</a></div>
</td>
</tr>
</tbody>
</table>
<hr size="1" noshade="noshade" />
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4/&amp;t=Flex+101+with+Flash+Builder+4+%E2%80%93+Part+4&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4/&amp;title=Flex+101+with+Flash+Builder+4+%E2%80%93+Part+4&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript">tweetmeme_url='http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4/'; tweetmeme_style = 'normal';tweetmeme_source = 'flextutorial'; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flex 101 with Flash Builder 4 &#8211; Part 3</title>
		<link>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3/</link>
		<comments>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 12:31:48 +0000</pubDate>
		<dc:creator>Bryan</dc:creator>
				<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Flex 101]]></category>

		<guid isPermaLink="false">http://flextutorial.org/?p=989</guid>
		<description><![CDATA[Yahoo! News Application Let us write another application, we will call it the Yahoo! News Application. This application shows a list of current news items from Yahoo that has been classified as &#8220;most emailed&#8220;. Yahoo! provides this list in the form of a RSS feed. The RSS feed for the same is: http://rss.news.yahoo.com/rss/mostemailed. Let us [...]]]></description>
			<content:encoded><![CDATA[<h2>Yahoo! News Application</h2>
<p>Let us write another application, we will call it the Yahoo! News Application. This application shows a list of current news items from Yahoo that has been classified as &#8220;<strong>most emailed</strong>&#8220;.</p>
<p>Yahoo! provides this list in the form of a RSS feed. The RSS feed for the same is: <a href="http://rss.news.yahoo.com/rss/mostemailed" target="_blank">http://rss.news.yahoo.com/rss/mostemailed</a>.</p>
<p>Let us first look at the application when it is all ready so that we can understand what we are trying to build. </p>
<p><span id="more-989"></span></p>
<p>The snapshot is shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image18.PNG" alt="" /></p>
<p>The application is simple. It has a button called <strong>Fetch News</strong>, which when clicked will connect to the internet, access the RSS Feed and display the new items. It shows the news items by using a DataGrid component that can show rows of data, which can comprise several columns. In our case, each row is one news item and we are currently displaying only one column —title of the news item.</p>
<p>Let us build this application now. To start off, we will create another application which we shall call <strong>YahooNews</strong>. You do not need to create another project and can stay within the <strong>MyFirstFB4App </strong>project and create a new MXML application by going to the main menu and selecting <strong>File ? New ? MXML</strong> Application. This will bring up a dialog window as shown below. Give the <strong>Filename </strong>as <strong>YahooNews </strong>and select the <strong>Layout </strong>as <strong>spark.layouts.VerticalLayout</strong> (This will arrange all your components vertically at the main application canvas level).</p>
<p>Finally, click on the <strong>Finish </strong>button.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image19.png" alt="" /></p>
<p>This will generate the same boilerplate code that we saw earlier. Go to the <strong>Design </strong>View and then from the <strong>Components </strong>tab, first drag and drop a <strong>Button </strong>from the <strong>Controls </strong>tree node. The properties of the button are shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image20.PNG" alt="" /></p>
<p>Create a <strong>click handler</strong> for the button as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image21.PNG" alt="" /></p>
<p>Go back to the <strong>Design </strong>view and drop a <strong>DataGrid </strong>control from the <strong>Components </strong>tab as shown below. Note that the DataGrid component is present in the Data Controls tree node. The DataGrid component is like a table and visually it can display rows of data where each row can comprise one of more columns.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image22.PNG" alt="" /></p>
<p>The Design view is shown below. By default the <strong>DataGrid </strong>shows 3 sample columns and we need to restrict that to just one column in which we wish to show the title. We wish to name the column header as &#8220;News Title&#8221;.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image23.PNG" alt="" /></p>
<p>You can modify the DataGrid properties by selecting the DataGrid control and viewing the <strong>Properties </strong>Tab. First let us set the <strong>ID</strong> to <strong>dgNews</strong>.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image24.PNG" alt="" /></p>
<p>Then set the width and height of this control to 100% respectively. This means that it will occupy the whole application screen even if you resize it.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image25.PNG" alt="" /></p>
<p>You can view the current columns and modify (add/delete/edit) them by clicking on the <strong>Configure Columns</strong> button in the <strong>Properties </strong>Tab. That will bring up the current columns as you can see below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image26.PNG" alt="" /></p>
<p>We need only one column, so to delete Column 2 and Column 3, simply select the item and click on the <strong>Delete </strong>button. Additionally, select Column 1 and change the following two properties:</p>
<ol>
<li><strong>Bind to field</strong>: This is the attribute of the row object. For example we are going to assign a list of news items that is a collection of news items to the DataGrid. Each row is a news item object and each item object consists of several attributes like <em>title</em>, <em>pubDate</em>, <em>category</em>, and others as per the RSS definition. So in this case we are interested in only the <strong>title </strong>attribute or property.</li>
<li><strong>Header Text</strong>: This is the text that is shown in the header column for the DataGrid. We will call it <strong>News Title</strong>.</li>
</ol>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image27.PNG" alt="" /></p>
<p>Click on <strong>OK </strong>to commit the changes.</p>
<p>The final step will be for us to implement the code in our handler which we auto generated when the <strong>Fetch News</strong> button is clicked. Switch over the <strong>Source </strong>view to take a look at the current code generated for you.</p>
<p>Let us go through the code:</p>
<ol>
<li>Take a look at the <strong>Fetch News</strong> button code shown below:
<ol>
<pre>&lt;s:Button id="btnFetchYahooNews" label="Fetch News!"
          click="btnFetchYahooNews_clickHandler(event)"/&gt;</pre>
</ol>
<ol>
<pre>protected function
btnFetchYahooNews_clickHandler(event:MouseEvent):void
{
    // TODO Auto-generated method stub
}</pre>
</ol>
<ul>
<li>Invoke the RSS Feed: <a href="http://rss.news.yahoo.com/rss/mostemailed" target="_blank">http://rss.news.yahoo.com/rss/mostemailed</a>.</li>
<li>Retrieve the result and assign the RSS News Items to the DataGrid.</li>
</ul>
</li>
<p>This code is straightforward and it means that when the button is clicked the method <em>btnFetchYahooNews_clickHandler</em> will be invoked.</p>
<p>Since we auto-generated the click handler, it currently looks like this:</p>
<p>We need to now implement the code to do the following:</p>
<li>To do that, we will need to use the <em>HTTPService </em>from the <em>mx </em>namespace in the Flex framework. The <em>HTTPService </em>is a non-visual component and hence it is defined under a <em>&lt;fx:Declaration&gt;</em> tag as given below:
<ol>
<pre>&lt;fx:Declarations&gt;
	&lt;mx:HTTPService id="YahooNewsService"
                   url="http://rss.news.yahoo.com/rss/mostemailed"
                   method="GET"
	           result="YahooNewsService_resultHandler(event)"
	           fault="YahooNewsService_faultHandler(event)"/&gt;
&lt;/fx:Declarations&gt;</pre>
</ol>
</li>
<p>The <em>&lt;fx:Declarations&gt;</em> tag is created under the <em>&lt;mx:Application&gt;</em> main tag. We first have an <em>id </em>attribute that is a unique name for the service. Then the <em>url </em>attribute that points to the RSS Feed. We are using the <em>GET </em>method for the HTTP operation. Finally, two critical events are handled. One of them is the <strong>result </strong>event which is invoked when the HTTP Request has been successful and a response is returned. The other is a <strong>fault </strong>event which is invoked when the HTTP Request could not be completed and there was an error.</p>
<li>Let us look at the complete code now where we hook up invoking of the Fetch News button to the HTTP Service and then binding the result of the HTTP Response to the DataGrid.
<ol>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
 xmlns:s="library://ns.adobe.com/flex/spark"
 xmlns:mx="library://ns.adobe.com/flex/halo"
 minWidth="1024" minHeight="768"&gt;

 &lt;fx:Declarations&gt;
 &lt;mx:HTTPService id="YahooNewsService"
 url="http://rss.news.yahoo.com/rss/mostemailed"
 method="GET"
 result="YahooNewsService_resultHandler(event)"
 fault="YahooNewsService_faultHandler(event)"/&gt;
 &lt;/fx:Declarations&gt;

 &lt;fx:Script&gt;
 &lt;![CDATA[
 import mx.rpc.events.FaultEvent;
 import mx.rpc.events.ResultEvent;

 import mx.controls.Alert;

 //This handler is invoked when FetchNews button is clicked
 protected function
 btnFetchYahooNews_clickHandler(event:MouseEvent):void
 {
 //Send the HTTP Request by invoking the send() method
 YahooNewsService.send();
 }

 //When the HTTP Response is received
 //bind the result to the DataGrid's dataprovider
 protected function
 YahooNewsService_resultHandler(event:ResultEvent):void
 {
 dgNews.dataProvider = event.result.rss.channel.item;
 }

 protected function
 YahooNewsService_faultHandler(event:FaultEvent):void
 {
 Alert.show("Error in fetching Yahoo News.");
 }

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

 &lt;s:layout&gt;
 &lt;s:VerticalLayout/&gt;
 &lt;/s:layout&gt;

 &lt;s:Button id="btnFetchYahooNews" label="Fetch News!"
 click="btnFetchYahooNews_clickHandler(event)"/&gt;

 &lt;mx:DataGrid width="100%" height="100%" id="dgNews"&gt;
 &lt;mx:columns&gt;
 &lt;mx:DataGridColumn dataField="title" headerText="News Title"/&gt;
 &lt;/mx:columns&gt;
 &lt;/mx:DataGrid&gt;

&lt;/s:Application&gt;</pre>
</ol>
</li>
</ol>
<p>Let us go through the key points:</p>
<ul>
<li>The <em>btnFetchYahooNews_clickHandler</em> method is invoked when the Fetch News button is clicked. In this method, we send the HTTP Request by invoking the <em>send()</em> method on the HTTPService instance—YahooNewsService.</li>
<li>As mentioned the result event is fired when the HTTP Response is available. The HTTP response is available in the <strong>event </strong>parameter that is passed to the result handler. Since it is a standard RSS feed that is available, a collection of items is available under the <em>event.result.rss.channel.item</em> object.</li>
<li>This is then assigned to the Data Grid. To assign it to the DataGrid, we simply pass it to the <em>dataProvider </em>attribute of the grid. Since we have bound the column to only the title attribute, the DataGrid takes care of the column rendering for us.</li>
</ul>
<p>To run the application, simply click on the <strong>Run </strong>icon in the main toolbar. A sample output is shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image28.png" alt="" /></p>
<hr size="1" noshade="noshade" />
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><strong>Flex 3 with Java</strong></a></div>
<table border="0" cellspacing="5" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="99" valign="top"><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><img title="Flex 3 with Java" src="/wp-content/uploads/2009/07/flex-3-with-Java.jpg" border="0" alt="Flex 3 with Java" width="99" height="123" /></a></td>
<td valign="top">Develop rich internet applications quickly and easily using Adobe Flex 3, ActionScript 3.0 and integrate with a Java backend using BlazeDS 3.2</p>
<ul>
<li>A step-by-step tutorial for developing web applications using Flex 3, ActionScript 3.0, BlazeDS 3.2, and Java</li>
<li>Build efficient and seamless data-rich interactive applications in Flex using a combination of MXML and ActionScript 3.0</li>
<li>Create custom UIs, Components, Events, and Item Renders to develop user friendly applications</li>
<li>Build an end-to-end Flex e-commerce application using all major features of Flex covered throughout the book</li>
</ul>
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank">http://www.packtpub.com/flex-3-with-java/book</a></div>
</td>
</tr>
</tbody>
</table>
<hr size="1" noshade="noshade" /><a href="http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-4"><strong>Continue to Flex 101 with Flash Builder 4 &#8211; Part 4</strong></a></p>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3/&amp;t=Flex+101+with+Flash+Builder+4+-+Part+3&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3/&amp;title=Flex+101+with+Flash+Builder+4+-+Part+3&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript">tweetmeme_url='http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3/'; tweetmeme_style = 'normal';tweetmeme_source = 'flextutorial'; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 101 with Flash Builder 4 – Part 2</title>
		<link>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2/</link>
		<comments>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 12:28:26 +0000</pubDate>
		<dc:creator>Bryan</dc:creator>
				<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Flex 101]]></category>

		<guid isPermaLink="false">http://flextutorial.org/?p=980</guid>
		<description><![CDATA[Hello World using Flash Builder 4 In this section, we will be developing a basic Hello World application. While the application does not do much, it will help you get comfortable with the Flash Builder IDE. Launch the Flash Builder IDE. We will be creating a Flex Project. Flash Builder will help us create the [...]]]></description>
			<content:encoded><![CDATA[<h2>Hello World using Flash Builder 4</h2>
<p>In this section, we will be developing a basic Hello World application. While the application does not do much, it will help you get comfortable with the Flash Builder IDE.</p>
<p>Launch the Flash Builder IDE. We will be creating a Flex Project. Flash Builder will help us create the Project that will contain all our files. </p>
<p><span id="more-980"></span></p>
<p>To create a new Flex Project, click on the <strong>File ? New ? Flex Project</strong> as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image4.png" alt="" /></p>
<p>This will bring up a dialog in which you will need to specify more details about the Flex Project that you plan to develop. The dialog is shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image5.png" alt="" /></p>
<p>You will need to provide at least the following information:</p>
<ul>
<li><strong>Project Name</strong>: This is the name of your project. Enter a name that you want over here. In our case, we have named our project <strong>MyFirstFB4App</strong>.</li>
<li><strong>Application Type</strong>: We can develop both a Web version and a desktop version of our application using Flash Builder. The web application will then run inside of a web browser and execute within the Flash Player plug-in. We will go with the Web option over here. The Desktop application runs inside the Adobe Integrated Runtime environment and can have more desktop like features. We will skip that option for now.</li>
<li>We will let the other options remain as is. We will use the <strong>Flex 4.0 SDK</strong> and currently we are not integrating with any Server side layer so we will leave that option as <strong>None/Other</strong>.</li>
</ul>
<p>Click on <strong>Finish </strong>at this point to create your Flex Project. This will create a main application file called <strong>MyFirstFB4App.mxml</strong> as shown below.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image6.png" alt="" /></p>
<p>We will come back to our coding a little later but first we must familiarize ourselves with the Flash Builder IDE.</p>
<p>Let us first look at the <strong>Package Explorer</strong> to understand the files that have been created for the Flex Project. The screenshot is shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image7.png" alt="" /></p>
<p>It consists of the main source file <strong>MyFirstFB4App.mxml</strong>. This is the main application file or in other words the bootstrap. All your source files (MXML and ActionScript code along with assets like images, and others should go under the <strong>src </strong>folder. They can optionally be placed in packages too.</p>
<p>The Flex 4.0 framework consists of several libraries that you compile your code against. You would end up using its framework code, components (visual and non-visual) and other classes. These classes are packaged in a library file with an extension <strong>.swc</strong>. A list of library files is shown above. You do not need to typically do anything with it.</p>
<p>Optionally, you can also use 3rd party components written by other companies and developers that are not part of the Flex framework. These libraries are packages as <em>.SWC</em> files too and they can be placed in the <strong>libs</strong> folder as shown in the previous screenshot.</p>
<p>The typical step is to write and compile your code—build your project. If your build is successful, the object code is generated in the <strong>bin-debug</strong> folder. When you deploy your application to a Web Server, you will need to pickup the contents from this folder. We will come to that a little later. The <strong>html-template</strong> folder contains some boiler-plate code that contains the container HTML into which your object code will be referenced. It is possible to customize this but for now, we will not discuss that.</p>
<p>Double-click <strong>MyFirstFB4App.mxml</strong> file. This is our main application file. The code listing is given below:</p>
<pre style="margin-left: 40px;">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
	           xmlns:s="library://ns.adobe.com/flex/spark"
	           xmlns:mx="library://ns.adobe.com/flex/halo"
	           minWidth="1024" minHeight="768"&gt;

&lt;/s:Application&gt;</pre>
<p>As discussed before, you will typically write one or more MXML files that will contain typically your visual components (although there can be non-visual components also). By visual components, we mean controls like button, combobox, list, tree, and others. It could also contain layout components and containers that help you layout your design as per the application screen design.</p>
<p>To view what components, you can place on the main application canvas, select the <strong>Design </strong>View as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image8.png" alt="" /></p>
<p>Have a look at the lower half of the left pane. You will see the <strong>Components </strong>tab as shown below, which would address most needs of your Application Visual design.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image9.png" alt="" /></p>
<p>Click on the <strong>Controls </strong>tree node as shown below. You will see several controls that you can use and from which, we will use the <strong>Button </strong>control for this application.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image10.png" alt="" /></p>
<p>Simply select the <strong>Button </strong>control and drag it to the Design View Canvas as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image11.png" alt="" /></p>
<p>This will drop an instance of the <strong>Button </strong>control on the Design View as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image12.png" alt="" /></p>
<p>Select the <strong>Button </strong>to see its properties panel as shown below. <strong>Properties </strong>Panel is where you can set several attributes at design time for the control. In case the Properties panel is not visible, you can get to that by selecting <strong>Window ? Properties</strong> from the main menu.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image13.jpg" alt="" /></p>
<p>In the <strong>Properties </strong>panel, we can change several key attributes. All controls can be uniquely identified and addressed in your code via the <em>ID </em>attribute. This is a unique name that you need to provide. Go ahead and give it some meaningful name. In our case, we name it <strong>btnSayHello</strong>.</p>
<p>Next we can change the label so that instead of Button, it can display a message for example, <strong>Say Hello</strong>. Finally we want to wire some code such that if the button is clicked, we can do some action like display a Message Box saying Hello World.</p>
<p>To do that, click the icon next to the <strong>On click</strong> edit field as shown below. It will provide you two options. Select the option for <strong>Generate Event Handler</strong>.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image14.png" alt="" /></p>
<p>This will generate the code and switch to the <strong>Source </strong>view. The code is listed below for your reference.</p>
<pre style="margin-left: 10px;">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
	xmlns:s="library://ns.adobe.com/flex/spark"
	xmlns:mx="library://ns.adobe.com/flex/halo"
	minWidth="1024" minHeight="768"&gt;

&lt;fx:Script&gt;
  &lt;![CDATA[
    protected function btnSayHello_clickHandler(event:MouseEvent):void
    {
      // TODO Auto-generated method stub
    }
  ]]&gt;
&lt;/fx:Script&gt;

  &lt;s:Button x="17" y="14" label="Button" id="btnSayHello"
         click="btnSayHello_clickHandler(event)"/&gt;

&lt;/s:Application&gt;</pre>
<p>There are few things to note here. As mentioned most of your application logic will be written in ActionScript and that is exactly what Flash Builder has generated for you. All such code is typically added inside a scripting block marked with the <em>&lt;fx:Script&gt;</em> tag. You can place your ActionScript methods over here that can be used by the rest of the application.</p>
<p>When we clicked on <strong>Generate Event Handler</strong>, Flash Builder generated the Event Handler code. This code is in ActionScript and was appropriately placed inside the <em>&lt;fx:Script&gt;</em> block for us.</p>
<p>If you look at the code, you can see that it has added a function that is invoked when the <strong>click </strong>event is fired on the button.</p>
<p>The method is <strong>btnSayHello_clickHandler</strong> and if you notice it has an empty method that is, no implementation.</p>
<p>Let us run the application now to see what it looks like. To run the application, click on the <img src="/wp-content/uploads/2009/07/flex101-article-image15.png" alt="" /> <strong>Run </strong>icon in the main toolbar of Flash Builder.</p>
<p>This will launch the web application as shown below. Clicking the <strong>Say Hello</strong> button will not do anything at this point since there is no code written inside the handler as we saw above.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image16.png" alt="" /></p>
<p>To display the MessageBox, we add the code shown below (Only the Script section is shown below):</p>
<pre style="margin-left: 10px;">&lt;fx:Script&gt;
  &lt;![CDATA[
    import mx.controls.Alert;

    protected function btnSayHello_clickHandler(event:MouseEvent):void
    {
	Alert.show("Hello World");
    }
  ]]&gt;
&lt;/fx:Script&gt;</pre>
<p>We use one of the classes (called <em>Alert</em>) from the Flex framework. Like any other language, we need to specify which package we are using the class from so that the compiler can understand it. The <em>Alert </em>class belongs to the <em>mx.controls</em> package and it has a static method called <em>show()</em> which takes a single parameter of type String. This String parameter is the message to be displayed and in our case it is &#8220;<strong>Hello World</strong>&#8220;.</p>
<p>To run this, click <strong>Ctrl-S</strong> to save your file or <strong>File ?  Save</strong> from the main menu. And click on <strong>Run</strong> icon in the main toolbar. This will launch the application and on clicking the <strong>SayHello</strong> button, you will see the Hello World Alert window as shown below.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image17.png" alt="" /></p>
<hr size="1" noshade="noshade" />
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><strong>Flex 3 with Java</strong></a></div>
<table border="0" cellspacing="5" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="99" valign="top"><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><img title="Flex 3 with Java" src="/wp-content/uploads/2009/07/flex-3-with-Java.jpg" border="0" alt="Flex 3 with Java" width="99" height="123" /></a></td>
<td valign="top">Develop rich internet applications quickly and easily using Adobe Flex 3, ActionScript 3.0 and integrate with a Java backend using BlazeDS 3.2</p>
<ul>
<li>A step-by-step tutorial for developing web applications using Flex 3, ActionScript 3.0, BlazeDS 3.2, and Java</li>
<li>Build efficient and seamless data-rich interactive applications in Flex using a combination of MXML and ActionScript 3.0</li>
<li>Create custom UIs, Components, Events, and Item Renders to develop user friendly applications</li>
<li>Build an end-to-end Flex e-commerce application using all major features of Flex covered throughout the book</li>
</ul>
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank">http://www.packtpub.com/flex-3-with-java/book</a></div>
</td>
</tr>
</tbody>
</table>
<hr size="1" noshade="noshade" /><a href="http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-3"><strong>Continue to Flex 101 with Flash Builder 4 &#8211; Part 3</strong></a></p>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2/&amp;t=Flex+101+with+Flash+Builder+4+%E2%80%93+Part+2&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2/&amp;title=Flex+101+with+Flash+Builder+4+%E2%80%93+Part+2&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript">tweetmeme_url='http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2/'; tweetmeme_style = 'normal';tweetmeme_source = 'flextutorial'; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex 101 with Flash Builder 4 &#8211; Part 1</title>
		<link>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-1/</link>
		<comments>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-1/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 12:26:14 +0000</pubDate>
		<dc:creator>Bryan</dc:creator>
				<category><![CDATA[Flash Builder 4]]></category>
		<category><![CDATA[Flex 101]]></category>

		<guid isPermaLink="false">http://flextutorial.org/?p=964</guid>
		<description><![CDATA[The article is intended towards developers who have never used Flex before and would like to exercise a “Hello World” kind of tutorial. The article does not aim to cover Flex and FB4 in detail but rather focuses on the mechanics of FB4 and getting an application running with minimal effort. For developers familiar with [...]]]></description>
			<content:encoded><![CDATA[<p>The article is intended towards developers who have never used Flex before and would like to exercise a “Hello World” kind of tutorial. The article does not aim to cover Flex and FB4 in detail but rather focuses on the mechanics of FB4 and getting an application running with minimal effort.</p>
<p>For developers familiar with Flex and the predecessor to Flash Builder 4 (Flex Builder 2 or 3), it contains an introduction to FB4 and some differences in the way you go about building Flex Applications using FB4.</p>
<p><span id="more-964"></span></p>
<p>Even if you have not programmed before and are looking at understanding how to make a start in developing applications, this would serve as a good start.</p>
<h2>The Flex Ecosystem</h2>
<p>The Flex ecosystem is a set of libraries, tools, languages and a deployment runtime that provides an end-to-end framework for designing, developing and deploying RIAs. All these together are being branded as a part of the Flash platform.</p>
<p>In its latest release, Flex 4, special efforts have been put in to address the designer to developer workflow by letting graphic designers address layout, skinning, effects and general look and feel of your application and then the developers taking over to address the application logic, events, etc.</p>
<p>To understand this at a high level, take a look at the diagram shown below. This is a very simplified diagram and the intention is to project a 10,000 ft view of the development, compilation and execution process.</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image1.png" alt="" /></p>
<p>Let us understand the diagram now:</p>
<ol>
<li>The developer will typically work in the Flash Builder Application. Flash Builder is the Integrated Development Environment (IDE) that provides an environment for coding, compiling, running / debugging your Flex based applications.</li>
<li>Your Flex Application will typically consist of MXML and ActionScript code. ActionScript is an ECMAScript compatible Object Oriented language, whereas MXML is an XML-based markup language.</li>
<li>Using MXML you can define/layout your visual components like buttons, combobox, data grids, and others. Your application logic will be typically coded inside ActionScript classes/methods.</li>
<li>While coding your Flex Application, you will make use of the Flex framework classes that provide most of the core functionality. Additional libraries like Flex Charting libraries and 3rd party components can be used in your application too.</li>
<li>Flash Builder compiles all of this into object byte code that can be executed inside the Flash Player. Flash Player is the runtime host that executes your application.</li>
</ol>
<p>This is high level introduction to the ecosystem and as we work through the samples later on in the article, things will start falling into place.</p>
<h1>Flash Builder 4</h1>
<p>Flash Builder is the new name for the development IDE previously known as Flex Builder. The latest release is 4 and it is currently in public beta.</p>
<p>Flash Builder 4 is based on the Eclipse IDE, so if you are familiar with Eclipse based tools, you will be able to navigate your way quite easily. Flash Builder 4 like Flex Builder 3 previously is a commercial product and you need to purchase a development license. FB4 currently is in public beta and is available as a 30-day evaluation.</p>
<p>Through the rest of the article, we will make use of FB4 and will be focused completely on that to build and run the sample applications. Let us now take a look at setting up FB4.</p>
<h2>Setting up your Development Environment</h2>
<p>To setup Flash Builder 4, follows these steps:</p>
<ol>
<li>The first step should be installing Flash Player 10 on your system. We will be developing with the Flex 4 SDK that comes along with Flash Builder 4 and it requires Flash Player 10. You can download the latest version of Flash Player from here: <a href="http://www.adobe.com/products/flashplayer/" target="_blank">http://www.adobe.com/products/flashplayer/</a></li>
<li>Download Flash Builder 4 Public Beta from <a href="http://labs.adobe.com/technologies/flashbuilder4/" target="_blank">http://labs.adobe.com/technologies/flashbuilder4/</a>. The page is shown below:</li>
</ol>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image2.jpg" alt="" /></p>
<p>After you download, run the installer program and proceed with the rest of the installation.</p>
<p>Launch the Adobe Flash Builder Beta. It will prompt first with a message that it is a Trial version as shown below:</p>
<p style="text-align: center;"><img src="/wp-content/uploads/2009/07/flex101-article-image3.png" alt="" /></p>
<p>To continue in evaluation mode, select the option highlighted above and click <strong>Next</strong>. This will launch the Flash Builder IDE.</p>
<p>Let us start coding with Flash Builder 4 IDE. We will stick to tradition and write the “Hello World” application.</p>
<hr size="1" noshade="noshade" />
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><strong>Flex 3 with Java</strong></a></div>
<table border="0" cellspacing="5" cellpadding="5" width="100%">
<tbody>
<tr>
<td width="99" valign="top"><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank"><img title="Flex 3 with Java" src="/wp-content/uploads/2009/07/flex-3-with-Java.jpg" border="0" alt="Flex 3 with Java" width="99" height="123" /></a></td>
<td valign="top">Develop rich internet applications quickly and easily using Adobe Flex 3, ActionScript 3.0 and integrate with a Java backend using BlazeDS 3.2</p>
<ul>
<li>A step-by-step tutorial for developing web applications using Flex 3, ActionScript 3.0, BlazeDS 3.2, and Java</li>
<li>Build efficient and seamless data-rich interactive applications in Flex using a combination of MXML and ActionScript 3.0</li>
<li>Create custom UIs, Components, Events, and Item Renders to develop user friendly applications</li>
<li>Build an end-to-end Flex e-commerce application using all major features of Flex covered throughout the book</li>
</ul>
<div><a href="http://www.packtpub.com/flex-3-with-java/book/mid/1707090m2f6u" target="_blank">http://www.packtpub.com/flex-3-with-java/book</a></div>
</td>
</tr>
</tbody>
</table>
<hr size="1" noshade="noshade" /><a href="http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-2"><strong>Continue to Flex 101 with Flash Builder 4 &#8211; Part 2</strong></a></p>
<div><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-1/&amp;t=Flex+101+with+Flash+Builder+4+-+Part+1&amp;s=normal' height='80' width='52' frameborder='0' scrolling='no'></iframe></td> <td><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-1/&amp;title=Flex+101+with+Flash+Builder+4+-+Part+1&amp;t=1 ' height='80' width='52' scrolling='no' frameborder='0' ></iframe></td> <td><script type="text/javascript">tweetmeme_url='http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-1/'; tweetmeme_style = 'normal';tweetmeme_source = 'flextutorial'; </script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js" ></script></td></table></div><!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	-->]]></content:encoded>
			<wfw:commentRss>http://flextutorial.org/2009/07/22/flex-101-with-flash-builder-4-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
