A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [CS3] Rewinding only 30 frames?

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    16

    [CS3] Rewinding only 30 frames?

    Hey what would be the best solution in rewinding the main timeline only 30 frames?

    so far ive used:
    rewindbutton.onRelease = function () {
    onEnterFrame = function () {
    prevframe ();
    }
    }


    but that makes it rewind all the way back to the beginning of the whole timeline. I would like it to rewind only 30 frames and then stop.

    Thanks! (AS2/3, anything goes)
    Last edited by Noisepurge; 07-22-2008 at 05:30 AM.

  2. #2
    Working On An Online RPG grimm 88's Avatar
    Join Date
    Sep 2007
    Location
    Nowhere
    Posts
    280
    i myself have never used prevframe... but my guess would be to get rid of the onenterframe = function() part to make it only go back one frame, and put a 30 in the prevframe brackets which might make it go back 30... although its untested and i am not sure

    otherwise, you could write:
    Code:
    rewindbutton.onRelease = function() {
    count = 0;
    onEnterFrame = function() {
    if (count <= 30) {
    prevframe();
    count++;
    }
    }
    }

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    16
    Thanks for the fast reply, and it does work like a charm! Rewinding a timeline in flash seems to be quite a chore, how come it doesn't support a simple "rewind" or "playback" command

    Thanks again!

  4. #4
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    Small point, but in both cases, you should delete onEnterFrame; when you finish to prevent the function running indefinitely.

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