Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menuLoaders.visible = false;
- menuLoaders.btnQuest.addEventListener(MouseEvent.CLICK, btnQuest_onClick);
- /*Notice how the event listener is now being applied to 'menuLoaders.btnQuest' as btnQuest is now being held on the menuLoaders symbol.*/
- function btnQuest_onClick(e:MouseEvent):void
- {
- Game.world.showQuests(menuLoaders.txtQuest.text, "q");
- //Same goes for the TextInput called txtQuest
- }
- btnLoaders.addEventListener(MouseEvent.CLICK, btnLoaders_onClick);
- //This button will now be used to open the Loaders menu
- function btnLoaders_onClick(e:MouseEvent):void
- {
- menuLoaders.visible = !menuLoaders.visible;
- //This toggles the visibility of the menu. This method is much cleaner than using if statements.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement