1 Reply Latest reply on Jul 2, 2009 6:52 AM by Ned Murphy

    Photo Easing Help

    2y2d

      Hi Im just wondering, if anyone knows any good tutorials so that I can achieve an easing photo gallery like the one in the linke below

       

      http://www.webdesign.org/web/flash-&-swish/flash-tutorials/macromedia-flash-photo-slidesho w-with-easing.12433.html

       

      I am wanting this for actionscript3.

       

      Cheers in advance

        • 1. Re: Photo Easing Help
          Ned Murphy Adobe Community Professional & MVP

          What you should do is understand how the AS2 version works so that it will be easier to understand/create an AS3 version.  What this involves is putting all your images into a movieclip and then tweening from one x position of that clip to another, where each x position marks the left edge of an image within that movieclip.  This movieclip is placed behind a mask so that only one image's width is visible out of the whole movieclip.

           

          So you would have buttons that would command the movieclip to tween from its current x position to the x position designated by the button (the z position of the image within the movieclip).  For the example you pointed to, that x position is determined based on the images all having the same width.

           

          So all you would really need to do in terms of coding is to have one function that does the tweening and use movieclip buttons that each define their own unique ending value for the tween.  All of the buttons (movieclips as buttons) would interact with this same function.  Here's a rough example of it, where I have the btns each holding a variable imgX to indicate where the imageMC has to be moved:

           

          import fl.transitions.Tween;
          import fl.transitions.easing.*;

           

          var tw:Tween;

           

          function tweenImage(evt:MouseEvent):void {

               var btn:MovieClip = MovieClip(evt.currentTarget);

               tw = new Tween(imagesMC, "x", Regular.easeIn, imagesMC.x, btn.imgX, changeTime, true);

          }

           

          Look in the Flash help documents for anything you don't understand about the Tween coding.