# Creating photo gallery AS2 to AS3 help

**URL:** <https://forum.kirupa.com/t/creating-photo-gallery-as2-to-as3-help/262942>\
**Category:** flash\
**Created:** [June 11, 2008, 10:19am UTC](https://forum.kirupa.com/t/creating-photo-gallery-as2-to-as3-help/262942 "2008-06-11T10:19:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nohugs](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nohugs](https://forum.kirupa.com/u/nohugs)\
**Post date:** [June 11, 2008, 10:19am UTC](https://forum.kirupa.com/t/creating-photo-gallery-as2-to-as3-help/262942/1 "2008-06-11T10:19:32Z")

</div>

This script is from the How to create a photo gallery page from this website.  
Can someone change this to AS3 please? Thanks

this.pathToPics = “Pics/”;  
// fill this array with your pics  
this.pArray = [“image0.jpg”, “image1.jpg”, “image2.jpg”, “image3.jpg”];  
this.fadeSpeed = 20;  
this.pIndex = 0;  
loadMovie(this.pathToPics+this.pArray[0], \_root.photo);  
MovieClip.prototype.changePhoto = function(d) {  
// make sure pIndex falls within pArray.length  
this.pIndex = (this.pIndex+d)%this.pArray.length;  
if (this.pIndex\<0) {  
this.pIndex += this.pArray.length;  
}  
this.onEnterFrame = fadeOut;  
};  
MovieClip.prototype.fadeOut = function() {  
if (this.photo.\_alpha\>this.fadeSpeed) {  
this.photo.\_alpha -= this.fadeSpeed;  
} else {  
this.loadPhoto();  
}  
};  
MovieClip.prototype.loadPhoto = function() {  
// specify the movieclip to load images into  
var p = \_root.photo;  
//------------------------------------------  
p.\_alpha = 0;  
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);  
this.onEnterFrame = loadMeter;  
};  
MovieClip.prototype.loadMeter = function() {  
var i, l, t;  
l = this.photo.getBytesLoaded();  
t = this.photo.getBytesTotal();  
if (t\>0 && t == l) {  
this.onEnterFrame = fadeIn;  
} else {  
trace(l/t);  
}  
};  
MovieClip.prototype.fadeIn = function() {  
if (this.photo.\_alpha\<100-this.fadeSpeed) {  
this.photo.\_alpha += this.fadeSpeed;  
} else {  
this.photo.\_alpha = 100;  
this.onEnterFrame = null;  
}  
};
