<?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 User &#187; as3</title>
	<atom:link href="http://www.flashuser.net/tag/as3/feed" rel="self" type="application/rss+xml" />
	<link>http://www.flashuser.net</link>
	<description>FlashUser.net helps creative Flash developers and designers from all over the world to save time and money for their projects. By following our posts you will easily create more effective Flash designs or add value to your Flash software and applications</description>
	<lastBuildDate>Fri, 20 Aug 2010 11:27:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Eyes following mouse cursor AS3</title>
		<link>http://www.flashuser.net/flash-actionscript-as3/eyes-following-mouse-cursor-as3.html</link>
		<comments>http://www.flashuser.net/flash-actionscript-as3/eyes-following-mouse-cursor-as3.html#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:50:16 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Tutorials]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[eyes]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=2322</guid>
		<description><![CDATA[<p>A simple and easy tutorial for you to know how to use the mouse interactivity in Actionscript 3. We&#8217;ll create the eyes for an alien character that will follow the mouse. Also we&#8217;ll hide the mouse and change it with something else. All this is done in a general Movie Clip so you can drag it in your project.</p>
<p><span id="more-2322"></span> Here&#8217;s the final result:</p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_alien_eyes_follow_1942814850"
			class="flashmovie"
			width="550"
			height="300">
	<param name="movie" value="http://www.flashuser.net/flash-files/tutorials/eyes_following_mouse_as3/alien_eyes_follow.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/tutorials/eyes_following_mouse_as3/alien_eyes_follow.swf"
			name="fm_alien_eyes_follow_1942814850"
			width="550"
			height="300">
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p><strong>1. </strong>To create an alien eye draw a white circle that will represent the cornea. Convert it to a Movie Clip that has the registration point centered. Inside this clip draw 2 circles that will represent the iris and convert them to a Movie Clip. Position it right over the cornea. Give an instance name of <strong>eye1</strong> for the parent Movie Clip. Drag other two eyes (instance name of <strong>eye2</strong> and <strong>eye3</strong>) and position them on the alien&#8217;s body.</p>
<div align="center" class="border-media">
<img src="http://www.flashuser.net/wp-content/uploads/2009/09/eyes_follow_11.jpg" alt="eyes_follow_1" title="eyes_follow_1" width="309" height="185" class="alignnone size-full wp-image-2334" />
</div>
<p><strong>2. </strong>Now that we have obtained the eye let&#8217;s create the interactivity. The basic idea is that we&#8217;ll have to rotate the eye according to the mouse position. To do so we&#8217;ll calculate the angle from the eye position to the mouse position and rotate it. To obtain the angle we&#8217;ll use the <strong>atan2</strong> function from Flash, that will have as parameters the Y and X position of the mouse.</p>
<div align="center" class="border-media">
<img src="http://www.flashuser.net/wp-content/uploads/2009/09/eyes_follow_2.jpg" alt="eyes_follow_2" title="eyes_follow_2" width="417" height="202" class="alignnone size-full wp-image-2335" />
</div>
<pre class="brush: as3;">
radians1 = Math.atan2(a1, b1);
</pre>
<p><strong>3.</strong> The angle obtained from the<strong> atan2</strong> function is in radians. To convert it in degrees paste this line.</p>
<pre class="brush: as3;">
degrees1 = radians1 / (Math.PI / 180);
</pre>
<p><strong>4.</strong> Now rotate the eye by the angle obtained in degrees.</p>
<pre class="brush: as3;">
eye1.rotation = degrees1;
</pre>
<p><strong>5.</strong> In order to change the mouse with something else use this code:</p>
<pre class="brush: as3;">
        Mouse.hide();
	cookie.x = mouseX;
	cookie.y = mouseY;
</pre>
<p><strong>6.</strong> All code:</p>
<pre class="brush: as3;">
stage.addEventListener(&quot;mouseMove&quot;, eyesFollow);

cookie.visible = false;

function eyesFollow(e:MouseEvent):void {

	var a1 = mouseY - eye1.y;
	var b1 = mouseX - eye1.x;
	var radians1 = Math.atan2(a1,b1);
	var degrees1 = radians1 / (Math.PI / 180);
	eye1.rotation = degrees1;

	var a2 = mouseY - eye2.y;
	var b2 = mouseX - eye2.x;
	var radians2 = Math.atan2(a2,b2);
	var degrees2 = radians2 / (Math.PI / 180);
	eye2.rotation = degrees2;

	var a3 = mouseY - eye3.y;
	var b3 = mouseX - eye3.x;
	var radians3 = Math.atan2(a3,b3);
	var degrees3 = radians3 / (Math.PI / 180);
	eye3.rotation = degrees3;

	Mouse.hide();
	cookie.visible = true;
	cookie.x = mouseX;
	cookie.y = mouseY;
}
</pre>
<div id="download-file"><a href="http://www.flashuser.net/flash-files/tutorials/eyes_following_mouse_as3/alien_eyes_follow.zip" color="FF0000" target="_blank"><span>Download the source file</span></a></div>
]]></description>
			<content:encoded><![CDATA[<p>A simple and easy tutorial for you to know how to use the mouse interactivity in Actionscript 3. We&#8217;ll create the eyes for an alien character that will follow the mouse. Also we&#8217;ll hide the mouse and change it with something else. All this is done in a general Movie Clip so you can drag it in your project.</p>
<p><span id="more-2322"></span> Here&#8217;s the final result:</p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_alien_eyes_follow_800348815"
			class="flashmovie"
			width="550"
			height="300">
	<param name="movie" value="http://www.flashuser.net/flash-files/tutorials/eyes_following_mouse_as3/alien_eyes_follow.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/tutorials/eyes_following_mouse_as3/alien_eyes_follow.swf"
			name="fm_alien_eyes_follow_800348815"
			width="550"
			height="300">
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p><strong>1. </strong>To create an alien eye draw a white circle that will represent the cornea. Convert it to a Movie Clip that has the registration point centered. Inside this clip draw 2 circles that will represent the iris and convert them to a Movie Clip. Position it right over the cornea. Give an instance name of <strong>eye1</strong> for the parent Movie Clip. Drag other two eyes (instance name of <strong>eye2</strong> and <strong>eye3</strong>) and position them on the alien&#8217;s body.</p>
<div align="center" class="border-media">
<img src="http://www.flashuser.net/wp-content/uploads/2009/09/eyes_follow_11.jpg" alt="eyes_follow_1" title="eyes_follow_1" width="309" height="185" class="alignnone size-full wp-image-2334" />
</div>
<p><strong>2. </strong>Now that we have obtained the eye let&#8217;s create the interactivity. The basic idea is that we&#8217;ll have to rotate the eye according to the mouse position. To do so we&#8217;ll calculate the angle from the eye position to the mouse position and rotate it. To obtain the angle we&#8217;ll use the <strong>atan2</strong> function from Flash, that will have as parameters the Y and X position of the mouse.</p>
<div align="center" class="border-media">
<img src="http://www.flashuser.net/wp-content/uploads/2009/09/eyes_follow_2.jpg" alt="eyes_follow_2" title="eyes_follow_2" width="417" height="202" class="alignnone size-full wp-image-2335" />
</div>
<pre class="brush: as3;">
radians1 = Math.atan2(a1, b1);
</pre>
<p><strong>3.</strong> The angle obtained from the<strong> atan2</strong> function is in radians. To convert it in degrees paste this line.</p>
<pre class="brush: as3;">
degrees1 = radians1 / (Math.PI / 180);
</pre>
<p><strong>4.</strong> Now rotate the eye by the angle obtained in degrees.</p>
<pre class="brush: as3;">
eye1.rotation = degrees1;
</pre>
<p><strong>5.</strong> In order to change the mouse with something else use this code:</p>
<pre class="brush: as3;">
        Mouse.hide();
	cookie.x = mouseX;
	cookie.y = mouseY;
</pre>
<p><strong>6.</strong> All code:</p>
<pre class="brush: as3;">
stage.addEventListener(&quot;mouseMove&quot;, eyesFollow);

cookie.visible = false;

function eyesFollow(e:MouseEvent):void {

	var a1 = mouseY - eye1.y;
	var b1 = mouseX - eye1.x;
	var radians1 = Math.atan2(a1,b1);
	var degrees1 = radians1 / (Math.PI / 180);
	eye1.rotation = degrees1;

	var a2 = mouseY - eye2.y;
	var b2 = mouseX - eye2.x;
	var radians2 = Math.atan2(a2,b2);
	var degrees2 = radians2 / (Math.PI / 180);
	eye2.rotation = degrees2;

	var a3 = mouseY - eye3.y;
	var b3 = mouseX - eye3.x;
	var radians3 = Math.atan2(a3,b3);
	var degrees3 = radians3 / (Math.PI / 180);
	eye3.rotation = degrees3;

	Mouse.hide();
	cookie.visible = true;
	cookie.x = mouseX;
	cookie.y = mouseY;
}
</pre>
<div id="download-file"><a href="http://www.flashuser.net/flash-files/tutorials/eyes_following_mouse_as3/alien_eyes_follow.zip" color="FF0000" target="_blank"><span>Download the source file</span></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-actionscript-as3/eyes-following-mouse-cursor-as3.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Flash of the Day 79</title>
		<link>http://www.flashuser.net/flash-of-the-day/flash-of-the-day-79.html</link>
		<comments>http://www.flashuser.net/flash-of-the-day/flash-of-the-day-79.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 19:53:27 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[Flash of the day]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=2315</guid>
		<description><![CDATA[<p>Because we like to keep up the inspiration, we post daily sparks both for designers and developers.</p>
<p>If you&#8217;d like to contribute send us via contact form the link that inspired you and specify in the message for &#8220;Flash of the day&#8221;  or via Twitter <span  id="writer-content"><a href="http://www.twitter.com/flashuser" target="_blank">http://www.twitter.com/flashuser</a></span></p>
<p><span id="more-2315"></span></p>
<p><span  id="writer-content"><a href="http://your-majesty.com/nestle/index.html" target="_blank">Nestlé Born Better Campaign</a></span></p>
<div align="center" class="border-media"><a href="http://your-majesty.com/nestle/index.html" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/nestle_born_better_campaign.jpg" alt="nestle_born_better_campaign" title="nestle_born_better_campaign" width="560" height="341" class="alignnone size-full wp-image-2317" /></a></div>
<p><span  id="writer-content"><a href="http://www.extrememusic.com/" target="_blank">Extreme Music</a></span></p>
<div align="center" class="border-media"><a href="http://www.extrememusic.com/" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/extreme_music.jpg" alt="extreme_music" title="extreme_music" width="560" height="405" class="alignnone size-full wp-image-2318" /></a></div>
<p><span  id="writer-content"><a href="http://www.flashcomponents.net/component/flash_fotoqueue_cs_as3.html" target="_blank">Fotoqueue CS AS3</a></span><br />
FotoQueue CS is a Flash component which allows you to build a queue of your product for displaying to your customer in a way innovative. </p>
<div align="center" class="border-media"><a href="http://www.flashcomponents.net/component/flash_fotoqueue_cs_as3.html" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/fotoqueue_as3.jpg" alt="fotoqueue_as3" title="fotoqueue_as3" width="560" height="319" class="alignnone size-full wp-image-2319" /></a></div>
]]></description>
			<content:encoded><![CDATA[<p>Because we like to keep up the inspiration, we post daily sparks both for designers and developers.</p>
<p>If you&#8217;d like to contribute send us via contact form the link that inspired you and specify in the message for &#8220;Flash of the day&#8221;  or via Twitter <span  id="writer-content"><a href="http://www.twitter.com/flashuser" target="_blank">http://www.twitter.com/flashuser</a></span></p>
<p><span id="more-2315"></span></p>
<p><span  id="writer-content"><a href="http://your-majesty.com/nestle/index.html" target="_blank">Nestlé Born Better Campaign</a></span></p>
<div align="center" class="border-media"><a href="http://your-majesty.com/nestle/index.html" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/nestle_born_better_campaign.jpg" alt="nestle_born_better_campaign" title="nestle_born_better_campaign" width="560" height="341" class="alignnone size-full wp-image-2317" /></a></div>
<p><span  id="writer-content"><a href="http://www.extrememusic.com/" target="_blank">Extreme Music</a></span></p>
<div align="center" class="border-media"><a href="http://www.extrememusic.com/" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/extreme_music.jpg" alt="extreme_music" title="extreme_music" width="560" height="405" class="alignnone size-full wp-image-2318" /></a></div>
<p><span  id="writer-content"><a href="http://www.flashcomponents.net/component/flash_fotoqueue_cs_as3.html" target="_blank">Fotoqueue CS AS3</a></span><br />
FotoQueue CS is a Flash component which allows you to build a queue of your product for displaying to your customer in a way innovative. </p>
<div align="center" class="border-media"><a href="http://www.flashcomponents.net/component/flash_fotoqueue_cs_as3.html" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/fotoqueue_as3.jpg" alt="fotoqueue_as3" title="fotoqueue_as3" width="560" height="319" class="alignnone size-full wp-image-2319" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-of-the-day/flash-of-the-day-79.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build an image slideshow in Flash</title>
		<link>http://www.flashuser.net/flash-actionscript-as3/build-an-image-slideshow-in-flash.html</link>
		<comments>http://www.flashuser.net/flash-actionscript-as3/build-an-image-slideshow-in-flash.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 22:03:44 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Tutorials]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[banner rotator]]></category>
		<category><![CDATA[flash tutorial]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=1888</guid>
		<description><![CDATA[<p>In this tutorial I will describe how to create an image sliding in Actionscript 3.0. For creating the transition we&#8217;ll use the standard Tween from Flash. You can use this in your projects, product presentation, anywhere you need such a tool.</p>
<p><span id="more-1888"></span>The images used in this tutorial were taken from flickr user <span  id="writer-content"><a href="http://www.flickr.com/photos/mundilfari_gjk" target="_blank">mundilfari_gjk</a></span></p>
<p>The end result (rollover the image for the navigation buttons to appear):</p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_flash_image_slideshow_1456773917"
			class="flashmovie"
			width="500"
			height="250">
	<param name="movie" value="http://www.flashuser.net/flash-files/tutorials/image_slideshow_as3/flash_image_slideshow.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/tutorials/image_slideshow_as3/flash_image_slideshow.swf"
			name="fm_flash_image_slideshow_1456773917"
			width="500"
			height="250">
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p><strong>1.</strong> Create a new Flash AS3 file (500 x 250) with a frame rate of 30 fps and 3 layers inside of it.</p>
<div align="center" class="border-media"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/flash_slideshow_1.jpg" alt="flash_slideshow_1" title="flash_slideshow_1" width="279" height="56" class="alignnone size-full wp-image-1900" /></div>
<p><strong>2.</strong> In the last layer, create an empty Movie Clip with the registration point in the top left corner (Insert ->New Symbol). Place the images side by side in the Movie Clip together with the text name and description in front of each picture. Give it an instance name of <strong>mc</strong>.</p>
<div align="center" class="border-media"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/flash_slideshow_3.jpg" alt="flash_slideshow_3" title="flash_slideshow_3" width="560" height="89" class="alignnone size-full wp-image-1921" /></div>
<p><strong>3.</strong> Select the buttons layer from the timeline and draw a 30&#215;30 rectangle and two lines for the button arrow. Center align and convert them to a Movie Clip(right click &#8211; Convert to Symbol). Give an instance name of <strong>button_left</strong>. Duplicate this and inside of it change the arrow shape to point in the right direction and give an instance name of <strong>button_right</strong>.</p>
<div align="center" class="border-media"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/flash_slideshow_2.jpg" alt="flash_slideshow_2" title="flash_slideshow_2" width="211" height="135" class="alignnone size-full wp-image-1904" /></div>
<p><strong>4.</strong> In the <strong>as</strong> layer open the Actions tab. Import the transition classes for tweening. Declare variables for the image to play, total images and an array with the X coordinate of each image.</p>
<pre class="brush: as3;">
import fl.transitions.easing.*;
import fl.transitions.*;

//know what image to play
var count :Number = 0;

//an array with the images  x - coordinate
var imagePos :Array = [0,-500,-1000,-1500,-2000];

var imgLength = imagePos.length-1;
</pre>
<p><strong>5.</strong> Create the buttons and the functions for them to appear or disapper according to the mouse move.</p>
<pre class="brush: as3;">
//left button
button_left.buttonMode = true;
button_left.useHandCursor = true;
button_left.mouseChildren = false;
button_left.addEventListener(&quot;mouseDown&quot;,buttonLeftPress);
button_left.visible = false;

//right button
button_right.buttonMode = true;
button_right.useHandCursor = true;
button_right.mouseChildren = false;
button_right.addEventListener(&quot;mouseDown&quot;,buttonRightPress);
button_right.visible = false;

//functions for buttons to appear or disapper according to the mouse move
stage.addEventListener(&quot;mouseMove&quot;, getPosition);
stage.addEventListener( Event.MOUSE_LEAVE,leftStage );

function leftStage(e:Event) {
	button_left.visible = false;
	button_right.visible = false;
}
function getPosition(e:MouseEvent) {
	if (mouseX &lt; stage.stageWidth/2) {
		button_left.visible = true;
		button_right.visible = false;
	} else {
		button_left.visible = false;
		button_right.visible = true;
	}

}
</pre>
<p><strong>6.</strong> Create the functions for the images transition when you click the left or the right button.</p>
<pre class="brush: as3;">
//left button press
function buttonLeftPress(e:MouseEvent) {
	count--;
	if (count &lt;0) {
		count = imgLength;
	}
	new Tween(mc,&quot;x&quot;,Regular.easeOut,mc.x,imagePos[count],1,true);
}
//right button press
function buttonRightPress(e:MouseEvent) {
	count++;
	if (count &gt;imgLength) {
		count = 0;
	}

	new Tween(mc,&quot;x&quot;,Regular.easeOut,mc.x,imagePos[count],1,true);
}
</pre>
<div id="download-file"><a href="http://flashuser.net/flash-files/tutorials/image_slideshow_as3/flash_image_slideshow.zip" target="_blank"><span>Download Source</span></a></div>
]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I will describe how to create an image sliding in Actionscript 3.0. For creating the transition we&#8217;ll use the standard Tween from Flash. You can use this in your projects, product presentation, anywhere you need such a tool.</p>
<p><span id="more-1888"></span>The images used in this tutorial were taken from flickr user <span  id="writer-content"><a href="http://www.flickr.com/photos/mundilfari_gjk" target="_blank">mundilfari_gjk</a></span></p>
<p>The end result (rollover the image for the navigation buttons to appear):</p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_flash_image_slideshow_573020646"
			class="flashmovie"
			width="500"
			height="250">
	<param name="movie" value="http://www.flashuser.net/flash-files/tutorials/image_slideshow_as3/flash_image_slideshow.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/tutorials/image_slideshow_as3/flash_image_slideshow.swf"
			name="fm_flash_image_slideshow_573020646"
			width="500"
			height="250">
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p><strong>1.</strong> Create a new Flash AS3 file (500 x 250) with a frame rate of 30 fps and 3 layers inside of it.</p>
<div align="center" class="border-media"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/flash_slideshow_1.jpg" alt="flash_slideshow_1" title="flash_slideshow_1" width="279" height="56" class="alignnone size-full wp-image-1900" /></div>
<p><strong>2.</strong> In the last layer, create an empty Movie Clip with the registration point in the top left corner (Insert ->New Symbol). Place the images side by side in the Movie Clip together with the text name and description in front of each picture. Give it an instance name of <strong>mc</strong>.</p>
<div align="center" class="border-media"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/flash_slideshow_3.jpg" alt="flash_slideshow_3" title="flash_slideshow_3" width="560" height="89" class="alignnone size-full wp-image-1921" /></div>
<p><strong>3.</strong> Select the buttons layer from the timeline and draw a 30&#215;30 rectangle and two lines for the button arrow. Center align and convert them to a Movie Clip(right click &#8211; Convert to Symbol). Give an instance name of <strong>button_left</strong>. Duplicate this and inside of it change the arrow shape to point in the right direction and give an instance name of <strong>button_right</strong>.</p>
<div align="center" class="border-media"><img src="http://www.flashuser.net/wp-content/uploads/2009/09/flash_slideshow_2.jpg" alt="flash_slideshow_2" title="flash_slideshow_2" width="211" height="135" class="alignnone size-full wp-image-1904" /></div>
<p><strong>4.</strong> In the <strong>as</strong> layer open the Actions tab. Import the transition classes for tweening. Declare variables for the image to play, total images and an array with the X coordinate of each image.</p>
<pre class="brush: as3;">
import fl.transitions.easing.*;
import fl.transitions.*;

//know what image to play
var count :Number = 0;

//an array with the images  x - coordinate
var imagePos :Array = [0,-500,-1000,-1500,-2000];

var imgLength = imagePos.length-1;
</pre>
<p><strong>5.</strong> Create the buttons and the functions for them to appear or disapper according to the mouse move.</p>
<pre class="brush: as3;">
//left button
button_left.buttonMode = true;
button_left.useHandCursor = true;
button_left.mouseChildren = false;
button_left.addEventListener(&quot;mouseDown&quot;,buttonLeftPress);
button_left.visible = false;

//right button
button_right.buttonMode = true;
button_right.useHandCursor = true;
button_right.mouseChildren = false;
button_right.addEventListener(&quot;mouseDown&quot;,buttonRightPress);
button_right.visible = false;

//functions for buttons to appear or disapper according to the mouse move
stage.addEventListener(&quot;mouseMove&quot;, getPosition);
stage.addEventListener( Event.MOUSE_LEAVE,leftStage );

function leftStage(e:Event) {
	button_left.visible = false;
	button_right.visible = false;
}
function getPosition(e:MouseEvent) {
	if (mouseX &lt; stage.stageWidth/2) {
		button_left.visible = true;
		button_right.visible = false;
	} else {
		button_left.visible = false;
		button_right.visible = true;
	}

}
</pre>
<p><strong>6.</strong> Create the functions for the images transition when you click the left or the right button.</p>
<pre class="brush: as3;">
//left button press
function buttonLeftPress(e:MouseEvent) {
	count--;
	if (count &lt;0) {
		count = imgLength;
	}
	new Tween(mc,&quot;x&quot;,Regular.easeOut,mc.x,imagePos[count],1,true);
}
//right button press
function buttonRightPress(e:MouseEvent) {
	count++;
	if (count &gt;imgLength) {
		count = 0;
	}

	new Tween(mc,&quot;x&quot;,Regular.easeOut,mc.x,imagePos[count],1,true);
}
</pre>
<div id="download-file"><a href="http://flashuser.net/flash-files/tutorials/image_slideshow_as3/flash_image_slideshow.zip" target="_blank"><span>Download Source</span></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-actionscript-as3/build-an-image-slideshow-in-flash.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Flash of the Day 43</title>
		<link>http://www.flashuser.net/flash-of-the-day/flash-of-the-day-43.html</link>
		<comments>http://www.flashuser.net/flash-of-the-day/flash-of-the-day-43.html#comments</comments>
		<pubDate>Sat, 15 Aug 2009 18:59:48 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[Flash of the day]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[ecological]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=1408</guid>
		<description><![CDATA[<p>Because we like to keep up the inspiration, we post daily sparks both for designers and developers.</p>
<p>If you&#8217;d like to contribute send us via contact form the link that inspired you and specify in the message for &#8220;Flash of the day&#8221;  or via Twitter http://www.twitter.com/flashuser</p>
<p><span id="more-1408"></span></p>
<p><span  id="writer-content"><a href="http://ge.ecomagination.com/smartgrid/#/landing_page" target="_blank">GE | Plug Into the Smart Grid</a></span></p>
<div class="border-media"><a href="http://ge.ecomagination.com/smartgrid/#/landing_page" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/08/ecoimagination.jpg" alt="ecoimagination" title="ecoimagination" width="560" height="263" class="alignnone size-full wp-image-1410" /></a></div>
<p><span  id="writer-content"><a href="http://www.venour.com/" target="_blank">VENOUR</a></span></p>
<div class="border-media"><a href="http://www.venour.com/" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/08/venour.jpg" alt="venour" title="venour" width="560" height="306" class="alignnone size-full wp-image-1411" /></a></div>
<p><span  id="writer-content"><a href="http://www.flashcomponents.net/component/html_xml_news_list_as_3.html" target="_blank">HTML / XML News List AS3</a></span><br />
Highly customizable HTML / XML driven news list with custom scrolling and coloring effects. Flash CS3 / Flash CS4 and above / ActionScript 3.0 version. </p>
<div class="border-media"><a href="http://www.flashcomponents.net/component/html_xml_news_list_as_3.html" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/08/flash_components3.jpg" alt="flash_components" title="flash_components" width="560" height="271" class="alignnone size-full wp-image-1412" /></a></div>
]]></description>
			<content:encoded><![CDATA[<p>Because we like to keep up the inspiration, we post daily sparks both for designers and developers.</p>
<p>If you&#8217;d like to contribute send us via contact form the link that inspired you and specify in the message for &#8220;Flash of the day&#8221;  or via Twitter http://www.twitter.com/flashuser</p>
<p><span id="more-1408"></span></p>
<p><span  id="writer-content"><a href="http://ge.ecomagination.com/smartgrid/#/landing_page" target="_blank">GE | Plug Into the Smart Grid</a></span></p>
<div class="border-media"><a href="http://ge.ecomagination.com/smartgrid/#/landing_page" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/08/ecoimagination.jpg" alt="ecoimagination" title="ecoimagination" width="560" height="263" class="alignnone size-full wp-image-1410" /></a></div>
<p><span  id="writer-content"><a href="http://www.venour.com/" target="_blank">VENOUR</a></span></p>
<div class="border-media"><a href="http://www.venour.com/" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/08/venour.jpg" alt="venour" title="venour" width="560" height="306" class="alignnone size-full wp-image-1411" /></a></div>
<p><span  id="writer-content"><a href="http://www.flashcomponents.net/component/html_xml_news_list_as_3.html" target="_blank">HTML / XML News List AS3</a></span><br />
Highly customizable HTML / XML driven news list with custom scrolling and coloring effects. Flash CS3 / Flash CS4 and above / ActionScript 3.0 version. </p>
<div class="border-media"><a href="http://www.flashcomponents.net/component/html_xml_news_list_as_3.html" target="_blank"><img src="http://www.flashuser.net/wp-content/uploads/2009/08/flash_components3.jpg" alt="flash_components" title="flash_components" width="560" height="271" class="alignnone size-full wp-image-1412" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-of-the-day/flash-of-the-day-43.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips &amp; Tricks 10: Using Drag &amp; Drop in Actionscript 3.0</title>
		<link>http://www.flashuser.net/flash-tricks/tips-tricks-10-using-drag-drop-in-actionscript-3-0.html</link>
		<comments>http://www.flashuser.net/flash-tricks/tips-tricks-10-using-drag-drop-in-actionscript-3-0.html#comments</comments>
		<pubDate>Fri, 07 Aug 2009 18:02:34 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Tips & Tricks]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[drag&drop]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=1060</guid>
		<description><![CDATA[<p>A really simple and useful tip. The drag and drop functionality in Actionscript 3.0. You can use it to drag pictures from one spot to other, to put items in a shoping cart, to arrange objects in a specific order etc. I&#8217;ll show you how to match 3 different shapes in their corresponding spots.</p>
<p><span id="more-1060"></span>Here is the final movie:</p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_figures_1213940704"
			class="flashmovie"
			width="560"
			height="300">
	<param name="movie" value="http://www.flashuser.net/flash-files/flash_tips_tricks/drag_drop_as3/figures.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/flash_tips_tricks/drag_drop_as3/figures.swf"
			name="fm_figures_1213940704"
			width="560"
			height="300">
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p>How is done:</p>
<p><strong>1.</strong> Create the 3 small shapes and put them individually in a Movie Clip. Also give each of them an instance name (I call them <strong>item1</strong>, <strong>item2</strong>, <strong>item3</strong>).</p>
<p><strong>2.</strong> Now for the large shape, create an empty Movie Clip (instance name <strong>bin1</strong>). Draw a circle without stroke and convert it to a Movie Clip. Give it an instance name of <em>&#8220;shape&#8221;</em> and place it at <strong>x=0</strong> and <strong>y=0</strong>. Create a new layer and draw there a circle same width and height like the first one but without fill. Place it at the same coordinates.</p>
<p><strong>3.</strong> For the triangle and rectangle follow the steps from point 2, except the empty Movie Clip instances.( rectangle -<strong> bin2</strong> , triangle &#8211; <strong>bin3</strong> )</p>
<p><strong>4.</strong> Create two Dynamic TextFields (instance name <strong>itemName_txt</strong> and <strong>info_txt</strong>) and place them in a empty Movie Clip (instance name <strong>ilabel</strong>).</p>
<p> <strong>5.</strong> Final step copy the actionscript code bellow and paste it in the <strong>Actions</strong> tab.</p>
<pre class="brush: as3;">
item1.objName = &quot;circle&quot;;
item1.initX = item1.x;
item1.initY = item1.y;
item1.val = 0;

item2.objName = &quot;rectangle&quot;;
item2.initX = item2.x;
item2.initY = item2.y;
item2.val = 0;

item3.objName = &quot;triangle&quot;;
item3.initX = item3.x;
item3.initY = item3.y;
item3.val = 0;

bin1.shape.alpha = 0;
bin2.shape.alpha = 0;
bin3.shape.alpha = 0;

item1.buttonMode = true;
item2.buttonMode = true;
item3.buttonMode = true;

item1.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
item1.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
item2.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
item2.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
item3.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
item3.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);

//Mouse Events

function mousePress(event:MouseEvent):void {
	var item:MovieClip = MovieClip(event.target);
	item.startDrag();
	item.scaleX = item.scaleY = .95;
	var topPos:uint = this.numChildren - 1;
	this.setChildIndex(item, topPos);
	ilabel.itemName_txt.text = item.objName;
}

function mouseRelease(event:MouseEvent):void {
	var item:MovieClip = MovieClip(event.target);
	item.stopDrag();

	switch (item.objName) {
		case &quot;circle&quot; :
			if (bin1.hitTestObject(item)) {
				updateShape(item, bin1);

			} else {
				ilabel.info_txt.text =&quot;WRONG!&quot;;
				item.scaleX = item.scaleY = 1;
			}
			break;
		case &quot;rectangle&quot; :
			if (bin2.hitTestObject(item)) {
				updateShape(item, bin2);

			} else {
				ilabel.info_txt.text =&quot;WRONG!&quot;;
				item.scaleX = item.scaleY = 1;
			}
			break;
		case &quot;triangle&quot; :
			if (bin3.hitTestObject(item)) {
				updateShape(item, bin3);
			} else {
				ilabel.info_txt.text =&quot;WRONG!&quot;;
				item.scaleX = item.scaleY = 1;
			}
			break;
		default :
			; ;
	}
}
function updateShape(item:MovieClip, bin:MovieClip):void {
	ilabel.itemName_txt.text = &quot;&quot;;
	item.scaleX = item.scaleY = 1;
	item.visible = false;
	ilabel.info_txt.text =&quot;CORRECT!&quot;;
	bin.shape.alpha = 1;
	item.val = 1;
	resetShapes();
}

function resetShapes() {
	if ((item1.val == 1)&amp;&amp; (item2.val == 1) &amp;&amp; (item3.val == 1)) {

		item1.x = item1.initX;
		item1.y = item1.initY;
		item2.x = item2.initX;
		item2.y = item2.initY;
		item3.x = item3.initX;
		item3.y = item3.initY;

		bin1.shape.alpha = 0;
		bin2.shape.alpha = 0;
		bin3.shape.alpha = 0;

		item1.visible = true;
		item2.visible = true;
		item3.visible = true;

		item1.val = 0;
		item2.val = 0;
		item3.val = 0;

	}
}
</pre>
<div id="download-file"><a href="http://www.flashuser.net/flash-files/flash_tips_tricks/drag_drop_as3/drag_drop_as3.zip" target="_blank"><span>Download Source</span></a></div>
]]></description>
			<content:encoded><![CDATA[<p>A really simple and useful tip. The drag and drop functionality in Actionscript 3.0. You can use it to drag pictures from one spot to other, to put items in a shoping cart, to arrange objects in a specific order etc. I&#8217;ll show you how to match 3 different shapes in their corresponding spots.</p>
<p><span id="more-1060"></span>Here is the final movie:</p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_figures_1061940895"
			class="flashmovie"
			width="560"
			height="300">
	<param name="movie" value="http://www.flashuser.net/flash-files/flash_tips_tricks/drag_drop_as3/figures.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/flash_tips_tricks/drag_drop_as3/figures.swf"
			name="fm_figures_1061940895"
			width="560"
			height="300">
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<p>How is done:</p>
<p><strong>1.</strong> Create the 3 small shapes and put them individually in a Movie Clip. Also give each of them an instance name (I call them <strong>item1</strong>, <strong>item2</strong>, <strong>item3</strong>).</p>
<p><strong>2.</strong> Now for the large shape, create an empty Movie Clip (instance name <strong>bin1</strong>). Draw a circle without stroke and convert it to a Movie Clip. Give it an instance name of <em>&#8220;shape&#8221;</em> and place it at <strong>x=0</strong> and <strong>y=0</strong>. Create a new layer and draw there a circle same width and height like the first one but without fill. Place it at the same coordinates.</p>
<p><strong>3.</strong> For the triangle and rectangle follow the steps from point 2, except the empty Movie Clip instances.( rectangle -<strong> bin2</strong> , triangle &#8211; <strong>bin3</strong> )</p>
<p><strong>4.</strong> Create two Dynamic TextFields (instance name <strong>itemName_txt</strong> and <strong>info_txt</strong>) and place them in a empty Movie Clip (instance name <strong>ilabel</strong>).</p>
<p> <strong>5.</strong> Final step copy the actionscript code bellow and paste it in the <strong>Actions</strong> tab.</p>
<pre class="brush: as3;">
item1.objName = &quot;circle&quot;;
item1.initX = item1.x;
item1.initY = item1.y;
item1.val = 0;

item2.objName = &quot;rectangle&quot;;
item2.initX = item2.x;
item2.initY = item2.y;
item2.val = 0;

item3.objName = &quot;triangle&quot;;
item3.initX = item3.x;
item3.initY = item3.y;
item3.val = 0;

bin1.shape.alpha = 0;
bin2.shape.alpha = 0;
bin3.shape.alpha = 0;

item1.buttonMode = true;
item2.buttonMode = true;
item3.buttonMode = true;

item1.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
item1.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
item2.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
item2.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);
item3.addEventListener(MouseEvent.MOUSE_DOWN, mousePress);
item3.addEventListener(MouseEvent.MOUSE_UP, mouseRelease);

//Mouse Events

function mousePress(event:MouseEvent):void {
	var item:MovieClip = MovieClip(event.target);
	item.startDrag();
	item.scaleX = item.scaleY = .95;
	var topPos:uint = this.numChildren - 1;
	this.setChildIndex(item, topPos);
	ilabel.itemName_txt.text = item.objName;
}

function mouseRelease(event:MouseEvent):void {
	var item:MovieClip = MovieClip(event.target);
	item.stopDrag();

	switch (item.objName) {
		case &quot;circle&quot; :
			if (bin1.hitTestObject(item)) {
				updateShape(item, bin1);

			} else {
				ilabel.info_txt.text =&quot;WRONG!&quot;;
				item.scaleX = item.scaleY = 1;
			}
			break;
		case &quot;rectangle&quot; :
			if (bin2.hitTestObject(item)) {
				updateShape(item, bin2);

			} else {
				ilabel.info_txt.text =&quot;WRONG!&quot;;
				item.scaleX = item.scaleY = 1;
			}
			break;
		case &quot;triangle&quot; :
			if (bin3.hitTestObject(item)) {
				updateShape(item, bin3);
			} else {
				ilabel.info_txt.text =&quot;WRONG!&quot;;
				item.scaleX = item.scaleY = 1;
			}
			break;
		default :
			; ;
	}
}
function updateShape(item:MovieClip, bin:MovieClip):void {
	ilabel.itemName_txt.text = &quot;&quot;;
	item.scaleX = item.scaleY = 1;
	item.visible = false;
	ilabel.info_txt.text =&quot;CORRECT!&quot;;
	bin.shape.alpha = 1;
	item.val = 1;
	resetShapes();
}

function resetShapes() {
	if ((item1.val == 1)&amp;&amp; (item2.val == 1) &amp;&amp; (item3.val == 1)) {

		item1.x = item1.initX;
		item1.y = item1.initY;
		item2.x = item2.initX;
		item2.y = item2.initY;
		item3.x = item3.initX;
		item3.y = item3.initY;

		bin1.shape.alpha = 0;
		bin2.shape.alpha = 0;
		bin3.shape.alpha = 0;

		item1.visible = true;
		item2.visible = true;
		item3.visible = true;

		item1.val = 0;
		item2.val = 0;
		item3.val = 0;

	}
}
</pre>
<div id="download-file"><a href="http://www.flashuser.net/flash-files/flash_tips_tricks/drag_drop_as3/drag_drop_as3.zip" target="_blank"><span>Download Source</span></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-tricks/tips-tricks-10-using-drag-drop-in-actionscript-3-0.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Freebie: XML Image Viewer AS3</title>
		<link>http://www.flashuser.net/flash-actionscript-as3/freebie-xml-image-viewer-as3.html</link>
		<comments>http://www.flashuser.net/flash-actionscript-as3/freebie-xml-image-viewer-as3.html#comments</comments>
		<pubDate>Wed, 05 Aug 2009 14:22:58 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Gallery]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[image gallery]]></category>
		<category><![CDATA[xml image]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=1006</guid>
		<description><![CDATA[<p>This freebie is a XML driven image viewer built in Actionscript 3.0. It&#8217;s very easy to integrate in your projects, change the images path and description text from XML. </p>
<p><span id="more-1006"></span>If you want to change the thumbs into vertical mode configure <strong>horizontalMode</strong> variable from the FLA file. Also for other parameters check the FLA. Don&#8217;t forget to give us credits for this file if you intend to use it. </p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_image_viewer_as3_822725674"
			class="flashmovie"
			width="500"
			height="350">
	<param name="movie" value="http://www.flashuser.net/flash-files/freebie/image_viewer/image_viewer_as3.swf" />
	<param name="base" value="http://www.flashuser.net/flash-files/freebie/image_viewer/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/freebie/image_viewer/image_viewer_as3.swf"
			name="fm_image_viewer_as3_822725674"
			width="500"
			height="350">
		<param name="base" value="http://www.flashuser.net/flash-files/freebie/image_viewer/" />
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<div id="download-file"><a href="http://www.flashuser.net/flash-files/freebie/image_viewer/image_viewer.zip" target="_blank"><span>Download Source</span></a></div>
]]></description>
			<content:encoded><![CDATA[<p>This freebie is a XML driven image viewer built in Actionscript 3.0. It&#8217;s very easy to integrate in your projects, change the images path and description text from XML. </p>
<p><span id="more-1006"></span>If you want to change the thumbs into vertical mode configure <strong>horizontalMode</strong> variable from the FLA file. Also for other parameters check the FLA. Don&#8217;t forget to give us credits for this file if you intend to use it. </p>
<div align="center" class="border-media">

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_image_viewer_as3_1584273861"
			class="flashmovie"
			width="500"
			height="350">
	<param name="movie" value="http://www.flashuser.net/flash-files/freebie/image_viewer/image_viewer_as3.swf" />
	<param name="base" value="http://www.flashuser.net/flash-files/freebie/image_viewer/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.flashuser.net/flash-files/freebie/image_viewer/image_viewer_as3.swf"
			name="fm_image_viewer_as3_1584273861"
			width="500"
			height="350">
		<param name="base" value="http://www.flashuser.net/flash-files/freebie/image_viewer/" />
	<!--<![endif]-->
		<br />
 <!-- Begin Alternate Content --></p>
<p>
 <a href="http://adobe.com/go/getflashplayer"><br />
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /><br />
</a>
 </p>
<p><!-- End Alternate Content --></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
</div>
<div id="download-file"><a href="http://www.flashuser.net/flash-files/freebie/image_viewer/image_viewer.zip" target="_blank"><span>Download Source</span></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-actionscript-as3/freebie-xml-image-viewer-as3.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Tips &amp; Tricks 3: Loading of external resources such as images or SWFs using ActionScript 3.0</title>
		<link>http://www.flashuser.net/flash-tricks/loading-external-images-swfs-as3.html</link>
		<comments>http://www.flashuser.net/flash-tricks/loading-external-images-swfs-as3.html#comments</comments>
		<pubDate>Fri, 12 Jun 2009 09:22:30 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Tips & Tricks]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[load swf]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=118</guid>
		<description><![CDATA[<p>Maybe you have tried many different ways loading an external resource such as images or SWFs inside an empty movie clip from the stage and no matter what you have tried when loading another image / SWF again you saw two or three versions of it playing and hogging resources. Not good.</p>
<p><span id="more-118"></span></p>
<p>You first need to understand that this loading problem of an external image or SWF is a bug in how the removing a child / garbage collector / display list mechanisms are working in AS3 / Flash player and not an issue with the SWF of your product(s).</p>
<p>That&#8217;s because when you remove a child in Flash AS3, the reference to that child is still there in parent although you believed it was entirely removed. Here is a simple function that you can use in the future when you load images or SWFs inside an empty movie clip:</p>
<pre class="brush: as3;">function loadResource(resURL) {

var url = resURL;
var request1 = new URLRequest(url);
var loader1 = new Loader();

var mc1 = this.getChildByName(“mc”
var nc = mc1.numChildren;

if (nc) { var l1 = mc1.getChildAt(0); mc1.removeChild(l1); l1 = null; }

loader1.load(request1); //start loading img/swf
mc1.addChild(loader1);

loader1.contentLoaderInfo.addEventListener(“complete”, this.finished_loading);

}

function finished_loading(e:Event) { trace(“Loading completed.” }</pre>
<p>, where mc is the instance name of an empty movie clip from the stage. You can simply call this function with the path string to your external SWFs and images avoiding references duplicates.</p>
]]></description>
			<content:encoded><![CDATA[<p>Maybe you have tried many different ways loading an external resource such as images or SWFs inside an empty movie clip from the stage and no matter what you have tried when loading another image / SWF again you saw two or three versions of it playing and hogging resources. Not good.</p>
<p><span id="more-118"></span></p>
<p>You first need to understand that this loading problem of an external image or SWF is a bug in how the removing a child / garbage collector / display list mechanisms are working in AS3 / Flash player and not an issue with the SWF of your product(s).</p>
<p>That&#8217;s because when you remove a child in Flash AS3, the reference to that child is still there in parent although you believed it was entirely removed. Here is a simple function that you can use in the future when you load images or SWFs inside an empty movie clip:</p>
<pre class="brush: as3;">function loadResource(resURL) {

var url = resURL;
var request1 = new URLRequest(url);
var loader1 = new Loader();

var mc1 = this.getChildByName(“mc”
var nc = mc1.numChildren;

if (nc) { var l1 = mc1.getChildAt(0); mc1.removeChild(l1); l1 = null; }

loader1.load(request1); //start loading img/swf
mc1.addChild(loader1);

loader1.contentLoaderInfo.addEventListener(“complete”, this.finished_loading);

}

function finished_loading(e:Event) { trace(“Loading completed.” }</pre>
<p>, where mc is the instance name of an empty movie clip from the stage. You can simply call this function with the path string to your external SWFs and images avoiding references duplicates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-tricks/loading-external-images-swfs-as3.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
