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

  • Home
  • SEARCH
  • 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 9169777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:55:32+00:00 2026-06-17T15:55:32+00:00

I am new to working in ActionScript and I’m experimenting with using the Timeline

  • 0

I am new to working in ActionScript and I’m experimenting with using the Timeline to trigger certain events in my game. In particular, I’m using the timeline to trigger the fire event for a gun so that when the fire animation gets to a certain frame, a bullet is spawned. In the gun class (Enter_Frame) I check that the mouse is being held down and the time between the last shot and the current time is longer than the cool down, if everything checks out I play the animation.

if (time - lastShot > cooldown)
{
    canShoot = true;
    lastShot = time;
}
if (mouseHold && canShoot)
{
    play();
}

This creates a problem when the frame rate is brought below the point where the full animation cannot be played before the cool down is up again. In this instance the bullets fire slower with lower frame rates.

In addition, higher frame rates make the gun more responsive to mouse input because the fire frame comes sooner than in lower frame rates.

The goal is obviously to make the game completely frame rate independent. I would like to have the ability to slow down or speed up the frame rate of the animation depending on the cool down of the gun.

What is the best way to make this animation play in a specific time period without skipping over the actions that I have put into the timeline?

  • 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-06-17T15:55:33+00:00Added an answer on June 17, 2026 at 3:55 pm

    It sounds like you’re on the right track, but approaching this the wrong way. Check out the Timer class, it’s framerate independent, and will greatly aid you.

    var my_timer = new Timer(1000,0); //in milliseconds
    my_timer.addEventListener(TimerEvent.TIMER, catchTimer);
    my_timer.start();
    
    
    function catchTimer(e:TimerEvent)
    {
         trace("event fired");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a SmartVersioning ad using MediaMind using ActionScript 2 (the publisher doesn't
I'm new to Objective C and XCode, currently working on my first iPhone Game.
I'm very very new on ActionScript 3.0 development for Blackberry Playbook. I'm working with
I'm relatively new to 3D development and am currently using Actionscript, Stage3D and AGAL
Im new to working with Domain Models so forgive me for asking an elementary
I am new to working with C# and databases. I need to iterate over
I'm way new to working with XML but just had a need dropped in
I'm rather new to working with multiple threads in a database (most of my
I'm relatively new to working with XML and am working with some rather large
I'm fairly new to working with relational databases, but have read a few books

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.