Advertisement
Scriv07

Untitled

Sep 16th, 2017
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. package
  2. {
  3. import flash.display.MovieClip;
  4. import flash.events.Event;
  5. import flash.events.IOErrorEvent;
  6. import Shared.AS3.BSButtonHintBar;
  7. import Shared.AS3.BSButtonHintData;
  8. import Shared.IMenu;
  9.  
  10. public class ScopeMenu extends IMenu implements IScopeMenu
  11. {
  12. public var OverlayLoader_mc:OverlayLoader;
  13. public var ButtonHintInstance:BSButtonHintBar;
  14.  
  15. private var HoldBreathButton:BSButtonHintData;
  16. private var HoldBreathButtonForVita:BSButtonHintData;
  17.  
  18. public var OverlayFrame:int = 0;
  19.  
  20.  
  21.  
  22. // Initialize
  23. //---------------------------------------------
  24.  
  25. public function ScopeMenu()
  26. {
  27. trace("[ScopeMenu.as]: "+Utility.WalkMovie(this));
  28. HoldBreathButton = new BSButtonHintData("$Hold Breath", "Alt", "PSN_L3", "Xenon_L3", 1, null);
  29. HoldBreathButtonForVita = new BSButtonHintData("$Hold Breath", "Alt", "_DPad_Down", "Xenon_L3", 1, null);
  30. super();
  31.  
  32. HoldBreathButtonForVita.ButtonVisible = false;
  33.  
  34. var hints:Vector.<BSButtonHintData> = new Vector.<BSButtonHintData>();
  35. hints.push(HoldBreathButton);
  36. hints.push(HoldBreathButtonForVita);
  37. ButtonHintInstance.SetButtonHintData(hints);
  38.  
  39. addEventListener(Event.ADDED_TO_STAGE, this.OnAddedToStage, false, 0, true);
  40. }
  41.  
  42. private function OnAddedToStage(event:Event):void
  43. {
  44. removeEventListener(Event.ADDED_TO_STAGE, this.OnAddedToStage, false);
  45.  
  46. trace("[ScopeMenu] onStageInit");
  47. OverlayLoader_mc.Info.addEventListener(Event.COMPLETE, this.OnLoadComplete);
  48. OverlayLoader_mc.Info.addEventListener(IOErrorEvent.IO_ERROR, this.OnLoadError);
  49.  
  50. }
  51.  
  52.  
  53. // Events
  54. //---------------------------------------------
  55.  
  56. private function OnLoadComplete(e:Event) : void
  57. {
  58. gotoAndStop(18);
  59. trace("[ScopeMenu] LOADED");
  60. }
  61.  
  62.  
  63. private function OnLoadError(e:IOErrorEvent) : void
  64. {
  65. gotoAndStop(OverlayFrame);
  66. trace("[ScopeMenu] ERROR");
  67. }
  68.  
  69.  
  70. // Methods
  71. //---------------------------------------------
  72.  
  73. public function SetIsVita(isVita:Boolean) : *
  74. {
  75. if (isVita)
  76. {
  77. HoldBreathButton.ButtonVisible = false;
  78. HoldBreathButtonForVita.ButtonVisible = true;
  79. }
  80. else
  81. {
  82. HoldBreathButton.ButtonVisible = true;
  83. HoldBreathButtonForVita.ButtonVisible = false;
  84. }
  85. }
  86.  
  87.  
  88. public function SetOverlay(identifier:uint) : *
  89. {
  90. OverlayFrame = identifier + 1;
  91. gotoAndStop(OverlayFrame);
  92. trace("[ScopeMenu] SetOverlay(identifier="+identifier+")");
  93. }
  94.  
  95.  
  96. public function SetCustom(filePath:String) : *
  97. {
  98. OverlayLoader_mc.Load(filePath);
  99. trace("[ScopeMenu] SetCustom(filePath="+filePath+")");
  100. }
  101.  
  102.  
  103. public function GetCustom() : String
  104. {
  105. return OverlayLoader_mc.Instance;
  106. }
  107.  
  108.  
  109. public function PathConvert(filepath:String, toExtension:String) : String
  110. {
  111. trace("[ScopeMenu] PathConvert(filepath="+filepath+", toExtension="+toExtension+")");
  112. return Path.ConvertFileExtension(filepath, toExtension);
  113. }
  114.  
  115.  
  116. }
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement