A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Changing Frame Rate During Runtime

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Posts
    10
    Hi all

    Does anyone know if there is any way of changing the movie's frame rate during runtime from actionscript? Many thanks in advance.

    Ade

  2. #2
    Pillow Daddy m_andrews808's Avatar
    Join Date
    May 2001
    Location
    London England
    Posts
    924
    Nope. Sorry its not possible

  3. #3
    Flash Initiate StuartW's Avatar
    Join Date
    Jul 2000
    Location
    The Metaverse
    Posts
    504
    I beg to differ...

    not really - you can't do it - but you can CHEAT to make it look as though you can.

    Make a blank movieclip
    call it "controlClip" or whetever

    Put all the contents you want to speed up into another MC call it "contents" say, then:

    Put this in controlClip

    Frame 1:
    stop;

    Frame 2:
    tellTarget ("_root.contents") {
    gotoAndPlay (_currentframe + 2);
    }

    Frame 3:
    gotoAndPlay (1);

    Now when you want to call it put:

    tellTarget ("_root.controlClip") {
    gotoAndPlay (2);
    }

    in your main timeline and when you want to return to the current speed:

    tellTarget ("_root.controlClip") {
    gotoAndStop (1);
    }


    This should double the speed of the MC "contents" by skipping every other frame.

    It's a bit long winded, but it works!

    Hope it helps in some way.

    Stu

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Posts
    10
    Thanks people, unfortunatley I was looking for a way of speeding the movie up without skipping frames. Oh well, Back to the drawing board. Thanks again.

    Ade

  5. #5
    Junior Member
    Join Date
    Jun 2001
    Posts
    9
    You can speed up the movie without speeding up the frame rate. Unfortunately, it involves a pretty much ground-up design, so if you have much time invested it probably won't be worth it.

    You would have to do all tweening that you wanted sped up programatically. Then instead of changing the values based on a frame or number of frames passing, change the value based on a number of ticks (use the global getTimer function to retrieve the number of milliseconds since the movie started). You can then factor in a variable that allows you adjust your movement relative to the time passed.


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