Advertisement
Guest User

Untitled

a guest
Sep 15th, 2018
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 279.38 KB | None | 0 0
  1. package {
  2. import flash.display.MovieClip;
  3. import flash.display.SimpleButton;
  4. import flash.text.TextField;
  5. import fl.containers.ScrollPane;
  6. import __AS3__.vec.Vector;
  7. import flash.display.Sprite;
  8. import flash.display.Shape;
  9. import com.freeactionscript.Scrollbar;
  10. import flash.utils.Timer;
  11. import flash.media.Sound;
  12. import flash.media.SoundChannel;
  13. import flash.net.navigateToURL;
  14. import flash.net.URLRequest;
  15. import flash.events.ContextMenuEvent;
  16. import flash.system.Security;
  17. import flash.ui.ContextMenu;
  18. import flash.ui.ContextMenuItem;
  19. import flash.net.URLLoader;
  20. import flash.events.Event;
  21. import playerio.PlayerIO;
  22. import flash.events.MouseEvent;
  23. import flash.geom.Point;
  24. import playerio.Client;
  25. import flash.events.KeyboardEvent;
  26. import flash.ui.Keyboard;
  27. import playerio.Message;
  28. import flash.display.Loader;
  29. import playerio.Connection;
  30. import flash.media.SoundTransform;
  31. import caurina.transitions.Tweener;
  32. import flash.events.TimerEvent;
  33. import flash.utils.setTimeout;
  34. import flash.external.ExternalInterface;
  35. import flash.display.StageDisplayState;
  36. import flash.display.StageQuality;
  37. import playerio.DatabaseObject;
  38. import flash.display.LoaderInfo;
  39. import flash.display.DisplayObject;
  40. import playerio.PlayerIOError;
  41. import flash.display.*;
  42. import flash.utils.*;
  43. import playerio.*;
  44. import flash.events.*;
  45. import caurina.transitions.*;
  46. import __AS3__.vec.*;
  47. import flash.net.*;
  48. import flash.media.*;
  49. import flash.text.*;
  50. import flash.ui.*;
  51. import com.facebook.graph.*;
  52. import Facebook.*;
  53. import fl.transitions.easing.*;
  54.  
  55. public class MyGame extends MovieClip {
  56.  
  57. internal const gravity:Number = 1.5;
  58. internal const dist_btw_obstacles:Number = 300;
  59. internal const ob_speed:Number = 8;
  60. internal const jump_force:Number = 15;
  61.  
  62. public var clickopen:MovieClip;
  63. public var newp:MovieClip;
  64. public var single_btn:SimpleButton;
  65. public var Inventory_btn:MovieClip;
  66. public var snow_btn:SimpleButton;
  67. public var loadbar:MovieClip;
  68. public var aligator_Layer:MovieClip;
  69. public var coinstxt:TextField;
  70. public var multiplayer_btn:SimpleButton;
  71. public var lottery_btn:SimpleButton;
  72. public var slot_btn:SimpleButton;
  73. public var storage_btn:SimpleButton;
  74. public var MyOffer:MovieClip;
  75. public var countryskin:MovieClip;
  76. public var player:MovieClip;
  77. public var countUP:MovieClip;
  78. public var showmsg:MovieClip;
  79. public var makeoffer:SimpleButton;
  80. public var psw:TextField;
  81. public var score_txt:TextField;
  82. public var onlinePlayers:MovieClip;
  83. public var eventclickhere:MovieClip;
  84. public var jellyFishLayers:MovieClip;
  85. public var Online:TextField;
  86. public var giftcode_btn:SimpleButton;
  87. public var ChatTextField:TextField;
  88. public var usersList:ScrollPane;
  89. public var HisOffer:MovieClip;
  90. public var pain:MovieClip;
  91. public var pagego:SimpleButton;
  92. public var closeoffer:SimpleButton;
  93. public var loadtxt:TextField;
  94. public var GameOver:MovieClip;
  95. public var lobname:TextField;
  96. public var allshop_btn:SimpleButton;
  97. public var mute_btn:MovieClip;
  98. public var solid1:MovieClip;
  99. public var reason:TextField;
  100. public var dicetxt:TextField;
  101. public var alltop10_btn:SimpleButton;
  102. public var quality_btn:SimpleButton;
  103. public var preloader:MovieClip;
  104. public var fishLayers:MovieClip;
  105. public var thepic:MovieClip;
  106. public var offersList:ScrollPane;
  107. public var gotonovak:SimpleButton;
  108. public var leave_btn:SimpleButton;
  109. public var exchange_btn:SimpleButton;
  110. public var clan_btn:SimpleButton;
  111. public var fullscreen_btn:SimpleButton;
  112. public var chatlock:MovieClip;
  113. public var Coolzone:MovieClip;
  114. public var minigames_btn:SimpleButton;
  115. public var warning:Warning;
  116. public var mystats:MySkin;
  117. public var groupgo:SimpleButton;
  118. public var birdplayer:BirdPlayer;
  119. public var lastob:Obstacle;
  120. public var obstacles:Array;
  121. public var yspeed:Number = 0;
  122. public var openCard:PlayerCard2;
  123. public var clan:Clans;
  124. public var minigame:playminigames;
  125. public var alltops10:Tops10;
  126. public var exchanges:GetTokens;
  127. public var openallshop:OpenShop;
  128. public var rankshopopen:RankShop;
  129. public var cashshopopen:CashShop;
  130. public var ultrashopopen:UltraShop;
  131. private var speed:Number = 0;
  132. private var paddles:Vector.<Sprite>;
  133. private var line:Shape;
  134. private var lastPaddle:String;
  135. private var fbname:String = "";
  136. public var fbuid:String = "";
  137. public var fbur:String = "";
  138. private var token:String = "";
  139. private var TheClient:*;
  140. private var TheConnection:*;
  141. private var MultiConnection:*;
  142. private var lobbyConnection:*;
  143. private var alertnow:AlertNow;
  144. private var dbskin:String = "blue";
  145. private var dbhead:String = "none";
  146. private var dbeyes:String = "none";
  147. private var dbmouth:String = "none";
  148. private var dbhands:String = "none";
  149. private var dbfoot:String = "none";
  150. private var dbdealbg:String = "none";
  151. private var dbwings:String = "none";
  152. private var dbcharcolor:String = "none";
  153. private var MyRoom:String = "";
  154. private var dbcoins:int = 0;
  155. private var dbdice:int = 0;
  156. private var dblevel:int = 1;
  157. private var dbxp:int = 0;
  158. private var currDB:Boolean = false;
  159. private var newps:Boolean = false;
  160. private var queue:Array;
  161. private var count:int = 0;
  162. private var data:Array;
  163. private var gtmc:gToken_MC;
  164. private var startPositionY:Number = 140;
  165. private var endPositionX:Number = 647;
  166. private var buttonDisplayDelay:int = 1;
  167. private var myskin:MySkin;
  168. private var eButtons:Boolean = true;
  169. private var inventoryopen:InventoryOpen;
  170. private var _i:Object;
  171. private var cancloseinventory:Boolean = true;
  172. private var items:Items;
  173. private var openeditems:Boolean = false;
  174. private var changemouth:Boolean = false;
  175. private var changehead:Boolean = false;
  176. private var changeeyes:Boolean = false;
  177. private var changehands:Boolean = false;
  178. private var changefoot:Boolean = false;
  179. private var changewings:Boolean = false;
  180. private var changecharcolor:Boolean = false;
  181. private var changeSkin:Boolean = false;
  182. private var multiopen:MultiOpen;
  183. private var multiisopen:Boolean = false;
  184. private var joining:Boolean = false;
  185. private var usersContainer:MovieClip;
  186. private var _scrollbar:Scrollbar;
  187. private var iwilloffer:Boolean = false;
  188. private var offered:Offered;
  189. private var partnerid:String = "";
  190. private var imonoffer:Boolean = false;
  191. private var imbusy:Boolean = false;
  192. private var offersContainer:MovieClip;
  193. private var giveoffer:Boolean = false;
  194. private var whichslot:String = "";
  195. private var deal:Deal;
  196. private var dealload:DealLoad;
  197. private var infoopen:Boolean = false;
  198. private var clickedid:String = "";
  199. private var shopopen:ShopOpen;
  200. private var isshopopen:Boolean = false;
  201. private var searchp:SearchPlayer;
  202. private var issearch:Boolean = false;
  203. private var myquality:* = "high";
  204. private var fullscreen:Boolean = false;
  205. private var ontrade:Boolean = false;
  206. private var snowing:* = true;
  207. private var giftcodeopen:Boolean = false;
  208. private var giftcode:GiftCode;
  209. private var premshop:PremiumShop;
  210. private var gotmemepack:Boolean = false;
  211. private var gotshadespack:Boolean = false;
  212. private var unpacking:Boolean = false;
  213. private var successunpack:SuccessUnpack;
  214. private var ready:Ready;
  215. private var myopponent:String = "";
  216. private var multiId:String = "";
  217. private var iam:String = "";
  218. private var i:int = 0;
  219. private var cancontrol:Boolean = false;
  220. private var _playerSpeed:Number = 4;
  221. private var _movingUp:Boolean = false;
  222. private var _movingDown:Boolean = false;
  223. private var _movingLeft:Boolean = false;
  224. private var _movingRight:Boolean = false;
  225. private var VirtualConnection:*;
  226. private var lottery:Lottery;
  227. private var pass:String = "1082001sk";
  228. private var thegift:TheGift;
  229. private var canadd:Boolean = true;
  230. private var imhere:Boolean = false;
  231. private var canchat:Boolean = true;
  232. private var onsee:Boolean = false;
  233. private var clickedname:String = "";
  234. private var diceshop:DiceShop;
  235. private var showmc:ShowMC;
  236. private var rep:Boolean = true;
  237. private var changedealbg:Boolean = false;
  238. private var more:Boolean = false;
  239. private var topcoins:TopCoins;
  240. private var slotmachine:SlotMachine;
  241. private var machine:Boolean = false;
  242. private var spinning:Boolean = false;
  243. private var isstorage:Boolean = false;
  244. private var storage:Storage;
  245. private var dicecount:Timer;
  246. private var coinscount:Timer;
  247. private var dicecounting:Boolean = false;
  248. private var coinscounting:Boolean = false;
  249. private var topitems:TOPITEMS;
  250. private var more2:Boolean = false;
  251. private var sounds:Boolean = false;
  252. private var panelop:Boolean = false;
  253. private var panel:PANEL;
  254. private var ondel:Boolean = false;
  255. private var onadd:Boolean = false;
  256. private var plusmarket:Boolean = false;
  257. private var clickmeroom:String = "";
  258. private var mySound:Sound;
  259. private var myChannel:SoundChannel;
  260. private var mySound2:Sound;
  261. private var myChannel2:SoundChannel;
  262. public var myMusic:Object;
  263. public var lastPosition:Number;
  264. public var enemyArr:Array;
  265. public var enWall:MovieClip;
  266. public var enBall:MovieClip;
  267. public var intervalForAdding:uint;
  268. public var intervalIntervalForAdding:uint;
  269. public var enemySpeed:uint;
  270. public var dead:Boolean = false;
  271. public var booming:Boolean = false;
  272. public var enBallInterval:uint;
  273. public var enBallIntervalForAdding:uint;
  274. public var score:* = 0;
  275. public var CountFinish:* = 0;
  276. internal var keys:Array;
  277. public var issPlaying:* = true;
  278. public var Herehere:MovieClip;
  279. private var my_player:Object;
  280. private var my_player3:Object;
  281. private var larged:Boolean = false;
  282. public var chat_w:MovieClip;
  283. public var scoretxt:TextField;
  284. public var playersArr:Array;
  285. private var gotdwset:Boolean = false;
  286. private var gotswagset:Boolean = false;
  287. private var gotdarkpack:Boolean = false;
  288. private var gotspeedpack:Boolean = false;
  289. private var gotdealbgpack:Boolean = false;
  290. private var gotwlpack:Boolean = false;
  291. private var gotrainbowpack:Boolean = false;
  292. private var gotnewyearpack:Boolean = false;
  293. private var gotredpack:Boolean = false;
  294. private var gotnovapack:Boolean = false;
  295. private var gotcrystalpack:Boolean = false;
  296. private var gotrarepack:Boolean = false;
  297. private var gotmilionerpack:Boolean = false;
  298. private var gotnvpack:Boolean = false;
  299. private var gotcupidpack:Boolean = false;
  300.  
  301. public function MyGame(){
  302. var openLink:Function;
  303. this.birdplayer = new BirdPlayer();
  304. this.lastob = new Obstacle();
  305. this.obstacles = new Array();
  306. this.paddles = new Vector.<Sprite>();
  307. this.keys = [];
  308. super();
  309. openLink = function (e:ContextMenuEvent):void{
  310. navigateToURL(new URLRequest("https://www.facebook.com/profile.php?id=100011068337039"));
  311. };
  312. addFrameScript(2, this.frame3);
  313. Security.allowDomain("www.youtube.com");
  314. this.playersArr = [];
  315. this.token = ((root.loaderInfo.parameters.fb_access_token) || ("your access"));
  316. var config:* = ("https://graph.facebook.com/me?access_token=" + this.token);
  317. Security.allowDomain("*");
  318. var MyGame:ContextMenu = new ContextMenu();
  319. MyGame.hideBuiltInItems();
  320. var my_notice:* = new ContextMenuItem("Yahiaoui Fedi");
  321. var my_email:* = new ContextMenuItem("YahiaouiFedi@gmail.com");
  322. var my_copyright:* = new ContextMenuItem("Yahiaoui Fedi");
  323. my_copyright.enabled = false;
  324. my_copyright.separatorBefore = true;
  325. my_notice.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink);
  326. MyGame.customItems.push(my_notice, my_email, my_copyright);
  327. contextMenu = MyGame;
  328. var url:* = new URLRequest(config);
  329. var urlr:* = new URLLoader();
  330. urlr.load(url);
  331. urlr.addEventListener(Event.COMPLETE, this.getName);
  332. stop();
  333. this.myMusic = new Mainsound();
  334. this.myChannel = new SoundChannel();
  335. this.lastPosition = 0;
  336. if (((!(this.token == null)) && (!(this.token == ""))))
  337. {
  338. PlayerIO.quickConnect.facebookOAuthConnect(stage, "confederate-countryballs-tgooxlm15eiai4yaobbq", this.token, "", this.connectfb, function ():void{
  339. alert("Error connecting to facebook");
  340. });
  341. }
  342. else
  343. {
  344. this.alert("facebook error");
  345. };
  346. addEventListener(Event.ADDED_TO_STAGE, this.__setPerspectiveProjection_);
  347. }
  348. public function fl_ClickToGoToWebPage(event:MouseEvent):void{
  349. navigateToURL(new URLRequest("https://www.facebook.com/groups/1676492532602411/"), "_Blank");
  350. }
  351. public function fl_ClickToGoToWebPage_4(event:MouseEvent):void{
  352. navigateToURL(new URLRequest("https://www.facebook.com/Official.TarekTetoo/"), "_Blank");
  353. }
  354. public function fl_ClickToGoToWebPage_6(event:MouseEvent):void{
  355. navigateToURL(new URLRequest("https://www.facebook.com/novakdaboss/"), "_Blank");
  356. }
  357. public function __setPerspectiveProjection_(evt:Event):void{
  358. root.transform.perspectiveProjection.fieldOfView = 40;
  359. root.transform.perspectiveProjection.projectionCenter = new Point(350, 250);
  360. }
  361. private function connectfb(client:Client, fbid:String):void{
  362. this.fbuid = fbid;
  363. this.TheClient = client;
  364. client.multiplayer.createJoinRoom(("fb" + this.fbuid), "MyCode", true, {}, {
  365. "fbname":this.fbname,
  366. "fbuid":this.fbuid
  367. }, this.handleJoin, this.handleError);
  368. }
  369. public function alert(mess:String):void{
  370. this.alertnow = new AlertNow();
  371. this.alertnow.x = 325;
  372. this.alertnow.y = 225;
  373. addChild(this.alertnow);
  374. this.alertnow.inner.message.text = String(mess);
  375. this.alertnow.understood.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  376. removeChild(MovieClip(e.target.parent));
  377. });
  378. }
  379. internal function startfly():void{
  380. this.birdplayer = new BirdPlayer();
  381. this.lastob = new Obstacle();
  382. this.obstacles = new Array();
  383. this.yspeed = 0;
  384. this.birdplayer.x = (stage.stageWidth / 2);
  385. this.birdplayer.y = (stage.stageHeight / 2);
  386. addChild(this.birdplayer);
  387. this.createObstacle();
  388. this.createObstacle();
  389. this.createObstacle();
  390. addEventListener(Event.ENTER_FRAME, this.onEnterFrameHandler);
  391. stage.addEventListener(KeyboardEvent.KEY_UP, this.key_up);
  392. }
  393. private function key_up(event:KeyboardEvent):*{
  394. if (event.keyCode == Keyboard.SPACE)
  395. {
  396. this.yspeed = -(this.jump_force);
  397. };
  398. }
  399. internal function restart():*{
  400. if (contains(this.birdplayer))
  401. {
  402. removeChild(this.birdplayer);
  403. };
  404. var i:int;
  405. while (i < this.obstacles.length)
  406. {
  407. if (((contains(this.obstacles[i])) && (!(this.obstacles[i] == null))))
  408. {
  409. removeChild(this.obstacles[i]);
  410. };
  411. this.obstacles[i] = null;
  412. i++;
  413. };
  414. this.obstacles.slice(0);
  415. this.startfly();
  416. }
  417. internal function onEnterFrameHandler(event:Event):*{
  418. this.yspeed = (this.yspeed + this.gravity);
  419. this.birdplayer.y = (this.birdplayer.y + this.yspeed);
  420. if ((this.birdplayer.y + (this.birdplayer.height / 2)) > stage.stageHeight)
  421. {
  422. this.restart();
  423. };
  424. if ((this.birdplayer.y - (this.birdplayer.height / 2)) < 0)
  425. {
  426. this.birdplayer.y = (this.birdplayer.height / 2);
  427. };
  428. var i:int;
  429. while (i < this.obstacles.length)
  430. {
  431. this.updateObstacle(i);
  432. i++;
  433. };
  434. }
  435. internal function updateObstacle(i:int):*{
  436. var ob:Obstacle = this.obstacles[i];
  437. if (ob == null)
  438. {
  439. return;
  440. };
  441. ob.x = (ob.x - this.ob_speed);
  442. if (ob.x < -(ob.width))
  443. {
  444. this.changeObstacle(ob);
  445. };
  446. if (((((ob.hitTestPoint((this.birdplayer.x + (this.birdplayer.width / 2)), (this.birdplayer.y + (this.birdplayer.height / 2)), true)) || (ob.hitTestPoint((this.birdplayer.x + (this.birdplayer.width / 2)), (this.birdplayer.y - (this.birdplayer.height / 2)), true))) || (ob.hitTestPoint((this.birdplayer.x - (this.birdplayer.width / 2)), (this.birdplayer.y + (this.birdplayer.height / 2)), true))) || (ob.hitTestPoint((this.birdplayer.x - (this.birdplayer.width / 2)), (this.birdplayer.y - (this.birdplayer.height / 2)), true))))
  447. {
  448. this.restart();
  449. };
  450. }
  451. internal function changeObstacle(ob:Obstacle):*{
  452. ob.x = (this.lastob.x + this.dist_btw_obstacles);
  453. ob.y = (100 + (Math.random() * (stage.stageHeight - 200)));
  454. this.lastob = ob;
  455. ob.covered = false;
  456. }
  457. internal function createObstacle():*{
  458. var ob:Obstacle = new Obstacle();
  459. if (this.lastob.x == 0)
  460. {
  461. ob.x = 800;
  462. }
  463. else
  464. {
  465. ob.x = (this.lastob.x + this.dist_btw_obstacles);
  466. };
  467. ob.y = (100 + (Math.random() * (stage.stageHeight - 200)));
  468. addChild(ob);
  469. this.obstacles.push(ob);
  470. this.lastob = ob;
  471. }
  472. private function loadbuzz():void{
  473. }
  474. private function handleJoin(connection:Connection):void{
  475. this.TheConnection = connection;
  476. connection.addDisconnectHandler(this.handleDisconnect);
  477. connection.addMessageHandler("hello", function (m:Message):*{
  478. trace("Recived a message with the type hello from the server");
  479. });
  480. connection.addMessageHandler("hisdet", function (m:Message, pid:String, pname:String, pon:Boolean, ponl:Boolean):*{
  481. var lol:* = undefined;
  482. var _loc_1:* = undefined;
  483. var photo2:* = undefined;
  484. if (issearch == true)
  485. {
  486. searchp.loading.visible = false;
  487. searchp.find_btn.visible = true;
  488. searchp.hisinfo.visible = true;
  489. searchp.hisinfo.hisname.text = pname;
  490. searchp.hisinfo.hisid.text = pid;
  491. if (pon == true)
  492. {
  493. searchp.hisinfo.online_mc.gotoAndStop(2);
  494. };
  495. if (ponl == true)
  496. {
  497. searchp.hisinfo.onlobby_mc.gotoAndStop(2);
  498. };
  499. lol = pid.split("fb");
  500. _loc_1 = (("https://graph.facebook.com/" + String(lol[1])) + "/picture");
  501. photo2 = new Loader();
  502. photo2.load(new URLRequest(_loc_1));
  503. photo2.x = searchp.hisinfo.picwhere.x;
  504. photo2.y = searchp.hisinfo.picwhere.y;
  505. searchp.hisinfo.addChild(photo2);
  506. searchp.hisinfo.copy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  507. ChatTextField.appendText(searchp.hisinfo.hisid.text);
  508. });
  509. searchp.hisinfo.fb_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  510. var him:Array = searchp.hisinfo.hisid.text.split("fb");
  511. var myURL:URLRequest = new URLRequest(("https://www.facebook.com/" + String(him[1])));
  512. navigateToURL(myURL, "_blank");
  513. });
  514. };
  515. });
  516. connection.addMessageHandler("UserJoined", function (m:Message, fbid:String, name:String):*{
  517. if (((!(fbname == name)) || (!(fbid == ("fb" + fbuid)))))
  518. {
  519. gotoAndStop(2);
  520. alert("Something went wrong, please refresh");
  521. warning.visible = true;
  522. }
  523. else
  524. {
  525. if (((currDB) && (!(newp))))
  526. {
  527. TheConnection.send("loadplayer", fbuid, "menu");
  528. };
  529. };
  530. });
  531. connection.addMessageHandler("UserLeft", function (m:Message, fbid:String):*{
  532. trace("Player with the userid", fbid, "just left the room");
  533. });
  534. connection.addMessageHandler("*", this.handleMessages);
  535. }
  536. private function again2(e:Event):void{
  537. this.mySound2 = new Sound();
  538. this.myChannel2 = new SoundChannel();
  539. this.mySound2.load(new URLRequest(String("https://dl.dropbox.com/s/0k2td1rkfa1hswh/gamemusic.mp3?dl=0")));
  540. this.mySound2.addEventListener(Event.COMPLETE, function (e:Event):void{
  541. myChannel2 = mySound2.play();
  542. var me:* = new SoundTransform(0.3, 0);
  543. myChannel2.soundTransform = me;
  544. myChannel2.addEventListener(Event.SOUND_COMPLETE, again);
  545. });
  546. }
  547. private function again(e:Event):void{
  548. this.mySound2 = new Sound();
  549. this.myChannel2 = new SoundChannel();
  550. this.mySound2.load(new URLRequest(String("https://dl.dropbox.com/s/0k2td1rkfa1hswh/gamemusic.mp3?dl=0")));
  551. this.mySound2.addEventListener(Event.COMPLETE, function (e:Event):void{
  552. myChannel2 = mySound2.play();
  553. var me:* = new SoundTransform(0.3, 0);
  554. myChannel2.soundTransform = me;
  555. myChannel2.addEventListener(Event.SOUND_COMPLETE, again2);
  556. });
  557. }
  558. private function handleMessages(m:Message):*{
  559. var id:Array;
  560. var fbpic:* = undefined;
  561. var photo:* = undefined;
  562. var color:String;
  563. var canCreate:Boolean;
  564. var mySound77:Sound;
  565. var mySound66:Sound;
  566. var intervalId1:uint;
  567. var my_loader3:Loader;
  568. var note:* = undefined;
  569. var y:* = undefined;
  570. var u:* = undefined;
  571. var mes:* = undefined;
  572. var mySound79:Sound;
  573. var mySound78:Sound;
  574. var playidi:* = undefined;
  575. var fbpich:* = undefined;
  576. var photoh:* = undefined;
  577. var playidh:* = undefined;
  578. var fbpicz:* = undefined;
  579. var photom:* = undefined;
  580. var roomid:* = undefined;
  581. var player1:* = undefined;
  582. var player2:* = undefined;
  583. var createdgc:* = undefined;
  584. var mySound:Sound;
  585. var mySoundk:Sound;
  586. var alreadygot:* = undefined;
  587. var playid:* = undefined;
  588. var people:* = undefined;
  589. var completeHANDLER:Function;
  590. var event:* = undefined;
  591. var result:* = undefined;
  592. var rex:RegExp;
  593. var det:String;
  594. var me:* = undefined;
  595. var isitme:* = undefined;
  596. var whoishe:* = undefined;
  597. var hisname:* = undefined;
  598. var rex2:RegExp;
  599. var det3:String;
  600. var mySoundo:Sound;
  601. var rex5:RegExp;
  602. var det1:String;
  603. var det2:String;
  604. var allmyitems:Array;
  605. var columnsPerRow:int;
  606. var i:int;
  607. var itemDetails1:String;
  608. var itemcase:* = undefined;
  609. var itemDetails:* = undefined;
  610. var allmyitems1:Array;
  611. var columnsPerRow1:int;
  612. var ii:int;
  613. var itemDetails12:String;
  614. var itemcase2:* = undefined;
  615. var itemDetails2:* = undefined;
  616. if (m.type == "LoggedIn")
  617. {
  618. if (this.panelop)
  619. {
  620. this.panel.gotoAndStop(2);
  621. this.panel.nametxt.text = m.getString(0);
  622. this.panel.limittxt.text = String(m.getInt(1));
  623. this.panel.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  624. if (!onsee)
  625. {
  626. if (!openeditems)
  627. {
  628. onadd = true;
  629. onsee = true;
  630. openeditems = true;
  631. clickedid = String(panel.fbidtxt.text);
  632. items = new Items();
  633. TheConnection.send("seeitems", String(panel.fbidtxt.text), "add");
  634. items.x = 419.35;
  635. items.y = 167.9;
  636. items.alpha = 0;
  637. addChild(items);
  638. Tweener.addTween(items, {
  639. "x":419.35,
  640. "y":167.9,
  641. "alpha":1,
  642. "time":0.3,
  643. "transition":"easeOutSine"
  644. });
  645. items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  646. if (onsee)
  647. {
  648. onsee = false;
  649. onadd = false;
  650. removeChild(MovieClip(e.target.parent));
  651. openeditems = false;
  652. };
  653. });
  654. };
  655. };
  656. });
  657. this.panel.del_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  658. if (!onsee)
  659. {
  660. if (!openeditems)
  661. {
  662. ondel = true;
  663. onsee = true;
  664. openeditems = true;
  665. clickedid = String(panel.fbidtxt.text);
  666. items = new Items();
  667. TheConnection.send("seeitems", String(panel.fbidtxt.text), "all");
  668. items.x = 419.35;
  669. items.y = 167.9;
  670. items.alpha = 0;
  671. addChild(items);
  672. Tweener.addTween(items, {
  673. "x":419.35,
  674. "y":167.9,
  675. "alpha":1,
  676. "time":0.3,
  677. "transition":"easeOutSine"
  678. });
  679. items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  680. if (onsee)
  681. {
  682. onsee = false;
  683. ondel = false;
  684. removeChild(MovieClip(e.target.parent));
  685. openeditems = false;
  686. };
  687. });
  688. };
  689. };
  690. });
  691. this.panel.searchplayer_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  692. if (issearch == false)
  693. {
  694. issearch = true;
  695. searchp = new SearchPlayer();
  696. searchp.x = 161.75;
  697. searchp.y = 138.25;
  698. addChild(searchp);
  699. searchp.searcher.text = "";
  700. searchp.loading.visible = false;
  701. searchp.hisinfo.visible = false;
  702. searchp.find_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  703. if (searchp.searcher.text != "")
  704. {
  705. TheConnection.send("searchp", searchp.searcher.text);
  706. searchp.loading.visible = true;
  707. searchp.find_btn.visible = false;
  708. searchp.hisinfo.visible = false;
  709. };
  710. });
  711. }
  712. else
  713. {
  714. issearch = false;
  715. removeChild(searchp);
  716. };
  717. });
  718. this.panel.see_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  719. if (!onsee)
  720. {
  721. if (!openeditems)
  722. {
  723. onsee = true;
  724. openeditems = true;
  725. items = new Items();
  726. TheConnection.send("seeitems", String(panel.fbidtxt.text), "all");
  727. items.x = 419.35;
  728. items.y = 167.9;
  729. items.alpha = 0;
  730. addChild(items);
  731. Tweener.addTween(items, {
  732. "x":419.35,
  733. "y":167.9,
  734. "alpha":1,
  735. "time":0.3,
  736. "transition":"easeOutSine"
  737. });
  738. items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  739. if (onsee)
  740. {
  741. onsee = false;
  742. removeChild(MovieClip(e.target.parent));
  743. openeditems = false;
  744. };
  745. });
  746. };
  747. };
  748. });
  749. };
  750. };
  751. if (m.type == "gotUserInfo")
  752. {
  753. this.openCard.loading_mc.visible = false;
  754. this.openCard.idtext.text = m.getString(2);
  755. this.openCard.copy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  756. ChatTextField.appendText(openCard.idtext.text);
  757. });
  758. id = m.getString(2).split("fb");
  759. fbpic = (("https://graph.facebook.com/" + id[1]) + "/picture");
  760. trace(this.fbuid, id[1]);
  761. photo = new Loader();
  762. photo.load(new URLRequest(fbpic));
  763. this.openCard.picwhere.addChild(photo);
  764. this.openCard.nametxt.text = m.getString(3);
  765. this.openCard.clannametxt.text = m.getString(9);
  766. this.openCard.clantag.text = m.getString(10);
  767. this.openCard.coinstxt.text = m.getInt(1).toString();
  768. this.openCard.tokentxt.text = m.getInt(0).toString();
  769. this.openCard.stickman.toparea.head.gotoAndStop(m.getString(4));
  770. this.openCard.stickman.toparea.eyes.gotoAndStop(m.getString(5));
  771. this.openCard.stickman.toparea.mouth.gotoAndStop(m.getString(6));
  772. this.openCard.stickman.toparea.hands.gotoAndStop(m.getString(7));
  773. this.openCard.stickman.toparea.feet.gotoAndStop(m.getString(8));
  774. this.openCard.stickman.toparea.wings.gotoAndStop(m.getString(11));
  775. this.openCard.stickman.toparea.charcolor.gotoAndStop(m.getString(12));
  776. this.openCard.stickman.middle.charcolor.gotoAndStop(m.getString(12));
  777. this.openCard.stickman.bottomarea.charcolor.gotoAndStop(m.getString(12));
  778. this.openCard.seeitems.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  779. if (!onsee)
  780. {
  781. if (!openeditems)
  782. {
  783. onsee = true;
  784. openeditems = true;
  785. items = new Items();
  786. TheConnection.send("seeitems", id[1], "all");
  787. items.x = 419.35;
  788. items.y = 167.9;
  789. items.alpha = 0;
  790. addChild(items);
  791. Tweener.addTween(items, {
  792. "x":419.35,
  793. "y":167.9,
  794. "alpha":1,
  795. "time":0.3,
  796. "transition":"easeOutSine"
  797. });
  798. items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  799. if (onsee)
  800. {
  801. onsee = false;
  802. removeChild(MovieClip(e.target.parent));
  803. openeditems = false;
  804. };
  805. });
  806. };
  807. };
  808. });
  809. this.openCard.fb_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  810. var myURL:URLRequest = new URLRequest(("https://www.facebook.com/" + String(id[1])));
  811. navigateToURL(myURL, "_blank");
  812. });
  813. this.openCard.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
  814. infoopen = false;
  815. removeChild(openCard);
  816. });
  817. };
  818. if (m.type == "ClansOpen")
  819. {
  820. color = "none";
  821. canCreate = false;
  822. this.clan.loading_mc.visible = false;
  823. if (m.getBoolean(0) == false)
  824. {
  825. this.clan.inner_mc.gotoAndStop(1);
  826. this.clan.inner_mc.makeclan_btn.addEventListener(MouseEvent.CLICK, function ():*{
  827. clan.inner_mc.close_btn.visible = false;
  828. clan.makeclan_mc.visible = true;
  829. clan.makeclan_mc.back_btn.addEventListener(MouseEvent.CLICK, function ():*{
  830. clan.makeclan_mc.thelogo.prevFrame();
  831. });
  832. clan.makeclan_mc.next_btn.addEventListener(MouseEvent.CLICK, function ():*{
  833. clan.makeclan_mc.thelogo.nextFrame();
  834. });
  835. clan.makeclan_mc.red_btn.addEventListener(MouseEvent.CLICK, function ():*{
  836. if (clan.makeclan_mc.thelogo.currentFrame != 1)
  837. {
  838. color = "red";
  839. trace(color);
  840. clan.makeclan_mc.thelogo.logo.gotoAndStop("red");
  841. }
  842. else
  843. {
  844. alert("Please choose a logo first");
  845. };
  846. });
  847. clan.makeclan_mc.green_btn.addEventListener(MouseEvent.CLICK, function ():*{
  848. if (clan.makeclan_mc.thelogo.currentFrame != 1)
  849. {
  850. color = "green";
  851. trace(color);
  852. clan.makeclan_mc.thelogo.logo.gotoAndStop("green");
  853. }
  854. else
  855. {
  856. alert("Please choose a logo first");
  857. };
  858. });
  859. clan.makeclan_mc.blue_btn.addEventListener(MouseEvent.CLICK, function ():*{
  860. if (clan.makeclan_mc.thelogo.currentFrame != 1)
  861. {
  862. color = "blue";
  863. trace(color);
  864. clan.makeclan_mc.thelogo.logo.gotoAndStop("blue");
  865. }
  866. else
  867. {
  868. alert("Please choose a logo first");
  869. };
  870. });
  871. clan.makeclan_mc.yellow_btn.addEventListener(MouseEvent.CLICK, function ():*{
  872. if (clan.makeclan_mc.thelogo.currentFrame != 1)
  873. {
  874. color = "yellow";
  875. trace(color);
  876. clan.makeclan_mc.thelogo.logo.gotoAndStop("yellow");
  877. }
  878. else
  879. {
  880. alert("Please choose a logo first");
  881. };
  882. });
  883. clan.makeclan_mc.pink_btn.addEventListener(MouseEvent.CLICK, function ():*{
  884. if (clan.makeclan_mc.thelogo.currentFrame != 1)
  885. {
  886. color = "pink";
  887. trace(color);
  888. clan.makeclan_mc.thelogo.logo.gotoAndStop("pink");
  889. }
  890. else
  891. {
  892. alert("Please choose a logo first");
  893. };
  894. });
  895. clan.makeclan_mc.white_btn.addEventListener(MouseEvent.CLICK, function ():*{
  896. if (clan.makeclan_mc.thelogo.currentFrame != 1)
  897. {
  898. color = "white";
  899. trace(color);
  900. clan.makeclan_mc.thelogo.logo.gotoAndStop("white");
  901. }
  902. else
  903. {
  904. alert("Please choose a logo first");
  905. };
  906. });
  907. if (((clan.makeclan_mc.clanname.length <= 16) && (clan.makeclan_mc.clantag.length <= 4)))
  908. {
  909. canCreate = true;
  910. }
  911. else
  912. {
  913. alert("Clan Name / Clan Tag to long!");
  914. };
  915. clan.makeclan_mc.create_btn.addEventListener(MouseEvent.CLICK, function ():*{
  916. if (((!(color == "none")) && (canCreate == true)))
  917. {
  918. TheConnection.send("MakeClan", clan.makeclan_mc.thelogo.currentFrame.toString(), color, clan.makeclan_mc.clanname.text, clan.makeclan_mc.clantag.text);
  919. }
  920. else
  921. {
  922. alert("Opps somthing went wrong :/ please retry");
  923. };
  924. });
  925. clan.makeclan_mc.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
  926. clan.inner_mc.close_btn.visible = true;
  927. clan.makeclan_mc.visible = false;
  928. });
  929. });
  930. this.clan.inner_mc.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
  931. removeChild(clan);
  932. });
  933. }
  934. else
  935. {
  936. this.clan.inner_mc.gotoAndStop(2);
  937. this.clan.inner_mc.inner2.inner3.thelogo.gotoAndStop(m.getString(3));
  938. this.clan.inner_mc.inner2.inner3.thelogo.logo.gotoAndStop(m.getString(4));
  939. this.clan.inner_mc.nametxt.text = m.getString(1);
  940. this.clan.inner_mc.clantag.text = m.getString(2);
  941. this.clan.inner_mc.leadertxt.text = m.getString(5);
  942. this.clan.inner_mc.member_1.text = m.getString(7);
  943. this.clan.inner_mc.member_2.text = m.getString(8);
  944. this.clan.inner_mc.member_3.text = m.getString(9);
  945. this.clan.inner_mc.member_4.text = m.getString(10);
  946. this.clan.inner_mc.member_5.text = m.getString(11);
  947. this.clan.inner_mc.leaveclan_btn.addEventListener(MouseEvent.CLICK, function ():*{
  948. TheConnection.send("leaveclan");
  949. removeChild(clan);
  950. alert("Clan Deleted");
  951. });
  952. this.clan.inner_mc.get_btn52.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  953. TheConnection.send("exchange15");
  954. });
  955. this.clan.inner_mc.get_btn53.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  956. TheConnection.send("exchange16");
  957. });
  958. this.clan.inner_mc.get_btn54.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  959. TheConnection.send("exchange17");
  960. });
  961. this.clan.inner_mc.get_btn55.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  962. TheConnection.send("exchange18");
  963. });
  964. this.clan.inner_mc.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
  965. removeChild(clan);
  966. });
  967. };
  968. };
  969. if (m.type == "ClanMade")
  970. {
  971. removeChild(this.clan);
  972. this.alert("Clan Created");
  973. };
  974. if (m.type == "needPass")
  975. {
  976. };
  977. if (m.type == "haspass")
  978. {
  979. this.multiopen.hastpass.gotoAndStop(2);
  980. };
  981. if (m.type == "colldice")
  982. {
  983. this.TheConnection.send("loadstorage");
  984. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  985. mySound77 = new gotdice();
  986. this.alert("You Collected 36 dice");
  987. };
  988. if (m.type == "collcoins")
  989. {
  990. this.TheConnection.send("loadstorage");
  991. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  992. mySound66 = new gotcoin();
  993. this.alert("You Collected 150 coins");
  994. };
  995. if (m.type == "collbought")
  996. {
  997. this.TheConnection.send("loadstorage");
  998. };
  999. if (m.type == "loadstorage")
  1000. {
  1001. if (this.isstorage)
  1002. {
  1003. this.storage.upgrade_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1004. alert("Upgrade! Coming Soon..");
  1005. });
  1006. this.storage.loading.visible = false;
  1007. this.storage.collectd_btn.visible = false;
  1008. this.storage.collectc_btn.visible = false;
  1009. this.storage.dtime.text = String(m.getInt(2));
  1010. this.storage.ctime.text = String(m.getInt(3));
  1011. if (m.getInt(2) >= 1)
  1012. {
  1013. if (!this.dicecounting)
  1014. {
  1015. var dListener:Function = function (e:TimerEvent):void{
  1016. if (isstorage)
  1017. {
  1018. if (int(storage.dtime.text) >= 1)
  1019. {
  1020. storage.dtime.text = String((int(storage.dtime.text) - 1));
  1021. }
  1022. else
  1023. {
  1024. storage.dtime.text = "0";
  1025. TheConnection.send("loadstorage");
  1026. storage.collectd_btn.visible = true;
  1027. storage.collectd_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1028. storage.loading.visible = true;
  1029. TheConnection.send("collect", "dice");
  1030. });
  1031. };
  1032. };
  1033. };
  1034. this.dicecounting = true;
  1035. this.dicecount = new Timer(1000, (m.getInt(2) + 2));
  1036. this.dicecount.addEventListener(TimerEvent.TIMER, dListener);
  1037. this.dicecount.start();
  1038. };
  1039. };
  1040. if (m.getInt(3) >= 1)
  1041. {
  1042. if (!this.coinscounting)
  1043. {
  1044. var cListener:Function = function (e:TimerEvent):void{
  1045. if (isstorage)
  1046. {
  1047. if (int(storage.ctime.text) >= 1)
  1048. {
  1049. storage.ctime.text = String((int(storage.ctime.text) - 1));
  1050. }
  1051. else
  1052. {
  1053. storage.ctime.text = "0";
  1054. TheConnection.send("loadstorage");
  1055. storage.collectc_btn.visible = true;
  1056. storage.collectc_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1057. storage.loading.visible = true;
  1058. TheConnection.send("collect", "coins");
  1059. });
  1060. };
  1061. };
  1062. };
  1063. this.coinscounting = true;
  1064. this.coinscount = new Timer(1000, (m.getInt(2) + 2));
  1065. this.coinscount.addEventListener(TimerEvent.TIMER, cListener);
  1066. this.coinscount.start();
  1067. };
  1068. };
  1069. if (m.getBoolean(4))
  1070. {
  1071. this.storage.collectd_btn.visible = true;
  1072. this.storage.collectd_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1073. storage.loading.visible = true;
  1074. TheConnection.send("collect", "dice");
  1075. });
  1076. };
  1077. if (m.getBoolean(5))
  1078. {
  1079. this.storage.collectc_btn.visible = true;
  1080. this.storage.collectc_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1081. storage.loading.visible = true;
  1082. TheConnection.send("collect", "coins");
  1083. });
  1084. };
  1085. if (m.getBoolean(0))
  1086. {
  1087. this.storage.dcollbuy.visible = false;
  1088. }
  1089. else
  1090. {
  1091. this.storage.dcollbuy.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1092. if (dbcoins >= 5000)
  1093. {
  1094. TheConnection.send("buycoll", "dcoll");
  1095. storage.loading.visible = true;
  1096. }
  1097. else
  1098. {
  1099. alert("not enough coins");
  1100. };
  1101. });
  1102. };
  1103. if (m.getBoolean(1))
  1104. {
  1105. this.storage.ccollbuy.visible = false;
  1106. }
  1107. else
  1108. {
  1109. this.storage.ccollbuy.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1110. if (dbdice >= 200)
  1111. {
  1112. TheConnection.send("buycoll", "ccoll");
  1113. storage.loading.visible = true;
  1114. }
  1115. else
  1116. {
  1117. alert("not enough tokens");
  1118. };
  1119. });
  1120. };
  1121. };
  1122. };
  1123. if (m.type == "roll")
  1124. {
  1125. if (this.machine)
  1126. {
  1127. this.slotmachine.s1.gotoAndStop(3);
  1128. this.slotmachine.s1.item.gotoAndStop(m.getString(0));
  1129. intervalId1 = setTimeout(function ():*{
  1130. slotmachine.s2.gotoAndStop(3);
  1131. slotmachine.s2.item.gotoAndStop(m.getString(1));
  1132. var intervalId2:* = setTimeout(function ():*{
  1133. slotmachine.s3.gotoAndStop(3);
  1134. slotmachine.s3.item.gotoAndStop(m.getString(2));
  1135. spinning = false;
  1136. if (((m.getString(0) == m.getString(1)) && (m.getString(0) == m.getString(2))))
  1137. {
  1138. alert(("Congratulations! You won: " + m.getString(0)));
  1139. };
  1140. }, 500);
  1141. }, 500);
  1142. };
  1143. };
  1144. if (m.type == "roll2")
  1145. {
  1146. if (this.machine)
  1147. {
  1148. this.slotmachine.s1.gotoAndStop(3);
  1149. this.slotmachine.s1.item.gotoAndStop(m.getString(0));
  1150. intervalId1 = setTimeout(function ():*{
  1151. slotmachine.s2.gotoAndStop(3);
  1152. slotmachine.s2.item.gotoAndStop(m.getString(1));
  1153. var intervalId2:* = setTimeout(function ():*{
  1154. slotmachine.s3.gotoAndStop(3);
  1155. slotmachine.s3.item.gotoAndStop(m.getString(2));
  1156. spinning = false;
  1157. if (((m.getString(0) == m.getString(1)) && (m.getString(0) == m.getString(2))))
  1158. {
  1159. alert(("Congratulations! You won: " + m.getString(0)));
  1160. };
  1161. }, 500);
  1162. }, 500);
  1163. };
  1164. };
  1165. if (m.type == "clear")
  1166. {
  1167. this.chat_w.DisplayTextField.htmlText = "<font color='#FF0000'>>>> Server : Chat Cleared";
  1168. };
  1169. if (m.type == "playyoutube")
  1170. {
  1171. my_loader3 = new Loader();
  1172. my_loader3.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
  1173. my_loader3.contentLoaderInfo.addEventListener(Event.INIT, function (e:Event):void{
  1174. MovieClip(root).Herehere.addChild(my_loader3);
  1175. my_player3 = my_loader3.content;
  1176. my_player3.addEventListener("onReady", function (e:Event):void{
  1177. my_player3.visible = false;
  1178. my_player3.setSize(140, 95);
  1179. my_player3.x = 541.3;
  1180. my_player3.y = 401.85;
  1181. my_player3.cueVideoById(m.getString(0), 0);
  1182. my_player3.playVideo();
  1183. });
  1184. Herehere.play_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1185. my_player3.playVideo();
  1186. });
  1187. Herehere.remove_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1188. MovieClip(root).Herehere.addChild(my_loader3);
  1189. my_player3.stopVideo();
  1190. });
  1191. });
  1192. };
  1193. if (m.type == "stopyoutube")
  1194. {
  1195. this.my_player3.stopVideo();
  1196. };
  1197. if (m.type == "note")
  1198. {
  1199. note = new Note();
  1200. note.x = 118.5;
  1201. note.y = 54.05;
  1202. note.mess.text = m.getString(0);
  1203. addChild(note);
  1204. note.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1205. removeChild(MovieClip(e.target.parent));
  1206. TheConnection.send("Read");
  1207. });
  1208. };
  1209. if (m.type == "dicebought")
  1210. {
  1211. this.alert("item bought");
  1212. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  1213. if (this.diceshop != null)
  1214. {
  1215. this.diceshop.loadblock.visible = false;
  1216. };
  1217. };
  1218. if (m.type == "dshop")
  1219. {
  1220. y = 0;
  1221. u = 0;
  1222. while (u < m.length)
  1223. {
  1224. this.showmc = new ShowMC();
  1225. mes = m.getString(u).split(":");
  1226. this.showmc.nametxt.text = String(mes[0]);
  1227. this.showmc.item.gotoAndStop(mes[0]);
  1228. this.showmc.price_txt.text = String(mes[1]);
  1229. this.showmc.y = y;
  1230. this.diceshop.content.addChild(this.showmc);
  1231. y = (y + (this.showmc.height + 5));
  1232. this._scrollbar = new Scrollbar();
  1233. this._scrollbar.init(this.diceshop.content, this.diceshop.contentMask, this.diceshop.track, this.diceshop.slider);
  1234. this.showmc.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1235. if (dbdice >= int(e.target.parent.price_txt.text))
  1236. {
  1237. diceshop.loadblock.visible = true;
  1238. TheConnection.send("dicebuy", String(e.target.parent.nametxt.text), int(e.target.parent.price_txt.text));
  1239. }
  1240. else
  1241. {
  1242. alert("not enough tokens");
  1243. };
  1244. });
  1245. u++;
  1246. };
  1247. };
  1248. if (m.type == "playmusic")
  1249. {
  1250. this.issPlaying = false;
  1251. this.lastPosition = this.myChannel.position;
  1252. this.myChannel.stop();
  1253. this.mySound = new Sound();
  1254. this.myChannel = new SoundChannel();
  1255. this.mySound.load(new URLRequest(String(m.getString(0))));
  1256. this.myChannel = this.mySound.play();
  1257. };
  1258. if (m.type == "stopmusic")
  1259. {
  1260. if (this.issPlaying == false)
  1261. {
  1262. this.issPlaying = true;
  1263. this.myChannel = this.myMusic.play(this.lastPosition);
  1264. };
  1265. this.sounds = false;
  1266. trace(this.sounds);
  1267. this.mute_btn.gotoAndStop(1);
  1268. this.myChannel.stop();
  1269. };
  1270. if (m.type == "Iadd")
  1271. {
  1272. if (m.getString(0) == ("fb" + this.fbuid))
  1273. {
  1274. mySound79 = new pck();
  1275. trace("Someone added");
  1276. trace(m.getString(1));
  1277. this.canadd = true;
  1278. if (m.getString(1) == "offer1")
  1279. {
  1280. this.MyOffer.hisoffer1.howmany.text = String(m.getInt(2));
  1281. };
  1282. if (m.getString(1) == "offer2")
  1283. {
  1284. this.MyOffer.hisoffer2.howmany.text = String(m.getInt(2));
  1285. };
  1286. if (m.getString(1) == "offer3")
  1287. {
  1288. this.MyOffer.hisoffer3.howmany.text = String(m.getInt(2));
  1289. };
  1290. if (m.getString(1) == "offer4")
  1291. {
  1292. this.MyOffer.hisoffer4.howmany.text = String(m.getInt(2));
  1293. };
  1294. if (m.getString(1) == "offer5")
  1295. {
  1296. this.MyOffer.hisoffer5.howmany.text = String(m.getInt(2));
  1297. };
  1298. if (m.getString(1) == "offer6")
  1299. {
  1300. this.MyOffer.hisoffer6.howmany.text = String(m.getInt(2));
  1301. };
  1302. };
  1303. };
  1304. if (m.type == "added")
  1305. {
  1306. trace("added");
  1307. this.canadd = true;
  1308. if (m.getString(0) == "offer1")
  1309. {
  1310. this.HisOffer.offer1.howmany.text = String(m.getInt(1));
  1311. };
  1312. if (m.getString(0) == "offer2")
  1313. {
  1314. this.HisOffer.offer2.howmany.text = String(m.getInt(1));
  1315. };
  1316. if (m.getString(0) == "offer3")
  1317. {
  1318. this.HisOffer.offer3.howmany.text = String(m.getInt(1));
  1319. };
  1320. if (m.getString(0) == "offer4")
  1321. {
  1322. this.HisOffer.offer4.howmany.text = String(m.getInt(1));
  1323. };
  1324. if (m.getString(0) == "offer5")
  1325. {
  1326. this.HisOffer.offer5.howmany.text = String(m.getInt(1));
  1327. };
  1328. if (m.getString(0) == "offer6")
  1329. {
  1330. this.HisOffer.offer6.howmany.text = String(m.getInt(1));
  1331. };
  1332. };
  1333. if (m.type == "removed")
  1334. {
  1335. trace("removed");
  1336. this.canadd = true;
  1337. if (m.getInt(1) == 0)
  1338. {
  1339. if (m.getString(0) == "offer1")
  1340. {
  1341. this.HisOffer.offer1.howmany.text = "";
  1342. this.HisOffer.offer1.gotoAndStop("none");
  1343. };
  1344. if (m.getString(0) == "offer2")
  1345. {
  1346. this.HisOffer.offer2.howmany.text = "";
  1347. this.HisOffer.offer2.gotoAndStop("none");
  1348. };
  1349. if (m.getString(0) == "offer3")
  1350. {
  1351. this.HisOffer.offer3.howmany.text = "";
  1352. this.HisOffer.offer3.gotoAndStop("none");
  1353. };
  1354. if (m.getString(0) == "offer4")
  1355. {
  1356. this.HisOffer.offer4.howmany.text = "";
  1357. this.HisOffer.offer4.gotoAndStop("none");
  1358. };
  1359. if (m.getString(0) == "offer5")
  1360. {
  1361. this.HisOffer.offer5.howmany.text = "";
  1362. this.HisOffer.offer5.gotoAndStop("none");
  1363. };
  1364. if (m.getString(0) == "offer6")
  1365. {
  1366. this.HisOffer.offer6.howmany.text = "";
  1367. this.HisOffer.offer6.gotoAndStop("none");
  1368. };
  1369. }
  1370. else
  1371. {
  1372. if (m.getString(0) == "offer1")
  1373. {
  1374. this.HisOffer.offer1.howmany.text = String(m.getInt(1));
  1375. };
  1376. if (m.getString(0) == "offer2")
  1377. {
  1378. this.HisOffer.offer2.howmany.text = String(m.getInt(1));
  1379. };
  1380. if (m.getString(0) == "offer3")
  1381. {
  1382. this.HisOffer.offer3.howmany.text = String(m.getInt(1));
  1383. };
  1384. if (m.getString(0) == "offer4")
  1385. {
  1386. this.HisOffer.offer4.howmany.text = String(m.getInt(1));
  1387. };
  1388. if (m.getString(0) == "offer5")
  1389. {
  1390. this.HisOffer.offer5.howmany.text = String(m.getInt(1));
  1391. };
  1392. if (m.getString(0) == "offer6")
  1393. {
  1394. this.HisOffer.offer6.howmany.text = String(m.getInt(1));
  1395. };
  1396. };
  1397. };
  1398. if (m.type == "Iminus")
  1399. {
  1400. if (m.getString(0) == ("fb" + this.fbuid))
  1401. {
  1402. mySound78 = new pck();
  1403. if (m.getInt(2) == 0)
  1404. {
  1405. if (m.getString(1) == "offer1")
  1406. {
  1407. this.MyOffer.hisoffer1.howmany.text = "";
  1408. this.MyOffer.hisoffer1.gotoAndStop("none");
  1409. };
  1410. if (m.getString(1) == "offer2")
  1411. {
  1412. this.MyOffer.hisoffer2.howmany.text = "";
  1413. this.MyOffer.hisoffer2.gotoAndStop("none");
  1414. };
  1415. if (m.getString(1) == "offer3")
  1416. {
  1417. this.MyOffer.hisoffer3.howmany.text = "";
  1418. this.MyOffer.hisoffer3.gotoAndStop("none");
  1419. };
  1420. if (m.getString(1) == "offer4")
  1421. {
  1422. this.MyOffer.hisoffer4.howmany.text = "";
  1423. this.MyOffer.hisoffer4.gotoAndStop("none");
  1424. };
  1425. if (m.getString(1) == "offer5")
  1426. {
  1427. this.MyOffer.hisoffer5.howmany.text = "";
  1428. this.MyOffer.hisoffer5.gotoAndStop("none");
  1429. };
  1430. if (m.getString(1) == "offer6")
  1431. {
  1432. this.MyOffer.hisoffer6.howmany.text = "";
  1433. this.MyOffer.hisoffer6.gotoAndStop("none");
  1434. };
  1435. }
  1436. else
  1437. {
  1438. if (m.getString(1) == "offer1")
  1439. {
  1440. this.MyOffer.hisoffer1.howmany.text = String(m.getInt(2));
  1441. };
  1442. if (m.getString(1) == "offer2")
  1443. {
  1444. this.MyOffer.hisoffer2.howmany.text = String(m.getInt(2));
  1445. };
  1446. if (m.getString(1) == "offer3")
  1447. {
  1448. this.MyOffer.hisoffer3.howmany.text = String(m.getInt(2));
  1449. };
  1450. if (m.getString(1) == "offer4")
  1451. {
  1452. this.MyOffer.hisoffer4.howmany.text = String(m.getInt(2));
  1453. };
  1454. if (m.getString(1) == "offer5")
  1455. {
  1456. this.MyOffer.hisoffer5.howmany.text = String(m.getInt(2));
  1457. };
  1458. if (m.getString(1) == "offer6")
  1459. {
  1460. this.MyOffer.hisoffer6.howmany.text = String(m.getInt(2));
  1461. };
  1462. };
  1463. };
  1464. };
  1465. if (m.type == "gift")
  1466. {
  1467. this.dicetxt.text = m.getInt(0).toString();
  1468. this.coinstxt.text = m.getInt(1).toString();
  1469. this.thegift = new TheGift();
  1470. this.thegift.x = 133.7;
  1471. this.thegift.y = 49.05;
  1472. addChild(this.thegift);
  1473. this.thegift.gift1.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1474. lobbyConnection.send("choose", 1);
  1475. removeChild(thegift);
  1476. });
  1477. this.thegift.gift2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1478. lobbyConnection.send("choose", 2);
  1479. removeChild(thegift);
  1480. });
  1481. this.thegift.gift3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1482. lobbyConnection.send("choose", 3);
  1483. removeChild(thegift);
  1484. });
  1485. };
  1486. if (m.type == "gotCoin")
  1487. {
  1488. this.chat_w.DisplayTextField.htmlText = (this.chat_w.DisplayTextField.htmlText + (((("<font color='#FF0000'>StickSWIM: " + this.fbname) + " got free ") + m.getString(0)) + "coins!\n"));
  1489. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  1490. };
  1491. if (m.type == "gotDice")
  1492. {
  1493. this.chat_w.DisplayTextField.htmlText = (this.chat_w.DisplayTextField.htmlText + (((("<font color='#00FFFF'>StickSWIM: " + this.fbname) + " got free ") + m.getString(0)) + "dice!\n"));
  1494. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  1495. };
  1496. if (m.type == "lotteryAlert")
  1497. {
  1498. if (this.lottery)
  1499. {
  1500. if (m.getString(0) == "success")
  1501. {
  1502. this.lottery.load_mc.visible = false;
  1503. this.alert(m.getString(1));
  1504. }
  1505. else
  1506. {
  1507. this.lottery.load_mc.visible = false;
  1508. this.alert(m.getString(1));
  1509. };
  1510. };
  1511. };
  1512. if (m.type == "lotteryDet")
  1513. {
  1514. if (this.lottery)
  1515. {
  1516. this.lottery.bet_btn.tabEnabled = false;
  1517. this.lottery.load_mc.visible = false;
  1518. this.lottery.coinstxt.restrict = "0-9";
  1519. this.lottery.item1.gotoAndStop(m.getString(1));
  1520. this.lottery.item1.howmany.text = "1";
  1521. this.lottery.item2.howmany.text = "1";
  1522. this.lottery.item3.howmany.text = "1";
  1523. this.lottery.item2.gotoAndStop(m.getString(2));
  1524. this.lottery.item3.gotoAndStop(m.getString(3));
  1525. this.lottery.tbet.text = String(m.getInt(0));
  1526. this.lottery.mostbet.nametxt.text = m.getString(4);
  1527. this.lottery.mostbet.coinstxt.text = String(m.getInt(6));
  1528. this.lottery.timetxt.text = String(m.getInt(7));
  1529. playidi = m.getString(5).split("fb");
  1530. fbpich = (("https://graph.facebook.com/" + String(playidi[1])) + "/picture");
  1531. photoh = new Loader();
  1532. photoh.load(new URLRequest(fbpich));
  1533. this.lottery.mostbet.picwhere.addChild(photoh);
  1534. this.lottery.bet_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1535. if (dbcoins >= int(lottery.coinstxt.text))
  1536. {
  1537. lottery.load_mc.visible = true;
  1538. dbcoins = (dbcoins - int(lottery.coinstxt.text));
  1539. TheConnection.send("bet", int(lottery.coinstxt.text));
  1540. }
  1541. else
  1542. {
  1543. alert("not enought coins");
  1544. };
  1545. });
  1546. };
  1547. };
  1548. if (m.type == "move")
  1549. {
  1550. if (m.getString(2) != this.iam)
  1551. {
  1552. if (m.getString(2) == "player1")
  1553. {
  1554. player1.x = m.getInt(0);
  1555. player1.y = m.getInt(1);
  1556. }
  1557. else
  1558. {
  1559. player2.x = m.getInt(0);
  1560. player2.y = m.getInt(1);
  1561. };
  1562. };
  1563. };
  1564. if (m.type == "MyOpp")
  1565. {
  1566. this.ready.loading.visible = false;
  1567. this.ready.found.visible = true;
  1568. this.ready.found.nametxt.text = String(m.getString(0));
  1569. playidh = this.myopponent.split("fb");
  1570. fbpicz = (("https://graph.facebook.com/" + String(playidh[1])) + "/picture");
  1571. photom = new Loader();
  1572. photom.load(new URLRequest(fbpicz));
  1573. this.ready.found.picwhere.addChild(photom);
  1574. this.multiId = "";
  1575. this.myopponent = "";
  1576. };
  1577. if (m.type == "gameFound")
  1578. {
  1579. trace(m);
  1580. roomid = m.getString(0);
  1581. this.multiId = m.getString(0);
  1582. player1 = m.getString(1);
  1583. player2 = m.getString(2);
  1584. if (player1 != ("fb" + this.fbuid))
  1585. {
  1586. this.TheConnection.send("loadHIM", player1);
  1587. this.myopponent = player1;
  1588. this.iam = "player2";
  1589. trace(("my op: " + player1));
  1590. }
  1591. else
  1592. {
  1593. this.TheConnection.send("loadHIM", player2);
  1594. this.myopponent = player2;
  1595. this.iam = "player1";
  1596. trace(("my op: " + player2));
  1597. };
  1598. };
  1599. if (m.type == "createdgc")
  1600. {
  1601. createdgc = new CreatedGC();
  1602. createdgc.x = 148.5;
  1603. createdgc.y = 156.55;
  1604. addChild(createdgc);
  1605. createdgc.item.gotoAndStop(String(m.getString(0)));
  1606. createdgc.itemtxt.text = String(m.getString(0));
  1607. createdgc.gctxt.text = String(m.getString(1));
  1608. createdgc.copy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1609. ChatTextField.appendText(createdgc.gctxt.text);
  1610. });
  1611. createdgc.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1612. removeChild(e.target.parent);
  1613. });
  1614. };
  1615. if (m.type == "unpacked")
  1616. {
  1617. var callback:Function = function ():*{
  1618. TheConnection.send("loadplayer", fbuid, "newdb");
  1619. eButtons = true;
  1620. removeChild(successunpack);
  1621. };
  1622. this.successunpack = new SuccessUnpack();
  1623. this.successunpack.alpha = 0;
  1624. this.successunpack.x = 158.95;
  1625. this.successunpack.y = 166;
  1626. this.successunpack.width = 332.1;
  1627. this.successunpack.height = 118;
  1628. addChild(this.successunpack);
  1629. this.successunpack.item1.gotoAndStop(String(m.getString(0)));
  1630. this.successunpack.item2.gotoAndStop(String(m.getString(1)));
  1631. this.successunpack.item3.gotoAndStop(String(m.getString(2)));
  1632. this.successunpack.item4.gotoAndStop(String(m.getString(3)));
  1633. this.successunpack.item5.gotoAndStop(String(m.getString(4)));
  1634. this.successunpack.item6.gotoAndStop(String(m.getString(5)));
  1635. mySound = new success_sound();
  1636. mySound.play();
  1637. Tweener.addTween(this.successunpack, {
  1638. "x":158.95,
  1639. "y":166,
  1640. "width":332.1,
  1641. "height":118,
  1642. "time":2,
  1643. "alpha":1,
  1644. "transition":"easeInSine",
  1645. "onComplete":callback
  1646. });
  1647. this.unpacking = false;
  1648. if (this.inventoryopen != null)
  1649. {
  1650. removeChild(this.inventoryopen);
  1651. };
  1652. };
  1653. if (m.type == "gcsuccess")
  1654. {
  1655. if (this.giftcodeopen)
  1656. {
  1657. this.giftcode.item.gotoAndStop(String(m.getString(0)));
  1658. this.giftcode.check_btn.visible = true;
  1659. this.giftcode.loadbar.visible = false;
  1660. this.alert(("Got an item: " + m.getString(0)));
  1661. mySoundk = new success_sound();
  1662. mySoundk.play();
  1663. };
  1664. };
  1665. if (m.type == "gcresponce")
  1666. {
  1667. alreadygot = new AlreadyGot();
  1668. alreadygot.x = 203.55;
  1669. alreadygot.y = 187.55;
  1670. addChild(alreadygot);
  1671. alreadygot.fbname.text = String(m.getString(0));
  1672. alreadygot.item.gotoAndStop(String(m.getString(2)));
  1673. playid = m.getString(1).split("fb");
  1674. fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
  1675. photo = new Loader();
  1676. photo.load(new URLRequest(fbpic));
  1677. alreadygot.picwhere.addChild(photo);
  1678. alreadygot.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1679. removeChild(e.target.parent);
  1680. });
  1681. this.giftcode.check_btn.visible = true;
  1682. this.giftcode.loadbar.visible = false;
  1683. };
  1684. if (m.type == "gcresponce2")
  1685. {
  1686. if (this.giftcodeopen)
  1687. {
  1688. this.giftcode.loadbar.visible = false;
  1689. this.giftcode.check_btn.visible = true;
  1690. this.alert("Invalid Giftcode");
  1691. };
  1692. };
  1693. if (m.type == "playermessage")
  1694. {
  1695. if (m.getString(1) == ("fb" + this.fbuid))
  1696. {
  1697. this.alert(String(m.getString(0)));
  1698. };
  1699. };
  1700. if (m.type == "kick")
  1701. {
  1702. if (m.getString(0) == ("fb" + this.fbuid))
  1703. {
  1704. this.ontrade = false;
  1705. this.lobbyConnection.send("iclose", this.fbuid, this.partnerid);
  1706. this.lobbyConnection.send("byebye", this.partnerid);
  1707. this.letsStart();
  1708. this.eButtons = true;
  1709. this.joining = false;
  1710. this.multiisopen = false;
  1711. this.iwilloffer = false;
  1712. this.imonoffer = false;
  1713. this.lobbyConnection.disconnect();
  1714. this.partnerid = "";
  1715. };
  1716. };
  1717. if (m.type == "buyalert")
  1718. {
  1719. if (m.getString(0) == "success")
  1720. {
  1721. this.alert("Successfully bought");
  1722. if (this.isshopopen)
  1723. {
  1724. this.shopopen.loadblock.visible = false;
  1725. };
  1726. }
  1727. else
  1728. {
  1729. this.alert("Failed to buy");
  1730. if (this.isshopopen)
  1731. {
  1732. this.shopopen.loadblock.visible = false;
  1733. };
  1734. };
  1735. };
  1736. if (m.type == "offerClosed")
  1737. {
  1738. if (((m.getString(0) == ("fb" + this.fbuid)) && (!(this.iwilloffer))))
  1739. {
  1740. this.ontrade = false;
  1741. this.alert("Trader left, ...");
  1742. this.HisOffer.fbname.text = "";
  1743. this.hisOfferRefresh();
  1744. };
  1745. };
  1746. if (m.type == "putCoins")
  1747. {
  1748. if (((m.getString(0) == this.partnerid) && (("fb" + this.fbuid) == m.getString(1))))
  1749. {
  1750. this.MyOffer.coinstxt.text = String(m.getInt(2));
  1751. };
  1752. };
  1753. if (m.type == "putDice")
  1754. {
  1755. if (((m.getString(0) == this.partnerid) && (("fb" + this.fbuid) == m.getString(1))))
  1756. {
  1757. this.MyOffer.dicetxt.text = String(m.getInt(2));
  1758. };
  1759. };
  1760. if (m.type == "theinfo")
  1761. {
  1762. if (((this.infoopen) && (this.clickedid == ("fb" + m.getString(2)))))
  1763. {
  1764. this.myskin.coinstxt.text = String(m.getString(1));
  1765. this.myskin.dicetxt.text = String(m.getString(0));
  1766. this.myskin.thechar.visible = true;
  1767. this.myskin.thechar.stickman.toparea.head.gotoAndStop(String(m.getString(3)));
  1768. this.myskin.thechar.stickman.toparea.hands.gotoAndStop(String(m.getString(6)));
  1769. this.myskin.thechar.stickman.toparea.eyes.gotoAndStop(String(m.getString(4)));
  1770. this.myskin.thechar.stickman.toparea.mouth.gotoAndStop(String(m.getString(5)));
  1771. this.myskin.thechar.stickman.toparea.feet.gotoAndStop(String(m.getString(7)));
  1772. };
  1773. };
  1774. if (m.type == "outBitch")
  1775. {
  1776. if ((((m.getString(0) == ("fb" + this.fbuid)) && (this.partnerid == m.getString(1))) && (this.imonoffer)))
  1777. {
  1778. this.ontrade = false;
  1779. this.alert("You've been rejected^^");
  1780. this.hisOfferRefresh();
  1781. };
  1782. };
  1783. if (m.type == "newplayer")
  1784. {
  1785. this.newps = true;
  1786. gotoAndStop(2);
  1787. this.newp.visible = true;
  1788. this.newp.blue_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1789. changeskin("blue");
  1790. });
  1791. this.newp.yellow_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1792. changeskin("yellow");
  1793. });
  1794. this.newp.green_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1795. changeskin("green");
  1796. });
  1797. this.newp.red_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  1798. changeskin("red");
  1799. });
  1800. };
  1801. if (m.type == "loadingdb")
  1802. {
  1803. this.loadtxt.text = "Loading Database";
  1804. this.loadbar.gotoAndStop(35);
  1805. this.loadbuzz();
  1806. if (((!(this.currDB)) && (!(this.newps))))
  1807. {
  1808. this.currDB = true;
  1809. };
  1810. };
  1811. if (m.type == "block")
  1812. {
  1813. gotoAndStop(2);
  1814. this.alert("Something went wrong, please refresh");
  1815. this.warning.visible = true;
  1816. };
  1817. if (m.type == "menu")
  1818. {
  1819. trace(m);
  1820. this.dbskin = m.getString(0);
  1821. this.dbhead = m.getString(1);
  1822. this.dbeyes = m.getString(2);
  1823. this.dbmouth = m.getString(3);
  1824. this.dbhands = m.getString(4);
  1825. this.dbfoot = m.getString(5);
  1826. this.dbwings = m.getString(18);
  1827. this.dbcharcolor = m.getString(21);
  1828. this.dbcoins = m.getInt(6);
  1829. this.dbdice = m.getInt(7);
  1830. this.dblevel = m.getInt(8);
  1831. this.dbxp = m.getInt(9);
  1832. this.gotmemepack = m.getBoolean(13);
  1833. this.dbdealbg = m.getString(15);
  1834. this.gotdwset = m.getBoolean(16);
  1835. this.gotswagset = m.getBoolean(17);
  1836. this.gotdarkpack = m.getBoolean(19);
  1837. this.gotspeedpack = m.getBoolean(22);
  1838. this.gotdealbgpack = m.getBoolean(23);
  1839. this.gotwlpack = m.getBoolean(24);
  1840. this.gotrainbowpack = m.getBoolean(25);
  1841. this.gotredpack = m.getBoolean(26);
  1842. this.gotnewyearpack = m.getBoolean(27);
  1843. this.gotnovapack = m.getBoolean(28);
  1844. this.gotcrystalpack = m.getBoolean(29);
  1845. this.gotrarepack = m.getBoolean(30);
  1846. this.gotmilionerpack = m.getBoolean(31);
  1847. this.gotnvpack = m.getBoolean(32);
  1848. this.gotcupidpack = m.getBoolean(20);
  1849. this.TheConnection.send("security", this.fbuid);
  1850. this.loadtxt.text = "Loading Player Support";
  1851. this.loadbar.gotoAndStop(50);
  1852. this.loadbuzz();
  1853. };
  1854. if (m.type == "newdb")
  1855. {
  1856. this.dbskin = m.getString(0);
  1857. this.dbhead = m.getString(1);
  1858. this.dbeyes = m.getString(2);
  1859. this.dbmouth = m.getString(3);
  1860. this.dbhands = m.getString(4);
  1861. this.dbfoot = m.getString(5);
  1862. this.dbwings = m.getString(18);
  1863. this.dbcharcolor = m.getString(21);
  1864. this.dbcoins = m.getInt(6);
  1865. this.dbdice = m.getInt(7);
  1866. this.dblevel = m.getInt(8);
  1867. this.dbxp = m.getInt(9);
  1868. this.gotmemepack = m.getBoolean(13);
  1869. this.gotdwset = m.getBoolean(16);
  1870. this.gotswagset = m.getBoolean(17);
  1871. this.gotdarkpack = m.getBoolean(19);
  1872. this.gotspeedpack = m.getBoolean(22);
  1873. this.gotdealbgpack = m.getBoolean(23);
  1874. this.gotwlpack = m.getBoolean(24);
  1875. this.gotrainbowpack = m.getBoolean(25);
  1876. this.gotredpack = m.getBoolean(26);
  1877. this.gotnewyearpack = m.getBoolean(27);
  1878. this.gotnovapack = m.getBoolean(28);
  1879. this.gotcrystalpack = m.getBoolean(29);
  1880. this.gotrarepack = m.getBoolean(30);
  1881. this.gotmilionerpack = m.getBoolean(31);
  1882. this.gotnvpack = m.getBoolean(32);
  1883. this.gotcupidpack = m.getBoolean(20);
  1884. if (this.myskin != null)
  1885. {
  1886. this.mystats.coinstxt.text = String(this.dbcoins);
  1887. this.mystats.dicetxt.text = String(this.dbdice);
  1888. };
  1889. if (currentFrame == 3)
  1890. {
  1891. this.coinstxt.text = String(this.dbcoins);
  1892. this.dicetxt.text = String(this.dbdice);
  1893. };
  1894. };
  1895. if (m.type == "lobbys")
  1896. {
  1897. people = m.getString(0).split(",");
  1898. if (this.multiisopen)
  1899. {
  1900. this.multiopen.a_online.text = String(people[0]);
  1901. this.multiopen.b_online.text = String(people[1]);
  1902. this.multiopen.c_online.text = String(people[2]);
  1903. this.multiopen.d_online.text = String(people[3]);
  1904. this.multiopen.e_online.text = String(people[4]);
  1905. this.multiopen.f_online.text = String(people[5]);
  1906. this.multiopen.aa_online.text = String(people[6]);
  1907. this.multiopen.bb_online.text = String(people[7]);
  1908. this.multiopen.cc_online.text = String(people[8]);
  1909. };
  1910. };
  1911. if (m.type == "refresh")
  1912. {
  1913. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  1914. };
  1915. if (m.type == "gotcashbro")
  1916. {
  1917. this.alert("Enjoy");
  1918. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  1919. };
  1920. if (m.type == "gotcord")
  1921. {
  1922. this.alert("Enjoy");
  1923. this.TheConnection.send("loadplayer", this.fbuid, "newdb");
  1924. };
  1925. if (m.type == "refreshSlots2")
  1926. {
  1927. this.mystats.dicetxt.text = m.getInt(0).toString();
  1928. };
  1929. if (m.type == "refreshSlots")
  1930. {
  1931. this.mystats.coinstxt.text = m.getInt(0).toString();
  1932. };
  1933. if (m.type == "yolo1")
  1934. {
  1935. this.mystats.dicetxt.text = m.getInt(0).toString();
  1936. this.mystats.coinstxt.text = m.getInt(0).toString();
  1937. this.exchanges.coinstxt.text = m.getInt(0).toString();
  1938. this.exchanges.dicetxt.text = m.getInt(0).toString();
  1939. };
  1940. if (m.type == "start")
  1941. {
  1942.  
  1943. if (("fb" + this.fbuid) == m.getString(0))
  1944. {
  1945. this.letsStart();
  1946. this.dbhead = m.getString(1);
  1947. this.dbeyes = m.getString(3);
  1948. this.dbmouth = m.getString(4);
  1949. this.dbhands = m.getString(2);
  1950. this.dbfoot = m.getString(5);
  1951. this.dbwings = m.getString(6);
  1952. this.dbcharcolor = m.getString(7);
  1953. this.issPlaying = false;
  1954. event = event;
  1955. completeHANDLER = function (event:Event):void{
  1956. lastPosition = 0;
  1957. issPlaying = false;
  1958. };
  1959. if (this.issPlaying == false)
  1960. {
  1961. this.issPlaying = true;
  1962. this.myChannel = this.myMusic.play(this.lastPosition);
  1963. };
  1964. this.myChannel.addEventListener(Event.SOUND_COMPLETE, completeHANDLER);
  1965. };
  1966. };
  1967. if (m.type == "time")
  1968. {
  1969. trace(String(m.getString(0)));
  1970. };
  1971. if (m.type == "alert")
  1972. {
  1973. this.alert(String(m.getString(0)));
  1974. };
  1975. if (m.type == "banned")
  1976. {
  1977. this.TheConnection.disconnect();
  1978. gotoAndStop(4);
  1979. this.alert(String(m.getString(0)));
  1980. this.reason.text = m.getString(0);
  1981. };
  1982. if (m.type == "forcereload")
  1983. {
  1984. if (((!(m.getString(0) == ("fb" + this.fbuid))) && (!(("fb" + this.fbuid) == ""))))
  1985. {
  1986. if (ExternalInterface.available)
  1987. {
  1988. result = ExternalInterface.call("reload");
  1989. };
  1990. this.TheConnection.disconnect();
  1991. this.lobbyConnection.disconnect();
  1992. gotoAndStop(5);
  1993. };
  1994. };
  1995. if (m.type == "isBanned")
  1996. {
  1997. if (m.getString(0) == ("fb" + this.fbuid))
  1998. {
  1999. this.TheConnection.disconnect();
  2000. this.lobbyConnection.disconnect();
  2001. gotoAndStop(4);
  2002. trace("faggot");
  2003. };
  2004. };
  2005. if (m.type == "me")
  2006. {
  2007. rex = /[\s\r\n]+/gim;
  2008. det = m.getString(0);
  2009. det = det.replace(rex, "");
  2010. me = det.split(";");
  2011. trace(det);
  2012. };
  2013. if (m.type == "updateOffer")
  2014. {
  2015. trace(m.getString(0));
  2016. this.updateOffer(m.getString(0));
  2017. };
  2018. if (m.type == "otherplayer")
  2019. {
  2020. isitme = m.getString(0);
  2021. whoishe = m.getString(1);
  2022. hisname = m.getString(2);
  2023. rex2 = /[\s\r\n]+/gim;
  2024. det3 = isitme;
  2025. det3 = det3.replace(rex2, "");
  2026. trace("gotIn");
  2027. if ((((!(this.imbusy)) && (this.iwilloffer)) && (det3 == ("fb" + this.fbuid))))
  2028. {
  2029. mySoundo = new trader_found();
  2030. mySoundo.play();
  2031. this.gotInOffer(whoishe, hisname);
  2032. this.partnerid = whoishe;
  2033. this.lobbyConnection.send("onMe", whoishe);
  2034. this.imbusy = true;
  2035. }
  2036. else
  2037. {
  2038. if (this.partnerid != whoishe)
  2039. {
  2040. this.lobbyConnection.send("busydude", m.getString(1));
  2041. };
  2042. };
  2043. };
  2044. if (m.type == "sorry")
  2045. {
  2046. rex5 = /[\s\r\n]+/gim;
  2047. det1 = m.getString(0);
  2048. det2 = m.getString(1);
  2049. det1 = det1.replace(rex5, "");
  2050. det2 = det2.replace(rex5, "");
  2051. if (((det1 == ("fb" + this.fbuid)) && (this.partnerid == det2)))
  2052. {
  2053. this.alert("Someone is already on this offer");
  2054. this.hisOfferRefresh();
  2055. };
  2056. };
  2057. if (m.type == "lookitems")
  2058. {
  2059. if (this.openeditems)
  2060. {
  2061. if (m.getString(0) != "")
  2062. {
  2063. allmyitems = m.getString(0).split(",");
  2064. columnsPerRow = 11;
  2065. i = 0;
  2066. while (i < allmyitems.length)
  2067. {
  2068. trace(allmyitems.length);
  2069. if (allmyitems.length >= 55)
  2070. {
  2071. this.items.track.visible = true;
  2072. this.items.slider.visible = true;
  2073. };
  2074. this.items.loadMC.visible = false;
  2075. itemDetails1 = allmyitems[i];
  2076. itemcase = new ItemCase();
  2077. itemDetails = itemDetails1.split(":");
  2078. this._scrollbar = new Scrollbar();
  2079. this.items.whos.text = (String(this.clickedname) + " Items");
  2080. trace((itemDetails[1] + " Items"));
  2081. this._scrollbar.init(this.items.content, this.items.contentMask, this.items.track, this.items.slider);
  2082. if (((((((((((!(itemDetails[0] == "")) || (!(itemDetails[1] == ""))) || (!(itemDetails[0] == " "))) || (!(itemDetails[1] == " "))) || (!(itemDetails[0] == null))) || (!(itemDetails[1] == null))) || (!(itemDetails[0] == undefined))) || (!(itemDetails[1] == undefined))) || (!(itemDetails1 == ""))) || (!(itemDetails1 == " "))))
  2083. {
  2084. itemcase.scaleX = 0.871248789932236;
  2085. itemcase.scaleY = 0.835073068893528;
  2086. itemcase.x = (((i % columnsPerRow) * (itemcase.width + 2)) + 20);
  2087. itemcase.y = ((Math.floor((i / columnsPerRow)) * (itemcase.height + 1)) + 15);
  2088. itemcase.name = String(itemDetails[0]);
  2089. trace((itemDetails[1] + " Items"));
  2090. if (int(itemDetails[1]) >= 2)
  2091. {
  2092. itemcase.howmany.text = ("" + String(itemDetails[1]));
  2093. };
  2094. itemcase.gotoAndStop(String(itemDetails[0]));
  2095. this.items.content.addChild(itemcase);
  2096. trace(("y:" + itemcase.y));
  2097. itemcase.addEventListener(MouseEvent.ROLL_OVER, function (e:MouseEvent):void{
  2098. var mySound:Sound = new blub2();
  2099. mySound.play();
  2100. Tweener.addTween(MovieClip(e.target), {
  2101. "scaleX":1,
  2102. "scaleY":1,
  2103. "time":0.1,
  2104. "transition":"easeInSine"
  2105. });
  2106. });
  2107. itemcase.addEventListener(MouseEvent.ROLL_OUT, function (e:MouseEvent):void{
  2108. Tweener.addTween(MovieClip(e.target), {
  2109. "scaleX":0.871248789932236,
  2110. "scaleY":0.835073068893528,
  2111. "time":0.3,
  2112. "transition":"easeInSine"
  2113. });
  2114. });
  2115. itemcase.addEventListener(MouseEvent.CLICK, this.ItemClick2);
  2116. };
  2117. i = (i + 1);
  2118. };
  2119. }
  2120. else
  2121. {
  2122. this.items.loadMC.visible = false;
  2123. };
  2124. };
  2125. };
  2126. if (m.type == "allitems")
  2127. {
  2128. if (this.openeditems)
  2129. {
  2130. if (m.getString(0) != "")
  2131. {
  2132. allmyitems1 = m.getString(0).split(",");
  2133. columnsPerRow1 = 10;
  2134. ii = 0;
  2135. while (ii < allmyitems1.length)
  2136. {
  2137. trace(allmyitems1.length);
  2138. if (allmyitems1.length >= 55)
  2139. {
  2140. this.items.track.visible = true;
  2141. this.items.slider.visible = true;
  2142. };
  2143. this.items.loadMC.visible = false;
  2144. itemDetails12 = allmyitems1[ii];
  2145. itemcase2 = new ItemCase();
  2146. itemDetails2 = itemDetails12.split(":");
  2147. this._scrollbar = new Scrollbar();
  2148. this._scrollbar.init(this.items.content, this.items.contentMask, this.items.track, this.items.slider);
  2149. if (((((((((((!(itemDetails2[0] == "")) || (!(itemDetails2[1] == ""))) || (!(itemDetails2[0] == " "))) || (!(itemDetails2[1] == " "))) || (!(itemDetails2[0] == null))) || (!(itemDetails2[1] == null))) || (!(itemDetails2[0] == undefined))) || (!(itemDetails2[1] == undefined))) || (!(itemDetails12 == ""))) || (!(itemDetails12 == " "))))
  2150. {
  2151. itemcase2.scaleX = 0.85;
  2152. itemcase2.scaleY = 0.85;
  2153. itemcase2.x = (((ii % columnsPerRow1) * (itemcase2.width + 5)) + 35);
  2154. itemcase2.y = ((Math.floor((ii / columnsPerRow1)) * (itemcase2.height + 0.5)) + 8);
  2155. itemcase2.name = String(itemDetails2[0]);
  2156. if (int(itemDetails2[1]) >= 2)
  2157. {
  2158. itemcase2.howmany.text = ("" + String(itemDetails2[1]));
  2159. };
  2160. itemcase2.gotoAndStop(String(itemDetails2[0]));
  2161. this.items.content.addChild(itemcase2);
  2162. trace(("y:" + itemcase2.y));
  2163. itemcase2.addEventListener(MouseEvent.ROLL_OVER, function (e:MouseEvent):void{
  2164. var mySound:Sound = new blub2();
  2165. mySound.play();
  2166. Tweener.addTween(MovieClip(e.target), {
  2167. "scaleX":1,
  2168. "scaleY":1,
  2169. "time":0.1,
  2170. "transition":"easeInSine"
  2171. });
  2172. });
  2173. itemcase2.addEventListener(MouseEvent.ROLL_OUT, function (e:MouseEvent):void{
  2174. Tweener.addTween(MovieClip(e.target), {
  2175. "scaleX":0.85,
  2176. "scaleY":0.85,
  2177. "time":0.3,
  2178. "transition":"easeInSine"
  2179. });
  2180. });
  2181. itemcase2.addEventListener(MouseEvent.CLICK, this.ItemClick);
  2182. };
  2183. ii = (ii + 1);
  2184. };
  2185. this.items.normal_btn.addEventListener(MouseEvent.CLICK, function ():*{
  2186. removeChild(items);
  2187. openeditems = false;
  2188. loadinvent("normals");
  2189. });
  2190. this.items.prem_btn.addEventListener(MouseEvent.CLICK, function ():*{
  2191. removeChild(items);
  2192. openeditems = false;
  2193. loadinvent("prems");
  2194. });
  2195. this.items.rare_btn.addEventListener(MouseEvent.CLICK, function ():*{
  2196. removeChild(items);
  2197. openeditems = false;
  2198. loadinvent("rares");
  2199. });
  2200. this.items.ultra_btn.addEventListener(MouseEvent.CLICK, function ():*{
  2201. removeChild(items);
  2202. openeditems = false;
  2203. loadinvent("ultras");
  2204. });
  2205. this.items.special_btn.addEventListener(MouseEvent.CLICK, function ():*{
  2206. removeChild(items);
  2207. openeditems = false;
  2208. loadinvent("specials");
  2209. });
  2210. }
  2211. else
  2212. {
  2213. this.items.loadMC.visible = false;
  2214. };
  2215. };
  2216. };
  2217. }
  2218. public function myOnRelease(event:KeyboardEvent):void{
  2219. switch (event.keyCode)
  2220. {
  2221. case Keyboard.UP:
  2222. this._movingUp = false;
  2223. break;
  2224. case Keyboard.DOWN:
  2225. this._movingDown = false;
  2226. break;
  2227. case Keyboard.LEFT:
  2228. this._movingLeft = false;
  2229. break;
  2230. case Keyboard.RIGHT:
  2231. this._movingRight = false;
  2232. break;
  2233. };
  2234. }
  2235. private function ItemClick2(e:MouseEvent):void{
  2236. var theitem:String = e.currentTarget.name;
  2237. if (this.onadd)
  2238. {
  2239. this.lobbyConnection.send("additem", theitem, this.clickedid);
  2240. this.clickedid = "";
  2241. this.onadd = false;
  2242. this.onsee = false;
  2243. this.openeditems = false;
  2244. removeChild(this.items);
  2245. };
  2246. if (this.ondel)
  2247. {
  2248. this.lobbyConnection.send("delitem", theitem, this.clickedid);
  2249. this.clickedid = "";
  2250. this.ondel = false;
  2251. this.onsee = false;
  2252. this.openeditems = false;
  2253. removeChild(this.items);
  2254. };
  2255. }
  2256. private function ItemClick(e:MouseEvent):void{
  2257. var mySound:Sound;
  2258. var offer1:* = undefined;
  2259. var offer2:* = undefined;
  2260. var offer3:* = undefined;
  2261. var offer4:* = undefined;
  2262. var offer5:* = undefined;
  2263. var offer6:* = undefined;
  2264. var themen:* = undefined;
  2265. var theitem:String = e.currentTarget.name;
  2266. var theitem1:String = e.currentTarget.currentLabel;
  2267. if (theitem == theitem1)
  2268. {
  2269. if (!this.giveoffer)
  2270. {
  2271. mySound = new klicksound111();
  2272. mySound.play();
  2273. };
  2274. if (this.changeSkin)
  2275. {
  2276. this.changeSkin = false;
  2277. if (theitem != null)
  2278. {
  2279. this.changemyskin(theitem);
  2280. };
  2281. if (!this.cancloseinventory)
  2282. {
  2283. removeChild(this.items);
  2284. this.cancloseinventory = true;
  2285. this.openeditems = false;
  2286. this.inventoryopen.blockMC.visible = false;
  2287. };
  2288. }
  2289. else
  2290. {
  2291. if (this.changeeyes)
  2292. {
  2293. this.changeeyes = false;
  2294. if (theitem != null)
  2295. {
  2296. this.changemyeyes(theitem);
  2297. };
  2298. if (!this.cancloseinventory)
  2299. {
  2300. removeChild(this.items);
  2301. this.cancloseinventory = true;
  2302. this.openeditems = false;
  2303. this.inventoryopen.blockMC.visible = false;
  2304. };
  2305. }
  2306. else
  2307. {
  2308. if (this.changehands)
  2309. {
  2310. this.changehands = false;
  2311. if (theitem != null)
  2312. {
  2313. this.changemyhands(theitem);
  2314. };
  2315. if (!this.cancloseinventory)
  2316. {
  2317. removeChild(this.items);
  2318. this.cancloseinventory = true;
  2319. this.openeditems = false;
  2320. this.inventoryopen.blockMC.visible = false;
  2321. };
  2322. }
  2323. else
  2324. {
  2325. if (this.changemouth)
  2326. {
  2327. this.changemouth = false;
  2328. if (theitem != null)
  2329. {
  2330. this.changemymouth(theitem);
  2331. };
  2332. if (!this.cancloseinventory)
  2333. {
  2334. removeChild(this.items);
  2335. this.cancloseinventory = true;
  2336. this.openeditems = false;
  2337. this.inventoryopen.blockMC.visible = false;
  2338. };
  2339. }
  2340. else
  2341. {
  2342. if (this.changedealbg)
  2343. {
  2344. this.changedealbg = false;
  2345. if (theitem != null)
  2346. {
  2347. this.changemydealbg(theitem);
  2348. };
  2349. if (!this.cancloseinventory)
  2350. {
  2351. removeChild(this.items);
  2352. this.cancloseinventory = true;
  2353. this.openeditems = false;
  2354. this.inventoryopen.blockMC.visible = false;
  2355. };
  2356. }
  2357. else
  2358. {
  2359. if (this.changehead)
  2360. {
  2361. this.changehead = false;
  2362. if (theitem != null)
  2363. {
  2364. this.changemyhead(theitem);
  2365. };
  2366. if (!this.cancloseinventory)
  2367. {
  2368. removeChild(this.items);
  2369. this.cancloseinventory = true;
  2370. this.openeditems = false;
  2371. this.inventoryopen.blockMC.visible = false;
  2372. };
  2373. }
  2374. else
  2375. {
  2376. if (this.changefoot)
  2377. {
  2378. this.changefoot = false;
  2379. if (theitem != null)
  2380. {
  2381. this.changemyfoot(theitem);
  2382. };
  2383. if (!this.cancloseinventory)
  2384. {
  2385. removeChild(this.items);
  2386. this.cancloseinventory = true;
  2387. this.openeditems = false;
  2388. this.inventoryopen.blockMC.visible = false;
  2389. };
  2390. }
  2391. else
  2392. {
  2393. if (this.changewings)
  2394. {
  2395. this.changewings = false;
  2396. if (theitem != null)
  2397. {
  2398. this.changemywings(theitem);
  2399. };
  2400. if (!this.cancloseinventory)
  2401. {
  2402. removeChild(this.items);
  2403. this.cancloseinventory = true;
  2404. this.openeditems = false;
  2405. this.inventoryopen.blockMC.visible = false;
  2406. };
  2407. }
  2408. else
  2409. {
  2410. if (this.changecharcolor)
  2411. {
  2412. this.changecharcolor = false;
  2413. if (theitem != null)
  2414. {
  2415. this.changemycharcolor(theitem);
  2416. };
  2417. if (!this.cancloseinventory)
  2418. {
  2419. removeChild(this.items);
  2420. this.cancloseinventory = true;
  2421. this.openeditems = false;
  2422. this.inventoryopen.blockMC.visible = false;
  2423. };
  2424. }
  2425. else
  2426. {
  2427. if (this.giveoffer)
  2428. {
  2429. if (((((!(this.whichslot == "")) && (this.imonoffer)) && (!(theitem == null))) && (!(this.partnerid == ""))))
  2430. {
  2431. offer1 = String(this.HisOffer.offer1.currentLabel);
  2432. offer2 = String(this.HisOffer.offer2.currentLabel);
  2433. offer3 = String(this.HisOffer.offer3.currentLabel);
  2434. offer4 = String(this.HisOffer.offer4.currentLabel);
  2435. offer5 = String(this.HisOffer.offer5.currentLabel);
  2436. offer6 = String(this.HisOffer.offer6.currentLabel);
  2437. themen = String(this.HisOffer.hisoffer.currentLabel);
  2438. if ((((((((!(offer1 == theitem)) && (!(offer2 == theitem))) && (!(offer3 == theitem))) && (!(offer4 == theitem))) && (!(offer5 == theitem))) && (!(offer6 == theitem))) && (!(themen == theitem))))
  2439. {
  2440. if (this.whichslot == "offer1")
  2441. {
  2442. this.HisOffer.offer1.gotoAndStop(String(theitem));
  2443. this.HisOffer.offer1.howmany.text = "";
  2444. };
  2445. if (this.whichslot == "offer2")
  2446. {
  2447. this.HisOffer.offer2.gotoAndStop(String(theitem));
  2448. this.HisOffer.offer2.howmany.text = "";
  2449. };
  2450. if (this.whichslot == "offer3")
  2451. {
  2452. this.HisOffer.offer3.gotoAndStop(String(theitem));
  2453. this.HisOffer.offer3.howmany.text = "";
  2454. };
  2455. if (this.whichslot == "offer4")
  2456. {
  2457. this.HisOffer.offer4.gotoAndStop(String(theitem));
  2458. this.HisOffer.offer4.howmany.text = "";
  2459. };
  2460. if (this.whichslot == "offer5")
  2461. {
  2462. this.HisOffer.offer5.gotoAndStop(String(theitem));
  2463. this.HisOffer.offer5.howmany.text = "";
  2464. };
  2465. if (this.whichslot == "offer6")
  2466. {
  2467. this.HisOffer.offer6.gotoAndStop(String(theitem));
  2468. this.HisOffer.offer6.howmany.text = "";
  2469. };
  2470. this.lobbyConnection.send("IwillGive", this.partnerid, this.whichslot, theitem);
  2471. this.giveoffer = false;
  2472. this.whichslot = "";
  2473. this.openeditems = false;
  2474. removeChild(this.items);
  2475. this.canadd = true;
  2476. this.addminus();
  2477. }
  2478. else
  2479. {
  2480. this.alert("You can't offer the same item at once");
  2481. this.giveoffer = false;
  2482. this.whichslot = "";
  2483. this.openeditems = false;
  2484. removeChild(this.items);
  2485. this.addminus();
  2486. };
  2487. };
  2488. }
  2489. else
  2490. {
  2491. if (this.iwilloffer)
  2492. {
  2493. if (theitem == null)
  2494. {
  2495. trace(theitem);
  2496. }
  2497. else
  2498. {
  2499. if (this.MyOffer.offer != null)
  2500. {
  2501. this.MyOffer.offer.gotoAndStop(String(theitem));
  2502. this.lobbyConnection.send("ioffer", this.fbuid, theitem);
  2503. this.MyOffer.x = 31.4;
  2504. this.MyOffer.y = -263.25;
  2505. this.MyOffer.fbname.text = "";
  2506. this.MyOffer.coinstxt.text = "0";
  2507. this.MyOffer.dicetxt.text = "0";
  2508. this.closeoffer.visible = true;
  2509. this.MyOffer.deal_btn.visible = false;
  2510. this.MyOffer.unlock_btn.visible = false;
  2511. this.MyOffer.lockedmcc.visible = false;
  2512. this.MyOffer.deal_btn.tabEnabled = false;
  2513. this.MyOffer.unlock_btn.tabEnabled = false;
  2514. this.closeoffer.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2515. if (iwilloffer)
  2516. {
  2517. lobbyConnection.send("iclose", fbuid, partnerid);
  2518. myOfferRefresh();
  2519. offered.removeChildren();
  2520. };
  2521. });
  2522. this.openeditems = false;
  2523. removeChild(this.items);
  2524. };
  2525. };
  2526. };
  2527. };
  2528. };
  2529. };
  2530. };
  2531. };
  2532. };
  2533. };
  2534. };
  2535. };
  2536. };
  2537. };
  2538. }
  2539. private function changemyhead(thehead:String):void{
  2540. this.dbhead = thehead;
  2541. this.TheConnection.send("changesuit", thehead, "head");
  2542. if (!this.cancloseinventory)
  2543. {
  2544. this.inventoryopen.headitem.gotoAndStop(thehead);
  2545. this.inventoryopen.stickman.toparea.head.gotoAndStop(thehead);
  2546. };
  2547. }
  2548. private function changemymouth(themouth:String):void{
  2549. this.dbmouth = themouth;
  2550. this.TheConnection.send("changesuit", themouth, "mouth");
  2551. if (!this.cancloseinventory)
  2552. {
  2553. this.inventoryopen.mouthitem.gotoAndStop(themouth);
  2554. this.inventoryopen.stickman.toparea.mouth.gotoAndStop(themouth);
  2555. };
  2556. }
  2557. private function changemyhands(thehands:String):void{
  2558. this.dbhands = thehands;
  2559. trace(thehands);
  2560. this.TheConnection.send("changesuit", thehands, "hands");
  2561. if (!this.cancloseinventory)
  2562. {
  2563. this.inventoryopen.handitem.gotoAndStop(thehands);
  2564. this.inventoryopen.stickman.toparea.hands.gotoAndStop(thehands);
  2565. };
  2566. }
  2567. private function changemyeyes(theeyes:String):void{
  2568. this.dbeyes = theeyes;
  2569. trace(theeyes);
  2570. this.TheConnection.send("changesuit", theeyes, "eyes");
  2571. if (!this.cancloseinventory)
  2572. {
  2573. this.inventoryopen.eyesitem.gotoAndStop(theeyes);
  2574. this.inventoryopen.stickman.toparea.eyes.gotoAndStop(theeyes);
  2575. };
  2576. }
  2577. private function changemyfoot(thefoot:String):void{
  2578. this.dbfoot = thefoot;
  2579. trace(thefoot);
  2580. this.TheConnection.send("changesuit", thefoot, "foot");
  2581. if (!this.cancloseinventory)
  2582. {
  2583. this.inventoryopen.footitem.gotoAndStop(thefoot);
  2584. this.inventoryopen.stickman.toparea.feet.gotoAndStop(thefoot);
  2585. };
  2586. }
  2587. private function changemywings(thewings:String):void{
  2588. this.dbwings = thewings;
  2589. trace(thewings);
  2590. this.TheConnection.send("changesuit", thewings, "wings");
  2591. if (!this.cancloseinventory)
  2592. {
  2593. this.inventoryopen.wingsitem.gotoAndStop(thewings);
  2594. this.inventoryopen.stickman.toparea.wings.gotoAndStop(thewings);
  2595. };
  2596. }
  2597. private function changemycharcolor(thecharcolor:String):void{
  2598. this.dbcharcolor = thecharcolor;
  2599. trace(thecharcolor);
  2600. this.TheConnection.send("changesuit", thecharcolor, "charcolor");
  2601. if (!this.cancloseinventory)
  2602. {
  2603. this.inventoryopen.charcoloritem.gotoAndStop(thecharcolor);
  2604. this.inventoryopen.stickman.toparea.charcolor.gotoAndStop(thecharcolor);
  2605. this.inventoryopen.stickman.middle.charcolor.gotoAndStop(thecharcolor);
  2606. this.inventoryopen.stickman.bottomarea.charcolor.gotoAndStop(thecharcolor);
  2607. };
  2608. }
  2609. private function changemyskin(theskin:String):void{
  2610. this.dbskin = theskin;
  2611. this.TheConnection.send("changeskin", theskin);
  2612. if (!this.cancloseinventory)
  2613. {
  2614. this.inventoryopen.skinitem.gotoAndStop(theskin);
  2615. this.mystats.gotoAndStop(theskin);
  2616. };
  2617. }
  2618. private function changemydealbg(thedealbg:String):void{
  2619. this.dbdealbg = thedealbg;
  2620. this.TheConnection.send("changedealbg", thedealbg);
  2621. if (!this.cancloseinventory)
  2622. {
  2623. this.inventoryopen.dealitem.gotoAndStop(thedealbg);
  2624. };
  2625. }
  2626. private function addskin():void{
  2627. this.mystats.nametxt.text = this.fbname;
  2628. this.mystats.coinstxt.text = String(this.dbcoins);
  2629. this.mystats.dicetxt.text = String(this.dbdice);
  2630. this.mystats.gotoAndStop(String(this.dbskin));
  2631. this.mystats.badge.gotoAndStop(int(this.dblevel));
  2632. var fbpic:* = (("https://graph.facebook.com/" + String(this.fbuid)) + "/picture");
  2633. var photo:* = new Loader();
  2634. photo.load(new URLRequest(fbpic));
  2635. this.mystats.pic_mcc.picwhere.addChild(photo);
  2636. if (currentFrame == 2)
  2637. {
  2638. this.mystats.thechar.visible = true;
  2639. this.mystats.thechar.stickman.toparea.head.gotoAndStop(this.dbhead);
  2640. this.mystats.thechar.stickman.toparea.mouth.gotoAndStop(this.dbmouth);
  2641. this.mystats.thechar.stickman.toparea.eyes.gotoAndStop(this.dbeyes);
  2642. this.mystats.thechar.stickman.toparea.hands.gotoAndStop(this.dbhands);
  2643. this.mystats.thechar.stickman.toparea.feet.gotoAndStop(this.dbfoot);
  2644. this.mystats.thechar.stickman.toparea.wings.gotoAndStop(this.dbwings);
  2645. this.mystats.thechar.stickman.toparea.charcolor.gotoAndStop(this.dbcharcolor);
  2646. this.mystats.thechar.stickman.middle.charcolor.gotoAndStop(this.dbcharcolor);
  2647. this.mystats.thechar.stickman.bottomarea.charcolor.gotoAndStop(this.dbcharcolor);
  2648. }
  2649. else
  2650. {
  2651. this.mystats.thechar.visible = false;
  2652. };
  2653. }
  2654. private function myOfferRefresh():void{
  2655. this.MyOffer.fbname.text = "";
  2656. this.MyOffer.picwhere.alpha = 0;
  2657. this.MyOffer.kick_btn.visible = false;
  2658. this.MyOffer.deal_btn.visible = false;
  2659. this.MyOffer.unlock_btn.visible = false;
  2660. this.MyOffer.lockedmcc.visible = false;
  2661. this.MyOffer.hisoffer1.gotoAndStop("none");
  2662. this.MyOffer.hisoffer2.gotoAndStop("none");
  2663. this.MyOffer.hisoffer3.gotoAndStop("none");
  2664. this.MyOffer.hisoffer4.gotoAndStop("none");
  2665. this.MyOffer.hisoffer5.gotoAndStop("none");
  2666. this.MyOffer.hisoffer6.gotoAndStop("none");
  2667. this.MyOffer.hisoffer1.howmany.text = "";
  2668. this.MyOffer.hisoffer2.howmany.text = "";
  2669. this.MyOffer.hisoffer3.howmany.text = "";
  2670. this.MyOffer.hisoffer4.howmany.text = "";
  2671. this.MyOffer.hisoffer5.howmany.text = "";
  2672. this.MyOffer.hisoffer6.howmany.text = "";
  2673. this.MyOffer.unlock_btn.visible = false;
  2674. this.MyOffer.deal_btn.visible = false;
  2675. this.MyOffer.lockedmcc.visible = false;
  2676. this.MyOffer.x = -500;
  2677. this.MyOffer.y = -500;
  2678. this.MyOffer.coinstxt.text = "0";
  2679. this.MyOffer.dicetxt.text = "0";
  2680. this.closeoffer.visible = false;
  2681. this.makeoffer.visible = true;
  2682. this.iwilloffer = false;
  2683. this.imbusy = false;
  2684. }
  2685. private function allRefresh(m:Message):void{
  2686. this.mystats.dicetxt.text = m.getInt(0).toString();
  2687. this.mystats.coinstxt.text = m.getInt(0).toString();
  2688. }
  2689. private function hisOfferRefresh():void{
  2690. this.HisOffer.x = -500;
  2691. this.HisOffer.y = -500;
  2692. this.HisOffer.fbname.text = "";
  2693. this.HisOffer.hisoffer.gotoAndStop("none");
  2694. this.HisOffer.offer1.gotoAndStop("none");
  2695. this.HisOffer.offer2.gotoAndStop("none");
  2696. this.HisOffer.offer3.gotoAndStop("none");
  2697. this.HisOffer.offer4.gotoAndStop("none");
  2698. this.HisOffer.offer5.gotoAndStop("none");
  2699. this.HisOffer.offer6.gotoAndStop("none");
  2700. this.HisOffer.lock_btn.visible = true;
  2701. this.HisOffer.lockedmcc.visible = false;
  2702. this.HisOffer.putcoins.visible = false;
  2703. this.HisOffer.putdice.visible = false;
  2704. this.HisOffer.coinstxt.text = "0";
  2705. this.HisOffer.dicetxt.text = "0";
  2706. this.HisOffer.putcoins.coinstxt.text = "0";
  2707. this.HisOffer.putdice.dicetxt.text = "0";
  2708. this.imbusy = false;
  2709. this.partnerid = "";
  2710. this.imonoffer = false;
  2711. }
  2712. private function gag():void{
  2713. if (String(root.loaderInfo.parameters.fb_app_root) != "https://apps.facebook.com/dice_rules/")
  2714. {
  2715. this.TheConnection.disconnect();
  2716. };
  2717. }
  2718. public function getName(event:Event):void{
  2719. var you:* = URLLoader(event.target);
  2720. var you2:* = you.data.split("name").join("Name");
  2721. var you3:* = you2.split(":");
  2722. var you4:* = you3[1].split(",");
  2723. var realname:* = you4[0].split('"');
  2724. this.fbname = realname[1];
  2725. }
  2726. private function letsStart():void{
  2727. var idkwhatsthat:Boolean;
  2728. gotoAndStop(2);
  2729. this.addskin();
  2730. this.mute_btn.addEventListener(MouseEvent.CLICK, function ():*{
  2731. if (sounds == false)
  2732. {
  2733. sounds = true;
  2734. trace(sounds);
  2735. mute_btn.gotoAndStop(2);
  2736. issPlaying = false;
  2737. lastPosition = myChannel.position;
  2738. myChannel.stop();
  2739. }
  2740. else
  2741. {
  2742. if (issPlaying == false)
  2743. {
  2744. issPlaying = true;
  2745. myChannel = myMusic.play(lastPosition);
  2746. };
  2747. sounds = false;
  2748. trace(sounds);
  2749. mute_btn.gotoAndStop(1);
  2750. };
  2751. });
  2752. this.fullscreen_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2753. if (fullscreen == false)
  2754. {
  2755. stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
  2756. fullscreen = true;
  2757. trace("fullscreen");
  2758. }
  2759. else
  2760. {
  2761. if (fullscreen == true)
  2762. {
  2763. stage.displayState = StageDisplayState.NORMAL;
  2764. fullscreen = false;
  2765. trace("not fullscreen");
  2766. };
  2767. };
  2768. });
  2769. this.quality_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2770. if (myquality == "high")
  2771. {
  2772. stage.quality = StageQuality.LOW;
  2773. myquality = "low";
  2774. trace("low quality");
  2775. }
  2776. else
  2777. {
  2778. if (myquality == "low")
  2779. {
  2780. stage.quality = StageQuality.BEST;
  2781. myquality = "high";
  2782. trace("high quality");
  2783. };
  2784. };
  2785. });
  2786. this.lottery_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2787. if (eButtons)
  2788. {
  2789. eButtons = false;
  2790. lottery = new Lottery();
  2791. lottery.alpha = 0;
  2792. lottery.width = 650;
  2793. lottery.height = 450;
  2794. lottery.x = 325.2;
  2795. lottery.y = 193.55;
  2796. addChild(lottery);
  2797. Tweener.addTween(lottery, {
  2798. "x":325.2,
  2799. "y":193.55,
  2800. "width":650,
  2801. "height":450,
  2802. "alpha":1,
  2803. "time":0.3,
  2804. "transition":"easeOutSine"
  2805. });
  2806. lottery.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2807. TheConnection.send("loadplayer", fbuid, "newdb");
  2808. removeChild(e.target.parent);
  2809. eButtons = true;
  2810. });
  2811. TheConnection.send("getLottery");
  2812. };
  2813. });
  2814. this.slot_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2815. if (!machine)
  2816. {
  2817. machine = true;
  2818. slotmachine = new SlotMachine();
  2819. slotmachine.alpha = 0;
  2820. slotmachine.width = 700;
  2821. slotmachine.height = 500;
  2822. slotmachine.x = 52.8;
  2823. slotmachine.y = 96.15;
  2824. addChild(slotmachine);
  2825. Tweener.addTween(slotmachine, {
  2826. "x":52.8,
  2827. "y":96.15,
  2828. "width":700,
  2829. "height":500,
  2830. "alpha":1,
  2831. "time":0.3,
  2832. "transition":"easeOutSine"
  2833. });
  2834. slotmachine.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2835. removeChild(e.target.parent);
  2836. machine = false;
  2837. spinning = false;
  2838. });
  2839. slotmachine.spin_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2840. if (((dbcoins >= 10) && (!(spinning))))
  2841. {
  2842. slotmachine.s1.gotoAndStop(2);
  2843. slotmachine.s2.gotoAndStop(2);
  2844. slotmachine.s3.gotoAndStop(2);
  2845. TheConnection.send("roll");
  2846. spinning = true;
  2847. };
  2848. });
  2849. slotmachine.spin_btn2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2850. if (((dbdice >= 10) && (!(spinning))))
  2851. {
  2852. slotmachine.s1.gotoAndStop(2);
  2853. slotmachine.s2.gotoAndStop(2);
  2854. slotmachine.s3.gotoAndStop(2);
  2855. TheConnection.send("roll2");
  2856. spinning = true;
  2857. };
  2858. });
  2859. };
  2860. });
  2861. idkwhatsthat = true;
  2862. idkwhatsthat = idkwhatsthat;
  2863. this.Inventory_btn.buttonMode = idkwhatsthat;
  2864. this.single_btn.addEventListener(MouseEvent.CLICK, this.startGame);
  2865. this.Inventory_btn.addEventListener(MouseEvent.ROLL_OVER, this.items_btn_over);
  2866. this.Inventory_btn.addEventListener(MouseEvent.ROLL_OUT, this.items_btn_out);
  2867. this.Inventory_btn.addEventListener(MouseEvent.MOUSE_DOWN, this.items_btn_start);
  2868. this.clan_btn.addEventListener(MouseEvent.CLICK, this.openClan);
  2869. this.minigames_btn.addEventListener(MouseEvent.CLICK, this.minigames);
  2870. this.alltop10_btn.addEventListener(MouseEvent.CLICK, this.alltop10);
  2871. this.exchange_btn.addEventListener(MouseEvent.CLICK, this.exchange);
  2872. this.allshop_btn.addEventListener(MouseEvent.CLICK, this.allshop_mc);
  2873. this.multiplayer_btn.addEventListener(MouseEvent.CLICK, this.multiplayer_go);
  2874. }
  2875. public function multiplayer_go(ev:MouseEvent):void{
  2876. this.TheConnection.send("checkforpass", this.fbuid);
  2877. if (((this.eButtons) && (!(this.multiisopen))))
  2878. {
  2879. if (this.pass == "")
  2880. {
  2881. this.pass = this.psw.text;
  2882. };
  2883. this.eButtons = false;
  2884. this.multiisopen = true;
  2885. this.multiopen = new MultiOpen();
  2886. this.multiopen.alpha = 0;
  2887. this.multiopen.width = 700;
  2888. this.multiopen.height = 500;
  2889. this.multiopen.x = 43.55;
  2890. this.multiopen.y = 123.15;
  2891. addChild(this.multiopen);
  2892. Tweener.addTween(this.multiopen, {
  2893. "x":43.55,
  2894. "y":123.15,
  2895. "width":700,
  2896. "height":500,
  2897. "alpha":1,
  2898. "time":0.3,
  2899. "transition":"easeOutSine"
  2900. });
  2901. this.multiopen.a_btn.tabEnabled = false;
  2902. this.multiopen.b_btn.tabEnabled = false;
  2903. this.multiopen.c_btn.tabEnabled = false;
  2904. this.multiopen.d_btn.tabEnabled = false;
  2905. this.multiopen.e_btn.tabEnabled = false;
  2906. this.multiopen.f_btn.tabEnabled = false;
  2907. this.multiopen.aa_btn.tabEnabled = false;
  2908. this.multiopen.bb_btn.tabEnabled = false;
  2909. this.multiopen.cc_btn.tabEnabled = false;
  2910. this.TheConnection.send("countOnline", this.fbuid);
  2911. this.multiopen.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2912. TheConnection.send("loadplayer", fbuid, "newdb");
  2913. if (!joining)
  2914. {
  2915. removeChild(MovieClip(e.target.parent));
  2916. eButtons = true;
  2917. multiisopen = false;
  2918. };
  2919. });
  2920. this.multiopen.a_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2921. if (!joining)
  2922. {
  2923. golobby("normal_a");
  2924. };
  2925. });
  2926. this.multiopen.b_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2927. if (!joining)
  2928. {
  2929. golobby("normal_b");
  2930. };
  2931. });
  2932. this.multiopen.c_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2933. if (!joining)
  2934. {
  2935. golobby("normal_c");
  2936. };
  2937. });
  2938. this.multiopen.d_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2939. if (!joining)
  2940. {
  2941. golobby("normal_d");
  2942. };
  2943. });
  2944. this.multiopen.e_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2945. if (!joining)
  2946. {
  2947. golobby("normal_e");
  2948. };
  2949. });
  2950. this.multiopen.f_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2951. if (!joining)
  2952. {
  2953. golobby("normal_f");
  2954. };
  2955. });
  2956. this.multiopen.aa_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2957. if (!joining)
  2958. {
  2959. golobby("a_plus");
  2960. };
  2961. });
  2962. this.multiopen.bb_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2963. if (!joining)
  2964. {
  2965. golobby("b_plus");
  2966. };
  2967. });
  2968. this.multiopen.cc_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  2969. if (!joining)
  2970. {
  2971. golobby("c_plus");
  2972. };
  2973. });
  2974. };
  2975. }
  2976. public function items_btn_over(event:MouseEvent):*{
  2977. this.Inventory_btn.gotoAndStop(2);
  2978. }
  2979. public function items_btn_out(event:MouseEvent):*{
  2980. this.Inventory_btn.gotoAndPlay(3);
  2981. }
  2982. public function items_btn_start(event:MouseEvent):*{
  2983. this.showInventory();
  2984. }
  2985. public function startGame(ev:MouseEvent):void{
  2986. gotoAndStop(6);
  2987. this.player.inner1.head.gotoAndStop(this.dbhead);
  2988. this.player.inner1.eyes.gotoAndStop(this.dbeyes);
  2989. this.player.inner1.wings.gotoAndStop(this.dbwings);
  2990. this.player.inner1.face1.gotoAndStop(this.dbmouth);
  2991. this.player.inner1.hand2.gotoAndStop(this.dbhands);
  2992. this.player.inner1.shoe1.gotoAndStop(this.dbfoot);
  2993. this.player.inner1.shoe2.gotoAndStop(this.dbfoot);
  2994. this.player.x = 124.15;
  2995. this.player.y = 183;
  2996. this.player.visible = true;
  2997. this.GameOver.gotoAndStop(1);
  2998. this.CountFinish = 0;
  2999. this.dead = false;
  3000. this.enemyArr = [];
  3001. this.intervalIntervalForAdding = 50;
  3002. this.enemySpeed = 6;
  3003. this.enBallInterval = 0;
  3004. this.enBallIntervalForAdding = 100;
  3005. this.score = 0;
  3006. this.score_txt.text = ("Score: " + String(this.score));
  3007. this.countUP.visible = true;
  3008. this.countUP.gotoAndPlay(0);
  3009. setTimeout(this.countFinish, 3000);
  3010. }
  3011. public function countFinish():*{
  3012. this.CountFinish = 1;
  3013. if (((currentFrame == 6) && (this.CountFinish == 1)))
  3014. {
  3015. this.solid1.gotoAndPlay(2);
  3016. addEventListener(Event.ENTER_FRAME, this.update);
  3017. stage.addEventListener(KeyboardEvent.KEY_DOWN, this.keyDown);
  3018. stage.addEventListener(KeyboardEvent.KEY_UP, this.keyUp);
  3019. stage.addEventListener(Event.ENTER_FRAME, this.loop);
  3020. };
  3021. }
  3022. internal function update(e:Event):void{
  3023. if (((this.keys[Keyboard.RIGHT]) || (this.keys[Keyboard.D])))
  3024. {
  3025. this.player.x = (this.player.x + 8);
  3026. };
  3027. if (((this.keys[Keyboard.LEFT]) || (this.keys[Keyboard.A])))
  3028. {
  3029. this.player.x = (this.player.x - 8);
  3030. };
  3031. if (((this.keys[Keyboard.UP]) || (this.keys[Keyboard.W])))
  3032. {
  3033. this.player.y = (this.player.y - 9);
  3034. };
  3035. if (((this.keys[Keyboard.DOWN]) || (this.keys[Keyboard.S])))
  3036. {
  3037. this.player.y = (this.player.y + 9);
  3038. };
  3039. }
  3040. internal function keyDown(e:KeyboardEvent):void{
  3041. this.keys[e.keyCode] = true;
  3042. }
  3043. internal function keyUp(e:KeyboardEvent):void{
  3044. this.keys[e.keyCode] = false;
  3045. }
  3046. internal function loop(e:Event):*{
  3047. var en:* = undefined;
  3048. var nen:* = undefined;
  3049. if (((!(this.dead)) && (this.CountFinish == 1)))
  3050. {
  3051. this.score = (this.score + 1);
  3052. this.score_txt.text = ("Score: " + String(this.score));
  3053. this.enemySpeed = (6 + ((this.score / 200) * 3));
  3054. this.enBallInterval = (this.enBallInterval + 1);
  3055. if (this.enBallInterval > this.enBallIntervalForAdding)
  3056. {
  3057. this.enBallInterval = 0;
  3058. this.enBall = new jellyFishs();
  3059. this.enBall.x = 1000;
  3060. this.enBall.y = this.e1RandomY();
  3061. this.enemyArr.push(this.enBall);
  3062. addChild(this.enBall);
  3063. };
  3064. this.intervalForAdding = (this.intervalForAdding + 1);
  3065. if (this.intervalForAdding == this.intervalIntervalForAdding)
  3066. {
  3067. this.intervalForAdding = 0;
  3068. if (this.intervalIntervalForAdding > 0)
  3069. {
  3070. (this.intervalIntervalForAdding - 1);
  3071. };
  3072. this.enWall = new Aligator();
  3073. this.enWall.x = 1000;
  3074. this.enWall.y = this.e1RandomY();
  3075. this.enemyArr.push(this.enWall);
  3076. addChild(this.enWall);
  3077. if (this.score >= 500)
  3078. {
  3079. this.enemySpeed = 10;
  3080. this.intervalIntervalForAdding = 100;
  3081. };
  3082. if (this.score >= 1000)
  3083. {
  3084. this.enemySpeed = 15;
  3085. this.intervalIntervalForAdding = 150;
  3086. };
  3087. if (this.score >= 1500)
  3088. {
  3089. this.enemySpeed = 17;
  3090. this.intervalIntervalForAdding = 160;
  3091. };
  3092. if (this.score >= 2000)
  3093. {
  3094. this.enemySpeed = 18;
  3095. this.intervalIntervalForAdding = 175;
  3096. };
  3097. if (this.score >= 3000)
  3098. {
  3099. this.enemySpeed = 20;
  3100. this.intervalIntervalForAdding = 190;
  3101. };
  3102. if (this.score >= 4000)
  3103. {
  3104. this.enemySpeed = 24;
  3105. this.intervalIntervalForAdding = 200;
  3106. };
  3107. if (this.score >= 5000)
  3108. {
  3109. this.enemySpeed = 28;
  3110. this.intervalIntervalForAdding = 210;
  3111. };
  3112. if (this.score >= 6000)
  3113. {
  3114. this.enemySpeed = 30;
  3115. this.enBall.y = this.player.y;
  3116. this.enWall.y = this.player.y;
  3117. this.intervalIntervalForAdding = 210;
  3118. };
  3119. };
  3120. en = 0;
  3121. while (en < this.enemyArr.length)
  3122. {
  3123. this.enemyArr[en].x = (this.enemyArr[en].x - this.enemySpeed);
  3124. if (this.enemyArr[en].hitTestObject(this.player))
  3125. {
  3126. this.dead = true;
  3127. this.CountFinish = 0;
  3128. this.GameOver.gotoAndStop(2);
  3129. this.GameOver.scoretxt.text = ("Score: " + String(this.score));
  3130. removeEventListener(Event.ENTER_FRAME, this.update);
  3131. stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.keyDown);
  3132. stage.removeEventListener(KeyboardEvent.KEY_UP, this.keyUp);
  3133. this.GameOver.back_btn.addEventListener(MouseEvent.CLICK, function ():*{
  3134. letsStart();
  3135. });
  3136. this.GameOver.again_btn.addEventListener(MouseEvent.CLICK, this.startGame);
  3137. };
  3138. if (this.enemyArr[en].x < -55)
  3139. {
  3140. removeChild(this.enemyArr[en]);
  3141. this.enemyArr.splice(en, 1);
  3142. };
  3143. en = (en + 1);
  3144. };
  3145. if (this.player.x < 75)
  3146. {
  3147. this.player.x = 75;
  3148. };
  3149. if (this.player.x > 580)
  3150. {
  3151. this.player.x = 580;
  3152. };
  3153. if (this.player.y < 75)
  3154. {
  3155. this.player.y = 75;
  3156. };
  3157. if (this.player.y > 370)
  3158. {
  3159. this.player.y = 370;
  3160. };
  3161. }
  3162. else
  3163. {
  3164. this.player.visible = false;
  3165. nen = 0;
  3166. while (nen < this.enemyArr.length)
  3167. {
  3168. removeChild(this.enemyArr[nen]);
  3169. nen = (nen + 1);
  3170. };
  3171. this.enemyArr = [];
  3172. stage.removeEventListener(Event.ENTER_FRAME, this.loop);
  3173. };
  3174. }
  3175. public function e1RandomY():*{
  3176. return ((Math.random() * 300) + 50);
  3177. }
  3178. public function openClan(e:Event):*{
  3179. this.clan = new Clans();
  3180. this.clan.alpha = 0;
  3181. this.clan.width = 700;
  3182. this.clan.height = 500;
  3183. this.clan.x = 340.55;
  3184. this.clan.y = 210.1;
  3185. addChild(this.clan);
  3186. Tweener.addTween(this.clan, {
  3187. "x":340.55,
  3188. "y":210.1,
  3189. "width":700,
  3190. "height":500,
  3191. "alpha":1,
  3192. "time":0.3,
  3193. "transition":"easeOutSine"
  3194. });
  3195. this.TheConnection.send("openClans");
  3196. }
  3197. public function minigames(e:Event):*{
  3198. this.minigame = new playminigames();
  3199. this.minigame.alpha = 0;
  3200. this.minigame.x = 107.85;
  3201. this.minigame.y = 89.7;
  3202. addChild(this.minigame);
  3203. Tweener.addTween(this.minigame, {
  3204. "x":107.85,
  3205. "y":89.7,
  3206. "alpha":1,
  3207. "time":0.3,
  3208. "transition":"easeOutSine"
  3209. });
  3210. this.minigame.flappybird_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3211. minigame.gotoAndStop(2);
  3212. startfly();
  3213. });
  3214. this.minigame.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3215. removeChild(e.target.parent);
  3216. });
  3217. }
  3218. public function allshop_mc(e:Event):*{
  3219. this.openallshop = new OpenShop();
  3220. this.openallshop.alpha = 0;
  3221. this.openallshop.x = 325;
  3222. this.openallshop.y = 225;
  3223. addChild(this.openallshop);
  3224. Tweener.addTween(this.openallshop, {
  3225. "x":325,
  3226. "y":225,
  3227. "alpha":1,
  3228. "time":0.3,
  3229. "transition":"easeOutSine"
  3230. });
  3231. this.openallshop.dshop.addEventListener(MouseEvent.CLICK, this.openDshop);
  3232. this.openallshop.nshop.addEventListener(MouseEvent.CLICK, this.openShop);
  3233. this.openallshop.rankshop_btn.addEventListener(MouseEvent.CLICK, this.rankshop_mc);
  3234. this.openallshop.cashshop_btn.addEventListener(MouseEvent.CLICK, this.cashshop_mc);
  3235. this.openallshop.ultrshop_btn.addEventListener(MouseEvent.CLICK, this.ultrashop_mc);
  3236. this.openallshop.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3237. removeChild(openallshop);
  3238. });
  3239. }
  3240. public function ultrashop_mc(e:Event):*{
  3241. this.ultrashopopen = new UltraShop();
  3242. this.ultrashopopen.alpha = 0;
  3243. this.ultrashopopen.x = 325;
  3244. this.ultrashopopen.y = 225;
  3245. addChild(this.ultrashopopen);
  3246. Tweener.addTween(this.ultrashopopen, {
  3247. "x":325,
  3248. "y":225,
  3249. "alpha":1,
  3250. "time":0.3,
  3251. "transition":"easeOutSine"
  3252. });
  3253. this.ultrashopopen.matrix.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3254. BuyPrem("matrix", "Matrix Skin");
  3255. });
  3256. this.ultrashopopen.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3257. removeChild(ultrashopopen);
  3258. });
  3259. }
  3260. public function cashshop_mc(e:Event):*{
  3261. this.cashshopopen = new CashShop();
  3262. this.cashshopopen.alpha = 0;
  3263. this.cashshopopen.x = 325;
  3264. this.cashshopopen.y = 225;
  3265. addChild(this.cashshopopen);
  3266. this._scrollbar = new Scrollbar();
  3267. this._scrollbar.init(this.cashshopopen.content, this.cashshopopen.contentMask, this.cashshopopen.track, this.cashshopopen.slider);
  3268. this.cashshopopen.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3269. removeChild(cashshopopen);
  3270. });
  3271. Tweener.addTween(this.cashshopopen, {
  3272. "x":325,
  3273. "y":225,
  3274. "alpha":1,
  3275. "time":0.3,
  3276. "transition":"easeOutSine"
  3277. });
  3278. this.cashshopopen.content.get_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3279. TheConnection.send("cashtoslitherio");
  3280. });
  3281. this.cashshopopen.content.get_btn2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3282. TheConnection.send("cashtoslitherio2");
  3283. });
  3284. this.cashshopopen.content.get_btn3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3285. TheConnection.send("cashtoslitherio3");
  3286. });
  3287. this.cashshopopen.content.get_btn4.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3288. TheConnection.send("cashtoslitherio4");
  3289. });
  3290. this.cashshopopen.content.get_btn5.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3291. TheConnection.send("cashtoslitherio5");
  3292. });
  3293. this.cashshopopen.content.get_btn6.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3294. TheConnection.send("cashtoslitherio6");
  3295. });
  3296. this.cashshopopen.content.get_btn7.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3297. TheConnection.send("cashtoslitherio7");
  3298. });
  3299. this.cashshopopen.content.get_btn8.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3300. TheConnection.send("cashtoslitherio8");
  3301. });
  3302. this.cashshopopen.content.get_btn9.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3303. TheConnection.send("cashtoslitherio9");
  3304. });
  3305. this.cashshopopen.content.get_btn10.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3306. TheConnection.send("cashtoslitherio10");
  3307. });
  3308. this.cashshopopen.content.get_btn11.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3309. TheConnection.send("cashtoslitherio11");
  3310. });
  3311. this.cashshopopen.content.get_btn12.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3312. TheConnection.send("cashtoslitherio12");
  3313. });
  3314. }
  3315. public function rankshop_mc(e:Event):*{
  3316. this.rankshopopen = new RankShop();
  3317. this.rankshopopen.alpha = 0;
  3318. this.rankshopopen.x = 325;
  3319. this.rankshopopen.y = 225;
  3320. addChild(this.rankshopopen);
  3321. Tweener.addTween(this.rankshopopen, {
  3322. "x":325,
  3323. "y":225,
  3324. "alpha":1,
  3325. "time":0.3,
  3326. "transition":"easeOutSine"
  3327. });
  3328. this.rankshopopen.get_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3329. TheConnection.send("getleve2");
  3330. });
  3331. this.rankshopopen.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3332. removeChild(rankshopopen);
  3333. });
  3334. }
  3335. public function exchange(e:Event):*{
  3336. this.exchanges = new GetTokens();
  3337. this.exchanges.alpha = 0;
  3338. this.exchanges.x = 335.8;
  3339. this.exchanges.y = 199.75;
  3340. addChild(this.exchanges);
  3341. this._scrollbar = new Scrollbar();
  3342. this._scrollbar.init(this.exchanges.content, this.exchanges.contentMask, this.exchanges.track, this.exchanges.slider);
  3343. this.exchanges.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3344. removeChild(exchanges);
  3345. TheConnection.send("loadplayer", fbuid, "newdb");
  3346. });
  3347. Tweener.addTween(this.exchanges, {
  3348. "x":335.8,
  3349. "y":199.75,
  3350. "alpha":1,
  3351. "time":0.3,
  3352. "transition":"easeOutSine"
  3353. });
  3354. this.TheConnection.send("GetTokens");
  3355. this.exchanges.coinstxt.text = String(this.dbcoins);
  3356. this.exchanges.dicetxt.text = String(this.dbdice);
  3357. this.exchanges.content.get_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3358. TheConnection.send("exchange1");
  3359. });
  3360. this.exchanges.content.get_btn2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3361. TheConnection.send("exchange2");
  3362. });
  3363. this.exchanges.content.get_btn3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3364. TheConnection.send("exchange3");
  3365. });
  3366. this.exchanges.content.get_btn4.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3367. TheConnection.send("exchange4");
  3368. });
  3369. this.exchanges.content.get_btn5.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3370. TheConnection.send("exchange5");
  3371. });
  3372. this.exchanges.content.get_btn6.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3373. TheConnection.send("exchange6");
  3374. });
  3375. this.exchanges.content.get_btn7.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3376. TheConnection.send("exchange7");
  3377. });
  3378. this.exchanges.content.get_btn8.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3379. TheConnection.send("exchange8");
  3380. });
  3381. this.exchanges.content.get_btn9.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3382. TheConnection.send("exchange9");
  3383. });
  3384. this.exchanges.content.get_btn10.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3385. TheConnection.send("exchange10");
  3386. });
  3387. this.exchanges.content.get_btn11.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3388. TheConnection.send("exchange11");
  3389. });
  3390. this.exchanges.content.get_btn12.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3391. TheConnection.send("exchange12");
  3392. });
  3393. this.exchanges.content.get_btn13.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3394. TheConnection.send("exchange13");
  3395. });
  3396. this.exchanges.content.get_btn14.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3397. TheConnection.send("exchange14");
  3398. });
  3399. }
  3400. public function alltop10(e:Event):*{
  3401. this.alltops10 = new Tops10();
  3402. this.alltops10.alpha = 0;
  3403. this.alltops10.x = 144.25;
  3404. this.alltops10.y = 107.65;
  3405. addChild(this.alltops10);
  3406. Tweener.addTween(this.alltops10, {
  3407. "x":144.25,
  3408. "y":107.65,
  3409. "alpha":1,
  3410. "time":0.3,
  3411. "transition":"easeOutSine"
  3412. });
  3413. this.alltops10.tops.items_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3414. if (!more2)
  3415. {
  3416. more2 = true;
  3417. topitems = new TOPITEMS();
  3418. addChild(topitems);
  3419. topitems.x = 350.7;
  3420. topitems.y = -389;
  3421. Tweener.addTween(topitems, {
  3422. "x":350.7,
  3423. "y":93.5,
  3424. "width":214.3,
  3425. "height":455,
  3426. "alpha":1,
  3427. "time":1,
  3428. "transition":"easeOutSine"
  3429. });
  3430. topitems.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3431. if (more2)
  3432. {
  3433. more2 = false;
  3434. removeChild(topitems);
  3435. };
  3436. });
  3437. TheClient.bigDB.loadRange("Maindb", "itemcount", [], null, null, 10, function (theitem:Array):void{
  3438. var co:DatabaseObject;
  3439. var top:* = undefined;
  3440. var playid:* = undefined;
  3441. var fbpic:* = undefined;
  3442. var photo:* = undefined;
  3443. var y:* = 2;
  3444. var x:* = 4.95;
  3445. topitems.loading.visible = false;
  3446. var i:int;
  3447. while (i < theitem.length)
  3448. {
  3449. co = (theitem[i] as DatabaseObject);
  3450. top = new TOPI();
  3451. trace(co.key);
  3452. y = (y + 27);
  3453. playid = co.key.split("fb");
  3454. fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
  3455. photo = new Loader();
  3456. photo.load(new URLRequest(fbpic));
  3457. photo.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void{
  3458. var loader:Loader = LoaderInfo(e.target).loader;
  3459. loader.width = 23.4;
  3460. loader.height = 22.4;
  3461. });
  3462. topitems.addChild(top);
  3463. trace(co.itemcount);
  3464. top.itemtxt.text = String(co.itemcount);
  3465. top.y = y;
  3466. top.x = x;
  3467. top.picwhere.addChild(photo);
  3468. if (i == 0)
  3469. {
  3470. top.nametxt.htmlText = ("<font color='#00FFFF'>[1]" + co.fbname);
  3471. }
  3472. else
  3473. {
  3474. if (i == 1)
  3475. {
  3476. top.nametxt.htmlText = (("<font color='#FF0000'>[2]" + co.fbname) || ("not support"));
  3477. }
  3478. else
  3479. {
  3480. top.nametxt.text = ((co.fbname) || ("not support"));
  3481. };
  3482. };
  3483. i = (i + 1);
  3484. };
  3485. });
  3486. };
  3487. });
  3488. this.alltops10.tops.more_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3489. if (!more)
  3490. {
  3491. more = true;
  3492. topcoins = new TopCoins();
  3493. addChild(topcoins);
  3494. topcoins.x = 248.9;
  3495. topcoins.y = 18.4;
  3496. topcoins.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3497. if (more)
  3498. {
  3499. more = false;
  3500. removeChild(topcoins);
  3501. };
  3502. });
  3503. TheClient.bigDB.loadRange("Maindb", "coins", [], null, null, 10, function (thedice:Array):void{
  3504. var co:DatabaseObject;
  3505. var top:* = undefined;
  3506. var playid:* = undefined;
  3507. var fbpic:* = undefined;
  3508. var photo:* = undefined;
  3509. var y:* = 8.8;
  3510. var x:* = -91.6;
  3511. topcoins.loading.visible = false;
  3512. var i:int;
  3513. while (i < thedice.length)
  3514. {
  3515. co = (thedice[i] as DatabaseObject);
  3516. top = new TOP2();
  3517. trace(co.key);
  3518. y = (y + 31);
  3519. playid = co.key.split("fb");
  3520. fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
  3521. photo = new Loader();
  3522. photo.load(new URLRequest(fbpic));
  3523. photo.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void{
  3524. var loader:Loader = LoaderInfo(e.target).loader;
  3525. loader.width = 23.4;
  3526. loader.height = 22.4;
  3527. });
  3528. topcoins.addChild(top);
  3529. top.coinstxt.text = String(co.coins);
  3530. top.y = y;
  3531. top.x = x;
  3532. top.picwhere.addChild(photo);
  3533. if (i == 0)
  3534. {
  3535. top.nametxt.htmlText = ("<font color='#00FFFF'>[1]" + co.fbname);
  3536. }
  3537. else
  3538. {
  3539. if (i == 1)
  3540. {
  3541. top.nametxt.htmlText = (("<font color='#FF0000'>[2]" + co.fbname) || ("not support"));
  3542. }
  3543. else
  3544. {
  3545. top.nametxt.text = ((co.fbname) || ("not support"));
  3546. };
  3547. };
  3548. i = (i + 1);
  3549. };
  3550. });
  3551. };
  3552. });
  3553. this.TheClient.bigDB.loadRange("Maindb", "dice", [], null, null, 10, function (thedice:Array):void{
  3554. var co:DatabaseObject;
  3555. var top:* = undefined;
  3556. var playid:* = undefined;
  3557. var fbpic:* = undefined;
  3558. var photo:* = undefined;
  3559. var y:* = 8.8;
  3560. var x:* = -91.6;
  3561. alltops10.tops.loading.visible = false;
  3562. var i:int;
  3563. while (i < thedice.length)
  3564. {
  3565. co = (thedice[i] as DatabaseObject);
  3566. top = new TOP();
  3567. top.dicetxt.text = String(co.dice);
  3568. top.y = y;
  3569. top.x = x;
  3570. y = (y + 31);
  3571. playid = co.key.split("fb");
  3572. fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
  3573. photo = new Loader();
  3574. photo.load(new URLRequest(fbpic));
  3575. top.picwhere.addChild(photo);
  3576. if (i == 0)
  3577. {
  3578. top.nametxt.htmlText = ("<font color='#00FFFF'>[1]" + co.fbname);
  3579. }
  3580. else
  3581. {
  3582. if (i == 1)
  3583. {
  3584. top.nametxt.htmlText = (("<font color='#FF0000'>[2]" + co.fbname) || ("not support"));
  3585. }
  3586. else
  3587. {
  3588. top.nametxt.text = ((co.fbname) || ("not support"));
  3589. };
  3590. };
  3591. photo.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void{
  3592. var loader:Loader = LoaderInfo(e.target).loader;
  3593. loader.width = 23.4;
  3594. loader.height = 22.4;
  3595. });
  3596. alltops10.tops.addChild(top);
  3597. i = (i + 1);
  3598. };
  3599. });
  3600. this.alltops10.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3601. removeChild(e.target.parent);
  3602. });
  3603. }
  3604. private function handleSearch(connection:Connection):void{
  3605. connection.addMessageHandler("*", this.handleMessages);
  3606. }
  3607. private function onEnter():*{
  3608. var snow:Snow;
  3609. snow = null;
  3610. if (this.snowing == true)
  3611. {
  3612. snow = new Snow();
  3613. snow.gotoAndStop(Math.round(Math.ceil((Math.random() * 10))));
  3614. snow.x = (650 * Math.random());
  3615. snow.y = 0;
  3616. snow.width = (snow.height = (1 + (5 * Math.random())));
  3617. snow.xSpeed = (-2 + (4 * Math.random()));
  3618. snow.ySpeed = (1 + (4 * Math.random()));
  3619. snow.at = (-0.001 - (0.001 * Math.random()));
  3620. snow.vt = 0;
  3621. addChild(snow);
  3622. snow.addEventListener(Event.ENTER_FRAME, this.onSnowEnter);
  3623. };
  3624. }
  3625. private function onSnowEnter(e:Event):void{
  3626. var snow:Snow;
  3627. snow = (e.currentTarget as Snow);
  3628. snow.x = (snow.x + snow.xSpeed);
  3629. snow.y = (snow.y + snow.ySpeed);
  3630. if (snow.y >= 510)
  3631. {
  3632. snow.addEventListener(Event.ENTER_FRAME, this.onMeltingEnter);
  3633. };
  3634. }
  3635. private function onMeltingEnter(e:Event):void{
  3636. var snow:Snow;
  3637. snow = (e.currentTarget as Snow);
  3638. addChild(snow);
  3639. snow.removeEventListener(Event.ENTER_FRAME, this.onSnowEnter);
  3640. snow.vt = (snow.vt + snow.at);
  3641. snow.alpha = (snow.alpha + snow.vt);
  3642. if (snow.alpha <= 0)
  3643. {
  3644. snow.removeEventListener(Event.ENTER_FRAME, this.onMeltingEnter);
  3645. removeChild(snow);
  3646. };
  3647. }
  3648. private function startSnow(shit:*):*{
  3649. if (this.snowing == true)
  3650. {
  3651. this.snowing = false;
  3652. }
  3653. else
  3654. {
  3655. this.snowing = true;
  3656. };
  3657. }
  3658. private function openShop(e:Event):void{
  3659. if (((!(this.isshopopen)) && (this.eButtons)))
  3660. {
  3661. this.eButtons = false;
  3662. this.isshopopen = true;
  3663. this.shopopen = new ShopOpen();
  3664. this.shopopen.alpha = 0;
  3665. this.shopopen.x = -45.45;
  3666. this.shopopen.y = 2.6;
  3667. addChild(this.shopopen);
  3668. Tweener.addTween(this.shopopen, {
  3669. "x":-45.45,
  3670. "y":2.6,
  3671. "alpha":1,
  3672. "time":0.3,
  3673. "transition":"easeOutSine"
  3674. });
  3675. this.shopopen.content.giftbox.price_txt.text = "Price: 30";
  3676. this.shopopen.content.chinahat.price_txt.text = "Price: 500";
  3677. this.shopopen.content.lolface.price_txt.text = "Price: 500";
  3678. this.shopopen.content.angrymouth.price_txt.text = "Price: 500";
  3679. this.shopopen.content.happymouths.price_txt.text = "Price: 500";
  3680. this.shopopen.content.Reggae.price_txt.text = "Price: 350";
  3681. this.shopopen.content.suprisedeyes.price_txt.text = "Price: 350";
  3682. this.shopopen.content.sadeyes.price_txt.text = "Price: 350";
  3683. this.shopopen.content.knifes.price_txt.text = "Price: 600";
  3684. this.shopopen.content.giftbox.name_txt.text = "Gift Box";
  3685. this.shopopen.content.chinahat.name_txt.text = "China Hat";
  3686. this.shopopen.content.lolface.name_txt.text = "Lol Face";
  3687. this.shopopen.content.angrymouth.name_txt.text = "Angry Mouth";
  3688. this.shopopen.content.happymouths.name_txt.text = "Happy Mouth";
  3689. this.shopopen.content.Reggae.name_txt.text = "Reggae Hat";
  3690. this.shopopen.content.suprisedeyes.name_txt.text = "Suprised Eyes";
  3691. this.shopopen.content.sadeyes.name_txt.text = "Sad Eyes";
  3692. this.shopopen.content.knifes.name_txt.text = "Knifess";
  3693. this.shopopen.content.giftbox.item.gotoAndStop("giftbox");
  3694. this.shopopen.content.chinahat.item.gotoAndStop("chinahat");
  3695. this.shopopen.content.lolface.item.gotoAndStop("lolface");
  3696. this.shopopen.content.angrymouth.item.gotoAndStop("angrymouth");
  3697. this.shopopen.content.happymouths.item.gotoAndStop("happymouths");
  3698. this.shopopen.content.Reggae.item.gotoAndStop("Reggae");
  3699. this.shopopen.content.suprisedeyes.item.gotoAndStop("suprisedeyes");
  3700. this.shopopen.content.sadeyes.item.gotoAndStop("sadeyes");
  3701. this.shopopen.content.knifes.item.gotoAndStop("knifes");
  3702. this.shopopen.content.giftbox.buy_btn.tabEnabled = false;
  3703. this.shopopen.content.chinahat.buy_btn.tabEnabled = false;
  3704. this.shopopen.content.lolface.buy_btn.tabEnabled = false;
  3705. this.shopopen.content.angrymouth.buy_btn.tabEnabled = false;
  3706. this.shopopen.content.happymouths.buy_btn.tabEnabled = false;
  3707. this.shopopen.content.Reggae.buy_btn.tabEnabled = false;
  3708. this.shopopen.content.suprisedeyes.buy_btn.tabEnabled = false;
  3709. this.shopopen.content.sadeyes.buy_btn.tabEnabled = false;
  3710. this.shopopen.content.knifes.buy_btn.tabEnabled = false;
  3711. this.shopopen.content.knifes.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3712. buyItem("knifes");
  3713. });
  3714. this.shopopen.content.sadeyes.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3715. buyItem("sadeyes");
  3716. });
  3717. this.shopopen.content.suprisedeyes.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3718. buyItem("suprisedeyes");
  3719. });
  3720. this.shopopen.content.Reggae.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3721. buyItem("Reggae");
  3722. });
  3723. this.shopopen.content.chinahat.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3724. buyItem("chinahat");
  3725. });
  3726. this.shopopen.content.lolface.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3727. buyItem("lolface");
  3728. });
  3729. this.shopopen.content.angrymouth.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3730. buyItem("angrymouth");
  3731. });
  3732. this.shopopen.content.happymouths.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3733. buyItem("happymouths");
  3734. });
  3735. this.shopopen.content.giftbox.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3736. buyItem("giftbox");
  3737. });
  3738. this._scrollbar = new Scrollbar();
  3739. this._scrollbar.init(this.shopopen.content, this.shopopen.contentMask, this.shopopen.track, this.shopopen.slider);
  3740. this.shopopen.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3741. TheConnection.send("loadplayer", fbuid, "newdb");
  3742. isshopopen = false;
  3743. eButtons = true;
  3744. removeChild(e.target.parent);
  3745. });
  3746. };
  3747. }
  3748. private function buyItem(item:String):void{
  3749. if (this.isshopopen)
  3750. {
  3751. this.TheConnection.send("buyItem", item);
  3752. this.shopopen.loadblock.visible = true;
  3753. };
  3754. }
  3755. private function mouseDown(e:MouseEvent):void{
  3756. switch (e.currentTarget.name)
  3757. {
  3758. case "pshop":
  3759. this.openPshop();
  3760. break;
  3761. };
  3762. }
  3763. private function updateOffer(offerz:String):void{
  3764. var offerlist:Array;
  3765. var columnsPerRow:int;
  3766. var i:int;
  3767. var thelist:String;
  3768. var user:* = undefined;
  3769. if (offerz.length > 0)
  3770. {
  3771. offerlist = offerz.split("~");
  3772. columnsPerRow = 3;
  3773. while (this.offersList.source.numChildren > 0)
  3774. {
  3775. this.offersList.source.removeChildAt(0);
  3776. };
  3777. i = 0;
  3778. while (i < offerlist.length)
  3779. {
  3780. thelist = offerlist[i];
  3781. user = thelist.split(";");
  3782. if (user[1] != "nooffer")
  3783. {
  3784. this.offered = new Offered();
  3785. this.offered.thename.text = String(user[2]);
  3786. this.offered.fbid.text = String(user[3]);
  3787. this.offered.gotoAndStop(String(user[1]));
  3788. this.offered.item.gotoAndStop(String(user[0]));
  3789. trace(user);
  3790. this.offered.trusttxt.text = ("Trust: " + user[5].toString());
  3791. this.offered.dealbg.gotoAndStop(String(user[4]));
  3792. this.offered.x = ((i % columnsPerRow) * (this.offered.width + 14));
  3793. this.offered.y = (Math.floor((i / columnsPerRow)) * (this.offered.height + 5));
  3794. this.offersContainer.addChild(this.offered);
  3795. this.offersList.update();
  3796. if (this.offered.currentFrame >= 2)
  3797. {
  3798. this.offered.buttonMode = true;
  3799. };
  3800. this.offered.addEventListener(MouseEvent.ROLL_OVER, function (e:MouseEvent):void{
  3801. Tweener.addTween(MovieClip(e.target), {
  3802. "alpha":0.5,
  3803. "time":0.1,
  3804. "transition":"easeInSine"
  3805. });
  3806. });
  3807. this.offered.addEventListener(MouseEvent.ROLL_OUT, function (e:MouseEvent):void{
  3808. Tweener.addTween(MovieClip(e.target), {
  3809. "alpha":1,
  3810. "time":0.1,
  3811. "transition":"easeInSine"
  3812. });
  3813. });
  3814. if (user[1] == "open")
  3815. {
  3816. this.offered.addEventListener(MouseEvent.CLICK, this.offerClick);
  3817. };
  3818. };
  3819. i = (i + 1);
  3820. };
  3821. }
  3822. else
  3823. {
  3824. if (this.offered != null)
  3825. {
  3826. this.offered.removeChildren();
  3827. };
  3828. };
  3829. }
  3830. private function offerClick(e:MouseEvent):void{
  3831. var partnername:*;
  3832. var partneritem:*;
  3833. if (e.currentTarget.fbid.text != undefined)
  3834. {
  3835. this.partnerid = e.currentTarget.fbid.text;
  3836. partnername = e.currentTarget.thename.text;
  3837. partneritem = e.currentTarget.item.currentLabel;
  3838. if ((((!(this.partnerid == ("fb" + this.fbuid))) && (!(this.iwilloffer))) && (!(this.imonoffer))))
  3839. {
  3840. this.imonoffer = true;
  3841. this.goOnOffer(this.partnerid, partnername, partneritem);
  3842. }
  3843. else
  3844. {
  3845. this.alert("Join Failed!, it's either your offer or the person is busy");
  3846. this.partnerid = "";
  3847. };
  3848. };
  3849. }
  3850. private function gotInOffer(id:String, name:String):*{
  3851. var playid:* = undefined;
  3852. var fbpic:* = undefined;
  3853. var photo:* = undefined;
  3854. this.ontrade = true;
  3855. this.chat_w.DisplayTextField.htmlText = (("<font color='#FF0000'>You are on Private Chat with " + name) + "!\n");
  3856. this.MyOffer.fbname.text = name;
  3857. this.MyOffer.picwhere.alpha = 100;
  3858. this.partnerid = id;
  3859. playid = id.split("fb");
  3860. fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
  3861. photo = new Loader();
  3862. photo.load(new URLRequest(fbpic));
  3863. this.MyOffer.picwhere.addChild(photo);
  3864. this.MyOffer.kick_btn.visible = true;
  3865. this.MyOffer.kick_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3866. ontrade = false;
  3867. imbusy = false;
  3868. MyOffer.fbname.text = "";
  3869. MyOffer.picwhere.alpha = 0;
  3870. MyOffer.kick_btn.visible = false;
  3871. MyOffer.deal_btn.visible = false;
  3872. MyOffer.unlock_btn.visible = false;
  3873. MyOffer.lockedmcc.visible = false;
  3874. MyOffer.hisoffer1.gotoAndStop("none");
  3875. MyOffer.hisoffer2.gotoAndStop("none");
  3876. MyOffer.hisoffer3.gotoAndStop("none");
  3877. MyOffer.hisoffer4.gotoAndStop("none");
  3878. MyOffer.hisoffer5.gotoAndStop("none");
  3879. MyOffer.hisoffer6.gotoAndStop("none");
  3880. MyOffer.hisoffer1.howmany.text = "";
  3881. MyOffer.hisoffer2.howmany.text = "";
  3882. MyOffer.hisoffer3.howmany.text = "";
  3883. MyOffer.hisoffer4.howmany.text = "";
  3884. MyOffer.hisoffer5.howmany.text = "";
  3885. MyOffer.hisoffer6.howmany.text = "";
  3886. MyOffer.coinstxt.text = "0";
  3887. MyOffer.dicetxt.text = "0";
  3888. MyOffer.unlock_btn.visible = false;
  3889. MyOffer.deal_btn.visible = false;
  3890. MyOffer.lockedmcc.visible = false;
  3891. lobbyConnection.send("getOut", partnerid);
  3892. });
  3893. }
  3894. private function addminus():void{
  3895. if (this.ontrade)
  3896. {
  3897. if (this.HisOffer.offer6.currentLabel != "none")
  3898. {
  3899. this.HisOffer.more6.visible = true;
  3900. this.HisOffer.more6.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3901. var num:*;
  3902. if (canadd)
  3903. {
  3904. if (HisOffer.offer6.howmany.text == "")
  3905. {
  3906. canadd = false;
  3907. (HisOffer.offer6.howmany.text == "");
  3908. HisOffer.offer6.gotoAndStop("none");
  3909. HisOffer.more6.visible = false;
  3910. lobbyConnection.send("Iminus", "offer6", 0);
  3911. addminus();
  3912. }
  3913. else
  3914. {
  3915. canadd = false;
  3916. num = (int(HisOffer.offer6.howmany.text) - 1);
  3917. lobbyConnection.send("Iminus", "offer6", num);
  3918. addminus();
  3919. };
  3920. };
  3921. });
  3922. this.HisOffer.more6.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3923. var num:*;
  3924. if (canadd)
  3925. {
  3926. if (HisOffer.offer6.howmany.text == "")
  3927. {
  3928. canadd = false;
  3929. lobbyConnection.send("Iadd", "offer6", 2);
  3930. addminus();
  3931. trace("2");
  3932. }
  3933. else
  3934. {
  3935. canadd = false;
  3936. num = (int(HisOffer.offer6.howmany.text) + 1);
  3937. lobbyConnection.send("Iadd", "offer6", num);
  3938. addminus();
  3939. trace(num);
  3940. };
  3941. };
  3942. });
  3943. };
  3944. if (this.HisOffer.offer5.currentLabel != "none")
  3945. {
  3946. this.HisOffer.more5.visible = true;
  3947. this.HisOffer.more5.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3948. var num:*;
  3949. if (canadd)
  3950. {
  3951. if (HisOffer.offer5.howmany.text == "")
  3952. {
  3953. canadd = false;
  3954. (HisOffer.offer5.howmany.text == "");
  3955. HisOffer.offer5.gotoAndStop("none");
  3956. HisOffer.more5.visible = false;
  3957. lobbyConnection.send("Iminus", "offer5", 0);
  3958. addminus();
  3959. }
  3960. else
  3961. {
  3962. canadd = false;
  3963. num = (int(HisOffer.offer5.howmany.text) - 1);
  3964. lobbyConnection.send("Iminus", "offer5", num);
  3965. addminus();
  3966. };
  3967. };
  3968. });
  3969. this.HisOffer.more5.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3970. var num:*;
  3971. if (canadd)
  3972. {
  3973. if (HisOffer.offer5.howmany.text == "")
  3974. {
  3975. canadd = false;
  3976. lobbyConnection.send("Iadd", "offer5", 2);
  3977. addminus();
  3978. trace("2");
  3979. }
  3980. else
  3981. {
  3982. canadd = false;
  3983. num = (int(HisOffer.offer5.howmany.text) + 1);
  3984. lobbyConnection.send("Iadd", "offer5", num);
  3985. addminus();
  3986. trace(num);
  3987. };
  3988. };
  3989. });
  3990. };
  3991. if (this.HisOffer.offer4.currentLabel != "none")
  3992. {
  3993. this.HisOffer.more4.visible = true;
  3994. this.HisOffer.more4.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  3995. var num:*;
  3996. if (canadd)
  3997. {
  3998. if (HisOffer.offer4.howmany.text == "")
  3999. {
  4000. canadd = false;
  4001. (HisOffer.offer4.howmany.text == "");
  4002. HisOffer.offer4.gotoAndStop("none");
  4003. HisOffer.more4.visible = false;
  4004. lobbyConnection.send("Iminus", "offer4", 0);
  4005. addminus();
  4006. }
  4007. else
  4008. {
  4009. canadd = false;
  4010. num = (int(HisOffer.offer4.howmany.text) - 1);
  4011. lobbyConnection.send("Iminus", "offer4", num);
  4012. addminus();
  4013. };
  4014. };
  4015. });
  4016. this.HisOffer.more4.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4017. var num:*;
  4018. if (canadd)
  4019. {
  4020. if (HisOffer.offer4.howmany.text == "")
  4021. {
  4022. canadd = false;
  4023. lobbyConnection.send("Iadd", "offer4", 2);
  4024. addminus();
  4025. trace("2");
  4026. }
  4027. else
  4028. {
  4029. canadd = false;
  4030. num = (int(HisOffer.offer4.howmany.text) + 1);
  4031. lobbyConnection.send("Iadd", "offer4", num);
  4032. addminus();
  4033. trace(num);
  4034. };
  4035. };
  4036. });
  4037. };
  4038. if (this.HisOffer.offer3.currentLabel != "none")
  4039. {
  4040. this.HisOffer.more3.visible = true;
  4041. this.HisOffer.more3.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4042. var num:*;
  4043. if (canadd)
  4044. {
  4045. if (HisOffer.offer3.howmany.text == "")
  4046. {
  4047. canadd = false;
  4048. (HisOffer.offer3.howmany.text == "");
  4049. HisOffer.offer3.gotoAndStop("none");
  4050. HisOffer.more3.visible = false;
  4051. lobbyConnection.send("Iminus", "offer3", 0);
  4052. addminus();
  4053. }
  4054. else
  4055. {
  4056. canadd = false;
  4057. num = (int(HisOffer.offer3.howmany.text) - 1);
  4058. lobbyConnection.send("Iminus", "offer3", num);
  4059. addminus();
  4060. };
  4061. };
  4062. });
  4063. this.HisOffer.more3.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4064. var num:*;
  4065. if (canadd)
  4066. {
  4067. if (HisOffer.offer3.howmany.text == "")
  4068. {
  4069. canadd = false;
  4070. lobbyConnection.send("Iadd", "offer3", 2);
  4071. addminus();
  4072. trace("2");
  4073. }
  4074. else
  4075. {
  4076. canadd = false;
  4077. num = (int(HisOffer.offer3.howmany.text) + 1);
  4078. lobbyConnection.send("Iadd", "offer3", num);
  4079. addminus();
  4080. trace(num);
  4081.  
  4082. };
  4083. };
  4084. });
  4085. };
  4086. if (this.HisOffer.offer2.currentLabel != "none")
  4087. {
  4088. this.HisOffer.more2.visible = true;
  4089. this.HisOffer.more2.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4090. var num2:*;
  4091. if (canadd)
  4092. {
  4093. if (HisOffer.offer2.howmany.text == "")
  4094. {
  4095. canadd = false;
  4096. (HisOffer.offer2.howmany.text == "");
  4097. HisOffer.offer2.gotoAndStop("none");
  4098. HisOffer.more2.visible = false;
  4099. lobbyConnection.send("Iminus", "offer2", 0);
  4100. addminus();
  4101. }
  4102. else
  4103. {
  4104. canadd = false;
  4105. num2 = (int(HisOffer.offer2.howmany.text) - 1);
  4106. lobbyConnection.send("Iminus", "offer2", num2);
  4107. addminus();
  4108. };
  4109. };
  4110. });
  4111. this.HisOffer.more2.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4112. var num:*;
  4113. if (canadd)
  4114. {
  4115. if (HisOffer.offer2.howmany.text == "")
  4116. {
  4117. canadd = false;
  4118. lobbyConnection.send("Iadd", "offer2", 2);
  4119. addminus();
  4120. trace("2");
  4121. }
  4122. else
  4123. {
  4124. canadd = false;
  4125. num = (int(HisOffer.offer2.howmany.text) + 1);
  4126. lobbyConnection.send("Iadd", "offer2", num);
  4127. addminus();
  4128. trace(num);
  4129. };
  4130. };
  4131. });
  4132. };
  4133. if (this.HisOffer.offer1.currentLabel != "none")
  4134. {
  4135. this.HisOffer.more1.visible = true;
  4136. this.HisOffer.more1.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4137. var num:*;
  4138. if (canadd)
  4139. {
  4140. if (HisOffer.offer1.howmany.text == "")
  4141. {
  4142. canadd = false;
  4143. (HisOffer.offer1.howmany.text == "");
  4144. HisOffer.offer1.gotoAndStop("none");
  4145. HisOffer.more1.visible = false;
  4146. lobbyConnection.send("Iminus", "offer1", 0);
  4147. addminus();
  4148. }
  4149. else
  4150. {
  4151. canadd = false;
  4152. num = (int(HisOffer.offer1.howmany.text) - 1);
  4153. lobbyConnection.send("Iminus", "offer1", num);
  4154. addminus();
  4155. };
  4156. };
  4157. });
  4158. this.HisOffer.more1.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4159. var num:*;
  4160. if (canadd)
  4161. {
  4162. if (HisOffer.offer1.howmany.text == "")
  4163. {
  4164. canadd = false;
  4165. lobbyConnection.send("Iadd", "offer1", 2);
  4166. addminus();
  4167. trace("2");
  4168. }
  4169. else
  4170. {
  4171. canadd = false;
  4172. num = (int(HisOffer.offer1.howmany.text) + 1);
  4173. lobbyConnection.send("Iadd", "offer1", num);
  4174. addminus();
  4175. trace(num);
  4176. };
  4177. };
  4178. });
  4179. };
  4180. };
  4181. }
  4182. private function goOnOffer(id:String, name:String, item:String):*{
  4183. var playid:* = undefined;
  4184. var fbpic:* = undefined;
  4185. var photo:* = undefined;
  4186. var arr:String;
  4187. var ye:* = undefined;
  4188. var i:* = undefined;
  4189. var t:DisplayObject;
  4190. if (!this.imbusy)
  4191. {
  4192. this.imbusy = true;
  4193. this.ontrade = true;
  4194. this.chat_w.DisplayTextField.htmlText = (("<font color='#FF0000'>You are on Private Chat with " + name) + "!\n");
  4195. this.HisOffer.x = 145.7;
  4196. this.HisOffer.y = 193.05;
  4197. this.HisOffer.putcoins.coinstxt.text = "0";
  4198. this.HisOffer.putdice.dicetxt.text = "0";
  4199. this.HisOffer.putdice.visible = false;
  4200. this.HisOffer.putcoins.visible = false;
  4201. this.HisOffer.fbname.text = name;
  4202. this.HisOffer.hisoffer.gotoAndStop(item);
  4203. this.HisOffer.more1.add_btn.tabEnabled = false;
  4204. this.HisOffer.more1.minus_btn.tabEnabled = false;
  4205. this.HisOffer.more2.add_btn.tabEnabled = false;
  4206. this.HisOffer.more2.minus_btn.tabEnabled = false;
  4207. this.HisOffer.more3.add_btn.tabEnabled = false;
  4208. this.HisOffer.more3.minus_btn.tabEnabled = false;
  4209. this.HisOffer.more4.add_btn.tabEnabled = false;
  4210. this.HisOffer.more4.minus_btn.tabEnabled = false;
  4211. this.HisOffer.more5.add_btn.tabEnabled = false;
  4212. this.HisOffer.more5.minus_btn.tabEnabled = false;
  4213. this.HisOffer.more6.add_btn.tabEnabled = false;
  4214. this.HisOffer.more6.minus_btn.tabEnabled = false;
  4215. this.HisOffer.more1.visible = false;
  4216. this.HisOffer.more2.visible = false;
  4217. this.HisOffer.more3.visible = false;
  4218. this.HisOffer.more4.visible = false;
  4219. this.HisOffer.more5.visible = false;
  4220. this.HisOffer.more6.visible = false;
  4221. playid = id.split("fb");
  4222. fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
  4223. photo = new Loader();
  4224. photo.load(new URLRequest(fbpic));
  4225. this.HisOffer.picwhere.addChild(photo);
  4226. this.lobbyConnection.send("goOffer", id, item);
  4227. this.HisOffer.offer1.howmany.text = "";
  4228. this.HisOffer.offer2.howmany.text = "";
  4229. this.HisOffer.offer3.howmany.text = "";
  4230. this.HisOffer.offer4.howmany.text = "";
  4231. this.HisOffer.offer5.howmany.text = "";
  4232. this.HisOffer.offer6.howmany.text = "";
  4233. arr = "offer1,offer2,offer3,offer4,offer5,offer6";
  4234. ye = arr.split(",");
  4235. for (i in ye)
  4236. {
  4237. trace(ye[i]);
  4238. t = this.HisOffer.getChildByName(String(ye[i]));
  4239. t.addEventListener(MouseEvent.ROLL_OVER, this.mouseOverU);
  4240. t.addEventListener(MouseEvent.ROLL_OUT, this.mouseOutU);
  4241. };
  4242. this.HisOffer.offer1.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4243. if (((!(giveoffer)) && (imonoffer)))
  4244. {
  4245. giveoffer = true;
  4246. whichslot = "offer1";
  4247. loadinvent("allitems");
  4248. addminus();
  4249. };
  4250. });
  4251. this.HisOffer.offer2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4252. if (((!(giveoffer)) && (imonoffer)))
  4253. {
  4254. giveoffer = true;
  4255. whichslot = "offer2";
  4256. loadinvent("allitems");
  4257. addminus();
  4258. };
  4259. });
  4260. this.HisOffer.offer3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4261. if (((!(giveoffer)) && (imonoffer)))
  4262. {
  4263. giveoffer = true;
  4264. whichslot = "offer3";
  4265. loadinvent("allitems");
  4266. addminus();
  4267. };
  4268. });
  4269. this.HisOffer.offer4.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4270. if (((!(giveoffer)) && (imonoffer)))
  4271. {
  4272. giveoffer = true;
  4273. whichslot = "offer4";
  4274. loadinvent("allitems");
  4275. addminus();
  4276. };
  4277. });
  4278. this.HisOffer.offer5.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4279. if (((!(giveoffer)) && (imonoffer)))
  4280. {
  4281. giveoffer = true;
  4282. whichslot = "offer5";
  4283. loadinvent("allitems");
  4284. addminus();
  4285. };
  4286. });
  4287. this.HisOffer.offer6.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4288. if (((!(giveoffer)) && (imonoffer)))
  4289. {
  4290. giveoffer = true;
  4291. whichslot = "offer6";
  4292. loadinvent("allitems");
  4293. addminus();
  4294. };
  4295. });
  4296. this.HisOffer.coins_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4297. HisOffer.putcoins.visible = true;
  4298. HisOffer.putcoins.coinstxt.restrict = "0-9";
  4299. HisOffer.putcoins.coinstxt.text = "0";
  4300. HisOffer.putcoins.put_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4301. if ((((!(HisOffer.putcoins.coinstxt.text == "")) || (!(HisOffer.putcoins.coinstxt.text == " "))) || (!(HisOffer.putcoins.coinstxt.text == " "))))
  4302. {
  4303. if (int(HisOffer.putcoins.coinstxt.text) <= int(dbcoins))
  4304. {
  4305. trace(HisOffer.putcoins.coinstxt.text);
  4306. HisOffer.coinstxt.text = HisOffer.putcoins.coinstxt.text;
  4307. lobbyConnection.send("putCoins", int(HisOffer.putcoins.coinstxt.text), partnerid);
  4308. HisOffer.putcoins.visible = false;
  4309. addminus();
  4310. }
  4311. else
  4312. {
  4313. alert("you don't have this much coins");
  4314. };
  4315. }
  4316. else
  4317. {
  4318. alert("Invalid number");
  4319. };
  4320. });
  4321. });
  4322. this.HisOffer.dice_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4323. HisOffer.putdice.visible = true;
  4324. HisOffer.putdice.dicetxt.restrict = "0-9";
  4325. HisOffer.putdice.dicetxt.text = "0";
  4326. HisOffer.putdice.put_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4327. if ((((!(HisOffer.putdice.dicetxt.text == "")) || (!(HisOffer.putdice.dicetxt.text == " "))) || (!(HisOffer.putdice.dicetxt.text == " "))))
  4328. {
  4329. if (int(HisOffer.putdice.dicetxt.text) <= int(dbdice))
  4330. {
  4331. trace(HisOffer.putdice.dicetxt.text);
  4332. HisOffer.dicetxt.text = HisOffer.putdice.dicetxt.text;
  4333. lobbyConnection.send("putDice", int(HisOffer.putdice.dicetxt.text), partnerid);
  4334. HisOffer.putdice.visible = false;
  4335. addminus();
  4336. }
  4337. else
  4338. {
  4339. alert("You Don't own that much Token's :/");
  4340. };
  4341. }
  4342. else
  4343. {
  4344. alert("Invalid number");
  4345. };
  4346. });
  4347. });
  4348. this.HisOffer.leave_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4349. canadd = true;
  4350. ontrade = false;
  4351. lobbyConnection.send("byebye", partnerid);
  4352. hisOfferRefresh();
  4353. });
  4354. this.HisOffer.lock_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4355. var mySound:Sound;
  4356. mySound = new locksound();
  4357. mySound.play();
  4358. HisOffer.lockedmcc.visible = true;
  4359. HisOffer.lock_btn.visible = false;
  4360. lobbyConnection.send("ilock", partnerid);
  4361. });
  4362. };
  4363. }
  4364. private function goRoom(room:String):void{
  4365. if (this.multiisopen)
  4366. {
  4367. this.joining = true;
  4368. this.multiopen.blocks.visible = true;
  4369. trace(room);
  4370. this.TheClient.multiplayer.createJoinRoom(room, "VirtualRoom", true, {}, {
  4371. "fbname":this.fbname,
  4372. "fbuid":this.fbuid
  4373. }, this.VirtualLobby, this.handleError);
  4374. };
  4375. }
  4376. private function golobby2(room:String):void{
  4377. if (this.multiisopen)
  4378. {
  4379. this.joining = true;
  4380. this.multiopen.blocks.visible = true;
  4381. trace(room);
  4382. this.clickmeroom = room;
  4383. this.TheClient.multiplayer.createJoinRoom(room, "TradeRoom", true, {"room":room}, {
  4384. "fbname":this.fbname,
  4385. "fbuid":this.fbuid,
  4386. "pass":""
  4387. }, this.handleLobby2, this.handleError);
  4388. };
  4389. }
  4390. private function golobby(room:String):void{
  4391. if (this.multiisopen)
  4392. {
  4393. this.joining = true;
  4394. this.multiopen.blocks.visible = true;
  4395. trace(room);
  4396. this.MyRoom = room;
  4397. if ((((room == "a_plus") || (room == "b_plus")) || (room == "c_plus")))
  4398. {
  4399. this.plusmarket = true;
  4400. }
  4401. else
  4402. {
  4403. this.plusmarket = false;
  4404. };
  4405. this.TheClient.multiplayer.createJoinRoom(room, "TradeRoom", true, {}, {
  4406. "fbname":this.fbname,
  4407. "fbuid":this.fbuid,
  4408. "pass":this.pass
  4409. }, this.handleLobby, this.handleError);
  4410. };
  4411. }
  4412. public function resetOnlinePlayers():*{
  4413. var players:*;
  4414. players = 0;
  4415. if (currentFrame == 3)
  4416. {
  4417. players = 0;
  4418. while (players < this.playersArr.length)
  4419. {
  4420. this.playersArr[players].visible = false;
  4421. players++;
  4422. };
  4423. };
  4424. }
  4425. public function handleOnlinePlayers(m:Message):*{
  4426. var Name:String;
  4427. var pcard:*;
  4428. var actualLevel:String;
  4429. var players:*;
  4430. Name = "";
  4431. var Skins:* = 0;
  4432. actualLevel = null;
  4433. var id:Array;
  4434. this.resetOnlinePlayers();
  4435. players = 0;
  4436. while (players < m.length)
  4437. {
  4438. Name = m.getString(players);
  4439. Skins = ((players / 2) + 1);
  4440. pcard = new Skin(Name, this.TheClient);
  4441. pcard.y = (((75 * players) / 2) + 20);
  4442. this.onlinePlayers.players.addChild(pcard);
  4443. this.playersArr.push(pcard);
  4444. actualLevel = new String(Name);
  4445. id = actualLevel.split(";");
  4446. players++;
  4447. };
  4448. this._scrollbar = new Scrollbar();
  4449. this._scrollbar.init(this.onlinePlayers.players, this.onlinePlayers.contentMask, this.onlinePlayers.track, this.onlinePlayers.slider);
  4450. }
  4451. public function userClicked(id:String):void{
  4452. if (!this.infoopen)
  4453. {
  4454. this.openCard = new PlayerCard2();
  4455. addChild(this.openCard);
  4456. this.openCard.alpha = 0;
  4457. this.openCard.x = 368.25;
  4458. this.openCard.y = 197.55;
  4459. this.openCard.claninvite.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4460. TheConnection.send("claninvite", id);
  4461. });
  4462. this.openCard.clankick.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4463. TheConnection.send("clankick", id);
  4464. });
  4465. Tweener.addTween(this.openCard, {
  4466. "x":368.25,
  4467. "y":197.55,
  4468. "alpha":1,
  4469. "time":0.3,
  4470. "transition":"easeOutSine"
  4471. });
  4472. this.TheConnection.send("seeinfo", id);
  4473. this.infoopen = true;
  4474. };
  4475. }
  4476. private function AdminKey(e:KeyboardEvent):void{
  4477. var message:*;
  4478. if (((e.keyCode == 27) && (!(this.ChatTextField.text == ""))))
  4479. {
  4480. message = this.ChatTextField.text;
  4481. this.lobbyConnection.send("CMD", message);
  4482. this.ChatTextField.text = "";
  4483. message = "";
  4484. };
  4485. }
  4486. private function eventclickme(e:MouseEvent):void{
  4487. this.eventclickhere.clickhere_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4488. var myURL:URLRequest;
  4489. myURL = new URLRequest("https://www.facebook.com/groups/1701363410108212/");
  4490. navigateToURL(myURL, "_blank");
  4491. });
  4492. }
  4493. private function giftcodego(e:MouseEvent):void{
  4494. if (!this.giftcodeopen)
  4495. {
  4496. this.giftcodeopen = true;
  4497. this.giftcode = new GiftCode();
  4498. this.giftcode.x = 143.05;
  4499. this.giftcode.y = 122.05;
  4500. addChild(this.giftcode);
  4501. this.giftcode.gctxt.text = "";
  4502. this.giftcode.check_btn.tabEnabled = false;
  4503. this.giftcode.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4504. removeChild(e.target.parent);
  4505. giftcodeopen = false;
  4506. });
  4507. this.giftcode.check_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4508. if (giftcode.gctxt.text != "")
  4509. {
  4510. giftcode.loadbar.visible = true;
  4511. giftcode.check_btn.visible = false;
  4512. TheConnection.send("checkgc", giftcode.gctxt.text);
  4513. giftcode.gctxt.text = "";
  4514. };
  4515. });
  4516. };
  4517. }
  4518. private function KeyisDown22(e:KeyboardEvent):void{
  4519. var message:* = undefined;
  4520. var intervalId1:uint;
  4521. if (((e.keyCode == 13) && (!(this.ChatTextField.text == ""))))
  4522. {
  4523. if (this.canchat)
  4524. {
  4525. this.canchat = false;
  4526. this.chatlock.visible = true;
  4527. message = this.ChatTextField.text;
  4528. this.lobbyConnection.send("BroadcastMessage", message);
  4529. this.ChatTextField.text = "";
  4530. message = "";
  4531. intervalId1 = setTimeout(function ():*{
  4532. chatlock.visible = false;
  4533. canchat = true;
  4534. }, 5000);
  4535. };
  4536. };
  4537. }
  4538. private function KeyisDown(e:KeyboardEvent):void{
  4539. var message:* = undefined;
  4540. var intervalId1:uint;
  4541. var message2:* = undefined;
  4542. var intervalId:uint;
  4543. if (((e.keyCode == 13) && (!(this.ChatTextField.text == ""))))
  4544. {
  4545. trace(this.ontrade);
  4546. if (((this.ontrade == false) && (this.canchat)))
  4547. {
  4548. this.canchat = false;
  4549. this.chatlock.visible = true;
  4550. message = this.ChatTextField.text;
  4551. this.lobbyConnection.send("BroadcastMessage", message);
  4552. this.ChatTextField.text = "";
  4553. message = "";
  4554. intervalId1 = setTimeout(function ():*{
  4555. chatlock.visible = false;
  4556. canchat = true;
  4557. }, 5000);
  4558. };
  4559. if (((this.ontrade == true) && (this.canchat)))
  4560. {
  4561. this.canchat = false;
  4562. trace("private");
  4563. this.chatlock.visible = true;
  4564. message2 = this.ChatTextField.text;
  4565. this.lobbyConnection.send("PrivateMessage", message2, this.partnerid);
  4566. this.ChatTextField.text = "";
  4567. message = "";
  4568. intervalId = setTimeout(function ():*{
  4569. chatlock.visible = false;
  4570. canchat = true;
  4571. }, 5000);
  4572. };
  4573. };
  4574. }
  4575. private function openDshop(e:Event):void{
  4576. if (this.eButtons)
  4577. {
  4578. this.eButtons = false;
  4579. this.diceshop = new DiceShop();
  4580. this.diceshop.alpha = 0;
  4581. this.diceshop.x = 13.1;
  4582. this.diceshop.y = -90.75;
  4583. addChild(this.diceshop);
  4584. Tweener.addTween(this.diceshop, {
  4585. "x":13.1,
  4586. "y":-90.75,
  4587. "alpha":1,
  4588. "time":0.3,
  4589. "transition":"easeOutSine"
  4590. });
  4591. this.TheConnection.send("dshop");
  4592. this.diceshop.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4593. removeChild(e.target.parent);
  4594. eButtons = true;
  4595. TheConnection.send("loadplayer", fbuid, "newdb");
  4596. });
  4597. };
  4598. }
  4599. private function openPshop():void{
  4600. if (this.eButtons)
  4601. {
  4602. this.eButtons = false;
  4603. this.premshop = new PremiumShop();
  4604. this.premshop.x = 235.25;
  4605. this.premshop.y = 43.85;
  4606. addChild(this.premshop);
  4607. this._scrollbar = new Scrollbar();
  4608. this._scrollbar.init(this.premshop.content, this.premshop.contentMask, this.premshop.track, this.premshop.slider);
  4609. this.premshop.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4610. removeChild(e.target.parent);
  4611. eButtons = true;
  4612. });
  4613. this.premshop.content.vipskin.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4614. BuyPrem("vipskin", "VIP Access");
  4615. });
  4616. };
  4617. }
  4618. private function BuyPrem(theitem:String, details:String):void{
  4619. this.TheClient.payVault.getBuyDirectInfo("paypal", {
  4620. "currency":"USD",
  4621. "item_name":String(details)
  4622. }, [{"itemKey":String(theitem)}], function (info:Object):void{
  4623. navigateToURL(new URLRequest(info.paypalurl), "_blank");
  4624. }, function (e:PlayerIOError):void{
  4625. alert("Unable to buy item");
  4626. });
  4627. }
  4628. private function VirtualLobby(connection:Connection):void{
  4629. trace("Sucessfully connected to the multiplayer server");
  4630. gotoAndStop(4);
  4631. this.VirtualConnection = connection;
  4632. connection.addDisconnectHandler(this.handleDisconnect);
  4633. connection.addMessageHandler("hello", function (m:Message):*{
  4634. trace("Recived a message with the type hello from the server");
  4635. });
  4636. connection.addMessageHandler("UserJoined", function (m:Message, userid:uint):*{
  4637. trace("Player with the userid", userid, "just joined the room");
  4638. });
  4639. connection.addMessageHandler("UserLeft", function (m:Message, userid:uint):*{
  4640. trace("Player with the userid", userid, "just left the room");
  4641. });
  4642. connection.addMessageHandler("*", this.handleMessages);
  4643. }
  4644. private function handleLobby2(connection:Connection):void{
  4645. trace("Connected on Lobby");
  4646. this.lobbyConnection = connection;
  4647. gotoAndStop(5);
  4648. removeChild(this.myskin);
  4649. removeChild(this.multiopen);
  4650. this.lobname.text = this.clickmeroom;
  4651. stage.addEventListener(KeyboardEvent.KEY_DOWN, this.KeyisDown22);
  4652. connection.addMessageHandler("isBanned", function (m:Message, who:String):*{
  4653. if (who == fbuid)
  4654. {
  4655. gotoAndStop(4);
  4656. lobbyConnection.disconnect();
  4657. };
  4658. });
  4659. connection.addMessageHandler("UserJoined", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
  4660. });
  4661. connection.addMessageHandler("UserLeft", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
  4662. });
  4663. connection.addMessageHandler("BroadcastMessage", function (m:Message, ChatMessage:String):*{
  4664. var mySound88:Sound;
  4665. chat_w.DisplayTextField.htmlText = (chat_w.DisplayTextField.htmlText + (ChatMessage + "\n"));
  4666. chat_w.DisplayTextField.scrollV = chat_w.DisplayTextField.maxScrollV;
  4667. chat_w.DisplayTextField.condenseWhite = true;
  4668. mySound88 = new chatsound();
  4669. mySound88.play();
  4670. });
  4671. this.leave_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4672. lobbyConnection.send("iclose", fbuid, partnerid);
  4673. lobbyConnection.send("byebye", partnerid);
  4674. canchat = true;
  4675. eButtons = true;
  4676. joining = false;
  4677. multiisopen = false;
  4678. iwilloffer = false;
  4679. imonoffer = false;
  4680. lobbyConnection.disconnect();
  4681. partnerid = "";
  4682. ontrade = false;
  4683. letsStart();
  4684. });
  4685. connection.addMessageHandler("*", this.handleMessages);
  4686. this.usersList.setStyle("upSkin", new MovieClip());
  4687. this.usersContainer = new MovieClip();
  4688. this.usersList.source = this.usersContainer;
  4689. connection.addDisconnectHandler(this.handleDisconnect);
  4690. }
  4691. private function handleLobby(connection:Connection):void{
  4692. trace("Connected on Trading Lobby");
  4693. this.lobbyConnection = connection;
  4694. gotoAndStop(3);
  4695. if (this.MyRoom == "normal_a")
  4696. {
  4697. this.Coolzone.gotoAndStop(1);
  4698. }
  4699. else
  4700. {
  4701. if (this.MyRoom == "normal_b")
  4702. {
  4703. this.Coolzone.gotoAndStop(2);
  4704. }
  4705. else
  4706. {
  4707. if (this.MyRoom == "normal_c")
  4708. {
  4709. this.Coolzone.gotoAndStop(3);
  4710. }
  4711. else
  4712. {
  4713. if (this.MyRoom == "normal_d")
  4714. {
  4715. this.Coolzone.gotoAndStop(4);
  4716. }
  4717. else
  4718. {
  4719. if (this.MyRoom == "normal_e")
  4720. {
  4721. this.Coolzone.gotoAndStop(5);
  4722. }
  4723. else
  4724. {
  4725. if (this.MyRoom == "normal_f")
  4726. {
  4727. this.Coolzone.gotoAndStop(6);
  4728. }
  4729. else
  4730. {
  4731. if (this.MyRoom == "a_plus")
  4732. {
  4733. this.Coolzone.gotoAndStop(7);
  4734. }
  4735. else
  4736. {
  4737. if (this.MyRoom == "b_plus")
  4738. {
  4739. this.Coolzone.gotoAndStop(8);
  4740. }
  4741. else
  4742. {
  4743. if (this.MyRoom == "c_plus")
  4744. {
  4745. this.Coolzone.gotoAndStop(9);
  4746. };
  4747. };
  4748. };
  4749. };
  4750. };
  4751. };
  4752. };
  4753. };
  4754. };
  4755. this.clickopen.panel_btn.tabEnabled = false;
  4756. this.Herehere.visible = false;
  4757. if (this.dblevel == 11)
  4758. {
  4759. this.Herehere.visible = true;
  4760. this.clickopen.panel_btn.visible = true;
  4761. this.clickopen.panel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4762. if (!panelop)
  4763. {
  4764. panelop = true;
  4765. panel = new PANEL();
  4766. panel.x = 114.6;
  4767. panel.y = 99.05;
  4768. addChild(panel);
  4769. Tweener.addTween(panel, {
  4770. "x":114.6,
  4771. "y":99.05,
  4772. "time":0.3,
  4773. "transition":"easeOutSine"
  4774. });
  4775. panel.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4776. if (panelop)
  4777. {
  4778. panelop = false;
  4779. removeChild(panel);
  4780. };
  4781. });
  4782. panel.auth_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4783. panel.loadme.visible = true;
  4784. panel.auth_btn.visible = false;
  4785. if (panel.pswtxt.text == "adminlog")
  4786. {
  4787. lobbyConnection.send("adminLogin");
  4788. }
  4789. else
  4790. {
  4791. alert("Wrong pass");
  4792. panel.loadme.visible = false;
  4793. panel.auth_btn.visible = true;
  4794. };
  4795. });
  4796. };
  4797. });
  4798. };
  4799. this.coinstxt.text = String(this.dbcoins);
  4800. this.dicetxt.text = String(this.dbdice);
  4801. removeChild(this.multiopen);
  4802. this.makeoffer.tabEnabled = false;
  4803. this.closeoffer.tabEnabled = false;
  4804. this.MyOffer.deal_btn.tabEnabled = false;
  4805. this.MyOffer.kick_btn.tabEnabled = false;
  4806. this.MyOffer.unlock_btn.tabEnabled = false;
  4807. this.HisOffer.lock_btn.tabEnabled = false;
  4808. this.HisOffer.leave_btn.tabEnabled = false;
  4809. this.fullscreen_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4810. if (fullscreen == false)
  4811. {
  4812. stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
  4813. fullscreen = true;
  4814. trace("fullscreen");
  4815. }
  4816. else
  4817. {
  4818. if (fullscreen == true)
  4819. {
  4820. stage.displayState = StageDisplayState.NORMAL;
  4821. fullscreen = false;
  4822. trace("not fullscreen");
  4823. };
  4824. };
  4825. });
  4826. this.quality_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4827. if (myquality == "high")
  4828. {
  4829. stage.quality = StageQuality.LOW;
  4830. myquality = "low";
  4831. trace("low quality");
  4832. }
  4833. else
  4834. {
  4835. if (myquality == "low")
  4836. {
  4837. stage.quality = StageQuality.BEST;
  4838. myquality = "high";
  4839. trace("high quality");
  4840. };
  4841. };
  4842. });
  4843. this.mute_btn.addEventListener(MouseEvent.CLICK, function ():*{
  4844. if (sounds == false)
  4845. {
  4846. sounds = true;
  4847. trace(sounds);
  4848. mute_btn.gotoAndStop(2);
  4849. issPlaying = false;
  4850. lastPosition = myChannel.position;
  4851. myChannel.stop();
  4852. }
  4853. else
  4854. {
  4855. if (issPlaying == false)
  4856. {
  4857. issPlaying = true;
  4858. myChannel = myMusic.play(lastPosition);
  4859. };
  4860. sounds = false;
  4861. trace(sounds);
  4862. mute_btn.gotoAndStop(1);
  4863. };
  4864. });
  4865. this.giftcode_btn.addEventListener(MouseEvent.CLICK, this.giftcodego);
  4866. this.eventclickhere.addEventListener(MouseEvent.CLICK, this.eventclickme);
  4867. this.makeoffer.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4868. if (((!(iwilloffer)) && (!(imonoffer))))
  4869. {
  4870. iwilloffer = true;
  4871. loadinvent("allitems");
  4872. makeoffer.visible = false;
  4873. if (dealload != null)
  4874. {
  4875. removeChild(dealload);
  4876. };
  4877. };
  4878. });
  4879. this.clickopen.openmc.addEventListener(MouseEvent.MOUSE_OVER, function (e:MouseEvent):void{
  4880. var callback:Function;
  4881. var callback2:Function;
  4882. if (clickopen.x != 0)
  4883. {
  4884. callback = function ():*{
  4885. clickopen.openmc.gotoAndStop(2);
  4886. };
  4887. Tweener.addTween(clickopen, {
  4888. "x":0,
  4889. "time":0.3,
  4890. "transition":"easeOutSine",
  4891. "onComplete":callback
  4892. });
  4893. }
  4894. else
  4895. {
  4896. callback2 = function ():*{
  4897. clickopen.openmc.gotoAndStop(1);
  4898. };
  4899. Tweener.addTween(clickopen, {
  4900. "x":-114.6,
  4901. "time":0.3,
  4902. "transition":"easeOutSine",
  4903. "onComplete":callback2
  4904. });
  4905. };
  4906. });
  4907. this.storage_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4908. if (!isstorage)
  4909. {
  4910. isstorage = true;
  4911. storage = new Storage();
  4912. storage.x = 155.45;
  4913. storage.y = 88.95;
  4914. storage.alpha = 0;
  4915. addChild(storage);
  4916. TheConnection.send("loadstorage");
  4917. storage.collectd_btn.tabEnabled = false;
  4918. storage.collectc_btn.tabEnabled = false;
  4919. Tweener.addTween(storage, {
  4920. "x":155.45,
  4921. "y":88.95,
  4922. "alpha":1,
  4923. "time":0.3,
  4924. "transition":"easeOutSine"
  4925. });
  4926. storage.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4927. removeChild(e.target.parent);
  4928. isstorage = false;
  4929. dicecount.stop();
  4930. dicecounting = false;
  4931. coinscounting = false;
  4932. coinscount.stop();
  4933. });
  4934. };
  4935. });
  4936. stage.addEventListener(KeyboardEvent.KEY_DOWN, this.KeyisDown);
  4937. stage.addEventListener(KeyboardEvent.KEY_DOWN, this.AdminKey);
  4938. this.leave_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4939. lobbyConnection.send("iclose", fbuid, partnerid);
  4940. lobbyConnection.send("byebye", partnerid);
  4941. canchat = true;
  4942. eButtons = true;
  4943. joining = false;
  4944. multiisopen = false;
  4945. iwilloffer = false;
  4946. imonoffer = false;
  4947. lobbyConnection.disconnect();
  4948. partnerid = "";
  4949. ontrade = false;
  4950. letsStart();
  4951. });
  4952. this.offersList.setStyle("upSkin", new MovieClip());
  4953. this.offersContainer = new MovieClip();
  4954. this.offersList.source = this.offersContainer;
  4955. connection.addDisconnectHandler(this.handleDisconnect);
  4956. connection.addMessageHandler("hello", function (m:Message):*{
  4957. trace("Recived a message with the type hello from the server");
  4958. });
  4959. connection.addMessageHandler("UserJoined", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
  4960. updateOffer(offers);
  4961. Online.text = String(howmany);
  4962. if (!imhere)
  4963. {
  4964. imhere = true;
  4965. lobbyConnection.send("here");
  4966. };
  4967. });
  4968. connection.addMessageHandler("alert2", function (m:Message, who:String, mess:String):*{
  4969. if (who == ("fb" + fbur))
  4970. {
  4971. alert(String(mess));
  4972. }
  4973. else
  4974. {
  4975. if (who == "all")
  4976. {
  4977. showmsg.mymsg.text = String(mess);
  4978. showmsg.rec.gotoAndPlay(2);
  4979. };
  4980. };
  4981. });
  4982. connection.addMessageHandler("math", function (m:Message, who:String, whattheitem:String, howmany:int):*{
  4983. showmsg.mymsg.text = String(who);
  4984. showmsg.gotoAndStop(2);
  4985. showmsg.theitem.gotoAndStop(String(whattheitem));
  4986. showmsg.theitem.howmany.text = int(howmany);
  4987. showmsg.answer.text = "";
  4988. showmsg.enter_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  4989. trace(showmsg.answer.text);
  4990. lobbyConnection.send("myanswer", showmsg.answer.text);
  4991. showmsg.gotoAndStop(1);
  4992. });
  4993. });
  4994. connection.addMessageHandler("closemath", function (m:Message, who:String):*{
  4995. showmsg.gotoAndStop(1);
  4996. });
  4997. connection.addMessageHandler("playersOnline", function (m:Message):*{
  4998. handleOnlinePlayers(m);
  4999. trace(m);
  5000. });
  5001. connection.addMessageHandler("heoffered", function (m:Message, isitme:String, whoishe:String, whichslotz:String, whattheitem:String):*{
  5002. var rex:RegExp;
  5003. var det:String;
  5004. var det2:String;
  5005. var mySound:Sound;
  5006. rex = /[\s\r\n]+/gim;
  5007. det = isitme;
  5008. det2 = partnerid;
  5009. det = det.replace(rex, "");
  5010. det2 = det2.replace(rex, "");
  5011. if (((("fb" + fbuid) == det) && (det2 == whoishe)))
  5012. {
  5013. mySound = new pck();
  5014. if (whichslotz == "offer1")
  5015. {
  5016. MyOffer.hisoffer1.gotoAndStop(String(whattheitem));
  5017. MyOffer.hisoffer1.howmany.text = "";
  5018. };
  5019. if (whichslotz == "offer2")
  5020. {
  5021. MyOffer.hisoffer2.gotoAndStop(String(whattheitem));
  5022. MyOffer.hisoffer2.howmany.text = "";
  5023. };
  5024. if (whichslotz == "offer3")
  5025. {
  5026. MyOffer.hisoffer3.gotoAndStop(String(whattheitem));
  5027. MyOffer.hisoffer3.howmany.text = "";
  5028. };
  5029. if (whichslotz == "offer4")
  5030. {
  5031. MyOffer.hisoffer4.gotoAndStop(String(whattheitem));
  5032. MyOffer.hisoffer4.howmany.text = "";
  5033. };
  5034. if (whichslotz == "offer5")
  5035. {
  5036. MyOffer.hisoffer5.gotoAndStop(String(whattheitem));
  5037. MyOffer.hisoffer5.howmany.text = "";
  5038. };
  5039. if (whichslotz == "offer6")
  5040. {
  5041. MyOffer.hisoffer6.gotoAndStop(String(whattheitem));
  5042. MyOffer.hisoffer6.howmany.text = "";
  5043. };
  5044. };
  5045. });
  5046. connection.addMessageHandler("UserLeft", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
  5047. updateOffer(offers);
  5048. Online.text = String(howmany);
  5049. });
  5050. connection.addMessageHandler("helock", function (m:Message, isitme:String, whoishe:String):*{
  5051. var rex:RegExp;
  5052. var det:String;
  5053. var det2:String;
  5054. var mySound:Sound;
  5055. rex = /[\s\r\n]+/gim;
  5056. det = isitme;
  5057. det2 = partnerid;
  5058. det = det.replace(rex, "");
  5059. det2 = det2.replace(rex, "");
  5060. if (((("fb" + fbuid) == det) && (det2 == partnerid)))
  5061. {
  5062. MyOffer.lockedmcc.visible = true;
  5063. MyOffer.deal_btn.visible = true;
  5064. MyOffer.unlock_btn.visible = true;
  5065. MyOffer.unlock_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5066. var mySound:Sound;
  5067. mySound = new locksound();
  5068. mySound.play();
  5069. if (MyOffer.lockedmcc.visible)
  5070. {
  5071. MyOffer.lockedmcc.visible = false;
  5072. MyOffer.deal_btn.visible = false;
  5073. MyOffer.unlock_btn.visible = false;
  5074. lobbyConnection.send("iunlock", partnerid);
  5075. };
  5076. });
  5077. MyOffer.deal_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5078. var mySound:Sound;
  5079. mySound = new button();
  5080. mySound.play();
  5081. if (MyOffer.lockedmcc.visible)
  5082. {
  5083. myOfferRefresh();
  5084. dealload = new DealLoad();
  5085. dealload.x = 0;
  5086. dealload.y = 0;
  5087. dealload.width = 650;
  5088. dealload.height = 450;
  5089. addChild(dealload);
  5090. lobbyConnection.send("ideal", partnerid, fbuid);
  5091. };
  5092. });
  5093. mySound = new locksound();
  5094. mySound.play();
  5095. };
  5096. });
  5097. connection.addMessageHandler("dealsuccess", function (m:Message, isitme:String, whoishe:String):*{
  5098. var mySound:Sound;
  5099. var mySound2:Sound;
  5100. trace("Dealed");
  5101. trace(("isitme:" + isitme));
  5102. trace(whoishe);
  5103. trace((("this is me: " + "fb") + fbuid));
  5104. if (((("fb" + fbuid) == isitme) && (partnerid == whoishe)))
  5105. {
  5106. var callback:Function = function ():*{
  5107. removeChild(deal);
  5108. };
  5109. canadd = true;
  5110. ontrade = false;
  5111. mySound = new success_sound();
  5112. mySound.play();
  5113. deal = new Deal();
  5114. deal.width = 235;
  5115. deal.height = 90;
  5116. deal.x = 325;
  5117. deal.y = 225;
  5118. addChild(deal);
  5119. partnerid = "";
  5120. if (dealload != null)
  5121. {
  5122. removeChild(dealload);
  5123. };
  5124. lobbyConnection.send("imdone");
  5125. hisOfferRefresh();
  5126. TheConnection.send("loadplayer", fbuid, "newdb");
  5127. };
  5128. if (((("fb" + fbuid) == whoishe) && (isitme == partnerid)))
  5129. {
  5130. var callback2:Function = function ():*{
  5131. removeChild(deal);
  5132. };
  5133. canadd = true;
  5134. ontrade = false;
  5135. mySound2 = new success_sound();
  5136. mySound2.play();
  5137. deal = new Deal();
  5138. deal.width = 235;
  5139. deal.height = 90;
  5140. deal.x = 325;
  5141. deal.y = 225;
  5142. addChild(deal);
  5143. partnerid = "";
  5144. removeChild(dealload);
  5145. TheConnection.send("loadplayer", fbuid, "newdb");
  5146. };
  5147. });
  5148. connection.addMessageHandler("hedeal", function (m:Message, isitme:String, whoishe:String):*{
  5149. var rex:RegExp;
  5150. var det:String;
  5151. var det2:String;
  5152. rex = /[\s\r\n]+/gim;
  5153. det = isitme;
  5154. det2 = whoishe;
  5155. det = det.replace(rex, "");
  5156. det2 = det2.replace(rex, "");
  5157. if (((("fb" + fbuid) == det) && (det2 == partnerid)))
  5158. {
  5159. ontrade = false;
  5160. dealload = new DealLoad();
  5161. dealload.x = 0;
  5162. dealload.y = 0;
  5163. dealload.width = 650;
  5164. dealload.height = 450;
  5165. addChild(dealload);
  5166. HisOffer.x = -500;
  5167. HisOffer.y = -500;
  5168. HisOffer.fbname.text = "";
  5169. HisOffer.hisoffer.gotoAndStop("none");
  5170. HisOffer.offer1.gotoAndStop("none");
  5171. HisOffer.offer2.gotoAndStop("none");
  5172. HisOffer.offer3.gotoAndStop("none");
  5173. HisOffer.offer4.gotoAndStop("none");
  5174. HisOffer.offer5.gotoAndStop("none");
  5175. HisOffer.offer6.gotoAndStop("none");
  5176. HisOffer.lock_btn.visible = true;
  5177. HisOffer.lockedmcc.visible = false;
  5178. HisOffer.putcoins.visible = false;
  5179. HisOffer.putdice.visible = false;
  5180. HisOffer.putcoins.coinstxt.text = "0";
  5181. HisOffer.putdice.dicetxt.text = "0";
  5182. imbusy = false;
  5183. imonoffer = false;
  5184. };
  5185. });
  5186. connection.addMessageHandler("heunlock", function (m:Message, isitme:String, whoishe:String):*{
  5187. var rex:RegExp;
  5188. var det:String;
  5189. var det2:String;
  5190. rex = /[\s\r\n]+/gim;
  5191. det = isitme;
  5192. det2 = whoishe;
  5193. det = det.replace(rex, "");
  5194. det2 = det2.replace(rex, "");
  5195. if (((("fb" + fbuid) == det) && (det2 == partnerid)))
  5196. {
  5197. canadd = true;
  5198. HisOffer.lockedmcc.visible = false;
  5199. HisOffer.lock_btn.visible = true;
  5200. };
  5201. });
  5202. connection.addMessageHandler("BroadcastMessage", function (m:Message, ChatMessage:String):*{
  5203. var mySound88:Sound;
  5204. if (!ontrade)
  5205. {
  5206. chat_w.DisplayTextField.htmlText = (chat_w.DisplayTextField.htmlText + (ChatMessage + "\n"));
  5207. chat_w.DisplayTextField.scrollV = chat_w.DisplayTextField.maxScrollV;
  5208. chat_w.DisplayTextField.condenseWhite = true;
  5209. mySound88 = new chatsound();
  5210. mySound88.play();
  5211. };
  5212. });
  5213. connection.addMessageHandler("PrivateMessage", function (m:Message, ChatMessage:String, partner:String):*{
  5214. var mySound88:Sound;
  5215. trace(("Someone talked:" + ChatMessage));
  5216. trace(("who? = " + partner));
  5217. if (((partner == ("fb" + fbuid)) || (partner == partnerid)))
  5218. {
  5219. chat_w.DisplayTextField.htmlText = (chat_w.DisplayTextField.htmlText + (ChatMessage + "\n"));
  5220. chat_w.DisplayTextField.scrollV = chat_w.DisplayTextField.maxScrollV;
  5221. chat_w.DisplayTextField.condenseWhite = true;
  5222. mySound88 = new chatsound();
  5223. mySound88.play();
  5224. };
  5225. });
  5226. connection.addMessageHandler("leaveyah", function (m:Message, isitme:String, hisid:String):*{
  5227. var rex:RegExp;
  5228. var det:String;
  5229. var det2:String;
  5230. rex = /[\s\r\n]+/gim;
  5231. det = isitme;
  5232. det = det.replace(rex, "");
  5233. det2 = hisid;
  5234. det2 = det2.replace(rex, "");
  5235. if (((("fb" + fbuid) == det) && (partnerid == det2)))
  5236. {
  5237. ontrade = false;
  5238. MyOffer.fbname.text = "";
  5239. MyOffer.picwhere.alpha = 0;
  5240. MyOffer.kick_btn.visible = false;
  5241. MyOffer.unlock_btn.visible = false;
  5242. MyOffer.deal_btn.visible = false;
  5243. MyOffer.lockedmcc.visible = false;
  5244. MyOffer.hisoffer1.gotoAndStop("none");
  5245. MyOffer.hisoffer2.gotoAndStop("none");
  5246. MyOffer.hisoffer3.gotoAndStop("none");
  5247. MyOffer.hisoffer4.gotoAndStop("none");
  5248. MyOffer.hisoffer5.gotoAndStop("none");
  5249. MyOffer.hisoffer6.gotoAndStop("none");
  5250. MyOffer.hisoffer1.howmany.text = "";
  5251. MyOffer.hisoffer2.howmany.text = "";
  5252. MyOffer.hisoffer3.howmany.text = "";
  5253. MyOffer.hisoffer4.howmany.text = "";
  5254. MyOffer.hisoffer5.howmany.text = "";
  5255. MyOffer.hisoffer6.howmany.text = "";
  5256. MyOffer.unlock_btn.visible = false;
  5257. MyOffer.deal_btn.visible = false;
  5258. MyOffer.lockedmcc.visible = false;
  5259. MyOffer.coinstxt.text = "0";
  5260. MyOffer.dicetxt.text = "0";
  5261. lobbyConnection.send("backtonormal");
  5262. imbusy = false;
  5263. partnerid = "";
  5264. };
  5265. });
  5266. connection.addMessageHandler("UserLeft", function (m:Message, userid:uint):*{
  5267. trace("Player with the userid", userid, "just left the room");
  5268. });
  5269. connection.addMessageHandler("*", this.handleMessages);
  5270. }
  5271. private function showInventory():void{
  5272. var met:Array;
  5273. var i:* = undefined;
  5274. var t:DisplayObject;
  5275. if (this.eButtons)
  5276. {
  5277. this.eButtons = false;
  5278. this.inventoryopen = new InventoryOpen();
  5279. this.inventoryopen.alpha = 0;
  5280. this.inventoryopen.x = 125.05;
  5281. this.inventoryopen.y = 24.7;
  5282. this.inventoryopen.coinstxt.text = String(this.dbcoins);
  5283. this.inventoryopen.dicetxt.text = String(this.dbdice);
  5284. addChild(this.inventoryopen);
  5285. Tweener.addTween(this.inventoryopen, {
  5286. "x":125.05,
  5287. "y":24.7,
  5288. "alpha":1,
  5289. "time":0.3,
  5290. "transition":"easeOutSine"
  5291. });
  5292. trace(this.gotmemepack);
  5293. if (this.gotmemepack)
  5294. {
  5295. this.inventoryopen.herepacks.visible = true;
  5296. this.inventoryopen.herepacks.memepack.visible = true;
  5297. this.inventoryopen.herepacks.memepack.item.gotoAndStop("memeset");
  5298. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5299. this.inventoryopen.herepacks.memepack.unpack_btn.tabEnabled = false;
  5300. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5301. inventoryopen.herepacks.visible = false;
  5302. });
  5303. this.inventoryopen.herepacks.memepack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5304. inventoryopen.herepacks.close_btn.visible = false;
  5305. inventoryopen.herepacks.memepack.unpack_btn.visible = false;
  5306. inventoryopen.herepacks.memepack.loading.visible = true;
  5307. unpack("memeset");
  5308. });
  5309. };
  5310. trace(this.gotdwset);
  5311. if (this.gotdwset)
  5312. {
  5313. this.inventoryopen.herepacks.visible = true;
  5314. this.inventoryopen.herepacks.dwset.visible = true;
  5315. this.inventoryopen.herepacks.dwset.item.gotoAndStop("dwset");
  5316. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5317. this.inventoryopen.herepacks.dwset.unpack_btn.tabEnabled = false;
  5318. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5319. inventoryopen.herepacks.visible = false;
  5320. });
  5321. this.inventoryopen.herepacks.dwset.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5322. inventoryopen.herepacks.close_btn.visible = false;
  5323. inventoryopen.herepacks.dwset.unpack_btn.visible = false;
  5324. inventoryopen.herepacks.dwset.loading.visible = true;
  5325. unpack("dwset");
  5326. });
  5327. };
  5328. trace(this.gotswagset);
  5329. if (this.gotswagset)
  5330. {
  5331. this.inventoryopen.herepacks.visible = true;
  5332. this.inventoryopen.herepacks.swagset.visible = true;
  5333. this.inventoryopen.herepacks.swagset.item.gotoAndStop("swagset");
  5334. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5335. this.inventoryopen.herepacks.swagset.unpack_btn.tabEnabled = false;
  5336. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5337. inventoryopen.herepacks.visible = false;
  5338. });
  5339. this.inventoryopen.herepacks.swagset.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5340. inventoryopen.herepacks.close_btn.visible = false;
  5341. inventoryopen.herepacks.swagset.unpack_btn.visible = false;
  5342. inventoryopen.herepacks.swagset.loading.visible = true;
  5343. unpack("swagset");
  5344. });
  5345. };
  5346. trace(this.gotdarkpack);
  5347. if (this.gotdarkpack)
  5348. {
  5349. this.inventoryopen.herepacks.visible = true;
  5350. this.inventoryopen.herepacks.darkpack.visible = true;
  5351. this.inventoryopen.herepacks.darkpack.item.gotoAndStop("darkpack");
  5352. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5353. this.inventoryopen.herepacks.darkpack.unpack_btn.tabEnabled = false;
  5354. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5355. inventoryopen.herepacks.visible = false;
  5356. });
  5357. this.inventoryopen.herepacks.darkpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5358. inventoryopen.herepacks.close_btn.visible = false;
  5359. inventoryopen.herepacks.darkpack.unpack_btn.visible = false;
  5360. inventoryopen.herepacks.darkpack.loading.visible = true;
  5361. unpack("darkpack");
  5362. });
  5363. };
  5364. trace(this.gotspeedpack);
  5365. if (this.gotspeedpack)
  5366. {
  5367. this.inventoryopen.herepacks.visible = true;
  5368. this.inventoryopen.herepacks.speedpack.visible = true;
  5369. this.inventoryopen.herepacks.speedpack.item.gotoAndStop("speedpack");
  5370. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5371. this.inventoryopen.herepacks.speedpack.unpack_btn.tabEnabled = false;
  5372. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5373. inventoryopen.herepacks.visible = false;
  5374. });
  5375. this.inventoryopen.herepacks.speedpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5376. inventoryopen.herepacks.close_btn.visible = false;
  5377. inventoryopen.herepacks.speedpack.unpack_btn.visible = false;
  5378. inventoryopen.herepacks.speedpack.loading.visible = true;
  5379. unpack("speedpack");
  5380. });
  5381. };
  5382. trace(this.gotdealbgpack);
  5383. if (this.gotdealbgpack)
  5384. {
  5385. this.inventoryopen.herepacks.visible = true;
  5386. this.inventoryopen.herepacks.dealbgpack.visible = true;
  5387. this.inventoryopen.herepacks.dealbgpack.item.gotoAndStop("dealbgpack");
  5388. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5389. this.inventoryopen.herepacks.dealbgpack.unpack_btn.tabEnabled = false;
  5390. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5391. inventoryopen.herepacks.visible = false;
  5392. });
  5393. this.inventoryopen.herepacks.dealbgpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5394. inventoryopen.herepacks.close_btn.visible = false;
  5395. inventoryopen.herepacks.dealbgpack.unpack_btn.visible = false;
  5396. inventoryopen.herepacks.dealbgpack.loading.visible = true;
  5397. unpack("dealbgpack");
  5398. });
  5399. };
  5400. trace(this.gotwlpack);
  5401. if (this.gotwlpack)
  5402. {
  5403. this.inventoryopen.herepacks.visible = true;
  5404. this.inventoryopen.herepacks.wlpack.visible = true;
  5405. this.inventoryopen.herepacks.wlpack.item.gotoAndStop("wlpack");
  5406. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5407. this.inventoryopen.herepacks.wlpack.unpack_btn.tabEnabled = false;
  5408. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5409. inventoryopen.herepacks.visible = false;
  5410. });
  5411. this.inventoryopen.herepacks.wlpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5412. inventoryopen.herepacks.close_btn.visible = false;
  5413. inventoryopen.herepacks.wlpack.unpack_btn.visible = false;
  5414. inventoryopen.herepacks.wlpack.loading.visible = true;
  5415. unpack("wlpack");
  5416. });
  5417. };
  5418. trace(this.gotrainbowpack);
  5419. if (this.gotrainbowpack)
  5420. {
  5421. this.inventoryopen.herepacks.visible = true;
  5422. this.inventoryopen.herepacks.rainbowpack.visible = true;
  5423. this.inventoryopen.herepacks.rainbowpack.item.gotoAndStop("rainbowpack");
  5424. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5425. this.inventoryopen.herepacks.rainbowpack.unpack_btn.tabEnabled = false;
  5426. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5427. inventoryopen.herepacks.visible = false;
  5428. });
  5429. this.inventoryopen.herepacks.rainbowpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5430. inventoryopen.herepacks.close_btn.visible = false;
  5431. inventoryopen.herepacks.rainbowpack.unpack_btn.visible = false;
  5432. inventoryopen.herepacks.rainbowpack.loading.visible = true;
  5433. unpack("rainbowpack");
  5434. });
  5435. };
  5436. trace(this.gotnewyearpack);
  5437. if (this.gotnewyearpack)
  5438. {
  5439. this.inventoryopen.herepacks.visible = true;
  5440. this.inventoryopen.herepacks.newyearpack.visible = true;
  5441. this.inventoryopen.herepacks.newyearpack.item.gotoAndStop("newyearpack");
  5442. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5443. this.inventoryopen.herepacks.newyearpack.unpack_btn.tabEnabled = false;
  5444. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5445. inventoryopen.herepacks.visible = false;
  5446. });
  5447. this.inventoryopen.herepacks.newyearpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5448. inventoryopen.herepacks.close_btn.visible = false;
  5449. inventoryopen.herepacks.rainbowpack.unpack_btn.visible = false;
  5450. inventoryopen.herepacks.rainbowpack.loading.visible = true;
  5451. unpack("newyearpack");
  5452. });
  5453. };
  5454. trace(this.gotredpack);
  5455. if (this.gotredpack)
  5456. {
  5457. this.inventoryopen.herepacks.visible = true;
  5458. this.inventoryopen.herepacks.redpack.visible = true;
  5459. this.inventoryopen.herepacks.redpack.item.gotoAndStop("redpack");
  5460. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5461. this.inventoryopen.herepacks.redpack.unpack_btn.tabEnabled = false;
  5462. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5463. inventoryopen.herepacks.visible = false;
  5464. });
  5465. this.inventoryopen.herepacks.redpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5466. inventoryopen.herepacks.close_btn.visible = false;
  5467. inventoryopen.herepacks.redpack.unpack_btn.visible = false;
  5468. inventoryopen.herepacks.redpack.loading.visible = true;
  5469. unpack("redpack");
  5470. });
  5471. };
  5472. trace(this.gotnovapack);
  5473. if (this.gotnovapack)
  5474. {
  5475. this.inventoryopen.herepacks.visible = true;
  5476. this.inventoryopen.herepacks.novapack.visible = true;
  5477. this.inventoryopen.herepacks.novapack.item.gotoAndStop("novapack");
  5478. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5479. this.inventoryopen.herepacks.novapack.unpack_btn.tabEnabled = false;
  5480. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5481. inventoryopen.herepacks.visible = false;
  5482. });
  5483. this.inventoryopen.herepacks.novapack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5484. inventoryopen.herepacks.close_btn.visible = false;
  5485. inventoryopen.herepacks.novapack.unpack_btn.visible = false;
  5486. inventoryopen.herepacks.novapack.loading.visible = true;
  5487. unpack("novapack");
  5488. });
  5489. };
  5490. trace(this.gotcrystalpack);
  5491. if (this.gotcrystalpack)
  5492. {
  5493. this.inventoryopen.herepacks.visible = true;
  5494. this.inventoryopen.herepacks.crystalpack.visible = true;
  5495. this.inventoryopen.herepacks.crystalpack.item.gotoAndStop("crystalpack");
  5496. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5497. this.inventoryopen.herepacks.crystalpack.unpack_btn.tabEnabled = false;
  5498. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5499. inventoryopen.herepacks.visible = false;
  5500. });
  5501. this.inventoryopen.herepacks.crystalpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5502. inventoryopen.herepacks.close_btn.visible = false;
  5503. inventoryopen.herepacks.crystalpack.unpack_btn.visible = false;
  5504. inventoryopen.herepacks.crystalpack.loading.visible = true;
  5505. unpack("crystalpack");
  5506. });
  5507. };
  5508. trace(this.gotrarepack);
  5509. if (this.gotrarepack)
  5510. {
  5511. this.inventoryopen.herepacks.visible = true;
  5512. this.inventoryopen.herepacks.rarepack.visible = true;
  5513. this.inventoryopen.herepacks.rarepack.item.gotoAndStop("rarepack");
  5514. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5515. this.inventoryopen.herepacks.rarepack.unpack_btn.tabEnabled = false;
  5516. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5517. inventoryopen.herepacks.visible = false;
  5518. });
  5519. this.inventoryopen.herepacks.rarepack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5520. inventoryopen.herepacks.close_btn.visible = false;
  5521. inventoryopen.herepacks.rarepack.unpack_btn.visible = false;
  5522. inventoryopen.herepacks.rarepack.loading.visible = true;
  5523. unpack("rarepack");
  5524. });
  5525. };
  5526. trace(this.gotmilionerpack);
  5527. if (this.gotmilionerpack)
  5528. {
  5529. this.inventoryopen.herepacks.visible = true;
  5530. this.inventoryopen.herepacks.milionerpack.visible = true;
  5531. this.inventoryopen.herepacks.milionerpack.item.gotoAndStop("milionerpack");
  5532. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5533. this.inventoryopen.herepacks.milionerpack.unpack_btn.tabEnabled = false;
  5534. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5535. inventoryopen.herepacks.visible = false;
  5536. });
  5537. this.inventoryopen.herepacks.milionerpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5538. inventoryopen.herepacks.close_btn.visible = false;
  5539. inventoryopen.herepacks.milionerpack.unpack_btn.visible = false;
  5540. inventoryopen.herepacks.milionerpack.loading.visible = true;
  5541. unpack("milionerpack");
  5542. });
  5543. };
  5544. trace(this.gotnvpack);
  5545. if (this.gotnvpack)
  5546. {
  5547. this.inventoryopen.herepacks.visible = true;
  5548. this.inventoryopen.herepacks.nvpack.visible = true;
  5549. this.inventoryopen.herepacks.nvpack.item.gotoAndStop("nvpack");
  5550. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5551. this.inventoryopen.herepacks.nvpack.unpack_btn.tabEnabled = false;
  5552. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5553. inventoryopen.herepacks.visible = false;
  5554. });
  5555. this.inventoryopen.herepacks.nvpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5556. inventoryopen.herepacks.close_btn.visible = false;
  5557. inventoryopen.herepacks.nvpack.unpack_btn.visible = false;
  5558. inventoryopen.herepacks.nvpack.loading.visible = true;
  5559. unpack("nvpack");
  5560. });
  5561. };
  5562. trace(this.gotcupidpack);
  5563. if (this.gotcupidpack)
  5564. {
  5565. this.inventoryopen.herepacks.visible = true;
  5566. this.inventoryopen.herepacks.cupidpack.visible = true;
  5567. this.inventoryopen.herepacks.cupidpack.item.gotoAndStop("cupidpack");
  5568. this.inventoryopen.herepacks.close_btn.tabEnabled = false;
  5569. this.inventoryopen.herepacks.cupidpack.unpack_btn.tabEnabled = false;
  5570. this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5571. inventoryopen.herepacks.visible = false;
  5572. });
  5573. this.inventoryopen.herepacks.cupidpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5574. inventoryopen.herepacks.close_btn.visible = false;
  5575. inventoryopen.herepacks.cupidpack.unpack_btn.visible = false;
  5576. inventoryopen.herepacks.cupidpack.loading.visible = true;
  5577. unpack("cupidpack");
  5578. });
  5579. };
  5580. this.inventoryopen.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5581. if (cancloseinventory)
  5582. {
  5583. TheConnection.send("loadplayer", fbuid, "newdb");
  5584. removeChild(MovieClip(e.target.parent));
  5585. eButtons = true;
  5586. };
  5587. });
  5588. this.inventoryopen.medrag.addEventListener(MouseEvent.MOUSE_DOWN, function (e:MouseEvent):void{
  5589. inventoryopen.startDrag();
  5590. });
  5591. this.inventoryopen.headr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5592. TheConnection.send("changesuit", "none", "head");
  5593. inventoryopen.headitem.gotoAndStop("none");
  5594. inventoryopen.stickman.toparea.head.gotoAndStop("none");
  5595. });
  5596. this.inventoryopen.eyesr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5597. TheConnection.send("changesuit", "none", "eyes");
  5598. inventoryopen.eyesitem.gotoAndStop("none");
  5599. inventoryopen.stickman.toparea.eyes.gotoAndStop("none");
  5600. });
  5601. this.inventoryopen.mouthr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5602. TheConnection.send("changesuit", "none", "mouth");
  5603. inventoryopen.mouthitem.gotoAndStop("none");
  5604. inventoryopen.stickman.toparea.mouth.gotoAndStop("none");
  5605. });
  5606. this.inventoryopen.handr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5607. TheConnection.send("changesuit", "none", "hands");
  5608. inventoryopen.handitem.gotoAndStop("none");
  5609. inventoryopen.stickman.toparea.hands.gotoAndStop("none");
  5610. });
  5611. this.inventoryopen.shoesr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5612. TheConnection.send("changesuit", "none", "foot");
  5613. inventoryopen.footitem.gotoAndStop("none");
  5614. inventoryopen.stickman.toparea.feet.gotoAndStop("none");
  5615. });
  5616. this.inventoryopen.wingsr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5617. TheConnection.send("changesuit", "none", "wings");
  5618. inventoryopen.wingsitem.gotoAndStop("none");
  5619. inventoryopen.stickman.toparea.wings.gotoAndStop("none");
  5620. });
  5621. this.inventoryopen.charr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5622. TheConnection.send("changesuit", "none", "charcolor");
  5623. inventoryopen.charcoloritem.gotoAndStop("none");
  5624. inventoryopen.stickman.toparea.charcolor.gotoAndStop("none");
  5625. inventoryopen.stickman.middle.charcolor.gotoAndStop("none");
  5626. inventoryopen.stickman.bottomarea.charcolor.gotoAndStop("none");
  5627. });
  5628. this.inventoryopen.medrag.addEventListener(MouseEvent.MOUSE_UP, function (e:MouseEvent):void{
  5629. inventoryopen.stopDrag();
  5630. });
  5631. this.inventoryopen.blockMC.visible = false;
  5632. met = ["skinitem", "headitem", "eyesitem", "mouthitem", "footitem", "skinitem", "handitem", "dealitem", "wingsitem", "charcoloritem"];
  5633. for (i in met)
  5634. {
  5635. t = this.inventoryopen.getChildByName(String(met[i]));
  5636. t.addEventListener(MouseEvent.ROLL_OVER, this.mouseOverI);
  5637. t.addEventListener(MouseEvent.ROLL_OUT, this.mouseOutI);
  5638. };
  5639. this.inventoryopen.stickman.toparea.head.gotoAndStop(this.dbhead);
  5640. this.inventoryopen.stickman.toparea.hands.gotoAndStop(this.dbhands);
  5641. this.inventoryopen.stickman.toparea.eyes.gotoAndStop(this.dbeyes);
  5642. this.inventoryopen.stickman.toparea.feet.gotoAndStop(this.dbfoot);
  5643. this.inventoryopen.stickman.toparea.wings.gotoAndStop(this.dbwings);
  5644. this.inventoryopen.stickman.toparea.charcolor.gotoAndStop(this.dbcharcolor);
  5645. this.inventoryopen.stickman.middle.charcolor.gotoAndStop(this.dbcharcolor);
  5646. this.inventoryopen.stickman.bottomarea.charcolor.gotoAndStop(this.dbcharcolor);
  5647. this.inventoryopen.headitem.gotoAndStop(String(this.dbhead));
  5648. this.inventoryopen.eyesitem.gotoAndStop(String(this.dbeyes));
  5649. this.inventoryopen.mouthitem.gotoAndStop(String(this.dbmouth));
  5650. this.inventoryopen.handitem.gotoAndStop(String(this.dbhands));
  5651. this.inventoryopen.footitem.gotoAndStop(String(this.dbfoot));
  5652. this.inventoryopen.wingsitem.gotoAndStop(String(this.dbwings));
  5653. this.inventoryopen.charcoloritem.gotoAndStop(String(this.dbcharcolor));
  5654. this.inventoryopen.dealitem.gotoAndStop(String(this.dbdealbg));
  5655. this.inventoryopen.skinitem.addEventListener(MouseEvent.CLICK, this.skinclick);
  5656. this.inventoryopen.dealitem.addEventListener(MouseEvent.CLICK, this.dealbgclick);
  5657. this.inventoryopen.headitem.addEventListener(MouseEvent.CLICK, this.headclick);
  5658. this.inventoryopen.eyesitem.addEventListener(MouseEvent.CLICK, this.eyesclick);
  5659. this.inventoryopen.mouthitem.addEventListener(MouseEvent.CLICK, this.mouthclick);
  5660. this.inventoryopen.handitem.addEventListener(MouseEvent.CLICK, this.handsclick);
  5661. this.inventoryopen.footitem.addEventListener(MouseEvent.CLICK, this.footclick);
  5662. this.inventoryopen.wingsitem.addEventListener(MouseEvent.CLICK, this.wingsclick);
  5663. this.inventoryopen.charcoloritem.addEventListener(MouseEvent.CLICK, this.charcolorclick);
  5664. this.inventoryopen.skinitem.gotoAndStop(String(this.dbskin));
  5665. };
  5666. }
  5667. private function unpack(item:String):void{
  5668. if (!this.unpacking)
  5669. {
  5670. this.unpacking = true;
  5671. this.TheConnection.send("task", "unpack", item);
  5672. };
  5673. }
  5674. private function loadinvent(which:String):void{
  5675. if (!this.openeditems)
  5676. {
  5677. trace(which);
  5678. this.openeditems = true;
  5679. this.TheConnection.send("myitems", this.fbuid, which);
  5680. this.items = new Items();
  5681. this.items.x = 419.35;
  5682. this.items.y = 167.9;
  5683. this.items.alpha = 0;
  5684. addChild(this.items);
  5685. if ((((((((((which == "head") || (which == "eyes")) || (which == "dealbg")) || (which == "skin")) || (which == "mouth")) || (which == "foot")) || (which == "hands")) || (which == "wings")) || (which == "charcolor")))
  5686. {
  5687. this.items.classestxt.visible = false;
  5688. this.items.normal_btn.visible = false;
  5689. this.items.prem_btn.visible = false;
  5690. this.items.rare_btn.visible = false;
  5691. this.items.ultra_btn.visible = false;
  5692. this.items.special_btn.visible = false;
  5693. };
  5694. if (which == "normals")
  5695. {
  5696. this.items.normal_btn.gotoAndStop(2);
  5697. };
  5698. if (which == "prems")
  5699. {
  5700. this.items.prem_btn.gotoAndStop(2);
  5701. };
  5702. if (which == "rares")
  5703. {
  5704. this.items.rare_btn.gotoAndStop(2);
  5705. };
  5706. if (which == "ultras")
  5707. {
  5708. this.items.ultra_btn.gotoAndStop(2);
  5709. };
  5710. if (which == "specials")
  5711. {
  5712. this.items.special_btn.gotoAndStop(2);
  5713. };
  5714. Tweener.addTween(this.items, {
  5715. "x":419.35,
  5716. "y":167.9,
  5717. "alpha":1,
  5718. "time":0.3,
  5719. "transition":"easeOutSine"
  5720. });
  5721. this.items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
  5722. if (!cancloseinventory)
  5723. {
  5724. removeChild(MovieClip(e.target.parent));
  5725. cancloseinventory = true;
  5726. openeditems = false;
  5727. inventoryopen.blockMC.visible = false;
  5728. changeSkin = false;
  5729. changehead = false;
  5730. changemouth = false;
  5731. changeeyes = false;
  5732. changehands = false;
  5733. changefoot = false;
  5734. changewings = false;
  5735. changecharcolor = false;
  5736. changedealbg = false;
  5737. };
  5738. if (((currentFrame == 3) && (iwilloffer)))
  5739. {
  5740. removeChild(MovieClip(e.target.parent));
  5741. makeoffer.visible = true;
  5742. openeditems = false;
  5743. iwilloffer = false;
  5744. };
  5745. if (((currentFrame == 3) && (giveoffer == true)))
  5746. {
  5747. removeChild(MovieClip(e.target.parent));
  5748. openeditems = false;
  5749. giveoffer = false;
  5750. whichslot = "";
  5751. };
  5752. });
  5753. };
  5754. }
  5755. private function disablechange():void{
  5756. if (!this.cancloseinventory)
  5757. {
  5758. this.inventoryopen.blockMC.visible = true;
  5759. };
  5760. }
  5761. private function headclick(e:MouseEvent):void{
  5762. this.cancloseinventory = false;
  5763. this.loadinvent("head");
  5764. this.disablechange();
  5765. this.changehead = true;
  5766. }
  5767. private function mouthclick(e:MouseEvent):void{
  5768. this.cancloseinventory = false;
  5769. this.loadinvent("mouth");
  5770. this.disablechange();
  5771. this.changemouth = true;
  5772. }
  5773. private function skinclick(e:MouseEvent):void{
  5774. this.cancloseinventory = false;
  5775. this.loadinvent("skin");
  5776. this.disablechange();
  5777. this.changeSkin = true;
  5778. }
  5779. private function dealbgclick(e:MouseEvent):void{
  5780. this.cancloseinventory = false;
  5781. this.loadinvent("dealbg");
  5782. this.disablechange();
  5783. this.changedealbg = true;
  5784. }
  5785. private function eyesclick(e:MouseEvent):void{
  5786. this.cancloseinventory = false;
  5787. this.loadinvent("eyes");
  5788. this.disablechange();
  5789. this.changeeyes = true;
  5790. }
  5791. private function handsclick(e:MouseEvent):void{
  5792. this.cancloseinventory = false;
  5793. this.loadinvent("hands");
  5794. this.disablechange();
  5795. this.changehands = true;
  5796. }
  5797. private function footclick(e:MouseEvent):void{
  5798. this.cancloseinventory = false;
  5799. this.loadinvent("foot");
  5800. this.disablechange();
  5801. this.changefoot = true;
  5802. }
  5803. private function wingsclick(e:MouseEvent):void{
  5804. this.cancloseinventory = false;
  5805. this.loadinvent("wings");
  5806. this.disablechange();
  5807. this.changewings = true;
  5808. }
  5809. private function charcolorclick(e:MouseEvent):void{
  5810. this.cancloseinventory = false;
  5811. this.loadinvent("charcolor");
  5812. this.disablechange();
  5813. this.changecharcolor = true;
  5814. }
  5815. private function mouseOverU(e:MouseEvent):void{
  5816. var mySound:Sound;
  5817. mySound = new blub2();
  5818. mySound.play();
  5819. Tweener.addTween(MovieClip(e.currentTarget), {
  5820. "scaleX":1,
  5821. "scaleY":1.2,
  5822. "time":0.1,
  5823. "transition":"easeInSine"
  5824. });
  5825. }
  5826. private function mouseOutU(e:MouseEvent):void{
  5827. Tweener.addTween(MovieClip(e.currentTarget), {
  5828. "scaleX":0.851119995117188,
  5829. "scaleY":1.02371215820313,
  5830. "time":0.3,
  5831. "transition":"easeInSine"
  5832. });
  5833. }
  5834. private function mouseOverI(e:MouseEvent):void{
  5835. Tweener.addTween(MovieClip(e.currentTarget), {
  5836. "scaleX":1,
  5837. "scaleY":1,
  5838. "time":0.1,
  5839. "transition":"easeInSine"
  5840. });
  5841. }
  5842. private function mouseOutI(e:MouseEvent):void{
  5843. Tweener.addTween(MovieClip(e.currentTarget), {
  5844. "scaleX":0.8,
  5845. "scaleY":0.8,
  5846. "time":0.3,
  5847. "transition":"easeInSine"
  5848. });
  5849. }
  5850. private function changeskin(theskin:String):void{
  5851. this.TheConnection.send("changeskin", theskin);
  5852. this.dbskin = theskin;
  5853. this.newp.visible = false;
  5854. this.dbhead = "none";
  5855. this.dbeyes = "none";
  5856. this.dbmouth = "none";
  5857. this.dbhands = "none";
  5858. this.dbfoot = "none";
  5859. this.dbwings = "none";
  5860. this.dbcharcolor = "none";
  5861. this.dbcoins = 0;
  5862. this.dbdice = 0;
  5863. this.dblevel = 1;
  5864. this.dbxp = 0;
  5865. this.letsStart();
  5866. }
  5867. private function handleDisconnect():void{
  5868. this.alert("Disconnected");
  5869. gotoAndStop(5);
  5870. }
  5871. private function handleError(error:PlayerIOError):void{
  5872. this.alert(String(error));
  5873. }
  5874. internal function frame3():*{
  5875. this.groupgo.addEventListener(MouseEvent.CLICK, this.fl_ClickToGoToWebPage);
  5876. this.pagego.addEventListener(MouseEvent.CLICK, this.fl_ClickToGoToWebPage_4);
  5877. this.gotonovak.addEventListener(MouseEvent.CLICK, this.fl_ClickToGoToWebPage_6);
  5878. stop();
  5879. }
  5880.  
  5881. }
  5882. }//package
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement