I have a combination of Flash goodies.
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.
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.
system
July 20, 2003, 5:58pm
2
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.
system
July 20, 2003, 6:11pm
3
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
system
July 20, 2003, 6:43pm
4
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:
system
July 20, 2003, 9:24pm
5
Yes, its was the referal to _root.
I corrected the fla, find it attached.
Regards,
Viru.
system
July 21, 2003, 1:00am
6
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.
Sam.
system
July 21, 2003, 6:54pm
7
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.
system
July 22, 2003, 11:33am
8
:rd:
Thank You humble Sir! Much appreciated.
Sam.
http://www.samblakeley.com/samba
(Rainbow Greenhouse in the making)