dimanche 28 décembre 2014

(dart) I want two different onclick function to trigger depending if the radio button is checked or not upon clicking. How do I do that?


I'm working on a game project where the user has to click the radio button that is checked randomly.


If he clicks the radio button that is checked, another one is randomly generated and the one he just clicked is unchecked.


If he clicks a radio button that is unchecked, he loses the game.


So both clicking even trigger a different function.


Right now I have :



var elemDmz = querySelectorAll('input[type="radio"]');

elemDmz.onClick.listen(
(event) => hithead(id));


which makes the same function (hithead(id)) happen on all radio clicks regardless if checked or not. How do I make it so that it uses the hithead() only if the radio clicked is checked and uses the stopgame() if the radio clicked was unchecked ?





Aucun commentaire:

Enregistrer un commentaire