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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:28:12+00:00 2026-05-27T03:28:12+00:00

How do you set a function to increment in AS3 Flash. I am trying

  • 0

How do you set a function to increment in AS3 Flash. I am trying to start the incremented function when my video starts and then run the same function every 20 seconds until the video stops.

something like:

    my_player.addEventListener(VideoEvent.COMPLETE, completePlay);
    my_player.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, startPlay);

   function startPlay(){
       startInc();
       //OTHER items are started and set within this function that do not have to do with the incremented function.
    }


   function completePlay(){
       //This is where the startInc is stopped but not removed since it will be used again.

    }


     function startInc(){
          //This function should run every 20 seconds.
     }
  • 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-27T03:28:12+00:00Added an answer on May 27, 2026 at 3:28 am

    User a timer around your player’s VideoEvents.

    package
    {
        import flash.display.Sprite;
        import flash.events.TimerEvent;
        import flash.events.VideoEvent;
        import flash.utils.Timer;
    
        public class IncrementTimer extends Sprite
        {
    
            private var my_player:*;
    
            private var timer:Timer;
    
            public function IncrementTimer()
            {
                my_player.addEventListener(VideoEvent.COMPLETE, completePlay);
                my_player.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, startPlay);
            }
    
            protected function startPlay(event:VideoEvent)
            {
                timer = new Timer(20000);
                timer.addEventListener(TimerEvent.TIMER, startInc);
                timer.start();
            }
    
            protected function completePlay(event:VideoEvent)
            {
                timer.reset();
            }
    
            protected function startInc(event:TimerEvent)
            {
                // called every 20-seconds
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to set a function to do something like this def __binaryTreeInsert(self, toInsert,
I am trying to increment a number and update the database and then display
How do you set a function to \C-' ? when I try to do
1 set: $('#tabs li:first-child').addClass('first-child'); $('.photos li:first-child').addClass('first-child'); $('#alphabet li:first-child').addClass('first-child'); 2 set: $(function(){ $(#header-thumbs img).fadeTo(fast,1); $(#header-thumbs
In a framework like Django or Pylons you can set up function to handle
I have an on object like so var obj = {}; function set() {
I have a set of assembly function which I want to use in C
I'd like to set up a function pointer as a member of a class
Is there a way to set up a function that will get the user
Is it possible to retrieve variable set in onreadystatechange function from outside the function?

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.