0

I am creating flex application in which I am using spark states.

State 1: is a initial page.

State 2: Having radio button, Submit and Cancel Button.

Now my problem is ..

When I move to State 2 from State 1 and click on radio button then Submit Button gets enabled and from this If i click on Cancel Button it returns to State 1 now suppose if I again go to State 2 then whatever operation I have did in last state it still remains same means Submit button enabled and clicked radio button.

So anybody help me how can I reset State when I revisiting the same state?

eliasah
  • 39,588
  • 11
  • 124
  • 154
ppb
  • 2,299
  • 4
  • 43
  • 75

1 Answers1

0

You may use a reset function called when you click on the "cancel" button. This function could reset your components the way you like, then go back to your state1

function reset():void
{
   submitButton.enabled = false;
   radioChoice.selectedValue = "myInitValue"; 
   currentState = "state1";
}
Chris
  • 1,016
  • 1
  • 14
  • 18