How do I reset and start another game.

Hello
Please can someone help, I have spent several days on this and still can't get it to work.
The code below is ok, I am playing a bowling game using the keyboard and timer with a text readout of the elapsed time, the bowl moves a set number of pixels on the screen.  whilst in full screen mode I would like to click a start/play button on the screen to start the game and timer again, everything is in frame 1.  Also I would like the game to just accept the keycode 77 and keyboard event (2 events only to move the bowl) and then wait for the start/play button click.
Thanks
Mick
import flash.utils.Timer;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
var totalTime:Number = 0;
var startTime:Number;
//stop();
var bowlTimer:Timer = new Timer(1,6000);
//startButton.addEventListener(MouseEvent.CLICK, startTimer);
bowlTimer.addEventListener(TimerEvent.TIMER, moveBowl);
//bowlTimer.addEventListener(TimerEvent.TIMER_COMPLETE, endTimer);
/*function startTimer(e:MouseEvent):void
clockTimer.start();
trace("Timer started");
startButton.visible = false;
function moveBowl(e:TimerEvent):void
myBowl.x = myBowl.x + 70;
trace("Timer cycle expired");
/*function endTimer(e:TimerEvent):void
trace("Timer finished");
stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);
var myKeyBoolean = false;
function keyDownHandler(event:KeyboardEvent)
if (event.keyCode == 77)
  bowlTimer.start();
  startTime = getTimer();
else if (myKeyBoolean == false)
  bowlTimer.stop();
  totalTime +=(getTimer()-startTime)/1;
  yourTF.text = Math.round(totalTime).toString();
}// add yourTF to the stage

Hello, Thanks for the reply.
I put the code onto frame 20 and added the gotoAndPlay (1), the code played, I then clicked the button which reset the playhead to frame 1 , however the code didn't play a second time ?
Any idea why ?
Thanks for your help.
Mick
myButton.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);
function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void
gotoAndPlay(1);
trace("btn_myButton");

Similar Messages

  • HT201269 Best Buy started the setup assistant on my new iPhone 5 and now I can't make it sync with iTunes.  How can I reset and start over?

    I bought an iPhone 5 at Best Buy, and they started the setup assistant process.  Now I can't go back and start over so I can sync my phone to my iTunes account.  I have an old iPhone 3GS and didn't use the iCloud.  I backed up to my computer.  And now I can't reset my iPhone 5 to sync to my iTunes.
    Help.

    I purchased a iPhone 5, and after completing a backup of my old iPhone 3GS, I in error selected Set Up as a New iPhone in the Setup Assistant.
    I connected to iTunes and did a Restore iPhone, which set the iPhone5 back to factory defaults, and I was able to restart the Setup Assistant, and following the apple support instructions, restored from my 3GS backup and synced with my iTunes account.  The Restore kept my phone number intact.
    I was worried that I would lose the setup of my phone number that was done in the store, but everything worked perfectly.

  • Threads - Multithreaded app. - How to cancel one and start another?

    I've searched through the forums for some direction on this but have been unsuccessful in finding anything I could use yet.
    What I am trying to accomplish is the following:
    1. I have a multithreaded application
    2. User can enter login information and then initiate the login thread by clicking the login button
    3. Login button turns into a Cancel button during login attempt
    4. If user changes their mind, they can initiate the cancel login thread by clicking the cancel button
    How can I stop the login thread and start the cancel thread? Reading through the API (1.3.1), it seems that necessary methods have been depreciated. Could anyone offer me any insight/examples?
    Thanks,
    KJ

    Have a boolean variable in the login thread which is checked at various points through the process and set to true when login starts. When the user clicks cancel, set it to false, then the login thread will end itself next time it checks the boolean.

  • I am trying to set up my new ipod touch and the system does not recognize my apple id.  How do I reset and start again.  I'm not sure what to do now.

    I can be reached at this email during the day [email protected]

    Try to change your Apple ID back to your old email address (http://appleid.apple.com) in order to set up and activate the phone. After the set up please sign out of iCloud and turn off "Find My iPhone" (Settings > iCloud) - do that on all your devices -, then change your Apple ID to your new address again and then add your iCloud account on you devices again.

  • Just purchased a ex demo iMac from a store and i want to reset and start from scratch how do i do this please

    just purchased a ex demo iMac from a store and would like to reset and start again how do i do this

    I would take it back to the store and have them do this for you, that should be a condition of the  purchase. However the easiest method is to boot into the Recovery Partition (Command + R) on startup, use Disk Utility to erase the HD and then install OS X again. This will give you a fresh start.

  • I recently purchased FaceTime from the Application Store. After approx. ±10 meg, the application resets and starts downloading again. I have tried to download it at different times of the day but with the same results. I have been in contact with Apple su

    I recently purchased FaceTime from the Application Store. After approx. ±10 meg, the application resets and starts downloading again. I have tried to download it at different times of the day but with the same results. I have been in contact with Apple support and have tried different options with the same result. I cannot download a new Version because in my Purchased List the applicaiton (FaceTime) is still there, and because I have halted it it tells me to resume. I can’t, because the same thing is going to happen. I have tried all the various troubleshooting tips supplied by my ISP and also Apple Support with no luck. I am currently working on a IMac OS 10.6.7. Has anybody got any ideas? Any suggestion would help. Thanks

    Amol Soni wrote:
    As I said, I tried everything what the manual says, but hard luck. I have taken an appointment for today, lets see what happens.
    Also there is no activity on unit when I use the remote. The unit is stuck on the first page itself where we have to choose the language. The unit seems to be fine to me but the real problem is remote does'nt have activity. The IR is not responding while pressing any of the button.
    Good luck with your appointment.
    Not much consolation but even new products can have issues and might need a trip to a store to return/replace.
    The reason i asked about the LED on the AppleTV is that occasionally it thinks it's paired with a specific remote and ignores others - the unpair keypress I described is quick and free.
    AC

  • I have downloaded the 30 day free trial using Adobe Download Assistant but I do not know how to open it and start using it.

    I have downloaded the 30 day free trial using Adobe Download Assistant but I do not know how to open it and start using it.

    This was so annoying!! It took me a good couple of hours but i figured it out, you need to do the following: Go to the folder where you saved the download (in my case i saved it in My Downloads) -> click on 'Adobe Photoshop Elements 12' -> click on 'PSE 12' -> click on 'Setup' (select the icon which is a box with a shield) -> follow instructions and....voila! You will need to restart when it suggests so save anything else first, then when it reboots you should see the icon on your desktop....hpe this helps!

  • How to stop defragmenting and start living - Revisit

    Hi,
    When deal with fragmentation, most of the time we will be directed to read the technical paper (How to stop defragmenting and start living). If i'm not mistaken, this was published in the year of 1996/1998 for Oracle version 7/8.
    Time passed and we are now at 11g and i can't help to wonder if the many good advices still hold true? I've seen posting saying forget about segment with > 1024 extents, as it doesn't degrade performance.
    I want to stick to that advice, but...its kind of old! Or maybe old is as good as gold.
    Rgds
    Ung

    Realistically, any recent Oracle version is going to use locally managed tablespaces, using either uniform or autoallocated extent sizes. In either case, it is practically impossible to have fragmentation, so there is exceptionally little that a DBA could even do if he wanted to. You don't set extent sizes at the table level any longer, you don't set PCTINCREASE, at most you pick an extent size for each tablespace and pick with tablespace an object is going to reside in.
    The principles from that white paper are still very valid. It's just that Oracle has made it exceptionally difficult to deviate from them now.
    Justin

  • Got a iphone set the apple id n it was the wrong email address now i can't verifie it how do i delete and start over

    got a iphone set the apple id n it was the wrong email address now i can't verifie it how do i delete and start over

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    When you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.

  • HT1277 My hard drive crashed and using my back up, it seems my Mac mail is corrupted. How do I delete and start over?

    My hard drive crashed and using my back up, it seems my Mac mail is corrupted. How do I delete and start over?

    If you are a resident of the U.S., have iTunes 10.3 or later, you can re download purchases for free.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • HT5534 Issues w/ Microsoft word! how do I reset and relaunch?

    How do I reset and reload microsoft word on my Macbook Pro?
    Secondly, the adobe flash player stopped to function with message indicating "couldn't load plug-in". Any assistance?

    This forum is for troubleshooting Apple Software Update for Windows, a software package for Windows designed to update Apple products that run on Windows, and not related to Microsoft Office in any way. I suggest you post Office related questions on Microsoft's own forums for their Mac products.
    http://www.officeformac.com/productforums

  • HT5858 Settings - How do I reset and delete a voice recording?

    How do I reset and delete a voice recording?

    Just swipe to delete or call voice mail and delete it there

  • TS1702 How do I reset and uninstall all information on my iPad. I want to return it?

    How do I reset and delete all information on my iPad. I want to return it?

    Settings>General>Reset>Erase all content and settings. Some people suggest signing out of your ID prior to erasing the iPad in Settings>iTunes & App Stores>Apple ID. Tap your ID and sign out.

  • HT201274 How do I reset and restore from itunes

    How do I reset and restore from ITunes.I have a IPhone 4s,and I can't reset from the phone because evidentally my 4 yr. old son set a password for restrictions.

    Place your phone in recovery or DFU mode (search Google for instructions) and restore.

  • How do I download and start using Premiere?

    How do I downlod and start using Premiere?

    Hi Philip2204,
    Welcome to Adobe Forums.
    Please use the below link to download Premiere Pro
    http://prodesigntools.com/adobe-cc-direct-download-links.html
    Please make sure to complete the very important instructions prior to clicking on the link.
    Thanks

Maybe you are looking for

  • Runtime error in enhancement spot-' mereq_topline does  not exists.'

    Hi all, I have implemented an implicit enhancement spot in ME53n. When i applied break point in enhancement spot and control goes to ebhancement spot in debugging mode, i got purchse requisition number in mereq_topline. When i tried to use this struc

  • FTP using Runtime class ...Please Help ??

    Hi, I am trying to ftp a file programatically. I am trying to use Runtime class but facing problems in it.This is what I am trying to do : Runtime rr = Runtime.getRuntime(); String[] cmds = new String[2]; cmds[0]="username=rahmed"; cmds[1]="password=

  • R12 Installation on Windows 2003  Error

    pl help me when post-install checks HTTP checking URL = http://jarry.cppw.com:8000 RW-50015: Error: - HTTP Listener is not responding. The service might not have started on the port yet. Please check the service and use the retry button. Help Page ch

  • Access Denied error when copying Lead conversion layout

    Hi.. I wanted to mark as default the following: -Create new account. -Create new contact -Create new opportunity when converting a lead. For this porpuse I tried to copy the "Standard Lead Conversion Layout" and take out the other options. In the fir

  • ITunes 11 and Photoshop Elements 11

    I have a PC and I used Photoshop Elements 9.0 which used to work fine with iTunes. I was able to sync my albums to my iPhone and iPad thru iTunes.  I installed Photoshop Elements 11 and uninstalled Photoshop Elements 9.0.  The photos are not being up