LoggedInScreen.as 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import flash.external.*;
  2. import gfx.controls.TextInput;
  3. import gfx.controls.Button;
  4. class Screens.LoggedInScreen extends Screen
  5. {
  6. private var logoffButton:Button;
  7. private var updateAccountButton:Button;
  8. private var ignoreFunctions:Button;
  9. private var friendFunctions:Button;
  10. private var emailFunctions:Button;
  11. private var clanFunctions:Button;
  12. public function LoggedInScreen()
  13. {
  14. ConsoleWindow.Trace("Constructing LoggedInScreen");
  15. mScreenId = ScreenID.LOGGED_IN;
  16. mScreenTabId = ScreenTab.ID_LOGIN;
  17. }
  18. public function VOnFinishedLoading():Void
  19. {
  20. //Add click event for buttons
  21. logoffButton.addEventListener("click", this, "f2c_Logoff");
  22. updateAccountButton.addEventListener("click", this, "GotoUpdateAccountState");
  23. ignoreFunctions.addEventListener("click", this, "GotoIgnoreFunctionsState");
  24. friendFunctions.addEventListener("click", this, "GotoFriendFunctionsState");
  25. emailFunctions.addEventListener("click", this, "GotoEmailFunctionsState");
  26. clanFunctions.addEventListener("click", this, "GotoClanFunctionsState");
  27. //Add callbacks for C++
  28. super.VOnFinishedLoading();
  29. }
  30. public function f2c_Logoff():Void
  31. {
  32. ConsoleWindow.Trace("LoggedinScreen calling login");
  33. ExternalInterface.call("f2c_Logoff");
  34. //_root.gotoAndPlay("ConnectedToServer");
  35. LobbyInterface.Instance.SetLoginState( false );
  36. LobbyInterface.Instance.ShowScreen( ScreenID.LOGIN );
  37. }
  38. public function GotoUpdateAccountState():Void
  39. {
  40. //_root.gotoAndPlay("UpdateAccount");
  41. //LobbyInterface.Instance.ShowScreen( ScreenID.LOGIN ); //need to hook up update profile screen
  42. LobbyInterface.Instance.ShowScreen( ScreenID.UPDATE_ACCOUNT );
  43. }
  44. public function GotoIgnoreFunctionsState():Void
  45. {
  46. //_root.gotoAndPlay("IgnoreFunctions");
  47. LobbyInterface.Instance.ShowScreen( ScreenID.BLOCK_LIST );
  48. }
  49. public function GotoFriendFunctionsState():Void
  50. {
  51. //_root.gotoAndPlay("FriendFunctions");
  52. LobbyInterface.Instance.ShowScreen( ScreenID.FRIENDS );
  53. }
  54. public function GotoEmailFunctionsState():Void
  55. {
  56. //_root.gotoAndPlay("EmailFunctions");
  57. LobbyInterface.Instance.ShowScreen( ScreenID.EMAIL );
  58. }
  59. public function GotoClanFunctionsState():Void
  60. {
  61. //_root.gotoAndPlay("ClanFunctions");
  62. LobbyInterface.Instance.ShowScreen( ScreenID.CLAN_ROOT );
  63. }
  64. }
粤ICP备19079148号