Oliboli8769 (03-23-2013),Rance-Sama (03-20-2013)
Hello Everyone, as promised I have a new video! and in this video, I explain in great detail howto make a Advanced menu similar to the ones in ZeroLight and other semi-popular trainers. I sounded pretty homo in this video due to a lack of a 'good' microphone, so please don't flame me.
Code:
Need any more help? Reply to this thread below.Code:Another reminder! Be sure to change the code of the shop loader to this: this.Game.world.sendLoadShopRequest(this.ItemMenu. shoptext.text); This is the actual code: //Menus: this.ItemMenu.visible = false //Show Menus: btn_Menu.addEventListener(MouseEvent.CLICK, mainmenu); //Menu Buttons: this.ItemMenu.btn_Hair.addEventListener(MouseEvent .CLICK, hairshop); this.ItemMenu.btn_Badges.addEventListener(MouseEve nt.CLICK, Loadbadges); //Functions function mainmenu(e:MouseEvent){ if(this.ItemMenu.visible == true){ this.ItemMenu.visible = false; }else if(this.ItemMenu.visible == false){ this.ItemMenu.visible = true; } } function hairshop(e:MouseEvent){ this.Game.world.sendLoadHairShopRequest(this.ItemM enu.hairtxt.text); } function Loadbadges(e:MouseEvent):void{ this.ItemMenu.cb1.removeAll(); badgeList(); } function badgeList():void{ this.ItemMenu.cb1.addItem({label:"FridayThe13th Badge", data:"%xt%zm%setAchievement%79%ia0%0%1%"}); this.ItemMenu.cb1.addItem({label:"KungFood Badge", data:"%xt%zm%setAchievement%79%ia0%1%1%"}); this.ItemMenu.cb1.addItem({label:"MoglinPunter Badge", data:"%xt%zm%setAchievement%79%ia0%2%1%"}); this.ItemMenu.cb1.addItem({label:"EyeWasThere Badge", data:"%xt%zm%setAchievement%79%ia0%5%1%"}); this.ItemMenu.cbt.addItem({label:"Stubborn Badge", data:"%xt%zm%setAchievement%79%ia0%7%1%"}); this.ItemMenu.cb1.addItem({label:"Unicorn Commander Badge", data:"%xt%zm%setAchievement%79%ia0%12%1%"}); this.ItemMenu.cb1.addItem({label:"Cornelis Badge", data:"%xt%zm%setAchievement%79%ia0%13%1%"}); this.ItemMenu.cb1.addItem({label:"Reinforced Badge", data:"%xt%zm%setAchievement%9773%ia0%8%1%"}); this.ItemMenu.cb1.addItem({label:"Sky Pirate Badge", data:"%xt%zm%setAchievement%9773%ia0%9%1%"}); } //Keybinds: stage.addEventListener(KeyboardEvent.KEY_DOWN,keyP ressed); function keyPressed(keyEvent:KeyboardEvent){ if(keyEvent.keyCode ==38){ menu2(); }else if(keyEvent.keyCode ==40){ trace("Down Arrow pressed"); } } function menu2():void{ if(this.ItemMenu.visible == true){ this.ItemMenu.visible = false; }else if(this.ItemMenu.visible == false){ this.ItemMenu.visible = true; } }
Visit my channel:
Zerobrium - YouTube
Oliboli8769 (03-23-2013),Rance-Sama (03-20-2013)
Great tutorial but whenever I get around to anything like that I'm going to use text with instance names.
Hey man, I did a small change to your code, it works the same but uses less lines, so your AS gets "cleaner":
Code://Menus: this.ItemMenu.visible = false //Show Menus: btn_Menu.addEventListener(MouseEvent.CLICK, mainmenu); //Menu Buttons: this.ItemMenu.btn_Hair.addEventListener(MouseEvent.CLICK, hairshop); this.ItemMenu.btn_Badges.addEventListener(MouseEvent.CLICK, Loadbadges); //Functions function mainmenu(e:MouseEvent) { ItemMenu.visible = !ItemMenu.visible; } } function hairshop(e:MouseEvent) { this.Game.world.sendLoadHairShopRequest(this.ItemMenu.hairtxt.text); } function Loadbadges(e:MouseEvent):void { this.ItemMenu.cb1.removeAll(); badgeList(); } function badgeList():void { this.ItemMenu.cb1.addItem({label:"FridayThe13th Badge", data:"%xt%zm%setAchievement%79%ia0%0%1%"}); this.ItemMenu.cb1.addItem({label:"KungFood Badge", data:"%xt%zm%setAchievement%79%ia0%1%1%"}); this.ItemMenu.cb1.addItem({label:"MoglinPunter Badge", data:"%xt%zm%setAchievement%79%ia0%2%1%"}); this.ItemMenu.cb1.addItem({label:"EyeWasThere Badge", data:"%xt%zm%setAchievement%79%ia0%5%1%"}); this.ItemMenu.cbt.addItem({label:"Stubborn Badge", data:"%xt%zm%setAchievement%79%ia0%7%1%"}); this.ItemMenu.cb1.addItem({label:"Unicorn Commander Badge", data:"%xt%zm%setAchievement%79%ia0%12%1%"}); this.ItemMenu.cb1.addItem({label:"Cornelis Badge", data:"%xt%zm%setAchievement%79%ia0%13%1%"}); this.ItemMenu.cb1.addItem({label:"Reinforced Badge", data:"%xt%zm%setAchievement%9773%ia0%8%1%"}); this.ItemMenu.cb1.addItem({label:"Sky Pirate Badge", data:"%xt%zm%setAchievement%9773%ia0%9%1%"}); } //Keybinds: stage.addEventListener(KeyboardEvent.KEY_DOWN,keyPressed); function keyPressed(keyEvent:KeyboardEvent) { if(keyEvent.keyCode ==38) { menu2(); } else if(keyEvent.keyCode ==40) { trace("Down Arrow pressed"); } } function menu2():void { ItemMenu.visible = !ItemMenu.visible; }
zerobrium (03-20-2013)