protected function btnClose(event:Event):void { var btn:Button = new Button(); if(checkBox.selected) btn.enabled =true; else btn.enabled=false; //swidget.dontShowSplashAgain(true); PopUpManager.removePopUp(this); }
switch (btnAction) { case "close": { btn.enabled = false; btn.addEventListener(MouseEvent.CLICK, btnClose); break; }
protected function btnClose(event:Event):void { var btn:Button = new Button(); //If the close button is not enabled we would never get here in the first place. //swidget.dontShowSplashAgain(true); PopUpManager.removePopUp(this); }
switch (btnAction) { case "close": { btn.enabled = checkBox.selected; btn.addEventListener(MouseEvent.CLICK, btnClose); break; }
switch (btnAction) { case "close": { btn.enabled = checkBox.selected; btn.addEventListener(MouseEvent.CLICK, btnClose); break; }
protected function btnClose(event:Event):void { var btn:Button = new Button(); if(checkBox.selected) btn.enabled =checkBox.selected; //swidget.dontShowSplashAgain(true); PopUpManager.removePopUp(this); }
<s:VGroup horizontalAlign="center" verticalAlign="middle" gap="5" width="100%"> <s:CheckBox id="checkBox" selected="false" label="I accept Terms and Conditions." /> <s:HGroup id="bGroup" horizontalAlign="center" verticalAlign="middle" gap="10" width="100%"/> </s:VGroup>
<s:CheckBox id="checkBox" selected="false" label="I accept Terms and Conditions." change="checkBox_changeHandler(event)" /> protected function checkBox_changeHandler(event:Event):void { for (var b:int = 0; b<bGroup.numElements; b++){ if (Button(bGroup.getElementAt(b)).name == "") Button(bGroup.getElementAt(b)).enabled = checkBox.selected; } }
protected function btnClose(event:Event):void { PopUpManager.removePopUp(this); }
Adi,
Hmm... That was a little more difficult then I thought it should be...<s:CheckBox id="checkBox" selected="false" label="I accept Terms and Conditions." change="checkBox_changeHandler(event)" /> protected function checkBox_changeHandler(event:Event):void { for (var b:int = 0; b<bGroup.numElements; b++){ if (Button(bGroup.getElementAt(b)).name == "") Button(bGroup.getElementAt(b)).enabled = checkBox.selected; } }
Once again there is no need to have anything in the btnClose function because it will not get fired if the button is not enabled.protected function btnClose(event:Event):void { PopUpManager.removePopUp(this); }