I have the following gallery:
http://www.harbourgreenplace.com/gallery/gallery.html
The following code is on the main timeline (“begin” is the instance name of the play button). There’s a MC in the library with a linkage name of “slideshow” .
pic_arr = ["wedding/brothers.swf", "wedding/brothers2.swf", "wedding/insideout.swf", "wedding/jaichurch.swf", "wedding/stillgotit.swf"];
color_arr = [0xf75eb0, 0xf6f818, 0xbb57c8, 0xdf1734, 0xfe9809];
blank_mc.attachMovie("slideshow", "uuShow", 1, {
_x:0, _y:0, _visible:false, fps:21, nFrames:24, alphaIncr:10,
slides_arr:pic_arr, slideDepth:50, repeat:true});
blank_mc.uuShow.addListener(blank_mc);
blank_mc.onSlideLoaded = function(i) {
(new Color(this._parent["dot"+i+"_mc"])).setRGB(color_arr*);
// trace('slide '+ i + ' loaded');
};
begin.onRelease = function() {
blank_mc.uuShow._visible = true;
blank_mc.uuShow.beginTransitions();
};
On the MC in my library which has the linkage name of “slideshow” I have this
#initclip 1
Slideshow = function() {
// trace('slideshow created');
ASBroadcaster.initialize(this);
this.loadInSeq(0);
}
Slideshow.prototype = new MovieClip ();
Slideshow.prototype.loadInSeq = function(i) {
var slide = this.createEmptyMovieClip("slide" + i, this.slideDepth++);
// hide all slides loading on top of first one
if (i > 0) slide._alpha = 0;
slide.loadMovie(this.slides_arr*);
checkLoadedID = setInterval(function(i, mc) {
if (mc["slide" + i]._width > 0) {
mc["slide" + i]._visible = true;
mc.broadcastMessage("onSlideLoaded", i);
clearInterval(checkLoadedID);
// start next one loading (if not last)
if (i < mc.slides_arr.length-1) {
mc.loadInSeq(i + 1);
} else {
mc.broadcastMessage("onAllSlidesLoaded");
}
}
}, 1000/this.fps, i, this);
};
Slideshow.prototype.beginTransitions = function() {
var holdTimeMs = 1000 * this.nFrames / this.fps;
holdID = setInterval(function(mc) { mc.activateInSeq(0); clearInterval(holdID); }, holdTimeMs, this);
};
Slideshow.prototype.activateInSeq = function(i) {
//trace('in activateInSeq, i='+i);
if (++i < this.slides_arr.length) {
this["slide" + i]._alpha = 0;
this["slide" + i].swapDepths(this.slideDepth++);
this.onEnterFrame = function() {
if (this["slide" + i]._alpha >= 95) {
var counter = this.nFrames;
this.onEnterFrame = function() {
if (!counter--) {
delete this.onEnterFrame;
this.activateInSeq(i);
}
};
} else {
this["slide" + i]._alpha += this.alphaIncr;
}
};
} else {
if (this.repeat) this.activateInSeq(-1);
else this.broadcastMessage("onShowOver");
}
};
Object.registerClass("slideshow", Slideshow);
#endinitclip
To avoid this being any longer than it is I won’t say all the various things I have tried thus far (I have tried A LOT of differ things!). But as you will notice there’s many many many things still wrong with this mock up. Although the main things that I would like help in getting resolved, which I have been unsuccessful with, are:
- getting the stop button working
- if you click on one of the thumbnail pics and then the play button, you will notice that the play button no longer works.
PS-blank_mc is the instance name of the container MC. The thumbnail pics are not preloaded like they are when you hit the play button so there will prolly be a delay on that
Cheers
Sandman9