Help!

:alien:

I have a combination of Flash goodies.

  1. My main site is index.swf - has 2 buttons, one of the buttons (Annuals) loads another flash file (annuals.swf) into the main *.swf file.

  2. My secondary flash file (I used tutorials "Photo Gallery " from the site) loads pictures (image0.jpg) from a folder named ā€œannualsā€. The gallery should have 10 images and 2 buttons to scroll forward and back.

The problem?

Open up ā€œannuals.swfā€ on itā€™s own and the whole dynamic loading works fine. Now, open up the ā€œindex.swfā€, press the ā€œannualsā€ button and it only loads ā€œimage0.jpgā€ - The buttons donā€™t appear?

Please see the files attachedā€¦ because it baffles me!

Thanks.
Sam.

Iā€™m not gaining much from your attachment, there could be some thing wrong with your layers, or your action script. It would help us to help you if you supply the .flaā€™s.

Regards,
Viru.

Sorry guysā€¦ I was up late last night and early this morningā€¦

Here are the ā€˜correct filesā€™ā€¦

Sam.

www.samblakeley.com/download/perennials.fla
www.samblakeley.com/download/index.fla

Iā€™m thinking that the problem is obviously the actionscript when loading the picturesā€¦

Because the 2nd *.swf file isā€¦ placed within the 1st and main fileā€¦ the references to the second file might be conflicting?

Either wayā€¦ it needs to be sortedā€¦ I will continue readingā€¦

Sam.
:bandit:

Yes, its was the referal to _root.
I corrected the fla, find it attached.
Regards,
Viru.

So how much do i send for technical support? And to what accountā€¦ ?

You should have a Donation/Paypal accountā€¦ and everytime you help someone, they can offer to donate $2/3 - they all add up in the end.

:alien:

Sam.

Solving the problem and helping others in need is all the reward that i need, lol.

Heres the code in the main timeline:

this.pathToPics = ā€œannuals/ā€;
// fill this array with your pics
this.pArray = [ā€œimage0.jpgā€, ā€œimage1.jpgā€, ā€œimage2.jpgā€, ā€œimage3.jpgā€, ā€œimage4.jpgā€, ā€œimage5.jpgā€, ā€œimage6.jpgā€, ā€œimage7.jpgā€, ā€œimage8.jpgā€, ā€œimage9.jpgā€];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
photo.loadMovie(this.pathToPics+this.pArray[0]);
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 = 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;
}
};
// 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);
stop();

And then the two buttons:

left button:

on (release) {
changePhoto(-1);
}

right button:

on (release) {
changePhoto(1);
}

Regards,
V.

:rd:

Thank You humble Sir! Much appreciated.

Sam.

http://www.samblakeley.com/samba

(Rainbow Greenhouse in the making)