0 Replies Latest reply on May 6, 2009 11:40 PM by hene-

    UILoader and next-button

    hene-

      Hi!

       

      I use UILoader to load pictures from folder. Example 1.jpg, 2.jpg etc. I have just buttons to browse pictures. Button 1 loads picture 1 etc.

      Now I need next and back buttons to browse pictures. Is it possible to do? How?

       

      Here is code I use:

       

      var photo:UILoader = new UILoader();

       


      var defaultPIC:URLRequest = new URLRequest("1.jpg");
      photo.load(defaultPIC);
      picbox.addChild(photo);
      photo.scaleContent = false;
      photo.maintainAspectRatio = true;

       


      panel_mc.panelInner_mc.btn_01.addEventListener(MouseEvent.MOUSE_UP, pic1);
      function pic1(event:MouseEvent):void{
          picbox.removeChild(photo);
          photo.load(new URLRequest("1.jpg"));
          picbox.addChild(photo);
         
      }
      panel_mc.panelInner_mc.btn_02.addEventListener(MouseEvent.MOUSE_UP, pic2);
      function pic2(event:MouseEvent):void{
          picbox.removeChild(photo);
          photo.load(new URLRequest("2.jpg"));
          picbox.addChild(photo);
      }