A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: sliding in/sliding out images using Actionscript

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    23

    sliding in/sliding out images using Actionscript

    I know I should probably know how to do this by know but I'm stuck.
    How do I create this effect using Actionscript?

    http://synap-sys.com/in_out_slide.html

    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
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Nov 2007
    Posts
    2

    me too

    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?

  3. #3
    Junior Member
    Join Date
    Nov 2007
    Posts
    2

    found it

    actually i thonk i found it here:

    http://www.hed.swinburne.edu.au/desi...ions/index.php

    thanks

  4. #4
    Senior Member
    Join Date
    Aug 2004
    Location
    plymouth-uk
    Posts
    313
    look into the tweening code etc.

    you could simply have a mc that holds all the images, then using the tweening and some maths etc you can have this scroll left or right.

    I created something like it last week.

    If need more help then will spend time to code something
    NOW! look whats happened! I told you to watch this space and now its gone.

  5. #5
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    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);
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center