Да ничего сложного =) 1. Подключаешь и парсишь XML 2. Размножаешь мувики(рамки для фоток). 3. Грузишь туда картинки, с процентной подгрузкой конечно... 4. Добовляешь всякую анимашку 5. Делишь на страницы.
Вот например так:
ActionScript:
| Код | import mx.transitions.*;
_global.thisX = 30; _global.thisY = 30;
_global.stageWidth = 630; _global.stageHeight = 430;
var gallery_xml:XML = new XML(); gallery_xml.ignoreWhite = true; gallery_xml.onLoad = function(success:Boolean) { try { if (success) { var images:Array = this.firstChild.childNodes; var gallery_array:Array = new Array(); for (var i = 0; i<images.length; i++) { gallery_array.push({src:images[i].firstChild.nodeValue}); } displayGallery(gallery_array); } else { throw new Error("Unable to parse XML"); } } catch (e_err:Error) { trace(e_err.message); } finally { delete this; } };
gallery_xml.load("gallery_tween.xml");
function displayGallery(gallery_array:Array) { var galleryLength:Number = gallery_array.length; for (var i = 0; i<galleryLength; i++) { var thisMC:MovieClip = this.createEmptyMovieClip("image"+i+"_mc", i); mcLoader_mcl.loadClip(gallery_array[i].src, thisMC); preloaderMC = this.attachMovie("preloader_mc", "preloader"+i+"_mc", 5000+i); preloaderMC.bar_mc._xscale = 0; preloaderMC.progress_txt.text = "0%"; thisMC._x = _global.thisX; thisMC._y = _global.thisY; preloaderMC._x = _global.thisX; preloaderMC._y = _global.thisY+20; if ((i+1)%5 == 0) { _global.thisX = 20; _global.thisY += 80; } else { _global.thisX += 80+20; } } }
var mcLoader_mcl:MovieClipLoader = new MovieClipLoader(); var mclListener:Object = new Object(); mclListener.onLoadStart = function() { }; mclListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) { var pctLoaded:Number = Math.round(loadedBytes/totalBytes*100); var preloaderMC = target_mc._parent["preloader"+target_mc.getDepth()+"_mc"]; preloaderMC.bar_mc._xscale = pctLoaded; preloaderMC.progress_txt.text = pctLoaded+"%"; }; mclListener.onLoadInit = function(evt:MovieClip) { evt._parent["preloader"+evt.getDepth()+"_mc"].removeMovieClip(); var thisWidth:Number = evt._width; var thisHeight:Number = evt._height; var borderWidth:Number = 2; var marginWidth:Number = 8; evt.scale = 20; evt.lineStyle(borderWidth, 0x000000, 100); evt.beginFill(0xFFFFFF, 100); evt.moveTo(-borderWidth-marginWidth, -borderWidth-marginWidth); evt.lineTo(thisWidth+borderWidth+marginWidth, -borderWidth-marginWidth); evt.lineTo(thisWidth+borderWidth+marginWidth, thisHeight+borderWidth+marginWidth); evt.lineTo(-borderWidth-marginWidth, thisHeight+borderWidth+marginWidth); evt.lineTo(-borderWidth-marginWidth, -borderWidth-marginWidth); evt.endFill(); evt._xscale = evt.scale; evt._yscale = evt.scale; evt._rotation = Math.round(Math.random()*-10)+5; evt.onPress = function() { this.startDrag(); this._xscale = 100; this._yscale = 100; this.origX = this._x; this.origY = this._y; this.origDepth = this.getDepth(); this.swapDepths(this._parent.getNextHighestDepth()); this._x = (_global.stageWidth-evt._width+30)/2; this._y = (_global.stageHeight-evt._height+30)/2; mx.transitions.TransitionManager.start(this, {type:mx.transitions.Photo, direction:0, duration:1, easing:mx.transitions.easing.Strong.easeOut, param1:empty, param2:empty}); }; evt.onRelease = function() { this.stopDrag(); this._xscale = this.scale; this._yscale = this.scale; this._x = this.origX; this._y = this.origY; }; evt.onReleaseOutside = evt.onRelease; }; mcLoader_mcl.addListener(mclListener);
|
Вот XML:
| Код | <?xml version="1.0"?> <gallery> <img><![CDATA[DCP_0730.jpg]]></img> <img><![CDATA[DCP_0731.jpg]]></img> <img><![CDATA[DCP_0732.jpg]]></img> <img><![CDATA[DCP_0733.jpg]]></img> <img><![CDATA[DCP_0734.jpg]]></img> <img><![CDATA[DCP_0735.jpg]]></img> <img><![CDATA[DCP_0736.jpg]]></img> <img><![CDATA[DCP_0737.jpg]]></img> <img><![CDATA[DCP_0738.jpg]]></img> <img><![CDATA[DCP_0739.jpg]]></img> <img><![CDATA[DCP_0740.jpg]]></img> <img><![CDATA[DCP_0741.jpg]]></img> <img><![CDATA[DCP_0742.jpg]]></img> <img><![CDATA[DCP_0743.jpg]]></img> <img><![CDATA[DCP_0744.jpg]]></img> <img><![CDATA[DCP_0745.jpg]]></img> <img><![CDATA[DCP_0746.jpg]]></img> <img><![CDATA[DCP_0747.jpg]]></img> </gallery>
|
А вот и сам http://antoniobanderaz.narod.ru/gallery.rar |