<?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>Free Flash Tutorials at FlashMint Tuts &#187; flash gallery</title>
	<atom:link href="http://tuts.flashmint.com/tag/flash-gallery/feed/" rel="self" type="application/rss+xml" />
	<link>http://tuts.flashmint.com</link>
	<description>Advanced Flash Tutorials and tips</description>
	<lastBuildDate>Wed, 17 Mar 2010 14:16:09 +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>How To Create A Simple Image Gallery In Flash CS4</title>
		<link>http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/</link>
		<comments>http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 13:04:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Tutorials]]></category>
		<category><![CDATA[flash components]]></category>
		<category><![CDATA[flash gallery]]></category>

		<guid isPermaLink="false">http://tuts.flashmint.com/?p=130</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<table width="100%" border="0" cellspacing="10 cellpadding="0">
<tr>
<td>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery3_63205937"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf"
			name="fm_imagegallery3_63205937"
			width="400"
			height="300">
	<!--<![endif]-->
		<br />

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object></td>
<td valign="top">In this tutorial we will show you how to create a <strong>simple image gallery with thumbnails in Flash CS4</strong>. We will apply a couple of simple, yet nice transitions to the images and thumbnails. This will require you to get the hands a bit dirty in animation and action scripting. However, this is going to be easy and fun! So here we go.</td>
</tr>
</table>
<p><span id="more-130"></span><br />
<h3>Step 1.</h3>
<p>Create a new file with ActionScript 3.0 and modify the document like it&#8217;s shown on the screenshot below. You can enter the document properties via the admin panel (follow the highlights in red) or pressing <strong>Ctrl+J</strong>.</p>
<p style="text-align: center;"><img class="size-full wp-image-131 aligncenter" title="1c" src="http://tuts.flashmint.com/wp-content/uploads/1c.jpg" alt="1c" width="600" height="326" /></p>
<h3>Step 2.</h3>
<p>Add four images from your computer to your library. To do this press <strong>File =&gt; Imort =&gt; Import to library</strong>. You can also import the images directly to the stage, by pressing <strong>Ctrl+R</strong>.</p>
<p>Next, create three new layers and give them the names <strong>Buttons</strong>,<strong> Images</strong> and <strong>Actions</strong>. To rename a layer, double click on it and type the text.  See the shot below.</p>
<p style="text-align: center;"><img class="size-full wp-image-132 aligncenter" title="2c" src="http://tuts.flashmint.com/wp-content/uploads/2c.jpg" alt="2c" width="600" height="372" /></p>
<p>Notice that the first frame of each layer has a small circle on it. This is a <em>blank keyframe</em>. Once you put anything on the stage, the circle transforms into black dot which corresponds to the <em>filled keyframe</em>.</p>
<p>Go to the Buttons layer and select the first frame on the timeline. <strong>Drag the images from your library to the stage</strong> (in case you haven&#8217;t imported them right to the stage already) and modify their size to <strong>114&#215;85 px</strong>. Be sure to drag the images to our document area which we&#8217;ve made black earlier.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/3c.jpg"><img class="size-full wp-image-133 aligncenter" title="3c" src="http://tuts.flashmint.com/wp-content/uploads/3c.jpg" alt="3c" width="600" height="289" /></a></p>
<p>Now you have your thumbnails on the stage. Set image alignment selecting <strong>Align</strong> in <strong>Window menu</strong>, or just press <strong>Ctrl+K</strong>. Align pics to the bottom and distribute horizontal center like it&#8217;s shown below.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/4c.jpg"><img class="size-full wp-image-134 aligncenter" title="4c" src="http://tuts.flashmint.com/wp-content/uploads/4c.jpg" alt="4c" width="600" height="328" /></a></p>
<h3>Step 3.</h3>
<p>Our thumbnails are going to be buttons, so now we need to convert the images into the Button symbols. Using the<strong> Selection Tool</strong>, right click on the first thumbnail image and choose <strong>&#8220;Convert to Symbol&#8221;</strong>, or simply hit <strong>F8</strong>. In the opened window set the type Button and name the symbol <strong>btn1</strong>. Click &#8220;OK&#8221; to save the changes. Do this for the other three images and give them the names <strong>btn2</strong>, <strong>btn3</strong> and <strong>btn4</strong>, respectively.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/5c.jpg"><img class="size-full wp-image-135 aligncenter" title="5c" src="http://tuts.flashmint.com/wp-content/uploads/5c.jpg" alt="5c" width="600" height="425" /></a></p>
<p>Now we have to give each of these the same <em>Instance Name</em> which is a name to refer to your symbol or object in ActionScript. Instance Name can be set in the Properties panel which you can enter by selecting the necessary object on the stage. Instance Name of the <strong>btn1</strong> button will be <strong>btn1</strong> and so forth.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/6c.jpg"><img class="size-full wp-image-136 aligncenter" title="6c" src="http://tuts.flashmint.com/wp-content/uploads/6c.jpg" alt="6c" width="300" height="155" /></a></p>
<p>Right click on the first frame of the Buttons layer, select <strong>Copy Frames</strong>, go to the fourth frame and <strong>Paste Frames</strong> the same way. Or you can just drag the first frame up to the fourth cell to copy it. You timeline should have the following look by now.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/7c.jpg"><img class="size-full wp-image-137 aligncenter" title="7c" src="http://tuts.flashmint.com/wp-content/uploads/7c.jpg" alt="7c" width="600" height="392" /></a></p>
<h3>Step 4.</h3>
<p>OK, let&#8217;s put the images that we will be exactly viewing in our gallery. Switch to the <strong>Images layer</strong> and select the first frame on the timeline. Drag the image that corresponds to the first thumbnail from your library to the stage. Size it down to the <strong>358&#215;268 px</strong> and set its position to the <strong>93&#215;18</strong>. Of course, you may set your own dimensions and place the pictures whatever you like; this is just what we use for this tutorial.</p>
<p>Insert three more blank keyframes (<strong>F6</strong>) and do the same operation with the rest of the images.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/8c.jpg"><img class="size-full wp-image-138 aligncenter" title="8c" src="http://tuts.flashmint.com/wp-content/uploads/8c.jpg" alt="8c" width="600" height="363" /></a></p>
<p>Now go back to the timeline, select the first frame and go to the Properties panel. Here we will set the <em>Frame Label</em>. It&#8217;s important to remember about this because we&#8217;re going to reference frame labels in the ActionScript later. We&#8217;ve got four frame labels: <strong>model</strong>, <strong>dreamy</strong>, <strong>dancing </strong>and<strong> teacher</strong>, respectively.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/9c.jpg"><img class="size-full wp-image-139 aligncenter" title="9c" src="http://tuts.flashmint.com/wp-content/uploads/9c.jpg" alt="9c" width="600" height="360" /></a></p>
<h3>Step 5.</h3>
<p>So far we&#8217;ve got a thumbnail gallery where each of the thumbs is a button. Our next step is to <strong>add some action script</strong> so we could click on the button to play the right frame. Go to the <strong>Actions layer</strong> and drag the first frame up to the fourth cell. Your timeline should have the following look by this moment:</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/10c.jpg"><img class="size-full wp-image-140 aligncenter" title="10c" src="http://tuts.flashmint.com/wp-content/uploads/10c.jpg" alt="10c" width="300" height="258" /></a></p>
<p>Go back to the first frame in the Actions layer and hit <strong>F9</strong> to open the <strong>Actions window</strong>. Copy and paste the following code into your Actions window. Don&#8217;t worry, we will explain in great detail what happens shortly.<br />
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><span class="kw7">stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
btn1<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play1<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play1<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;young&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span>
btn2<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play2<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play2<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;thoughtful&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span>
btn3<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play3<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play3<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;dancing&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span>
btn4<span class="sy0">.</span><span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play4<span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">function</span> play4<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span> <span class="br0">&#40;</span><span class="st0">&quot;old&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span></pre></div></div><br />
After you have copied and pasted the above code, go to <strong>Control =&gt; Test Movie</strong> or press <strong>Ctrl + Enter</strong> to see the result gallery. Here is what you should get:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery_252628890"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery.swf"
			name="fm_imagegallery_252628890"
			width="400"
			height="300">
	<!--<![endif]-->
		  
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Let&#8217;s look closer at what you&#8217;ve just done and learn more about AS functions.  The first thing you see in your code window is Stop action.</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><span class="kw7">stop</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>Any effect you create in Flash repeats continuously when you test or publish your movie. Stop action is used to actually stop it from looping. You can apply the Stop action to any keyframe and the movie will stop playing at that exact point.</p>
<p>The next code line is</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;">btn1<span class="sy0">.</span> <span class="kw7">addEventListener</span><span class="br0">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="sy0">.</span><span class="kw8">CLICK</span><span class="sy0">,</span>play1<span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>This script means that <strong>btn1</strong>, our instance name, referring to the first button in our thumbnail gallery, is responding to a mouse click and calls for the function <strong>play1</strong>.</p>
<p>And here goes the definition of that function</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://tuts.flashmint.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="actionscript3" style="font-family:monospace;"><span class="kw3">function</span> play1<span class="br0">&#40;</span>event<span class="sy0">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span class="kw5">MouseEvent</span></a><span class="br0">&#41;</span><span class="sy0">:</span><span class="kw1">void</span><span class="br0">&#123;</span>
<span class="kw7">gotoAndStop</span><span class="br0">&#40;</span><span class="st0">&quot;model&quot;</span><span class="br0">&#41;</span>
<span class="br0">&#125;</span></pre></div></div>
<p>In this line:</p>
<ul>
<li><em><strong>function play1</strong></em> tells us the name of the function;</li>
<li><em><strong>(event:MouseEvent)</strong></em> defines the type of the event , which is interaction with the mouse here,</li>
<li> <em><strong>void</strong></em> is a special type used to specify that the function doesn&#8217;t return any data;</li>
<li> <em><strong>gotoAndStop (&#8220;model&#8221;)</strong></em> causes the playhead to jump to the frame model and stops from progressing further.</li>
</ul>
<p>All right, this is the initial script that allows our image gallery to work properly. As you see, this piece of code repeats for the rest of the buttons, we <strong>change only instance names and frame labels</strong>.</p>
<h3>Step 6.</h3>
<p>To add some spice to our images when they come in, let&#8217;s learn how to animate them in Flash CS4.</p>
<p>So, go up to your <strong>Images layer</strong> and select the first frame. To be able to add some animation to our images, we need to convert them to movie clip symbols. To do this hit <strong>F8</strong> and select <strong>Movie Clip</strong> in the Type menu. Repeat this operation for each of the four images. Let the names be <strong>movie1</strong>, <strong>movie2</strong>, <strong>movie3</strong> and <strong>movie4</strong>.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/11c.jpg"><img class="size-full wp-image-141 aligncenter" title="11c" src="http://tuts.flashmint.com/wp-content/uploads/11c.jpg" alt="11c" width="600" height="450" /></a></p>
<p>Choose the Selection tool from your toolbar and <strong>double click on the first movie clip</strong> we&#8217;ve just created. Now we can animate it.</p>
<p>Right click on the movie clip on the stage and select <strong>Create Motion Tween</strong>.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/12c.jpg"><img class="size-full wp-image-142 aligncenter" title="12c" src="http://tuts.flashmint.com/wp-content/uploads/12c.jpg" alt="12c" width="600" height="331" /></a></p>
<p>You can see that it automatically inserts some frames; the number of frames inserted depends on your frame rate. By default Flash CS4 has a frame rate of 24 frames per second. So basically you have the number of frames that would equal one second. Let&#8217;s <strong>cut it down to 15 frames per second</strong> &#8211; just drag the border of the 24th frame down to the one we need.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/13c.jpg"><img class="size-full wp-image-143 aligncenter" title="13c" src="http://tuts.flashmint.com/wp-content/uploads/13c.jpg" alt="13c" width="600" height="146" /></a></p>
<p>Now<strong> let&#8217;s create a sleek fade-in effect</strong> by means of some color effects and motion tween. Select the image on the stage while the playhead is on the last frame. Go to the object properties, choose <strong>Alpha</strong> in the <strong>Style menu</strong> and put it 0%.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/14c.jpg"><img class="size-full wp-image-144 aligncenter" title="14c" src="http://tuts.flashmint.com/wp-content/uploads/14c.jpg" alt="14c" width="600" height="336" /></a></p>
<p>Move the playhead back and forth and you will see that <strong>we&#8217;ve created a fade-out effect</strong> for our image &#8211; it&#8217;s completely transparent on the last keyframe. Right click anywhere on the motion tween area and select <strong>Reverse Keyframes</strong>. Now we have the fade-in effect applied to the picture.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/15c.jpg"><img class="size-full wp-image-145 aligncenter" title="15c" src="http://tuts.flashmint.com/wp-content/uploads/15c.jpg" alt="15c" width="600" height="246" /></a></p>
<p>Click <strong>Ctrl+Enter</strong> to test your movie. You should see something like this:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery11_2138255824"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery11.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery11.swf"
			name="fm_imagegallery11_2138255824"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p style="text-align: center;">
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Movie plays over and over again and we don&#8217;t want this loop happen. Stop action comes in handy here. Return to your movie clip window, right click on the motion tween area and select <strong>Convert to Frame by Frame Animation</strong>. Then go to the last frame and hit <strong>F9</strong>. Type <strong><em>stop()</em></strong> in the Actions window and that should fix the problem.</p>
<p>Here is the result:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery21_1239280315"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery21.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery21.swf"
			name="fm_imagegallery21_1239280315"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p style="text-align: center;">
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<h3>Step 7.</h3>
<p>Another cute effect we&#8217;re going to apply is <strong>rollover</strong>. Wouldn&#8217;t it be nice to have the thumbnails change a bit when the mouse hovers over? And that&#8217;s pretty easy to do, here we go!</p>
<p>Double click on the first button in the thumbnail line, which is <strong>btn1</strong>. You can see four frames on your timeline &#8211; <strong>Up</strong>, <strong>Over</strong>, <strong>Down</strong> and <strong>Hit</strong>. These are the states of our button.</p>
<ul>
<li>The <strong><em>Up</em></strong> frame is the inactive stage when nothing is happening, the button is displayed as it is.</li>
<li>The <strong><em>Over</em></strong> is the stage when the mouse hovers over the button.</li>
<li>The <strong><em>Down</em></strong> frame is the stage when the button is clicked on.</li>
<li>The purpose of the <em><strong>Hit</strong></em> frame is to define the clickable area or the coordinates of the button.</li>
</ul>
<p>So, insert blank keyframes (<strong>F6</strong>) into each of the frames.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/16c.jpg"><img class="size-full wp-image-146 aligncenter" title="16c" src="http://tuts.flashmint.com/wp-content/uploads/16c.jpg" alt="16c" width="600" height="323" /></a></p>
<p>Go to the Over and select the button on the stage. In order to modify the way it is rendered, we need to convert it into a graphic symbol. Press <strong>F8</strong> and select <strong>Graphic</strong> in the Type menu. Now go to the object properties and do some changes to the color effect. You may do whatever you want, we changed the RGB parameters, for example (see the screenshot below).</p>
<p>Switch to the Down frame and apply some effects if you want the button to change its state when you click on it. In this case, we&#8217;ve added more red to it.</p>
<p>Move on to the Hit area and using the <strong>Rectangular Tool</strong> draw an area you want to be clickable on your button.</p>
<p style="text-align: center;"><a href="http://tuts.flashmint.com/wp-content/uploads/17c.jpg"><img class="size-full wp-image-147 aligncenter" title="17c" src="http://tuts.flashmint.com/wp-content/uploads/17c.jpg" alt="17c" width="600" height="346" /></a></p>
<p>Repeat this step for the other three buttons and press <strong>Ctrl+Enter</strong> to see the result. It should be similar to this:</p>
<p style="text-align: center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_imagegallery3_571474409"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://tuts.flashmint.com/wp-content/uploads/imagegallery3.swf"
			name="fm_imagegallery3_571474409"
			width="400"
			height="300">
	<!--<![endif]-->
		
<p style="text-align: center;">
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>This is it, folks. Now you know how to create a simple image gallery with thumbnails and spice it with some nice effects. If you have any questions, please leave them in comments.</p>
<div id="fb-like" style=""><iframe src="http://www.facebook.com/plugins/like.php?href=http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/&amp;layout=button_count&amp;show_faces=false&amp;width=50&amp;action=like&amp;font=&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:50px; height:25px"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://tuts.flashmint.com/how-to-create-a-simple-image-gallery-in-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

