<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: AS3 Photo Viewer Tutorial]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Sun, 22 Nov 2009 12:49:01 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment10458</link><description><![CDATA[Leaving an ENTER_FRAME listening seems to eat 20-30% of the CPU while doing nothing. CPU usage seems to improve to under 3% when it is removed. Of course don't forget to addEventListener in the appropriate places, such as when the stage is resized, or the menu is clicked.

		private function dispatchOnEnterFrame(e) {
			//if the diffrence=0 do nothing
			if (Math.abs(finalX-cX)<1) {
				trace("OnEnterFrame removed");
				holder.removeEventListener(Event.ENTER_FRAME,dispatchOnEnterFrame);
				return;
			}
			//else update the sliding of our image holder with easing
			imgHolder.x+=(finalX-imgHolder.x)/6;
			//and also update the current X aside but with a greater easing coef to have some retard in time
			//between the 2 transition
			cX+=(finalX-cX)/12;
			//generate a percentage
			var per=100*(1-(finalX-cX)/diffX);
			//and ease the current percentage depending on the current generated percentage
			//this will assure the smoothing and the continus animation
			percentage+=(per-percentage)/12;
			//update the scaling to have the zoom in out effect
			holder.scaleX=1-(.5)*Math.sin(Math.PI*percentage/100);
			holder.scaleY=1-(.5)*Math.sin(Math.PI*percentage/100);
		}

<br/><br/>
(Comment posted by Christopher Tjalsma at 6:44 pm, Wed 26th Mar 2008)]]></description><author>no@spam.com (Christopher Tjalsma)</author><pubDate><![CDATA[Wed, 26 Mar 2008 18:44:30 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment10458</guid></item><item><title><![CDATA[Comment #2]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment11880</link><description><![CDATA[Hey. I kinda new to AS3, it does show how these files are suppose to be setup.. pretty confusing, maybe cuz im new to this. so question is. do i put all this code in one external file? or do i break up the code in couple files?<br/><br/>
(Comment posted by andre at 2:56 pm, Fri 29th Aug 2008)]]></description><author>no@spam.com (andre)</author><pubDate><![CDATA[Fri, 29 Aug 2008 14:56:21 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment11880</guid></item><item><title><![CDATA[Comment #3 (Reply to Comment #2)]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment11898</link><description><![CDATA[Andre, Hey. Download the PhotoViewer Tutorial.zip under Attachments above. The files are all together in the .zip file.

Good Luck,<br/><br/>
(Comment posted by DaShan at 9:14 pm, Mon 1st Sep 2008)]]></description><author>no@spam.com (DaShan)</author><pubDate><![CDATA[Mon, 01 Sep 2008 21:14:29 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment11898</guid></item><item><title><![CDATA[Comment #4]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12104</link><description><![CDATA[Excellent tutorial.
I'm new with AS3 and i have a question : i want to modify your script in order to :
- remove the the 1-n buttons,
- show the pictures one by one with a 2 seconds interval.

remove the buttons is pretty easy ;-)
But (if i don't make mistakes) i don't know how to put the setInterval  to the showImageAt() function. Can you explain me to do this ?<br/><br/>
(Comment posted by david at 9:23 am, Sun 12th Oct 2008)]]></description><author>no@spam.com (david)</author><pubDate><![CDATA[Sun, 12 Oct 2008 09:23:24 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12104</guid></item><item><title><![CDATA[Comment #5]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12260</link><description><![CDATA[This is a great tutorial. Being that I'm new to this, I have a simple question. How is this initially called? I don't see any code that invokes the .as file, yet it works. Any help on the initial call would be great.<br/><br/>
(Comment posted by Dave at 11:17 am, Wed 12th Nov 2008)]]></description><author>no@spam.com (Dave)</author><pubDate><![CDATA[Wed, 12 Nov 2008 11:17:27 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12260</guid></item><item><title><![CDATA[Comment #6 (Reply to Comment #5)]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12788</link><description><![CDATA[You don't have to invoke it, it is being published on the stage of the PhotoViewer swf from the AS file.<br/><br/>
(Comment posted by Derek at 2:26 pm, Sat 21st Mar 2009)]]></description><author>no@spam.com (Derek)</author><pubDate><![CDATA[Sat, 21 Mar 2009 14:26:54 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12788</guid></item><item><title><![CDATA[Comment #7 (Reply to Comment #5)]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13360</link><description><![CDATA[Im also new to AS3 and i can't get the whole picture of the included AS file into the swf if there's no invoke method. =S<br/><br/>
(Comment posted by Edgar at 12:31 pm, Wed 19th Aug 2009)]]></description><author>no@spam.com (Edgar)</author><pubDate><![CDATA[Wed, 19 Aug 2009 12:31:58 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13360</guid></item><item><title><![CDATA[Comment #8]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12298</link><description><![CDATA[I have adapted parts of your excellent tutorial as the basis for an agency portfolio, and I wonder if you have given any thought to how you might incorporate video into the mixture? I'd be very interested to hear any thoughts or input you might have to offer. I sincerely appreciate the work you put into producing this tut. Thanks again.

Ken<br/><br/>
(Comment posted by Ken at 5:50 pm, Thu 20th Nov 2008)]]></description><author>no@spam.com (Ken)</author><pubDate><![CDATA[Thu, 20 Nov 2008 17:50:07 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12298</guid></item><item><title><![CDATA[Comment #9]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12366</link><description><![CDATA[hi,

I'm also new to this and have an (hopefully) easy question....

How can I add a link to each of the images?  I would like to link to external web sites from each image.

Thanks!!!<br/><br/>
(Comment posted by Alan at 8:42 pm, Fri 5th Dec 2008)]]></description><author>no@spam.com (Alan)</author><pubDate><![CDATA[Fri, 05 Dec 2008 20:42:13 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12366</guid></item><item><title><![CDATA[Comment #10]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12380</link><description><![CDATA[Great transition effects!  I am trying to embed your movie in another one.  I keep getting the error message "TypeError: Error #1009: Cannot access a property or method of a null object reference.   at PhotoViewer()".  I am using the following code to load the movie:

import flash.display.*;
import flash.net.URLRequest;
 var rect:Shape = new Shape();
 rect.graphics.beginFill(0xFFFFFF);
 rect.graphics.drawRect(100, 41, 741, 501);
 rect.graphics.endFill();
 addChild(rect);
 
 

 var ldr:Loader = new Loader();
 ldr.mask = rect;
 var url:String = "PhotoViewer.swf";
 var urlReq:URLRequest = new URLRequest(url);
 ldr.load(urlReq);
 addChild(ldr);

The error occurs at the first import statement in your PhotoViewer.as file.  Any ideas on what my problem is ?

Thanks.<br/><br/>
(Comment posted by DonD. at 11:35 pm, Mon 8th Dec 2008)]]></description><author>no@spam.com (DonD.)</author><pubDate><![CDATA[Mon, 08 Dec 2008 23:35:09 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12380</guid></item><item><title><![CDATA[Comment #11 (Reply to Comment #10)]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13002</link><description><![CDATA[Hi,

The problem is that the script uses stage.width and stage.height. Replace those with the size you want. I did a search and replace for those and voila, it worked :)<br/><br/>
(Comment posted by Cahva at 7:57 am, Thu 14th May 2009)]]></description><author>no@spam.com (Cahva)</author><pubDate><![CDATA[Thu, 14 May 2009 07:57:08 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13002</guid></item><item><title><![CDATA[Comment #12]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12528</link><description><![CDATA[Love this tutorial as soon as i get some $ i would love to donate to the designer...
just have one small problem , It works beautiful but once i have more than 20 images it does not work it works up to image 20 ... is there something i need to add.?
I would really appreciate your help.<br/><br/>
(Comment posted by Ashley at 12:07 am, Tue 20th Jan 2009)]]></description><author>no@spam.com (Ashley)</author><pubDate><![CDATA[Tue, 20 Jan 2009 00:07:51 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12528</guid></item><item><title><![CDATA[Comment #13]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12964</link><description><![CDATA[Love the app
Does anyone know how to intergrate this app into flex3 (have mxml call the as3)<br/><br/>
(Comment posted by george at 7:04 pm, Mon 4th May 2009)]]></description><author>no@spam.com (george)</author><pubDate><![CDATA[Mon, 04 May 2009 19:04:55 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment12964</guid></item><item><title><![CDATA[Comment #14]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13213</link><description><![CDATA[thanks man..great job.. it was very useful for me...<br/><br/>
(Comment posted by sara at 5:47 am, Fri 10th Jul 2009)]]></description><author>no@spam.com (sara)</author><pubDate><![CDATA[Fri, 10 Jul 2009 05:47:48 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13213</guid></item><item><title><![CDATA[Comment #15]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13314</link><description><![CDATA[When I open the fla or swf file, it does only blank screen and does not show any image? What should I do not correct this problem?<br/><br/>
(Comment posted by knb at 3:03 pm, Wed 5th Aug 2009)]]></description><author>no@spam.com (knb)</author><pubDate><![CDATA[Wed, 05 Aug 2009 15:03:08 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13314</guid></item><item><title><![CDATA[Comment #16]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13366</link><description><![CDATA[Hi, I am totally new to ActionScript and Flex. I want to use the existing class for a new Flex project and modify some of the functionality. Therefore I need to create an instance of this class from the MXML file. Can someone explain me how to go about it. Secondly, I get the following errors based on the package structure (I created a folder AS and placed the given class within it):

package AS
{
    public class PhotoViewer extends MovieClip
    {
      Class definition here
    }
}


class ImageContainer extends MovieClip
{
    Class definition here
}


Errors:
1. Packages cannot be nested
2. Classes must not be nested<br/><br/>
(Comment posted by Varun Verma at 6:32 pm, Thu 20th Aug 2009)]]></description><author>no@spam.com (Varun Verma)</author><pubDate><![CDATA[Thu, 20 Aug 2009 18:32:20 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13366</guid></item><item><title><![CDATA[Comment #17]]></title><link>http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13402</link><description><![CDATA[How can i change the stage size? Sorry to ask but i'm new to this
Thank you in advanced.

Best,
Krai<br/><br/>
(Comment posted by Krai at 7:11 am, Mon 31st Aug 2009)]]></description><author>no@spam.com (Krai)</author><pubDate><![CDATA[Mon, 31 Aug 2009 07:11:37 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/726/1/AS3-Photo-Viewer-Tutorial/Page1.html#Comment13402</guid></item></channel></rss>