dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Simple, I hope :)

  1. #1

    Simple, I hope :)

    Currently I have a FLA that plays a seriers of images. i am using stop(); and a next button with on(release){ play(); }. The next button is always displayed and when an image flows onto screen the stop(); action will hault the movie. The user needs to click next to go to the next slide - this all works fine.

    My question is how would I incorporate a rewind button? Basically just looking to hop back to the previous image.

    Any help appreciated.
    Thanks,
    Kerry

  2. #2
    Senior Member
    Join Date
    Jan 2005
    Posts
    110
    If the images are on the time line, give each image a frame label as "img1", "img2" ...

    Then put "rewind" and "next" buttons on another layer in the same movie as the image.

    In the first frame of timeline put:

    var currentImage = 1;
    var totalImage = (number of image you have);
    Code for next:

    on(release) {
    if (currentImage < totalImage) {
    gotoAndStop("img" + currentImage);
    currentImage ++;
    }
    }

    code for rewind:

    on(release) {
    if (currentImage > 0) {
    gotoAndStop("img" + currentImage);
    currentImage --;
    }
    }

    Same principle for the loaded images

  3. #3
    Can you e-mail me directly so I can show you what I am referring to? My e-mail is kerry.corcoran@molex.com

  4. #4
    Skill_Unabletospell_guy skill_guy101's Avatar
    Join Date
    Dec 2001
    Location
    Bristol, UK
    Posts
    295
    the easyest way would be to use the "nextFrame" and "prevFame" on the buttons
    ie.
    on(release) {
    gotoAndStop(nextFrame);
    }


    on(release) {
    gotoAndStop(prevFrame);
    }

    good luck
    I like good music.

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