need help adding thumbnails and scroll buttons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anfetienne
    Contributor
    • Feb 2009
    • 424

    need help adding thumbnails and scroll buttons

    ive been through a tutorial on using array for a gallery and wrote the following code.

    i need to include thumbnails with left and right buttons on each side to scroll through the thumbnails

    MY CODE
    Code:
    #include "64516994.txt"
    
    this.fadeSpeed = 20;
    this.pIndex = 0;
    
    loadMovie(this.locVar[0], _root.photo);
    MovieClip.prototype.changePhoto = function(d) {
    	// make sure pIndex falls within pArray.length
    	this.pIndex = (this.pIndex+d)%this.locVar.length;
    	if (this.pIndex<0) {
    		this.pIndex += this.locVar.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() {
    
    	var p = _root.photo;
    
    	p._alpha = 0;
    	p.loadMovie(this.locVar[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;
    	}
    };
    // Actions -----------------------------------------
    // these aren't necessary, just an example implementation
    this.onKeyDown = function() {
    	if (Key.getCode() == Key.LEFT) {
    		this.changePhoto(-1);
    	} else if (Key.getCode() == Key.RIGHT) {
    		this.changePhoto(1);
    	}
    };
    Key.addListener(this);
    i have attached the fla that i would like my gallery to be similar to....if there are tutorials that can help please do tell.
    Attached Files
Working...