addEventListener for checkbox

Hello

I have a checkbox. I want to set up an eventListener for her.

It works:

cb.onClick = function()

{

Alert ("clicked");

}

Do not do this:

cb.addEventListener ("click", cbClick);

function cbClick()

{

Alert ("clicked");

}

Why not? I used the method addEventListener for many other components.

Thank you

Jakob

'click' is the correct word, but since the CC versions, everything that has a similar behavior to a button (with or without value, IE buttons of base, iconbuttons, checkboxes, radio buttons, etc.) do not meet the events 'mouseup' and 'click '. Only mousedown, mouseover, or mouseout/mouseouthandler() for this type of widgets. It has been disabled in silent mode.

Xavier

Tags: After Effects

Similar Questions

  • Record the value for checkboxes deselected in interactive report

    Hello.

    We have an interactive relationship with checkbox column.

    Created under APEX_ITEM. CHECKBOX2...

    Check box is selected, if the database column element value is 1 or disabled if the value is 0.

    Users can also check boxes for all the lines they want and save the changed check box.

    Save us the value with the process as... BECAUSE me in 1... apex_application.g_f09. COUNTY...

    and update the value 1 in the database.

    Now the question.

    Is it possible to uncheck the checked value and update the value of database to 0?

    1 line FOR i... apex_application.g_f09. COUNTY counties only checked checboxes.

    How can we determine the lines where unchecked and update the value of database?

    the reason is, that users want to use interactive report already in use and not of new application, in the form of new.

    Thank you.

    Concerning

    Hi DejanH,

    Yes it is possible. Please read my blog on how to do this:

    http://blog.iAdvise.EU/2013/06/12/checkboxes-in-editable-reports-in-apex/

    Kind regards

    Joni

  • using addEventListener for Enter and Exit frame

    Hi, sometimes I want to define a function in a specific picture in the start menu and leave this frame
    for example I have Flv player into 20 frame, I have the background sound (mp3 player), so I want when swf is in this framework that my sound goes off and when he leave and go to an other images, the sound played once again...
    I put the script in frame 20:
    addEventListener(Event.ENTER_FRAME,enterfunc);
     
    function enterfunc(e:Event):void {
        trace("I started");
    }
     
     
    addEventListener(Event.EXIT_FRAME,exitfunc);
     
    function exitfunc(e:Event):void {
        trace("will Exit");
    }
    
    but after test movie I see that I started and will exit short Repeatly without a showdown!
    Notice: first of all, I put my sndChannel = soundClip.play; and sndChannel = soundClip.stop;  but my music runs several times and finally hung my system and I need to restart so I use trace to see

    So what is a problem?  Please spend some time and help me

    because their names are misleading.  Event.EXIT_FRAME does not execute once when the playback head leaves a frame.  It runs several times.

    Similarly, Event.ENTER_FRAME does not execute once when the playhead in one frame.  It runs several times.

    You can run a function when the playhead passes a a frame by adding a function to the framework call:

    f() ;  attached to a frame will call the function f when the playhead enters that frame.  and there are other ways to do this.

    You can run a function when a read head there is a frame by invalidating the scene and using a rendering event when a goto is executed:

    internship. Invalidate();

    this.addEventListener (Event.RENDER, exitingF);

    this.gotoAndPlay ('whatever');

    function exitingF(e:Event):void {}

    This code runs when you exit this frame and "all that" is rendered (displayed =);

    }

  • Need help change fill color for checkbox to verify / unchecked

    Is it possible to change the fill color of a checkbox to a different color when someone check?

    Right now I have a check mark as X, but I was invited to see if we can also change the fill color when it is toggled checked/unchecked.

    I played with a few scripts, but nothing I tried works (and I'm super green to Javascript).

    Sure. In the event mouse to the top of a box to check, do something like:

    // Mouse Up script for check box
    if (event.target.value === "Off") {
        event.target.fillColor = color.red;
    } else {
        event.target.fillColor = color.green;
    }
    

    This can be simplified to just:

    event.target.fillColor = event.target.value === "Off" ? color.red : color.green;
    
  • addEventListener for later

    I'm doing a subclass of flash.display.Loader, who should do something when the charger is finished loading the content.

    So, I do addEventListener (Event.COMPLETE, onComplete) on my subclass of loader.

    But this Eventlistener is never called. If it's supposed to happen? I can't use an Eventlistener on the class that dispatches the event?

    My code looks like this:

    public class MyLoader
    {
    public function MyLoader() 
         {
              super();
                   
                   //addEventListener(Event.INIT, onComplete);
         }
         
         override public function load(request:URLRequest, context:LoaderContext = null):void
         {
              super.load(request, context);
              addEventListener(Event.INIT, onComplete);
         }
         
         protected function onComplete(ev:Event):void
         {
              trace("loading complete");
         }
    }
    

    I tried both to add my Eventlistener depending on the load and in the constructor, the two doesn't work, my onComplete function is never called.

    An Eventlistener that I add outside of class (var loader: MyLoader = new MyLoader; loader.addEventListener (Event.INIT, onComplete)) is called without a problem.

    It should work like this? I can't listen for events on my own class?

    Property contentLoaderInfo the Loader class is what I use normally to follow events of charger.  Based on the documentation, the class Loader itself passes loading events.

    Loader.contentLoaderInfo.addEventListener (Event.COMPLETE, completeHandler);

  • g.clear () call to the method object refuses the development of drawing for checkbox

    Hello

    I have this custom field extend the CheckboxField, with him object method is overloaded as follows:

    protected void paint (Graphics g)
    {
    int bgColor = _fontStyle.getBackgroundColor ();
    If (bgColor! = - 1).
    {
    g.setBackgroundColor (_fontStyle.getBackgroundColor ());
    g.Clear ();
    }
    g.setColor (_fontStyle.getForegroundColor ());
    Super.Paint (g);
    }

    the _fontSytle is defined by the user and transmitted as a reference of custom style, everything works fine in a first time without g.clear (), but I soon found out when the background color is black, while the foreground is white, paint reverse color. So I added this g.clear () and the problem was solved.

    However, the compensation seems to graphics here refuses the development of drawing and I was not able to trace which is cleaned and what is the indicator for the development of design. BTW, the "g.isDrawingStyleSet (Graphics.DRAWSTYLE_FOCUS)" returns true.

    So I was wondering if anyone here can provide a diagnosis on what could be the cause and how to fix it. Thanks in advance.

    Christian

    Nope, the g.clear () must be called to display the colors correctly. As I said, it can work in some cases, but just mess up from time to time.

    So what I do now is take a workaround to override the drawFocus() as default

    protected void drawFocus(Graphics g, boolean on)
        {
            refreshFooter(on ? getLabel() : "");
            // customize draw focus logic here as the default one conflicts with the paint method
            XYRect rec = new XYRect();
            getFocusRect(rec);
            g.invert(rec);
        }
    

    Thus the development of drawing must rely on paint and so don't mess the color.

    In any case, thanks much for the reply!

  • Help with the JavaScript for checkbox

    I am a newbie with Javascript and will have questions, get the selection of a checkbox on my form to change a calculation.

    I have a form that contains two drop-down lists, the result of these two boxes are multiplied together.  I can get it works fine.

    However, I also have a box that, when checked I want the calculation according to the drop-down lists duplicate.  I can't get that part to work!

    Can anyone provide the javascript code to activate this simple event?

    Any help is appreciated.

    Thank you.

    It should look like this:

    Get field values

    var v1 = combo1.value;

    var v2 = combo2.value;

    $ var = + v1 + v2;

    Get the value of the checkbox

    var v3 = getField("checkbox1").value;

    Calculate the value of this field based on the State of the checkbox

    V3 = Event.Value = "Off"? sum: 2 * sum;

    This last line is equivalent to the following five lines:

    If (v3 = 'Off') {}

    Event.Value = sum;

    } else {}

    Event.value = 2 * sum;

    }

  • addEventListener for FLVPlayback, VideoError

    Hello

    I'm really stuck on finding a solution to detect a connection problem is present on the FLVPlayback component:

    If I try the following:

    V1.addEventListener (VideoError.NO_CONNECTION, sourceFailed);

    function sourceFailed (e:VideoError): void
    {
    var vError:uint = 1000;
    If (e == VideoError (vError))
    {
    trace ("3 - VideoError:" + e)
    }

    trace ("3B - VideoError:" + e)

    }

    I get the error: layer 'Scripts', image 1, scene 1, line 96 1067: Implicit coercion of a value of type uint to type String unrelated.

    can someone suggest a snipplet code that works?

    Thank you very much

    Use try)

  • form input type = checkbox works in all browsers but FF. WHY?

    I created a div containing box entries that work in all browsers except FF.

    FF reported "undefined" for checkboxes and stopped running Javascript.
    

    You have a problem with the boxes or the onclick code?

    A good place to ask questions and advice on web development is the forum mozillaZine evangelism/Web development Standards.

    Aid to this forum are better informed on issues related to web development.

    You must register on mozillaZine forum site to post in this forum.

    See http://forums.mozillazine.org/viewforum.php?f=25

    You must post a link to the website or by mail to the relevant parts of the code.

  • Remove the eventlistener for multiple movieclips in a table

    Hi all

    Game scenario:

    I do a crossing road learning alphabet game. In the first level there are 10 alphabets tell of A J (movieclips) stand on one side of the road in a mixed random way. The player must move the alphabets (using the keyboard commands) in alphabetical order, so that it strikes at the entrance of a kindergarten and is removed from the scene.

    Situation-problem:

    If you click on the correct alphabet the player gets a positive score. And if the wrong alphabet is cliked, a negative score is given. This works well for the first alphabet, but, once the first alphabet hits its target and is removed from the scene, it does not work for the next alphabet since removeEventListener to the case the first alphabet code continues to work for the continuous alphabets.

    For eg., once the first alphabet "letA" is removed from the scene, and then when I click on "Letbs" that gives a score to both positive and negative. Positive note, since it is the next alphabet that must be clicked. Negative note, since the "wrongClick" table contains the movieclip 'Letbs', although it was intended for the situation, when "letA" was also present on the stage.

    Code:

    var wrongClick:Array = new Array (Letbs, THG, letD, summer, fall, letG, letH, letI, letJ);

    for (var i = 0; i < wrongClick.length; i ++) {}

    wrongClick [i] .addEventListener (MouseEvent.MOUSE_DOWN, negScore);

    function negScore(e:MouseEvent):void {}

    gameScore += pointsForMiss; showGameScore();

    wrongClick [i] .removeEventListener (MouseEvent.MOUSE_DOWN, negScore);

    }

    }

    Requested solution:

    Can someone please tell me how I can write code that, once an alphabet is removed from the scene, the method addEventListener for above of movieclips is completely removed and a new addEventListener starts to work for the rest of the alphabet which remain on stage.

    thnx in advance

    Kind regards

    Ginette tabriz

    run this code:

    for (var i = 0; i)

    wrongClick [i]. delete EventListener (MouseEvent.MOUSE_DOWN, negScore);

    }

    When the correct letter is clicked.  That is to say, in the correct letter listener function.

  • Problem with the value of the checkbox and app.settings.getSetting)

    Hello everyone.

    I have a problem with is settings saved for checkbox.

    Saved settings does not apply on the value of the checkbox.

    It's strange, but it always 'true '.

    Here is piece of code:

    checkMe = 11;    //any value for the first time running
    
    
    if (app.settings.haveSetting("savea", "chck")) {                            
                          checkMe = app.settings.getSetting("savea", "chck");  // get saved value, else 11
                          alert("checkMe = "+checkMe)
                            }
                        if(checkMe == 11){
                            checkMe= false;   //if there is no saved settings, checkbox value will be false/ unchecked
                            alert("You run this script first time, so manual value will be 'false'")
                            }else{
                                checkMe = app.settings.getSetting("savea", "chck");     // if saved settings exist, get true or false
                            }
         alert("Yes, checkMe will = "+checkMe)        
        
        
    win.checkPanel.chkOne.value = checkMe;  /// checkbox value will equal saved checkMe
    
    var fff = win.checkPanel.chkOne.value;  // string for alert
     alert("aha! but checkbox value is  = " +fff+ "\n Why so?")     // here we`ve got always "true"
    
    
    
    
    win.checkPanel.chkOne.onClick  = function () {
            
        var path11 = win.checkPanel.chkOne.value;  //  checkbox value to variable
        app.settings.saveSetting("savea", "chck", path11);  //saving checkbox value
        alert("Saved this value - " + app.settings.getSetting("savea", "chck"))
              }
    
    

    win.checkPanel.chkOne.value is always true.

    Can anyone exmplain why and how to get rid of this static value?

    P.S. just in case, here's the complete code:

    function mainFun() 
    {
    
    
        this.windowRef = null;
    }
    
    
    
    
    mainFun.prototype.run = function()
    {
        
        /*----- UI -----*/
              var retval = true;
              var win = new Window("palette", "Check option", [150, 150, 460, 455]);
              this.windowRef = win;
    
    
        
              win.checkPanel = win.add("panel", [25, 150, 285, 265], "Checkbox");
              win.checkPanel.chkOne = win.checkPanel.add("checkbox", [10, 15, 125, 35], "Checkbox One");
              //win.checkPanel.chkTxtOne = win.checkPanel.add('edittext', [140, 15, 230, 35], '');
    
    
         win.quitBtn = win.add("button", [110,275,200,295], "Close");
    
    
    checkMe = 11;    //any value for the first time running
    
    
    if (app.settings.haveSetting("savea", "chck")) {                            
                          checkMe = app.settings.getSetting("savea", "chck");  // get saved value, else 11
                          alert("checkMe = "+checkMe)
                            }
                        if(checkMe == 11){
                            checkMe= false;   //if there is no saved settings, checkbox value will be false/ unchecked
                            alert("You run this script first time, so manual value will be 'false'")
                            }else{
                                checkMe = app.settings.getSetting("savea", "chck");     // if saved settings exist, get true or false
                            }
         alert("Yes, checkMe will = "+checkMe)        
        
        
    win.checkPanel.chkOne.value = checkMe;  /// checkbox value will equal saved checkMe
    
    var fff = win.checkPanel.chkOne.value;  // string for alert
     alert("aha! but checkbox value is  = " +fff+ "\n Why so?")     // here we`ve got always "true"
    
    
    
    
    win.checkPanel.chkOne.onClick  = function () {
            
        var path11 = win.checkPanel.chkOne.value;  //  checkbox value to variable
        app.settings.saveSetting("savea", "chck", path11);  //saving checkbox value
        alert("Saved this value - " + app.settings.getSetting("savea", "chck"))
              }
    
    
    
    
    
    
              win.quitBtn.onClick = function() { 
                  win.close(); 
              }
    
    
        win.center();
              win.show();
    
    
              return retval;
      
    }
    
    
    if(typeof(mainFun_unitTest) == "undefined") {
        new mainFun().run();
    }
    
    

    A quick glance, I'd say it's because when the pref that is saved as a string, so after having read it you must control if (checkMe == 'true') rather than check it out as a Boolean value.

  • List of re-filling of question

    I have a list with a custom CellRenderer class. I added a checkbox to the cell, as described in the developer's guide, and as can be found on this forum. From a selection that the user do I need to re - fill the list with other content. If, however, for example a checkbox has been selected by the user in the initial list, after the re-filling of the list one of the boxes for the newly populated list is also checked. How to avoid that?

    I have the following code in which I declare a container of variables to hold the list and to load the data:

    ...
    public class ListsPanelContainer extends Container
    {
        private var _conChecklists:ChecklistContainer = new ChecklistContainer();
        private var _checklistData:ChecklistDataLoader = new ChecklistDataLoader();
        ...
        public function ListsPanelContainer()
        {
            initializeUI();
            ...
        }
    
        private function initializeUI() : void
        {
            addChild(_conChecklists);
    
            _checklistData.addEventListener(MyConstants.CHECKLISTS_LOADED, checklistDataLoadedHandler);
            ...
        }
    
        ...
    
        private function checklistDataLoadedHandler (event:Event) : void
        {
            _conChecklists.setData(_checklistData.currentData);
        }
        ...
    }
    

    And it's the ChecklistContainer class definition:

    ...
    public class ChecklistContainer extends Container
    {
        private var _checklistData:ChecklistDataLoader = new ChecklistDataLoader();
        private var _lstChecklists:List;
    
        public function ChecklistContainer()
        {
            initializeUI();
        }
    
        private function initializeUI() : void
        {
            if (!_lstChecklists)
            {
                _lstChecklists = new List();
    
                with (_lstChecklists)
                {
                    x = 0;
                    y = MyConstants.HEADER_HEIGHT;
                    setSize(MyConstants.LIST_PANEL_WIDTH, MyConstants.CHECKLISTS_LIST_HEIGHT);
                    rowHeight = 70;
                    setSkin(ChecklistCellRenderer);
                    selectionMode = ListSelectionMode.SINGLE;
                    allowDeselect = true;
                    addEventListener(ListEvent.ITEM_CLICKED, listItemClickedHandler);
                }
    
                addChild(_lstChecklists);
            }
        }
    
        public function setData (data:Array) : void
        {
            _lstChecklists.dataProvider = new DataProvider(data);
        }
        ...
    }
    

    And it's the ChecklistDataLoader class definition:

    ...
    public class ChecklistDataLoader extends EventDispatcher
    {
        public var currentData:Array;
    
        private var _arrChecklistNames:Array = new Array("First", "Second", "Third", "Fourth"); 
    
        public function load () : void
        {
            // Categories; to be read from database
            var _arrChecklists:Array = [];
            var _checklist:Checklist;
    
            _checklist = new Checklist();
            _checklist.name = _arrChecklistNames[0];
            _checklist.category = "test";
    
            _arrChecklists.push({label: _checklist.name, data: _checklist});
    
            _checklist = new Checklist();
            _checklist.name = _arrChecklistNames[1];
            _checklist.category = "test";
    
            _arrChecklists.push({label: _checklist.name, data: _checklist});
    
            currentData = _arrChecklists;
    
            dispatchEvent(new Event(MyConstants.CHECKLISTS_LOADED));
        }
    }
    

    It is not the complete code, because in another class is called the load() function, but I think that's enough.

    And it's the custom cellrenderer class:

    ...
    public class ChecklistCellRenderer extends CellRenderer
    {
        protected var _cbCheckbox:CheckBox = new CheckBox();
        protected var _sprRowBackground:Sprite = new Sprite();
        ...
    
        public function ChecklistCellRenderer ()
        {
            super();
        }
    
        override protected function init () : void
        {
            with (_cbCheckbox)
            {
                addEventListener(MouseEvent.CLICK, onCheckboxClicked);
                addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
            }
    
            addChild(_sprRowBackground);
            addChild(_cbCheckbox);
    
            super.init();
        }
    
        override protected function drawLabel () : void
        {
            super.drawLabel();
    
            if (this.label)
            {
                // place checkbox
                _cbCheckbox.setPosition(5, 5);
    
                // shift x-coordinate of label to make room for checkbox
                this.label.x = 36;
                this.label.y = 4;
                ...
            }
        }
    
        override public function set data (value:Object) : void
        {
            super.data = value;
    
            label.text = value.highway;
        }
    
        private function drawState () : void
        {
            _sprRowBackground.graphics.clear();
    
            // color the rows alternatively white / light grey
            if ((index % 2) == 0)
            {
                _sprRowBackground.graphics.beginFill(MyConstants.LIGHTGREY);
            }
            else
            {
                _sprRowBackground.graphics.beginFill(MyConstants.WHITE);
            }
    
            _sprRowBackground.graphics.drawRect(0, 0, this.width, this.height);
            _sprRowBackground.graphics.endFill();
        }
    
        override public function set index (value:int) : void
        {
            super.index = value;
    
            drawState();
        }
        ...
    }
    

    Thanks in advance for your help.

    Hello Eugene,

    I would force selection false checkbox (if it is the default value that you expect) in a set data() in your ChecklistCellRenderer.

  • Control edge file animate OAM with the buttons play/pause of Captivate on the skin.

    Hello world

    I worked on a project where I mix a variety of objects and animations.  I do animations animate on board.  The problem I have is that when the user clicks the button pause on the Captivate playback controls, the oam file do not pause.  I found descriptions of how I can make an animation to play/pause the Captivate timeline button on board, but I can't find anything on the use of the Captivate pause button to control the Edge file animate.  Discussions only that I managed to find on that seem to be the answer.  Someone had a bit of luck with this question?

    Any advice would be appreciated.

    Thank you

    Randy

    OK, it's a bit hacky, but it works quite to control the main timeline object in a file of edge of Cape Town, where the Edge file has been imported to Cap 9 as a Web (oam) object. I went seeking answers same like you and came from vacuum, then start to tinker myself and came across the following method.

    Let's use window.postMessage to send a string between Cape document window and document edge iframe window then react accordingly. You can learn more about postMessage accepted battery answer here: http://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy

    In your dashboard file click the support of Actions for the stage object in the timeline and select the compositionReady event. Paste this code into the text window:

    addEventListener for Chrome, attachEvent for IE

    window.addEventListener ('message', receivedFromCaptivate, false);

    window.attachEvent ('onmessage', receivedFromCaptivate);

    function receivedFromCaptivate (event) {}

    switch (event.data) {}

    case "play":

    SYM. Play();

    break;

    case "pause":

    SYM. Stop();

    break;

    }

    }

    Save the file and publish it as an oam, then import the OLS in a slide of Cap, as you normally would. Now, to put in place things of the CAP. Here is a visual aid for the rest of the explanation...

    In the PAC file select the control that you use to start playing the chronology of the edge (in the example above the "slide4Play"), select the checkbox 'Use as button' in the properties on the right, select the "Actions" tab, then to the drop-down list for 'Success' choose "Execute advanced Actions." Click the folder next to the selection of Script control and advanced Actions dialog box should appear. Name your action something (for example, "playEdgeSlide4"), then click the 'Add' in the grey bar to add a new action in the queue. In the drop down "Select Action"... ", choose"execute Javascript. "In the drop down menu"select the window... ". ", choose"current ". Then click on the 'Script_Window' button to bring up a window of text Javascript crap. In this window, you can paste this:

    try {}

    $("iframe") [0].contentWindow.postMessage ("play", "*");

    } catch (e) {}

    Console.log (e.message);

    }

    Select 'OK' to close the window of text Javascript crap, then click the 'Update Action' button to save your new action. Now let's do the same for break action - select the control that you use to pause, go through the steps above, the name of the action, implement advanced action in the same way and in the Javascript crap text window, paste the following text:

    try {}

    $("iframe") [0].contentWindow.postMessage ("break", "*");

    } catch (e) {}

    Console.log (e.message);

    }

    Cap incorporates the Edge file in an iframe on the page that has its own document window. In order to communicate between base ceiling windows and the iframe, we use the postMessage call. So when you hit your button Pause/Play in Cape Town, he publishes an event to the function that gets recorded in the iframe on board. And in the event.data is the string we send above the Cap base window in the function postMessage ('play' or 'pause'). We use a simple switch to react to the data string, stop or have fun with the main symbol of the scene at the edge (sym.play(1000) (), sym.stop ()).

    I hope this helps!

  • 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.

  • Why ads are not to be blocked?

    Recently, I reformatted and reinstalled my version of Windows7. Changed the search to Google; and I use FIREFOX. Also have installed AdBlock Plus.

    BUT... it seems that AdBlock does not work. I have reset the ads "approve" in the field of the tool; with no improvement. and some other scam free programs...

    Please... the ads are "eating" my life as a navigation...

    Note that some installers, or the updates come with unwanted additions, so be sure to always look for checkboxes if you update or install programs such as Java and Flash.

Maybe you are looking for