Comunidad de diseño web y desarrollo en internet online

Paginacion Galeria

Citar            
MensajeEscrito el 17 Dic 2009 04:09 pm
Saludos me quede pegado en una galería básica que estoy haciendo, con referencia a la paginacion no tengo idea de como terminarla, la funcionalidad serian 5 thumbs, y si son mas de estos, que se puedan ver los siguientes con dos botones, en este caso llamados next_mc y back_mc, gracias a todos por la ayuda de antemano, adjunto codigo de la galería.

Código ActionScript :

package com.as3{
   import flash.display.Loader;
   import flash.display.MovieClip;
   import flash.events.Event;
   import flash.events.MouseEvent;
   import flash.net.URLLoader;
   import flash.net.URLRequest;
   import flash.display.Bitmap;
   
   
   public class  Gallery extends MovieClip{
      
      private var _xmlLoader:URLLoader;
      private var _xmlPath:String = "data/xml/gallery.xml";
      private var _xmlData:XML;
      private var _thumbs:Array;
      private var _ref:int = 0;
      private var _imgContainer:MovieClip;
      
      public function Gallery() {
         _xmlLoader = new URLLoader();
         _xmlLoader.addEventListener(Event.COMPLETE, onCompleteXMLLoadHandler);
         _xmlLoader.load(new URLRequest(_xmlPath));
         _thumbs = new Array();
         _imgContainer = new MovieClip();
         addChild(_imgContainer);
         next_mc.buttonMode = true;
         back_mc.buttonMode = true;
         next_mc.addEventListener(MouseEvent.CLICK, onClickArrowHandler);
         back_mc.addEventListener(MouseEvent.CLICK, onClickArrowHandler);
      }
      
      
      private function onCompleteXMLLoadHandler(event:Event):void {
         _xmlData = new XML(event.target.data);
         populateThumbs();
      }
      
      private function populateThumbs():void {
         for (var i:int = 0; i < 5; i++) {
            var temp:Loader = new Loader();
            temp.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteThumbLoad);
            temp.load(new URLRequest(_xmlData.item[i].thumb));
            var thumb:MovieClip = new MovieClip();
            addChild(thumb);
            _thumbs.push(thumb);
         }
      }
      
      private function onCompleteThumbLoad(event:Event):void {
         var image:Bitmap = Bitmap(event.target.content);
         image.smoothing = true;
         MovieClip(_thumbs[_ref]).x = (_ref * 80) + 80;
         MovieClip(_thumbs[_ref]).y = 350;
         MovieClip(_thumbs[_ref]).addChild(image);
         MovieClip(_thumbs[_ref]).buttonMode = true;
         MovieClip(_thumbs[_ref]).addEventListener(MouseEvent.CLICK, onClickThumbHandler);
         MovieClip(_thumbs[_ref]).id = _ref;
         _ref++;
      }
      
      private function onClickThumbHandler(event:MouseEvent):void {
         var temp:Loader = new Loader();
         temp.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteImgLoad);
         temp.load(new URLRequest(_xmlData.item[event.target.id].full));
      }
      
      private function onCompleteImgLoad(event:Event):void {
         var image:Bitmap = Bitmap(event.target.content);
         image.smoothing = true;
         _imgContainer.addChild(image);
         _imgContainer.x = (stage.stageWidth - image.width) / 2;
         _imgContainer.y = 15;
      }
      
      private function onClickArrowHandler(event:Event):void {
         
      }
   }
   
}

Por YorCh.Peraza

5 de clabLevel



 

chrome
Citar            
MensajeEscrito el 17 Dic 2009 07:25 pm
eso es una imagen convertida a caracteres ??

Por Zandy

Claber

1345 de clabLevel

5 tutoriales

Genero:Masculino   Premio_Secretos

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.