PDA

Просмотр полной версии : фотогаллерея, как сделать?


glukaviy
22.11.2006, 17:48
Написал код для загрузки изображений..

Но теперь стоит другая задача, надо чтобы при нажатии на фотку открывалась такая же фотка (которая лежит в другом каталоге) только в 2 раза больше.... Как сделать?


LoadImages = function (ImagesArray)
{
for (i=0; i<ImagesArray.length; i++)
{
this.createEmptyMovieClip("mc_foto"+i, this.getNextHighestDepth());
loadMovie(ImagesArray[i]+".jpg", this["mc_foto"+i]);
trace (ImagesArray[i]+".jpg");
this["mc_foto"+i]._x=(i-Math.floor(i/3)*3)*170;
this["mc_foto"+i]._y=Math.floor(i/3)*170;
this["mc_foto"+i]._xscale=100;
this["mc_foto"+i]._yscale=110;


}

}

var my_image:LoadVars = new LoadVars();
my_image.onData = function(src:String) {
if (src) {

ImagesArray = src.split(",");
// òóò òèïà óæå ãðóç¸øü ïîø¸ë
LoadImages (ImagesArray);

} else {
trace("Что то здесь не работает!");
}
};
my_image.load("foto.txt");

El Scream
22.11.2006, 17:55
Добавляем к

this["mc_foto"+i]._x=(i-Math.floor(i/3)*3)*170;
this["mc_foto"+i]._y=Math.floor(i/3)*170;
this["mc_foto"+i]._xscale=100;
this["mc_foto"+i]._yscale=110;

вот это
this["mc_foto"+i].onPress=function() {
// здесь производим загрузку
};

glukaviy
22.11.2006, 18:04
Так?

this["mc_foto"+i].onPress=function() {
{
for (i=0; i<ImagesArray_big.length; i++)
{
this.createEmptyMovieClip("mc_foto_big"+i, this.getNextHighestDepth());
loadMovie(ImagesArray_big[i]+".jpg", this["mc_foto"+i]);
trace (ImagesArray_big[i]+".jpg");

}

}

var my_image_big:LoadVars = new LoadVars();

};


};
my_image.load("foto_big.txt");

glukaviy
22.11.2006, 19:20
написал загрузку вроде как точнее мне помогли но картинки не являются кнопками как мне сделать правильно ??? помогите пожалуйста!

LoadImages = function (ImagesArray) {
for (i=0; i<ImagesArray.length; i++) {
var t:MovieClip = this.createEmptyMovieClip("mc_foto"+i, this.getNextHighestDepth());
loadMovie(ImagesArray[i]+".jpg",t);
trace (ImagesArray[i]+".jpg");
t._x=(i-Math.floor(i/3)*3)*170;
t._y=Math.floor(i/3)*170;
t._yscale=110;
t.big_urls=ImagesArray[i];
t.onPress = function() {
_root.createEmptyMovieClip("bigphoto",1000);
_root.bigphoto.loadMovie("big_images/"+t.big_urls+".jpg", _root.bigphoto);
}
this.bigphoto.onPress = function() {
// óäàëÿåì áîëüøóþ êàðòèíêó...
}
}
}
var my_image:LoadVars = new LoadVars();
my_image.onData = function(src:String) {
if (src) {
////////// Ç À Ã Ð Ó Ç È Ë È È È ! ! !
ImagesArray = src.split(",");
// ooo oeia o?a a?oc?ou iio?e
LoadImages (ImagesArray);
} else {
trace("Ioeaea a caa?ocea / ?acai?a ?acoeuoe?o?uae no?iee.");
}
};
my_image.load("foto.txt");