Привет всем, всех люблю сегодня я, настроенье на ура Очень всё просто
Создание фотогалереи
вот такую вот
Создаем новый документ желаемых размеров, рисуем прямоугольник таких размеров, каким хотим показывать картинку
Преобразуем его в символ
Дадим instance name имя - photo
Создадим новый слой, назовем ег action, и пропишем в первый кадр
CODE
//код можно изменять под ваши нужды ) this.pathToPics = "animation/"; //путь к картинкам // в массив закидываем нужное количество картинок с нужными именами 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; //загрузка картинок loadMovie(this.pathToPics+this.pArray[0], _root.photo); 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() { var p = _root.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);
Создание кнопок
Делаем две кнопки, стрелки или буквами напишите вперед и назад
Выбираем , жмем F8, преобразовываем в кнопки
для первой прописываем
CODE
(release) { _root.changePhoto(-1); }
для второй
CODE
on (release) { _root.changePhoto(1); }
всё ) Дизайн на свой вкус делаем )
зы: во флэшке есть еще маска, хотя в уроке о ней не написано. смотреть исходник