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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:37:24+00:00 2026-05-13T19:37:24+00:00

My timer counts down from 60 to zero . I want my movie to

  • 0

My timer counts down from 60 to zero. I want my movie to go to the next frame at zero count. How would I make a condition to go from frame 1-2? I need to find the right operator and values, but I get lost in the strings.

WHAT I’M TRYING
If (something is <> == true false);
gotoAndPlay(2);

stop();
//
var timer:Timer = new Timer(100, 300);
timer.addEventListener(TimerEvent.TIMER, countdown);
timer.start();
function countdown(event:TimerEvent) {
    var totalSecondsLeft:Number = 60 - timer.currentCount;
    myText.text = timeFormat(totalSecondsLeft);
}

function timeFormat(seconds:int):String {
  //  var minutes:int;
   // var sMinutes:String;
    var sSeconds:String;
    if(seconds > 59) {
    //    minutes = Math.floor(seconds / 60);
    //    sMinutes = String(minutes);
        sSeconds = String(seconds % 60);
    } else {
   //     sMinutes = "";
        sSeconds = String(seconds);
    }
    if(sSeconds.length == 1) {
        sSeconds = "0" + sSeconds;

            //###################################
            //}
            //if(bla bla bla?) {
            //gotoAndPlay(2);
            //###################################
    }
    return sSeconds;//return sMinutes + ":" + sSeconds;
}

I Tried This “Nothing”

stop();
var timer:Timer = new Timer(1000); // delay = time between ticks in milliseconds
timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
timer.start();

function onTimer($evt:TimerEvent):void { 
    watch.hand.rotation = 30 + timer.currentCount;//tick 5 
} 

//function startAgain($evt:TimerEvent):void { 
//timer.reset(); 
//timer.start(); 
//} 

function onTimerComplete(e:TimerEvent):void
{

    // remove listener
    timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
    // advance playhead to frame 2
    gotoAndPlay(2);
}

I’m making several experiments like this to understand conditionals. I need to build objects that function similar to preloaders.

alt text http://www.ashcraftband.com/myspace/videodnd/board1.jpg

  • 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-13T19:37:25+00:00Added an answer on May 13, 2026 at 7:37 pm

    If your question is about advancing the playhead from frame 1 to frame 2 after 60 ticks then I would suggest you listen for a TimerEvent.TIMER_COMPLETE event. For example,

    var timer:Timer = new Timer(delay, 60); // delay = time between ticks in milliseconds
    timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
    timer.start();
    
    function onTimerComplete(e:TimerEvent):void
    {
        // remove listener
        timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
    
        // advance playhead to frame 2
        gotoAndPlay(2);
    }
    

    As for your question about conditionals… you ask, “How would I make a condition to go from frame 1-2?” Well, what does the condition require in order to advance a frame?

    Please try to ask clear and concise questions. If you are just trying to wrap your head around conditionals then I suggest you search google and this site as there is a ton of good information out there. Good luck!

    ==== Edit ====

    The code you added 2 days ago (i.e. I Tried This “Nothing”…) shouldn’t do anything 🙂

    The following line of code instantiates a Timer object that will tick every 1000 milliseconds forever:

    var timer:Timer = new Timer(1000);
    

    This is why your onTimerComplete(e:TimerEvent) handler never gets called. If you want it to eventually stop ticking, say after 5 seconds, you would want to use the following snippet in place of yours:

    var timer:Timer = new Timer(1000, 5); // timer will tick every second (1000 milliseconds) for 5 seconds
    

    You also never register a TimerEvent.TIMER event handler. This is why your onTimer($evt:TimerEvent) handler never gets called. If you want to capture that event you will need to register the handler like so:

    timer.addEventListener(TimerEvent.TIMER, onTimer);
    

    If you add that listener be sure to remove it in the onTimerComplete(e:TimerEvent) handler in the same manner the TimerEvent.TIMER_COMPLETE handler is removed.

    Hope this helps. Good luck!

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

Sidebar

Related Questions

No related questions found

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.