PDA

View Full Version : a slideshow like this...


chop
12-02-2005, 06:57 PM
hi

anyone know how to do a slideshow like this?
http://www.viz.com/onlinemanga/om.php?chap=pa-hi-chapter-1

bye and thanks

self
12-02-2005, 07:10 PM
create two holder clips for the pics, define an array for the picture names, make next and previous buttons. put your code to it, and voila, it works.

no, honestly, what exactly do you need? the whole sourcecode? or have you already tried to do it and are stuck somewhere? details... i need input (i think the others too) :)

chop
12-02-2005, 07:16 PM
yes, i'm searching the source code
because i'm not very expert for do a thing li this ^__^;;;

thanks!

self
12-03-2005, 11:46 AM
well this should be it. for the loading symbols just place an animation you wish behind the picture holders, and as long they are loading, this animation will be visible. the _x and _y values will depend on your layout and image sizes. maybe you wanna scale them also etc... but the script i posted here should be what they did on the page you attached. (notice, i am no clean coder, there are surely many ppl who can do it better...)

i'd suggest you also have a look at the tutorials, there are some better slideshows as this one.

// intitialization command
initAll();
// init function
function initAll() {
// drop here the name of the subfolder
// your pics are in or the URL of the folder
pictureFolder = "pics/";
// write the picture names in there - without the .jpg
pictureArray = ["pic1", "drawing2", "bla3", "..."];
// init for control
step = 0;
// creation and setup of the picture holders
this.createEmptyMovieClip("picHolder1", this.getNextHighestDepth());
picHolder1._x = 20;
picHolder1._y = 20;
picHolder1.duplicateMovieClip("picHolder2", this.getNextHighestDepth());
picHolder2._x += 300;
// load of the first 2 pics
loadStep(0);
}
function loadStep(difference:Number) {
if (difference == 0) {
picHolder1.loadMovie(picURL(step*2));
picHolder2.loadMovie(picURL(step*2+1));
} else {
if (step+difference<pictureArray.length/2 && step+difference>=0) {
step += difference;
picHolder1.loadMovie(picURL(step*2));
picHolder2.loadMovie(picURL(step*2+1));
}
}
// writing page numbers to text fields
pageLeft.text=step;
pageRight.text=step+1;
}
function picURL(picNumber:String) {
retVal = pictureFolder+pictureArray[picNumber]+".jpg";
return (retVal);
}

// next button
on(release) {
loadStep(1);
}
// previous button
on(release) {
loadStep(-1);
}
// reset button
on(release) {
step = 0;
loadStep(0);
}

for this, you'd just have to create three buttons, put their code into them, create the two dynamic textfields "pageLeft" and "pageRight" for the page numbers, and put the rest of the code on the main timeline...