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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:00:31+00:00 2026-05-12T07:00:31+00:00

Greetings. I’m building a video player in ActionScript 3, that’s supposed to be targeted

  • 0

Greetings. I’m building a video player in ActionScript 3, that’s supposed to be targeted on performance. It has to play large h264 videos via RTMP, with the least possible processor load.

There’s not much control on the actual video playback part, but my approach is to try and not kill the processor with the chrome and other additional parts of the player. I’ve ditched the FLVPlayback and all components and build my own player from scratch, using Video, NetConnection and NetStream, but the NetStream class does not have an update event.

Therefor, in order to update the progress bar and elapsed time textfield, I must create a regular event of my own, that reads from the NetStream.time property and calculates the progress of the video.

As far as I’ve figured out, I have two ways I can do that: by creating a Timer class instance or by adding a listener for the EnterFrame event. I’m looking for the best way to update regularly (each couple hundreds ms), with the least impact on the processor load. Which of the two is likely to be a better option?

There’s also a third solution, but it seems like a long shot to me: create a separate animation, a basic tween, that plays independent of the video and only syncs on various video events. That would remove the regular update altogether, but only as far as I can see in the code. The animation still updates itself while playing, obviously, but I’m guessing that would be handled on a lower level than a timer. Sure, there will be extra code in order to keep the animation of the progress bar and the actual video playback in sync, but at least I won’t have a timer going off 30 times per second.

Which is the best way to eat up the least processor resources?

  • 1 1 Answer
  • 2 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-12T07:00:31+00:00Added an answer on May 12, 2026 at 7:00 am

    Asking which approach is the most efficient is the wrong way to begin. Instead, ask yourself which approach is conceptually appropriate for what you want to do.

    Since you’re updating part of your app’s visuals, it would probably be wise to start with the fact that Flash updates the screen on a fixed schedule – once per frames – and it issues events before and afterwards. If performance didn’t matter, the most correct approach would be to update the visual in an ENTER_FRAME handler – ensuring that you don’t run your update code more than once per frame (wasting cycles on updates that will not be drawn to the screen) or less (possibly degrading the visual results). So start with that.

    Since using a frame handler is the correct approach if performance didn’t matter, the next question is, does using a frame handler affect performance? The best way to answer that is to profile your app, but I’d bet my house the answer will be no. Flash will be redrawing your video anyway, and unless your progress bar has fifteen filters on it, it’s hard to imagine that it have any measurable effect. Also, even if you decided to call your updated every Nth frame, instead of every frame, unless everything you’d be updating is outside of the dirty rectangle, it will be redrawn every frame anyway, regardless of whether you’ve moved it or not. So the “savings” in performance would amount to little more than a function call and a variable assignment each frame. Such savings would be invisible compared to simplifying the graphics in the progress bar itself (and thus lowering the cost of redrawing it), if squeezing out more performance was necessary.

    All this is a long-winded way of saying, use the Frame handler unless you can find a measurable reason not to. (You won’t. 😉 If in doubt, after you’re finished, try removing the event listener and see if it makes any difference in performance, and if it does, tackle the problem then.

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

Sidebar

Related Questions

Greetings, I'm working on a game project that uses a 3D variant of hexagonal
Greetings, I have an asp.net mvc application. I have some links that corresponds to
Greetings Stack Overflow community. I'm trying to make a function that can pop all
Greetings everyone. Can any one has a working example for the CoreTelephony framework? I
Greetings. I've got a large textbox in SSRS, with a few textboxes under it.
Greetings! I am working on an AS2 website with MovieClips for pages that swap
Greetings, My app name(the one that appears on the home screen) contains a special
Greetings, I have a jqueryui autocomplete input that uses an ajax call to populate
Greetings, I have a large piece of software developed in Eiffel. It is possible
Greetings! I have an issue here that i can't find. I am getting a

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.