<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Dynamically loading images using the UILoader component in Flash using ActionScript 3.0</title>
	<atom:link href="http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/feed/" rel="self" type="application/rss+xml" />
	<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/</link>
	<description>A bunch of ActionScript 2.0 and ActionScript 3.0 examples*</description>
	<lastBuildDate>Thu, 22 Jul 2010 14:13:10 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: sy wa</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-678</link>
		<dc:creator>sy wa</dc:creator>
		<pubDate>Sat, 15 May 2010 11:07:25 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-678</guid>
		<description>Hi
I have a problem with loading images from an external folder.
The problem is I have 6 images and load using the UI loader. 
This all works fine although I need a line of code to tell the loader it is at the last image because it trys to load image 7, and there is no image 7.

Please help, its driving me nuts. I just need a stop or, this is the last image command.

following code has been used:

Image_next_btn.addEventListener(MouseEvent.CLICK, nextImage);

//variable is a container that holds some value
var imageNumber:Number = 1;

function nextImage (evtObj:MouseEvent):void
{
//Adding to the current value +1
imageNumber++;
project_aLoader.source = &quot;images/project_a_&quot;+imageNumber+&quot;.png&quot;;
}


image_back_btn.addEventListener(MouseEvent.CLICK, backImage);

function backImage (evtObj:MouseEvent):void
{
//subtracting to the current value -1
imageNumber--;
project_aLoader.source = &quot;images/project_a_&quot;+imageNumber+&quot;.png&quot;;
}</description>
		<content:encoded><![CDATA[<p>Hi<br />
I have a problem with loading images from an external folder.<br />
The problem is I have 6 images and load using the UI loader.<br />
This all works fine although I need a line of code to tell the loader it is at the last image because it trys to load image 7, and there is no image 7.</p>
<p>Please help, its driving me nuts. I just need a stop or, this is the last image command.</p>
<p>following code has been used:</p>
<p>Image_next_btn.addEventListener(MouseEvent.CLICK, nextImage);</p>
<p>//variable is a container that holds some value<br />
var imageNumber:Number = 1;</p>
<p>function nextImage (evtObj:MouseEvent):void<br />
{<br />
//Adding to the current value +1<br />
imageNumber++;<br />
project_aLoader.source = &#8220;images/project_a_&#8221;+imageNumber+&#8221;.png&#8221;;<br />
}</p>
<p>image_back_btn.addEventListener(MouseEvent.CLICK, backImage);</p>
<p>function backImage (evtObj:MouseEvent):void<br />
{<br />
//subtracting to the current value -1<br />
imageNumber&#8211;;<br />
project_aLoader.source = &#8220;images/project_a_&#8221;+imageNumber+&#8221;.png&#8221;;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darkllangle</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-658</link>
		<dc:creator>darkllangle</dc:creator>
		<pubDate>Tue, 23 Mar 2010 08:01:52 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-658</guid>
		<description>&lt;code&gt;uiLoader.unload();&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code>uiLoader.unload();</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khalifa</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-621</link>
		<dc:creator>Khalifa</dc:creator>
		<pubDate>Sat, 26 Dec 2009 19:43:08 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-621</guid>
		<description>How to unload the UILoader</description>
		<content:encoded><![CDATA[<p>How to unload the UILoader</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nuno</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-595</link>
		<dc:creator>Nuno</dc:creator>
		<pubDate>Fri, 02 Oct 2009 16:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-595</guid>
		<description>you can add a linkage name in the library such as MyObject and then just set uiLoader.source = MyObject .</description>
		<content:encoded><![CDATA[<p>you can add a linkage name in the library such as MyObject and then just set uiLoader.source = MyObject .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-561</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Thu, 23 Jul 2009 05:26:47 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-561</guid>
		<description>How can you load something that is already in the library?</description>
		<content:encoded><![CDATA[<p>How can you load something that is already in the library?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-538</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 17 Jun 2009 22:30:24 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-538</guid>
		<description>or u can add this:

loader.scaleContent = false; 

it will risize the loader to the size of every image</description>
		<content:encoded><![CDATA[<p>or u can add this:</p>
<p>loader.scaleContent = false; </p>
<p>it will risize the loader to the size of every image</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ian_banderaz</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-525</link>
		<dc:creator>ian_banderaz</dc:creator>
		<pubDate>Thu, 04 Jun 2009 16:40:02 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-525</guid>
		<description>try this code timo 
  uiLoader.setSize(150,200);</description>
		<content:encoded><![CDATA[<p>try this code timo<br />
  uiLoader.setSize(150,200);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timo</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-507</link>
		<dc:creator>Timo</dc:creator>
		<pubDate>Wed, 13 May 2009 20:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-507</guid>
		<description>If I use the code to load my own images, they are loaded and resized to a very small picture. How can I change the size of this picture?</description>
		<content:encoded><![CDATA[<p>If I use the code to load my own images, they are loaded and resized to a very small picture. How can I change the size of this picture?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crason</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-381</link>
		<dc:creator>crason</dc:creator>
		<pubDate>Thu, 12 Feb 2009 17:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-381</guid>
		<description>import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

var myTween1:Tween = new Tween(pic1_btn, &quot;x&quot;, Bounce.easeOut, -100, 1000, 2, true);
var myTween2:Tween = new Tween(pic2_btn, &quot;x&quot;, Bounce.easeOut, -100, 850, 2, true);							  
var myTween3:Tween = new Tween(pic3_btn, &quot;x&quot;, Bounce.easeOut, -100,700, 2, true);							  
var myTween4:Tween = new Tween(pic4_btn, &quot;x&quot;, Bounce.easeOut, 100, 400, 2, true);
var myTween5:Tween = new Tween(pic5_btn, &quot;x&quot;, Bounce.easeOut, 100, 250, 2, true);							  
var myTween6:Tween = new Tween(pic6_btn, &quot;x&quot;, Bounce.easeOut, 1000, 100, 2, true);							
var myTween7:Tween = new Tween(pic7_btn, &quot;x&quot;, Bounce.easeOut, 1050, 550, 2, true);

//This tells the movie clips to act like buttons
pic1_btn.buttonMode = true;
pic2_btn.buttonMode = true;
pic3_btn.buttonMode = true;
pic4_btn.buttonMode = true;
pic5_btn.buttonMode = true;
pic6_btn.buttonMode = true;
pic7_btn.buttonMode = true;

function Pic1(e:MouseEvent):void
{
	display.source = &quot;pic1.swf&quot;;
}

function Pic2(e:MouseEvent):void
{
	display.source = &quot;pic2.swf&quot;;
}

function Pic3(e:MouseEvent):void
{
	display.source = &quot;pic3.swf&quot;;
}
function Pic4(e:MouseEvent):void
{
	display.source = &quot;pic4.swf&quot;;
}

function Pic5(e:MouseEvent):void
{
	display.source = &quot;pic5.swf&quot;;
}

function Pic6(e:MouseEvent):void
{
	display.source = &quot;pic6.swf&quot;;
}
function Pic7(e:MouseEvent):void
{
	display.source = &quot;pic7.swf&quot;;
}

pic1_btn.addEventListener(MouseEvent.CLICK, Pic1);
pic2_btn.addEventListener(MouseEvent.CLICK, Pic2);
pic3_btn.addEventListener(MouseEvent.CLICK, Pic3);
pic4_btn.addEventListener(MouseEvent.CLICK, Pic4);
pic5_btn.addEventListener(MouseEvent.CLICK, Pic5);
pic6_btn.addEventListener(MouseEvent.CLICK, Pic6);
pic7_btn.addEventListener(MouseEvent.CLICK, Pic7);</description>
		<content:encoded><![CDATA[<p>import fl.transitions.Tween;<br />
import fl.transitions.easing.*;<br />
import fl.transitions.TweenEvent;</p>
<p>var myTween1:Tween = new Tween(pic1_btn, &#8220;x&#8221;, Bounce.easeOut, -100, 1000, 2, true);<br />
var myTween2:Tween = new Tween(pic2_btn, &#8220;x&#8221;, Bounce.easeOut, -100, 850, 2, true);<br />
var myTween3:Tween = new Tween(pic3_btn, &#8220;x&#8221;, Bounce.easeOut, -100,700, 2, true);<br />
var myTween4:Tween = new Tween(pic4_btn, &#8220;x&#8221;, Bounce.easeOut, 100, 400, 2, true);<br />
var myTween5:Tween = new Tween(pic5_btn, &#8220;x&#8221;, Bounce.easeOut, 100, 250, 2, true);<br />
var myTween6:Tween = new Tween(pic6_btn, &#8220;x&#8221;, Bounce.easeOut, 1000, 100, 2, true);<br />
var myTween7:Tween = new Tween(pic7_btn, &#8220;x&#8221;, Bounce.easeOut, 1050, 550, 2, true);</p>
<p>//This tells the movie clips to act like buttons<br />
pic1_btn.buttonMode = true;<br />
pic2_btn.buttonMode = true;<br />
pic3_btn.buttonMode = true;<br />
pic4_btn.buttonMode = true;<br />
pic5_btn.buttonMode = true;<br />
pic6_btn.buttonMode = true;<br />
pic7_btn.buttonMode = true;</p>
<p>function Pic1(e:MouseEvent):void<br />
{<br />
	display.source = &#8220;pic1.swf&#8221;;<br />
}</p>
<p>function Pic2(e:MouseEvent):void<br />
{<br />
	display.source = &#8220;pic2.swf&#8221;;<br />
}</p>
<p>function Pic3(e:MouseEvent):void<br />
{<br />
	display.source = &#8220;pic3.swf&#8221;;<br />
}<br />
function Pic4(e:MouseEvent):void<br />
{<br />
	display.source = &#8220;pic4.swf&#8221;;<br />
}</p>
<p>function Pic5(e:MouseEvent):void<br />
{<br />
	display.source = &#8220;pic5.swf&#8221;;<br />
}</p>
<p>function Pic6(e:MouseEvent):void<br />
{<br />
	display.source = &#8220;pic6.swf&#8221;;<br />
}<br />
function Pic7(e:MouseEvent):void<br />
{<br />
	display.source = &#8220;pic7.swf&#8221;;<br />
}</p>
<p>pic1_btn.addEventListener(MouseEvent.CLICK, Pic1);<br />
pic2_btn.addEventListener(MouseEvent.CLICK, Pic2);<br />
pic3_btn.addEventListener(MouseEvent.CLICK, Pic3);<br />
pic4_btn.addEventListener(MouseEvent.CLICK, Pic4);<br />
pic5_btn.addEventListener(MouseEvent.CLICK, Pic5);<br />
pic6_btn.addEventListener(MouseEvent.CLICK, Pic6);<br />
pic7_btn.addEventListener(MouseEvent.CLICK, Pic7);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bobby</title>
		<link>http://actionscriptexamples.com/2008/12/18/dynamically-loading-images-using-the-uiloader-component-in-flash-using-actionscript-30/comment-page-1/#comment-347</link>
		<dc:creator>Bobby</dc:creator>
		<pubDate>Mon, 12 Jan 2009 19:37:52 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/?p=258#comment-347</guid>
		<description>hello,
i need to create 3 buttons. when clicked on any of them they take me to a jpg or sfw file using the uiloader technique. can someone tell me how to do this
thank u</description>
		<content:encoded><![CDATA[<p>hello,<br />
i need to create 3 buttons. when clicked on any of them they take me to a jpg or sfw file using the uiloader technique. can someone tell me how to do this<br />
thank u</p>
]]></content:encoded>
	</item>
</channel>
</rss>
