<?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>Flash, Flex and ActionScript tutorials - flashadvanced &#187; tabs</title>
	<atom:link href="http://flashadvanced.com/tag/tabs/feed/" rel="self" type="application/rss+xml" />
	<link>http://flashadvanced.com</link>
	<description>Become an advanced actionscript developer</description>
	<lastBuildDate>Sun, 30 Jan 2011 21:10:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Colorful tabbed menu</title>
		<link>http://flashadvanced.com/colorful-tabbed-menu/</link>
		<comments>http://flashadvanced.com/colorful-tabbed-menu/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 18:00:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0 Basics]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[tabbed menu]]></category>
		<category><![CDATA[tabs]]></category>
		<category><![CDATA[tint]]></category>

		<guid isPermaLink="false">http://flashadvanced.com/?p=354</guid>
		<description><![CDATA[In this tutorial I will show you the easiest way to create a nice colorful menu with tabs using Flash and AS3. 1. Open a new Flash document and save it under &#8220;tabbedmenu.fla&#8221;. Set its size to 500 x 80 pixels. 2. Rename the first layer to &#8220;rectangle&#8221;. As you guessed, we&#8217;ll be drawing a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flashadvanced.com/?p=354"><br />
<img src="http://flashadvanced.com/wp-content/upload/tabbedmenu/tabbedmenu.jpg" /><br />
</a></p>
<p>In this tutorial I will show you the easiest way to create a nice colorful menu with tabs using Flash and AS3.</p>
<p><span id="more-354"></span></p>
<p><span style="color: #ff0000;">1.</span> Open a new Flash document and save it under &#8220;tabbedmenu.fla&#8221;. Set its size to 500 x 80 pixels.</p>
<p><span style="color: #ff0000;">2.</span> Rename the first layer to &#8220;rectangle&#8221;. As you guessed, we&#8217;ll be drawing a rectangle. Take the rectangle tool, disable the stroke, for color select #1E73E6 and draw a rectangle with size 500 x 40 px and position it on the bottom center of the stage. Convert the rectangle to movie clip. Lock this layer. </p>
<p><span style="color: #ff0000;">3.</span> Create a new layer called &#8220;tabs&#8221; and take the rectangle tool again. Set its top corner values to 15:</p>
<p><img src="http://flashadvanced.com/wp-content/upload/tabbedmenu/corners.jpg" /></p>
<p>Disable the stroke, select #1E73E6 for fill color and draw your tab. Your tab should be 96px wide by 33px high. Now take the text tool, select &#8220;Tahoma&#8221; for font, bold, size 18 and type &#8220;Home&#8221;. Convert both the tab and the text to Button symbol. Position the button like this:</p>
<p><img src="http://flashadvanced.com/wp-content/upload/tabbedmenu/tabpos.jpg" /></p>
<p><span style="color: #ff0000;">4.</span> Now make 4 copies of the the button and position them one after another. To modify each of the buttons you need to select each of them and then go to Modify -> Symbol -> <strong>Duplicate Symbol</strong>. Now you can modify them. Go inside the first copy and change its color to #BF7AC7. Double click the text field and type &#8220;about&#8221;. For the second copy choose #6DB6F4 for color and type &#8220;portfolio&#8221;, for the third one &#8211; #97C57E for color and type &#8220;photos&#8221;, for the fourth one &#8211; #CD846B for color and type &#8220;contact&#8221;.<br />
Now give the buttons <strong>instance</strong> names: &#8220;home_btn&#8221;, &#8220;about_btn&#8221;, &#8220;pf_btn&#8221;, &#8220;photos_btn&#8221;, &#8220;contact_btn&#8221;. </p>
<p><span style="color: #ff0000;">5.</span> On the &#8220;tabs&#8221; layer, click on the first frame, go to Properties Panel and under &#8220;Frame&#8221; type &#8220;home_selected&#8221;:</p>
<p><img src="http://flashadvanced.com/wp-content/upload/tabbedmenu/framename.jpg" /></p>
<p>Now click on frame 5, 10, 15, 20, convert them to keyframes and under &#8220;Frame&#8221; type:</p>
<p><strong>frame 5</strong>: &#8220;about_selected&#8221;<br />
<strong>frame 10</strong>: &#8220;portfolio_selected&#8221;<br />
<strong>frame 15</strong>: &#8220;photos_selected&#8221;<br />
<strong>frame 20</strong>: &#8220;contact_selected&#8221; </p>
<p><span style="color: #ff0000;">6.</span> Go back to &#8220;rectangle&#8221; layer and unlock it. Now click on frame 5, 10, 15, 20 and convert them to keyframes. Click on frame 5 and select the rectangle. Go to Properties Panel and under color select &#8220;Tint&#8221; and set it to 100%. Change the color to #BF7AC7:</p>
<p><img src="http://flashadvanced.com/wp-content/upload/tabbedmenu/tint.jpg" /></p>
<p>Go to the other keyframes and do the same. On frame 10 set the &#8220;Tint&#8221; color to #6DB6F4, on frame 15 &#8211; #97C57E and on frame 20 &#8211; #CD846B. </p>
<p><span style="color: #ff0000;">7.</span> Create a new layer called actions and click on frame 5, 10, 15, 20 and convert them to keyframes. On frames 1, 5, 10, 15, 20 open the Actions Panel and type &#8220;stop();&#8221;.<br />
Go to the first frame again, open the Actions Panel and type the following block of code:</p>
<pre><code>
home_btn.addEventListener(MouseEvent.CLICK, homeSelected);
about_btn.addEventListener(MouseEvent.CLICK, aboutSelected);
pf_btn.addEventListener(MouseEvent.CLICK, portfolioSelected);
photos_btn.addEventListener(MouseEvent.CLICK, photosSelected);
contact_btn.addEventListener(MouseEvent.CLICK, contactSelected);

function homeSelected(e:MouseEvent):void{
	gotoAndPlay("home_selected");
}

function aboutSelected(e:MouseEvent):void{
	gotoAndPlay("about_selected");
}

function portfolioSelected(e:MouseEvent):void{
	gotoAndPlay("portfolio_selected");
}

function photosSelected(e:MouseEvent):void{
	gotoAndPlay("photos_selected");
}

function contactSelected(e:MouseEvent):void{
	gotoAndPlay("contact_selected");
}
</code></pre>
<h4>Here is the final result:</h4>
<p><object width="500" height="80"><param name="movie" value="http://flashadvanced.com/wp-content/upload/tabbedmenu/tabbedmenu.swf"><embed src="http://flashadvanced.com/wp-content/upload/tabbedmenu/tabbedmenu.swf" width="500" height="80"></embed></object></p>
<p style="text-align: left; margin: 40px 40px 40px 0;"><a href="http://www.flashadvanced.com/wp-content/upload/tabbedmenu/tabbedmenu.zip"><img src="http://flashadvanced.com/wp-content/upload/other/download.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://flashadvanced.com/colorful-tabbed-menu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

