les dejo el codigo del Fla y el xml.
Fla:
Código ActionScript :
import flash.display.*; loadTmbs (); function setPositions () { if (imageContainer._height > Stage.height) { imageContainer._width = Stage.width; imageContainer._yscale = imageContainer._xscale; } if (imageContainer._height <= Stage.height) { imageContainer._height = Stage.height; imageContainer._xscale = imageContainer._yscale; } if (imageContainer._width < Stage.width) { imageContainer._width = Stage.width; imageContainer._yscale = imageContainer._xscale; } imageContainer._x = (-(imageContainer._width - Stage.width) / 2); imageContainer._y = Stage.height - imageContainer._height; } function intro () { ZigoEngine.doTween (mainmenu,'_x',Stage.width,1,"easeInOutExpo",0,function () { mainmenuOpen = true; controlMainmenu (); }); } function controlMainmenu () { if (mainmenuOpen == false) { attachMovie ("hitUp","hitUp",0); hitUp._x = Stage.width; hitUp._y = 0; hitUp._width = 25; hitUp._height = Stage.height; hitUp.useHandCursor = false; hitUp.onRollOver = function () { mainmenuOpen = true; ZigoEngine.doTween (mainmenu,'_x',Stage.width,1,"easeOutExpo"); controlMainmenu (); }; } else if (mainmenuOpen == true) { attachMovie ("hitDown","hitDown",0); hitDown._x = 0; hitDown._y = 0; hitDown._width = Stage.width - 425; hitDown._height = Stage.height; hitDown.useHandCursor = false; initFloat (mainmenu.containerTmbs); hitDown.onRollOver = function () { mainmenuOpen = false; ZigoEngine.doTween (mainmenu,'_x',Stage.width + 400,0.5,"easeOutExpo"); controlMainmenu (); }; } } function loadTmbs () { var tmbs:XML = new XML (); tmbs.ignoreWhite = true; tmbs.onLoad = function (success) { if (success) { var root:XMLNode = this.firstChild; for (i = 0; i < root.childNodes.length; i++) { var titleTxt:String = root.childNodes[i].childNodes[0].childNodes[0].nodeValue; var descTxt:String = root.childNodes[i].childNodes[1].childNodes[0].nodeValue; var thumbs:String = root.childNodes[i].childNodes[2].childNodes[0].nodeValue; var images:String = root.childNodes[i].childNodes[3].childNodes[0].nodeValue; imagesArr.push (images); mainmenu.containerTmbs.attachMovie ("tmb","tmb" + i,i); mainmenu.containerTmbs["tmb" + i]._y = i * 80; loadMovieClip (thumbs,mainmenu.containerTmbs["tmb" + i].containerTmb); mainmenu.containerTmbs["tmb" + i].titleLabel.titleText.htmlText = titleTxt mainmenu.containerTmbs["tmb" + i].descLabel.descText.htmlText = descTxt mainmenu.containerTmbs["tmb" + i].bt.idInstance = i; mainmenu.containerTmbs["tmb" + i].bt.onRelease = function () { cursorArr = this.idInstance; ZigoEngine.doTween (imageContainer,'_alpha',0,1,"easeOutExpo",0,function () { loadBitmapSmoothed (imagesArr[cursorArr],imageContainer); }); }; } } loadBitmapSmoothed (imagesArr[cursorArr],imageContainer); intro (); mainmenu.containerTmbs._y = 0 - mainmenu.containerTmbs.height / 2; }; tmbs.load ("photoGallery.xml"); } function updateMovies () { d = 10; mov = _root._ymouse; coef = (Stage.height - (mainmenu.containerTmbs._height + 180)) / Stage.height; mainmenu.containerTmbs._y -= (((mainmenu.containerTmbs._y-35) + Stage.height/2) - coef * mov) / d; } function initFloat (mc:MovieClip) { temp = mc; temp.onEnterFrame = this.updateMovies; } function loadBitmapSmoothed (url:String, target:MovieClip) { var bmc:MovieClip = target.createEmptyMovieClip ("bmc", target.getNextHighestDepth ()); var listener:Object = new Object (); listener.tmc = target; listener.onLoadStart = function () { attachMovie ("loaderMC","loaderMC",1); loaderMC._x = Stage.width / 2; loaderMC._y = Stage.height / 2; }; listener.onLoadProgress = function (mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) { //percent = Math.round (bytesLoaded / bytesTotal * 100); //trace (percent); }; listener.onLoadInit = function (mc:MovieClip) { imageContainer._alpha = 0; var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true, 0); this.tmc.attachBitmap(bitmap,1,"auto",true); bitmap.draw(mc); attachMovie ("clock","clock",1); setPositions (); }; var loader:MovieClipLoader = new MovieClipLoader (); loader.addListener (listener); loader.loadClip (url,bmc); } function loadMovieClip (externalTarget:String, targetRoot:MovieClip, action:String) { var mcLoader:MovieClipLoader = new MovieClipLoader (); var listenerLoad:Object = new Object (); listenerLoad.onLoadStart = function (target:MovieClip) { //trace("Thumbnails Load Start") }; listenerLoad.onLoadProgress = function (target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void { //*percent = Math.round(bytesLoaded/bytesTotal*100); //trace("Thumbnails Load Progress") }; listenerLoad.onLoadComplete = function (target:MovieClip):Void { //trace("Thumbnails Load Complete") }; mcLoader.addListener (listenerLoad); mcLoader.loadClip (externalTarget,targetRoot); }
xml:
Código XML :
<?xml version="1.0" encoding="iso-8859-1"?> <gallery> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Texto de Referencia]]></description> <tmb>photoGallery/tmb1.jpg</tmb> <img>photoGallery/img1.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Sed hendrerit, est sed congue luctus, arcu mauris tincidunt elit, vestibulum accumsan quam risus nec turpis.]]></description> <tmb>photoGallery/tmb2.jpg</tmb> <img>photoGallery/img2.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Aliquam ultricies libero ut lacus. Cras scelerisque lectus ac justo. Proin imperdiet. Maecenas cursus.]]></description> <tmb>photoGallery/tmb3.jpg</tmb> <img>photoGallery/img3.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Cras euismod vehicula velit. Aenean odio augue, cursus ac, sagittis in, blandit sit amet, nulla. Suspendisse lacinia.]]></description> <tmb>photoGallery/tmb4.jpg</tmb> <img>photoGallery/img4.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Fusce feugiat quam sed ligula. Fusce rutrum, mi in fermentum auctor, massa ipsum lacinia magna.]]></description> <tmb>photoGallery/tmb5.jpg</tmb> <img>photoGallery/img5.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Nulla facilisis fermentum velit. Proin justo orci, viverra fermentum, nonummy rutrum, condimentum malesuada, enim.]]></description> <tmb>photoGallery/tmb6.jpg</tmb> <img>photoGallery/img6.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Vivamus et orci vitae nisi blandit porta. Integer lacus leo, sollicitudin quis, consectetuer eget, elementum quis, enim.]]></description> <tmb>photoGallery/tmb7.jpg</tmb> <img>photoGallery/img7.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Quisque id velit. Duis ultricies ornare leo. Phasellus vitae augue sed nulla condimentum dictum.]]></description> <tmb>photoGallery/tmb8.jpg</tmb> <img>photoGallery/img8.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Aliquam vitae tortor eget lectus pretium dapibus. Nulla purus augue, tempor at, auctor non, lobortis et, libero.]]></description> <tmb>photoGallery/tmb9.jpg</tmb> <img>photoGallery/img9.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[In tempor. Sed non nunc non massa vulputate lacinia. Suspendisse at justo. Phasellus ligula nunc, lobortis a.]]></description> <tmb>photoGallery/tmb10.jpg</tmb> <img>photoGallery/img10.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Fusce a diam in turpis suscipit commodo. Nam ut nisl eget mauris scelerisque nonummy.]]></description> <tmb>photoGallery/tmb11.jpg</tmb> <img>photoGallery/img11.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Maecenas eros. In aliquam. Duis cursus mauris porta dui. Vivamus sem felis, malesuada sit amet, condimentum quis.]]></description> <tmb>photoGallery/tmb12.jpg</tmb> <img>photoGallery/img12.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Fusce ornare quam et orci. Sed malesuada purus vel dolor. Integer sodales rhoncus ipsum. Proin nonummy metus id erat.]]></description> <tmb>photoGallery/tmb13.jpg</tmb> <img>photoGallery/img13.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Pellentesque convallis. Donec dolor. Vestibulum venenatis ante ac nunc. Duis imperdiet. Mauris urna quam.]]></description> <tmb>photoGallery/tmb14.jpg</tmb> <img>photoGallery/img14.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Nam faucibus bibendum leo. Sed odio tellus, ultricies id, pretium dapibus, faucibus quis, mauris. Ut porttitor.]]></description> <tmb>photoGallery/tmb15.jpg</tmb> <img>photoGallery/img15.jpg</img> </images> <images> <title><![CDATA[PHOTOVENTURA]]></title> <description><![CDATA[Curabitur ut ante at lacus venenatis porttitor. Mauris congue sapien eget lorem. Ut adipiscing dapibus leo.]]></description> <tmb>photoGallery/tmb16.jpg</tmb> <img>photoGallery/img16.jpg</img> </images> </gallery>