Brought up to date with the private repository (feea4c7)

This commit is contained in:
S committed 2026-10-14 20:57:33 +03:00
1 parent 1aa738d692
commit 1b1df1ae48
7925 files changed
+2617237 -20

No files matched your search

@@ -0,0 +1,205 @@
package createAccountGui
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
public class GuiAvatarCreationAssets extends Sprite
{
public var creationWiz:GuiCreateWizard;
public var notifyPopup:MovieClip;
public var tipsPopup:MovieClip;
private var nextBtn:MovieClip;
private var backBtn:MovieClip;
private var playBtn:MovieClip;
private var buyBtnRed:MovieClip;
private var buyBtnGreen:MovieClip;
private var closeBtn:MovieClip;
private var _avatarAssets:MovieClip;
public function GuiAvatarCreationAssets(param1:MovieClip, param2:Boolean = false)
{
var _loc3_:TextField = null;
super();
this._avatarAssets = param1;
addChild(param1);
this._avatarAssets.addEventListener("Localization",this.onFrameCompleteEvent,false,0,true);
this.notifyPopup = param1.oopsPopup;
this.notifyPopup.notifyTxt = param1.oopsPopup.oops_txt;
this.notifyPopup.titleTxt = param1.oopsPopup.oops_title_txt;
this.notifyPopup.bx.addEventListener(MouseEvent.MOUSE_DOWN,this.notifyPopupBxHandler,false,0,true);
this.notifyPopup.visible = false;
if(!param2)
{
this.tipsPopup = param1.tipsPopup;
this.tipsPopup.bx.addEventListener(MouseEvent.MOUSE_DOWN,this.tipsPopupBxHandler,false,0,true);
_loc3_ = this.tipsPopup.tips_pp_txt;
_loc3_.htmlText = _loc3_.text.replace("Privacy Policy","<a href=\'http://www.animaljam.com/privacy\' target=\'_blank\'><u>Privacy Policy</u></a>");
this.playBtn = param1.play_btn;
this.playBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.onPlayBtn,false,0,true);
}
else
{
this.buyBtnRed = param1.buy_btn_red;
this.buyBtnRed.addEventListener(MouseEvent.MOUSE_DOWN,this.onBuyBtn,false,0,true);
this.buyBtnGreen = param1.buy_btn_green;
this.buyBtnGreen.addEventListener(MouseEvent.MOUSE_DOWN,this.onBuyBtn,false,0,true);
this.closeBtn = param1.bx;
this.closeBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.onClose,false,0,true);
}
this.nextBtn = param1.next_btn;
this.nextBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.onNextBtn,false,0,true);
this.backBtn = param1.back_btn;
this.backBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.onBackBtn,false,0,true);
this._avatarAssets.addEventListener(MouseEvent.MOUSE_DOWN,this.onPopupDown,false,0,true);
}
public function init(param1:Object, param2:Boolean) : void
{
this.creationWiz = new GuiCreateWizard(param1);
this.creationWiz.init(this._avatarAssets,false,1,null,true,false,param2);
}
public function destroy() : void
{
this.creationWiz.destroy();
this.creationWiz = null;
removeChild(this._avatarAssets);
this._avatarAssets = null;
}
public function get currAvatar() : MovieClip
{
return this.creationWiz.chooseAnimalScreen.currAvatar;
}
public function get currBG() : String
{
return this.creationWiz.chooseAnimalScreen.currBG;
}
public function get currType() : int
{
return this.creationWiz.chooseAnimalScreen.currType;
}
public function get hasEnoughGems() : Boolean
{
return this.creationWiz.chooseAnimalScreen.hasEnoughGems;
}
public function get currAvatarCost() : int
{
return this.creationWiz.chooseAnimalScreen.currAvatarCost;
}
public function get currAvatarName() : String
{
return this.creationWiz.chooseAnimalScreen.currAvatarName;
}
public function get isCreatingWithoutChoosing() : Boolean
{
return this.creationWiz.chooseAnimalScreen.isCreatingWithoutChoosing;
}
public function get currencyType() : int
{
return this.creationWiz.chooseAnimalScreen.currencyType;
}
public function get currEmailAddress() : String
{
return this.creationWiz.emailScreen.currEmail;
}
public function get emailValidationCallback() : Function
{
return this.creationWiz.emailScreen.emailValidCallback;
}
public function get currEmailSoFar() : String
{
return this.creationWiz.emailScreen.currEmail;
}
public function reloadChooser(param1:Boolean, param2:Boolean, param3:int = -1, param4:Boolean = false, param5:int = 0, param6:int = -1) : void
{
this.creationWiz.step = 1;
this.creationWiz.chooseAnimalScreen.reload(param1,param2,param3,param4,param5,param6);
}
public function destroyReloadedItems() : void
{
this.creationWiz.chooseAnimalScreen.destroyReloadedItems();
}
public function loadNameLists() : void
{
this.creationWiz.createANameScreen.loadNameLists();
}
private function onFrameCompleteEvent(param1:Event = null) : void
{
this.creationWiz.updateCurrScreen();
}
private function notifyPopupBxHandler(param1:MouseEvent) : void
{
this.notifyPopup.visible = false;
}
private function tipsPopupBxHandler(param1:MouseEvent) : void
{
this.tipsPopup.visible = false;
}
private function onNextBtn(param1:MouseEvent) : void
{
param1.stopPropagation();
this.creationWiz.next();
}
private function onBackBtn(param1:MouseEvent) : void
{
param1.stopPropagation();
this.creationWiz.prev();
}
private function onPlayBtn(param1:MouseEvent) : void
{
param1.stopPropagation();
this.creationWiz.onPlay();
}
private function onBuyBtn(param1:MouseEvent) : void
{
param1.stopPropagation();
this.creationWiz.onPlay();
}
private function onClose(param1:MouseEvent) : void
{
param1.stopPropagation();
this.creationWiz.onClose();
}
private function onPopupDown(param1:MouseEvent) : void
{
param1.stopPropagation();
}
}
}
@@ -0,0 +1,819 @@
package createAccountGui
{
import achievement.AchievementXtCommManager;
import avatar.AvatarUtility;
import avatar.NewWorldAvatar;
import com.sbi.analytics.SBTracker;
import com.sbi.popup.SBOkPopup;
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.ItemWindowAvatarSelect;
import gui.LoadingSpiral;
import gui.SBScrollbar;
import gui.UpsellManager;
import gui.WindowGenerator;
import item.Item;
import localization.LocalizationManager;
public class GuiChooseAnimal extends SBScreen
{
private var _chooseScreen:MovieClip;
private var _voBtn:MovieClip;
private var _backBtn:MovieClip;
private var _nextBtn:MovieClip;
private var _playBtn:MovieClip;
private var _itemWindow:MovieClip;
private var _avatarHolder:MovieClip;
private var _currAvatar:MovieClip;
private var _buyBtnGreen:MovieClip;
private var _buyBtnRed:MovieClip;
private var _tag:MovieClip;
private var _amlNameTxt:TextField;
private var _titleText:TextField;
private var _avatarWindows:WindowGenerator;
private var _scrollBar:SBScrollbar;
private var _itemsLoadingSpiral:LoadingSpiral;
private var _currAvatarIconIds:Array;
private var _currAvatarTypes:Array;
private var _oceanOnlyIconIds:Array;
private var _oceanOnlyTypes:Array;
private var _usableAvatarIconIds:Array;
private var _usableAvatarTypes:Array;
private var _currBG:String;
private var _avatarNamesByType:Object;
private var _newAvatarFacilitator:NewWorldAvatar;
private var _currType:int;
private var _avtViewsFlag:int;
private var _myCurrencyCount:int;
private var _currCost:int;
private var _currIndex:int;
private var _isChoosingOceanAvatars:Boolean;
private var _isChoosingFirstNonMember:Boolean;
private var _isFromWorld:Boolean;
private var _hasEnoughGems:Boolean;
private var _wizard:SBWizard;
private var _isCreatingWithoutChoosing:Boolean;
private var _diamondCost:int;
private var _currencyType:int;
private var _scrollYValue:int;
private var _isMovingScreens:Boolean;
private var _registrationPanel:MovieClip;
private var _avatarSelect:MovieClip;
public function GuiChooseAnimal(param1:Object, param2:SBWizard, param3:Boolean)
{
this._chooseScreen = param3 ? param1.registrationPanel.chooseAnimal : param1.accountCreation.registrationPanel.chooseAnimal;
super(this._chooseScreen,param2);
this._registrationPanel = MovieClip(this._chooseScreen.parent);
this._avatarSelect = MovieClip(this._chooseScreen.parent.parent);
this._amlNameTxt = this._chooseScreen.animalNameText;
this._itemWindow = this._chooseScreen.itemWindow;
this._titleText = this._chooseScreen.titleText;
this._isFromWorld = param3;
this._wizard = param2;
if(param3)
{
this._backBtn = param1.back_btn;
this._nextBtn = param1.next_btn;
this._playBtn = param1.play_btn;
this._avatarHolder = param1.allAvatars;
this._buyBtnGreen = param1.buy_btn_green;
this._buyBtnRed = param1.buy_btn_red;
this._tag = this._chooseScreen.tag;
}
else
{
this._voBtn = this._chooseScreen.vo_btn;
this._playBtn = param1.accountCreation.play_btn;
this._backBtn = param1.accountCreation.back_btn;
this._nextBtn = param1.accountCreation.next_btn;
this._avatarHolder = param1.accountCreation.allAvatars;
}
}
public function init() : void
{
onEnterFromNext = this.enterFromNext;
onEnterFromPrev = this.enterFromPrev;
onLeaveToPrev = this.leaveToPrev;
onLeaveToNext = this.leaveToNext;
onClose = this.leaveToPrev;
updateScreen = this.updateScreenAssets;
if(!this._isFromWorld)
{
this._playBtn.visible = false;
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
this._voBtn.addEventListener(MouseEvent.CLICK,this.voBtnClickHandler,false,0,true);
}
else
{
this._buyBtnGreen.visible = false;
this._buyBtnRed.visible = false;
this._tag.visible = false;
}
this._backBtn.visible = false;
this._amlNameTxt.text = "";
this._myCurrencyCount = gMainFrame.clientInfo.gemCount;
this._newAvatarFacilitator = new NewWorldAvatar();
this._usableAvatarIconIds = [];
this._usableAvatarTypes = [];
this._currAvatarIconIds = [];
this._currAvatarTypes = [];
this._avatarNamesByType = [];
this._oceanOnlyIconIds = [];
this._oceanOnlyTypes = [];
this._avtViewsFlag = gMainFrame.userInfo.userVarCache.getUserVarValueById(AchievementXtCommManager.UV_AVT_VIEWABLE_FLAG);
this._itemsLoadingSpiral = new LoadingSpiral(this._itemWindow,this._itemWindow.width * 0.5,this._itemWindow.height * 0.5);
this._itemsLoadingSpiral.visible = true;
this.setupIcons();
if(!this._isFromWorld && Boolean(CreateAccountGui.vo1Sound))
{
CreateAccountGui.vo1Sound.play();
if(CreateAccountGui.vo1Sound.sc)
{
CreateAccountGui.vo1Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVOButton,false,0,true);
this._voBtn.play();
}
}
}
override public function destroy() : void
{
if(this._avatarWindows)
{
this._avatarWindows.destroy();
this._avatarWindows = null;
}
if(this._scrollBar)
{
this._scrollBar.destroy();
this._scrollBar = null;
}
super.destroy();
}
public function destroyReloadedItems() : void
{
if(this._avatarWindows)
{
this._avatarWindows.destroy();
this._avatarWindows = null;
}
if(this._scrollBar)
{
this._scrollBar.destroy();
this._scrollBar = null;
}
}
public function reload(param1:Boolean, param2:Boolean, param3:int = -1, param4:Boolean = false, param5:int = 0, param6:int = -1) : void
{
this._isMovingScreens = false;
this._avtViewsFlag = gMainFrame.userInfo.userVarCache.getUserVarValueById(AchievementXtCommManager.UV_AVT_VIEWABLE_FLAG);
this._itemsLoadingSpiral = new LoadingSpiral(this._itemWindow,this._itemWindow.width * 0.5,this._itemWindow.height * 0.5);
this._itemsLoadingSpiral.visible = true;
this._currencyType = param5;
this.setupIcons(true);
if(param5 == Item.GEM_CURRENCY)
{
this._myCurrencyCount = gMainFrame.clientInfo.gemCount;
}
else if(param5 == Item.DIAMOND_CURRENCY)
{
this._myCurrencyCount = gMainFrame.clientInfo.diamondCount;
}
this._isChoosingOceanAvatars = param1;
this._isChoosingFirstNonMember = param2;
this._nextBtn.visible = true;
this._buyBtnGreen.visible = false;
this._buyBtnRed.visible = false;
this._backBtn.visible = false;
this._isCreatingWithoutChoosing = param4;
if(this._isChoosingOceanAvatars)
{
this._currAvatarIconIds = this._oceanOnlyIconIds;
this._currAvatarTypes = this._oceanOnlyTypes;
}
else
{
this._currAvatarIconIds = this._usableAvatarIconIds;
this._currAvatarTypes = this._usableAvatarTypes;
}
this.pickRandomAvatar(param3,param6);
AvatarUtility.creationAssets.creationWiz.step = param4 ? 2 : 1;
if(Boolean(this._currAvatar) && Boolean(this._currBG))
{
if(!param4)
{
this.enterFromPrev();
this._nextBtn.visible = true;
this._tag.visible = true;
}
else
{
this._nextBtn.visible = false;
this._tag.visible = false;
}
}
if(!param4)
{
this.createAvatarWindows();
}
}
public function enterFromNext() : void
{
this._registrationPanel.gotoAndPlay("backChooseAnAnimal");
this._currAvatar.gotoAndPlay("backChooseAnAnimal");
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndPlay("backChooseAnAnimal");
if(this._isFromWorld)
{
this._buyBtnGreen.visible = false;
this._buyBtnRed.visible = false;
this._nextBtn.visible = true;
}
this.enterFromBoth();
}
public function enterFromPrev() : void
{
this._registrationPanel.gotoAndStop("intro");
this._currAvatar.gotoAndStop("chooseAnAnimal");
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndPlay("intro");
this.enterFromBoth();
}
public function enterFromBoth() : void
{
if(!this._isFromWorld && Boolean(CreateAccountGui.vo1Sound))
{
CreateAccountGui.vo1Sound.play();
if(CreateAccountGui.vo1Sound.sc)
{
CreateAccountGui.vo1Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVOButton,false,0,true);
this._voBtn.play();
}
}
this._isMovingScreens = false;
if(this._isFromWorld)
{
SBTracker.trackPageview("/game/play/popup/avatarCreation/ChooseAnimal");
}
else
{
CreateAccountGui.trackUserCreateAccountPageChange("ChooseAnimal");
}
}
public function leaveToNext() : Boolean
{
var _loc1_:Object = null;
if(this._nextBtn.isGray)
{
return false;
}
if(!this._isFromWorld)
{
if(CreateAccountGui.vo1Sound)
{
CreateAccountGui.vo1Sound.stop();
}
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
if(!gMainFrame.userInfo.isMember)
{
_loc1_ = AvatarUtility.avatarDefInfo[AvatarUtility.findAvDefIndexByType(this._currType)];
if(_loc1_.isMemberOnly)
{
if(this._isCreatingWithoutChoosing)
{
if(this._registrationPanel.currentFrameLabel != "chooseAName")
{
this._registrationPanel.gotoAndStop("chooseAName");
}
if(this._currAvatar.currentFrameLabel != "chooseAName")
{
this._currAvatar.gotoAndStop("chooseAName");
}
if(this._avatarSelect.bg[this._currBG + "Bg"].currentFrameLabel != "chooseAName")
{
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndStop("chooseAName");
}
return true;
}
UpsellManager.displayPopup(UpsellManager.ANIMALS,"createMembersOnlyAvatar");
}
else if(AvatarUtility.numNonMemberAvatars() >= 2 && !this._isChoosingFirstNonMember)
{
UpsellManager.displayPopup(UpsellManager.ANIMAL_SLOTS,"buyThirdAvatar");
}
else
{
if(!(this._isChoosingFirstNonMember && _loc1_.enviroFlag == 2))
{
if(this._isCreatingWithoutChoosing)
{
this._registrationPanel.gotoAndStop("chooseAName");
this._currAvatar.gotoAndStop("chooseAName");
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndStop("chooseAName");
}
else
{
this._registrationPanel.gotoAndPlay("playChooseAName");
this._currAvatar.gotoAndPlay("playChooseAName");
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndPlay("playChooseAName");
}
this._isMovingScreens = true;
return true;
}
new SBOkPopup(this._avatarSelect.parent.parent,LocalizationManager.translateIdOnly(14689));
}
return false;
}
if(this._isCreatingWithoutChoosing)
{
this._registrationPanel.gotoAndStop("chooseAName");
this._currAvatar.gotoAndStop("chooseAName");
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndStop("chooseAName");
}
else
{
this._registrationPanel.gotoAndPlay("playChooseAName");
this._currAvatar.gotoAndPlay("playChooseAName");
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndPlay("playChooseAName");
}
this._isMovingScreens = true;
return true;
}
public function leaveToPrev() : Boolean
{
if(!this._isFromWorld)
{
if(CreateAccountGui.vo1Sound)
{
CreateAccountGui.vo1Sound.stop();
}
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
this._newAvatarFacilitator.nameTypeScreenDone();
this._isMovingScreens = true;
return true;
}
public function leaveToBoth() : Boolean
{
return true;
}
public function updateScreenAssets(param1:Boolean = false) : void
{
this._chooseScreen = this._registrationPanel.chooseAnimal;
this._amlNameTxt = this._chooseScreen.animalNameText;
this._itemWindow = this._chooseScreen.itemWindow;
this._titleText = this._chooseScreen.titleText;
if(this._isFromWorld)
{
this._tag = this._chooseScreen.tag;
this._buyBtnGreen = this._avatarSelect.buy_btn_green;
this._buyBtnRed = this._avatarSelect.buy_btn_red;
}
if(param1)
{
this.setupAvatarTextItems();
this.createAvatarWindows();
if(this._isFromWorld)
{
this._buyBtnGreen.visible = false;
this._buyBtnRed.visible = false;
this._tag.visible = true;
}
else
{
this._playBtn.visible = false;
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
this._voBtn.addEventListener(MouseEvent.CLICK,this.voBtnClickHandler,false,0,true);
this._voBtn = this._chooseScreen.vo_btn;
}
if(!this._isFromWorld && Boolean(CreateAccountGui.vo1Sound))
{
if(CreateAccountGui.vo1Sound.sc)
{
this._voBtn.play();
}
}
}
}
public function get currencyType() : int
{
return this._currencyType;
}
public function get isCreatingWithoutChoosing() : Boolean
{
return this._isCreatingWithoutChoosing;
}
public function get currAvatar() : MovieClip
{
return this._currAvatar;
}
public function get currBG() : String
{
return this._currBG;
}
public function get currType() : int
{
return this._currType;
}
public function get hasEnoughGems() : Boolean
{
return this._hasEnoughGems;
}
public function get currAvatarCost() : int
{
return this._diamondCost == -1 ? this._currCost : this._diamondCost;
}
public function get currAvatarName() : String
{
return LocalizationManager.translateIdOnly(this._avatarNamesByType[this._currType]);
}
private function setupIcons(param1:Boolean = false) : void
{
var _loc3_:int = 0;
var _loc4_:Object = null;
var _loc2_:Array = AvatarUtility.creationAvatars;
this._usableAvatarIconIds = [];
this._usableAvatarTypes = [];
this._oceanOnlyIconIds = [];
this._oceanOnlyTypes = [];
var _loc5_:int = 0;
for(; _loc5_ < _loc2_.length; _loc5_++)
{
try
{
if(Boolean(AvatarUtility.avatarDefInfo && AvatarUtility.avatarDefInfo.length > 0) && Boolean(_loc5_ < AvatarUtility.avatarDefInfo.length) && Boolean(AvatarUtility.avatarDefInfo[_loc5_]))
{
_loc3_ = int(gMainFrame.userInfo.getAvatarDefByAvType(_loc2_[_loc5_].avTypeId).iconMediaId);
_loc4_ = AvatarUtility.avatarDefInfo[_loc5_];
if((this._avtViewsFlag & 1 << AvatarUtility.avatarTypes[_loc5_] - 1) != 0)
{
if(!this._isFromWorld && (AvatarUtility.isEndangered(_loc4_.availability) || AvatarUtility.isExtinct(_loc4_.availability)))
{
continue;
}
this._usableAvatarIconIds.push(_loc3_);
this._usableAvatarTypes.push(_loc2_[_loc5_].avTypeId);
}
if(Utility.isOcean(AvatarUtility.avatarDefInfo[_loc5_].enviroFlag))
{
this._oceanOnlyIconIds.push(_loc3_);
this._oceanOnlyTypes.push(_loc2_[_loc5_].avTypeId);
}
this._avatarNamesByType[_loc2_[_loc5_].avTypeId] = gMainFrame.userInfo.getAvatarDefByAvType(_loc2_[_loc5_].avTypeId).titleStrRef;
if(Boolean(this._currType) && _loc2_[_loc5_].avTypeId == this._currType)
{
LocalizationManager.translateId(this._amlNameTxt,this._avatarNamesByType[this._currType]);
}
}
}
catch(e:Error)
{
}
}
this._currAvatarIconIds = this._usableAvatarIconIds;
this._currAvatarTypes = this._usableAvatarTypes;
if(!this._isFromWorld && !param1)
{
this.pickRandomAvatar();
this.createAvatarWindows();
}
}
private function pickRandomAvatar(param1:int = -1, param2:int = -1) : void
{
var _loc3_:int = 0;
if(param1 == -1)
{
this._currIndex = Math.floor(Math.random() * (this._currAvatarTypes.length - 1 - 0 + 1)) + 0;
param1 = int(this._currAvatarTypes[this._currIndex]);
}
else
{
_loc3_ = 0;
while(_loc3_ < this._currAvatarTypes.length)
{
if(this._currAvatarTypes[_loc3_] == param1)
{
this._currIndex = _loc3_;
break;
}
_loc3_++;
}
}
this._diamondCost = param2;
this._currType = param1;
this.setupCurrAvatar();
}
private function createAvatarWindows() : void
{
if(Boolean(this._avatarWindows) && this._avatarWindows.numWindowsCreated > 0)
{
this._itemWindow.addChild(this._avatarWindows);
if(this._isFromWorld)
{
if(this._scrollBar)
{
this._scrollYValue = this._scrollBar.scrollYValue;
this._scrollBar.destroy();
this._scrollBar = null;
}
this._scrollBar = new SBScrollbar();
this._scrollBar.init(this._avatarWindows,this._avatarWindows.width,this._avatarWindows.boxHeight * 3 + 2 * 3,10,"scrollbar2",this._avatarWindows.boxHeight + 2,this._scrollYValue,this._avatarWindows.height);
}
return;
}
this._itemsLoadingSpiral.visible = true;
if(this._scrollBar)
{
this._scrollYValue = this._scrollBar.scrollYValue;
this._scrollBar.destroy();
this._scrollBar = null;
}
if(this._avatarWindows)
{
this._avatarWindows.destroy();
this._avatarWindows = null;
}
this._avatarWindows = new WindowGenerator();
this._avatarWindows.init(3,3,this._currAvatarIconIds.length,2,2,2,ItemWindowAvatarSelect,this._currAvatarIconIds,"",{
"mouseDown":this.winMouseDown,
"mouseOver":this.winMouseOver,
"mouseOut":this.winMouseOut
},{
"forCreation":!this._isFromWorld,
"avTypes":this._currAvatarTypes
},this.onAvatarIconWindowsLoaded,false,false);
this._itemWindow.addChild(this._avatarWindows);
}
private function onAvatarIconWindowsLoaded() : void
{
if(this._isFromWorld && this._scrollBar == null)
{
this._scrollBar = new SBScrollbar();
this._scrollBar.init(this._avatarWindows,this._avatarWindows.width,this._avatarWindows.boxHeight * 3 + 2 * 3,10,"scrollbar2",this._avatarWindows.boxHeight + 2,this._scrollYValue,this._avatarWindows.height);
}
this._itemsLoadingSpiral.visible = false;
if(MovieClip(this._avatarWindows.bg.getChildAt(this._currIndex)).currWindow.currentFrameLabel != "down")
{
MovieClip(this._avatarWindows.bg.getChildAt(this._currIndex)).currWindow.gotoAndStop("down");
}
}
private function winMouseDown(param1:MouseEvent) : void
{
param1.stopPropagation();
if(!this._isMovingScreens && this._currIndex != param1.currentTarget.index)
{
MovieClip(this._avatarWindows.bg.getChildAt(this._currIndex)).deselect();
this._currIndex = param1.currentTarget.index;
this._currType = this._currAvatarTypes[param1.currentTarget.index];
if(param1.currentTarget.currWindow.currentFrameLabel != "down")
{
param1.currentTarget.currWindow.gotoAndStop("down");
}
this.setupCurrAvatar();
}
}
private function setupCurrAvatar() : void
{
var _loc2_:Array = null;
var _loc1_:Array = this._avatarHolder.currentLabels;
var _loc3_:int = 0;
while(_loc3_ < _loc1_.length)
{
_loc2_ = _loc1_[_loc3_].name.split("_");
if(_loc2_[1] == this._currType)
{
this._currBG = _loc2_[0];
this._avatarHolder.gotoAndStop(this._currBG + "_" + this._currType);
this._currAvatar = this._avatarHolder["avatar" + this._currType];
break;
}
_loc3_++;
}
if(this._currAvatar)
{
this._currAvatar.gotoAndPlay("intro");
this.setupAvatarTextItems();
}
if(this._currBG)
{
if(this._avatarSelect.bg.currentFrameLabel != this._currBG)
{
this._avatarSelect.bg.gotoAndStop(this._currBG);
this._avatarSelect.bg[this._currBG + "Bg"].gotoAndPlay("intro");
}
}
}
private function setupAvatarTextItems() : void
{
var _loc1_:Object = null;
if(this._currAvatar)
{
if(this._avatarNamesByType[this._currType])
{
LocalizationManager.translateId(this._amlNameTxt,this._avatarNamesByType[this._currType]);
}
_loc1_ = AvatarUtility.avatarDefInfo[AvatarUtility.findAvatarIndexByType(this._currType)];
if(this._isFromWorld)
{
this._currCost = this._diamondCost == -1 ? int(_loc1_.cost) : this._diamondCost;
if(!this._isChoosingFirstNonMember)
{
this._tag.txt.text = String(this._currCost);
if(this._myCurrencyCount < this._currCost)
{
this._hasEnoughGems = false;
this._tag.gotoAndStop("red");
this._tag.txt.textColor = "0x800000";
}
else
{
this._hasEnoughGems = true;
this._tag.gotoAndStop("green");
this._tag.textColor = "0xFFFFFFFF";
}
}
else
{
this._hasEnoughGems = true;
LocalizationManager.translateId(this._tag.txt,11176);
}
}
if(AvatarUtility.isEndangered(_loc1_.availability))
{
if(this._currType == 13 || this._currType == 16 || this._currType == 26)
{
LocalizationManager.translateId(this._avatarSelect.endangeredSign.txt,11177);
}
else if(this._currType == 6)
{
LocalizationManager.translateId(this._avatarSelect.endangeredSign.txt,14226);
}
else
{
LocalizationManager.translateId(this._avatarSelect.endangeredSign.txt,11178);
}
this._avatarSelect.endangeredSign.visible = true;
}
else
{
this._avatarSelect.endangeredSign.visible = false;
}
if(AvatarUtility.isEndangered(_loc1_.availability) || AvatarUtility.isExtinct(_loc1_.availability))
{
this._nextBtn.activateGrayState(true);
if(this._isFromWorld)
{
this._tag.visible = false;
}
}
else
{
this._nextBtn.activateGrayState(false);
if(this._isFromWorld)
{
this._tag.visible = true;
}
}
}
}
private function winMouseOver(param1:MouseEvent) : void
{
if(param1)
{
param1.stopPropagation();
}
if(param1.currentTarget.currWindow.currentFrameLabel == "down")
{
param1.currentTarget.currWindow.gotoAndStop("downMouse");
}
else if(param1.currentTarget.currWindow.currentFrameLabel != "downMouse")
{
param1.currentTarget.currWindow.gotoAndStop("over");
}
AJAudio.playSubMenuBtnRollover();
}
private function winMouseOut(param1:MouseEvent) : void
{
if(param1)
{
param1.stopPropagation();
}
if(param1.currentTarget.currWindow.currentFrameLabel == "downMouse")
{
param1.currentTarget.currWindow.gotoAndStop("down");
}
else if(param1.currentTarget.currWindow.currentFrameLabel != "down")
{
param1.currentTarget.currWindow.gotoAndStop("up");
}
}
private function stopVOButton(param1:Event) : void
{
if(CreateAccountGui)
{
CreateAccountGui.vo1Sound.stop();
}
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
private function voBtnClickHandler(param1:MouseEvent) : void
{
param1.stopPropagation();
if(CreateAccountGui.vo1Sound.isPlaying)
{
CreateAccountGui.vo1Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
else
{
CreateAccountGui.vo1Sound.play();
if(CreateAccountGui.vo1Sound.sc)
{
CreateAccountGui.vo1Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVOButton,false,0,true);
this._voBtn.play();
}
}
}
}
}
@@ -0,0 +1,662 @@
package createAccountGui
{
import achievement.AchievementXtCommManager;
import avatar.AvatarSwitch;
import avatar.AvatarUtility;
import avatar.INewAvatar;
import avatar.NewWorldAvatar;
import com.sbi.analytics.SBTracker;
import com.sbi.debug.DebugUtility;
import com.sbi.popup.SBOkPopup;
import com.sbi.popup.SBScreen;
import com.sbi.popup.SBWizard;
import com.sbi.popup.SBYesNoPopup;
import createAccountFlow.CreateAccountGui;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
import gui.DarkenManager;
import gui.GuiCarousel;
import gui.GuiManager;
import gui.SwitchManager;
import gui.UpsellManager;
import item.Item;
import localization.LocalizationManager;
public class GuiCreateAName extends SBScreen
{
private static const AVT_NAMES_1:int = 200;
private static const AVT_NAMES_2:int = 202;
private static const AVT_NAMES_3:int = 203;
private var _createANameScreen:MovieClip;
private var _backBtn:MovieClip;
private var _playBtn:MovieClip;
private var _voBtn:MovieClip;
private var _name1Carousel:GuiCarousel;
private var _name2Carousel:GuiCarousel;
private var _name3Carousel:GuiCarousel;
private var _randomNameLever:MovieClip;
private var _avatarNameTxt:TextField;
private var _titleTxt:TextField;
private var _avatarNameIndexes:Array;
private var _avatarNameChosenIds:Array;
private var _avtNames:Array;
private var _newAvatarFacilitator:INewAvatar;
private var _isFromWorld:Boolean;
private var _isChoosingFirstNonMember:Boolean;
private var _isValid:Boolean;
private var _buyBtnGreen:MovieClip;
private var _buyBtnRed:MovieClip;
private var _nextBtn:MovieClip;
private var _registrationPanel:MovieClip;
private var _isRandomSpin:Boolean;
public function GuiCreateAName(param1:Object, param2:SBWizard, param3:Boolean)
{
this._createANameScreen = param3 ? param1.registrationPanel.createAName : param1.accountCreation.registrationPanel.createAName;
this._backBtn = param3 ? param1.back_btn : param1.accountCreation.back_btn;
this._playBtn = param3 ? param1.play_btn : param1.accountCreation.play_btn;
super(this._createANameScreen,param2);
this._registrationPanel = MovieClip(this._createANameScreen.parent);
this._name1Carousel = new GuiCarousel(this._createANameScreen.nameScroller1);
this._name2Carousel = new GuiCarousel(this._createANameScreen.nameScroller2);
this._name3Carousel = new GuiCarousel(this._createANameScreen.nameScroller3);
this._randomNameLever = this._createANameScreen.nameLever;
this._randomNameLever.addEventListener(MouseEvent.MOUSE_DOWN,this.randomLeverMouseDownHandler,false,0,true);
this._avatarNameTxt = this._createANameScreen.aml_name_txt;
this._titleTxt = this._createANameScreen.choose_name_title_txt;
if(param3)
{
this._nextBtn = param1.next_btn;
this._buyBtnGreen = param1.buy_btn_green;
this._buyBtnRed = param1.buy_btn_red;
}
else
{
this._voBtn = this._createANameScreen.vo_btn;
}
}
public function init(param1:Object, param2:Boolean = false) : void
{
onEnterFromPrev = this.enterFromPrev;
onEnterFromNext = this.enterFromNext;
onLeaveToPrev = this.leaveToPrev;
onLeaveToNext = this.leaveToNext;
onPlay = param2 ? this.leaveToNext : null;
onClose = this.close;
updateScreen = this.updateScreenAssets;
this._newAvatarFacilitator = param2 ? new NewWorldAvatar() : INewAvatar(param1);
this._avatarNameTxt.restrict = "A-Za-z0-9 ";
this._avatarNameTxt.maxChars = 23;
this._isFromWorld = param2;
if(!this._isFromWorld)
{
this._voBtn.stop();
this._voBtn.addEventListener(MouseEvent.CLICK,this.voBtnClickHandler,false,0,true);
}
this._backBtn.visible = false;
this._avatarNameIndexes = [-1,-1,-1];
this._avatarNameChosenIds = [0,0,0];
if(this._avtNames == null)
{
this._avtNames = [-1,-1,-1];
}
if(param2)
{
GenericListXtCommManager.requestGenericList(AVT_NAMES_1,this.onNamesLoaded);
GenericListXtCommManager.requestGenericList(AVT_NAMES_2,this.onNamesLoaded);
GenericListXtCommManager.requestGenericList(AVT_NAMES_3,this.onNamesLoaded);
}
}
override public function destroy() : void
{
this._createANameScreen = null;
this._name1Carousel.destroy();
this._name1Carousel = null;
this._name2Carousel.destroy();
this._name2Carousel = null;
this._name3Carousel.destroy();
this._name3Carousel = null;
this._newAvatarFacilitator = null;
super.destroy();
}
public function enterFromNext(param1:Boolean = false) : void
{
this._isChoosingFirstNonMember = param1;
this._isValid = false;
this._registrationPanel.gotoAndPlay("backChooseAName");
CreateAccountGui.currAvatar().gotoAndPlay("backChooseAName");
MovieClip(this._registrationPanel.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("backChooseAName");
this.enterFromBoth();
}
public function enterFromPrev() : void
{
this._newAvatarFacilitator.hideConnectingMsg();
if(this._isFromWorld)
{
this._nextBtn.visible = false;
this._buyBtnGreen.visible = AvatarUtility.creationAssets.hasEnoughGems;
this._buyBtnRed.visible = !this._buyBtnGreen.visible;
}
this._backBtn.visible = this._isFromWorld ? !AvatarUtility.creationAssets.isCreatingWithoutChoosing : true;
this._isValid = false;
this.enterFromBoth();
}
public function enterFromBoth() : void
{
if(this._newAvatarFacilitator.playSound)
{
if(CreateAccountGui.vo2Sound)
{
CreateAccountGui.vo2Sound.play();
if(CreateAccountGui.vo2Sound.sc)
{
CreateAccountGui.vo2Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVOButton,false,0,true);
this._voBtn.play();
}
}
}
if(this._isFromWorld)
{
SBTracker.trackPageview("/game/play/popup/avatarCreation/CreateAName");
}
else
{
CreateAccountGui.trackUserCreateAccountPageChange("CreateAName");
}
}
public function leaveToNext() : Boolean
{
var _loc1_:int = 0;
var _loc2_:Object = null;
var _loc3_:Object = null;
AJAudio.stopRandomLever();
AJAudio.stopNameGenRotationSound();
if(!this._isValid)
{
if(this._isFromWorld)
{
if(AvatarSwitch.numTotalAvatars >= SwitchManager.NUM_AVATAR_SLOTS)
{
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14690),true,this.onSlotsFullOk);
return true;
}
if(AvatarUtility.creationAssets.isCreatingWithoutChoosing)
{
if(!gMainFrame.userInfo.isMember)
{
_loc2_ = AvatarUtility.avatarDefInfo[AvatarUtility.findAvDefIndexByType(AvatarUtility.creationAssets.currType)];
if(_loc2_.isMemberOnly)
{
UpsellManager.displayPopup(UpsellManager.ANIMALS,"createMembersOnlyAvatar");
return false;
}
}
}
if(AvatarUtility.creationAssets.isCreatingWithoutChoosing)
{
if((gMainFrame.userInfo.userVarCache.getUserVarValueById(AchievementXtCommManager.UV_AVT_VIEWABLE_FLAG) & 1 << AvatarUtility.creationAssets.currType - 1) != 0)
{
_loc3_ = AvatarUtility.avatarDefInfo[AvatarUtility.findAvatarIndexByType(AvatarUtility.creationAssets.currType)];
new SBYesNoPopup(this._registrationPanel.parent.parent.parent,LocalizationManager.translateIdAndInsertOnly(14782,AvatarUtility.creationAssets.currAvatarName,_loc3_.cost),true,this.onDiamondShopConfirmBuy);
return false;
}
}
if(!this._isChoosingFirstNonMember && !AvatarUtility.creationAssets.hasEnoughGems)
{
DarkenManager.showLoadingSpiral(true);
if(AvatarUtility.creationAssets.isCreatingWithoutChoosing)
{
this.onCloseNotEnoughGems();
}
else
{
Utility.setupNotEnoughGemsPopup(AvatarUtility.creationAssets.parent,AvatarUtility.creationAssets.currAvatarCost,AvatarUtility.creationAssets.currencyType);
}
return false;
}
if(AvatarUtility.creationAssets.isCreatingWithoutChoosing)
{
GuiManager.showDiamondConfirmation(AvatarUtility.creationAssets.currAvatarCost,this.onDiamondApprovePurchase);
return false;
}
}
_loc1_ = this._isFromWorld ? AvatarUtility.creationAssets.currType : CreateAccountGui.currType();
this._newAvatarFacilitator.newAvatarData(_loc1_,this._avatarNameTxt.text,this._avatarNameChosenIds,this.avNameValidCallback,this._isFromWorld ? AvatarUtility.creationAssets.isCreatingWithoutChoosing : false);
}
if(this._isValid)
{
if(CreateAccountGui.vo2Sound)
{
CreateAccountGui.vo2Sound.stop();
}
if(!this._isFromWorld)
{
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
this._registrationPanel.gotoAndPlay("playPlayerAccountOne");
CreateAccountGui.currAvatar().gotoAndPlay("playPlayerAccountOne");
MovieClip(this._registrationPanel.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("playPlayerAccountOne");
}
return true;
}
return false;
}
public function leaveToBoth() : Boolean
{
return true;
}
public function leaveToPrev() : Boolean
{
this._backBtn.visible = false;
if(!this._isFromWorld)
{
if(CreateAccountGui.vo2Sound)
{
CreateAccountGui.vo2Sound.stop();
}
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
return true;
}
public function loadNameLists() : void
{
GenericListXtCommManager.requestGenericList(AVT_NAMES_1,this.onNamesLoaded,null,this._isFromWorld);
GenericListXtCommManager.requestGenericList(AVT_NAMES_2,this.onNamesLoaded,null,this._isFromWorld);
GenericListXtCommManager.requestGenericList(AVT_NAMES_3,this.onNamesLoaded,null,this._isFromWorld);
}
public function close() : void
{
AvatarSwitch.addAvatarCallback = null;
this._newAvatarFacilitator.nameTypeScreenDone();
}
public function updateScreenAssets(param1:Boolean = false) : void
{
this._createANameScreen = this._registrationPanel.createAName;
this._avatarNameTxt = this._createANameScreen.aml_name_txt;
if(this._name1Carousel)
{
this._name1Carousel.destroy();
this._name1Carousel = null;
}
this._name1Carousel = new GuiCarousel(this._createANameScreen.nameScroller1);
if(this._name2Carousel)
{
this._name2Carousel.destroy();
this._name2Carousel = null;
}
this._name2Carousel = new GuiCarousel(this._createANameScreen.nameScroller2);
if(this._name3Carousel)
{
this._name3Carousel.destroy();
this._name3Carousel = null;
}
this._name3Carousel = new GuiCarousel(this._createANameScreen.nameScroller3);
this.setupNameLists(this._avtNames[0].names,this._avtNames[1].names,this._avtNames[2].names);
if(param1 || (this._isFromWorld ? Boolean(AvatarUtility.creationAssets.isCreatingWithoutChoosing) : Boolean(false)))
{
this._backBtn = MovieClip(this._registrationPanel.parent).back_btn;
this._playBtn = MovieClip(this._registrationPanel.parent).play_btn;
this._randomNameLever = this._createANameScreen.nameLever;
this._randomNameLever.addEventListener(MouseEvent.MOUSE_DOWN,this.randomLeverMouseDownHandler,false,0,true);
this._titleTxt = this._createANameScreen.choose_name_title_txt;
this._voBtn = this._createANameScreen.vo_btn;
if(this._isFromWorld)
{
this._nextBtn = MovieClip(this._registrationPanel.parent).next_btn;
this._buyBtnGreen = MovieClip(this._registrationPanel.parent).buy_btn_green;
this._buyBtnRed = MovieClip(this._registrationPanel.parent).buy_btn_red;
this._voBtn.visible = false;
this._buyBtnGreen.visible = AvatarUtility.creationAssets.hasEnoughGems;
this._buyBtnRed.visible = !this._buyBtnGreen.visible;
}
else
{
this._voBtn.addEventListener(MouseEvent.CLICK,this.voBtnClickHandler,false,0,true);
if(CreateAccountGui.vo2Sound.sc)
{
this._voBtn.play();
}
}
this._backBtn.visible = this._isFromWorld ? !AvatarUtility.creationAssets.isCreatingWithoutChoosing : true;
}
}
private function onNamesLoaded(param1:int, param2:Array) : void
{
var _loc5_:Array = null;
var _loc6_:String = null;
var _loc7_:int = 0;
var _loc8_:int = 0;
var _loc3_:Object = [];
var _loc4_:int = -1;
switch(param1)
{
case AVT_NAMES_1:
_loc4_ = 0;
_loc3_ = {
"names":[],
"locIds":[]
};
break;
case AVT_NAMES_2:
if(LocalizationManager.isCurrLanguageReversed())
{
_loc3_ = {
"names":[],
"femNames":[],
"locIds":[]
};
_loc4_ = 2;
}
else
{
_loc3_ = {
"names":[],
"types":[],
"locIds":[]
};
_loc4_ = 1;
}
break;
case AVT_NAMES_3:
if(LocalizationManager.isCurrLanguageReversed())
{
_loc3_ = {
"names":[],
"types":[],
"locIds":[]
};
_loc4_ = 1;
}
else
{
_loc3_ = {
"names":[],
"femNames":[],
"locIds":[]
};
_loc4_ = 2;
}
}
if(_loc4_ != -1)
{
_loc8_ = 0;
while(_loc8_ < param2.length)
{
if(_loc4_ == 1)
{
_loc5_ = LocalizationManager.translateIdOnly(param2[_loc8_]).split("$");
_loc6_ = _loc5_[0];
_loc7_ = Utility.findIndexToInsert(_loc3_.names,_loc6_);
_loc3_.names.splice(_loc7_,0,_loc6_);
if(_loc5_[1])
{
_loc3_.types.splice(_loc7_,0,_loc5_[1]);
}
}
else if(_loc4_ == 2)
{
_loc5_ = LocalizationManager.translateIdOnly(param2[_loc8_]).split("$");
_loc6_ = _loc5_[0].toLowerCase();
_loc7_ = Utility.findIndexToInsert(_loc3_.names,_loc6_);
_loc3_.names.splice(_loc7_,0,_loc6_);
if(_loc5_[1])
{
_loc3_.femNames.splice(_loc7_,0,_loc5_[1].toLowerCase());
}
}
else
{
_loc6_ = LocalizationManager.translateIdOnly(param2[_loc8_]);
_loc7_ = Utility.findIndexToInsert(_loc3_.names,_loc6_);
_loc3_.names.splice(_loc7_,0,_loc6_);
}
_loc3_.locIds.splice(_loc7_,0,param2[_loc8_]);
_loc8_++;
}
this._avtNames[_loc4_] = _loc3_;
}
if(this._avtNames[0] != -1 && this._avtNames[1] != -1 && this._avtNames[2] != -1)
{
this.setupNameLists(this._avtNames[0].names,this._avtNames[1].names,this._avtNames[2].names);
}
}
private function onCloseNotEnoughGems() : void
{
UpsellManager.displayPopup(UpsellManager.EXTRA_DIAMONDS_AS_MEMBER,"extraDiamonds");
}
private function onDiamondApprovePurchase() : void
{
var _loc1_:int = this._isFromWorld ? AvatarUtility.creationAssets.currType : CreateAccountGui.currType();
this._newAvatarFacilitator.newAvatarData(_loc1_,this._avatarNameTxt.text,this._avatarNameChosenIds,this.avNameValidCallback,true);
}
private function onSlotsFullOk(param1:MouseEvent) : void
{
param1.stopPropagation();
SBOkPopup.destroyInParentChain(param1.target.parent);
this.close();
}
private function onDiamondShopConfirmBuy(param1:Object) : void
{
var _loc2_:Object = null;
var _loc3_:int = 0;
var _loc4_:int = 0;
if(param1.status)
{
_loc2_ = AvatarUtility.avatarDefInfo[AvatarUtility.findAvatarIndexByType(AvatarUtility.creationAssets.currType)];
_loc3_ = int(gMainFrame.clientInfo.gemCount);
if(_loc3_ < _loc2_.cost)
{
DarkenManager.showLoadingSpiral(true);
Utility.setupNotEnoughGemsPopup(AvatarUtility.creationAssets.parent,_loc2_.cost,Item.GEM_CURRENCY);
}
else
{
_loc4_ = AvatarUtility.creationAssets.currType;
this._newAvatarFacilitator.newAvatarData(_loc4_,this._avatarNameTxt.text,this._avatarNameChosenIds,this.avNameValidCallback);
}
}
else
{
this.close();
}
}
private function avNameValidCallback(param1:Boolean) : void
{
if(param1)
{
this._isValid = true;
if(super.parentWizard != null)
{
super.parentWizard.next();
}
this._newAvatarFacilitator.nameTypeScreenDone();
}
else
{
DebugUtility.debugTrace("ERROR: Invalid avname?!");
}
}
private function setupNameLists(param1:Array, param2:Array, param3:Array) : void
{
this._name1Carousel.init(param1,this.names1Changed,false,false,null,false,this._avatarNameIndexes[0]);
this._name2Carousel.init(param2,this.names2Changed,false,false,null,false,this._avatarNameIndexes[1]);
this._name3Carousel.init(param3,this.names3Changed,false,false,null,false,this._avatarNameIndexes[2]);
if(this._avatarNameIndexes[0] == -1)
{
this.randomizeNames();
}
}
private function randomizeNames() : void
{
this._name1Carousel.soundsEnabled = false;
this._name2Carousel.soundsEnabled = false;
this._name3Carousel.soundsEnabled = false;
this._name1Carousel.pickRandomItem(true);
this._name2Carousel.pickRandomItem(true);
this._name3Carousel.pickRandomItem(true);
this._name1Carousel.soundsEnabled = true;
this._name2Carousel.soundsEnabled = true;
this._name3Carousel.soundsEnabled = true;
}
private function names1Changed() : void
{
if(Boolean(this._name1Carousel.selectedContentItem) && Boolean(this._name2Carousel.selectedContentItem) && Boolean(this._name3Carousel.selectedContentItem))
{
LocalizationManager.updateToFit(this._avatarNameTxt,this._name1Carousel.selectedContentItem + " " + this._name2Carousel.selectedContentItem + this._name3Carousel.selectedContentItem);
this._avatarNameChosenIds[0] = this._avtNames[0].locIds[this._name1Carousel.contentItemIndex];
this._avatarNameIndexes[0] = this._name1Carousel.contentItemIndex;
}
}
private function names2Changed() : void
{
if(Boolean(this._name1Carousel.selectedContentItem) && Boolean(this._name2Carousel.selectedContentItem) && Boolean(this._name3Carousel.selectedContentItem))
{
LocalizationManager.updateToFit(this._avatarNameTxt,this._name1Carousel.selectedContentItem + " " + this._name2Carousel.selectedContentItem + this._name3Carousel.selectedContentItem);
this._avatarNameChosenIds[1] = this._avtNames[1].locIds[this._name2Carousel.contentItemIndex];
this._avatarNameIndexes[1] = this._name2Carousel.contentItemIndex;
}
if(!this._name2Carousel.soundsEnabled && this._isRandomSpin)
{
this._name2Carousel.soundsEnabled = true;
this._name3Carousel.soundsEnabled = true;
this._isRandomSpin = false;
}
if(Boolean(this._avtNames[2]) && this._name3Carousel.hasLoaded)
{
if(this._name3Carousel.contentItems == this._avtNames[2].femNames)
{
this._name3Carousel.contentItems = this._avtNames[2].names;
}
else if(Boolean(this._avtNames[2].femNames) && Boolean(this._avtNames[2].femNames[0]))
{
this._name3Carousel.contentItems = this._avtNames[2].femNames;
}
if(this._name3Carousel.soundsEnabled)
{
this._name3Carousel.soundsEnabled = false;
this._name3Carousel.spinToIndex(this._name3Carousel.contentItemIndex,true);
this._name3Carousel.soundsEnabled = true;
}
else
{
this._name3Carousel.spinToIndex(this._name3Carousel.contentItemIndex,true);
}
}
}
private function names3Changed() : void
{
if(Boolean(this._name1Carousel.selectedContentItem) && Boolean(this._name2Carousel.selectedContentItem) && Boolean(this._name3Carousel.selectedContentItem))
{
LocalizationManager.updateToFit(this._avatarNameTxt,this._name1Carousel.selectedContentItem + " " + this._name2Carousel.selectedContentItem + this._name3Carousel.selectedContentItem);
this._avatarNameChosenIds[2] = this._avtNames[2].locIds[this._name3Carousel.contentItemIndex];
this._avatarNameIndexes[2] = this._name3Carousel.contentItemIndex;
}
if(!this._name3Carousel.soundsEnabled && this._isRandomSpin)
{
this._name3Carousel.soundsEnabled = true;
this._name2Carousel.soundsEnabled = true;
this._isRandomSpin = false;
}
}
private function randomLeverMouseDownHandler(param1:MouseEvent) : void
{
if(this._randomNameLever.currentFrameLabel == "_up")
{
this._isRandomSpin = true;
this._name2Carousel.soundsEnabled = false;
this._name3Carousel.soundsEnabled = false;
AJAudio.playRandomLever();
this._randomNameLever.gotoAndPlay("_play");
this._name1Carousel.pickRandomItem();
this._name2Carousel.pickRandomItem();
this._name3Carousel.pickRandomItem();
}
}
private function stopVOButton(param1:Event) : void
{
CreateAccountGui.vo2Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
private function enableNext() : void
{
}
private function tipsNeedTxtClickHandler(param1:MouseEvent) : void
{
}
private function voBtnClickHandler(param1:MouseEvent) : void
{
if(CreateAccountGui.vo2Sound.isPlaying)
{
CreateAccountGui.vo2Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
else
{
CreateAccountGui.vo2Sound.play();
if(CreateAccountGui.vo2Sound.sc)
{
CreateAccountGui.vo2Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVOButton,false,0,true);
this._voBtn.play();
}
}
}
}
}
@@ -0,0 +1,77 @@
package createAccountGui
{
import com.sbi.popup.SBWizard;
import flash.display.MovieClip;
public class GuiCreateWizard extends SBWizard
{
public const SCREENS_LENGTH:int = 2;
public var playerTagScreen:GuiPlayerTagScreen;
public var emailScreen:GuiEmailScreen;
public var viewAssets:Object;
public var chooseAnimalScreen:GuiChooseAnimal;
public var createANameScreen:GuiCreateAName;
public var rulesScreen:GuiRulesScreen;
public function GuiCreateWizard(param1:Object)
{
super();
this.viewAssets = param1;
}
override public function init(param1:MovieClip, param2:Boolean = true, param3:int = 1, param4:Array = null, param5:Boolean = true, param6:Boolean = false, param7:Boolean = true) : void
{
var _loc8_:Array = null;
this.chooseAnimalScreen = new GuiChooseAnimal(this.viewAssets,this,param7);
this.createANameScreen = new GuiCreateAName(this.viewAssets,this,param7);
this.createANameScreen.init(this.viewAssets,param7);
if(param7)
{
_loc8_ = new Array(this.chooseAnimalScreen,this.createANameScreen);
}
else
{
this.playerTagScreen = new GuiPlayerTagScreen(this.viewAssets,this);
this.playerTagScreen.init();
this.emailScreen = new GuiEmailScreen(this.viewAssets,this);
this.emailScreen.init();
this.rulesScreen = new GuiRulesScreen(this.viewAssets,this);
this.rulesScreen.init();
_loc8_ = new Array(this.chooseAnimalScreen,this.createANameScreen,this.playerTagScreen,this.emailScreen,this.rulesScreen);
}
super.init(param1,param2,param3,_loc8_,param5,param6,param7);
}
override public function destroy() : void
{
this.chooseAnimalScreen.destroy();
this.chooseAnimalScreen = null;
this.createANameScreen.destroy();
this.createANameScreen = null;
if(this.playerTagScreen)
{
this.playerTagScreen.destroy();
this.playerTagScreen = null;
}
if(this.emailScreen)
{
this.emailScreen.destroy();
this.emailScreen = null;
}
if(this.rulesScreen)
{
this.rulesScreen.destroy();
this.rulesScreen = null;
}
super.destroy();
}
}
}
@@ -0,0 +1,503 @@
package createAccountGui
{
import com.sbi.corelib.Utils;
import com.sbi.popup.SBScreen;
import com.sbi.popup.SBWizard;
import createAccountFlow.CreateAccountGui;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.text.TextField;
import gui.DarkenManager;
import gui.GuiStatusIcon;
public class GuiEmailScreen extends SBScreen
{
public static const MAX_EMAIL_LENGTH:int = 50;
private var _emailTxt:TextField;
private var _confirmTxt:TextField;
private var _emailBar:MovieClip;
private var _confirmBar:MovieClip;
private var _emailSts:MovieClip;
private var _confirmSts:MovieClip;
private var _voBtn:MovieClip;
private var _login:Object;
private const _commonDomains:Array = ["yahoo.com","hotmail.com","gmail.com","comcast.net","sbcglobal.net","att.net","msn.com","microsoft.com","aim.com","charter.net","aol.com","cox.net","live.com","live.ca","verizon.net","xtra.co.nz","shaw.ca","bellsouth.net","roadrunner.com","hotmail.co.uk","yahoo.co.uk","optonline.net","centurylink.net","centurytel.net","mail.com","mac.com","google.com","googlemail.com","compuserve.com","myspace.com","facebook.com","youtube.com","netscape.net","emailaccount.com","earthlink.net","rocketmail.com","broadband.com","ymail.com","supermail.com","junkmail.com","mindspring.com","juno.com","prodigy.net","excite.com","frontiernet.net","frontier.com","frontiernet.net","epix.net","love.com","hellokitty.com","sky.com","pacbell.net","champmail.com","heartmail.com","dragon.com","computer.org","digis.net","yahoo.ca","hotmail.ca","googlemail.co.uk","msn.ca","msn.co.uk","microsoft.co.uk","microsoft.ca","aol.co.uk","live.co.uk","compuserve.co.uk","netscape.ca"];
private var _validationPending:Boolean;
private var _continueClicked:Boolean;
private var _validatedEmail:String;
private var _lastCheckedEmail:String;
private var _validatedConfirmEmail:String;
private var _prevConfirmTxt:String;
private var _emailScreen:MovieClip;
private var _playBtn:MovieClip;
private var _nextBtn:MovieClip;
private var _registrationPanel:MovieClip;
private var _emailText:String;
private var _confirmText:String;
private var _emailStsTracking:Object;
private var _confirmStsTracking:Object;
public function GuiEmailScreen(param1:Object, param2:SBWizard)
{
this._login = param1;
this._emailScreen = param1.accountCreation.registrationPanel.email_popup;
this._registrationPanel = MovieClip(this._emailScreen.parent);
super(this._emailScreen,param2);
this._emailTxt = this._emailScreen.email_txt;
this._emailTxt.maxChars = MAX_EMAIL_LENGTH;
this._confirmTxt = this._emailScreen.confirm_txt;
this._confirmTxt.maxChars = MAX_EMAIL_LENGTH;
this._emailBar = this._emailScreen.textBar;
this._confirmBar = this._emailScreen.confirmTextBar;
this._emailSts = this._emailScreen.email_status;
this._confirmSts = this._emailScreen.confirm_status;
this._emailStsTracking = {
"xTracking":false,
"waitTracking":false,
"checkTracking":false
};
this._confirmStsTracking = {
"xTracking":false,
"waitTracking":false,
"checkTracking":false
};
GuiStatusIcon.initClipOff(this._emailSts,this._emailStsTracking);
GuiStatusIcon.initClipOff(this._confirmSts,this._confirmStsTracking);
this._voBtn = this._emailScreen.vo_btn;
this._playBtn = this._login.accountCreation.play_btn;
this._nextBtn = this._login.accountCreation.next_btn;
this._nextBtn.gotoAndStop(1);
}
public function init() : void
{
onEnterFromPrev = this.enterFromPrev;
onEnterFromNext = this.enterFromNext;
onLeaveToPrev = this.leaveToPrev;
onLeaveToNext = this.leaveToNext;
onPlay = null;
updateScreen = this.updateScreenAssets;
this._validationPending = false;
this._continueClicked = false;
this._prevConfirmTxt = "";
this._emailText = "";
this._confirmText = "";
this._emailTxt.addEventListener(KeyboardEvent.KEY_UP,this.emailKeyUpHandler,false,0,true);
this._confirmTxt.addEventListener(KeyboardEvent.KEY_UP,this.confirmKeyUpHandler,false,0,true);
this._confirmTxt.addEventListener(Event.CHANGE,this.onTextInput,false,0,true);
this._confirmTxt.addEventListener(MouseEvent.MOUSE_DOWN,this.onConfirmText,false,0,true);
this._voBtn.stop();
this._voBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.voBtnClickHandler,false,0,true);
}
override public function destroy() : void
{
this._voBtn.removeEventListener(MouseEvent.MOUSE_DOWN,this.voBtnClickHandler);
super.destroy();
}
public function onTextInput(param1:Event) : void
{
param1.stopPropagation();
if(this._confirmTxt.text.substring(0,this._confirmTxt.text.length - 1) == this._prevConfirmTxt)
{
this._prevConfirmTxt = this._confirmTxt.text;
return;
}
if(this._confirmTxt.text == this._prevConfirmTxt.substring(0,this._prevConfirmTxt.length - 1))
{
this._prevConfirmTxt = this._confirmTxt.text;
return;
}
this._confirmTxt.text = this._prevConfirmTxt;
this._confirmTxt.setSelection(this._confirmTxt.text.length,this._confirmTxt.text.length);
this._confirmText = this._confirmTxt.text;
}
public function onConfirmText(param1:MouseEvent) : void
{
param1.stopPropagation();
this._confirmTxt.setSelection(this._confirmTxt.text.length,this._confirmTxt.text.length);
}
public function enterFromNext() : void
{
if(Boolean(this._emailSts["_check"].visible) && Boolean(this._confirmSts["_check"].visible))
{
this._nextBtn.visible = true;
}
else
{
this._nextBtn.visible = false;
}
CreateAccountGui.trackUserCreateAccountPageChange("ParentEmail");
CreateAccountGui.vo4Sound.play();
if(CreateAccountGui.vo4Sound.sc)
{
CreateAccountGui.vo4Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVO,false,0,true);
this._voBtn.play();
}
CreateAccountGui.hideNotifyPopup();
}
public function enterFromPrev() : void
{
this.enterFromNext();
MovieClip(this._emailScreen.parent).gotoAndPlay("playPlayerAccountTwo");
CreateAccountGui.currAvatar().gotoAndPlay("playPlayerAccountTwo");
MovieClip(this._emailScreen.parent.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("playPlayerAccountTwo");
}
public function enterFromBoth() : void
{
}
public function leaveToPrev() : Boolean
{
this._nextBtn.visible = true;
CreateAccountGui.vo4Sound.stop();
this._voBtn.stop();
MovieClip(this._emailScreen.parent).gotoAndPlay("backAccountOne");
CreateAccountGui.currAvatar().gotoAndPlay("backAccountOne");
MovieClip(this._emailScreen.parent.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("backAccountOne");
return true;
}
public function leaveToNext() : Boolean
{
CreateAccountGui.vo4Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
CreateAccountGui.hideNotifyPopup();
return this.nextBtnHandler();
}
public function updateScreenAssets(param1:Boolean = false) : void
{
this._emailScreen = this._registrationPanel.email_popup;
this._emailTxt = this._emailScreen.email_txt;
this._emailTxt.maxChars = MAX_EMAIL_LENGTH;
this._emailTxt.text = this._emailText;
this._confirmTxt = this._emailScreen.confirm_txt;
this._confirmTxt.maxChars = MAX_EMAIL_LENGTH;
this._confirmTxt.text = this._confirmText;
this._emailBar = this._emailScreen.textBar;
this._confirmBar = this._emailScreen.confirmTextBar;
this._emailSts = this._emailScreen.email_status;
this._confirmSts = this._emailScreen.confirm_status;
GuiStatusIcon.setVisBasedOnTrackers(this._emailSts,this._emailStsTracking);
GuiStatusIcon.setVisBasedOnTrackers(this._confirmSts,this._confirmStsTracking);
this._voBtn = this._emailScreen.vo_btn;
this._playBtn = this._login.accountCreation.play_btn;
this._nextBtn = this._login.accountCreation.next_btn;
this._nextBtn.gotoAndStop(1);
if(param1)
{
this._emailTxt.addEventListener(KeyboardEvent.KEY_UP,this.emailKeyUpHandler,false,0,true);
this._confirmTxt.addEventListener(KeyboardEvent.KEY_UP,this.confirmKeyUpHandler,false,0,true);
this._confirmTxt.addEventListener(Event.CHANGE,this.onTextInput,false,0,true);
this._confirmTxt.addEventListener(MouseEvent.MOUSE_DOWN,this.onConfirmText,false,0,true);
if(CreateAccountGui.vo4Sound.sc)
{
this._voBtn.play();
}
else
{
this._voBtn.stop();
}
this._voBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.voBtnClickHandler,false,0,true);
if(Boolean(this._emailSts["_check"].visible) && Boolean(this._confirmSts["_check"].visible))
{
this._nextBtn.visible = true;
}
else
{
this._nextBtn.visible = false;
}
this._playBtn.visible = false;
}
}
public function get currEmail() : String
{
return this._emailTxt.text;
}
public function stopVO(param1:Event) : void
{
if(CreateAccountGui)
{
CreateAccountGui.vo4Sound.stop();
}
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
public function emailValidCallback(param1:Boolean, param2:Boolean) : void
{
DarkenManager.showLoadingSpiral(false);
this._validationPending = false;
this._emailSts.visible = true;
if(param2)
{
this._validatedEmail = null;
GuiStatusIcon.showX(this._emailSts,this._emailStsTracking);
this._nextBtn.visible = false;
if(this._emailTxt.text == "")
{
GuiStatusIcon.initClipOff(this._emailSts,this._emailStsTracking);
this._emailBar.visible = true;
}
else
{
this._emailBar.visible = false;
}
}
else
{
GuiStatusIcon.showCheck(this._emailSts,this._emailStsTracking);
if(this._confirmSts["_check"].visible)
{
this._nextBtn.visible = true;
}
this._emailBar.visible = true;
if(!param1)
{
this._validatedEmail = this._emailTxt.text;
}
}
this._continueClicked = false;
}
public function confirmValidCallback(param1:Boolean) : void
{
this._confirmSts.visible = true;
if(param1)
{
this._validatedConfirmEmail = null;
GuiStatusIcon.showX(this._confirmSts,this._confirmStsTracking);
this._nextBtn.visible = false;
if(this._confirmTxt.text == "")
{
GuiStatusIcon.initClipOff(this._confirmSts,this._confirmStsTracking);
this._confirmBar.visible = true;
}
else
{
this._confirmBar.visible = false;
}
}
else if(this._emailSts["_check"].visible)
{
GuiStatusIcon.showCheck(this._confirmSts,this._confirmStsTracking);
this._nextBtn.visible = true;
this._confirmBar.visible = true;
this._validatedConfirmEmail = this._confirmTxt.text;
if(this._continueClicked)
{
this.nextBtnHandler();
}
}
this._continueClicked = false;
}
private function emailMarkEmptyAsError() : void
{
if(this._emailTxt.text == "")
{
GuiStatusIcon.showX(this._emailSts,this._emailStsTracking);
this._emailSts.visible = true;
this._emailBar.visible = false;
}
}
private function confirmMarkEmptyAsError() : void
{
if(this._confirmTxt.text == "")
{
GuiStatusIcon.showX(this._confirmSts,this._confirmStsTracking);
this._confirmSts.visible = true;
this._confirmBar.visible = false;
}
}
private function emailKeyUpHandler(param1:KeyboardEvent) : void
{
var _loc2_:Array = null;
var _loc3_:Boolean = false;
var _loc4_:Boolean = false;
var _loc5_:int = 0;
var _loc6_:int = 0;
var _loc7_:String = null;
var _loc8_:Array = null;
var _loc9_:Array = null;
var _loc10_:int = 0;
this._emailText = this._emailTxt.text;
if(this._emailTxt.text == "")
{
GuiStatusIcon.initClipOff(this._emailSts,this._emailStsTracking);
this._emailBar.visible = true;
this._lastCheckedEmail = this._emailTxt.text;
this._validatedEmail = null;
return;
}
if(this._emailTxt.text != this._lastCheckedEmail)
{
this._validationPending = true;
this._lastCheckedEmail = this._emailTxt.text;
_loc2_ = this._emailTxt.text.split("@");
if(_loc2_.length > 1 && _loc2_[0].toLowerCase() == this._login.validatedUserName.toLowerCase())
{
parentWizard.prev();
return;
}
_loc3_ = Boolean(!RegExp(/\A([^;:,\(\)\[\]@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i)["exec"](this._emailTxt.text) || this._emailTxt.text.length > MAX_EMAIL_LENGTH);
if(!_loc3_)
{
_loc4_ = false;
_loc5_ = 0;
_loc6_ = int(this._commonDomains.length);
_loc7_ = this._emailTxt.text.substr(this._emailTxt.text.indexOf("@") + 1).toLowerCase();
while(_loc5_ < _loc6_)
{
if(_loc7_ == this._commonDomains[_loc5_])
{
_loc4_ = true;
CreateAccountGui.hideNotifyPopup();
break;
}
_loc5_++;
}
if(!_loc4_)
{
_loc8_ = new Array();
_loc9_ = _loc7_.split("");
_loc5_ = 0;
while(_loc5_ < _loc6_)
{
_loc10_ = Utils.damerauLevenshteinDistance(_loc9_,this._commonDomains[_loc5_].split(""),64);
if(_loc10_ == 1)
{
_loc8_.push(this._commonDomains[_loc5_]);
}
_loc5_++;
}
if(_loc8_.length > 0)
{
CreateAccountGui.showEmailDomainMisspelledWarning(_loc8_);
}
else
{
CreateAccountGui.hideNotifyPopup();
}
}
}
this.emailValidCallback(_loc3_,_loc3_);
if(this._confirmTxt.text != "")
{
this.confirmKeyUpHandler(null);
}
}
}
private function confirmKeyUpHandler(param1:KeyboardEvent) : void
{
this._confirmText = this._confirmTxt.text;
if(this._confirmTxt.text == "")
{
GuiStatusIcon.initClipOff(this._confirmSts,this._confirmStsTracking);
this._validatedConfirmEmail = null;
return;
}
if(param1 != null)
{
CreateAccountGui.hideNotifyPopup();
}
if(this._emailTxt.text == this._confirmTxt.text)
{
this.confirmValidCallback(false);
}
else
{
this.confirmValidCallback(true);
}
}
private function voBtnClickHandler(param1:MouseEvent) : void
{
if(CreateAccountGui.vo4Sound.isPlaying)
{
CreateAccountGui.vo4Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
else
{
CreateAccountGui.vo4Sound.play();
if(CreateAccountGui.vo4Sound.sc)
{
CreateAccountGui.vo4Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVO,false,0,true);
this._voBtn.play();
}
}
}
private function nextBtnHandler() : Boolean
{
if(this._validationPending)
{
this._continueClicked = true;
return false;
}
if(this._validatedEmail != null)
{
if(this._validatedConfirmEmail != null)
{
this.stopVO(null);
this._continueClicked = true;
this._validationPending = false;
return true;
}
if(this._confirmTxt.text == "")
{
this.confirmMarkEmptyAsError();
}
CreateAccountGui.showMustConfirmMsg();
return false;
}
CreateAccountGui.showUsernameExistsMsg(CreateAccountGui.MSG_ID_EMAIL_INVALID,false);
if(this._emailTxt.text == "")
{
this.emailMarkEmptyAsError();
}
return false;
}
}
}
@@ -0,0 +1,815 @@
package createAccountGui
{
import com.sbi.analytics.SBTracker;
import com.sbi.popup.SBScreen;
import com.sbi.popup.SBWizard;
import createAccountFlow.CreateAccountGui;
import createAccountFlow.CreateAccountXtCommManager;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.events.TextEvent;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.utils.Timer;
import gui.GuiDropdown;
import gui.GuiRadioButtonGroup;
import gui.GuiSoundBtnSubMenu;
import gui.GuiStatusIcon;
public class GuiPlayerTagScreen extends SBScreen
{
public static const NUM_SUGGESTED_NAMES:int = 4;
private var _newBdayMonthDpn:GuiDropdown;
private var _newBdayDayDpn:GuiDropdown;
private var _newGenderRbg:GuiRadioButtonGroup;
private var _newPlayerAgeDpn:GuiDropdown;
private var _nameSuggestionsFrame:MovieClip;
private var _nameSugTxts:Array;
private var _userNameKeyUpDelayTimer:Timer;
private var _newUsernameTxt:TextField;
private var _newUsernameBar:MovieClip;
private var _newPasswordTxt:TextField;
private var _newPasswordBar:MovieClip;
private var _animalFrame:MovieClip;
private var _animalFrameAnimalHolder:MovieClip;
private var _activeSelBar1:MovieClip;
private var _activeSelBar2:MovieClip;
private var _activeSelBar3:MovieClip;
private var _activeSelBar4:MovieClip;
private var _backBtn:MovieClip;
private var _nextBtn:MovieClip;
private var _genderAgeSts:MovieClip;
private var _userNameSts:MovieClip;
private var _passWordSts:MovieClip;
private var _tipsNeedTxt:TextField;
private var _privacyPolicyTxt:TextField;
private var _voBtn:MovieClip;
private var _nameTipPopup:MovieClip;
private var _passwordTipPopup:MovieClip;
private var _creation:Object;
private var _playerTagScreen:MovieClip;
private var _validationPending:Boolean;
private var _lastCheckedPlayerTag:String;
private var _continueClicked:Boolean;
private var _numTimesBadUsername:int;
private var _isEmailSameAsUserName:Boolean;
private var _registrationPanel:MovieClip;
private var _selectedBdayMonthIndex:int;
private var _selectedBdayDayIndex:int;
private var _selectedGender:int;
private var _selectedBdayAgeIndex:int;
private var _passwordText:String;
private var _genderAgeTracking:Object;
private var _userNameTracking:Object;
private var _passWordTracking:Object;
public function GuiPlayerTagScreen(param1:Object, param2:SBWizard)
{
this._creation = param1;
this._creation.accountCreation.registrationPanel.gotoAndStop("intro");
this._playerTagScreen = this._creation.accountCreation.registrationPanel.userNamePanel.userNameContainer.signup_wizard.act_popup;
super(this._playerTagScreen,param2);
this._registrationPanel = MovieClip(this._creation.accountCreation.registrationPanel);
this._newBdayMonthDpn = new GuiDropdown(this._playerTagScreen.birthday.dropdown_month);
this._newBdayDayDpn = new GuiDropdown(this._playerTagScreen.birthday.dropdown_day);
this._newGenderRbg = new GuiRadioButtonGroup(this._playerTagScreen.ageGender.radioGenderBtn);
this._newPlayerAgeDpn = new GuiDropdown(this._playerTagScreen.ageGender.dropdown_age);
this._nameSuggestionsFrame = this._playerTagScreen.NamePopup;
this._newUsernameTxt = this._playerTagScreen.username.pTag_txt;
this._newUsernameBar = this._playerTagScreen.username.textBar1;
this._newPasswordTxt = this._playerTagScreen.password.pswd_txt;
this._newPasswordBar = this._playerTagScreen.password.textBar2;
this._activeSelBar1 = this._playerTagScreen.act_bar_sel1;
this._activeSelBar2 = this._playerTagScreen.act_bar_sel2;
this._activeSelBar3 = this._playerTagScreen.username.act_bar_sel3;
this._activeSelBar4 = this._playerTagScreen.password.act_bar_sel4;
this._tipsNeedTxt = this._playerTagScreen.tips_help_txt;
this._privacyPolicyTxt = this._playerTagScreen.pp_txt;
this._voBtn = this._playerTagScreen.vo_Btn;
this._backBtn = this._creation.accountCreation.back_btn;
this._backBtn.gotoAndStop(1);
this._nextBtn = this._creation.accountCreation.next_btn;
this._nextBtn.gotoAndStop(1);
this._genderAgeSts = this._playerTagScreen.ageGender.genderAge_status;
this._userNameSts = this._playerTagScreen.username.username_status;
this._passWordSts = this._playerTagScreen.password.pswd_status;
this._nameTipPopup = this._playerTagScreen.nameTipPopup;
this._passwordTipPopup = this._playerTagScreen.passwordTipPopup;
}
public function init() : void
{
var _loc2_:GuiSoundBtnSubMenu = null;
onEnterFromPrev = this.enterFromPrev;
onEnterFromNext = this.enterFromNext;
onLeaveToPrev = this.leaveToPrev;
onLeaveToNext = this.leaveToNext;
updateScreen = this.updateScreenAssets;
this._playerTagScreen.ageGender.visible = false;
this._playerTagScreen.username.visible = false;
this._playerTagScreen.password.visible = false;
this._genderAgeTracking = {
"xTracking":false,
"waitTracking":false,
"checkTracking":false
};
this._userNameTracking = {
"xTracking":false,
"waitTracking":false,
"checkTracking":false
};
this._passWordTracking = {
"xTracking":false,
"waitTracking":false,
"checkTracking":false
};
GuiStatusIcon.initClipOff(this._genderAgeSts,this._genderAgeTracking);
GuiStatusIcon.initClipOff(this._userNameSts,this._userNameTracking);
GuiStatusIcon.initClipOff(this._passWordSts,this._passWordTracking);
this._nameTipPopup.visible = false;
this._passwordTipPopup.visible = false;
this._validationPending = false;
this._continueClicked = false;
this._lastCheckedPlayerTag = "";
this._passwordText = "";
this._newBdayMonthDpn.init(-1.05,0,"-");
this._newBdayDayDpn.init(0.55,0,"-");
this._newPlayerAgeDpn.init(0.55,6,"-");
this._nameSuggestionsFrame.visible = false;
this._nameSuggestionsFrame["bx"].addEventListener(MouseEvent.MOUSE_DOWN,this.nameSugCloseBtnMouseDownHandler,false,0,true);
this._nameSugTxts = [];
var _loc1_:int = 0;
while(_loc1_ < NUM_SUGGESTED_NAMES)
{
_loc2_ = this._nameSuggestionsFrame["name" + (_loc1_ + 1)];
this._nameSugTxts[_loc1_] = _loc2_["pTag_txt"];
TextField(this._nameSugTxts[_loc1_]).text = "ysername" + _loc1_;
_loc2_.addEventListener(MouseEvent.CLICK,this.nameSugClickHandler,false,0,true);
_loc1_++;
}
this._userNameKeyUpDelayTimer = new Timer(1222);
this._userNameKeyUpDelayTimer.addEventListener(TimerEvent.TIMER,this.userNameTxtChangeDelayTimerHandler,false,0,true);
this._newUsernameTxt.restrict = "A-Za-z0-9";
this._newUsernameTxt.maxChars = 20;
this._newPasswordTxt.maxChars = 32;
this._activeSelBar1.visible = false;
this._activeSelBar2.visible = false;
this._activeSelBar3.visible = false;
this._activeSelBar4.visible = false;
this._selectedBdayMonthIndex = -1;
this._selectedBdayAgeIndex = -1;
this._selectedBdayDayIndex = -1;
this._selectedGender = -1;
this._newBdayMonthDpn.currDropDown.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar1FocusHandler,false,0,true);
this._newBdayDayDpn.currDropDown.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar1FocusHandler,false,0,true);
this._newBdayMonthDpn.currDropDown.addEventListener(FocusEvent.FOCUS_IN,this.selBar1FocusHandler,false,0,true);
this._newBdayDayDpn.currDropDown.addEventListener(FocusEvent.FOCUS_IN,this.selBar1FocusHandler,false,0,true);
this._newGenderRbg.currRadioButton.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar2FocusHandler,false,0,true);
this._newPlayerAgeDpn.currDropDown.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar2FocusHandler,false,0,true);
this._newPlayerAgeDpn.currDropDown.addEventListener(FocusEvent.FOCUS_IN,this.selBar2FocusHandler,false,0,true);
this._newUsernameTxt.addEventListener(Event.CHANGE,this.userNameTxtChangeHandler,false,0,true);
this._newUsernameTxt.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar3FocusHandler,false,0,true);
this._newUsernameTxt.addEventListener(KeyboardEvent.KEY_DOWN,this.selBar3FocusHandler,false,0,true);
this._newUsernameTxt.addEventListener(FocusEvent.FOCUS_IN,this.selBar3FocusHandler,false,0,true);
this._newPasswordTxt.addEventListener(Event.CHANGE,this.passWordTxtChangeHandler,false,0,true);
this._newPasswordTxt.addEventListener(FocusEvent.FOCUS_IN,this.selBar4FocusHandler,false,0,true);
this._tipsNeedTxt.htmlText = "<a href=\'event:\'><u>" + this._tipsNeedTxt.text + "</u></a>";
this._tipsNeedTxt.addEventListener(TextEvent.LINK,this.tipsNeedTxtClickHandler,false,0,true);
this._privacyPolicyTxt.htmlText = "<a href=\'http://www.animaljam.com/privacy\' target=\'_blank\'><u>" + this._privacyPolicyTxt.text + "</u></a>";
this._voBtn.stop();
this._voBtn.addEventListener(MouseEvent.CLICK,this.voBtnClickHandler,false,0,true);
}
override public function destroy() : void
{
this._newBdayMonthDpn.currDropDown.removeEventListener(MouseEvent.MOUSE_DOWN,this.selBar1FocusHandler);
this._newBdayDayDpn.currDropDown.removeEventListener(MouseEvent.MOUSE_DOWN,this.selBar1FocusHandler);
this._newBdayMonthDpn.currDropDown.removeEventListener(FocusEvent.FOCUS_IN,this.selBar1FocusHandler);
this._newBdayDayDpn.currDropDown.removeEventListener(FocusEvent.FOCUS_IN,this.selBar1FocusHandler);
this._newGenderRbg.currRadioButton.removeEventListener(MouseEvent.MOUSE_DOWN,this.selBar2FocusHandler);
this._newPlayerAgeDpn.currDropDown.removeEventListener(MouseEvent.MOUSE_DOWN,this.selBar2FocusHandler);
this._newPlayerAgeDpn.currDropDown.removeEventListener(FocusEvent.FOCUS_IN,this.selBar2FocusHandler);
this._newUsernameTxt.removeEventListener(Event.CHANGE,this.userNameTxtChangeHandler);
this._newUsernameTxt.removeEventListener(MouseEvent.MOUSE_DOWN,this.selBar3FocusHandler);
this._newUsernameTxt.removeEventListener(KeyboardEvent.KEY_DOWN,this.selBar3FocusHandler);
this._newUsernameTxt.removeEventListener(FocusEvent.FOCUS_IN,this.selBar3FocusHandler);
this._newPasswordTxt.removeEventListener(Event.CHANGE,this.passWordTxtChangeHandler);
this._newPasswordTxt.removeEventListener(FocusEvent.FOCUS_IN,this.selBar4FocusHandler);
this._tipsNeedTxt.removeEventListener(TextEvent.LINK,this.tipsNeedTxtClickHandler);
this._voBtn.removeEventListener(MouseEvent.CLICK,this.voBtnClickHandler);
this._newBdayMonthDpn.destroy();
this._newBdayMonthDpn = null;
this._newBdayDayDpn.destroy();
this._newBdayDayDpn = null;
this._newPlayerAgeDpn.destroy();
this._newPlayerAgeDpn = null;
this._newGenderRbg.destroy();
this._newGenderRbg = null;
this._nameSuggestionsFrame["bx"].removeEventListener(MouseEvent.MOUSE_DOWN,this.nameSugCloseBtnMouseDownHandler);
this._userNameKeyUpDelayTimer.stop();
this._userNameKeyUpDelayTimer = null;
super.destroy();
}
public function enterFromPrev() : void
{
this._playerTagScreen.ageGender.visible = true;
this._playerTagScreen.username.visible = true;
this._playerTagScreen.password.visible = true;
this._numTimesBadUsername = 0;
CreateAccountGui.vo3Sound.play();
if(CreateAccountGui.vo3Sound.sc)
{
CreateAccountGui.vo3Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVOButton,false,0,true);
this._voBtn.play();
}
CreateAccountGui.trackUserCreateAccountPageChange("CreatePlayerAccount");
this.selBar1FocusHandler(null);
this._nextBtn.enabled = false;
CreateAccountGui.hideNotifyPopup();
if(Boolean(this._userNameSts["_check"].visible) && Boolean(this._passWordSts["_check"].visible))
{
this._nextBtn.visible = true;
}
else
{
this._nextBtn.visible = false;
}
}
public function enterFromNext() : Boolean
{
this.enterFromPrev();
if(CreateAccountGui.currEmailAddress().split("@")[0].toLowerCase() == this._newUsernameTxt.text.toLowerCase())
{
this._isEmailSameAsUserName = true;
gMainFrame.stage.focus = this._newUsernameTxt;
CreateAccountGui.showEmailCannotMatchUserName();
this._nextBtn.visible = false;
this._newUsernameBar.visible = false;
this._validationPending = true;
GuiStatusIcon.showWait(this._userNameSts,this._userNameTracking);
this._userNameKeyUpDelayTimer.reset();
this._userNameKeyUpDelayTimer.start();
}
return true;
}
public function leaveToNext() : Boolean
{
CreateAccountGui.vo3Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
CreateAccountGui.showTipsPopup(false);
var _loc1_:Boolean = this._isEmailSameAsUserName;
var _loc2_:Boolean = this.nextBtnHandler();
if(_loc1_)
{
super.parentWizard.next();
}
return _loc2_;
}
public function leaveToBoth() : void
{
}
public function leaveToPrev() : Boolean
{
CreateAccountGui.vo3Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
this._numTimesBadUsername = 0;
CreateAccountGui.showNewChrPopup();
CreateAccountGui.showTipsPopup(false);
this._nextBtn.visible = true;
return true;
}
public function updateScreenAssets(param1:Boolean = false) : void
{
var _loc2_:int = 0;
var _loc3_:GuiSoundBtnSubMenu = null;
this._playerTagScreen = this._registrationPanel.userNamePanel.userNameContainer.signup_wizard.act_popup;
this._newBdayMonthDpn = new GuiDropdown(this._playerTagScreen.birthday.dropdown_month);
this._newBdayMonthDpn.init(-1.05,this._selectedBdayMonthIndex,this._selectedBdayMonthIndex == -1 ? "-" : null);
this._newBdayDayDpn = new GuiDropdown(this._playerTagScreen.birthday.dropdown_day);
this._newBdayDayDpn.init(0.55,this._selectedBdayDayIndex,this._selectedBdayDayIndex == -1 ? "-" : null);
this._newGenderRbg = new GuiRadioButtonGroup(this._playerTagScreen.ageGender.radioGenderBtn);
this._newGenderRbg.selected = this._selectedGender;
this._newPlayerAgeDpn = new GuiDropdown(this._playerTagScreen.ageGender.dropdown_age);
this._newPlayerAgeDpn.init(0.55,this._selectedBdayAgeIndex,this._selectedBdayAgeIndex == -1 ? "-" : null);
this._nameSuggestionsFrame = this._playerTagScreen.NamePopup;
this._newUsernameTxt = this._playerTagScreen.username.pTag_txt;
this._newUsernameTxt.text = this._lastCheckedPlayerTag ? this._lastCheckedPlayerTag : "";
this._newUsernameBar = this._playerTagScreen.username.textBar1;
this._newPasswordTxt = this._playerTagScreen.password.pswd_txt;
this._newPasswordTxt.text = this._passwordText;
this._newPasswordBar = this._playerTagScreen.password.textBar2;
this._activeSelBar1 = this._playerTagScreen.act_bar_sel1;
this._activeSelBar2 = this._playerTagScreen.act_bar_sel2;
this._activeSelBar3 = this._playerTagScreen.username.act_bar_sel3;
this._activeSelBar4 = this._playerTagScreen.password.act_bar_sel4;
this._tipsNeedTxt = this._playerTagScreen.tips_help_txt;
this._privacyPolicyTxt = this._playerTagScreen.pp_txt;
this._voBtn = this._playerTagScreen.vo_Btn;
this._backBtn = this._creation.accountCreation.back_btn;
this._backBtn.gotoAndStop(1);
this._nextBtn = this._creation.accountCreation.next_btn;
this._nextBtn.gotoAndStop(1);
this._genderAgeSts = this._playerTagScreen.ageGender.genderAge_status;
this._userNameSts = this._playerTagScreen.username.username_status;
this._passWordSts = this._playerTagScreen.password.pswd_status;
this._nameTipPopup = this._playerTagScreen.nameTipPopup;
this._passwordTipPopup = this._playerTagScreen.passwordTipPopup;
this._playerTagScreen.username.changeBtn.visible = false;
this._playerTagScreen.ageGender.visible = true;
this._playerTagScreen.username.visible = true;
this._playerTagScreen.password.visible = true;
GuiStatusIcon.setVisBasedOnTrackers(this._genderAgeSts,this._genderAgeTracking);
GuiStatusIcon.setVisBasedOnTrackers(this._userNameSts,this._userNameTracking);
GuiStatusIcon.setVisBasedOnTrackers(this._passWordSts,this._passWordTracking);
this._nameTipPopup.visible = false;
this._passwordTipPopup.visible = false;
this._validationPending = false;
this._continueClicked = false;
this._nameSuggestionsFrame.visible = false;
this._activeSelBar1.visible = false;
this._activeSelBar2.visible = false;
this._activeSelBar3.visible = false;
this._activeSelBar4.visible = false;
if(param1)
{
this._newUsernameTxt.restrict = "A-Za-z0-9";
this._newUsernameTxt.maxChars = 20;
this._newPasswordTxt.maxChars = 32;
this._nameSuggestionsFrame["bx"].addEventListener(MouseEvent.MOUSE_DOWN,this.nameSugCloseBtnMouseDownHandler,false,0,true);
this._nameSugTxts = [];
_loc2_ = 0;
while(_loc2_ < NUM_SUGGESTED_NAMES)
{
_loc3_ = this._nameSuggestionsFrame["name" + (_loc2_ + 1)];
this._nameSugTxts[_loc2_] = _loc3_["pTag_txt"];
TextField(this._nameSugTxts[_loc2_]).text = "ysername" + _loc2_;
_loc3_.addEventListener(MouseEvent.CLICK,this.nameSugClickHandler,false,0,true);
_loc2_++;
}
this._newBdayMonthDpn.currDropDown.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar1FocusHandler,false,0,true);
this._newBdayDayDpn.currDropDown.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar1FocusHandler,false,0,true);
this._newBdayMonthDpn.currDropDown.addEventListener(FocusEvent.FOCUS_IN,this.selBar1FocusHandler,false,0,true);
this._newBdayDayDpn.currDropDown.addEventListener(FocusEvent.FOCUS_IN,this.selBar1FocusHandler,false,0,true);
this._newGenderRbg.currRadioButton.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar2FocusHandler,false,0,true);
this._newPlayerAgeDpn.currDropDown.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar2FocusHandler,false,0,true);
this._newPlayerAgeDpn.currDropDown.addEventListener(FocusEvent.FOCUS_IN,this.selBar2FocusHandler,false,0,true);
this._newUsernameTxt.addEventListener(Event.CHANGE,this.userNameTxtChangeHandler,false,0,true);
this._newUsernameTxt.addEventListener(MouseEvent.MOUSE_DOWN,this.selBar3FocusHandler,false,0,true);
this._newUsernameTxt.addEventListener(KeyboardEvent.KEY_DOWN,this.selBar3FocusHandler,false,0,true);
this._newUsernameTxt.addEventListener(FocusEvent.FOCUS_IN,this.selBar3FocusHandler,false,0,true);
this._newPasswordTxt.addEventListener(Event.CHANGE,this.passWordTxtChangeHandler,false,0,true);
this._newPasswordTxt.addEventListener(FocusEvent.FOCUS_IN,this.selBar4FocusHandler,false,0,true);
this._tipsNeedTxt.addEventListener(TextEvent.LINK,this.tipsNeedTxtClickHandler,false,0,true);
this._voBtn.addEventListener(MouseEvent.CLICK,this.voBtnClickHandler,false,0,true);
if(CreateAccountGui.vo3Sound.sc)
{
this._voBtn.play();
}
else
{
this._voBtn.stop();
}
this.selBar1FocusHandler(null);
this._nextBtn.enabled = false;
CreateAccountGui.hideNotifyPopup();
if(Boolean(this._userNameSts["_check"].visible) && Boolean(this._passWordSts["_check"].visible))
{
this._nextBtn.visible = true;
}
else
{
this._nextBtn.visible = false;
}
}
}
public function stopVOButton(param1:Event) : void
{
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
public function enableNext() : void
{
this._nextBtn.enabled = true;
}
public function userNameValidCallback(param1:int, param2:Array, param3:int) : void
{
var _loc4_:int = 0;
this._validationPending = false;
this._userNameSts.visible = true;
if(param1 == 1)
{
GuiStatusIcon.showCheck(this._userNameSts,this._userNameTracking);
if(this._passWordSts["_check"].visible)
{
this._nextBtn.visible = true;
}
this._newUsernameBar.visible = true;
this._nameSuggestionsFrame.visible = false;
if(this._continueClicked || this._isEmailSameAsUserName)
{
if(this.nextBtnHandler())
{
if(super.parentWizard != null)
{
super.parentWizard.next();
}
}
}
}
else
{
if(param1 == CreateAccountGui.MSG_ID_USERNAME_UNAVAILABLE)
{
if(param3 != CreateAccountXtCommManager.LOGINAVAILABLE_TYPE_SUGGESTIONS)
{
SBTracker.trackPageview("/login/usernameUnavailable/#" + this._numTimesBadUsername,0,SBTracker.TYPE_EVENT);
++this._numTimesBadUsername;
}
_loc4_ = 3;
while(_loc4_ < NUM_SUGGESTED_NAMES + 3 && _loc4_ < param2.length)
{
TextField(this._nameSugTxts[_loc4_ - 3]).text = param2[_loc4_];
_loc4_++;
}
if(param2[4] != "")
{
this._nameSuggestionsFrame.visible = true;
}
this._newBdayMonthDpn.closeDropdownSilent();
this._newBdayDayDpn.closeDropdownSilent();
this._newPlayerAgeDpn.closeDropdownSilent();
}
GuiStatusIcon.showX(this._userNameSts,this._userNameTracking);
this._nextBtn.visible = false;
if(this._newUsernameTxt.text == "")
{
this._userNameSts.visible = this._userNameTracking.xTracking = this._userNameTracking.waitTracking = this._userNameTracking.checkTracking = false;
this._newUsernameBar.visible = true;
}
else
{
this._newUsernameBar.visible = false;
}
}
this._continueClicked = false;
}
public function passWordValidCallback(param1:Boolean) : void
{
this._passWordSts.visible = true;
if(param1)
{
GuiStatusIcon.showCheck(this._passWordSts,this._passWordTracking);
this._newPasswordBar.visible = true;
if(this._userNameSts["_check"].visible)
{
this._nextBtn.visible = true;
}
}
else
{
GuiStatusIcon.showX(this._passWordSts,this._passWordTracking);
this._nextBtn.visible = false;
if(this._newPasswordTxt.text.length < CreateAccountGui.MIN_PASSWORD_LENGTH)
{
this._passWordSts.visible = this._passWordTracking.xTracking = this._passWordTracking.waitTracking = this._passWordTracking.checkTracking = false;
this._newPasswordBar.visible = true;
}
else
{
this._newPasswordBar.visible = false;
}
}
}
private function markEmptyAsError() : void
{
if(this._newUsernameTxt.text == "")
{
GuiStatusIcon.showX(this._userNameSts,this._userNameTracking);
this._userNameSts.visible = true;
this._newUsernameBar.visible = false;
}
if(this._newPasswordTxt.text.length < CreateAccountGui.MIN_PASSWORD_LENGTH)
{
if(this._newUsernameTxt.text != "")
{
CreateAccountGui.showNewPasswordBadMsg();
}
GuiStatusIcon.showX(this._passWordSts,this._passWordTracking);
this._passWordSts.visible = true;
this._newPasswordBar.visible = false;
}
}
private function checkUserName() : void
{
if(this._creation.validatedUserName != this._newUsernameTxt.text)
{
if(this._creation.validatedUserName)
{
this._creation.invalidateUserName();
}
if(this._newUsernameTxt.text == "")
{
this._userNameSts.visible = this._userNameTracking.xTracking = this._userNameTracking.waitTracking = this._userNameTracking.checkTracking = false;
CreateAccountGui.hideNotifyPopup();
}
else if(this._newUsernameTxt.text != this._lastCheckedPlayerTag)
{
if(this._validationPending)
{
if(!this._userNameKeyUpDelayTimer.running)
{
this._creation.invalidatePending();
}
this._userNameKeyUpDelayTimer.reset();
}
this._validationPending = true;
this._lastCheckedPlayerTag = this._newUsernameTxt.text;
this._userNameSts.visible = true;
GuiStatusIcon.showWait(this._userNameSts,this._userNameTracking);
this._userNameKeyUpDelayTimer.start();
}
}
}
private function checkPassWord() : void
{
this._passWordSts.visible = true;
GuiStatusIcon.showX(this._passWordSts,this._passWordTracking);
if(this._newPasswordTxt.text.length >= CreateAccountGui.MIN_PASSWORD_LENGTH)
{
this._passwordText = this._newPasswordTxt.text;
this._creation.validatePassWord(this._newPasswordTxt.text,this._newUsernameTxt.text,this.passWordValidCallback);
}
else
{
if(this._newPasswordTxt.text.length == 0)
{
this._passWordSts.visible = this._passWordTracking.xTracking = this._passWordTracking.waitTracking = this._passWordTracking.checkTracking = false;
}
this._passwordText = "";
this._nextBtn.visible = false;
this._newPasswordBar.visible = true;
this._creation.invalidatePassWord();
}
}
private function userNameTxtChangeHandler(param1:Event) : void
{
this.checkUserName();
this.checkPassWord();
CreateAccountGui.hideNotifyPopup();
}
private function userNameTxtChangeDelayTimerHandler(param1:TimerEvent) : void
{
var _loc2_:String = this._newUsernameTxt.text;
this._newUsernameTxt.text = _loc2_.substr(0,1) + _loc2_.substr(1).toLowerCase();
var _loc3_:Array = CreateAccountGui.currEmailAddress().split("@");
if(_loc3_.length > 1)
{
if(_loc3_[0].toLowerCase() != this._newUsernameTxt.text.toLowerCase())
{
this._creation.validateUserName(this._newUsernameTxt.text,this._newPasswordTxt.text,0,0,0,this.userNameValidCallback);
}
else
{
CreateAccountGui.showEmailCannotMatchUserName();
this._nextBtn.visible = false;
GuiStatusIcon.showX(this._userNameSts,this._userNameTracking);
this._lastCheckedPlayerTag = this._newUsernameTxt.text;
this._validationPending = false;
this._creation.validateUserName(this._newUsernameTxt.text,this._newPasswordTxt.text,this.userNameValidCallback,CreateAccountXtCommManager.LOGINAVAILABLE_TYPE_SUGGESTIONS);
}
}
else
{
this._creation.validateUserName(this._newUsernameTxt.text,this._newPasswordTxt.text,0,0,0,this.userNameValidCallback);
}
this._userNameKeyUpDelayTimer.reset();
}
private function nameSugClickHandler(param1:MouseEvent) : void
{
this._newUsernameTxt.text = param1.currentTarget["pTag_txt"].text;
this.userNameTxtChangeHandler(null);
this._nameSuggestionsFrame.visible = false;
}
private function nameSugCloseBtnMouseDownHandler(param1:MouseEvent) : void
{
this._nameSuggestionsFrame.visible = false;
}
private function passWordTxtChangeHandler(param1:Event) : void
{
this._lastCheckedPlayerTag = null;
this.checkPassWord();
this.checkUserName();
}
private function selBar1FocusHandler(param1:Event) : void
{
if(!this._activeSelBar1.visible)
{
this._activeSelBar1.visible = true;
this._activeSelBar2.visible = false;
this._activeSelBar3.visible = false;
this._activeSelBar4.visible = false;
this._nameSuggestionsFrame.visible = false;
this._nameTipPopup.visible = false;
this._passwordTipPopup.visible = false;
this._newPlayerAgeDpn.closeDropdownSilent();
}
if(param1)
{
this._selectedBdayMonthIndex = this._newBdayMonthDpn.selectedIdx;
this._selectedBdayDayIndex = this._newBdayDayDpn.selectedIdx;
}
}
private function selBar2FocusHandler(param1:Event) : void
{
if(!this._activeSelBar2.visible)
{
this._activeSelBar1.visible = false;
this._activeSelBar2.visible = true;
this._activeSelBar3.visible = false;
this._activeSelBar4.visible = false;
this._nameSuggestionsFrame.visible = false;
this._nameTipPopup.visible = false;
this._passwordTipPopup.visible = false;
this._newBdayMonthDpn.closeDropdownSilent();
this._newBdayDayDpn.closeDropdownSilent();
}
if(param1)
{
this._selectedGender = this._newGenderRbg.selected;
this._selectedBdayAgeIndex = this._newPlayerAgeDpn.selectedIdx;
}
}
private function selBar3FocusHandler(param1:Event) : void
{
if(!this._activeSelBar3.visible)
{
this._activeSelBar1.visible = false;
this._activeSelBar2.visible = false;
this._activeSelBar3.visible = true;
this._activeSelBar4.visible = false;
this._nameTipPopup.visible = true;
this._passwordTipPopup.visible = false;
this._nameSuggestionsFrame.visible = false;
this._newPlayerAgeDpn.closeDropdownSilent();
this._newBdayMonthDpn.closeDropdownSilent();
this._newBdayDayDpn.closeDropdownSilent();
}
CreateAccountGui.hideNotifyPopup();
}
private function selBar4FocusHandler(param1:FocusEvent) : void
{
if(!this._activeSelBar4.visible)
{
this._activeSelBar1.visible = false;
this._activeSelBar2.visible = false;
this._activeSelBar3.visible = false;
this._activeSelBar4.visible = true;
this._nameSuggestionsFrame.visible = false;
this._nameTipPopup.visible = false;
this._passwordTipPopup.visible = true;
this._newPlayerAgeDpn.closeDropdownSilent();
this._newBdayMonthDpn.closeDropdownSilent();
this._newBdayDayDpn.closeDropdownSilent();
}
}
private function tipsNeedTxtClickHandler(param1:TextEvent) : void
{
param1.preventDefault();
CreateAccountGui.showTipsPopup(true);
}
private function voBtnClickHandler(param1:MouseEvent) : void
{
if(CreateAccountGui.vo3Sound.isPlaying)
{
CreateAccountGui.vo3Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
}
else
{
CreateAccountGui.vo3Sound.play();
if(CreateAccountGui.vo3Sound.sc)
{
CreateAccountGui.vo3Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopVOButton,false,0,true);
this._voBtn.play();
}
}
}
private function nextBtnHandler() : Boolean
{
if(this._validationPending)
{
this._continueClicked = true;
return false;
}
if(this._creation.validatedUserName)
{
if(this._creation.validatedPassWord)
{
if(this._newPlayerAgeDpn.selectedIdx < 0)
{
CreateAccountGui.showLoginCreateResultMsg(CreateAccountGui.MSG_ID_AGE_BLANK);
return false;
}
if(this._newGenderRbg.selected < 0)
{
CreateAccountGui.showLoginCreateResultMsg(CreateAccountGui.MSG_ID_SEX_BLANK);
return false;
}
if(this._newBdayDayDpn.selectedIdx < 0 || this._newBdayMonthDpn.selectedIdx < 0)
{
CreateAccountGui.showLoginCreateResultMsg(CreateAccountGui.MSG_ID_MONTH_OR_DAY_BLANK);
return false;
}
this._creation.setBirthday(String(this._newBdayMonthDpn.selectedIdx + 1),this._newBdayDayDpn.selectedTxt.text,String(this._newPlayerAgeDpn.selectedIdx));
this._creation.setGender(this._newGenderRbg.selected);
this._numTimesBadUsername = 0;
this._isEmailSameAsUserName = false;
return true;
}
this.passWordTxtChangeHandler(null);
this.markEmptyAsError();
return false;
}
this._continueClicked = true;
this._creation.validateUserName(this._newUsernameTxt.text,this.userNameValidCallback,this.userNameValidCallback);
this.markEmptyAsError();
return false;
}
}
}
@@ -0,0 +1,157 @@
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;
private var _registrationPanel:MovieClip;
private var _isCheckBoxChecked:Boolean;
public function GuiRulesScreen(param1:Object, param2:SBWizard)
{
this._login = param1;
this._rulesScreen = param1.accountCreation.registrationPanel.rules_popup;
this._registrationPanel = MovieClip(this._rulesScreen.parent);
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;
updateScreen = this.updateScreenAssets;
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();
}
this._registrationPanel.gotoAndPlay("playAJRules");
MovieClip(this._registrationPanel.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("playAJRules");
MovieClip(this._registrationPanel.parent).next_btn.visible = false;
MovieClip(this._registrationPanel.parent).play_btn.visible = this._checkBox.checked;
}
public function leaveToBoth() : Boolean
{
MovieClip(this._registrationPanel.parent).next_btn.visible = true;
MovieClip(this._registrationPanel.parent).play_btn.visible = false;
CreateAccountGui.vo5Sound.stop();
this._rulesVoBtn.stop();
this._rulesVoBtn.gotoAndStop(1);
this._registrationPanel.gotoAndPlay("backAJRules");
MovieClip(this._registrationPanel.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("backAJRules");
return true;
}
public function updateScreenAssets(param1:Boolean = false) : void
{
this._rulesScreen = this._registrationPanel.rules_popup;
this._checkBox = new GuiCheckBox(this._rulesScreen.agree_box,this.onAgreeChecked);
this._checkBox.init(this._rulesScreen.agree_txt);
this._checkBox.checked = this._isCheckBoxChecked;
this._fullRulesTxt = this._rulesScreen.pp_txt;
this._rulesVoBtn = this._rulesScreen.vo_btn;
if(param1)
{
if(CreateAccountGui.vo5Sound.sc)
{
this._rulesVoBtn.play();
}
MovieClip(this._registrationPanel.parent).next_btn.visible = false;
MovieClip(this._registrationPanel.parent).play_btn.visible = this._checkBox.checked;
}
else
{
MovieClip(this._registrationPanel.parent).play_btn.visible = false;
}
}
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._registrationPanel.parent).play_btn.visible = this._isCheckBoxChecked = this._checkBox.checked;
}
}
}