Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   фотогаллерея, как сделать? (http://www.flasher.ru/forum/showthread.php?t=88377)

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");



Часовой пояс GMT +4, время: 16:06.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.