Unselecting checkbox not making answer disappear

Hi all
I almost have this bit of code working how i want it too, but just have one query. i would just like to set it up so that if a user unchecks the checkbox the answer disappears, at the momment the answer does disappear if you check another checkbox, which is fine, but if a user unselects a checkbox, so there are no checkboxes selected then there should be no answer being shown.
Hope this makes sense and that someone can help
Thanks
See code below
checkBox1a.selected = false;
ans1 = 0;
var checkboxListener:Object = new Object();
checkboxListener.click = function(evt_obj:Object) {
if (evt_obj.target.selected) {
  //evt_obj.target.label = "Selected!";
  checkBox1b.selected = false;
  checkBox1c.selected = false;
  checkbox1d.selected = false;
  ans1 = 0;
  trace(ans1);
  txtOutput.text="No it's the wrong Answer!";
} else {
  //evt_obj.target.label = "Unselected!";
  ans1 = 0;
  trace(ans1);
checkBox1a.addEventListener("click", checkboxListener);
checkBox1b.selected = false;
ans1 = 0;
var checkboxListener:Object = new Object();
checkboxListener.click = function(evt_obj:Object) {
if (evt_obj.target.selected) {
  checkBox1a.selected = false;
  checkBox1c.selected = false;
  checkbox1d.selected = false;
  //evt_obj.target.label = "Selected!";
  ans1 = 1;
  trace(ans1);
  txtOutput.text="Brilliant You got the Right Answer!";
} else {
  //evt_obj.target.label = "Unselected!";
  ans1 = 0;
  trace(ans1);
checkBox1b.addEventListener("click", checkboxListener);

You are creating/duplicating code that won't work for you.  You can only have one listener by that variable name, and you can combine the listener functions into one... the following would replace all of your code.
checkBox1a.selected = false;
ans1 = 0;
var checkboxListener:Object = new Object();
checkboxListener.click = function(evt_obj:Object) {
if (evt_obj.target.selected) {
  checkBox1a.selected = false;
  checkBox1b.selected = false;
  checkBox1c.selected = false;
  checkBox1d.selected = false;
  evt_obj.target.selected = true;
  if(evt_obj.target != checkBox1b){
     txtOutput.text="No it's the wrong Answer!";
     ans1 = 0;
  } else {
     txtOutput.text="Brilliant You got the Right Answer!";  
     ans1 = 1;
} else {
  ans1 = 0;
// here is where you will do whatever you are calling "making answer disappear"
checkBox1a.addEventListener("click", checkboxListener);
checkBox1b.addEventListener("click", checkboxListener);
checkBox1c.addEventListener("click", checkboxListener);
checkBox1d.addEventListener("click", checkboxListener);

Similar Messages

  • Why is iMessage taking my incoming emails and then not making them available for my PC to get?  Why can I not send a text msg with photos when iMessage is turned off (but MMS is still on).

    Apple is great!
    Why is iMessage taking my incoming emails and then not making them available for my PC to get?  Why can I not send a text msg with photos when iMessage is turned off (but MMS is still on).
    I compose an iMessage with the destination as my email address and I attach 2 photos I want on my PC.  I send them several times from my iPhone 5C but they never arrive. I look at my ipad later and realize that it's iMessage app is getting ( and swallowing) these emails. I then turn the ipad off.  Still can't get the photos through because iphone is now getting them on it's iMessage.  I turn off the iMessage feature and try to send photos from text msging.  Phone tells me it can't send photos unless iMessage it turned on.  What happened to regular MMS text messaging?  I go and try to send photos as an email attachment and see that there is no option to attach from the stupid email program.  I look up online to learn about the brave new world of apple attachments and send them.
    Why is iMessage taking my incoming emails and then not making them available for my PC to get?
    The email program on my iphone is not configured to remove messages from the server.
    If iMessage is turned off I don't have the issue.
    Why can I not send a text msg with photos when iMessage is turned off (but MMS is still on).

    Did not work. I've selected iMessage to ON and left it. After a few hours I recieved a message "activation unsuccessful. Turn on iMessage to try again". This has been going on for the past 3 days.

  • Event entered on iPhone not making it to mobileme and iCal

    Since the 2.1 update, events entered in my iphone are not making it to mobileme or my laptop. Nor is it going the other way (laptop to me and iphone.) Any suggestions appreciated.

    Just deleted the account on my iphone and set it up and it seems to be working again. Also got all my ical colors correct across the 3 platforms.

  • Its Been asked 1000 times b4 but its just not making sense.......

    I have just completed a track containing about 24 tracks all together.
    I have just started making a new track, with about 5 audio tracks and 3 midi tracks running, and i keep getting that annoying core audio error msg -
    Disk is too slow or
    System Overload.
    (-10010)
    Its not making any sense cos the track i just completed didnt have these problems
    I'm running G5 2.3ghz with 1.5ram.
    Ive read through other posts about this but they all seem to say check your energy saver options, but those settings have always been how they should be.
    Can anyone help, or suggest another trick to sort this out. Why all of a sudden is all my memory being eaten up???

    One other thought is fragmentation. If you record and erase a whole lot, then your files could be fragmented, which would affect performance. There are defragmenting programs, which I have never used, available such as Norton Utilities. What I do is after a project. Say an album. I back up my work on DVD, then reformat my Audio drives. You can try that if you suspect your disk. Save your work on DVD, or another drive. Erase the disk, then put your files back to that drive. It should assemble the files continuously. You will have to re assign your record path after doing this, since the song is moved from its former "address". In older versions of Logic, you had to "search for the missing files" which the machine would do at the click of a button, but now it seems to locate them automatically without this step. Only the record path must be reset. OR If your disk is nearly full, I understand that the disk has poorer performance along the outer edge. Finally, if you are playing back samples from say, a program that uses Disk streaming, and if those sample files are located on your system disk, or I suppose even on your Audio disk, that could be creating an exhausting work load. If this is the case, you should store such samples on a separate, dedicated Hard drive of their own.

  • HT4085 Some videos that are taken with my iphone's camera are not making sounds, this problem occured today to all videos i record, please help

    Some videos that are taken with my iphone's camera are not making sounds, this problem occured today to all videos i recorded starting from today, please help

    It also takes time for the photos to be transferred out of your iPhone and into Photo stream on Apple's iCloud servers.
    Note that this can't happen if your iPhone is not connected to a WiFi network:
    When you enable My Photo Stream on your devices, all new photos you take or import to those devices will be automatically added to your photo stream.
    iOS devices: New photos you take are automatically uploaded to your photo stream when you leave the Camera app and are connected to Wi-Fi. My Photo Stream does not push photos over cellular connections.
    Macs: Any new photos you import to iPhoto or Aperture begin uploading automatically when you have a Wi-Fi or Ethernet connection. Or you can change your iPhoto or Aperture preferences so that only photos you manually add to My Photo Stream are uploaded.
    PC with iCloud Control Panel 2.0 or later: Open a Windows Explorer window and under Favorites select iCloud Photos if you are using iCloud Control Panel 3.0 (or Photo Stream if you are using 2.0 to 2.1.2). Open My Photo Stream. Click the "Add photos" button. Select the photos to import to My Photo Stream, then click Open.
    from here: http://support.apple.com/kb/ht4106

  • Hi everyone. I have just started having problems with iCal.  Events that I thought I had deleted are appearing on Print Preview and on print outs. Likewise Events which I have not deleted have disappeared from my calenders, but appear in print preview.

    Hi everybody. I have recently started having problems with iCal (Version 2.05 (1069). Events that I thought I had deleted appear in Print Preview and Print Outs. Likewise Events that I have not deleted have disappeared from my calender (Month View) but appear in Print Preview and Print Outs. I see that there have been similar problems with Events disappearing especially in Month View. I wondered how print preview seemrd to be picking everything up deleted or not, and what the solution may be?. First time of Posting. I hope I haven't embarassed myself.

    Hmmmm.
    At the very least there must be a "com.apple.ical.plist"...iCal would not function without it.
    Click on the Finder icon in the dock
    Click on Go > Home
    Double-click Library
    Double-click Preferences
    Look for a file called "com.apple.ical.plist" and remove it to the trash.

  • IPad is not making any sound

    iPad is not making any sound when typing, watching video from YouTube and video from cameroll. I don't even hear when I receive notification. My mom and dad has the same problem on their iPhone 4s. My mom when to apple store to replace for a new phone but do I have to go to the apple store to replace it too? I also tried a restore but it did not work. Please answer!
    Thank you

    DISCONNECT BLUETOOTH.
    After doing all the ridiculous resetting and changing/checking the settings by the advice given on these forums and on YouTube, I finally discovered that if you have your apple device connected to any other device by bluetooth you will not get any audio but by the device it's connected to. How un-awesome is that? Ive always been used to how my android devices work with Bluetooth which is when the system you're connected to is off or in a different mode, you still have audio. That makes perfect sense and is convenient, right? But I thought my brand new ipad was busted when I connected to my entertainment system by Bluetooth and haven't been getting any audio the last few weeks. So basically I need to go into settings every stinking time if I want to hear my game or show my wife a YouTube video. Regretting ever got this overpriced tablet...

  • HT1725 music download seems to be stuck, not making progress

    music downloads seem to be stuck, not making progress

    I'd report the problem to the iTunes Store, then.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the item, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.

  • HT3702 I continue to be charged on my credit card for purchases I am not making on itunes. I have switched credit cards and this contines to happen. I have reported the problem on each specific purchase. What else do I do?

    I continue to get charged on my credit for purchases I am not making on itunes. They are all small purchases such as $4.99, $1.99, $6.99 but have added to almost $300 in total. I keep clicking on them as report a problem. I have switched credit cards but this continues to happen. What do I do? Seems like there is no number to call. Wish I could talk to a person rather than trying to navigate this through the internet.

    How are they showing up on your account e.g. are they auto-renewing subscriptions that you haven't stopped : http://support.apple.com/kb/HT4098
    Does anyone else have access to your account and/or devices that might be making them ?
    If you can't work out where they are coming from then you could contact iTunes support and ask them for help (we are fellow users here on these forums) : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
    If they aren't showing on your account's purchase history then you should also contact your card issuer.

  • IPad is not making any sounds except for itunes, Pandora and Netflix. Need help.

    From one day to another the iPad is not making any sounds (lock, keyboard, games) except for music on iTunes, Pandora and video on Netflix. All sounds are activated on the iPad's general settings. I have synced it and updated the OS to no avail. Any help or suggestions is gratly appreciated.

    If you lose sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds have been muted.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the task bar. Double tap the home button and in the task bar at the bottom, swipe all the way to the right. The speaker icon is all the way to the left. Tap on it and system sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock rotation can be accessed via the task bar in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085

  • Text suggestions not showing up/disappearing

    I mainly use three languages (German, French, English) when typing messages in my Lumia 535. Where "text suggestions" show up in French and English all the time, in German, they do not show up/disappear after typing and sending two or three messages so that I have to bring them back by going to Settings/Keyboard/German/Suggest text. What could be the reason for this strange behavior?

    Hi, lonza. Thanks for your response. Try checking if there is any update available for the phone's system apps. Go to Store > ... > settings > check for updates. If this did not help, try resetting your phone by going to Settings > about > reset your phone. Back up your files before doing it. Hope this one helps. 

  • HT201210 my notes have been disappearing

    my notes have been disappearing since I updated my iOS

    Using iCloud ?
    Tap Settings > iCloud
    Switch Notes off then back on.
    Give iCloud a few minutes to sync the data.
    If that didn't help, you can restore from a backup >  iOS: How to back up and restore your content

  • HT1535 I was syncing my notes and they disappeared from ipad and now I can't find them on my pc.

    I was syncing my notes and they disappeared from IPAD and now I can't find them.  Where or how can I retrieve them?

    Try Music App>Others

  • SAP not making Controlling Document at the time of MIRO

    Dear Guru!
    I have a very peculiar problem which I believe is an error in SAP.
    My problem is that at the time of implemenation of MM the company doesnt have a store. so company ask the consultant to override GRN process and process everything through invoice and all the stock will be charged out to a cost center.
    Now when the invoice of Cost Center (MIRO w/o GRN) is process, SAP doesnt create a controlling document and because there is no controlling document, the company cannot get the cost wise detail.
    Now my question is, if I cannot get a cost center wise data, how can I get that entry. Can I do any entry to get that data or what should be a solution I can tell to my company.
    Regards
    Shah

    Hi,
    First of all the Controlling Mudule have to be activated. Now you are charging all your stock to cost center, so first of all you will have to use the Account Assignment Category K in Purchase Order. Yoou will also have to configure the Account Assignment Category in configuration. You can configure it via OME9. In this setting, Set the only Invoice Reciept Indicator, because you are not making MIGO Docs.
    Now another condition is, you will have to charge all your stock to particular one GL Account so you will make the Cost Element for that GL as Cost Element Category 1. Now that Cost Element have to be assigned to OKB9 and cost center will be assigned there. Do not tick Profitibilty Segment because you are not going to create the document for COPA. So this is the general configuration for Creating CO Document.
    Main thing is, you must check the Controlling Area Settings twise.
    I hope it found useful to you.
    Regards,
    Jigar

  • Making simple Cross desolves at the end of still photo clips from my library. Not making a clean disolve beteen. Single frames from the previous clip are flashing half way through the desolve. Did both a drag and drop and insert disolve.

    Making simple cross desolves at the end of still photo clips from my library.
    Not making a clean disolve between clips.
    Single frames from the previous clip are flashing half way through the desolve.
    Did both a drag and drop and insert disolve.

    Making simple cross desolves at the end of still photo clips from my library.
    Not making a clean disolve between clips.
    Single frames from the previous clip are flashing half way through the desolve.
    Did both a drag and drop and insert disolve.

Maybe you are looking for

  • Calculated Column with Null date end result needs to be text.

    Good Morning, I am using SharePoint 2010 and am trying to create a calculated column converting a date/time column to to show just a month and day.  Calculation is =TEXT([Anniversary],"m/d") This is to enable sorting on the month.  And this works fin

  • Can connect to Internet, but not router.

    I know, this is the opposite problem from what most people have. I am trying to connect through a WRT54G v.6 to the ethernet port in the wall (I don't know what the building is hooked up to, we just have ethernet ports next to our cable jacks). If I

  • Is It Normal? I have order 3/06/10 ipad 16gb 3g, and still nothing!..

    Hello, is it normal to wait so much for get ipad 16gb 3g?? almost 1 month.. and even no information about when i will get it, i live in italy and did the order in data trade of rimini, they still dont know when i will get it! Someone can tell me if i

  • S-video 16:9 display

    I have a new Mac mini (2GHz Core 2 Duo) connected to a standard-resolution widescreen Sony TV using the Apple S-video adapter. It only offers me 4:3 ratio resolutions (such as 800x600, 1024x768), whereas if I connect my MacBook Pro using the same ada

  • Just bought myself a JamPack and would like some advice on installing...

    In the form of the Symphony JamPack. It was quite a fleeting idea, and I just went in and picked it up from the Apple Store. I see it needs 10 GB... This is just for my MacBook, so really just for self amusement, and I'm running lowish on HD space. I