How to add Score and Timer in Adobe flash

Hi guys I am making a android game. I am new in actionscript programming and i can't find to get this right.
I need to have a score and timer in this game >>> http://www.filedropper.com/eggrun
It should have coins for adding the score and a countdown timer for it's gaming time.
When the countdown timer goes to zero. The game stops then the stage will remove the game scene then a new layer will pop up with the total score in it.
Please help me guys
I am nowhere close to getting this right.

There are many ways to do countdown timer. Here are two examples to countdown from 60 seconds to zero. Theoretically they should work the same, but practically not always. Since heavy processing can slow down frame rate and hence method #2 will not be accurate. Really depends on your need.
#1, using Timer class
var delay:Number = 1000; //the delay between timer events, in milliseconds.
var remainingTime:int = 60;
var countDownTimer:Timer = new Timer(DELAY);
countDownTimer.addEventListener(TimerEvent.TIMER, countDownUpdate);
countDownTimer.start();
function countDownUpdate(evt:TimerEvent):void{
     //1 second passed, do something
     remainingTime--;
     if(remainingTime == 0){
          //60 seconds passed, do something
          countDownTimer.stop();
          countDownTimer.removeEventListener(TimerEvent.TIMER, countDownUpdate);
#2, using onEnterFrame event
var frameCount:int= 0;
var remainingTime:int = 60;
addEventListener(Event.ENTER_FRAME, countDownEnterFrame);
function countDownEnterFrame(e:Event):void{
     frameCount++;
     if(frameCount == Stage.frameRate){
          //1 second passed, do something
          frameCount = 0;
          remainingTime--;
          if(remainingTime == 0){
               //60 seconds passed, do something
               countDownTimer.stop();
               countDownTimer.removeEventListener(TimerEvent.TIMER, countDownUpdate);
As for your score part. It really depends on what exactly you're looking for. There are a lot of ways to do it, and for each way to do it there are even more methods to implement it. Maybe you can try to describe in more details of what you have in mind, so people can help you easier. Don't worry if one method doesn't work for you, since there are so many ways to do things in Flash with AS3. Good luck

Similar Messages

  • Add Score and Time in Android Runner Game

    HI guys!
    I am making a runner game for android and I am working on how to add a score and a timer in my game and I can't figure it out
    Please help me in adding a score board and Timer in my flash game >>> http://www.filedropper.com/eggrun
    There should be coins for adding scores then a 2mins countdown timer
    I am still new in programming. Please help me guys!

    http://www.filedropper.com/eggrun_1 on CS5 version.
    Please help me guys

  • Need help for Flash quiz with score and timer

    Greetings, I need to urgently create a flash
    game with 10 questions, 3 answers per question. At the end of the
    quiz I need to get the time the quiz was completed for, what answers the player answered correctly and the time its completed into a database, + a couple of fields like name and phone that the user fills also needed to be added into db with the score and time. I need it by the end of tomorrow and I do realise i dont have the knowledge to make it, So if there is anyone that wishes to help or trade services I can give you back the favour by creating some html/css/web design content for you. Thanks in advance and please excuse me for my terrible english.

    download flash cs6 and use it to publish your ad or expand flash cc's publishing capabilites.  if you have a flash cc subscription you can download and use flash cs6 after logging into your cc acount.
    here's how to expand publishing capabilites of flash cc: http://forums.adobe.com/message/5511080#5511080#5511080

  • Get-Content and add Date and Time in a new file

    Hello,
    in a existing file I have data like:
    1;Idle
    5;chrome
    1;spoolsv
    Now I need to grab the content and add date and time in front of each line and save it to another file like:
    07.04.2015;10:18;1;Idle
    07.04.2015;10:18;5;chrome
    07.04.2015;10:18;1;spoolsv
    But I don't have any idea how I could solve this challange. Does anyone have a helping hand for me?
    Greetings

    Hello,
    If you need a new file with the desired output try this
    get-content .\current.txt | Foreach-Object{ $dntv = (get-date) ; "$dntv" + $_} | Out-File newfile.txt
    regards,
    V
    Venu

  • How can i download and install and really use Adobe Flash Player on my MacBookAir with OS X 10.8.2 ??

    How can i download and install and really use Adobe Flash Player on my MacBookAir with OS X 10.8.2 ??

    Hello Allan,
    thank you for your promt message. I have download the installer like many times before and install the flashplayer like many times before, too. But it does not work ... only getting the black screen ... but then, after checking some settings and defaults i realize that i have to switch in Safari > Security > Plug in to status activated !!!
    Shame on me and sorry for wasting your time, but i started with Mac 3 weeks before and have to leave windows-thinking !!! But i am convinced that mac is the better way ...
    By Soeren

  • How to add MenuBar and MenuItems in JSP Form

    Help Me,
    Dear Forum,
    I am user of jDeveloper 10g working on JSP (Web Module).So How to add MenuBar and Menu Item, in Our jsp Form.What this type control exist?
    regards
    javed khan

    You should do this instead:
    iframe.setJMenuBar(i_menuBar);

  • How to add ParallelElement and  SerialElement in strobe Player

    hey frnd,
    i'm showing rtmp video from loud api to user and want to add some ads with list of mp3s.
    I'm using strobe player but not getting idea to do this .
    How can we send more parameters to strobe like xmllist or How to add ParallelElement and  SerialElement in strobe Player.
    thx in advanced,

    Ooohh... you mean, like the one mentioned in http://indesignsecrets.com/adding-zoom-and-print-to-indesign-swf-files.php?
    But they want to get paid for their hard work, the bastards!

  • How to add zooming and printing in e-magazine created by indesign?

    Could you please give ma an advise me how to add zooming and printing in e-magazine created by indesign? Many thanks

    Ooohh... you mean, like the one mentioned in http://indesignsecrets.com/adding-zoom-and-print-to-indesign-swf-files.php?
    But they want to get paid for their hard work, the bastards!

  • How to add depreciation and interest in product costing?

    how to add depreciation and interest in standard cost estimate and actual costing in product costing ?

    Hi,
    WHy the admin and sales overhead will be deited to cost of product. The cost of product should include only the factory related direct cost and overhead cost .. not the sales and admin ovehead. exp. for those treat them as period expense and pass on the same to COPa and there those can be analysed there..
    I hope i am clear..
    Regards
    Prabhat

  • How to add an "age / time counter" into DW?

    Can anyone assist on how to add an age / time counter into DW?
    In other words to say "Child X is now a years, b months old"? or "Product Z was launched A years B months ago"? Or, on the other hand, "You only have Z days & Y minutes left to enter"? With it updating in real time?
    Apologies in advance if this is a silly / obvious question but I just can't seem to do it!

    This isn't something you would add to DW, you would need to add it to your webpages. You would do this with javascript. Search the web for
    'javascript countdown timer' for plenty of examples.

  • Acrobat 7, needed with FrameMaker 7: How do I get and install an "Adobe PDF printer instance?"

    In FrameMaker, when I try to save a FrameMaker file as a PDF file, I get the following message: "FrameMaker could not find Adobe PDF printer instance, which must be installed to execute "Save as PDF" command".  I have a sinking feeling that I deleted that printer instance from my list of printers, thinking I did not need such a printer. I have tried uninstalling and reinstalling FrameMaker 7, Acrobat 7 and Reader 9. All reinstalled successfully, EXCEPT still no Adobe PDF printer instance. Thus my question: how do I get and install that Adobe PDF printer instance?
    .( I am using a new computer. I still have my old computer available, with the Adobe PDF printer instance on it. If I could find where in the old machine (Windows XP)  the files are for it, I could copy them to the new machine).
    Thanks in advance  for any advice.

    Just curious,
    What is the new machine's OS (& is it 32-bit or 64-bit)?
    Be well...

  • I have Windows 7 and IE 10 and have installed Adobe Flash Player 11 multiple times.

    I have Windows 7 and IE 10 and have installed Adobe Flash Player 11 multiple times. When I go to play a YouTube video, it tells me that I still need to install Flash Player and will not work. I've installed it many times and still nothing. Please help--getting very frustrated that I can watch YouTube videos on my smartphone, but can't on my computer which costs 12 times as much!!!

    http://forums.adobe.com/thread/885448
    http://forums.adobe.com/thread/867968

  • How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

    BKBK,
    Thank you for your response. That does adequately cover the
    client-originated sessions, but still leaves the ability I am
    looking for unavailable.
    It did serve to definitively answer my most pressing
    question, however, with this statement:
    Note: ColdFusion cannot create a session if an initiator
    application uses a SendGatewayMessage method to start an
    interaction with a client, such as an SMS user. In this case, the
    sending code must keep track (for example, in a database) of the
    messages it sends and their destinations. When a response event
    arrives, it can look up the origniatorID to determine whether it
    was in response to an outgoing message.
    I will play around with the Application scope to see if there
    might be a workable solution there.
    RLS

  • How to compare date and time together

    Hi,
    How to compare Date and Time together?
    For example in a database table there are two fields rundate and runtime.  I want to compare these two with perticular date and time in the program.  Like, I want to pull all the records where the records's date and time are less than a perticular date and time in the program.
    Hope the question is clear...
    Thanks.
    Kavita

    Hi Kavita
    There is no as such Date and Time Comparision FM in Standard SAP  But You can define your own like this
    <b>FUNCTION ZAV4_COMPAREDATETIME.
    ""Lokale Schnittstelle:
    *"  IMPORTING
    *"     REFERENCE(DATE1) TYPE  DATS
    *"     REFERENCE(TIME1) TYPE  TIMS
    *"     REFERENCE(DATE2) TYPE  DATS
    *"     REFERENCE(TIME2) TYPE  TIMS
    *"  EXPORTING
    *"     VALUE(TWOISMORETOPICAL) TYPE  C
      twoismoretopical = ''.
      if date2 > date1.
        twoismoretopical = 'X'.
      else.
         if date2 = date1 and time2 > time1.
           twoismoretopical = 'X'.
         endif.
      endif.
    ENDFUNCTION.</b>
    Regards
    Mithlesh

  • How to display date and time on jsf page

    Hi,
    how to display date and time on jsf page
    we are using 11.2.0.0 jdeveloper on windows.
    thanks
    Edited by: user12187801 on 26-Jul-2012 01:42

    Your question is certainly lacking some information.
    If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
    If you meant something else, then it's back to you to explain.

Maybe you are looking for

  • How can I recover lost iPhone data

    I recently performed a sync with Oulook. The file was corrupted and I lost all my iPhone contacts and calendar data. I am unable to repair the pst file. Can I restore my device from an old backup in iOS?

  • HP G62-357CA Recovery Disk Error code OxeOef000e

    I am trying to recover my HP notebook G62-357 and when I am on the second disk it is giving me the following error. Can anybody please help. "Recovery Manager could not restore your computer using the factory image. Please contact HP Support. Error c

  • Powerbook heats up with external display?

    I just recently got a 19 inch LCD Viewsonic VX924. I'm running the the mini dvi to dvi out to the external monitor with my powerbook display closed. I've noticed that the powerbook runs at a higher temperature with this setup and the fans are on abou

  • Saving Ultrabeat Presets

    Hello all, I've been working in Ultrabeat, making a custom kit using sounds from various presets. Problem is that I saved the new preset, but it reverts to the original preset, before I made the changes. Is saving presets something of Logic Pro? I kn

  • Premiere Pro CC Project File (.prproj) no longer XML?

    Hi, Does anyone know why the project file (.prproj) is no longer a readable XML file in PP CC? In earlier versions, you could open the project file in a text editor and read it as an XML file. In CC, it's illegible garbage. Is there a way to decode t