<?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>Frostb1te &#187; Flash</title>
	<atom:link href="http://ospsp.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://ospsp.com</link>
	<description>A place to review and chat about iPhone apps!</description>
	<lastBuildDate>Wed, 10 Mar 2010 18:14:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>How to create a button in Flash CS4 using AS3</title>
		<link>http://ospsp.com/2010/03/how-to-create-a-button-in-flash-cs4-using-as3/</link>
		<comments>http://ospsp.com/2010/03/how-to-create-a-button-in-flash-cs4-using-as3/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 23:44:34 +0000</pubDate>
		<dc:creator>Jackson</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[CS4]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ospsp.com/2010/03/how-to-create-a-button-in-flash-cs4-using-as3/</guid>
		<description><![CDATA[Creating a button in Flash CS4 is one of the most easy things to do in flash, yet a very essential piece when using it. Whether your a programmer, animator, or someone interested in Flash, this tutorial is for you. We will be creating the simple flash application featured in the picture. Start off by [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a button in Flash CS4 is one of the most easy things to do in flash, yet a very essential piece when using it. Whether your a programmer, animator, or someone interested in Flash, this tutorial is for you. We will be creating the simple flash application featured in the picture.</p>
<p>Start off by opening up Flash CS4 (also works with CS3) and click on "Flash File (actionscript 3)" under the "Create New" option or hit  (on a mac). A blank canvas should appear.</p>
<p>Here are the steps to set up the scene:</p>
<p>-Grab the rectangle tool from the toolbar and draw a rectangle (any size will do) in the white space provided.</p>
<p>-Create some text and center it in the rectangle.</p>
<p>-Highlight the entire rectangle and the text and right click inside of it.</p>
<p>-click the "Convert to Symbol..." option at the bottom.</p>
<p>-A dialog box should appear; set its name to "Play button" and select its type as "Button".</p>
<p>-Hit Enter</p>
<p>As you can see, we have just created a symbol containing 2 different instances; a rectangle and a textbox.</p>
<p>Select The Symbol and look at the top right corner of the window in the properties panel.<br />
(don't see it? press (if on a mac) or (if on a PC)</p>
<p>There should be a box that says "" and a dropdown box that should say "button" and below that, some text that says "Instance of: Play Button".</p>
<p>Click inside of the "" box and type: "play_btn"</p>
<p>we have just created the instance name of the button to which flash can now refer to it as; play_btn</p>
<p>Alright, we are ready to get coding! right-click on frame 1 of your project(down in the timeline) and select "actions".</p>
<p>Enter the code in the box provided:</p>
<p>play_btn.addEventListener(MouseEvent.CLICK, functionName);</p>
<p>function functionName(e:MouseEvent):void {<br />
play_btn.visible = false;<br />
}</p>
<p>now lets dissect this code:</p>
<p>play_btn.addEventListener(MouseEvent.CLICK, functionName);</p>
<p>is adding and event Listener to the instance "play_btn". MouseEvent is indicating that it is related to the mouse(others include: Event, Keyboard Event, etc.) and .CLICK is telling it that it is, well, a click. ,functionName is telling it to run the function: functionName  when clicked.</p>
<p>function functionName(e:MouseEvent):void {</p>
<p>is creating the function we want to run when play_btn is clicked. simple, not much to it.</p>
<p>play_btn.visible = false;</p>
<p>is making the play_btn invisible(it also disables it.)</p>
<p>}</p>
<p>closes the function.</p>
<p>Well, You've created your first button and are well on your way to becoming a master in flash!</p>
<p>Thanks, Jackson Smith</p>
<p>//please leave comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://ospsp.com/2010/03/how-to-create-a-button-in-flash-cs4-using-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

