<?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; image animation</title>
	<atom:link href="http://flashadvanced.com/tag/image-animation/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>Flash slideshow presentation</title>
		<link>http://flashadvanced.com/flash-slideshow-presentation/</link>
		<comments>http://flashadvanced.com/flash-slideshow-presentation/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 21:00:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript 3.0 Basics]]></category>
		<category><![CDATA[fade in]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[image animation]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://flashadvanced.com/?p=307</guid>
		<description><![CDATA[In this tutorial I will show you how to create a nice image presentation using Flash CS3 and few lines of ActionScript 3 code. First of all download the images for the tutorial by clicking here. 1. Now open a new Flash CS3 document with size 420 x 340. Set the frame rate to 16 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flashadvanced.com/?p=307"><br />
<img src="http://flashadvanced.com/wp-content/upload/slideshow/laptopslide.jpg" /><br />
</a></p>
<p>In this tutorial I will show you how to create a nice <strong>image presentation</strong> using Flash CS3 and few lines of ActionScript 3 code. </p>
<p><span id="more-307"></span></p>
<p>First of all download the images for the tutorial by clicking <a href="http://flashadvanced.com/wp-content/upload/slideshow/images.zip">here</a>.</p>
<p><span style="color: #ff0000;">1.</span> Now open a new Flash CS3 document with size 420 x 340. Set the frame rate to 16 fps.</p>
<p><span style="color: #ff0000;">2.</span> Import all of the downloaded images by clicking File -> Import -> Import to Library. Drag &#8220;laptop.jpg&#8221; to the stage and align it to center. Convert it to Movie Clip, give it instance name &#8220;slideshowMC&#8221; and after that go to the new created movie clip. Click on frame 135 and insert frame. Lock the layer.</p>
<p><span style="color: #ff0000;">3.</span> Create a new layer called &#8220;images&#8221;. Now, drag &#8220;pic1.jpg&#8221; to the stage and position it so that it covers the laptop&#8217;s screen. <strong>Break the image apart</strong> by selecting the image and then clicking Modify -> Break apart. Now, deselect the image and go to one of its corners.<br />
Drag the image corners so that they match the laptop&#8217;s screen. See the image below: </p>
<p><img src="http://flashadvanced.com/wp-content/upload/slideshow/laptopsteps.jpg" /></p>
<p>If you are ready, select the image and convert it to Movie Clip. Now, go to <strong>frame 30</strong> and convert it to keyframe. Go back to frame 1, select the image, go to Properties Panel and set the image <strong>alpha</strong> to 0%. Select a frame between 1 and 30 and create <strong>Motion Tween</strong>. Now, go to <strong>frame 35</strong>, convert it to keyframe, remove the image movie clip and drag the second image. Now repeat all previous steps. Do the same for the other images. Your timeline should look like this:</p>
<p><img src="http://flashadvanced.com/wp-content/upload/slideshow/timeline.jpg" /></p>
<p><span style="color: #ff0000;">4.</span> Go to the main stage. Create a new layer called &#8220;buttons&#8221;. Take the rectangle tool and draw a &#8220;stop&#8221; button. Give it an instance name &#8220;stopBtn&#8221;. I made this one:</p>
<p><img src="http://flashadvanced.com/wp-content/upload/slideshow/button.jpg" /></p>
<p>You can take the <strong>Transform tool</strong> and rotate the button a little bit so it matches the laptop. Select the button and go to Modify -> Symbol -> <strong>Duplicate symbol</strong> to create a Play button. Change the text to &#8220;play&#8221; and give the button instance name &#8220;playBtn&#8221;.</p>
<p><span style="color: #ff0000;">5.</span> Now we are ready to move to <strong>ActionScript</strong>. Create a new layer called &#8220;actions&#8221; and open the Actions panel.</p>
<pre><code>
//initially, we don't want to see Play button
playBtn.visible = false;
//positioning the buttons on the same X and Y values
stopBtn.x = playBtn.x;
stopBtn.y = playBtn.y;

//adding event listeners to the buttons
stopBtn.addEventListener(MouseEvent.CLICK, slideshowStop);
playBtn.addEventListener(MouseEvent.CLICK, slideshowPlay);

function slideshowStop(e:MouseEvent):void{
	//when clicking on stop button we stop the slideshow
	slideshowMC.gotoAndStop(1);
	//we hide stop button and show play button
	stopBtn.visible = false;
	playBtn.visible = true;
}

function slideshowPlay(e:MouseEvent):void{
	//when clicking on play button we stopplay the slideshow again
	slideshowMC.gotoAndPlay(2);
	//we hide the play button and show stop button again
	playBtn.visible = false;
	stopBtn.visible = true;
}
</code></pre>
<p>We are ready. I hope you liked it!</p>
<h4>Now let&#8217;s see the final result</h4>
<p><object width="420" height="340"><param name="movie" value="http://flashadvanced.com/wp-content/upload/slideshow/laptopslide.swf"><embed src="http://flashadvanced.com/wp-content/upload/slideshow/laptopslide.swf" width="420" height="340"></embed></object></p>
<p style="text-align: left; margin: 40px 40px 40px 0;"><a href="http://www.flashadvanced.com/wp-content/upload/slideshow/slideshow.zip"><img src="http://flashadvanced.com/wp-content/upload/other/download.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://flashadvanced.com/flash-slideshow-presentation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

