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 111037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:19:17+00:00 2026-05-11T02:19:17+00:00

I would like to do simple (looping) animation (moving, changing alpha etc) in Haxe

  • 0

I would like to do simple (looping) animation (moving, changing alpha etc) in Haxe (flash9). I don’t have anything that resembles frames in my library, just single frame assets.

Since I am a beginner. I am not necessarily looking for a sophisticated framework. I would be happy with something quick & dirty. Maybe ifs checking the frame (class variable) and linearly interpolating the values.

class MyClass extends Sprite {     static var frame:Int = 0;     static inline var framerate:Int = 25;      static function main() {         var app:MyClass = new MyClass();         flash.Lib.current.addChild(app);     }      private function new() {         super();          // init assets here          var myTimer:Timer = new Timer(1000/framerate);         myTimer.addEventListener(TimerEvent.TIMER, animate);         myTimer.start();     }      function animateForeground(event:TimerEvent) {         frame = (frame + 1) % 1000;          // set new values depending on frame     }  } 

I know the basic idea of keyframe animation. What I am looking for is more about how to structure this part of the program.

Can you please give me some pointers on how should I proceed?

  • 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. 2026-05-11T02:19:17+00:00Added an answer on May 11, 2026 at 2:19 am

    If you want to do animations I would very much recommend using a tweening library, although I understand that you might want to learn the basics before ‘cheating’ past them.

    I would recommend hooking up your animations to the ENTER_FRAME event instead of a timer running at the same speed as your framerate. There’s really no need to decouple these two, since the timer isn’t any more reliable than the ENTER_FRAME event, and there’s no need in moving stuff around if it can’t be seen anyway.

    Also, I don’t think you should focus that much on ‘keyframe’ animation. That is a useful concept when you have keyframes, if you don’t it’s way more practical just to do what feels like the best way to implement this.

    I would put some code in here, but I’m having a little bit of a hard time coming up with any since I’m not really sure what you’re trying to achieve here.

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

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If your DBMS does not impose limitations on which table… May 11, 2026 at 8:30 pm
  • Editorial Team
    Editorial Team added an answer In answer to the restructured question, you could do it… May 11, 2026 at 8:30 pm
  • Editorial Team
    Editorial Team added an answer From studying http://www.cherrypy.org/browser/trunk/cherrypy/lib/static.py I'd have to say, no: the serve_file… May 11, 2026 at 8:30 pm

Related Questions

This is NOT a question on plain old boring customization; I actually want to
I've just started building a prototype application in Django. I started out by working
Do you have a simple debounce routine handy to deal with a single switch
I am trying to do something fairly simple but seems like a near impossible

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.