Flashadvisor logo
:: Desktop Shortcut
:: Flash Help
Advices from Experts

 Submit Here! · Link to Us · Newsletter · Tell a Friend ·

      Add Tutorial |

 

Advertise here










 

Google

Search WWW   
FlashAdvisor.com

 Home > Tutorials  > ActionScript

Create a Photo Gallery

Author: lookaa | Email
Website : www.flash-slide-show.com


Advertisement


2. Customizing the Photo Gallery Code

Now here comes the relatively simple part of customizing the code to work with your own pictures to make your photo gallery something more meaningful than 10 pictures of wildlife I found over at the National Geographic site. Make sure your Actions dialog box is displayed with the code you pasted and read on!

More than likely, you have your images stored in a certain location on your Web site or on your hard drive that is different from where your Flash animation is stored.

Find the first line of code (it is a variable actually) that says: this.pathToPics. Modify the path set by the aforementioned variable to the folder containing your images. For example, in the version of the code in the tutorial, the images are stored in the animation folder. Therefore, the variables pathToPics equals "animation/". If your images are stored in the SAME directory as your animation, simply make pathToPics equal "" as in:

this.pathToPics = "animation/";

Other examples of how you can modify the code include:

this.pathToPics = "../animation/";
this.pathToPics = "http://www.domainname.com/pics/";

Now, you get the chance to specify the file name for the images that will be used! Find the line that says this.pArray. Replace all the image names I have written with the images that you will use instead. If you have more images than spaces provided, simply add more image names by adding a comma with the image name in quotation marks.

The code for just two images would be:

this.pArray = ["flash.jpg", "windows.jpg"];

Again, you can have as many or as few images in the photo gallery. The code that sbeener wrote is intelligent enough to count the number of images you specify in the pArray variable and customize the gallery accordingly.

You are done with customizing the code and this tutorial (for the second time). Preview the animation and see how it works. If you are good with ActionScript, you can tweak the code with a few modifications of your own.

Download Source File

| 1 | 2 | 3 |

Rate This Tutorial :
We hope the information helped you. If you have any questions or comments, please don't hesitate to post them on the Forums section
Submit your Tutorial at Click Here
  

Home | About Us | Contact Us | Feedback | Advertise with us

Best viewed in 800x600 resolution with Internet Explorer.

Site Developed and Hosted by  ethicsolutions.com
All rights reserved with FlashAdvisor

Flash is a registered trademark of Adobe Systems, Inc.

29 users online