Tuesday, May 15, 2012

[Action Script] [AS3] Radio Button - help with if/else statement May,2012

I have a form that as someone fills it out, animations on the stage become visible. For instance, I have one that says "are you Male or Female" with radio buttons and I want a male of female animation on the stage to become visible when the respective button is selected.

I tried writing my Actionscript 3 code like
ActionScript Code: MalePerson.visible = false;FemalePerson.visible = false;if(radioMale.selected = true) {        MalePerson.visible = true;    }    else if (radioMale.selected = false){FemalePerson.visible = true;}
MalePerson is the animation on the stage that will become visible and "radioMake" is that radio buttons instance name. Im just not sure how to write the "if" statement so that the animation will appear when the button is selected and not waiting on a "submit" button to be pressed.

Any help would be appreciated.

Thank you.
[AS3] Radio Button - help with if/else statement

Related Post



0 comments: