| Author |
Message |
igorlaszlo
Joined: 22 Sep 2007 Posts: 4 Location: Paris
|
Posted: Sat Sep 22, 2007 7:15 am Post subject: Auto Border Resize Photo Gallery |
|
|
Hi, I am totally new here and you should be patient with me bcs I do not speak English perfectly and I am self-educated in Flash and computer...
I found an auto border resize gallery here in this site which is just perfect for what i was looking. It does not use XML what is realy great (I believe that XML loads images pretty slowly).
However I would like to developpe this gallery with a "next" button and "previous" button to make it able to go through all images by clicking only to one button. In this case it is not necessary to click to each thumbnail.
I found a script in the same resize gallery but it uses xml so it is not exactly the same and i am not so strong in actionscript, it does not work. Please have a look at the whole actionscript and if you know the answer how to correct the point what I marked in red color, please please let me know !
THE SCRIPT :
----------------
stop();
space = 25;
photo_mc._alpha = 100;
var photo = new Array();
MovieClip.prototype.loadPhoto = function(photo){
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
// modified the total and loaded so as to round it up
// to smaller number.
var total = Math.round photo_mc.getBytesTotal)/ 1024);
var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
if (total != 0 && loaded>=total){
var w = photo_mc._width + space;
var h = photo_mc._height + space;
border.resize(w, h);
delete this.onEnterFrame;
picinfo.info.text = photo;
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resize = function(w, h){
//the higher the slower the resize of the border
var speed = 4;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2);
prevb._x = nav._x-5;
nextb._x = nav._x+this._width+5;
nextb._y = prevb._y=this._y-this._height/2;
picinfo._y = nextb._y-5;
picinfo._x = border._x-picinfo._width/2;
if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
photo_mc._x = this._x - this._width/2 + space/2;
photo_mc._y = this._y - this._height/2 + space/2;
photo_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
prevb.onRelease = function() {
photo--;
if (photo<0) {
photo_mc.loadPhoto(photo-1);
} else {
photo_mc.loadMovie(0);
}
};
nextb.onRelease = function() {
photo++;
if (photo>0) {
photo_mc.loadPhoto(0);
} else {
photo_mc.loadMovie(photo+1);
}
};
pic1.onPress = function() {
photo_mc.loadPhoto("p1.swf");
};
pic2.onPress = function() {
photo_mc.loadPhoto("p2.swf");
};
pic3.onPress = function() {
photo_mc.loadPhoto("p3.swf");
};
pic4.onPress = function() {
photo_mc.loadPhoto("p4.swf");
};
pic5.onPress = function() {
photo_mc.loadPhoto("p5.swf");
};
pic6.onPress = function() {
photo_mc.loadPhoto("p6.swf");
};
pic7.onPress = function() {
photo_mc.loadPhoto("p7.swf");
};
pic8.onPress = function() {
photo_mc.loadPhoto("p8.swf");
};
pic9.onPress = function() {
photo_mc.loadPhoto("p9.swf");
};
/////////////////////////////////Modified by Sokhodom Pheng ////////////////
//define the initiation function
function init(photo) {
photo_mc.loadPhoto(photo);
}
// call the initiation function
//change the image name accordingly
init("p1.swf");
|
|
| Back to top |
|
 |
guitarman fourth grade
Joined: 04 Nov 2005 Posts: 724
|
Posted: Mon Sep 24, 2007 4:51 am Post subject: |
|
|
those red fonts are ur changes? can you provide me with .fla ? it's easy for me to check based on .fla
|
|
| Back to top |
|
 |
igorlaszlo
Joined: 22 Sep 2007 Posts: 4 Location: Paris
|
Posted: Tue Sep 25, 2007 5:58 am Post subject: |
|
|
Hello Guitarman, thanks to reply me... yes, the scripts written by red fonts should be changed. How can I provide the .fla ? Send me an e-mail to my adresse please, I will send you the .fla file : igorlaszlo @ club.fr
Thank you ! 
|
|
| Back to top |
|
 |
igorlaszlo
Joined: 22 Sep 2007 Posts: 4 Location: Paris
|
Posted: Tue Sep 25, 2007 6:42 am Post subject: |
|
|
Please visit the gallery, I put it online : http://www.mozaikart.org/essai/essai1.htm
You will see, when you want to navigate with the next or previous button, it does not charge the image.
|
|
| Back to top |
|
 |
igorlaszlo
Joined: 22 Sep 2007 Posts: 4 Location: Paris
|
Posted: Mon Oct 01, 2007 6:24 am Post subject: |
|
|
Nobody can help me ? I am sure this is a realy simple thing for the people who use to deal with actionscripts... 
|
|
| Back to top |
|
 |
|