Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3352968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:05:40+00:00 2026-05-18T02:05:40+00:00

I have a Flash game I made way back in 2008. It runs super

  • 0

I have a Flash game I made way back in 2008. It runs super fast these days. Way too fast in fact. I have it set to 60fps in FlashDevelop, but I think that is just limiting the amount of draw calls. I think my logic is executing well past 60 times a second these days. I haven’t done ActionScript in a while, but I noticed that I am using an enterFrameHandler that executes my logic loop. It seems to have no constraint set on it. It just fires away as it is called I believe. Is there any way I can cap it at 30 or 60fps? I would greatly appreciate any help or ideas. My game is ruined if the logic runs too fast 🙁

UPDATE
As some ActionScript knowledge is coming back to me I just thought of something. Isn’t the enterFrameHandler bound by what the fps is set to in Flash or FlashDevelop under project properties? Can anybody confirm this? It would mean my draw calls and logic calls are 1:1 right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:05:40+00:00Added an answer on May 18, 2026 at 2:05 am

    Indeed, enterFrame handlers are only called when it’s rendering the frame (at 60Hz in your case).

    If you can limit the number of times something is executed by measuring the time. Something like this:

    // A property to store the last time the code was executed
    protected var lastTimeCalled:int;
    
    // Inside your enterFrame handler
    protected function onEnterFrameHandler(e:Event): void {
        var ti:int = getTimer(); // Get current time
        var desiredFPS:Number = 60; // Actual framerate you want
        var frameInterval:Number = 1000 / desiredFPS; // Desired ms per frame
    
        if (isNaN(lastTimeCalled) || ti >= lastTimeCalled + frameInterval) {
            // Execute code here
            ...
    
            // Increase time (by chunks of fixed size for framerate self-adjustment)
            lastTimeCalled = isNaN(lastTimeCalled) ? ti : lastTimeCalled + frameInterval;
        }
    }
    

    Notice, though, that if your SWF’s framerate is set to 60, trying to set desiredFPS to 60 won’t do a thing; it’ll probably just cause some frames to be dropped. It may be a good way to test if your enterFrame handler is getting called somewhere else though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a website and put inside it a flash game. For people
I have a game made by Flash CS5 ActionScript3. I want to create a
We have a flash game being developed in actionscript 3 and it runs much
I have made a flash game for facebook. All happened right expect when I
hey all, I have made a socket server in C# for a flash game
I have developed a Flash game for Adobe Air. In the game I set
I have little knowledge of Flash but for a little Flash game I have
I am nearing the completion of my first as3 flash game and have published
I am making a fighting game in Flash and while I have everything running,
I have a game loop written in Haxe/Flash. For some reason it slows down

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.