When a user clicks on button "1" the image slides in from the left. When the user chooses to view image "2" image one slides out of the way and image two then slides in. I would like to do this using Actionscript because there's going to be a bunch of pictures that are part of this slideshow. It's how to tell the Flash player how to slide out the current image and slide in the new image that I'm struggling with. Forgive my lameness.
I'm also trying to do this without dynamically loading each image everytime they click on a button. The reason for this is so all the images load at once, thereby eliminating the delay that would occur as each image loads after a user clicks a button. A fellow Flashkit member(Garbage) suggested I do this using a Library clip (all the images placed on a keyframe of a movieClip that are referenced per button click) but I'm not sure how to do this (goToAndPlay?).
Any help or guidance would be most appreciated.
I've attached the .fla if anybody wants to look at it.
Thanks
Adam
i can see this problem was posted 6 years ago, but i have the exact same problem..
how to make a current mc slide out while a new one slides in, without actually animating every possibility..
i'm sure there's an easy code for it, i just can't seem to find it..
help?
anyone?
Easiest way I can think of is to use the Tween class that comes with flash.
PHP Code:
//import the as files for the tweening
import mx.transitions.Tween;
import mx.transitions.easing.*;
//set up onRelease function for your button and set it to call a function
//also, send a parameter, holder, the instance name of the object to tween
byButton.onRelease = doATween(holder);
//write the function called onRelease
function doATween(clip){
//actual tween function that was imported
var tw:Tween = new Tween(clip,"_x",Strong.easeOut,-200,300,3,true);
}
The parameters you pass in the Tween method are this:
Tween(instanceName,"property",easing,start,finish, time,seconds or frames);