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,196 @@
package createAccountGui
{
import flash.display.MovieClip;
import flash.display.Sprite;
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;
public var privacyPolicyPopup: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.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.privacyPolicyPopup = param1.registrationPanel.userNamePanel.userNameContainer.privacyPolicyPopup;
this.privacyPolicyPopup.addEventListener(MouseEvent.MOUSE_DOWN,this.hideSelf,false,0,true);
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 reloadChooser(param1:Boolean, param2:Boolean, param3:int = -1, param4:Boolean = false, param5:int = 0, param6:int = -1) : void
{
this.creationWiz.chooseAnimalScreen.reload(param1,param2,param3,param4,param5,param6);
}
public function destroyReloadedItems() : void
{
this.creationWiz.chooseAnimalScreen.destroyReloadedItems();
}
private function notifyPopupBxHandler(param1:MouseEvent) : void
{
this.notifyPopup.visible = false;
}
private function tipsPopupBxHandler(param1:MouseEvent) : void
{
this.tipsPopup.visible = false;
}
private function hideSelf(param1:MouseEvent) : void
{
param1.currentTarget.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,728 @@
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;
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;
public function GuiChooseAnimal(param1:Object, param2:SBWizard, param3:Boolean)
{
this._chooseScreen = param3 ? param1.registrationPanel.chooseAnimal : param1.accountCreation.registrationPanel.chooseAnimal;
super(this._chooseScreen,param2);
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;
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._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;
AvatarUtility.creationAssets.creationWiz.step = 1;
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._tag.visible = false;
this._backBtn.visible = false;
this._isCreatingWithoutChoosing = param4;
if(Boolean(this._currAvatar) && Boolean(this._currBG))
{
this.enterFromPrev();
}
if(this._isChoosingOceanAvatars)
{
this._currAvatarIconIds = this._oceanOnlyIconIds;
this._currAvatarTypes = this._oceanOnlyTypes;
}
else
{
this._currAvatarIconIds = this._usableAvatarIconIds;
this._currAvatarTypes = this._usableAvatarTypes;
}
this.pickRandomAvatar(param3,param6);
if(param4)
{
this._wizard.next();
return;
}
this.createAvatarWindows();
}
public function enterFromNext() : void
{
MovieClip(this._chooseScreen.parent).gotoAndPlay("backChooseAnAnimal");
this._currAvatar.gotoAndPlay("backChooseAnAnimal");
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndPlay("backChooseAnAnimal");
if(this._isFromWorld)
{
this._buyBtnGreen.visible = false;
this._buyBtnRed.visible = false;
this._nextBtn.visible = true;
}
else if(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.enterFromBoth();
}
public function enterFromPrev() : void
{
MovieClip(this._chooseScreen.parent).gotoAndStop("intro");
this._currAvatar.gotoAndStop("intro");
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndStop("intro");
this.enterFromBoth();
}
public function enterFromBoth() : void
{
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 && MovieClip(this._chooseScreen.parent).currentFrameLabel != "chooseAName")
{
MovieClip(this._chooseScreen.parent).gotoAndStop("chooseAName");
this._currAvatar.gotoAndStop("chooseAName");
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndStop("chooseAName");
}
else
{
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)
{
MovieClip(this._chooseScreen.parent).gotoAndStop("chooseAName");
this._currAvatar.gotoAndStop("chooseAName");
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndStop("chooseAName");
}
else
{
MovieClip(this._chooseScreen.parent).gotoAndPlay("playChooseAName");
this._currAvatar.gotoAndPlay("playChooseAName");
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndPlay("playChooseAName");
}
return true;
}
new SBOkPopup(this._chooseScreen.parent.parent.parent.parent,"You must create at least one land animal.");
}
return false;
}
if(this._isCreatingWithoutChoosing)
{
MovieClip(this._chooseScreen.parent).gotoAndStop("chooseAName");
this._currAvatar.gotoAndStop("chooseAName");
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndStop("chooseAName");
}
else
{
MovieClip(this._chooseScreen.parent).gotoAndPlay("playChooseAName");
this._currAvatar.gotoAndPlay("playChooseAName");
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndPlay("playChooseAName");
}
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();
return true;
}
public function leaveToBoth() : Boolean
{
return true;
}
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 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);
}
LocalizationXtCommManager.sendTranslateStringRequest(gMainFrame.userInfo.getAvatarDefByAvType(_loc2_[_loc5_].avTypeId).titleStrRef,LocalizationXtCommManager.LANG_ENG,this.onAvtNames,_loc2_[_loc5_].avTypeId);
}
}
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 onAvtNames(param1:int, param2:String, param3:Object) : void
{
this._avatarNamesByType[param3] = param2;
if(Boolean(this._currType) && param3 == this._currType)
{
this._amlNameTxt.text = this._avatarNamesByType[this._currType];
}
}
private function createAvatarWindows() : void
{
this._itemsLoadingSpiral.visible = true;
if(this._avatarWindows)
{
this._avatarWindows.destroy();
this._avatarWindows = null;
}
if(this._scrollBar)
{
this._scrollBar.destroy();
this._scrollBar = 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 = new SBScrollbar();
this._scrollBar.init(this._avatarWindows,this._avatarWindows.width,this._avatarWindows.boxHeight * 3 + 2 * 3,10,"scrollbar2",this._avatarWindows.boxHeight + 2,0,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._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 _loc4_:Object = 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)
{
if(this._avatarNamesByType[this._currType])
{
this._amlNameTxt.text = this._avatarNamesByType[this._currType];
}
this._currAvatar.gotoAndPlay("intro");
_loc4_ = AvatarUtility.avatarDefInfo[AvatarUtility.findAvatarIndexByType(this._currType)];
if(this._isFromWorld)
{
this._currCost = this._diamondCost == -1 ? int(_loc4_.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;
this._tag.txt.text = "Free";
}
if(!this._tag.visible)
{
this._tag.visible = true;
}
}
if(AvatarUtility.isEndangered(_loc4_.availability))
{
if(this._currType == 13 || this._currType == 16 || this._currType == 26)
{
MovieClip(this._chooseScreen.parent.parent).endangeredSign.txt.text = "Traveling!";
}
else
{
MovieClip(this._chooseScreen.parent.parent).endangeredSign.txt.text = "Exploring!";
}
MovieClip(this._chooseScreen.parent.parent).endangeredSign.visible = true;
}
else
{
MovieClip(this._chooseScreen.parent.parent).endangeredSign.visible = false;
}
if(AvatarUtility.isEndangered(_loc4_.availability) || AvatarUtility.isExtinct(_loc4_.availability))
{
this._nextBtn.activateGrayState(true);
if(this._isFromWorld)
{
this._tag.visible = false;
}
}
else
{
this._nextBtn.activateGrayState(false);
if(this._isFromWorld)
{
this._tag.visible = true;
}
}
}
if(this._currBG)
{
if(MovieClip(this._chooseScreen.parent.parent).bg.currentFrameLabel != this._currBG)
{
MovieClip(this._chooseScreen.parent.parent).bg.gotoAndStop(this._currBG);
MovieClip(this._chooseScreen.parent.parent).bg[this._currBG + "Bg"].gotoAndPlay("intro");
}
}
}
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,484 @@
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;
public class GuiCreateAName extends SBScreen
{
private static const AVT_NAMES_1:int = 1610;
private static const AVT_NAMES_2:int = 1611;
private static const AVT_NAMES_3:int = 1612;
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 _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;
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._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;
this._newAvatarFacilitator = param2 ? new NewWorldAvatar() : INewAvatar(param1);
this._avatarNameIndexes = new Array(3);
LocalizationXtCommManager.sendTranslateStringRequest(AVT_NAMES_1,LocalizationXtCommManager.LANG_ENG,this.onAvtNameListReceived);
LocalizationXtCommManager.sendTranslateStringRequest(AVT_NAMES_2,LocalizationXtCommManager.LANG_ENG,this.onAvtNameListReceived);
LocalizationXtCommManager.sendTranslateStringRequest(AVT_NAMES_3,LocalizationXtCommManager.LANG_ENG,this.onAvtNameListReceived);
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;
}
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;
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();
}
}
}
MovieClip(this._createANameScreen.parent).gotoAndPlay("backChooseAName");
CreateAccountGui.currAvatar().gotoAndPlay("backChooseAName");
MovieClip(this._createANameScreen.parent.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("backChooseAName");
this.enterFromBoth();
}
public function enterFromPrev() : 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();
}
}
}
this._newAvatarFacilitator.hideConnectingMsg();
this._name1Carousel.pickRandomItem(true);
this._name2Carousel.pickRandomItem(true);
this._name3Carousel.pickRandomItem(true);
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._isFromWorld)
{
SBTracker.trackPageview("/game/play/popup/avatarCreation/CreateAName");
}
else
{
CreateAccountGui.trackUserCreateAccountPageChange("CreateAName");
}
}
public function leaveToNext() : Boolean
{
var _loc1_:int = 0;
var _loc2_:Object = null;
if(!this._isValid)
{
if(this._isFromWorld)
{
if(AvatarSwitch.numTotalAvatars >= SwitchManager.NUM_AVATAR_SLOTS)
{
new SBOkPopup(GuiManager.guiLayer,"You don\'t have any open animal slots. Free an animal.",true,this.onSlotsFullOk);
return true;
}
if(AvatarUtility.creationAssets.isCreatingWithoutChoosing)
{
if((gMainFrame.userInfo.userVarCache.getUserVarValueById(AchievementXtCommManager.UV_AVT_VIEWABLE_FLAG) & 1 << AvatarUtility.creationAssets.currType - 1) != 0)
{
_loc2_ = AvatarUtility.avatarDefInfo[AvatarUtility.findAvatarIndexByType(AvatarUtility.creationAssets.currType)];
new SBYesNoPopup(this._createANameScreen.parent.parent.parent.parent,"You already have the " + AvatarUtility.creationAssets.currAvatarName + ". Would you like to create another one for " + _loc2_.cost + " gems?",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._avatarNameIndexes,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);
MovieClip(this._createANameScreen.parent).gotoAndPlay("playPlayerAccountOne");
CreateAccountGui.currAvatar().gotoAndPlay("playPlayerAccountOne");
MovieClip(this._createANameScreen.parent.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 close() : void
{
AvatarSwitch.addAvatarCallback = null;
this._newAvatarFacilitator.nameTypeScreenDone();
}
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._avatarNameIndexes,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._avatarNameIndexes,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 onAvtNameListReceived(param1:int, param2:String) : void
{
if(this._avtNames == null)
{
this._avtNames = [];
}
var _loc3_:Array = param2.split("|");
var _loc4_:int = -1;
if(param1 == AVT_NAMES_1)
{
_loc4_ = 0;
}
else if(param1 == AVT_NAMES_2)
{
_loc4_ = 1;
}
else if(param1 == AVT_NAMES_3)
{
_loc4_ = 2;
}
this._avtNames[_loc4_] = _loc3_;
if(Boolean(this._avtNames[0]) && Boolean(this._avtNames[1]) && Boolean(this._avtNames[2]))
{
this.setupNameLists(this._avtNames[0],this._avtNames[1],this._avtNames[2]);
}
}
private function setupNameLists(param1:Array, param2:Array, param3:Array) : void
{
this._name1Carousel.init(param1,this.names1Changed);
this._name2Carousel.init(param2,this.names2Changed);
this._name3Carousel.init(param3,this.names3Changed);
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))
{
this._avatarNameTxt.text = this._name1Carousel.selectedContentItem + " " + this._name2Carousel.selectedContentItem + this._name3Carousel.selectedContentItem;
this._avatarNameIndexes[0] = this._name1Carousel.contentItemIndex;
}
if(!this._name1Carousel.soundsEnabled)
{
this._name1Carousel.soundsEnabled = true;
}
}
private function names2Changed() : void
{
if(Boolean(this._name1Carousel.selectedContentItem) && Boolean(this._name2Carousel.selectedContentItem) && Boolean(this._name3Carousel.selectedContentItem))
{
this._avatarNameTxt.text = this._name1Carousel.selectedContentItem + " " + this._name2Carousel.selectedContentItem + this._name3Carousel.selectedContentItem;
this._avatarNameIndexes[1] = this._name2Carousel.contentItemIndex;
}
if(!this._name2Carousel.soundsEnabled)
{
this._name2Carousel.soundsEnabled = true;
}
}
private function names3Changed() : void
{
if(Boolean(this._name1Carousel.selectedContentItem) && Boolean(this._name2Carousel.selectedContentItem) && Boolean(this._name3Carousel.selectedContentItem))
{
this._avatarNameTxt.text = this._name1Carousel.selectedContentItem + " " + this._name2Carousel.selectedContentItem + this._name3Carousel.selectedContentItem;
this._avatarNameIndexes[2] = this._name3Carousel.contentItemIndex;
}
if(!this._name3Carousel.soundsEnabled)
{
this._name3Carousel.soundsEnabled = true;
}
}
private function randomLeverMouseDownHandler(param1:MouseEvent) : void
{
if(this._randomNameLever.currentFrameLabel == "_up")
{
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 = 0, 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,415 @@
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;
public function GuiEmailScreen(param1:Object, param2:SBWizard)
{
this._login = param1;
this._emailScreen = param1.accountCreation.registrationPanel.email_popup;
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;
GuiStatusIcon.initClip(this._emailSts);
GuiStatusIcon.initClip(this._confirmSts);
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;
this._validationPending = false;
this._continueClicked = false;
this._prevConfirmTxt = "";
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._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;
}
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 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._nextBtn.visible = false;
if(this._emailTxt.text == "")
{
this._emailSts.visible = false;
this._emailBar.visible = true;
}
else
{
this._emailBar.visible = false;
}
}
else
{
GuiStatusIcon.showCheck(this._emailSts);
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._nextBtn.visible = false;
if(this._confirmTxt.text == "")
{
this._confirmSts.visible = false;
this._confirmBar.visible = true;
}
else
{
this._confirmBar.visible = false;
}
}
else if(this._emailSts["_check"].visible)
{
GuiStatusIcon.showCheck(this._confirmSts);
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._emailSts.visible = true;
this._emailBar.visible = false;
}
}
private function confirmMarkEmptyAsError() : void
{
if(this._confirmTxt.text == "")
{
GuiStatusIcon.showX(this._confirmSts);
this._confirmSts.visible = true;
this._confirmBar.visible = false;
}
}
private function emailKeyUpHandler(param1:KeyboardEvent) : void
{
var _loc2_:Boolean = false;
var _loc3_:Boolean = false;
var _loc4_:int = 0;
var _loc5_:int = 0;
var _loc6_:String = null;
var _loc7_:Array = null;
var _loc8_:Array = null;
var _loc9_:int = 0;
if(this._emailTxt.text == "")
{
this._emailSts.visible = false;
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_ = Boolean(!RegExp(/\A([^;:,\(\)\[\]@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i)["exec"](this._emailTxt.text) || this._emailTxt.text.length > MAX_EMAIL_LENGTH);
if(!_loc2_)
{
_loc3_ = false;
_loc4_ = 0;
_loc5_ = int(this._commonDomains.length);
_loc6_ = this._emailTxt.text.substr(this._emailTxt.text.indexOf("@") + 1).toLowerCase();
while(_loc4_ < _loc5_)
{
if(_loc6_ == this._commonDomains[_loc4_])
{
_loc3_ = true;
CreateAccountGui.hideNotifyPopup();
break;
}
_loc4_++;
}
if(!_loc3_)
{
_loc7_ = new Array();
_loc8_ = _loc6_.split("");
_loc4_ = 0;
while(_loc4_ < _loc5_)
{
_loc9_ = Utils.damerauLevenshteinDistance(_loc8_,this._commonDomains[_loc4_].split(""),64);
if(_loc9_ == 1)
{
_loc7_.push(this._commonDomains[_loc4_]);
}
_loc4_++;
}
if(_loc7_.length > 0)
{
CreateAccountGui.showEmailDomainMisspelledWarning(_loc7_);
}
else
{
CreateAccountGui.hideNotifyPopup();
}
}
}
this.emailValidCallback(_loc2_,_loc2_);
if(this._confirmTxt.text != "")
{
this.confirmKeyUpHandler(null);
}
}
}
private function confirmKeyUpHandler(param1:KeyboardEvent) : void
{
if(this._confirmTxt.text == "")
{
this._confirmSts.visible = false;
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,652 @@
package createAccountGui
{
import com.sbi.analytics.SBTracker;
import com.sbi.popup.SBScreen;
import com.sbi.popup.SBWizard;
import createAccountFlow.CreateAccountGui;
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 _isExperimental:Boolean;
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._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.enterFromBoth;
onEnterFromNext = this.enterFromBoth;
onLeaveToPrev = this.leaveToPrev;
onLeaveToNext = this.leaveToNext;
this._playerTagScreen.ageGender.visible = false;
this._playerTagScreen.username.visible = false;
this._playerTagScreen.password.visible = false;
this._genderAgeSts["_x"].visible = false;
this._genderAgeSts["_check"].visible = false;
this._genderAgeSts.visible = false;
this._userNameSts["_x"].visible = false;
this._userNameSts["_check"].visible = false;
this._userNameSts.visible = false;
this._passWordSts["_x"].visible = false;
this._passWordSts["_check"].visible = false;
this._passWordSts.visible = false;
this._nameTipPopup.visible = false;
this._passwordTipPopup.visible = false;
this._validationPending = false;
this._continueClicked = false;
this._lastCheckedPlayerTag = this._newUsernameTxt.text;
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._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 enterFromBoth() : void
{
this._isExperimental = gMainFrame.clientInfo.sessionId % 2 == 0;
if(!this._isExperimental)
{
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 leaveToNext() : Boolean
{
CreateAccountGui.vo3Sound.stop();
this._voBtn.stop();
this._voBtn.gotoAndStop(1);
CreateAccountGui.showTipsPopup(false);
return this.nextBtnHandler();
}
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 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) : void
{
var _loc3_:int = 0;
this._validationPending = false;
this._userNameSts.visible = true;
if(param1 == 1)
{
GuiStatusIcon.showCheck(this._userNameSts);
if(this._isExperimental)
{
this._playerTagScreen.password.visible = true;
SBTracker.trackPageview("/login/experimental/password",0);
}
if(this._passWordSts["_check"].visible)
{
this._nextBtn.visible = true;
}
this._newUsernameBar.visible = true;
this._nameSuggestionsFrame.visible = false;
if(this._continueClicked)
{
if(this.nextBtnHandler())
{
if(super.parentWizard != null)
{
super.parentWizard.next();
}
}
}
}
else
{
if(param1 == CreateAccountGui.MSG_ID_USERNAME_UNAVAILABLE)
{
SBTracker.trackPageview("/login/usernameUnavailable/#" + this._numTimesBadUsername,0);
++this._numTimesBadUsername;
_loc3_ = 3;
while(_loc3_ < NUM_SUGGESTED_NAMES + 3 && _loc3_ < param2.length)
{
TextField(this._nameSugTxts[_loc3_ - 3]).text = param2[_loc3_];
_loc3_++;
}
if(param2[4] != "")
{
this._nameSuggestionsFrame.visible = true;
}
this._newBdayMonthDpn.closeDropdownSilent();
this._newBdayDayDpn.closeDropdownSilent();
this._newPlayerAgeDpn.closeDropdownSilent();
}
GuiStatusIcon.showX(this._userNameSts);
if(this._isExperimental)
{
this._playerTagScreen.password.visible = false;
}
this._nextBtn.visible = false;
if(this._newUsernameTxt.text == "")
{
this._userNameSts.visible = 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._newPasswordBar.visible = true;
if(this._userNameSts["_check"].visible)
{
this._nextBtn.visible = true;
}
}
else
{
GuiStatusIcon.showX(this._passWordSts);
this._nextBtn.visible = false;
if(this._newPasswordTxt.text.length < CreateAccountGui.MIN_PASSWORD_LENGTH)
{
this._passWordSts.visible = false;
this._newPasswordBar.visible = true;
}
else
{
this._newPasswordBar.visible = false;
}
}
}
private function markEmptyAsError() : void
{
if(this._newUsernameTxt.text == "")
{
GuiStatusIcon.showX(this._userNameSts);
if(this._isExperimental)
{
this._playerTagScreen.password.visible = false;
}
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._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 = 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._userNameKeyUpDelayTimer.start();
}
}
}
private function checkPassWord() : void
{
this._passWordSts.visible = true;
GuiStatusIcon.showX(this._passWordSts);
if(this._newPasswordTxt.text.length >= CreateAccountGui.MIN_PASSWORD_LENGTH)
{
this._creation.validatePassWord(this._newPasswordTxt.text,this._newUsernameTxt.text,this.passWordValidCallback);
}
else
{
if(this._newPasswordTxt.text.length == 0)
{
this._passWordSts.visible = false;
}
this._nextBtn.visible = false;
this._newPasswordBar.visible = true;
this._creation.invalidatePassWord();
}
}
private function userNameTxtChangeHandler(param1:Event) : void
{
this.checkUserName();
this.checkPassWord();
}
private function userNameTxtChangeDelayTimerHandler(param1:TimerEvent) : void
{
var _loc2_:String = this._newUsernameTxt.text;
this._newUsernameTxt.text = _loc2_.substr(0,1) + _loc2_.substr(1).toLowerCase();
this._creation.validateUserName(this._newUsernameTxt.text,this._newPasswordTxt.text,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(this._isExperimental)
{
if(this._newBdayMonthDpn.dropdownTxt.text != "-" && this._newBdayDayDpn.dropdownTxt.text != "-")
{
if(!this._playerTagScreen.ageGender.visible)
{
SBTracker.trackPageview("/login/experimental/ageGender",0);
}
this._playerTagScreen.ageGender.visible = true;
}
}
}
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(this._isExperimental)
{
if(this._newGenderRbg.selected > -1 && this._newGenderRbg.selected < 2 && this._newPlayerAgeDpn.dropdownTxt.text != "-")
{
if(!this._playerTagScreen.username.visible)
{
SBTracker.trackPageview("/login/experimental/username",0);
}
this._playerTagScreen.username.visible = true;
}
}
}
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();
}
}
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;
return true;
}
this.passWordTxtChangeHandler(null);
this.markEmptyAsError();
return false;
}
this._continueClicked = true;
this._creation.validateUserName(this._newUsernameTxt.text,this.userNameValidCallback);
this.markEmptyAsError();
return false;
}
}
}
@@ -0,0 +1,129 @@
package createAccountGui
{
import com.sbi.popup.SBScreen;
import com.sbi.popup.SBWizard;
import createAccountFlow.CreateAccountGui;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
import gui.DarkenManager;
import gui.GuiCheckBox;
public class GuiRulesScreen extends SBScreen
{
private var _login:Object;
private var _rulesScreen:MovieClip;
private var _fullRulesTxt:TextField;
private var _rulesVoBtn:MovieClip;
private var _checkBox:GuiCheckBox;
public function GuiRulesScreen(param1:Object, param2:SBWizard)
{
this._login = param1;
this._rulesScreen = param1.accountCreation.registrationPanel.rules_popup;
this._checkBox = new GuiCheckBox(this._rulesScreen.agree_box,this.onAgreeChecked);
this._fullRulesTxt = this._rulesScreen.pp_txt;
this._rulesVoBtn = this._rulesScreen.vo_btn;
super(this._rulesScreen,param2);
}
public function init() : void
{
onEnterFromPrev = this.enterFromBoth;
onEnterFromNext = this.enterFromBoth;
onLeaveToPrev = this.leaveToBoth;
onLeaveToNext = null;
onPlay = this.onPlayBtn;
this._fullRulesTxt.htmlText = "<a href=\'http://animaljam.com/terms_of_service\' target=\'_blank\'><u>" + this._fullRulesTxt.text + "</u></a>";
this._rulesVoBtn.stop();
this._rulesVoBtn.addEventListener(MouseEvent.MOUSE_DOWN,this.voBtnClickHandler,false,0,true);
this._checkBox.init(this._rulesScreen.agree_txt);
this._checkBox.checked = false;
}
override public function destroy() : void
{
this._rulesVoBtn.removeEventListener(MouseEvent.MOUSE_DOWN,this.voBtnClickHandler);
this._checkBox.destroy();
this._checkBox = null;
super.destroy();
}
public function enterFromBoth() : void
{
CreateAccountGui.trackUserCreateAccountPageChange("Rules");
CreateAccountGui.vo5Sound.play();
if(CreateAccountGui.vo5Sound.sc)
{
CreateAccountGui.vo5Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopRulesVO,false,0,true);
this._rulesVoBtn.play();
}
MovieClip(this._rulesScreen.parent).gotoAndPlay("playAJRules");
MovieClip(this._rulesScreen.parent.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("playAJRules");
MovieClip(this._rulesScreen.parent.parent).next_btn.visible = false;
MovieClip(this._rulesScreen.parent.parent).play_btn.visible = this._checkBox.checked;
}
public function leaveToBoth() : Boolean
{
MovieClip(this._rulesScreen.parent.parent).next_btn.visible = true;
MovieClip(this._rulesScreen.parent.parent).play_btn.visible = false;
CreateAccountGui.vo5Sound.stop();
this._rulesVoBtn.stop();
this._rulesVoBtn.gotoAndStop(1);
MovieClip(this._rulesScreen.parent).gotoAndPlay("backAJRules");
MovieClip(this._rulesScreen.parent.parent).bg[CreateAccountGui.currBG() + "Bg"].gotoAndPlay("backAJRules");
return true;
}
public function onPlayBtn() : void
{
DarkenManager.showLoadingSpiral(true);
CreateAccountGui.vo5Sound.stop();
this._rulesVoBtn.stop();
this._rulesVoBtn.gotoAndStop(1);
this._login.createNewAccountSetup(CreateAccountGui.currEmailAddress(),CreateAccountGui.emailValidationCallback());
}
private function voBtnClickHandler(param1:MouseEvent) : void
{
if(CreateAccountGui.vo5Sound.isPlaying)
{
CreateAccountGui.vo5Sound.stop();
this._rulesVoBtn.stop();
this._rulesVoBtn.gotoAndStop(1);
}
else
{
CreateAccountGui.vo5Sound.play();
if(CreateAccountGui.vo5Sound.sc)
{
CreateAccountGui.vo5Sound.sc.addEventListener(Event.SOUND_COMPLETE,this.stopRulesVO,false,0,true);
this._rulesVoBtn.play();
}
}
}
private function stopRulesVO(param1:Event) : void
{
if(CreateAccountGui)
{
CreateAccountGui.vo5Sound.stop();
}
this._rulesVoBtn.stop();
this._rulesVoBtn.gotoAndStop(1);
}
private function onAgreeChecked() : void
{
MovieClip(this._rulesScreen.parent.parent).play_btn.visible = this._checkBox.checked;
}
}
}