package createAccountGui { import com.sbi.popup.SBScreen; import com.sbi.popup.SBWizard; import createAccountFlow.CreateAccountGui; import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; import flash.text.TextField; import gui.DarkenManager; import gui.GuiCheckBox; public class GuiRulesScreen extends SBScreen { private var _login:Object; private var _rulesScreen:MovieClip; private var _fullRulesTxt:TextField; private var _rulesVoBtn:MovieClip; private var _checkBox:GuiCheckBox; public function GuiRulesScreen(param1:Object, param2:SBWizard) { this._login = param1; this._rulesScreen = param1.accountCreation.registrationPanel.rules_popup; this._checkBox = new GuiCheckBox(this._rulesScreen.agree_box,this.onAgreeChecked); this._fullRulesTxt = this._rulesScreen.pp_txt; this._rulesVoBtn = this._rulesScreen.vo_btn; super(this._rulesScreen,param2); } public function init() : void { onEnterFromPrev = this.enterFromBoth; onEnterFromNext = this.enterFromBoth; onLeaveToPrev = this.leaveToBoth; onLeaveToNext = null; onPlay = this.onPlayBtn; this._fullRulesTxt.htmlText = "" + this._fullRulesTxt.text + ""; this._rulesVoBtn.stop(); this._rulesVoBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.voBtnClickHandler,false,0,true); this._checkBox.init(this._rulesScreen.agree_txt); this._checkBox.checked = false; } override public function destroy() : void { this._rulesVoBtn.removeEventListener(MouseEvent.MOUSE_DOWN,this.voBtnClickHandler); this._checkBox.destroy(); this._checkBox = null; super.destroy(); } public function enterFromBoth() : void { CreateAccountGui.trackUserCreateAccountPageChange("Rules"); CreateAccountGui.vo5Sound.play(); if(CreateAccountGui.vo5Sound.sc) { CreateAccountGui.vo5Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopRulesVO,false,0,true); this._rulesVoBtn.play(); } MovieClip(this._rulesScreen.parent).gotoAndPlay("playAJRules"); MovieClip(this._rulesScreen.parent.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("playAJRules"); MovieClip(this._rulesScreen.parent.parent).next_btn.visible = false; MovieClip(this._rulesScreen.parent.parent).play_btn.visible = this._checkBox.checked; } public function leaveToBoth() : Boolean { MovieClip(this._rulesScreen.parent.parent).next_btn.visible = true; MovieClip(this._rulesScreen.parent.parent).play_btn.visible = false; CreateAccountGui.vo5Sound.stop(); this._rulesVoBtn.stop(); this._rulesVoBtn.gotoAndStop(1); MovieClip(this._rulesScreen.parent).gotoAndPlay("backAJRules"); MovieClip(this._rulesScreen.parent.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("backAJRules"); return true; } public function onPlayBtn() : void { DarkenManager.showLoadingSpiral(true); CreateAccountGui.vo5Sound.stop(); this._rulesVoBtn.stop(); this._rulesVoBtn.gotoAndStop(1); this._login.createNewAccountSetup(CreateAccountGui.currEmailAddress(),CreateAccountGui.emailValidationCallback()); } private function voBtnClickHandler(param1:MouseEvent) : void { if(CreateAccountGui.vo5Sound.isPlaying) { CreateAccountGui.vo5Sound.stop(); this._rulesVoBtn.stop(); this._rulesVoBtn.gotoAndStop(1); } else { CreateAccountGui.vo5Sound.play(); if(CreateAccountGui.vo5Sound.sc) { CreateAccountGui.vo5Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopRulesVO,false,0,true); this._rulesVoBtn.play(); } } } private function stopRulesVO(param1:Event) : void { if(CreateAccountGui) { CreateAccountGui.vo5Sound.stop(); } this._rulesVoBtn.stop(); this._rulesVoBtn.gotoAndStop(1); } private function onAgreeChecked() : void { MovieClip(this._rulesScreen.parent.parent).play_btn.visible = this._checkBox.checked; } } }