3 Replies Latest reply on Dec 13, 2009 6:39 PM by kglad

    create a next and back functions in as2

    captaincainer Level 1

      This is my current code and i would like to include a next and back function, any ideas would be greatfully recieved?

       

      thanks for helping.

       

      as3 newbie!

       

      import mx.transitions.Tween;
      import mx.transitions.easing.*;

      totalPictures = 19;
      close._visible = false;

      function showThumb(target){
      close._visible = true;
      thumbsHide();
      loadTarget(target);
      disableThumbs();
      }
      function closeThumb(){
      close._visible = false;
      thumbsShow();
      enableThumbs();
      }

      function disableThumbs(){
      for(i=0;i<=totalPictures;i++){
        thumbs["btn"+(i+1)]._visible = false;
      }
      }

      function enableThumbs(){
      for(i=0;i<=totalPictures;i++){
        pictures["mc"+(i+1)].enabled = false;
      }

      for(i=0;i<=totalPictures;i++){
        thumbs["btn"+(i+1)]._visible = true;
      }
      }

      function thumbsHide(){var myTween:Object = new Tween(thumbs, "_alpha", Strong.easeOut, thumbs._alpha, 0, 0.5, true);}
      function thumbsShow(){var myTween:Object = new Tween(thumbs, "_alpha", Strong.easeOut, thumbs._alpha, 100, 0.5, true);}

      function loadTarget(target){
      var myTween:Object = new Tween(pictures["mc"+target], "_alpha", Strong.easeOut, pictures["mc"+target]._alpha, 100, 0.5, true);
      }

      function closeTarget(){
      for(i=0;i<=totalPictures;i++){
        var myTween:Object = new Tween(pictures["mc"+i], "_alpha", Strong.easeOut, pictures["mc"+i]._alpha, 0, 0.5, true);
      }

      closeThumb();

      }