<?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>Bluepearl Blog - Web Design &#187; Adobe Flash</title>
	<atom:link href="http://www.bluepearl-blog.com/category/tutorials/adobe-flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bluepearl-blog.com</link>
	<description>Tutorials  for vBulletin, Invision, XenForo, HTML,  CSS &#38; jQuery</description>
	<lastBuildDate>Fri, 30 Sep 2011 10:36:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Actionscript 3.0 for a button in Flash CS3 and CS4</title>
		<link>http://www.bluepearl-blog.com/2009/10/actionscript-for-a-button-in-cs4/</link>
		<comments>http://www.bluepearl-blog.com/2009/10/actionscript-for-a-button-in-cs4/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 13:16:12 +0000</pubDate>
		<dc:creator>Sean James</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.bluepearl-blog.com/?p=11</guid>
		<description><![CDATA[Creating a flash button for Actionscript 3.0]]></description>
			<content:encoded><![CDATA[<p>Recently i have been using Adobe Flash CS4 and i must say i am really liking it!! Especially the new tweening and animation, makes life alot easier.</p>
<p>I had to create a button in Actionscript 3.0 today and had some problems getting the button to work.. the actionscript for a button since actionscript 2.0 has changed. For starters you need to give the button an instance name by right clicking the button on the stage and then going to the the properties window you can enter the instance name like in the image below.</p>
<div id="attachment_12" class="wp-caption aligncenter" style="width: 293px"><img class="size-full wp-image-12" title="instance-name" src="http://www.bluepearl-blog.com/wp-content/uploads/2009/10/instance-name.png" alt="button instance for flash CS4" width="283" height="247" /><p class="wp-caption-text">button instance for flash CS4</p></div>
<p>So to create a button in Flash CS3 and CS4 with actionscript 3.0 please follow these steps.</p>
<ol>
<li>Create a button, for example create a box using the <strong>rectangle tool</strong> then right click the box and select <strong>covert to symbol</strong> then select type as <strong>Button,</strong> then press OK.<strong> </strong>
<div id="attachment_19" class="wp-caption aligncenter" style="width: 510px"><strong><strong><img class="size-full wp-image-19" title="My-Button" src="http://www.bluepearl-blog.com/wp-content/uploads/2009/10/My-Button.png" alt="Simple button in flash CS4" width="500" height="400" /></strong></strong><p class="wp-caption-text">Simple button in flash CS4</p></div>
<p><strong> </strong></li>
<li>Select the button and then goto the properties window on the right side of the screen. Give the button an instance name of <strong>My_Button. </strong>
<div id="attachment_20" class="wp-caption aligncenter" style="width: 510px"><strong><strong><img class="size-full wp-image-20" title="instance-name" src="http://www.bluepearl-blog.com/wp-content/uploads/2009/10/instance-name1.png" alt="The button instance name" width="500" height="400" /></strong></strong><p class="wp-caption-text">The button instance name</p></div>
<p><strong> </strong></li>
<li>Create a new layer above your <strong>button</strong> layer in the timeline called <strong>actions</strong>. Select the first frame in the <strong>actions</strong> layer and bring up your actions panel by either going to<strong> window -&gt; actions</strong> or by pressing <strong>F9</strong> on your keyboard.
<div id="attachment_22" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-22" title="button-timeline" src="http://www.bluepearl-blog.com/wp-content/uploads/2009/10/button-timeline.png" alt="Create these layers in your timelime" width="500" height="400" /><p class="wp-caption-text">Create these layers in your timelime</p></div>
<div id="attachment_24" class="wp-caption aligncenter" style="width: 510px"></p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_36" class="wp-caption aligncenter" style="width: 510px;">
<dt class="wp-caption-dt"><img class="size-full wp-image-36" title="actionscript" src="http://www.bluepearl-blog.com/wp-content/uploads/2009/10/actionscript1.png" alt="The action panel (F9)" width="500" height="400" /><p class="wp-caption-text">The action panel (F9)</p></div>
</dt>
<dd class="wp-caption-dd">This is what the action panel looks like</dd>
</dl>
</div>
</li>
<li>In the actions panel enter the Actionscript 3.0 below.</li>
</ol>
<p><code>My_Button.addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);</p>
<p>function mouseClick(event:MouseEvent):void {<br />
navigateToURL(new URLRequest("http://www.bluepearl-design.com/"));<br />
}</code></p>
<p>The Actionscript above will open a new window to www.bluepearl-design.com when clicked, if you prefer the link to open in the same window use this code below:</p>
<p><code>My_Button.addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);</p>
<p>function mouseClick(event:MouseEvent):void {<br />
navigateToURL(new URLRequest("http://www.bluepearl-design.com/"), "_self");<br />
}</code></p>
<p>You can also have the button use a timeline control.</p>
<p><code>My_Button.addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);</p>
<p>function mouseClick(event:MouseEvent):void {<br />
gotoAndPlay(2);<br />
}</code></p>
<p>And that's about it on how to create a simple clickable button in Actionscript 3.0, test the demo out below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluepearl-blog.com/2009/10/actionscript-for-a-button-in-cs4/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

