1 Reply Latest reply on Mar 11, 2010 7:44 AM by edgar remolina

    Buttons for gallery pics

    edgar remolina

      I need to write the AS for myback_btn and next_btn to upload images on the largeUILoader, source xml file.

      can you help me please, thank you.

       

      So far I have written this code:

       

      import fl.transitions.Tween;

      import fl.transitions.easing.*;

       

      next_btn.addEventListener(MouseEvent.CLICK, nextPic);

      function nextPic(ev:MouseEvent):void {

      trace("click");

      }

       

      back_btn.addEventListener(MouseEvent.CLICK, previousPic);

      function previousPic(ev:MouseEvent):void {

      trace("click");

      }

       

      var fadeTween:Tween;

       

      var imageLoader:Loader;

      var XML:XML

      var xmlList:XMLList;

      var xmlLoader:URLLoader = new URLLoader();

      xmlLoader.load(new URLRequest("portfolio/large/.xml"));

        

      xmlLoader.addEventListener(Event.COMPLETE, XMLloaded);

      function XMLLoaded(ev:Event):void {

      xml = XML(event.target.data);

      xmlList = xml.children();

      for(var i:int=0;i<xmlList.length(); i++)

      {

      largeUILoader.load(new URLRequest(xmlList[i].attribute("image")));

      }

      }