Check several choices and limit box

Hello

I created a quiz on as3. This is the code I used for radioboxes:

var quizscore = 0;  score. "" Text = quizscore + "";

var group1:RadioButtonGroup = new RadioButtonGroup ("question1");

A1. Group = a2.group = a3.group = a4.group is group1;.

submit_btn.addEventListener (MouseEvent.CLICK, myquiz)

myquiz function (event: MouseEvent): void {}

If (group1.selection.label == "Correct answer") {quizscore += 10;}  nextFrame(); }

else {nextFrame() ;}

}

A multiple choice question so I want to use the checkboxes. can I use the same type of method for checkboxes?

That is to say. If the value of the selected box is 'this' and then add 10 points. This question has two answers; have I can limit how many checkboxes are checked before they reach submit it?

can anyone help?

Thanks much :))

Since you use frames as the mechanism to change the quiz, the scripts on each image can mutate a little to treat each question easily.

In each script of frames, you can decide what values are correct for this image and use the existing logic you use to determine if something is correct. Using the property selected box will tell you that are selected in order to compare that to the right answer, for example:

If ((checkbox1.selected && checkbox2.selected && checkbox999.selected))

{

OK, what you want

} else {}

incorrect, do something else

}

There is on the other side as well, you usually want to check that some boxes are not checked (wrong answers), then just add! in front, for example: if (checkbox1.selected &! checkbox2.selected) {/ / 1 is selected, 2 is not}... If you have a few questions with 20 possible responses the strategy is not elegant then mention if you do.

Limiting the number of checkboxes that can be archived is possible in a variety of ways. The simplest is telling the user how much can be verified, which allows them to check that a lot as they want and the submission of the response, check the number of responses is within your limits. It is not the best way, but it is easier. Literally just loop through boxes and County. If you name the answer with a number boxes (checkbox1, checkbox2,... checkbox99) you can even browse them in this way, for example:

define a range of 1-3 answers

function checkAnswers(e:MouseEvent):void

{

response range

var minAnswers:int = 1;

var maxAnswers:int = 3;

detected number as selected

var selectedAnswers = 0;

total number of checkboxes for that matter (checkbox1, checbox2,... checkbox20)

var totalCheckboxes:int = 5;

for (var checkboxNumber:int = 1; checkboxNumber<= totalcheckboxes;="">

{

If (this ["checkbox" + checkboxNumber] .selected is true)

{

increment the selected answers

selectedAnswers ++;

}

}

a simple check because if it is in the range

If (selectedAnswers > = minAnswers & selectedAnswers)<=>

{

number is located, continue

}

on the other

{

out of reach, warn the user on the number of responses

}

}

When they click on which key you have you can have the Manager to do what he does and also to trigger this function...

myButton.addEventListener (MouseEvent.CLICK, checkAnswers);

There are ways much cleaner to do, but because the question is basic I give you just a simple way to manage the solution. If you are a lot more in the script and the reusability I can suggest other ways, but as they are less painful, they are more complicated.

Tags: Adobe Animate

Similar Questions

  • You just bought a MacBook Pro 13 "retina. A check of SN and he says initially 2015 but box has a label saying 23.9.2015. A black buy Friday save £100, but that should have is not the latest model. It's going to be as good as the last model?

    You just bought a MacBook Pro 13 "retina. A check of SN and he says initially 2015 but box has a label saying 23.9.2015. A black buy Friday save £100, but that should have is not the latest model. It's going to be as good as the last model? J

    Early 2015 is the current model for a 13 "MacBook Pro retina. See the list in the way to identify the MacBook Pro - Apple Support models

  • I Net Nanny parental control installed on my pc and limit myself to give my child access to his Hotmail account to check emails.

    original title: hotmail servers

    Hello

    I Net Nanny parental control installed on my pc and limit myself to give my child access to his Hotmail account to check emails.

    There is an option in Net Nanny (NN) to allow only Web sites, but I have trouble understanding exactly what servers Hotmail uses to run.

    Furthermore, I feel that some server addresses change over time. Is this true? If this is not the case, can you let me know which servers should I use to get a permanent solution for the NN filter.

    Thank you

    Neville

    After all the Hotmail issues in the appropriate forum found here:
    http://windowslivehelp.com/

  • Windows 7 64 bit worked very well and when was time to save I get the cyclic redundancy check, I try several times and made the same thing I need help please

    worked very well and when was time to save I get the cyclic redundancy check, I try several times and made the same thing I need help please

    Hello Hans,.

    Thanks for choosing Microsoft Community!

    According to the description of the problem, you have problems when you use the backup on Windows 8 feature.

    Please answer these questions to better understand the issue and help you:

    1. are - what you're talking to backup and restore functionality on Windows 7?

    2 have you made any changes to the computer before the show?

    It is perhaps to cause bad sectors on the hard drive, run the disk check to repair bad sectors

    Check your hard drive for errors:

    http://Windows.Microsoft.com/en-us/Windows7/check-your-hard-disk-for-errors

    Important: Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data can be lost.

    For more information:

    Backup and restore: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows7/back-up-and-restore-frequently-asked-questions

    Hope the helps of information. Don't answer if you need assistance, we will be happy to help you.

  • Try to install purchased box.  Alls well until the last window when this message appears. INCONSISTENCY IN THE DATABASE OF THE INSTALLER. RESTART YOUR COMPUTER AND INSTALL IT AGAIN. Fact as stated several times and redisplays but same message?

    Try to install purchased box.  Alls well until the last window when this message appears. INCONSISTENCY IN THE DATABASE OF THE INSTALLER. RESTART YOUR COMPUTER AND INSTALL IT AGAIN. Fact as stated several times and redisplays but same message?

    Run the cleanup tool and manually delete the caps.db file.

    Important directories | Error postal codes of Mylenium

    Use the CC cleaning tool to resolve installation problems. CC, CS3 - CS6

    When you reinstall, make sure that you run with user privileges sufficient and external tools like virus scanners do not interfere. This is why you have the question in the first place.

    Mylenium

  • Do not see "Show edit pins and check for selected mask overlay box" in LR

    Hi, for some reason any sign 'See change it pines and the box to see the selection mask Overlay' disappeared from the bottom of the screen of LR. I have Mac OS X and LR cc.

    Press T to show (and hide) the toolbar.

  • My guest user account has stopped working after the installation of several windows and IE9 updates.

    I recently installed several windows and IE9 updates. During the install IE9 I stopped the installation process, because it seemed that I had two IE9 installs go. I ended up cancelling the installation so IE9 has not installed. I tried to install IE9 again and this time I can't stop installation, and it has been successful. I checked the other user profiles to make sure that everything has been installed, and that's when I noticed that my guest account wasn't just all users accounts were working well.

    Whenever I try to open a program, for example: Internet explore, any Office program and even the calculator another window opens asking me to manually locate the file I'm looking for. I am able to locate the file and open it, but as soon as I close I can't reopen unless I have to manually search for the file. There is a checkbox indicating that it automatically uses this file with the program but I can't check the box (its in a light gray that I can't click on) and I don't want to manually search the file everytime I open a program. I tried using a restore point before updates, but which did not set can guest account everyone please help?

    [1] I need to correct me by declaring that the Mcafee subscription is 18 months and its due for renewal in June, then yes its still the preinstalled version.

    [2] will certainly be your advice on that. Should what drivers I roll back?

    [3] I thought to go on this forum first, but I chose it because the error occurred while I was updating, but I'll post my question it too

    A1A. Ah! The application is named McAfee Security Center by chance?

    A1B. Do you plan to purchase a subscription for this or any other McAfee application (which you would need to do so BEFORE the expiry of 18 months 'advance')?

    A2. In re the restore drivers, you restore the drivers that you have installed via Windows Update. that is, Intel G45/G43 Express Chipset (graphics driver or screen) and Realtek PCIe GBE Family Controller (NIC driver). Again, this is a long shot.

    A3. Please do that start new thread immediately.

  • When an image is in several catalogs and I make a change to it in a cat it is not recognized by other

    Now that I'm on a Mac, it seems that when an image is in several catalogs and I make a change to it in a cat it is not recognized by the other.  Everything was stored in an attached file on the PC. The Mac version does not seem to do that. Is there a work around for this? Last thing I want to do, is work on an image in LR and find all of this work is to specific catalog.

    Check the option in the settings dialog box of the LR catalog for "automatic writing changes to XMP. This way all of your actual changes are written in an XMP Sidecar file and can be read by other catalogs, you could use.

    But ultimately you do yourself a favor by using more than one catalog. The whole point behind LR is to have all the images in one catalog on your main computer. Of course, it is find to use one second, another catalog on another computer, such as a laptop, you take on the twigs and then merge this another catalog in your main catalog when you return from the shoot.

    Import of catalog "Julieanne Kost's Blog

    Export a catalog | Adobe Photoshop Lightroom CC tutorials

    And the series by Julieanne Kost.

    Julieanne Kost, Director Digital Imaging Evangelist, Adobe Systems, Inc.

  • How to insert a line checked several

    Hi friends,

    IM facing a scenario. Let me explain.

    I have a page with a report and a button (these two in a homepage).

    I have a tabular presentation based on a table that opens in a pop-up window by pressing a button located on the home page. In this sick in tabular form be select several lines and if I press Add button in the pop - up, then all the lines checked must insert in the table report located in the home page.

    How can I achieve this.

    Can someone help me with this problem.

    Brgds,
    Mini

    Mini,

    I've updated my example for you.

    There are several ways to accomplish what you're looking for, here are two options:
    1. make an ajax call on beforerefresh pop-up report.
    2 persists the values checked in a page element and use it instead of an array.

    In my example, I used the second option. Instead of using an item hidden, I used a text field you can see the selected values. Here are the changes I made:

    1. Add a new region and an article about her, I called my article "P33_SELECTED_WIDGETS".
    2. in the declarations of global variables in your definition of the page, add the following text:

        var pkArray = [];
    

    3. change the report query to refer to the element on the page and ensure that the State of the check box reflects the values that you have seaved in your page element.

    select
        SEQ,
        APEX_ITEM.CHECKBOX2(
          2,
          SEQ,
          'class="pk-selector" ' || SEQ_CHECK
        ) SEQ_CHECK,
        NAME,
        READY_DATE,
        COMMENTS
      from(
          select
              SEQ,
              case
                 when instr(':' || :P33_SELECTED_WIDGETS || ':',
                            ':' || SEQ || ':') > 0 then
                     'checked="checked"'
                 else ''
              end SEQ_CHECK,
              NAME,
              READY_DATE,
              COMMENTS
            from widgets_broken
    )
    

    4. create a dynamic action to manage the persistence the checked values.

    * Name: * bind_click_handler
    * Event: * after refresh
    * Type selection *: region
    * Region: *
    Real actions:
    * Seq *: 10
    * Fire on Page Load *: Yes
    * Execute JavaScript Code *:

    $('.pk-selector').bind('click',function(){
      $this = $(this);
      var checkVal = $this.val();
    
      if($this.prop("checked")){
        pkArray.push(checkVal); //save checked value
      }else{
        pkArray.splice( $.inArray(checkVal, pkArray), 1 ); //remove unchecked value
      }
      $s('P33_SELECTED_WIDGETS',pkArray.join(':')); //update page item with new values
    });
    

    Edit
    I left a decisive step. In your background report, ensure that this partial page refresh is enabled and P33_SELECTED_WIDGETS builds page elements to present the attribute.

    Finally, change the proceudure files add to refer to the page instead of globl table element.

    BEGIN
    
        insert into widgets(NAME,READY_DATE,COMMENTS)
        select name, ready_date, comments
          from widgets_broken
         where instr(':' || :P33_SELECTED_WIDGETS || ':', ':' || SEQ || ':') > 0;
    
        delete from widgets_broken
          where instr(':' || :P33_SELECTED_WIDGETS || ':', ':' || SEQ || ':') > 0;
    
        :P33_REC_CNT := SQL%ROWCOUNT;
    END;
    

    See you soon,.
    Janet Tyson

    Published by: Tyson Janet January 3, 2012 13:13

  • When you try to download Firefox. I click on Run and a box pops up and says 0% and then extracting more nothing... no download no other pop ups

    I tried to download Firefox several times. I have windows 8. When I click Start the download and the box downstairs comes up and asks if I want to run, save or cancel. I click on run. The next area that appears is a time bar as pop-up that says 0% extracting... never none goes further. This area stays on the screen for a few seconds then nothing. There are no more pop, Firefox is not the cases that are on the computer. Any ideas on a step I have to take for it to download completely.

    Make sure you use the official mozilla site (or http://www.getfirefox.com/) by your download.

    You may temporarily need to turn security software before install Firefox.

    See the installation instructions:

    You can try first to use the option to save the Setup program file that you download instead of run. Try to run it once it is downloaded to your computer, but make sure that the computer is connected to the internet.

  • I have Firefox 10.0.1 for several days, and I lost all the favicons on my favorites. I thought that this problem has been fixed in V 10. Someone at - it a solution?.

    I have a pc running Windows 7 64 bit. I have the latest Firefox V 10.0.1, automatically updated several days ago. Everything was fine until about an hour before, when I launched Firefox and all the Favicons for my favorites are blank dotted squares. I checked this forum and found that this problem should be fixed at 10 V. well, he's back.

    What is the solution?

    I can understand why the favicons have been lost. Earlier today, I ran the story of Vipre Antivirus to address another question I've had. Who may have somehow caused the favicons to clear.

    Thanks cor - el for your suggestion. I ran of CheckPlaces and selected 'Reload favicons. He charged more, but not all. I also discovered that just open the bookmark, the favicon for the site gets reloaded. So those CheckPlaces cannot charge, I can recharge by simply opening the bookmark.

    Maybe someone can explain to me why the history cleaner wiped out the first bookmark favicons.

  • Laptop of HP ENVY m6: busy cursor and dialog boxes flicker

    Hi there, I downloaded Windows 8.1 10 last night but since then have had problems with the constantly busy cursor (sparkles the blue circle and turn off quickly), as well as with selected dialogs flicker. I checked with the Task Manager, but can't find anything that could potentially cause the problem. It is interesting on an attempt, the pitcher kept taskbar icon flashing in the taskbar. I have attatched a screenshot of a paused task manager as programs keep fast switching, it is therefore difficult to assess where the problem may come from. I rebooted several times and reinstalled AVG a couple of times I've heard that could potentially cause problems. I also tried to install a new graphics driver, but who worked for apparently without success. In addition, Windows repeats that she is perfectly up-to-date and solves no problem.

    How can I solve this problem? I can't understand what my computer tries / load.

    Thanks in advance.

    Spoiler (Highlight to read)

     
  • If I have several fields and if I select a field in a drop-down list it will fill the other fields

    If I have several fields and if I select a field in a drop box is it possible to auto poplulate the other fields.

    Thank you

    Brain

    Please post your question on InfoPath 2010 at the following link

    http://social.technet.Microsoft.com/forums/en-us/sharepoint2010customization/thread/e70c23a9-1b68-4EF9-9FB4-923997043e56/

  • Stopped my Norton Ghost and Norton checked my computer and found that my Vista Premium do not have or plug and play services event log

    original title: journal of events in Vista Premium

    I had to reinstall Vista after a hard disk failure. My Norton Ghost stopped and Norton checked my computer and found that my Vista Premium do not have or plug and play services event log.
    Do you know how I can get them?

    The event log service will not start. I tried manually, start it and get this message.

    Windows could not start the service on the Local computer Windows event log.
    Error 998:Invalid access to memory location.

    I don't understand why it happened all of a sudden. Does anyone have an idea how I can get going again.

    Hello

    Method 1:

    Event Viewer services are - primary (Windows event log) it has no dependencies, but is dependent on the Scheduler of tasks and Windows event collector.

    Click on start and type Services) in the search box

    (b) right click on the list of programs services and selecting run as administrator

    (c) locate the services listed above and check if they are started.

    Method 2: How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

    http://support.Microsoft.com/kb/929833

  • VERY small fonts after update in some message windows and text boxes

    After I downloaded an update, there was a problem with the small text in some programs, for example and the boxes in Yahoo messenger, the popular I talk with texts are VERY small. When I go to stop, in the dialog box, the text is VERY small. Need a fix.

     

    http://www.bleepingcomputer.com/tutorials/tutorial140.html

    Understand the Extras in Windows Vista and Windows Update info is at the link above.

     

    Remove the Vista updates; two ways to do this:

    1. a System Restore to before the updates:

    Click Start > programs > Accessories > system tools > System Restore > restore time/choose your own date > next

    If you use Norton, disable it before using the system restore.

    If it is impossible to enter the Normal Mode, do a Safe Mode system restore:

    Press F8 at the startup/power and the list of startup options, use THE ARROW key to select Safe mode > and then press ENTER.

    System restore steps according to the info above.

    Also:

    2. click on start > right click on computer > properties > Windows updates down the lower left corner > updates installed in the lower left corner in the next window

    > then click the one that you don't want > uninstall will appear at the top > uninstall it.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In addition, on the page where you clicked "Installed updates", click on change settings at the top left corner it

    > Change update settings in the next page of AutoUpdate to "check for updates but let me choose etc" > OK ".

    When you take a look at pending updates, you can either download/install them one at the time, namely the update causing you problems.

    > or if you do not need an individual > right-click on > UAC prompt > hide it

    See you soon.

    Mick Murphy - Microsoft partner

Maybe you are looking for

  • Satellite Pro L20 PSL2YE: 1 GB Ram upgrade does not show in the Bios

    I just bought a 1 GB mem stick samsung 4200 s 533 mhz for my L20.It does not show in the Bios or in the main menu in Device Manager, but it shows in cpu - z and pz Assistant 2007. I am very confused, and upgrade the bios on toshibas website does not

  • 4313 Broadcom drivers for Windows XP

    Hello I have a HP Mini 210-2002ed with windows xp on it yesterday, sience But none of the broadcom drivers are working, and my LAN port is broken, Could someone help me get this to work? Thank you very much! Best regards, Sander.

  • I have two sound cards. Can I use the input to the output to another?

    Basiclly the problem I have is that I use one of my as a configuration of 5.1 sound cards speakers (I put the MIC and line as output) and I found another sound card in another PC. The question that I have, that now I'm not a line or a microphone avai

  • Windows Vista cannot find any networks - please help!

    On my laptop Windows Vista comes preinstalled and can have no problem finding networks. I also have Ubuntu on my laptop and it is detects networks easily. I was told it might be the driver... However, I don't know where to find the latest drivers for

  • The difference between ONS - SC - 2 G and DWDM-SFP

    Our datacenter needs summary 6 wavelength of the sub-centres of data. All sub - DCs should contact our domain controller. We have 6509E, 15216 MUX/DEMUX and 15454-SA-HD =. List of wavelength: DWDM SFP 1535.04 nm SFP (100 GHz ITU grid) DWDM SFP 1534.2