A Flash Developer Resource Site

Results 1 to 20 of 41

Thread: Get your 25fps flash movie to actually run at 25fps in IE

Threaded View

  1. #1
    Senior Member
    Join Date
    Aug 2001

    Get your 25fps flash movie to actually run at 25fps in IE

    Hi all,

    I posted this in another thread, but thought i'd post it here as well as we see this sort of question now and again.

    As some of you may know, if you tell a flash movie to be published at 25fps in flash, when you run it as a standalone flash movie it will pretty much run at that 25fps (unless your computer isnt fast enough)

    But..... if you run it through a html page, you get something stupid like 21fps, for no obvious reason other than someone at macromedia/microsoft/mozilla likes monkees.

    Anyhow, heres a work around which although works quite well, will only work most accurately if your publishing your movie at a frame rate of between 1 - 12, 13, 15, 17, 20, 25, 34, 50 or 100 (see http://www.flashkit.com/board/showthread.php?t=638974 for a reason as to why)

    Easy steps:-
    1. Forget whatever framerate you want your game to run at, and set flash to publish at some stupid rate, 120 is good. (but anything more than 10fps higher than the rate you really want should be fine)

    2. Make a blank Movieclip on your main stage that will be there throughout ur entire game

    3.Stick this code on the first frame of that new movieclip
    starttime = newDate()
       var currtime=new Date()
       var ttime=currtime-starttime
          var currtime = new Date()
          var ttime=currtime-starttime
       starttime=new Date()
    4. Change the 'DESIREDFRAMERATE' to be whatever you want, though please note, you will only get the frame rates noted above. If you type in a number not in the above list, it will get rounded down. Ie, 30 would give you 25fps.


    Sample of this working can be found here :-


    The demo originally loads trying to run at 120fps (if your computers fast enough you might just get there...)

    Press the textfieldeee button type thing to the left of the FPS counter, and the code should kick in to limit the framerate to 25 fps

    And you should (hopefully) see that you do actually get 25 fps, or at least much more closer to 25fps than if i had pulblished the game at 25 and run it through IE normally.

    Hope it helps

    Last edited by PercyPea; 07-07-2005 at 09:11 AM.

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