Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package {
- import flash.display.MovieClip;
- import flash.display.SimpleButton;
- import flash.text.TextField;
- import fl.containers.ScrollPane;
- import __AS3__.vec.Vector;
- import flash.display.Sprite;
- import flash.display.Shape;
- import com.freeactionscript.Scrollbar;
- import flash.utils.Timer;
- import flash.media.Sound;
- import flash.media.SoundChannel;
- import flash.net.navigateToURL;
- import flash.net.URLRequest;
- import flash.events.ContextMenuEvent;
- import flash.system.Security;
- import flash.ui.ContextMenu;
- import flash.ui.ContextMenuItem;
- import flash.net.URLLoader;
- import flash.events.Event;
- import playerio.PlayerIO;
- import flash.events.MouseEvent;
- import flash.geom.Point;
- import playerio.Client;
- import flash.events.KeyboardEvent;
- import flash.ui.Keyboard;
- import playerio.Message;
- import flash.display.Loader;
- import playerio.Connection;
- import flash.media.SoundTransform;
- import caurina.transitions.Tweener;
- import flash.events.TimerEvent;
- import flash.utils.setTimeout;
- import flash.external.ExternalInterface;
- import flash.display.StageDisplayState;
- import flash.display.StageQuality;
- import playerio.DatabaseObject;
- import flash.display.LoaderInfo;
- import flash.display.DisplayObject;
- import playerio.PlayerIOError;
- import flash.display.*;
- import flash.utils.*;
- import playerio.*;
- import flash.events.*;
- import caurina.transitions.*;
- import __AS3__.vec.*;
- import flash.net.*;
- import flash.media.*;
- import flash.text.*;
- import flash.ui.*;
- import com.facebook.graph.*;
- import Facebook.*;
- import fl.transitions.easing.*;
- public class MyGame extends MovieClip {
- internal const gravity:Number = 1.5;
- internal const dist_btw_obstacles:Number = 300;
- internal const ob_speed:Number = 8;
- internal const jump_force:Number = 15;
- public var clickopen:MovieClip;
- public var newp:MovieClip;
- public var single_btn:SimpleButton;
- public var Inventory_btn:MovieClip;
- public var snow_btn:SimpleButton;
- public var loadbar:MovieClip;
- public var aligator_Layer:MovieClip;
- public var coinstxt:TextField;
- public var multiplayer_btn:SimpleButton;
- public var lottery_btn:SimpleButton;
- public var slot_btn:SimpleButton;
- public var storage_btn:SimpleButton;
- public var MyOffer:MovieClip;
- public var countryskin:MovieClip;
- public var player:MovieClip;
- public var countUP:MovieClip;
- public var showmsg:MovieClip;
- public var makeoffer:SimpleButton;
- public var psw:TextField;
- public var score_txt:TextField;
- public var onlinePlayers:MovieClip;
- public var eventclickhere:MovieClip;
- public var jellyFishLayers:MovieClip;
- public var Online:TextField;
- public var giftcode_btn:SimpleButton;
- public var ChatTextField:TextField;
- public var usersList:ScrollPane;
- public var HisOffer:MovieClip;
- public var pain:MovieClip;
- public var pagego:SimpleButton;
- public var closeoffer:SimpleButton;
- public var loadtxt:TextField;
- public var GameOver:MovieClip;
- public var lobname:TextField;
- public var allshop_btn:SimpleButton;
- public var mute_btn:MovieClip;
- public var solid1:MovieClip;
- public var reason:TextField;
- public var dicetxt:TextField;
- public var alltop10_btn:SimpleButton;
- public var quality_btn:SimpleButton;
- public var preloader:MovieClip;
- public var fishLayers:MovieClip;
- public var thepic:MovieClip;
- public var offersList:ScrollPane;
- public var gotonovak:SimpleButton;
- public var leave_btn:SimpleButton;
- public var exchange_btn:SimpleButton;
- public var clan_btn:SimpleButton;
- public var fullscreen_btn:SimpleButton;
- public var chatlock:MovieClip;
- public var Coolzone:MovieClip;
- public var minigames_btn:SimpleButton;
- public var warning:Warning;
- public var mystats:MySkin;
- public var groupgo:SimpleButton;
- public var birdplayer:BirdPlayer;
- public var lastob:Obstacle;
- public var obstacles:Array;
- public var yspeed:Number = 0;
- public var openCard:PlayerCard2;
- public var clan:Clans;
- public var minigame:playminigames;
- public var alltops10:Tops10;
- public var exchanges:GetTokens;
- public var openallshop:OpenShop;
- public var rankshopopen:RankShop;
- public var cashshopopen:CashShop;
- public var ultrashopopen:UltraShop;
- private var speed:Number = 0;
- private var paddles:Vector.<Sprite>;
- private var line:Shape;
- private var lastPaddle:String;
- private var fbname:String = "";
- public var fbuid:String = "";
- public var fbur:String = "";
- private var token:String = "";
- private var TheClient:*;
- private var TheConnection:*;
- private var MultiConnection:*;
- private var lobbyConnection:*;
- private var alertnow:AlertNow;
- private var dbskin:String = "blue";
- private var dbhead:String = "none";
- private var dbeyes:String = "none";
- private var dbmouth:String = "none";
- private var dbhands:String = "none";
- private var dbfoot:String = "none";
- private var dbdealbg:String = "none";
- private var dbwings:String = "none";
- private var dbcharcolor:String = "none";
- private var MyRoom:String = "";
- private var dbcoins:int = 0;
- private var dbdice:int = 0;
- private var dblevel:int = 1;
- private var dbxp:int = 0;
- private var currDB:Boolean = false;
- private var newps:Boolean = false;
- private var queue:Array;
- private var count:int = 0;
- private var data:Array;
- private var gtmc:gToken_MC;
- private var startPositionY:Number = 140;
- private var endPositionX:Number = 647;
- private var buttonDisplayDelay:int = 1;
- private var myskin:MySkin;
- private var eButtons:Boolean = true;
- private var inventoryopen:InventoryOpen;
- private var _i:Object;
- private var cancloseinventory:Boolean = true;
- private var items:Items;
- private var openeditems:Boolean = false;
- private var changemouth:Boolean = false;
- private var changehead:Boolean = false;
- private var changeeyes:Boolean = false;
- private var changehands:Boolean = false;
- private var changefoot:Boolean = false;
- private var changewings:Boolean = false;
- private var changecharcolor:Boolean = false;
- private var changeSkin:Boolean = false;
- private var multiopen:MultiOpen;
- private var multiisopen:Boolean = false;
- private var joining:Boolean = false;
- private var usersContainer:MovieClip;
- private var _scrollbar:Scrollbar;
- private var iwilloffer:Boolean = false;
- private var offered:Offered;
- private var partnerid:String = "";
- private var imonoffer:Boolean = false;
- private var imbusy:Boolean = false;
- private var offersContainer:MovieClip;
- private var giveoffer:Boolean = false;
- private var whichslot:String = "";
- private var deal:Deal;
- private var dealload:DealLoad;
- private var infoopen:Boolean = false;
- private var clickedid:String = "";
- private var shopopen:ShopOpen;
- private var isshopopen:Boolean = false;
- private var searchp:SearchPlayer;
- private var issearch:Boolean = false;
- private var myquality:* = "high";
- private var fullscreen:Boolean = false;
- private var ontrade:Boolean = false;
- private var snowing:* = true;
- private var giftcodeopen:Boolean = false;
- private var giftcode:GiftCode;
- private var premshop:PremiumShop;
- private var gotmemepack:Boolean = false;
- private var gotshadespack:Boolean = false;
- private var unpacking:Boolean = false;
- private var successunpack:SuccessUnpack;
- private var ready:Ready;
- private var myopponent:String = "";
- private var multiId:String = "";
- private var iam:String = "";
- private var i:int = 0;
- private var cancontrol:Boolean = false;
- private var _playerSpeed:Number = 4;
- private var _movingUp:Boolean = false;
- private var _movingDown:Boolean = false;
- private var _movingLeft:Boolean = false;
- private var _movingRight:Boolean = false;
- private var VirtualConnection:*;
- private var lottery:Lottery;
- private var pass:String = "1082001sk";
- private var thegift:TheGift;
- private var canadd:Boolean = true;
- private var imhere:Boolean = false;
- private var canchat:Boolean = true;
- private var onsee:Boolean = false;
- private var clickedname:String = "";
- private var diceshop:DiceShop;
- private var showmc:ShowMC;
- private var rep:Boolean = true;
- private var changedealbg:Boolean = false;
- private var more:Boolean = false;
- private var topcoins:TopCoins;
- private var slotmachine:SlotMachine;
- private var machine:Boolean = false;
- private var spinning:Boolean = false;
- private var isstorage:Boolean = false;
- private var storage:Storage;
- private var dicecount:Timer;
- private var coinscount:Timer;
- private var dicecounting:Boolean = false;
- private var coinscounting:Boolean = false;
- private var topitems:TOPITEMS;
- private var more2:Boolean = false;
- private var sounds:Boolean = false;
- private var panelop:Boolean = false;
- private var panel:PANEL;
- private var ondel:Boolean = false;
- private var onadd:Boolean = false;
- private var plusmarket:Boolean = false;
- private var clickmeroom:String = "";
- private var mySound:Sound;
- private var myChannel:SoundChannel;
- private var mySound2:Sound;
- private var myChannel2:SoundChannel;
- public var myMusic:Object;
- public var lastPosition:Number;
- public var enemyArr:Array;
- public var enWall:MovieClip;
- public var enBall:MovieClip;
- public var intervalForAdding:uint;
- public var intervalIntervalForAdding:uint;
- public var enemySpeed:uint;
- public var dead:Boolean = false;
- public var booming:Boolean = false;
- public var enBallInterval:uint;
- public var enBallIntervalForAdding:uint;
- public var score:* = 0;
- public var CountFinish:* = 0;
- internal var keys:Array;
- public var issPlaying:* = true;
- public var Herehere:MovieClip;
- private var my_player:Object;
- private var my_player3:Object;
- private var larged:Boolean = false;
- public var chat_w:MovieClip;
- public var scoretxt:TextField;
- public var playersArr:Array;
- private var gotdwset:Boolean = false;
- private var gotswagset:Boolean = false;
- private var gotdarkpack:Boolean = false;
- private var gotspeedpack:Boolean = false;
- private var gotdealbgpack:Boolean = false;
- private var gotwlpack:Boolean = false;
- private var gotrainbowpack:Boolean = false;
- private var gotnewyearpack:Boolean = false;
- private var gotredpack:Boolean = false;
- private var gotnovapack:Boolean = false;
- private var gotcrystalpack:Boolean = false;
- private var gotrarepack:Boolean = false;
- private var gotmilionerpack:Boolean = false;
- private var gotnvpack:Boolean = false;
- private var gotcupidpack:Boolean = false;
- public function MyGame(){
- var openLink:Function;
- this.birdplayer = new BirdPlayer();
- this.lastob = new Obstacle();
- this.obstacles = new Array();
- this.paddles = new Vector.<Sprite>();
- this.keys = [];
- super();
- openLink = function (e:ContextMenuEvent):void{
- navigateToURL(new URLRequest("https://www.facebook.com/profile.php?id=100011068337039"));
- };
- addFrameScript(2, this.frame3);
- Security.allowDomain("www.youtube.com");
- this.playersArr = [];
- this.token = ((root.loaderInfo.parameters.fb_access_token) || ("your access"));
- var config:* = ("https://graph.facebook.com/me?access_token=" + this.token);
- Security.allowDomain("*");
- var MyGame:ContextMenu = new ContextMenu();
- MyGame.hideBuiltInItems();
- var my_notice:* = new ContextMenuItem("Yahiaoui Fedi");
- var my_email:* = new ContextMenuItem("YahiaouiFedi@gmail.com");
- var my_copyright:* = new ContextMenuItem("Yahiaoui Fedi");
- my_copyright.enabled = false;
- my_copyright.separatorBefore = true;
- my_notice.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openLink);
- MyGame.customItems.push(my_notice, my_email, my_copyright);
- contextMenu = MyGame;
- var url:* = new URLRequest(config);
- var urlr:* = new URLLoader();
- urlr.load(url);
- urlr.addEventListener(Event.COMPLETE, this.getName);
- stop();
- this.myMusic = new Mainsound();
- this.myChannel = new SoundChannel();
- this.lastPosition = 0;
- if (((!(this.token == null)) && (!(this.token == ""))))
- {
- PlayerIO.quickConnect.facebookOAuthConnect(stage, "confederate-countryballs-tgooxlm15eiai4yaobbq", this.token, "", this.connectfb, function ():void{
- alert("Error connecting to facebook");
- });
- }
- else
- {
- this.alert("facebook error");
- };
- addEventListener(Event.ADDED_TO_STAGE, this.__setPerspectiveProjection_);
- }
- public function fl_ClickToGoToWebPage(event:MouseEvent):void{
- navigateToURL(new URLRequest("https://www.facebook.com/groups/1676492532602411/"), "_Blank");
- }
- public function fl_ClickToGoToWebPage_4(event:MouseEvent):void{
- navigateToURL(new URLRequest("https://www.facebook.com/Official.TarekTetoo/"), "_Blank");
- }
- public function fl_ClickToGoToWebPage_6(event:MouseEvent):void{
- navigateToURL(new URLRequest("https://www.facebook.com/novakdaboss/"), "_Blank");
- }
- public function __setPerspectiveProjection_(evt:Event):void{
- root.transform.perspectiveProjection.fieldOfView = 40;
- root.transform.perspectiveProjection.projectionCenter = new Point(350, 250);
- }
- private function connectfb(client:Client, fbid:String):void{
- this.fbuid = fbid;
- this.TheClient = client;
- client.multiplayer.createJoinRoom(("fb" + this.fbuid), "MyCode", true, {}, {
- "fbname":this.fbname,
- "fbuid":this.fbuid
- }, this.handleJoin, this.handleError);
- }
- public function alert(mess:String):void{
- this.alertnow = new AlertNow();
- this.alertnow.x = 325;
- this.alertnow.y = 225;
- addChild(this.alertnow);
- this.alertnow.inner.message.text = String(mess);
- this.alertnow.understood.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(MovieClip(e.target.parent));
- });
- }
- internal function startfly():void{
- this.birdplayer = new BirdPlayer();
- this.lastob = new Obstacle();
- this.obstacles = new Array();
- this.yspeed = 0;
- this.birdplayer.x = (stage.stageWidth / 2);
- this.birdplayer.y = (stage.stageHeight / 2);
- addChild(this.birdplayer);
- this.createObstacle();
- this.createObstacle();
- this.createObstacle();
- addEventListener(Event.ENTER_FRAME, this.onEnterFrameHandler);
- stage.addEventListener(KeyboardEvent.KEY_UP, this.key_up);
- }
- private function key_up(event:KeyboardEvent):*{
- if (event.keyCode == Keyboard.SPACE)
- {
- this.yspeed = -(this.jump_force);
- };
- }
- internal function restart():*{
- if (contains(this.birdplayer))
- {
- removeChild(this.birdplayer);
- };
- var i:int;
- while (i < this.obstacles.length)
- {
- if (((contains(this.obstacles[i])) && (!(this.obstacles[i] == null))))
- {
- removeChild(this.obstacles[i]);
- };
- this.obstacles[i] = null;
- i++;
- };
- this.obstacles.slice(0);
- this.startfly();
- }
- internal function onEnterFrameHandler(event:Event):*{
- this.yspeed = (this.yspeed + this.gravity);
- this.birdplayer.y = (this.birdplayer.y + this.yspeed);
- if ((this.birdplayer.y + (this.birdplayer.height / 2)) > stage.stageHeight)
- {
- this.restart();
- };
- if ((this.birdplayer.y - (this.birdplayer.height / 2)) < 0)
- {
- this.birdplayer.y = (this.birdplayer.height / 2);
- };
- var i:int;
- while (i < this.obstacles.length)
- {
- this.updateObstacle(i);
- i++;
- };
- }
- internal function updateObstacle(i:int):*{
- var ob:Obstacle = this.obstacles[i];
- if (ob == null)
- {
- return;
- };
- ob.x = (ob.x - this.ob_speed);
- if (ob.x < -(ob.width))
- {
- this.changeObstacle(ob);
- };
- 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))))
- {
- this.restart();
- };
- }
- internal function changeObstacle(ob:Obstacle):*{
- ob.x = (this.lastob.x + this.dist_btw_obstacles);
- ob.y = (100 + (Math.random() * (stage.stageHeight - 200)));
- this.lastob = ob;
- ob.covered = false;
- }
- internal function createObstacle():*{
- var ob:Obstacle = new Obstacle();
- if (this.lastob.x == 0)
- {
- ob.x = 800;
- }
- else
- {
- ob.x = (this.lastob.x + this.dist_btw_obstacles);
- };
- ob.y = (100 + (Math.random() * (stage.stageHeight - 200)));
- addChild(ob);
- this.obstacles.push(ob);
- this.lastob = ob;
- }
- private function loadbuzz():void{
- }
- private function handleJoin(connection:Connection):void{
- this.TheConnection = connection;
- connection.addDisconnectHandler(this.handleDisconnect);
- connection.addMessageHandler("hello", function (m:Message):*{
- trace("Recived a message with the type hello from the server");
- });
- connection.addMessageHandler("hisdet", function (m:Message, pid:String, pname:String, pon:Boolean, ponl:Boolean):*{
- var lol:* = undefined;
- var _loc_1:* = undefined;
- var photo2:* = undefined;
- if (issearch == true)
- {
- searchp.loading.visible = false;
- searchp.find_btn.visible = true;
- searchp.hisinfo.visible = true;
- searchp.hisinfo.hisname.text = pname;
- searchp.hisinfo.hisid.text = pid;
- if (pon == true)
- {
- searchp.hisinfo.online_mc.gotoAndStop(2);
- };
- if (ponl == true)
- {
- searchp.hisinfo.onlobby_mc.gotoAndStop(2);
- };
- lol = pid.split("fb");
- _loc_1 = (("https://graph.facebook.com/" + String(lol[1])) + "/picture");
- photo2 = new Loader();
- photo2.load(new URLRequest(_loc_1));
- photo2.x = searchp.hisinfo.picwhere.x;
- photo2.y = searchp.hisinfo.picwhere.y;
- searchp.hisinfo.addChild(photo2);
- searchp.hisinfo.copy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- ChatTextField.appendText(searchp.hisinfo.hisid.text);
- });
- searchp.hisinfo.fb_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var him:Array = searchp.hisinfo.hisid.text.split("fb");
- var myURL:URLRequest = new URLRequest(("https://www.facebook.com/" + String(him[1])));
- navigateToURL(myURL, "_blank");
- });
- };
- });
- connection.addMessageHandler("UserJoined", function (m:Message, fbid:String, name:String):*{
- if (((!(fbname == name)) || (!(fbid == ("fb" + fbuid)))))
- {
- gotoAndStop(2);
- alert("Something went wrong, please refresh");
- warning.visible = true;
- }
- else
- {
- if (((currDB) && (!(newp))))
- {
- TheConnection.send("loadplayer", fbuid, "menu");
- };
- };
- });
- connection.addMessageHandler("UserLeft", function (m:Message, fbid:String):*{
- trace("Player with the userid", fbid, "just left the room");
- });
- connection.addMessageHandler("*", this.handleMessages);
- }
- private function again2(e:Event):void{
- this.mySound2 = new Sound();
- this.myChannel2 = new SoundChannel();
- this.mySound2.load(new URLRequest(String("https://dl.dropbox.com/s/0k2td1rkfa1hswh/gamemusic.mp3?dl=0")));
- this.mySound2.addEventListener(Event.COMPLETE, function (e:Event):void{
- myChannel2 = mySound2.play();
- var me:* = new SoundTransform(0.3, 0);
- myChannel2.soundTransform = me;
- myChannel2.addEventListener(Event.SOUND_COMPLETE, again);
- });
- }
- private function again(e:Event):void{
- this.mySound2 = new Sound();
- this.myChannel2 = new SoundChannel();
- this.mySound2.load(new URLRequest(String("https://dl.dropbox.com/s/0k2td1rkfa1hswh/gamemusic.mp3?dl=0")));
- this.mySound2.addEventListener(Event.COMPLETE, function (e:Event):void{
- myChannel2 = mySound2.play();
- var me:* = new SoundTransform(0.3, 0);
- myChannel2.soundTransform = me;
- myChannel2.addEventListener(Event.SOUND_COMPLETE, again2);
- });
- }
- private function handleMessages(m:Message):*{
- var id:Array;
- var fbpic:* = undefined;
- var photo:* = undefined;
- var color:String;
- var canCreate:Boolean;
- var mySound77:Sound;
- var mySound66:Sound;
- var intervalId1:uint;
- var my_loader3:Loader;
- var note:* = undefined;
- var y:* = undefined;
- var u:* = undefined;
- var mes:* = undefined;
- var mySound79:Sound;
- var mySound78:Sound;
- var playidi:* = undefined;
- var fbpich:* = undefined;
- var photoh:* = undefined;
- var playidh:* = undefined;
- var fbpicz:* = undefined;
- var photom:* = undefined;
- var roomid:* = undefined;
- var player1:* = undefined;
- var player2:* = undefined;
- var createdgc:* = undefined;
- var mySound:Sound;
- var mySoundk:Sound;
- var alreadygot:* = undefined;
- var playid:* = undefined;
- var people:* = undefined;
- var completeHANDLER:Function;
- var event:* = undefined;
- var result:* = undefined;
- var rex:RegExp;
- var det:String;
- var me:* = undefined;
- var isitme:* = undefined;
- var whoishe:* = undefined;
- var hisname:* = undefined;
- var rex2:RegExp;
- var det3:String;
- var mySoundo:Sound;
- var rex5:RegExp;
- var det1:String;
- var det2:String;
- var allmyitems:Array;
- var columnsPerRow:int;
- var i:int;
- var itemDetails1:String;
- var itemcase:* = undefined;
- var itemDetails:* = undefined;
- var allmyitems1:Array;
- var columnsPerRow1:int;
- var ii:int;
- var itemDetails12:String;
- var itemcase2:* = undefined;
- var itemDetails2:* = undefined;
- if (m.type == "LoggedIn")
- {
- if (this.panelop)
- {
- this.panel.gotoAndStop(2);
- this.panel.nametxt.text = m.getString(0);
- this.panel.limittxt.text = String(m.getInt(1));
- this.panel.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!onsee)
- {
- if (!openeditems)
- {
- onadd = true;
- onsee = true;
- openeditems = true;
- clickedid = String(panel.fbidtxt.text);
- items = new Items();
- TheConnection.send("seeitems", String(panel.fbidtxt.text), "add");
- items.x = 419.35;
- items.y = 167.9;
- items.alpha = 0;
- addChild(items);
- Tweener.addTween(items, {
- "x":419.35,
- "y":167.9,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (onsee)
- {
- onsee = false;
- onadd = false;
- removeChild(MovieClip(e.target.parent));
- openeditems = false;
- };
- });
- };
- };
- });
- this.panel.del_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!onsee)
- {
- if (!openeditems)
- {
- ondel = true;
- onsee = true;
- openeditems = true;
- clickedid = String(panel.fbidtxt.text);
- items = new Items();
- TheConnection.send("seeitems", String(panel.fbidtxt.text), "all");
- items.x = 419.35;
- items.y = 167.9;
- items.alpha = 0;
- addChild(items);
- Tweener.addTween(items, {
- "x":419.35,
- "y":167.9,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (onsee)
- {
- onsee = false;
- ondel = false;
- removeChild(MovieClip(e.target.parent));
- openeditems = false;
- };
- });
- };
- };
- });
- this.panel.searchplayer_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (issearch == false)
- {
- issearch = true;
- searchp = new SearchPlayer();
- searchp.x = 161.75;
- searchp.y = 138.25;
- addChild(searchp);
- searchp.searcher.text = "";
- searchp.loading.visible = false;
- searchp.hisinfo.visible = false;
- searchp.find_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (searchp.searcher.text != "")
- {
- TheConnection.send("searchp", searchp.searcher.text);
- searchp.loading.visible = true;
- searchp.find_btn.visible = false;
- searchp.hisinfo.visible = false;
- };
- });
- }
- else
- {
- issearch = false;
- removeChild(searchp);
- };
- });
- this.panel.see_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!onsee)
- {
- if (!openeditems)
- {
- onsee = true;
- openeditems = true;
- items = new Items();
- TheConnection.send("seeitems", String(panel.fbidtxt.text), "all");
- items.x = 419.35;
- items.y = 167.9;
- items.alpha = 0;
- addChild(items);
- Tweener.addTween(items, {
- "x":419.35,
- "y":167.9,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (onsee)
- {
- onsee = false;
- removeChild(MovieClip(e.target.parent));
- openeditems = false;
- };
- });
- };
- };
- });
- };
- };
- if (m.type == "gotUserInfo")
- {
- this.openCard.loading_mc.visible = false;
- this.openCard.idtext.text = m.getString(2);
- this.openCard.copy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- ChatTextField.appendText(openCard.idtext.text);
- });
- id = m.getString(2).split("fb");
- fbpic = (("https://graph.facebook.com/" + id[1]) + "/picture");
- trace(this.fbuid, id[1]);
- photo = new Loader();
- photo.load(new URLRequest(fbpic));
- this.openCard.picwhere.addChild(photo);
- this.openCard.nametxt.text = m.getString(3);
- this.openCard.clannametxt.text = m.getString(9);
- this.openCard.clantag.text = m.getString(10);
- this.openCard.coinstxt.text = m.getInt(1).toString();
- this.openCard.tokentxt.text = m.getInt(0).toString();
- this.openCard.stickman.toparea.head.gotoAndStop(m.getString(4));
- this.openCard.stickman.toparea.eyes.gotoAndStop(m.getString(5));
- this.openCard.stickman.toparea.mouth.gotoAndStop(m.getString(6));
- this.openCard.stickman.toparea.hands.gotoAndStop(m.getString(7));
- this.openCard.stickman.toparea.feet.gotoAndStop(m.getString(8));
- this.openCard.stickman.toparea.wings.gotoAndStop(m.getString(11));
- this.openCard.stickman.toparea.charcolor.gotoAndStop(m.getString(12));
- this.openCard.stickman.middle.charcolor.gotoAndStop(m.getString(12));
- this.openCard.stickman.bottomarea.charcolor.gotoAndStop(m.getString(12));
- this.openCard.seeitems.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!onsee)
- {
- if (!openeditems)
- {
- onsee = true;
- openeditems = true;
- items = new Items();
- TheConnection.send("seeitems", id[1], "all");
- items.x = 419.35;
- items.y = 167.9;
- items.alpha = 0;
- addChild(items);
- Tweener.addTween(items, {
- "x":419.35,
- "y":167.9,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (onsee)
- {
- onsee = false;
- removeChild(MovieClip(e.target.parent));
- openeditems = false;
- };
- });
- };
- };
- });
- this.openCard.fb_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var myURL:URLRequest = new URLRequest(("https://www.facebook.com/" + String(id[1])));
- navigateToURL(myURL, "_blank");
- });
- this.openCard.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
- infoopen = false;
- removeChild(openCard);
- });
- };
- if (m.type == "ClansOpen")
- {
- color = "none";
- canCreate = false;
- this.clan.loading_mc.visible = false;
- if (m.getBoolean(0) == false)
- {
- this.clan.inner_mc.gotoAndStop(1);
- this.clan.inner_mc.makeclan_btn.addEventListener(MouseEvent.CLICK, function ():*{
- clan.inner_mc.close_btn.visible = false;
- clan.makeclan_mc.visible = true;
- clan.makeclan_mc.back_btn.addEventListener(MouseEvent.CLICK, function ():*{
- clan.makeclan_mc.thelogo.prevFrame();
- });
- clan.makeclan_mc.next_btn.addEventListener(MouseEvent.CLICK, function ():*{
- clan.makeclan_mc.thelogo.nextFrame();
- });
- clan.makeclan_mc.red_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (clan.makeclan_mc.thelogo.currentFrame != 1)
- {
- color = "red";
- trace(color);
- clan.makeclan_mc.thelogo.logo.gotoAndStop("red");
- }
- else
- {
- alert("Please choose a logo first");
- };
- });
- clan.makeclan_mc.green_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (clan.makeclan_mc.thelogo.currentFrame != 1)
- {
- color = "green";
- trace(color);
- clan.makeclan_mc.thelogo.logo.gotoAndStop("green");
- }
- else
- {
- alert("Please choose a logo first");
- };
- });
- clan.makeclan_mc.blue_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (clan.makeclan_mc.thelogo.currentFrame != 1)
- {
- color = "blue";
- trace(color);
- clan.makeclan_mc.thelogo.logo.gotoAndStop("blue");
- }
- else
- {
- alert("Please choose a logo first");
- };
- });
- clan.makeclan_mc.yellow_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (clan.makeclan_mc.thelogo.currentFrame != 1)
- {
- color = "yellow";
- trace(color);
- clan.makeclan_mc.thelogo.logo.gotoAndStop("yellow");
- }
- else
- {
- alert("Please choose a logo first");
- };
- });
- clan.makeclan_mc.pink_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (clan.makeclan_mc.thelogo.currentFrame != 1)
- {
- color = "pink";
- trace(color);
- clan.makeclan_mc.thelogo.logo.gotoAndStop("pink");
- }
- else
- {
- alert("Please choose a logo first");
- };
- });
- clan.makeclan_mc.white_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (clan.makeclan_mc.thelogo.currentFrame != 1)
- {
- color = "white";
- trace(color);
- clan.makeclan_mc.thelogo.logo.gotoAndStop("white");
- }
- else
- {
- alert("Please choose a logo first");
- };
- });
- if (((clan.makeclan_mc.clanname.length <= 16) && (clan.makeclan_mc.clantag.length <= 4)))
- {
- canCreate = true;
- }
- else
- {
- alert("Clan Name / Clan Tag to long!");
- };
- clan.makeclan_mc.create_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (((!(color == "none")) && (canCreate == true)))
- {
- TheConnection.send("MakeClan", clan.makeclan_mc.thelogo.currentFrame.toString(), color, clan.makeclan_mc.clanname.text, clan.makeclan_mc.clantag.text);
- }
- else
- {
- alert("Opps somthing went wrong :/ please retry");
- };
- });
- clan.makeclan_mc.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
- clan.inner_mc.close_btn.visible = true;
- clan.makeclan_mc.visible = false;
- });
- });
- this.clan.inner_mc.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
- removeChild(clan);
- });
- }
- else
- {
- this.clan.inner_mc.gotoAndStop(2);
- this.clan.inner_mc.inner2.inner3.thelogo.gotoAndStop(m.getString(3));
- this.clan.inner_mc.inner2.inner3.thelogo.logo.gotoAndStop(m.getString(4));
- this.clan.inner_mc.nametxt.text = m.getString(1);
- this.clan.inner_mc.clantag.text = m.getString(2);
- this.clan.inner_mc.leadertxt.text = m.getString(5);
- this.clan.inner_mc.member_1.text = m.getString(7);
- this.clan.inner_mc.member_2.text = m.getString(8);
- this.clan.inner_mc.member_3.text = m.getString(9);
- this.clan.inner_mc.member_4.text = m.getString(10);
- this.clan.inner_mc.member_5.text = m.getString(11);
- this.clan.inner_mc.leaveclan_btn.addEventListener(MouseEvent.CLICK, function ():*{
- TheConnection.send("leaveclan");
- removeChild(clan);
- alert("Clan Deleted");
- });
- this.clan.inner_mc.get_btn52.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange15");
- });
- this.clan.inner_mc.get_btn53.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange16");
- });
- this.clan.inner_mc.get_btn54.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange17");
- });
- this.clan.inner_mc.get_btn55.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange18");
- });
- this.clan.inner_mc.close_btn.addEventListener(MouseEvent.CLICK, function ():*{
- removeChild(clan);
- });
- };
- };
- if (m.type == "ClanMade")
- {
- removeChild(this.clan);
- this.alert("Clan Created");
- };
- if (m.type == "needPass")
- {
- };
- if (m.type == "haspass")
- {
- this.multiopen.hastpass.gotoAndStop(2);
- };
- if (m.type == "colldice")
- {
- this.TheConnection.send("loadstorage");
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- mySound77 = new gotdice();
- this.alert("You Collected 36 dice");
- };
- if (m.type == "collcoins")
- {
- this.TheConnection.send("loadstorage");
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- mySound66 = new gotcoin();
- this.alert("You Collected 150 coins");
- };
- if (m.type == "collbought")
- {
- this.TheConnection.send("loadstorage");
- };
- if (m.type == "loadstorage")
- {
- if (this.isstorage)
- {
- this.storage.upgrade_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- alert("Upgrade! Coming Soon..");
- });
- this.storage.loading.visible = false;
- this.storage.collectd_btn.visible = false;
- this.storage.collectc_btn.visible = false;
- this.storage.dtime.text = String(m.getInt(2));
- this.storage.ctime.text = String(m.getInt(3));
- if (m.getInt(2) >= 1)
- {
- if (!this.dicecounting)
- {
- var dListener:Function = function (e:TimerEvent):void{
- if (isstorage)
- {
- if (int(storage.dtime.text) >= 1)
- {
- storage.dtime.text = String((int(storage.dtime.text) - 1));
- }
- else
- {
- storage.dtime.text = "0";
- TheConnection.send("loadstorage");
- storage.collectd_btn.visible = true;
- storage.collectd_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- storage.loading.visible = true;
- TheConnection.send("collect", "dice");
- });
- };
- };
- };
- this.dicecounting = true;
- this.dicecount = new Timer(1000, (m.getInt(2) + 2));
- this.dicecount.addEventListener(TimerEvent.TIMER, dListener);
- this.dicecount.start();
- };
- };
- if (m.getInt(3) >= 1)
- {
- if (!this.coinscounting)
- {
- var cListener:Function = function (e:TimerEvent):void{
- if (isstorage)
- {
- if (int(storage.ctime.text) >= 1)
- {
- storage.ctime.text = String((int(storage.ctime.text) - 1));
- }
- else
- {
- storage.ctime.text = "0";
- TheConnection.send("loadstorage");
- storage.collectc_btn.visible = true;
- storage.collectc_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- storage.loading.visible = true;
- TheConnection.send("collect", "coins");
- });
- };
- };
- };
- this.coinscounting = true;
- this.coinscount = new Timer(1000, (m.getInt(2) + 2));
- this.coinscount.addEventListener(TimerEvent.TIMER, cListener);
- this.coinscount.start();
- };
- };
- if (m.getBoolean(4))
- {
- this.storage.collectd_btn.visible = true;
- this.storage.collectd_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- storage.loading.visible = true;
- TheConnection.send("collect", "dice");
- });
- };
- if (m.getBoolean(5))
- {
- this.storage.collectc_btn.visible = true;
- this.storage.collectc_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- storage.loading.visible = true;
- TheConnection.send("collect", "coins");
- });
- };
- if (m.getBoolean(0))
- {
- this.storage.dcollbuy.visible = false;
- }
- else
- {
- this.storage.dcollbuy.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (dbcoins >= 5000)
- {
- TheConnection.send("buycoll", "dcoll");
- storage.loading.visible = true;
- }
- else
- {
- alert("not enough coins");
- };
- });
- };
- if (m.getBoolean(1))
- {
- this.storage.ccollbuy.visible = false;
- }
- else
- {
- this.storage.ccollbuy.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (dbdice >= 200)
- {
- TheConnection.send("buycoll", "ccoll");
- storage.loading.visible = true;
- }
- else
- {
- alert("not enough tokens");
- };
- });
- };
- };
- };
- if (m.type == "roll")
- {
- if (this.machine)
- {
- this.slotmachine.s1.gotoAndStop(3);
- this.slotmachine.s1.item.gotoAndStop(m.getString(0));
- intervalId1 = setTimeout(function ():*{
- slotmachine.s2.gotoAndStop(3);
- slotmachine.s2.item.gotoAndStop(m.getString(1));
- var intervalId2:* = setTimeout(function ():*{
- slotmachine.s3.gotoAndStop(3);
- slotmachine.s3.item.gotoAndStop(m.getString(2));
- spinning = false;
- if (((m.getString(0) == m.getString(1)) && (m.getString(0) == m.getString(2))))
- {
- alert(("Congratulations! You won: " + m.getString(0)));
- };
- }, 500);
- }, 500);
- };
- };
- if (m.type == "roll2")
- {
- if (this.machine)
- {
- this.slotmachine.s1.gotoAndStop(3);
- this.slotmachine.s1.item.gotoAndStop(m.getString(0));
- intervalId1 = setTimeout(function ():*{
- slotmachine.s2.gotoAndStop(3);
- slotmachine.s2.item.gotoAndStop(m.getString(1));
- var intervalId2:* = setTimeout(function ():*{
- slotmachine.s3.gotoAndStop(3);
- slotmachine.s3.item.gotoAndStop(m.getString(2));
- spinning = false;
- if (((m.getString(0) == m.getString(1)) && (m.getString(0) == m.getString(2))))
- {
- alert(("Congratulations! You won: " + m.getString(0)));
- };
- }, 500);
- }, 500);
- };
- };
- if (m.type == "clear")
- {
- this.chat_w.DisplayTextField.htmlText = "<font color='#FF0000'>>>> Server : Chat Cleared";
- };
- if (m.type == "playyoutube")
- {
- my_loader3 = new Loader();
- my_loader3.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
- my_loader3.contentLoaderInfo.addEventListener(Event.INIT, function (e:Event):void{
- MovieClip(root).Herehere.addChild(my_loader3);
- my_player3 = my_loader3.content;
- my_player3.addEventListener("onReady", function (e:Event):void{
- my_player3.visible = false;
- my_player3.setSize(140, 95);
- my_player3.x = 541.3;
- my_player3.y = 401.85;
- my_player3.cueVideoById(m.getString(0), 0);
- my_player3.playVideo();
- });
- Herehere.play_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- my_player3.playVideo();
- });
- Herehere.remove_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- MovieClip(root).Herehere.addChild(my_loader3);
- my_player3.stopVideo();
- });
- });
- };
- if (m.type == "stopyoutube")
- {
- this.my_player3.stopVideo();
- };
- if (m.type == "note")
- {
- note = new Note();
- note.x = 118.5;
- note.y = 54.05;
- note.mess.text = m.getString(0);
- addChild(note);
- note.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(MovieClip(e.target.parent));
- TheConnection.send("Read");
- });
- };
- if (m.type == "dicebought")
- {
- this.alert("item bought");
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- if (this.diceshop != null)
- {
- this.diceshop.loadblock.visible = false;
- };
- };
- if (m.type == "dshop")
- {
- y = 0;
- u = 0;
- while (u < m.length)
- {
- this.showmc = new ShowMC();
- mes = m.getString(u).split(":");
- this.showmc.nametxt.text = String(mes[0]);
- this.showmc.item.gotoAndStop(mes[0]);
- this.showmc.price_txt.text = String(mes[1]);
- this.showmc.y = y;
- this.diceshop.content.addChild(this.showmc);
- y = (y + (this.showmc.height + 5));
- this._scrollbar = new Scrollbar();
- this._scrollbar.init(this.diceshop.content, this.diceshop.contentMask, this.diceshop.track, this.diceshop.slider);
- this.showmc.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (dbdice >= int(e.target.parent.price_txt.text))
- {
- diceshop.loadblock.visible = true;
- TheConnection.send("dicebuy", String(e.target.parent.nametxt.text), int(e.target.parent.price_txt.text));
- }
- else
- {
- alert("not enough tokens");
- };
- });
- u++;
- };
- };
- if (m.type == "playmusic")
- {
- this.issPlaying = false;
- this.lastPosition = this.myChannel.position;
- this.myChannel.stop();
- this.mySound = new Sound();
- this.myChannel = new SoundChannel();
- this.mySound.load(new URLRequest(String(m.getString(0))));
- this.myChannel = this.mySound.play();
- };
- if (m.type == "stopmusic")
- {
- if (this.issPlaying == false)
- {
- this.issPlaying = true;
- this.myChannel = this.myMusic.play(this.lastPosition);
- };
- this.sounds = false;
- trace(this.sounds);
- this.mute_btn.gotoAndStop(1);
- this.myChannel.stop();
- };
- if (m.type == "Iadd")
- {
- if (m.getString(0) == ("fb" + this.fbuid))
- {
- mySound79 = new pck();
- trace("Someone added");
- trace(m.getString(1));
- this.canadd = true;
- if (m.getString(1) == "offer1")
- {
- this.MyOffer.hisoffer1.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer2")
- {
- this.MyOffer.hisoffer2.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer3")
- {
- this.MyOffer.hisoffer3.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer4")
- {
- this.MyOffer.hisoffer4.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer5")
- {
- this.MyOffer.hisoffer5.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer6")
- {
- this.MyOffer.hisoffer6.howmany.text = String(m.getInt(2));
- };
- };
- };
- if (m.type == "added")
- {
- trace("added");
- this.canadd = true;
- if (m.getString(0) == "offer1")
- {
- this.HisOffer.offer1.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer2")
- {
- this.HisOffer.offer2.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer3")
- {
- this.HisOffer.offer3.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer4")
- {
- this.HisOffer.offer4.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer5")
- {
- this.HisOffer.offer5.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer6")
- {
- this.HisOffer.offer6.howmany.text = String(m.getInt(1));
- };
- };
- if (m.type == "removed")
- {
- trace("removed");
- this.canadd = true;
- if (m.getInt(1) == 0)
- {
- if (m.getString(0) == "offer1")
- {
- this.HisOffer.offer1.howmany.text = "";
- this.HisOffer.offer1.gotoAndStop("none");
- };
- if (m.getString(0) == "offer2")
- {
- this.HisOffer.offer2.howmany.text = "";
- this.HisOffer.offer2.gotoAndStop("none");
- };
- if (m.getString(0) == "offer3")
- {
- this.HisOffer.offer3.howmany.text = "";
- this.HisOffer.offer3.gotoAndStop("none");
- };
- if (m.getString(0) == "offer4")
- {
- this.HisOffer.offer4.howmany.text = "";
- this.HisOffer.offer4.gotoAndStop("none");
- };
- if (m.getString(0) == "offer5")
- {
- this.HisOffer.offer5.howmany.text = "";
- this.HisOffer.offer5.gotoAndStop("none");
- };
- if (m.getString(0) == "offer6")
- {
- this.HisOffer.offer6.howmany.text = "";
- this.HisOffer.offer6.gotoAndStop("none");
- };
- }
- else
- {
- if (m.getString(0) == "offer1")
- {
- this.HisOffer.offer1.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer2")
- {
- this.HisOffer.offer2.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer3")
- {
- this.HisOffer.offer3.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer4")
- {
- this.HisOffer.offer4.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer5")
- {
- this.HisOffer.offer5.howmany.text = String(m.getInt(1));
- };
- if (m.getString(0) == "offer6")
- {
- this.HisOffer.offer6.howmany.text = String(m.getInt(1));
- };
- };
- };
- if (m.type == "Iminus")
- {
- if (m.getString(0) == ("fb" + this.fbuid))
- {
- mySound78 = new pck();
- if (m.getInt(2) == 0)
- {
- if (m.getString(1) == "offer1")
- {
- this.MyOffer.hisoffer1.howmany.text = "";
- this.MyOffer.hisoffer1.gotoAndStop("none");
- };
- if (m.getString(1) == "offer2")
- {
- this.MyOffer.hisoffer2.howmany.text = "";
- this.MyOffer.hisoffer2.gotoAndStop("none");
- };
- if (m.getString(1) == "offer3")
- {
- this.MyOffer.hisoffer3.howmany.text = "";
- this.MyOffer.hisoffer3.gotoAndStop("none");
- };
- if (m.getString(1) == "offer4")
- {
- this.MyOffer.hisoffer4.howmany.text = "";
- this.MyOffer.hisoffer4.gotoAndStop("none");
- };
- if (m.getString(1) == "offer5")
- {
- this.MyOffer.hisoffer5.howmany.text = "";
- this.MyOffer.hisoffer5.gotoAndStop("none");
- };
- if (m.getString(1) == "offer6")
- {
- this.MyOffer.hisoffer6.howmany.text = "";
- this.MyOffer.hisoffer6.gotoAndStop("none");
- };
- }
- else
- {
- if (m.getString(1) == "offer1")
- {
- this.MyOffer.hisoffer1.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer2")
- {
- this.MyOffer.hisoffer2.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer3")
- {
- this.MyOffer.hisoffer3.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer4")
- {
- this.MyOffer.hisoffer4.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer5")
- {
- this.MyOffer.hisoffer5.howmany.text = String(m.getInt(2));
- };
- if (m.getString(1) == "offer6")
- {
- this.MyOffer.hisoffer6.howmany.text = String(m.getInt(2));
- };
- };
- };
- };
- if (m.type == "gift")
- {
- this.dicetxt.text = m.getInt(0).toString();
- this.coinstxt.text = m.getInt(1).toString();
- this.thegift = new TheGift();
- this.thegift.x = 133.7;
- this.thegift.y = 49.05;
- addChild(this.thegift);
- this.thegift.gift1.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- lobbyConnection.send("choose", 1);
- removeChild(thegift);
- });
- this.thegift.gift2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- lobbyConnection.send("choose", 2);
- removeChild(thegift);
- });
- this.thegift.gift3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- lobbyConnection.send("choose", 3);
- removeChild(thegift);
- });
- };
- if (m.type == "gotCoin")
- {
- this.chat_w.DisplayTextField.htmlText = (this.chat_w.DisplayTextField.htmlText + (((("<font color='#FF0000'>StickSWIM: " + this.fbname) + " got free ") + m.getString(0)) + "coins!\n"));
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- };
- if (m.type == "gotDice")
- {
- this.chat_w.DisplayTextField.htmlText = (this.chat_w.DisplayTextField.htmlText + (((("<font color='#00FFFF'>StickSWIM: " + this.fbname) + " got free ") + m.getString(0)) + "dice!\n"));
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- };
- if (m.type == "lotteryAlert")
- {
- if (this.lottery)
- {
- if (m.getString(0) == "success")
- {
- this.lottery.load_mc.visible = false;
- this.alert(m.getString(1));
- }
- else
- {
- this.lottery.load_mc.visible = false;
- this.alert(m.getString(1));
- };
- };
- };
- if (m.type == "lotteryDet")
- {
- if (this.lottery)
- {
- this.lottery.bet_btn.tabEnabled = false;
- this.lottery.load_mc.visible = false;
- this.lottery.coinstxt.restrict = "0-9";
- this.lottery.item1.gotoAndStop(m.getString(1));
- this.lottery.item1.howmany.text = "1";
- this.lottery.item2.howmany.text = "1";
- this.lottery.item3.howmany.text = "1";
- this.lottery.item2.gotoAndStop(m.getString(2));
- this.lottery.item3.gotoAndStop(m.getString(3));
- this.lottery.tbet.text = String(m.getInt(0));
- this.lottery.mostbet.nametxt.text = m.getString(4);
- this.lottery.mostbet.coinstxt.text = String(m.getInt(6));
- this.lottery.timetxt.text = String(m.getInt(7));
- playidi = m.getString(5).split("fb");
- fbpich = (("https://graph.facebook.com/" + String(playidi[1])) + "/picture");
- photoh = new Loader();
- photoh.load(new URLRequest(fbpich));
- this.lottery.mostbet.picwhere.addChild(photoh);
- this.lottery.bet_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (dbcoins >= int(lottery.coinstxt.text))
- {
- lottery.load_mc.visible = true;
- dbcoins = (dbcoins - int(lottery.coinstxt.text));
- TheConnection.send("bet", int(lottery.coinstxt.text));
- }
- else
- {
- alert("not enought coins");
- };
- });
- };
- };
- if (m.type == "move")
- {
- if (m.getString(2) != this.iam)
- {
- if (m.getString(2) == "player1")
- {
- player1.x = m.getInt(0);
- player1.y = m.getInt(1);
- }
- else
- {
- player2.x = m.getInt(0);
- player2.y = m.getInt(1);
- };
- };
- };
- if (m.type == "MyOpp")
- {
- this.ready.loading.visible = false;
- this.ready.found.visible = true;
- this.ready.found.nametxt.text = String(m.getString(0));
- playidh = this.myopponent.split("fb");
- fbpicz = (("https://graph.facebook.com/" + String(playidh[1])) + "/picture");
- photom = new Loader();
- photom.load(new URLRequest(fbpicz));
- this.ready.found.picwhere.addChild(photom);
- this.multiId = "";
- this.myopponent = "";
- };
- if (m.type == "gameFound")
- {
- trace(m);
- roomid = m.getString(0);
- this.multiId = m.getString(0);
- player1 = m.getString(1);
- player2 = m.getString(2);
- if (player1 != ("fb" + this.fbuid))
- {
- this.TheConnection.send("loadHIM", player1);
- this.myopponent = player1;
- this.iam = "player2";
- trace(("my op: " + player1));
- }
- else
- {
- this.TheConnection.send("loadHIM", player2);
- this.myopponent = player2;
- this.iam = "player1";
- trace(("my op: " + player2));
- };
- };
- if (m.type == "createdgc")
- {
- createdgc = new CreatedGC();
- createdgc.x = 148.5;
- createdgc.y = 156.55;
- addChild(createdgc);
- createdgc.item.gotoAndStop(String(m.getString(0)));
- createdgc.itemtxt.text = String(m.getString(0));
- createdgc.gctxt.text = String(m.getString(1));
- createdgc.copy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- ChatTextField.appendText(createdgc.gctxt.text);
- });
- createdgc.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- });
- };
- if (m.type == "unpacked")
- {
- var callback:Function = function ():*{
- TheConnection.send("loadplayer", fbuid, "newdb");
- eButtons = true;
- removeChild(successunpack);
- };
- this.successunpack = new SuccessUnpack();
- this.successunpack.alpha = 0;
- this.successunpack.x = 158.95;
- this.successunpack.y = 166;
- this.successunpack.width = 332.1;
- this.successunpack.height = 118;
- addChild(this.successunpack);
- this.successunpack.item1.gotoAndStop(String(m.getString(0)));
- this.successunpack.item2.gotoAndStop(String(m.getString(1)));
- this.successunpack.item3.gotoAndStop(String(m.getString(2)));
- this.successunpack.item4.gotoAndStop(String(m.getString(3)));
- this.successunpack.item5.gotoAndStop(String(m.getString(4)));
- this.successunpack.item6.gotoAndStop(String(m.getString(5)));
- mySound = new success_sound();
- mySound.play();
- Tweener.addTween(this.successunpack, {
- "x":158.95,
- "y":166,
- "width":332.1,
- "height":118,
- "time":2,
- "alpha":1,
- "transition":"easeInSine",
- "onComplete":callback
- });
- this.unpacking = false;
- if (this.inventoryopen != null)
- {
- removeChild(this.inventoryopen);
- };
- };
- if (m.type == "gcsuccess")
- {
- if (this.giftcodeopen)
- {
- this.giftcode.item.gotoAndStop(String(m.getString(0)));
- this.giftcode.check_btn.visible = true;
- this.giftcode.loadbar.visible = false;
- this.alert(("Got an item: " + m.getString(0)));
- mySoundk = new success_sound();
- mySoundk.play();
- };
- };
- if (m.type == "gcresponce")
- {
- alreadygot = new AlreadyGot();
- alreadygot.x = 203.55;
- alreadygot.y = 187.55;
- addChild(alreadygot);
- alreadygot.fbname.text = String(m.getString(0));
- alreadygot.item.gotoAndStop(String(m.getString(2)));
- playid = m.getString(1).split("fb");
- fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
- photo = new Loader();
- photo.load(new URLRequest(fbpic));
- alreadygot.picwhere.addChild(photo);
- alreadygot.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- });
- this.giftcode.check_btn.visible = true;
- this.giftcode.loadbar.visible = false;
- };
- if (m.type == "gcresponce2")
- {
- if (this.giftcodeopen)
- {
- this.giftcode.loadbar.visible = false;
- this.giftcode.check_btn.visible = true;
- this.alert("Invalid Giftcode");
- };
- };
- if (m.type == "playermessage")
- {
- if (m.getString(1) == ("fb" + this.fbuid))
- {
- this.alert(String(m.getString(0)));
- };
- };
- if (m.type == "kick")
- {
- if (m.getString(0) == ("fb" + this.fbuid))
- {
- this.ontrade = false;
- this.lobbyConnection.send("iclose", this.fbuid, this.partnerid);
- this.lobbyConnection.send("byebye", this.partnerid);
- this.letsStart();
- this.eButtons = true;
- this.joining = false;
- this.multiisopen = false;
- this.iwilloffer = false;
- this.imonoffer = false;
- this.lobbyConnection.disconnect();
- this.partnerid = "";
- };
- };
- if (m.type == "buyalert")
- {
- if (m.getString(0) == "success")
- {
- this.alert("Successfully bought");
- if (this.isshopopen)
- {
- this.shopopen.loadblock.visible = false;
- };
- }
- else
- {
- this.alert("Failed to buy");
- if (this.isshopopen)
- {
- this.shopopen.loadblock.visible = false;
- };
- };
- };
- if (m.type == "offerClosed")
- {
- if (((m.getString(0) == ("fb" + this.fbuid)) && (!(this.iwilloffer))))
- {
- this.ontrade = false;
- this.alert("Trader left, ...");
- this.HisOffer.fbname.text = "";
- this.hisOfferRefresh();
- };
- };
- if (m.type == "putCoins")
- {
- if (((m.getString(0) == this.partnerid) && (("fb" + this.fbuid) == m.getString(1))))
- {
- this.MyOffer.coinstxt.text = String(m.getInt(2));
- };
- };
- if (m.type == "putDice")
- {
- if (((m.getString(0) == this.partnerid) && (("fb" + this.fbuid) == m.getString(1))))
- {
- this.MyOffer.dicetxt.text = String(m.getInt(2));
- };
- };
- if (m.type == "theinfo")
- {
- if (((this.infoopen) && (this.clickedid == ("fb" + m.getString(2)))))
- {
- this.myskin.coinstxt.text = String(m.getString(1));
- this.myskin.dicetxt.text = String(m.getString(0));
- this.myskin.thechar.visible = true;
- this.myskin.thechar.stickman.toparea.head.gotoAndStop(String(m.getString(3)));
- this.myskin.thechar.stickman.toparea.hands.gotoAndStop(String(m.getString(6)));
- this.myskin.thechar.stickman.toparea.eyes.gotoAndStop(String(m.getString(4)));
- this.myskin.thechar.stickman.toparea.mouth.gotoAndStop(String(m.getString(5)));
- this.myskin.thechar.stickman.toparea.feet.gotoAndStop(String(m.getString(7)));
- };
- };
- if (m.type == "outBitch")
- {
- if ((((m.getString(0) == ("fb" + this.fbuid)) && (this.partnerid == m.getString(1))) && (this.imonoffer)))
- {
- this.ontrade = false;
- this.alert("You've been rejected^^");
- this.hisOfferRefresh();
- };
- };
- if (m.type == "newplayer")
- {
- this.newps = true;
- gotoAndStop(2);
- this.newp.visible = true;
- this.newp.blue_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- changeskin("blue");
- });
- this.newp.yellow_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- changeskin("yellow");
- });
- this.newp.green_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- changeskin("green");
- });
- this.newp.red_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- changeskin("red");
- });
- };
- if (m.type == "loadingdb")
- {
- this.loadtxt.text = "Loading Database";
- this.loadbar.gotoAndStop(35);
- this.loadbuzz();
- if (((!(this.currDB)) && (!(this.newps))))
- {
- this.currDB = true;
- };
- };
- if (m.type == "block")
- {
- gotoAndStop(2);
- this.alert("Something went wrong, please refresh");
- this.warning.visible = true;
- };
- if (m.type == "menu")
- {
- trace(m);
- this.dbskin = m.getString(0);
- this.dbhead = m.getString(1);
- this.dbeyes = m.getString(2);
- this.dbmouth = m.getString(3);
- this.dbhands = m.getString(4);
- this.dbfoot = m.getString(5);
- this.dbwings = m.getString(18);
- this.dbcharcolor = m.getString(21);
- this.dbcoins = m.getInt(6);
- this.dbdice = m.getInt(7);
- this.dblevel = m.getInt(8);
- this.dbxp = m.getInt(9);
- this.gotmemepack = m.getBoolean(13);
- this.dbdealbg = m.getString(15);
- this.gotdwset = m.getBoolean(16);
- this.gotswagset = m.getBoolean(17);
- this.gotdarkpack = m.getBoolean(19);
- this.gotspeedpack = m.getBoolean(22);
- this.gotdealbgpack = m.getBoolean(23);
- this.gotwlpack = m.getBoolean(24);
- this.gotrainbowpack = m.getBoolean(25);
- this.gotredpack = m.getBoolean(26);
- this.gotnewyearpack = m.getBoolean(27);
- this.gotnovapack = m.getBoolean(28);
- this.gotcrystalpack = m.getBoolean(29);
- this.gotrarepack = m.getBoolean(30);
- this.gotmilionerpack = m.getBoolean(31);
- this.gotnvpack = m.getBoolean(32);
- this.gotcupidpack = m.getBoolean(20);
- this.TheConnection.send("security", this.fbuid);
- this.loadtxt.text = "Loading Player Support";
- this.loadbar.gotoAndStop(50);
- this.loadbuzz();
- };
- if (m.type == "newdb")
- {
- this.dbskin = m.getString(0);
- this.dbhead = m.getString(1);
- this.dbeyes = m.getString(2);
- this.dbmouth = m.getString(3);
- this.dbhands = m.getString(4);
- this.dbfoot = m.getString(5);
- this.dbwings = m.getString(18);
- this.dbcharcolor = m.getString(21);
- this.dbcoins = m.getInt(6);
- this.dbdice = m.getInt(7);
- this.dblevel = m.getInt(8);
- this.dbxp = m.getInt(9);
- this.gotmemepack = m.getBoolean(13);
- this.gotdwset = m.getBoolean(16);
- this.gotswagset = m.getBoolean(17);
- this.gotdarkpack = m.getBoolean(19);
- this.gotspeedpack = m.getBoolean(22);
- this.gotdealbgpack = m.getBoolean(23);
- this.gotwlpack = m.getBoolean(24);
- this.gotrainbowpack = m.getBoolean(25);
- this.gotredpack = m.getBoolean(26);
- this.gotnewyearpack = m.getBoolean(27);
- this.gotnovapack = m.getBoolean(28);
- this.gotcrystalpack = m.getBoolean(29);
- this.gotrarepack = m.getBoolean(30);
- this.gotmilionerpack = m.getBoolean(31);
- this.gotnvpack = m.getBoolean(32);
- this.gotcupidpack = m.getBoolean(20);
- if (this.myskin != null)
- {
- this.mystats.coinstxt.text = String(this.dbcoins);
- this.mystats.dicetxt.text = String(this.dbdice);
- };
- if (currentFrame == 3)
- {
- this.coinstxt.text = String(this.dbcoins);
- this.dicetxt.text = String(this.dbdice);
- };
- };
- if (m.type == "lobbys")
- {
- people = m.getString(0).split(",");
- if (this.multiisopen)
- {
- this.multiopen.a_online.text = String(people[0]);
- this.multiopen.b_online.text = String(people[1]);
- this.multiopen.c_online.text = String(people[2]);
- this.multiopen.d_online.text = String(people[3]);
- this.multiopen.e_online.text = String(people[4]);
- this.multiopen.f_online.text = String(people[5]);
- this.multiopen.aa_online.text = String(people[6]);
- this.multiopen.bb_online.text = String(people[7]);
- this.multiopen.cc_online.text = String(people[8]);
- };
- };
- if (m.type == "refresh")
- {
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- };
- if (m.type == "gotcashbro")
- {
- this.alert("Enjoy");
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- };
- if (m.type == "gotcord")
- {
- this.alert("Enjoy");
- this.TheConnection.send("loadplayer", this.fbuid, "newdb");
- };
- if (m.type == "refreshSlots2")
- {
- this.mystats.dicetxt.text = m.getInt(0).toString();
- };
- if (m.type == "refreshSlots")
- {
- this.mystats.coinstxt.text = m.getInt(0).toString();
- };
- if (m.type == "yolo1")
- {
- this.mystats.dicetxt.text = m.getInt(0).toString();
- this.mystats.coinstxt.text = m.getInt(0).toString();
- this.exchanges.coinstxt.text = m.getInt(0).toString();
- this.exchanges.dicetxt.text = m.getInt(0).toString();
- };
- if (m.type == "start")
- {
- if (("fb" + this.fbuid) == m.getString(0))
- {
- this.letsStart();
- this.dbhead = m.getString(1);
- this.dbeyes = m.getString(3);
- this.dbmouth = m.getString(4);
- this.dbhands = m.getString(2);
- this.dbfoot = m.getString(5);
- this.dbwings = m.getString(6);
- this.dbcharcolor = m.getString(7);
- this.issPlaying = false;
- event = event;
- completeHANDLER = function (event:Event):void{
- lastPosition = 0;
- issPlaying = false;
- };
- if (this.issPlaying == false)
- {
- this.issPlaying = true;
- this.myChannel = this.myMusic.play(this.lastPosition);
- };
- this.myChannel.addEventListener(Event.SOUND_COMPLETE, completeHANDLER);
- };
- };
- if (m.type == "time")
- {
- trace(String(m.getString(0)));
- };
- if (m.type == "alert")
- {
- this.alert(String(m.getString(0)));
- };
- if (m.type == "banned")
- {
- this.TheConnection.disconnect();
- gotoAndStop(4);
- this.alert(String(m.getString(0)));
- this.reason.text = m.getString(0);
- };
- if (m.type == "forcereload")
- {
- if (((!(m.getString(0) == ("fb" + this.fbuid))) && (!(("fb" + this.fbuid) == ""))))
- {
- if (ExternalInterface.available)
- {
- result = ExternalInterface.call("reload");
- };
- this.TheConnection.disconnect();
- this.lobbyConnection.disconnect();
- gotoAndStop(5);
- };
- };
- if (m.type == "isBanned")
- {
- if (m.getString(0) == ("fb" + this.fbuid))
- {
- this.TheConnection.disconnect();
- this.lobbyConnection.disconnect();
- gotoAndStop(4);
- trace("faggot");
- };
- };
- if (m.type == "me")
- {
- rex = /[\s\r\n]+/gim;
- det = m.getString(0);
- det = det.replace(rex, "");
- me = det.split(";");
- trace(det);
- };
- if (m.type == "updateOffer")
- {
- trace(m.getString(0));
- this.updateOffer(m.getString(0));
- };
- if (m.type == "otherplayer")
- {
- isitme = m.getString(0);
- whoishe = m.getString(1);
- hisname = m.getString(2);
- rex2 = /[\s\r\n]+/gim;
- det3 = isitme;
- det3 = det3.replace(rex2, "");
- trace("gotIn");
- if ((((!(this.imbusy)) && (this.iwilloffer)) && (det3 == ("fb" + this.fbuid))))
- {
- mySoundo = new trader_found();
- mySoundo.play();
- this.gotInOffer(whoishe, hisname);
- this.partnerid = whoishe;
- this.lobbyConnection.send("onMe", whoishe);
- this.imbusy = true;
- }
- else
- {
- if (this.partnerid != whoishe)
- {
- this.lobbyConnection.send("busydude", m.getString(1));
- };
- };
- };
- if (m.type == "sorry")
- {
- rex5 = /[\s\r\n]+/gim;
- det1 = m.getString(0);
- det2 = m.getString(1);
- det1 = det1.replace(rex5, "");
- det2 = det2.replace(rex5, "");
- if (((det1 == ("fb" + this.fbuid)) && (this.partnerid == det2)))
- {
- this.alert("Someone is already on this offer");
- this.hisOfferRefresh();
- };
- };
- if (m.type == "lookitems")
- {
- if (this.openeditems)
- {
- if (m.getString(0) != "")
- {
- allmyitems = m.getString(0).split(",");
- columnsPerRow = 11;
- i = 0;
- while (i < allmyitems.length)
- {
- trace(allmyitems.length);
- if (allmyitems.length >= 55)
- {
- this.items.track.visible = true;
- this.items.slider.visible = true;
- };
- this.items.loadMC.visible = false;
- itemDetails1 = allmyitems[i];
- itemcase = new ItemCase();
- itemDetails = itemDetails1.split(":");
- this._scrollbar = new Scrollbar();
- this.items.whos.text = (String(this.clickedname) + " Items");
- trace((itemDetails[1] + " Items"));
- this._scrollbar.init(this.items.content, this.items.contentMask, this.items.track, this.items.slider);
- if (((((((((((!(itemDetails[0] == "")) || (!(itemDetails[1] == ""))) || (!(itemDetails[0] == " "))) || (!(itemDetails[1] == " "))) || (!(itemDetails[0] == null))) || (!(itemDetails[1] == null))) || (!(itemDetails[0] == undefined))) || (!(itemDetails[1] == undefined))) || (!(itemDetails1 == ""))) || (!(itemDetails1 == " "))))
- {
- itemcase.scaleX = 0.871248789932236;
- itemcase.scaleY = 0.835073068893528;
- itemcase.x = (((i % columnsPerRow) * (itemcase.width + 2)) + 20);
- itemcase.y = ((Math.floor((i / columnsPerRow)) * (itemcase.height + 1)) + 15);
- itemcase.name = String(itemDetails[0]);
- trace((itemDetails[1] + " Items"));
- if (int(itemDetails[1]) >= 2)
- {
- itemcase.howmany.text = ("" + String(itemDetails[1]));
- };
- itemcase.gotoAndStop(String(itemDetails[0]));
- this.items.content.addChild(itemcase);
- trace(("y:" + itemcase.y));
- itemcase.addEventListener(MouseEvent.ROLL_OVER, function (e:MouseEvent):void{
- var mySound:Sound = new blub2();
- mySound.play();
- Tweener.addTween(MovieClip(e.target), {
- "scaleX":1,
- "scaleY":1,
- "time":0.1,
- "transition":"easeInSine"
- });
- });
- itemcase.addEventListener(MouseEvent.ROLL_OUT, function (e:MouseEvent):void{
- Tweener.addTween(MovieClip(e.target), {
- "scaleX":0.871248789932236,
- "scaleY":0.835073068893528,
- "time":0.3,
- "transition":"easeInSine"
- });
- });
- itemcase.addEventListener(MouseEvent.CLICK, this.ItemClick2);
- };
- i = (i + 1);
- };
- }
- else
- {
- this.items.loadMC.visible = false;
- };
- };
- };
- if (m.type == "allitems")
- {
- if (this.openeditems)
- {
- if (m.getString(0) != "")
- {
- allmyitems1 = m.getString(0).split(",");
- columnsPerRow1 = 10;
- ii = 0;
- while (ii < allmyitems1.length)
- {
- trace(allmyitems1.length);
- if (allmyitems1.length >= 55)
- {
- this.items.track.visible = true;
- this.items.slider.visible = true;
- };
- this.items.loadMC.visible = false;
- itemDetails12 = allmyitems1[ii];
- itemcase2 = new ItemCase();
- itemDetails2 = itemDetails12.split(":");
- this._scrollbar = new Scrollbar();
- this._scrollbar.init(this.items.content, this.items.contentMask, this.items.track, this.items.slider);
- if (((((((((((!(itemDetails2[0] == "")) || (!(itemDetails2[1] == ""))) || (!(itemDetails2[0] == " "))) || (!(itemDetails2[1] == " "))) || (!(itemDetails2[0] == null))) || (!(itemDetails2[1] == null))) || (!(itemDetails2[0] == undefined))) || (!(itemDetails2[1] == undefined))) || (!(itemDetails12 == ""))) || (!(itemDetails12 == " "))))
- {
- itemcase2.scaleX = 0.85;
- itemcase2.scaleY = 0.85;
- itemcase2.x = (((ii % columnsPerRow1) * (itemcase2.width + 5)) + 35);
- itemcase2.y = ((Math.floor((ii / columnsPerRow1)) * (itemcase2.height + 0.5)) + 8);
- itemcase2.name = String(itemDetails2[0]);
- if (int(itemDetails2[1]) >= 2)
- {
- itemcase2.howmany.text = ("" + String(itemDetails2[1]));
- };
- itemcase2.gotoAndStop(String(itemDetails2[0]));
- this.items.content.addChild(itemcase2);
- trace(("y:" + itemcase2.y));
- itemcase2.addEventListener(MouseEvent.ROLL_OVER, function (e:MouseEvent):void{
- var mySound:Sound = new blub2();
- mySound.play();
- Tweener.addTween(MovieClip(e.target), {
- "scaleX":1,
- "scaleY":1,
- "time":0.1,
- "transition":"easeInSine"
- });
- });
- itemcase2.addEventListener(MouseEvent.ROLL_OUT, function (e:MouseEvent):void{
- Tweener.addTween(MovieClip(e.target), {
- "scaleX":0.85,
- "scaleY":0.85,
- "time":0.3,
- "transition":"easeInSine"
- });
- });
- itemcase2.addEventListener(MouseEvent.CLICK, this.ItemClick);
- };
- ii = (ii + 1);
- };
- this.items.normal_btn.addEventListener(MouseEvent.CLICK, function ():*{
- removeChild(items);
- openeditems = false;
- loadinvent("normals");
- });
- this.items.prem_btn.addEventListener(MouseEvent.CLICK, function ():*{
- removeChild(items);
- openeditems = false;
- loadinvent("prems");
- });
- this.items.rare_btn.addEventListener(MouseEvent.CLICK, function ():*{
- removeChild(items);
- openeditems = false;
- loadinvent("rares");
- });
- this.items.ultra_btn.addEventListener(MouseEvent.CLICK, function ():*{
- removeChild(items);
- openeditems = false;
- loadinvent("ultras");
- });
- this.items.special_btn.addEventListener(MouseEvent.CLICK, function ():*{
- removeChild(items);
- openeditems = false;
- loadinvent("specials");
- });
- }
- else
- {
- this.items.loadMC.visible = false;
- };
- };
- };
- }
- public function myOnRelease(event:KeyboardEvent):void{
- switch (event.keyCode)
- {
- case Keyboard.UP:
- this._movingUp = false;
- break;
- case Keyboard.DOWN:
- this._movingDown = false;
- break;
- case Keyboard.LEFT:
- this._movingLeft = false;
- break;
- case Keyboard.RIGHT:
- this._movingRight = false;
- break;
- };
- }
- private function ItemClick2(e:MouseEvent):void{
- var theitem:String = e.currentTarget.name;
- if (this.onadd)
- {
- this.lobbyConnection.send("additem", theitem, this.clickedid);
- this.clickedid = "";
- this.onadd = false;
- this.onsee = false;
- this.openeditems = false;
- removeChild(this.items);
- };
- if (this.ondel)
- {
- this.lobbyConnection.send("delitem", theitem, this.clickedid);
- this.clickedid = "";
- this.ondel = false;
- this.onsee = false;
- this.openeditems = false;
- removeChild(this.items);
- };
- }
- private function ItemClick(e:MouseEvent):void{
- var mySound:Sound;
- var offer1:* = undefined;
- var offer2:* = undefined;
- var offer3:* = undefined;
- var offer4:* = undefined;
- var offer5:* = undefined;
- var offer6:* = undefined;
- var themen:* = undefined;
- var theitem:String = e.currentTarget.name;
- var theitem1:String = e.currentTarget.currentLabel;
- if (theitem == theitem1)
- {
- if (!this.giveoffer)
- {
- mySound = new klicksound111();
- mySound.play();
- };
- if (this.changeSkin)
- {
- this.changeSkin = false;
- if (theitem != null)
- {
- this.changemyskin(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changeeyes)
- {
- this.changeeyes = false;
- if (theitem != null)
- {
- this.changemyeyes(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changehands)
- {
- this.changehands = false;
- if (theitem != null)
- {
- this.changemyhands(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changemouth)
- {
- this.changemouth = false;
- if (theitem != null)
- {
- this.changemymouth(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changedealbg)
- {
- this.changedealbg = false;
- if (theitem != null)
- {
- this.changemydealbg(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changehead)
- {
- this.changehead = false;
- if (theitem != null)
- {
- this.changemyhead(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changefoot)
- {
- this.changefoot = false;
- if (theitem != null)
- {
- this.changemyfoot(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changewings)
- {
- this.changewings = false;
- if (theitem != null)
- {
- this.changemywings(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.changecharcolor)
- {
- this.changecharcolor = false;
- if (theitem != null)
- {
- this.changemycharcolor(theitem);
- };
- if (!this.cancloseinventory)
- {
- removeChild(this.items);
- this.cancloseinventory = true;
- this.openeditems = false;
- this.inventoryopen.blockMC.visible = false;
- };
- }
- else
- {
- if (this.giveoffer)
- {
- if (((((!(this.whichslot == "")) && (this.imonoffer)) && (!(theitem == null))) && (!(this.partnerid == ""))))
- {
- offer1 = String(this.HisOffer.offer1.currentLabel);
- offer2 = String(this.HisOffer.offer2.currentLabel);
- offer3 = String(this.HisOffer.offer3.currentLabel);
- offer4 = String(this.HisOffer.offer4.currentLabel);
- offer5 = String(this.HisOffer.offer5.currentLabel);
- offer6 = String(this.HisOffer.offer6.currentLabel);
- themen = String(this.HisOffer.hisoffer.currentLabel);
- if ((((((((!(offer1 == theitem)) && (!(offer2 == theitem))) && (!(offer3 == theitem))) && (!(offer4 == theitem))) && (!(offer5 == theitem))) && (!(offer6 == theitem))) && (!(themen == theitem))))
- {
- if (this.whichslot == "offer1")
- {
- this.HisOffer.offer1.gotoAndStop(String(theitem));
- this.HisOffer.offer1.howmany.text = "";
- };
- if (this.whichslot == "offer2")
- {
- this.HisOffer.offer2.gotoAndStop(String(theitem));
- this.HisOffer.offer2.howmany.text = "";
- };
- if (this.whichslot == "offer3")
- {
- this.HisOffer.offer3.gotoAndStop(String(theitem));
- this.HisOffer.offer3.howmany.text = "";
- };
- if (this.whichslot == "offer4")
- {
- this.HisOffer.offer4.gotoAndStop(String(theitem));
- this.HisOffer.offer4.howmany.text = "";
- };
- if (this.whichslot == "offer5")
- {
- this.HisOffer.offer5.gotoAndStop(String(theitem));
- this.HisOffer.offer5.howmany.text = "";
- };
- if (this.whichslot == "offer6")
- {
- this.HisOffer.offer6.gotoAndStop(String(theitem));
- this.HisOffer.offer6.howmany.text = "";
- };
- this.lobbyConnection.send("IwillGive", this.partnerid, this.whichslot, theitem);
- this.giveoffer = false;
- this.whichslot = "";
- this.openeditems = false;
- removeChild(this.items);
- this.canadd = true;
- this.addminus();
- }
- else
- {
- this.alert("You can't offer the same item at once");
- this.giveoffer = false;
- this.whichslot = "";
- this.openeditems = false;
- removeChild(this.items);
- this.addminus();
- };
- };
- }
- else
- {
- if (this.iwilloffer)
- {
- if (theitem == null)
- {
- trace(theitem);
- }
- else
- {
- if (this.MyOffer.offer != null)
- {
- this.MyOffer.offer.gotoAndStop(String(theitem));
- this.lobbyConnection.send("ioffer", this.fbuid, theitem);
- this.MyOffer.x = 31.4;
- this.MyOffer.y = -263.25;
- this.MyOffer.fbname.text = "";
- this.MyOffer.coinstxt.text = "0";
- this.MyOffer.dicetxt.text = "0";
- this.closeoffer.visible = true;
- this.MyOffer.deal_btn.visible = false;
- this.MyOffer.unlock_btn.visible = false;
- this.MyOffer.lockedmcc.visible = false;
- this.MyOffer.deal_btn.tabEnabled = false;
- this.MyOffer.unlock_btn.tabEnabled = false;
- this.closeoffer.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (iwilloffer)
- {
- lobbyConnection.send("iclose", fbuid, partnerid);
- myOfferRefresh();
- offered.removeChildren();
- };
- });
- this.openeditems = false;
- removeChild(this.items);
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- }
- private function changemyhead(thehead:String):void{
- this.dbhead = thehead;
- this.TheConnection.send("changesuit", thehead, "head");
- if (!this.cancloseinventory)
- {
- this.inventoryopen.headitem.gotoAndStop(thehead);
- this.inventoryopen.stickman.toparea.head.gotoAndStop(thehead);
- };
- }
- private function changemymouth(themouth:String):void{
- this.dbmouth = themouth;
- this.TheConnection.send("changesuit", themouth, "mouth");
- if (!this.cancloseinventory)
- {
- this.inventoryopen.mouthitem.gotoAndStop(themouth);
- this.inventoryopen.stickman.toparea.mouth.gotoAndStop(themouth);
- };
- }
- private function changemyhands(thehands:String):void{
- this.dbhands = thehands;
- trace(thehands);
- this.TheConnection.send("changesuit", thehands, "hands");
- if (!this.cancloseinventory)
- {
- this.inventoryopen.handitem.gotoAndStop(thehands);
- this.inventoryopen.stickman.toparea.hands.gotoAndStop(thehands);
- };
- }
- private function changemyeyes(theeyes:String):void{
- this.dbeyes = theeyes;
- trace(theeyes);
- this.TheConnection.send("changesuit", theeyes, "eyes");
- if (!this.cancloseinventory)
- {
- this.inventoryopen.eyesitem.gotoAndStop(theeyes);
- this.inventoryopen.stickman.toparea.eyes.gotoAndStop(theeyes);
- };
- }
- private function changemyfoot(thefoot:String):void{
- this.dbfoot = thefoot;
- trace(thefoot);
- this.TheConnection.send("changesuit", thefoot, "foot");
- if (!this.cancloseinventory)
- {
- this.inventoryopen.footitem.gotoAndStop(thefoot);
- this.inventoryopen.stickman.toparea.feet.gotoAndStop(thefoot);
- };
- }
- private function changemywings(thewings:String):void{
- this.dbwings = thewings;
- trace(thewings);
- this.TheConnection.send("changesuit", thewings, "wings");
- if (!this.cancloseinventory)
- {
- this.inventoryopen.wingsitem.gotoAndStop(thewings);
- this.inventoryopen.stickman.toparea.wings.gotoAndStop(thewings);
- };
- }
- private function changemycharcolor(thecharcolor:String):void{
- this.dbcharcolor = thecharcolor;
- trace(thecharcolor);
- this.TheConnection.send("changesuit", thecharcolor, "charcolor");
- if (!this.cancloseinventory)
- {
- this.inventoryopen.charcoloritem.gotoAndStop(thecharcolor);
- this.inventoryopen.stickman.toparea.charcolor.gotoAndStop(thecharcolor);
- this.inventoryopen.stickman.middle.charcolor.gotoAndStop(thecharcolor);
- this.inventoryopen.stickman.bottomarea.charcolor.gotoAndStop(thecharcolor);
- };
- }
- private function changemyskin(theskin:String):void{
- this.dbskin = theskin;
- this.TheConnection.send("changeskin", theskin);
- if (!this.cancloseinventory)
- {
- this.inventoryopen.skinitem.gotoAndStop(theskin);
- this.mystats.gotoAndStop(theskin);
- };
- }
- private function changemydealbg(thedealbg:String):void{
- this.dbdealbg = thedealbg;
- this.TheConnection.send("changedealbg", thedealbg);
- if (!this.cancloseinventory)
- {
- this.inventoryopen.dealitem.gotoAndStop(thedealbg);
- };
- }
- private function addskin():void{
- this.mystats.nametxt.text = this.fbname;
- this.mystats.coinstxt.text = String(this.dbcoins);
- this.mystats.dicetxt.text = String(this.dbdice);
- this.mystats.gotoAndStop(String(this.dbskin));
- this.mystats.badge.gotoAndStop(int(this.dblevel));
- var fbpic:* = (("https://graph.facebook.com/" + String(this.fbuid)) + "/picture");
- var photo:* = new Loader();
- photo.load(new URLRequest(fbpic));
- this.mystats.pic_mcc.picwhere.addChild(photo);
- if (currentFrame == 2)
- {
- this.mystats.thechar.visible = true;
- this.mystats.thechar.stickman.toparea.head.gotoAndStop(this.dbhead);
- this.mystats.thechar.stickman.toparea.mouth.gotoAndStop(this.dbmouth);
- this.mystats.thechar.stickman.toparea.eyes.gotoAndStop(this.dbeyes);
- this.mystats.thechar.stickman.toparea.hands.gotoAndStop(this.dbhands);
- this.mystats.thechar.stickman.toparea.feet.gotoAndStop(this.dbfoot);
- this.mystats.thechar.stickman.toparea.wings.gotoAndStop(this.dbwings);
- this.mystats.thechar.stickman.toparea.charcolor.gotoAndStop(this.dbcharcolor);
- this.mystats.thechar.stickman.middle.charcolor.gotoAndStop(this.dbcharcolor);
- this.mystats.thechar.stickman.bottomarea.charcolor.gotoAndStop(this.dbcharcolor);
- }
- else
- {
- this.mystats.thechar.visible = false;
- };
- }
- private function myOfferRefresh():void{
- this.MyOffer.fbname.text = "";
- this.MyOffer.picwhere.alpha = 0;
- this.MyOffer.kick_btn.visible = false;
- this.MyOffer.deal_btn.visible = false;
- this.MyOffer.unlock_btn.visible = false;
- this.MyOffer.lockedmcc.visible = false;
- this.MyOffer.hisoffer1.gotoAndStop("none");
- this.MyOffer.hisoffer2.gotoAndStop("none");
- this.MyOffer.hisoffer3.gotoAndStop("none");
- this.MyOffer.hisoffer4.gotoAndStop("none");
- this.MyOffer.hisoffer5.gotoAndStop("none");
- this.MyOffer.hisoffer6.gotoAndStop("none");
- this.MyOffer.hisoffer1.howmany.text = "";
- this.MyOffer.hisoffer2.howmany.text = "";
- this.MyOffer.hisoffer3.howmany.text = "";
- this.MyOffer.hisoffer4.howmany.text = "";
- this.MyOffer.hisoffer5.howmany.text = "";
- this.MyOffer.hisoffer6.howmany.text = "";
- this.MyOffer.unlock_btn.visible = false;
- this.MyOffer.deal_btn.visible = false;
- this.MyOffer.lockedmcc.visible = false;
- this.MyOffer.x = -500;
- this.MyOffer.y = -500;
- this.MyOffer.coinstxt.text = "0";
- this.MyOffer.dicetxt.text = "0";
- this.closeoffer.visible = false;
- this.makeoffer.visible = true;
- this.iwilloffer = false;
- this.imbusy = false;
- }
- private function allRefresh(m:Message):void{
- this.mystats.dicetxt.text = m.getInt(0).toString();
- this.mystats.coinstxt.text = m.getInt(0).toString();
- }
- private function hisOfferRefresh():void{
- this.HisOffer.x = -500;
- this.HisOffer.y = -500;
- this.HisOffer.fbname.text = "";
- this.HisOffer.hisoffer.gotoAndStop("none");
- this.HisOffer.offer1.gotoAndStop("none");
- this.HisOffer.offer2.gotoAndStop("none");
- this.HisOffer.offer3.gotoAndStop("none");
- this.HisOffer.offer4.gotoAndStop("none");
- this.HisOffer.offer5.gotoAndStop("none");
- this.HisOffer.offer6.gotoAndStop("none");
- this.HisOffer.lock_btn.visible = true;
- this.HisOffer.lockedmcc.visible = false;
- this.HisOffer.putcoins.visible = false;
- this.HisOffer.putdice.visible = false;
- this.HisOffer.coinstxt.text = "0";
- this.HisOffer.dicetxt.text = "0";
- this.HisOffer.putcoins.coinstxt.text = "0";
- this.HisOffer.putdice.dicetxt.text = "0";
- this.imbusy = false;
- this.partnerid = "";
- this.imonoffer = false;
- }
- private function gag():void{
- if (String(root.loaderInfo.parameters.fb_app_root) != "https://apps.facebook.com/dice_rules/")
- {
- this.TheConnection.disconnect();
- };
- }
- public function getName(event:Event):void{
- var you:* = URLLoader(event.target);
- var you2:* = you.data.split("name").join("Name");
- var you3:* = you2.split(":");
- var you4:* = you3[1].split(",");
- var realname:* = you4[0].split('"');
- this.fbname = realname[1];
- }
- private function letsStart():void{
- var idkwhatsthat:Boolean;
- gotoAndStop(2);
- this.addskin();
- this.mute_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (sounds == false)
- {
- sounds = true;
- trace(sounds);
- mute_btn.gotoAndStop(2);
- issPlaying = false;
- lastPosition = myChannel.position;
- myChannel.stop();
- }
- else
- {
- if (issPlaying == false)
- {
- issPlaying = true;
- myChannel = myMusic.play(lastPosition);
- };
- sounds = false;
- trace(sounds);
- mute_btn.gotoAndStop(1);
- };
- });
- this.fullscreen_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (fullscreen == false)
- {
- stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
- fullscreen = true;
- trace("fullscreen");
- }
- else
- {
- if (fullscreen == true)
- {
- stage.displayState = StageDisplayState.NORMAL;
- fullscreen = false;
- trace("not fullscreen");
- };
- };
- });
- this.quality_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (myquality == "high")
- {
- stage.quality = StageQuality.LOW;
- myquality = "low";
- trace("low quality");
- }
- else
- {
- if (myquality == "low")
- {
- stage.quality = StageQuality.BEST;
- myquality = "high";
- trace("high quality");
- };
- };
- });
- this.lottery_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (eButtons)
- {
- eButtons = false;
- lottery = new Lottery();
- lottery.alpha = 0;
- lottery.width = 650;
- lottery.height = 450;
- lottery.x = 325.2;
- lottery.y = 193.55;
- addChild(lottery);
- Tweener.addTween(lottery, {
- "x":325.2,
- "y":193.55,
- "width":650,
- "height":450,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- lottery.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("loadplayer", fbuid, "newdb");
- removeChild(e.target.parent);
- eButtons = true;
- });
- TheConnection.send("getLottery");
- };
- });
- this.slot_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!machine)
- {
- machine = true;
- slotmachine = new SlotMachine();
- slotmachine.alpha = 0;
- slotmachine.width = 700;
- slotmachine.height = 500;
- slotmachine.x = 52.8;
- slotmachine.y = 96.15;
- addChild(slotmachine);
- Tweener.addTween(slotmachine, {
- "x":52.8,
- "y":96.15,
- "width":700,
- "height":500,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- slotmachine.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- machine = false;
- spinning = false;
- });
- slotmachine.spin_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((dbcoins >= 10) && (!(spinning))))
- {
- slotmachine.s1.gotoAndStop(2);
- slotmachine.s2.gotoAndStop(2);
- slotmachine.s3.gotoAndStop(2);
- TheConnection.send("roll");
- spinning = true;
- };
- });
- slotmachine.spin_btn2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((dbdice >= 10) && (!(spinning))))
- {
- slotmachine.s1.gotoAndStop(2);
- slotmachine.s2.gotoAndStop(2);
- slotmachine.s3.gotoAndStop(2);
- TheConnection.send("roll2");
- spinning = true;
- };
- });
- };
- });
- idkwhatsthat = true;
- idkwhatsthat = idkwhatsthat;
- this.Inventory_btn.buttonMode = idkwhatsthat;
- this.single_btn.addEventListener(MouseEvent.CLICK, this.startGame);
- this.Inventory_btn.addEventListener(MouseEvent.ROLL_OVER, this.items_btn_over);
- this.Inventory_btn.addEventListener(MouseEvent.ROLL_OUT, this.items_btn_out);
- this.Inventory_btn.addEventListener(MouseEvent.MOUSE_DOWN, this.items_btn_start);
- this.clan_btn.addEventListener(MouseEvent.CLICK, this.openClan);
- this.minigames_btn.addEventListener(MouseEvent.CLICK, this.minigames);
- this.alltop10_btn.addEventListener(MouseEvent.CLICK, this.alltop10);
- this.exchange_btn.addEventListener(MouseEvent.CLICK, this.exchange);
- this.allshop_btn.addEventListener(MouseEvent.CLICK, this.allshop_mc);
- this.multiplayer_btn.addEventListener(MouseEvent.CLICK, this.multiplayer_go);
- }
- public function multiplayer_go(ev:MouseEvent):void{
- this.TheConnection.send("checkforpass", this.fbuid);
- if (((this.eButtons) && (!(this.multiisopen))))
- {
- if (this.pass == "")
- {
- this.pass = this.psw.text;
- };
- this.eButtons = false;
- this.multiisopen = true;
- this.multiopen = new MultiOpen();
- this.multiopen.alpha = 0;
- this.multiopen.width = 700;
- this.multiopen.height = 500;
- this.multiopen.x = 43.55;
- this.multiopen.y = 123.15;
- addChild(this.multiopen);
- Tweener.addTween(this.multiopen, {
- "x":43.55,
- "y":123.15,
- "width":700,
- "height":500,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.multiopen.a_btn.tabEnabled = false;
- this.multiopen.b_btn.tabEnabled = false;
- this.multiopen.c_btn.tabEnabled = false;
- this.multiopen.d_btn.tabEnabled = false;
- this.multiopen.e_btn.tabEnabled = false;
- this.multiopen.f_btn.tabEnabled = false;
- this.multiopen.aa_btn.tabEnabled = false;
- this.multiopen.bb_btn.tabEnabled = false;
- this.multiopen.cc_btn.tabEnabled = false;
- this.TheConnection.send("countOnline", this.fbuid);
- this.multiopen.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("loadplayer", fbuid, "newdb");
- if (!joining)
- {
- removeChild(MovieClip(e.target.parent));
- eButtons = true;
- multiisopen = false;
- };
- });
- this.multiopen.a_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("normal_a");
- };
- });
- this.multiopen.b_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("normal_b");
- };
- });
- this.multiopen.c_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("normal_c");
- };
- });
- this.multiopen.d_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("normal_d");
- };
- });
- this.multiopen.e_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("normal_e");
- };
- });
- this.multiopen.f_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("normal_f");
- };
- });
- this.multiopen.aa_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("a_plus");
- };
- });
- this.multiopen.bb_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("b_plus");
- };
- });
- this.multiopen.cc_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!joining)
- {
- golobby("c_plus");
- };
- });
- };
- }
- public function items_btn_over(event:MouseEvent):*{
- this.Inventory_btn.gotoAndStop(2);
- }
- public function items_btn_out(event:MouseEvent):*{
- this.Inventory_btn.gotoAndPlay(3);
- }
- public function items_btn_start(event:MouseEvent):*{
- this.showInventory();
- }
- public function startGame(ev:MouseEvent):void{
- gotoAndStop(6);
- this.player.inner1.head.gotoAndStop(this.dbhead);
- this.player.inner1.eyes.gotoAndStop(this.dbeyes);
- this.player.inner1.wings.gotoAndStop(this.dbwings);
- this.player.inner1.face1.gotoAndStop(this.dbmouth);
- this.player.inner1.hand2.gotoAndStop(this.dbhands);
- this.player.inner1.shoe1.gotoAndStop(this.dbfoot);
- this.player.inner1.shoe2.gotoAndStop(this.dbfoot);
- this.player.x = 124.15;
- this.player.y = 183;
- this.player.visible = true;
- this.GameOver.gotoAndStop(1);
- this.CountFinish = 0;
- this.dead = false;
- this.enemyArr = [];
- this.intervalIntervalForAdding = 50;
- this.enemySpeed = 6;
- this.enBallInterval = 0;
- this.enBallIntervalForAdding = 100;
- this.score = 0;
- this.score_txt.text = ("Score: " + String(this.score));
- this.countUP.visible = true;
- this.countUP.gotoAndPlay(0);
- setTimeout(this.countFinish, 3000);
- }
- public function countFinish():*{
- this.CountFinish = 1;
- if (((currentFrame == 6) && (this.CountFinish == 1)))
- {
- this.solid1.gotoAndPlay(2);
- addEventListener(Event.ENTER_FRAME, this.update);
- stage.addEventListener(KeyboardEvent.KEY_DOWN, this.keyDown);
- stage.addEventListener(KeyboardEvent.KEY_UP, this.keyUp);
- stage.addEventListener(Event.ENTER_FRAME, this.loop);
- };
- }
- internal function update(e:Event):void{
- if (((this.keys[Keyboard.RIGHT]) || (this.keys[Keyboard.D])))
- {
- this.player.x = (this.player.x + 8);
- };
- if (((this.keys[Keyboard.LEFT]) || (this.keys[Keyboard.A])))
- {
- this.player.x = (this.player.x - 8);
- };
- if (((this.keys[Keyboard.UP]) || (this.keys[Keyboard.W])))
- {
- this.player.y = (this.player.y - 9);
- };
- if (((this.keys[Keyboard.DOWN]) || (this.keys[Keyboard.S])))
- {
- this.player.y = (this.player.y + 9);
- };
- }
- internal function keyDown(e:KeyboardEvent):void{
- this.keys[e.keyCode] = true;
- }
- internal function keyUp(e:KeyboardEvent):void{
- this.keys[e.keyCode] = false;
- }
- internal function loop(e:Event):*{
- var en:* = undefined;
- var nen:* = undefined;
- if (((!(this.dead)) && (this.CountFinish == 1)))
- {
- this.score = (this.score + 1);
- this.score_txt.text = ("Score: " + String(this.score));
- this.enemySpeed = (6 + ((this.score / 200) * 3));
- this.enBallInterval = (this.enBallInterval + 1);
- if (this.enBallInterval > this.enBallIntervalForAdding)
- {
- this.enBallInterval = 0;
- this.enBall = new jellyFishs();
- this.enBall.x = 1000;
- this.enBall.y = this.e1RandomY();
- this.enemyArr.push(this.enBall);
- addChild(this.enBall);
- };
- this.intervalForAdding = (this.intervalForAdding + 1);
- if (this.intervalForAdding == this.intervalIntervalForAdding)
- {
- this.intervalForAdding = 0;
- if (this.intervalIntervalForAdding > 0)
- {
- (this.intervalIntervalForAdding - 1);
- };
- this.enWall = new Aligator();
- this.enWall.x = 1000;
- this.enWall.y = this.e1RandomY();
- this.enemyArr.push(this.enWall);
- addChild(this.enWall);
- if (this.score >= 500)
- {
- this.enemySpeed = 10;
- this.intervalIntervalForAdding = 100;
- };
- if (this.score >= 1000)
- {
- this.enemySpeed = 15;
- this.intervalIntervalForAdding = 150;
- };
- if (this.score >= 1500)
- {
- this.enemySpeed = 17;
- this.intervalIntervalForAdding = 160;
- };
- if (this.score >= 2000)
- {
- this.enemySpeed = 18;
- this.intervalIntervalForAdding = 175;
- };
- if (this.score >= 3000)
- {
- this.enemySpeed = 20;
- this.intervalIntervalForAdding = 190;
- };
- if (this.score >= 4000)
- {
- this.enemySpeed = 24;
- this.intervalIntervalForAdding = 200;
- };
- if (this.score >= 5000)
- {
- this.enemySpeed = 28;
- this.intervalIntervalForAdding = 210;
- };
- if (this.score >= 6000)
- {
- this.enemySpeed = 30;
- this.enBall.y = this.player.y;
- this.enWall.y = this.player.y;
- this.intervalIntervalForAdding = 210;
- };
- };
- en = 0;
- while (en < this.enemyArr.length)
- {
- this.enemyArr[en].x = (this.enemyArr[en].x - this.enemySpeed);
- if (this.enemyArr[en].hitTestObject(this.player))
- {
- this.dead = true;
- this.CountFinish = 0;
- this.GameOver.gotoAndStop(2);
- this.GameOver.scoretxt.text = ("Score: " + String(this.score));
- removeEventListener(Event.ENTER_FRAME, this.update);
- stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.keyDown);
- stage.removeEventListener(KeyboardEvent.KEY_UP, this.keyUp);
- this.GameOver.back_btn.addEventListener(MouseEvent.CLICK, function ():*{
- letsStart();
- });
- this.GameOver.again_btn.addEventListener(MouseEvent.CLICK, this.startGame);
- };
- if (this.enemyArr[en].x < -55)
- {
- removeChild(this.enemyArr[en]);
- this.enemyArr.splice(en, 1);
- };
- en = (en + 1);
- };
- if (this.player.x < 75)
- {
- this.player.x = 75;
- };
- if (this.player.x > 580)
- {
- this.player.x = 580;
- };
- if (this.player.y < 75)
- {
- this.player.y = 75;
- };
- if (this.player.y > 370)
- {
- this.player.y = 370;
- };
- }
- else
- {
- this.player.visible = false;
- nen = 0;
- while (nen < this.enemyArr.length)
- {
- removeChild(this.enemyArr[nen]);
- nen = (nen + 1);
- };
- this.enemyArr = [];
- stage.removeEventListener(Event.ENTER_FRAME, this.loop);
- };
- }
- public function e1RandomY():*{
- return ((Math.random() * 300) + 50);
- }
- public function openClan(e:Event):*{
- this.clan = new Clans();
- this.clan.alpha = 0;
- this.clan.width = 700;
- this.clan.height = 500;
- this.clan.x = 340.55;
- this.clan.y = 210.1;
- addChild(this.clan);
- Tweener.addTween(this.clan, {
- "x":340.55,
- "y":210.1,
- "width":700,
- "height":500,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.TheConnection.send("openClans");
- }
- public function minigames(e:Event):*{
- this.minigame = new playminigames();
- this.minigame.alpha = 0;
- this.minigame.x = 107.85;
- this.minigame.y = 89.7;
- addChild(this.minigame);
- Tweener.addTween(this.minigame, {
- "x":107.85,
- "y":89.7,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.minigame.flappybird_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- minigame.gotoAndStop(2);
- startfly();
- });
- this.minigame.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- });
- }
- public function allshop_mc(e:Event):*{
- this.openallshop = new OpenShop();
- this.openallshop.alpha = 0;
- this.openallshop.x = 325;
- this.openallshop.y = 225;
- addChild(this.openallshop);
- Tweener.addTween(this.openallshop, {
- "x":325,
- "y":225,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.openallshop.dshop.addEventListener(MouseEvent.CLICK, this.openDshop);
- this.openallshop.nshop.addEventListener(MouseEvent.CLICK, this.openShop);
- this.openallshop.rankshop_btn.addEventListener(MouseEvent.CLICK, this.rankshop_mc);
- this.openallshop.cashshop_btn.addEventListener(MouseEvent.CLICK, this.cashshop_mc);
- this.openallshop.ultrshop_btn.addEventListener(MouseEvent.CLICK, this.ultrashop_mc);
- this.openallshop.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(openallshop);
- });
- }
- public function ultrashop_mc(e:Event):*{
- this.ultrashopopen = new UltraShop();
- this.ultrashopopen.alpha = 0;
- this.ultrashopopen.x = 325;
- this.ultrashopopen.y = 225;
- addChild(this.ultrashopopen);
- Tweener.addTween(this.ultrashopopen, {
- "x":325,
- "y":225,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.ultrashopopen.matrix.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- BuyPrem("matrix", "Matrix Skin");
- });
- this.ultrashopopen.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(ultrashopopen);
- });
- }
- public function cashshop_mc(e:Event):*{
- this.cashshopopen = new CashShop();
- this.cashshopopen.alpha = 0;
- this.cashshopopen.x = 325;
- this.cashshopopen.y = 225;
- addChild(this.cashshopopen);
- this._scrollbar = new Scrollbar();
- this._scrollbar.init(this.cashshopopen.content, this.cashshopopen.contentMask, this.cashshopopen.track, this.cashshopopen.slider);
- this.cashshopopen.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(cashshopopen);
- });
- Tweener.addTween(this.cashshopopen, {
- "x":325,
- "y":225,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.cashshopopen.content.get_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio");
- });
- this.cashshopopen.content.get_btn2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio2");
- });
- this.cashshopopen.content.get_btn3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio3");
- });
- this.cashshopopen.content.get_btn4.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio4");
- });
- this.cashshopopen.content.get_btn5.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio5");
- });
- this.cashshopopen.content.get_btn6.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio6");
- });
- this.cashshopopen.content.get_btn7.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio7");
- });
- this.cashshopopen.content.get_btn8.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio8");
- });
- this.cashshopopen.content.get_btn9.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio9");
- });
- this.cashshopopen.content.get_btn10.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio10");
- });
- this.cashshopopen.content.get_btn11.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio11");
- });
- this.cashshopopen.content.get_btn12.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("cashtoslitherio12");
- });
- }
- public function rankshop_mc(e:Event):*{
- this.rankshopopen = new RankShop();
- this.rankshopopen.alpha = 0;
- this.rankshopopen.x = 325;
- this.rankshopopen.y = 225;
- addChild(this.rankshopopen);
- Tweener.addTween(this.rankshopopen, {
- "x":325,
- "y":225,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.rankshopopen.get_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("getleve2");
- });
- this.rankshopopen.cancel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(rankshopopen);
- });
- }
- public function exchange(e:Event):*{
- this.exchanges = new GetTokens();
- this.exchanges.alpha = 0;
- this.exchanges.x = 335.8;
- this.exchanges.y = 199.75;
- addChild(this.exchanges);
- this._scrollbar = new Scrollbar();
- this._scrollbar.init(this.exchanges.content, this.exchanges.contentMask, this.exchanges.track, this.exchanges.slider);
- this.exchanges.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(exchanges);
- TheConnection.send("loadplayer", fbuid, "newdb");
- });
- Tweener.addTween(this.exchanges, {
- "x":335.8,
- "y":199.75,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.TheConnection.send("GetTokens");
- this.exchanges.coinstxt.text = String(this.dbcoins);
- this.exchanges.dicetxt.text = String(this.dbdice);
- this.exchanges.content.get_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange1");
- });
- this.exchanges.content.get_btn2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange2");
- });
- this.exchanges.content.get_btn3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange3");
- });
- this.exchanges.content.get_btn4.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange4");
- });
- this.exchanges.content.get_btn5.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange5");
- });
- this.exchanges.content.get_btn6.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange6");
- });
- this.exchanges.content.get_btn7.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange7");
- });
- this.exchanges.content.get_btn8.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange8");
- });
- this.exchanges.content.get_btn9.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange9");
- });
- this.exchanges.content.get_btn10.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange10");
- });
- this.exchanges.content.get_btn11.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange11");
- });
- this.exchanges.content.get_btn12.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange12");
- });
- this.exchanges.content.get_btn13.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange13");
- });
- this.exchanges.content.get_btn14.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("exchange14");
- });
- }
- public function alltop10(e:Event):*{
- this.alltops10 = new Tops10();
- this.alltops10.alpha = 0;
- this.alltops10.x = 144.25;
- this.alltops10.y = 107.65;
- addChild(this.alltops10);
- Tweener.addTween(this.alltops10, {
- "x":144.25,
- "y":107.65,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.alltops10.tops.items_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!more2)
- {
- more2 = true;
- topitems = new TOPITEMS();
- addChild(topitems);
- topitems.x = 350.7;
- topitems.y = -389;
- Tweener.addTween(topitems, {
- "x":350.7,
- "y":93.5,
- "width":214.3,
- "height":455,
- "alpha":1,
- "time":1,
- "transition":"easeOutSine"
- });
- topitems.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (more2)
- {
- more2 = false;
- removeChild(topitems);
- };
- });
- TheClient.bigDB.loadRange("Maindb", "itemcount", [], null, null, 10, function (theitem:Array):void{
- var co:DatabaseObject;
- var top:* = undefined;
- var playid:* = undefined;
- var fbpic:* = undefined;
- var photo:* = undefined;
- var y:* = 2;
- var x:* = 4.95;
- topitems.loading.visible = false;
- var i:int;
- while (i < theitem.length)
- {
- co = (theitem[i] as DatabaseObject);
- top = new TOPI();
- trace(co.key);
- y = (y + 27);
- playid = co.key.split("fb");
- fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
- photo = new Loader();
- photo.load(new URLRequest(fbpic));
- photo.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void{
- var loader:Loader = LoaderInfo(e.target).loader;
- loader.width = 23.4;
- loader.height = 22.4;
- });
- topitems.addChild(top);
- trace(co.itemcount);
- top.itemtxt.text = String(co.itemcount);
- top.y = y;
- top.x = x;
- top.picwhere.addChild(photo);
- if (i == 0)
- {
- top.nametxt.htmlText = ("<font color='#00FFFF'>[1]" + co.fbname);
- }
- else
- {
- if (i == 1)
- {
- top.nametxt.htmlText = (("<font color='#FF0000'>[2]" + co.fbname) || ("not support"));
- }
- else
- {
- top.nametxt.text = ((co.fbname) || ("not support"));
- };
- };
- i = (i + 1);
- };
- });
- };
- });
- this.alltops10.tops.more_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!more)
- {
- more = true;
- topcoins = new TopCoins();
- addChild(topcoins);
- topcoins.x = 248.9;
- topcoins.y = 18.4;
- topcoins.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (more)
- {
- more = false;
- removeChild(topcoins);
- };
- });
- TheClient.bigDB.loadRange("Maindb", "coins", [], null, null, 10, function (thedice:Array):void{
- var co:DatabaseObject;
- var top:* = undefined;
- var playid:* = undefined;
- var fbpic:* = undefined;
- var photo:* = undefined;
- var y:* = 8.8;
- var x:* = -91.6;
- topcoins.loading.visible = false;
- var i:int;
- while (i < thedice.length)
- {
- co = (thedice[i] as DatabaseObject);
- top = new TOP2();
- trace(co.key);
- y = (y + 31);
- playid = co.key.split("fb");
- fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
- photo = new Loader();
- photo.load(new URLRequest(fbpic));
- photo.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void{
- var loader:Loader = LoaderInfo(e.target).loader;
- loader.width = 23.4;
- loader.height = 22.4;
- });
- topcoins.addChild(top);
- top.coinstxt.text = String(co.coins);
- top.y = y;
- top.x = x;
- top.picwhere.addChild(photo);
- if (i == 0)
- {
- top.nametxt.htmlText = ("<font color='#00FFFF'>[1]" + co.fbname);
- }
- else
- {
- if (i == 1)
- {
- top.nametxt.htmlText = (("<font color='#FF0000'>[2]" + co.fbname) || ("not support"));
- }
- else
- {
- top.nametxt.text = ((co.fbname) || ("not support"));
- };
- };
- i = (i + 1);
- };
- });
- };
- });
- this.TheClient.bigDB.loadRange("Maindb", "dice", [], null, null, 10, function (thedice:Array):void{
- var co:DatabaseObject;
- var top:* = undefined;
- var playid:* = undefined;
- var fbpic:* = undefined;
- var photo:* = undefined;
- var y:* = 8.8;
- var x:* = -91.6;
- alltops10.tops.loading.visible = false;
- var i:int;
- while (i < thedice.length)
- {
- co = (thedice[i] as DatabaseObject);
- top = new TOP();
- top.dicetxt.text = String(co.dice);
- top.y = y;
- top.x = x;
- y = (y + 31);
- playid = co.key.split("fb");
- fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
- photo = new Loader();
- photo.load(new URLRequest(fbpic));
- top.picwhere.addChild(photo);
- if (i == 0)
- {
- top.nametxt.htmlText = ("<font color='#00FFFF'>[1]" + co.fbname);
- }
- else
- {
- if (i == 1)
- {
- top.nametxt.htmlText = (("<font color='#FF0000'>[2]" + co.fbname) || ("not support"));
- }
- else
- {
- top.nametxt.text = ((co.fbname) || ("not support"));
- };
- };
- photo.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e:Event):void{
- var loader:Loader = LoaderInfo(e.target).loader;
- loader.width = 23.4;
- loader.height = 22.4;
- });
- alltops10.tops.addChild(top);
- i = (i + 1);
- };
- });
- this.alltops10.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- });
- }
- private function handleSearch(connection:Connection):void{
- connection.addMessageHandler("*", this.handleMessages);
- }
- private function onEnter():*{
- var snow:Snow;
- snow = null;
- if (this.snowing == true)
- {
- snow = new Snow();
- snow.gotoAndStop(Math.round(Math.ceil((Math.random() * 10))));
- snow.x = (650 * Math.random());
- snow.y = 0;
- snow.width = (snow.height = (1 + (5 * Math.random())));
- snow.xSpeed = (-2 + (4 * Math.random()));
- snow.ySpeed = (1 + (4 * Math.random()));
- snow.at = (-0.001 - (0.001 * Math.random()));
- snow.vt = 0;
- addChild(snow);
- snow.addEventListener(Event.ENTER_FRAME, this.onSnowEnter);
- };
- }
- private function onSnowEnter(e:Event):void{
- var snow:Snow;
- snow = (e.currentTarget as Snow);
- snow.x = (snow.x + snow.xSpeed);
- snow.y = (snow.y + snow.ySpeed);
- if (snow.y >= 510)
- {
- snow.addEventListener(Event.ENTER_FRAME, this.onMeltingEnter);
- };
- }
- private function onMeltingEnter(e:Event):void{
- var snow:Snow;
- snow = (e.currentTarget as Snow);
- addChild(snow);
- snow.removeEventListener(Event.ENTER_FRAME, this.onSnowEnter);
- snow.vt = (snow.vt + snow.at);
- snow.alpha = (snow.alpha + snow.vt);
- if (snow.alpha <= 0)
- {
- snow.removeEventListener(Event.ENTER_FRAME, this.onMeltingEnter);
- removeChild(snow);
- };
- }
- private function startSnow(shit:*):*{
- if (this.snowing == true)
- {
- this.snowing = false;
- }
- else
- {
- this.snowing = true;
- };
- }
- private function openShop(e:Event):void{
- if (((!(this.isshopopen)) && (this.eButtons)))
- {
- this.eButtons = false;
- this.isshopopen = true;
- this.shopopen = new ShopOpen();
- this.shopopen.alpha = 0;
- this.shopopen.x = -45.45;
- this.shopopen.y = 2.6;
- addChild(this.shopopen);
- Tweener.addTween(this.shopopen, {
- "x":-45.45,
- "y":2.6,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.shopopen.content.giftbox.price_txt.text = "Price: 30";
- this.shopopen.content.chinahat.price_txt.text = "Price: 500";
- this.shopopen.content.lolface.price_txt.text = "Price: 500";
- this.shopopen.content.angrymouth.price_txt.text = "Price: 500";
- this.shopopen.content.happymouths.price_txt.text = "Price: 500";
- this.shopopen.content.Reggae.price_txt.text = "Price: 350";
- this.shopopen.content.suprisedeyes.price_txt.text = "Price: 350";
- this.shopopen.content.sadeyes.price_txt.text = "Price: 350";
- this.shopopen.content.knifes.price_txt.text = "Price: 600";
- this.shopopen.content.giftbox.name_txt.text = "Gift Box";
- this.shopopen.content.chinahat.name_txt.text = "China Hat";
- this.shopopen.content.lolface.name_txt.text = "Lol Face";
- this.shopopen.content.angrymouth.name_txt.text = "Angry Mouth";
- this.shopopen.content.happymouths.name_txt.text = "Happy Mouth";
- this.shopopen.content.Reggae.name_txt.text = "Reggae Hat";
- this.shopopen.content.suprisedeyes.name_txt.text = "Suprised Eyes";
- this.shopopen.content.sadeyes.name_txt.text = "Sad Eyes";
- this.shopopen.content.knifes.name_txt.text = "Knifess";
- this.shopopen.content.giftbox.item.gotoAndStop("giftbox");
- this.shopopen.content.chinahat.item.gotoAndStop("chinahat");
- this.shopopen.content.lolface.item.gotoAndStop("lolface");
- this.shopopen.content.angrymouth.item.gotoAndStop("angrymouth");
- this.shopopen.content.happymouths.item.gotoAndStop("happymouths");
- this.shopopen.content.Reggae.item.gotoAndStop("Reggae");
- this.shopopen.content.suprisedeyes.item.gotoAndStop("suprisedeyes");
- this.shopopen.content.sadeyes.item.gotoAndStop("sadeyes");
- this.shopopen.content.knifes.item.gotoAndStop("knifes");
- this.shopopen.content.giftbox.buy_btn.tabEnabled = false;
- this.shopopen.content.chinahat.buy_btn.tabEnabled = false;
- this.shopopen.content.lolface.buy_btn.tabEnabled = false;
- this.shopopen.content.angrymouth.buy_btn.tabEnabled = false;
- this.shopopen.content.happymouths.buy_btn.tabEnabled = false;
- this.shopopen.content.Reggae.buy_btn.tabEnabled = false;
- this.shopopen.content.suprisedeyes.buy_btn.tabEnabled = false;
- this.shopopen.content.sadeyes.buy_btn.tabEnabled = false;
- this.shopopen.content.knifes.buy_btn.tabEnabled = false;
- this.shopopen.content.knifes.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("knifes");
- });
- this.shopopen.content.sadeyes.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("sadeyes");
- });
- this.shopopen.content.suprisedeyes.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("suprisedeyes");
- });
- this.shopopen.content.Reggae.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("Reggae");
- });
- this.shopopen.content.chinahat.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("chinahat");
- });
- this.shopopen.content.lolface.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("lolface");
- });
- this.shopopen.content.angrymouth.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("angrymouth");
- });
- this.shopopen.content.happymouths.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("happymouths");
- });
- this.shopopen.content.giftbox.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- buyItem("giftbox");
- });
- this._scrollbar = new Scrollbar();
- this._scrollbar.init(this.shopopen.content, this.shopopen.contentMask, this.shopopen.track, this.shopopen.slider);
- this.shopopen.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("loadplayer", fbuid, "newdb");
- isshopopen = false;
- eButtons = true;
- removeChild(e.target.parent);
- });
- };
- }
- private function buyItem(item:String):void{
- if (this.isshopopen)
- {
- this.TheConnection.send("buyItem", item);
- this.shopopen.loadblock.visible = true;
- };
- }
- private function mouseDown(e:MouseEvent):void{
- switch (e.currentTarget.name)
- {
- case "pshop":
- this.openPshop();
- break;
- };
- }
- private function updateOffer(offerz:String):void{
- var offerlist:Array;
- var columnsPerRow:int;
- var i:int;
- var thelist:String;
- var user:* = undefined;
- if (offerz.length > 0)
- {
- offerlist = offerz.split("~");
- columnsPerRow = 3;
- while (this.offersList.source.numChildren > 0)
- {
- this.offersList.source.removeChildAt(0);
- };
- i = 0;
- while (i < offerlist.length)
- {
- thelist = offerlist[i];
- user = thelist.split(";");
- if (user[1] != "nooffer")
- {
- this.offered = new Offered();
- this.offered.thename.text = String(user[2]);
- this.offered.fbid.text = String(user[3]);
- this.offered.gotoAndStop(String(user[1]));
- this.offered.item.gotoAndStop(String(user[0]));
- trace(user);
- this.offered.trusttxt.text = ("Trust: " + user[5].toString());
- this.offered.dealbg.gotoAndStop(String(user[4]));
- this.offered.x = ((i % columnsPerRow) * (this.offered.width + 14));
- this.offered.y = (Math.floor((i / columnsPerRow)) * (this.offered.height + 5));
- this.offersContainer.addChild(this.offered);
- this.offersList.update();
- if (this.offered.currentFrame >= 2)
- {
- this.offered.buttonMode = true;
- };
- this.offered.addEventListener(MouseEvent.ROLL_OVER, function (e:MouseEvent):void{
- Tweener.addTween(MovieClip(e.target), {
- "alpha":0.5,
- "time":0.1,
- "transition":"easeInSine"
- });
- });
- this.offered.addEventListener(MouseEvent.ROLL_OUT, function (e:MouseEvent):void{
- Tweener.addTween(MovieClip(e.target), {
- "alpha":1,
- "time":0.1,
- "transition":"easeInSine"
- });
- });
- if (user[1] == "open")
- {
- this.offered.addEventListener(MouseEvent.CLICK, this.offerClick);
- };
- };
- i = (i + 1);
- };
- }
- else
- {
- if (this.offered != null)
- {
- this.offered.removeChildren();
- };
- };
- }
- private function offerClick(e:MouseEvent):void{
- var partnername:*;
- var partneritem:*;
- if (e.currentTarget.fbid.text != undefined)
- {
- this.partnerid = e.currentTarget.fbid.text;
- partnername = e.currentTarget.thename.text;
- partneritem = e.currentTarget.item.currentLabel;
- if ((((!(this.partnerid == ("fb" + this.fbuid))) && (!(this.iwilloffer))) && (!(this.imonoffer))))
- {
- this.imonoffer = true;
- this.goOnOffer(this.partnerid, partnername, partneritem);
- }
- else
- {
- this.alert("Join Failed!, it's either your offer or the person is busy");
- this.partnerid = "";
- };
- };
- }
- private function gotInOffer(id:String, name:String):*{
- var playid:* = undefined;
- var fbpic:* = undefined;
- var photo:* = undefined;
- this.ontrade = true;
- this.chat_w.DisplayTextField.htmlText = (("<font color='#FF0000'>You are on Private Chat with " + name) + "!\n");
- this.MyOffer.fbname.text = name;
- this.MyOffer.picwhere.alpha = 100;
- this.partnerid = id;
- playid = id.split("fb");
- fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
- photo = new Loader();
- photo.load(new URLRequest(fbpic));
- this.MyOffer.picwhere.addChild(photo);
- this.MyOffer.kick_btn.visible = true;
- this.MyOffer.kick_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- ontrade = false;
- imbusy = false;
- MyOffer.fbname.text = "";
- MyOffer.picwhere.alpha = 0;
- MyOffer.kick_btn.visible = false;
- MyOffer.deal_btn.visible = false;
- MyOffer.unlock_btn.visible = false;
- MyOffer.lockedmcc.visible = false;
- MyOffer.hisoffer1.gotoAndStop("none");
- MyOffer.hisoffer2.gotoAndStop("none");
- MyOffer.hisoffer3.gotoAndStop("none");
- MyOffer.hisoffer4.gotoAndStop("none");
- MyOffer.hisoffer5.gotoAndStop("none");
- MyOffer.hisoffer6.gotoAndStop("none");
- MyOffer.hisoffer1.howmany.text = "";
- MyOffer.hisoffer2.howmany.text = "";
- MyOffer.hisoffer3.howmany.text = "";
- MyOffer.hisoffer4.howmany.text = "";
- MyOffer.hisoffer5.howmany.text = "";
- MyOffer.hisoffer6.howmany.text = "";
- MyOffer.coinstxt.text = "0";
- MyOffer.dicetxt.text = "0";
- MyOffer.unlock_btn.visible = false;
- MyOffer.deal_btn.visible = false;
- MyOffer.lockedmcc.visible = false;
- lobbyConnection.send("getOut", partnerid);
- });
- }
- private function addminus():void{
- if (this.ontrade)
- {
- if (this.HisOffer.offer6.currentLabel != "none")
- {
- this.HisOffer.more6.visible = true;
- this.HisOffer.more6.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer6.howmany.text == "")
- {
- canadd = false;
- (HisOffer.offer6.howmany.text == "");
- HisOffer.offer6.gotoAndStop("none");
- HisOffer.more6.visible = false;
- lobbyConnection.send("Iminus", "offer6", 0);
- addminus();
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer6.howmany.text) - 1);
- lobbyConnection.send("Iminus", "offer6", num);
- addminus();
- };
- };
- });
- this.HisOffer.more6.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer6.howmany.text == "")
- {
- canadd = false;
- lobbyConnection.send("Iadd", "offer6", 2);
- addminus();
- trace("2");
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer6.howmany.text) + 1);
- lobbyConnection.send("Iadd", "offer6", num);
- addminus();
- trace(num);
- };
- };
- });
- };
- if (this.HisOffer.offer5.currentLabel != "none")
- {
- this.HisOffer.more5.visible = true;
- this.HisOffer.more5.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer5.howmany.text == "")
- {
- canadd = false;
- (HisOffer.offer5.howmany.text == "");
- HisOffer.offer5.gotoAndStop("none");
- HisOffer.more5.visible = false;
- lobbyConnection.send("Iminus", "offer5", 0);
- addminus();
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer5.howmany.text) - 1);
- lobbyConnection.send("Iminus", "offer5", num);
- addminus();
- };
- };
- });
- this.HisOffer.more5.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer5.howmany.text == "")
- {
- canadd = false;
- lobbyConnection.send("Iadd", "offer5", 2);
- addminus();
- trace("2");
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer5.howmany.text) + 1);
- lobbyConnection.send("Iadd", "offer5", num);
- addminus();
- trace(num);
- };
- };
- });
- };
- if (this.HisOffer.offer4.currentLabel != "none")
- {
- this.HisOffer.more4.visible = true;
- this.HisOffer.more4.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer4.howmany.text == "")
- {
- canadd = false;
- (HisOffer.offer4.howmany.text == "");
- HisOffer.offer4.gotoAndStop("none");
- HisOffer.more4.visible = false;
- lobbyConnection.send("Iminus", "offer4", 0);
- addminus();
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer4.howmany.text) - 1);
- lobbyConnection.send("Iminus", "offer4", num);
- addminus();
- };
- };
- });
- this.HisOffer.more4.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer4.howmany.text == "")
- {
- canadd = false;
- lobbyConnection.send("Iadd", "offer4", 2);
- addminus();
- trace("2");
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer4.howmany.text) + 1);
- lobbyConnection.send("Iadd", "offer4", num);
- addminus();
- trace(num);
- };
- };
- });
- };
- if (this.HisOffer.offer3.currentLabel != "none")
- {
- this.HisOffer.more3.visible = true;
- this.HisOffer.more3.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer3.howmany.text == "")
- {
- canadd = false;
- (HisOffer.offer3.howmany.text == "");
- HisOffer.offer3.gotoAndStop("none");
- HisOffer.more3.visible = false;
- lobbyConnection.send("Iminus", "offer3", 0);
- addminus();
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer3.howmany.text) - 1);
- lobbyConnection.send("Iminus", "offer3", num);
- addminus();
- };
- };
- });
- this.HisOffer.more3.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer3.howmany.text == "")
- {
- canadd = false;
- lobbyConnection.send("Iadd", "offer3", 2);
- addminus();
- trace("2");
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer3.howmany.text) + 1);
- lobbyConnection.send("Iadd", "offer3", num);
- addminus();
- trace(num);
- };
- };
- });
- };
- if (this.HisOffer.offer2.currentLabel != "none")
- {
- this.HisOffer.more2.visible = true;
- this.HisOffer.more2.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num2:*;
- if (canadd)
- {
- if (HisOffer.offer2.howmany.text == "")
- {
- canadd = false;
- (HisOffer.offer2.howmany.text == "");
- HisOffer.offer2.gotoAndStop("none");
- HisOffer.more2.visible = false;
- lobbyConnection.send("Iminus", "offer2", 0);
- addminus();
- }
- else
- {
- canadd = false;
- num2 = (int(HisOffer.offer2.howmany.text) - 1);
- lobbyConnection.send("Iminus", "offer2", num2);
- addminus();
- };
- };
- });
- this.HisOffer.more2.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer2.howmany.text == "")
- {
- canadd = false;
- lobbyConnection.send("Iadd", "offer2", 2);
- addminus();
- trace("2");
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer2.howmany.text) + 1);
- lobbyConnection.send("Iadd", "offer2", num);
- addminus();
- trace(num);
- };
- };
- });
- };
- if (this.HisOffer.offer1.currentLabel != "none")
- {
- this.HisOffer.more1.visible = true;
- this.HisOffer.more1.minus_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer1.howmany.text == "")
- {
- canadd = false;
- (HisOffer.offer1.howmany.text == "");
- HisOffer.offer1.gotoAndStop("none");
- HisOffer.more1.visible = false;
- lobbyConnection.send("Iminus", "offer1", 0);
- addminus();
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer1.howmany.text) - 1);
- lobbyConnection.send("Iminus", "offer1", num);
- addminus();
- };
- };
- });
- this.HisOffer.more1.add_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var num:*;
- if (canadd)
- {
- if (HisOffer.offer1.howmany.text == "")
- {
- canadd = false;
- lobbyConnection.send("Iadd", "offer1", 2);
- addminus();
- trace("2");
- }
- else
- {
- canadd = false;
- num = (int(HisOffer.offer1.howmany.text) + 1);
- lobbyConnection.send("Iadd", "offer1", num);
- addminus();
- trace(num);
- };
- };
- });
- };
- };
- }
- private function goOnOffer(id:String, name:String, item:String):*{
- var playid:* = undefined;
- var fbpic:* = undefined;
- var photo:* = undefined;
- var arr:String;
- var ye:* = undefined;
- var i:* = undefined;
- var t:DisplayObject;
- if (!this.imbusy)
- {
- this.imbusy = true;
- this.ontrade = true;
- this.chat_w.DisplayTextField.htmlText = (("<font color='#FF0000'>You are on Private Chat with " + name) + "!\n");
- this.HisOffer.x = 145.7;
- this.HisOffer.y = 193.05;
- this.HisOffer.putcoins.coinstxt.text = "0";
- this.HisOffer.putdice.dicetxt.text = "0";
- this.HisOffer.putdice.visible = false;
- this.HisOffer.putcoins.visible = false;
- this.HisOffer.fbname.text = name;
- this.HisOffer.hisoffer.gotoAndStop(item);
- this.HisOffer.more1.add_btn.tabEnabled = false;
- this.HisOffer.more1.minus_btn.tabEnabled = false;
- this.HisOffer.more2.add_btn.tabEnabled = false;
- this.HisOffer.more2.minus_btn.tabEnabled = false;
- this.HisOffer.more3.add_btn.tabEnabled = false;
- this.HisOffer.more3.minus_btn.tabEnabled = false;
- this.HisOffer.more4.add_btn.tabEnabled = false;
- this.HisOffer.more4.minus_btn.tabEnabled = false;
- this.HisOffer.more5.add_btn.tabEnabled = false;
- this.HisOffer.more5.minus_btn.tabEnabled = false;
- this.HisOffer.more6.add_btn.tabEnabled = false;
- this.HisOffer.more6.minus_btn.tabEnabled = false;
- this.HisOffer.more1.visible = false;
- this.HisOffer.more2.visible = false;
- this.HisOffer.more3.visible = false;
- this.HisOffer.more4.visible = false;
- this.HisOffer.more5.visible = false;
- this.HisOffer.more6.visible = false;
- playid = id.split("fb");
- fbpic = (("https://graph.facebook.com/" + String(playid[1])) + "/picture");
- photo = new Loader();
- photo.load(new URLRequest(fbpic));
- this.HisOffer.picwhere.addChild(photo);
- this.lobbyConnection.send("goOffer", id, item);
- this.HisOffer.offer1.howmany.text = "";
- this.HisOffer.offer2.howmany.text = "";
- this.HisOffer.offer3.howmany.text = "";
- this.HisOffer.offer4.howmany.text = "";
- this.HisOffer.offer5.howmany.text = "";
- this.HisOffer.offer6.howmany.text = "";
- arr = "offer1,offer2,offer3,offer4,offer5,offer6";
- ye = arr.split(",");
- for (i in ye)
- {
- trace(ye[i]);
- t = this.HisOffer.getChildByName(String(ye[i]));
- t.addEventListener(MouseEvent.ROLL_OVER, this.mouseOverU);
- t.addEventListener(MouseEvent.ROLL_OUT, this.mouseOutU);
- };
- this.HisOffer.offer1.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((!(giveoffer)) && (imonoffer)))
- {
- giveoffer = true;
- whichslot = "offer1";
- loadinvent("allitems");
- addminus();
- };
- });
- this.HisOffer.offer2.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((!(giveoffer)) && (imonoffer)))
- {
- giveoffer = true;
- whichslot = "offer2";
- loadinvent("allitems");
- addminus();
- };
- });
- this.HisOffer.offer3.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((!(giveoffer)) && (imonoffer)))
- {
- giveoffer = true;
- whichslot = "offer3";
- loadinvent("allitems");
- addminus();
- };
- });
- this.HisOffer.offer4.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((!(giveoffer)) && (imonoffer)))
- {
- giveoffer = true;
- whichslot = "offer4";
- loadinvent("allitems");
- addminus();
- };
- });
- this.HisOffer.offer5.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((!(giveoffer)) && (imonoffer)))
- {
- giveoffer = true;
- whichslot = "offer5";
- loadinvent("allitems");
- addminus();
- };
- });
- this.HisOffer.offer6.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((!(giveoffer)) && (imonoffer)))
- {
- giveoffer = true;
- whichslot = "offer6";
- loadinvent("allitems");
- addminus();
- };
- });
- this.HisOffer.coins_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- HisOffer.putcoins.visible = true;
- HisOffer.putcoins.coinstxt.restrict = "0-9";
- HisOffer.putcoins.coinstxt.text = "0";
- HisOffer.putcoins.put_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if ((((!(HisOffer.putcoins.coinstxt.text == "")) || (!(HisOffer.putcoins.coinstxt.text == " "))) || (!(HisOffer.putcoins.coinstxt.text == " "))))
- {
- if (int(HisOffer.putcoins.coinstxt.text) <= int(dbcoins))
- {
- trace(HisOffer.putcoins.coinstxt.text);
- HisOffer.coinstxt.text = HisOffer.putcoins.coinstxt.text;
- lobbyConnection.send("putCoins", int(HisOffer.putcoins.coinstxt.text), partnerid);
- HisOffer.putcoins.visible = false;
- addminus();
- }
- else
- {
- alert("you don't have this much coins");
- };
- }
- else
- {
- alert("Invalid number");
- };
- });
- });
- this.HisOffer.dice_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- HisOffer.putdice.visible = true;
- HisOffer.putdice.dicetxt.restrict = "0-9";
- HisOffer.putdice.dicetxt.text = "0";
- HisOffer.putdice.put_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if ((((!(HisOffer.putdice.dicetxt.text == "")) || (!(HisOffer.putdice.dicetxt.text == " "))) || (!(HisOffer.putdice.dicetxt.text == " "))))
- {
- if (int(HisOffer.putdice.dicetxt.text) <= int(dbdice))
- {
- trace(HisOffer.putdice.dicetxt.text);
- HisOffer.dicetxt.text = HisOffer.putdice.dicetxt.text;
- lobbyConnection.send("putDice", int(HisOffer.putdice.dicetxt.text), partnerid);
- HisOffer.putdice.visible = false;
- addminus();
- }
- else
- {
- alert("You Don't own that much Token's :/");
- };
- }
- else
- {
- alert("Invalid number");
- };
- });
- });
- this.HisOffer.leave_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- canadd = true;
- ontrade = false;
- lobbyConnection.send("byebye", partnerid);
- hisOfferRefresh();
- });
- this.HisOffer.lock_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var mySound:Sound;
- mySound = new locksound();
- mySound.play();
- HisOffer.lockedmcc.visible = true;
- HisOffer.lock_btn.visible = false;
- lobbyConnection.send("ilock", partnerid);
- });
- };
- }
- private function goRoom(room:String):void{
- if (this.multiisopen)
- {
- this.joining = true;
- this.multiopen.blocks.visible = true;
- trace(room);
- this.TheClient.multiplayer.createJoinRoom(room, "VirtualRoom", true, {}, {
- "fbname":this.fbname,
- "fbuid":this.fbuid
- }, this.VirtualLobby, this.handleError);
- };
- }
- private function golobby2(room:String):void{
- if (this.multiisopen)
- {
- this.joining = true;
- this.multiopen.blocks.visible = true;
- trace(room);
- this.clickmeroom = room;
- this.TheClient.multiplayer.createJoinRoom(room, "TradeRoom", true, {"room":room}, {
- "fbname":this.fbname,
- "fbuid":this.fbuid,
- "pass":""
- }, this.handleLobby2, this.handleError);
- };
- }
- private function golobby(room:String):void{
- if (this.multiisopen)
- {
- this.joining = true;
- this.multiopen.blocks.visible = true;
- trace(room);
- this.MyRoom = room;
- if ((((room == "a_plus") || (room == "b_plus")) || (room == "c_plus")))
- {
- this.plusmarket = true;
- }
- else
- {
- this.plusmarket = false;
- };
- this.TheClient.multiplayer.createJoinRoom(room, "TradeRoom", true, {}, {
- "fbname":this.fbname,
- "fbuid":this.fbuid,
- "pass":this.pass
- }, this.handleLobby, this.handleError);
- };
- }
- public function resetOnlinePlayers():*{
- var players:*;
- players = 0;
- if (currentFrame == 3)
- {
- players = 0;
- while (players < this.playersArr.length)
- {
- this.playersArr[players].visible = false;
- players++;
- };
- };
- }
- public function handleOnlinePlayers(m:Message):*{
- var Name:String;
- var pcard:*;
- var actualLevel:String;
- var players:*;
- Name = "";
- var Skins:* = 0;
- actualLevel = null;
- var id:Array;
- this.resetOnlinePlayers();
- players = 0;
- while (players < m.length)
- {
- Name = m.getString(players);
- Skins = ((players / 2) + 1);
- pcard = new Skin(Name, this.TheClient);
- pcard.y = (((75 * players) / 2) + 20);
- this.onlinePlayers.players.addChild(pcard);
- this.playersArr.push(pcard);
- actualLevel = new String(Name);
- id = actualLevel.split(";");
- players++;
- };
- this._scrollbar = new Scrollbar();
- this._scrollbar.init(this.onlinePlayers.players, this.onlinePlayers.contentMask, this.onlinePlayers.track, this.onlinePlayers.slider);
- }
- public function userClicked(id:String):void{
- if (!this.infoopen)
- {
- this.openCard = new PlayerCard2();
- addChild(this.openCard);
- this.openCard.alpha = 0;
- this.openCard.x = 368.25;
- this.openCard.y = 197.55;
- this.openCard.claninvite.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("claninvite", id);
- });
- this.openCard.clankick.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("clankick", id);
- });
- Tweener.addTween(this.openCard, {
- "x":368.25,
- "y":197.55,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.TheConnection.send("seeinfo", id);
- this.infoopen = true;
- };
- }
- private function AdminKey(e:KeyboardEvent):void{
- var message:*;
- if (((e.keyCode == 27) && (!(this.ChatTextField.text == ""))))
- {
- message = this.ChatTextField.text;
- this.lobbyConnection.send("CMD", message);
- this.ChatTextField.text = "";
- message = "";
- };
- }
- private function eventclickme(e:MouseEvent):void{
- this.eventclickhere.clickhere_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var myURL:URLRequest;
- myURL = new URLRequest("https://www.facebook.com/groups/1701363410108212/");
- navigateToURL(myURL, "_blank");
- });
- }
- private function giftcodego(e:MouseEvent):void{
- if (!this.giftcodeopen)
- {
- this.giftcodeopen = true;
- this.giftcode = new GiftCode();
- this.giftcode.x = 143.05;
- this.giftcode.y = 122.05;
- addChild(this.giftcode);
- this.giftcode.gctxt.text = "";
- this.giftcode.check_btn.tabEnabled = false;
- this.giftcode.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- giftcodeopen = false;
- });
- this.giftcode.check_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (giftcode.gctxt.text != "")
- {
- giftcode.loadbar.visible = true;
- giftcode.check_btn.visible = false;
- TheConnection.send("checkgc", giftcode.gctxt.text);
- giftcode.gctxt.text = "";
- };
- });
- };
- }
- private function KeyisDown22(e:KeyboardEvent):void{
- var message:* = undefined;
- var intervalId1:uint;
- if (((e.keyCode == 13) && (!(this.ChatTextField.text == ""))))
- {
- if (this.canchat)
- {
- this.canchat = false;
- this.chatlock.visible = true;
- message = this.ChatTextField.text;
- this.lobbyConnection.send("BroadcastMessage", message);
- this.ChatTextField.text = "";
- message = "";
- intervalId1 = setTimeout(function ():*{
- chatlock.visible = false;
- canchat = true;
- }, 5000);
- };
- };
- }
- private function KeyisDown(e:KeyboardEvent):void{
- var message:* = undefined;
- var intervalId1:uint;
- var message2:* = undefined;
- var intervalId:uint;
- if (((e.keyCode == 13) && (!(this.ChatTextField.text == ""))))
- {
- trace(this.ontrade);
- if (((this.ontrade == false) && (this.canchat)))
- {
- this.canchat = false;
- this.chatlock.visible = true;
- message = this.ChatTextField.text;
- this.lobbyConnection.send("BroadcastMessage", message);
- this.ChatTextField.text = "";
- message = "";
- intervalId1 = setTimeout(function ():*{
- chatlock.visible = false;
- canchat = true;
- }, 5000);
- };
- if (((this.ontrade == true) && (this.canchat)))
- {
- this.canchat = false;
- trace("private");
- this.chatlock.visible = true;
- message2 = this.ChatTextField.text;
- this.lobbyConnection.send("PrivateMessage", message2, this.partnerid);
- this.ChatTextField.text = "";
- message = "";
- intervalId = setTimeout(function ():*{
- chatlock.visible = false;
- canchat = true;
- }, 5000);
- };
- };
- }
- private function openDshop(e:Event):void{
- if (this.eButtons)
- {
- this.eButtons = false;
- this.diceshop = new DiceShop();
- this.diceshop.alpha = 0;
- this.diceshop.x = 13.1;
- this.diceshop.y = -90.75;
- addChild(this.diceshop);
- Tweener.addTween(this.diceshop, {
- "x":13.1,
- "y":-90.75,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.TheConnection.send("dshop");
- this.diceshop.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- eButtons = true;
- TheConnection.send("loadplayer", fbuid, "newdb");
- });
- };
- }
- private function openPshop():void{
- if (this.eButtons)
- {
- this.eButtons = false;
- this.premshop = new PremiumShop();
- this.premshop.x = 235.25;
- this.premshop.y = 43.85;
- addChild(this.premshop);
- this._scrollbar = new Scrollbar();
- this._scrollbar.init(this.premshop.content, this.premshop.contentMask, this.premshop.track, this.premshop.slider);
- this.premshop.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- eButtons = true;
- });
- this.premshop.content.vipskin.buy_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- BuyPrem("vipskin", "VIP Access");
- });
- };
- }
- private function BuyPrem(theitem:String, details:String):void{
- this.TheClient.payVault.getBuyDirectInfo("paypal", {
- "currency":"USD",
- "item_name":String(details)
- }, [{"itemKey":String(theitem)}], function (info:Object):void{
- navigateToURL(new URLRequest(info.paypalurl), "_blank");
- }, function (e:PlayerIOError):void{
- alert("Unable to buy item");
- });
- }
- private function VirtualLobby(connection:Connection):void{
- trace("Sucessfully connected to the multiplayer server");
- gotoAndStop(4);
- this.VirtualConnection = connection;
- connection.addDisconnectHandler(this.handleDisconnect);
- connection.addMessageHandler("hello", function (m:Message):*{
- trace("Recived a message with the type hello from the server");
- });
- connection.addMessageHandler("UserJoined", function (m:Message, userid:uint):*{
- trace("Player with the userid", userid, "just joined the room");
- });
- connection.addMessageHandler("UserLeft", function (m:Message, userid:uint):*{
- trace("Player with the userid", userid, "just left the room");
- });
- connection.addMessageHandler("*", this.handleMessages);
- }
- private function handleLobby2(connection:Connection):void{
- trace("Connected on Lobby");
- this.lobbyConnection = connection;
- gotoAndStop(5);
- removeChild(this.myskin);
- removeChild(this.multiopen);
- this.lobname.text = this.clickmeroom;
- stage.addEventListener(KeyboardEvent.KEY_DOWN, this.KeyisDown22);
- connection.addMessageHandler("isBanned", function (m:Message, who:String):*{
- if (who == fbuid)
- {
- gotoAndStop(4);
- lobbyConnection.disconnect();
- };
- });
- connection.addMessageHandler("UserJoined", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
- });
- connection.addMessageHandler("UserLeft", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
- });
- connection.addMessageHandler("BroadcastMessage", function (m:Message, ChatMessage:String):*{
- var mySound88:Sound;
- chat_w.DisplayTextField.htmlText = (chat_w.DisplayTextField.htmlText + (ChatMessage + "\n"));
- chat_w.DisplayTextField.scrollV = chat_w.DisplayTextField.maxScrollV;
- chat_w.DisplayTextField.condenseWhite = true;
- mySound88 = new chatsound();
- mySound88.play();
- });
- this.leave_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- lobbyConnection.send("iclose", fbuid, partnerid);
- lobbyConnection.send("byebye", partnerid);
- canchat = true;
- eButtons = true;
- joining = false;
- multiisopen = false;
- iwilloffer = false;
- imonoffer = false;
- lobbyConnection.disconnect();
- partnerid = "";
- ontrade = false;
- letsStart();
- });
- connection.addMessageHandler("*", this.handleMessages);
- this.usersList.setStyle("upSkin", new MovieClip());
- this.usersContainer = new MovieClip();
- this.usersList.source = this.usersContainer;
- connection.addDisconnectHandler(this.handleDisconnect);
- }
- private function handleLobby(connection:Connection):void{
- trace("Connected on Trading Lobby");
- this.lobbyConnection = connection;
- gotoAndStop(3);
- if (this.MyRoom == "normal_a")
- {
- this.Coolzone.gotoAndStop(1);
- }
- else
- {
- if (this.MyRoom == "normal_b")
- {
- this.Coolzone.gotoAndStop(2);
- }
- else
- {
- if (this.MyRoom == "normal_c")
- {
- this.Coolzone.gotoAndStop(3);
- }
- else
- {
- if (this.MyRoom == "normal_d")
- {
- this.Coolzone.gotoAndStop(4);
- }
- else
- {
- if (this.MyRoom == "normal_e")
- {
- this.Coolzone.gotoAndStop(5);
- }
- else
- {
- if (this.MyRoom == "normal_f")
- {
- this.Coolzone.gotoAndStop(6);
- }
- else
- {
- if (this.MyRoom == "a_plus")
- {
- this.Coolzone.gotoAndStop(7);
- }
- else
- {
- if (this.MyRoom == "b_plus")
- {
- this.Coolzone.gotoAndStop(8);
- }
- else
- {
- if (this.MyRoom == "c_plus")
- {
- this.Coolzone.gotoAndStop(9);
- };
- };
- };
- };
- };
- };
- };
- };
- };
- this.clickopen.panel_btn.tabEnabled = false;
- this.Herehere.visible = false;
- if (this.dblevel == 11)
- {
- this.Herehere.visible = true;
- this.clickopen.panel_btn.visible = true;
- this.clickopen.panel_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!panelop)
- {
- panelop = true;
- panel = new PANEL();
- panel.x = 114.6;
- panel.y = 99.05;
- addChild(panel);
- Tweener.addTween(panel, {
- "x":114.6,
- "y":99.05,
- "time":0.3,
- "transition":"easeOutSine"
- });
- panel.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (panelop)
- {
- panelop = false;
- removeChild(panel);
- };
- });
- panel.auth_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- panel.loadme.visible = true;
- panel.auth_btn.visible = false;
- if (panel.pswtxt.text == "adminlog")
- {
- lobbyConnection.send("adminLogin");
- }
- else
- {
- alert("Wrong pass");
- panel.loadme.visible = false;
- panel.auth_btn.visible = true;
- };
- });
- };
- });
- };
- this.coinstxt.text = String(this.dbcoins);
- this.dicetxt.text = String(this.dbdice);
- removeChild(this.multiopen);
- this.makeoffer.tabEnabled = false;
- this.closeoffer.tabEnabled = false;
- this.MyOffer.deal_btn.tabEnabled = false;
- this.MyOffer.kick_btn.tabEnabled = false;
- this.MyOffer.unlock_btn.tabEnabled = false;
- this.HisOffer.lock_btn.tabEnabled = false;
- this.HisOffer.leave_btn.tabEnabled = false;
- this.fullscreen_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (fullscreen == false)
- {
- stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
- fullscreen = true;
- trace("fullscreen");
- }
- else
- {
- if (fullscreen == true)
- {
- stage.displayState = StageDisplayState.NORMAL;
- fullscreen = false;
- trace("not fullscreen");
- };
- };
- });
- this.quality_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (myquality == "high")
- {
- stage.quality = StageQuality.LOW;
- myquality = "low";
- trace("low quality");
- }
- else
- {
- if (myquality == "low")
- {
- stage.quality = StageQuality.BEST;
- myquality = "high";
- trace("high quality");
- };
- };
- });
- this.mute_btn.addEventListener(MouseEvent.CLICK, function ():*{
- if (sounds == false)
- {
- sounds = true;
- trace(sounds);
- mute_btn.gotoAndStop(2);
- issPlaying = false;
- lastPosition = myChannel.position;
- myChannel.stop();
- }
- else
- {
- if (issPlaying == false)
- {
- issPlaying = true;
- myChannel = myMusic.play(lastPosition);
- };
- sounds = false;
- trace(sounds);
- mute_btn.gotoAndStop(1);
- };
- });
- this.giftcode_btn.addEventListener(MouseEvent.CLICK, this.giftcodego);
- this.eventclickhere.addEventListener(MouseEvent.CLICK, this.eventclickme);
- this.makeoffer.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (((!(iwilloffer)) && (!(imonoffer))))
- {
- iwilloffer = true;
- loadinvent("allitems");
- makeoffer.visible = false;
- if (dealload != null)
- {
- removeChild(dealload);
- };
- };
- });
- this.clickopen.openmc.addEventListener(MouseEvent.MOUSE_OVER, function (e:MouseEvent):void{
- var callback:Function;
- var callback2:Function;
- if (clickopen.x != 0)
- {
- callback = function ():*{
- clickopen.openmc.gotoAndStop(2);
- };
- Tweener.addTween(clickopen, {
- "x":0,
- "time":0.3,
- "transition":"easeOutSine",
- "onComplete":callback
- });
- }
- else
- {
- callback2 = function ():*{
- clickopen.openmc.gotoAndStop(1);
- };
- Tweener.addTween(clickopen, {
- "x":-114.6,
- "time":0.3,
- "transition":"easeOutSine",
- "onComplete":callback2
- });
- };
- });
- this.storage_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!isstorage)
- {
- isstorage = true;
- storage = new Storage();
- storage.x = 155.45;
- storage.y = 88.95;
- storage.alpha = 0;
- addChild(storage);
- TheConnection.send("loadstorage");
- storage.collectd_btn.tabEnabled = false;
- storage.collectc_btn.tabEnabled = false;
- Tweener.addTween(storage, {
- "x":155.45,
- "y":88.95,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- storage.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- removeChild(e.target.parent);
- isstorage = false;
- dicecount.stop();
- dicecounting = false;
- coinscounting = false;
- coinscount.stop();
- });
- };
- });
- stage.addEventListener(KeyboardEvent.KEY_DOWN, this.KeyisDown);
- stage.addEventListener(KeyboardEvent.KEY_DOWN, this.AdminKey);
- this.leave_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- lobbyConnection.send("iclose", fbuid, partnerid);
- lobbyConnection.send("byebye", partnerid);
- canchat = true;
- eButtons = true;
- joining = false;
- multiisopen = false;
- iwilloffer = false;
- imonoffer = false;
- lobbyConnection.disconnect();
- partnerid = "";
- ontrade = false;
- letsStart();
- });
- this.offersList.setStyle("upSkin", new MovieClip());
- this.offersContainer = new MovieClip();
- this.offersList.source = this.offersContainer;
- connection.addDisconnectHandler(this.handleDisconnect);
- connection.addMessageHandler("hello", function (m:Message):*{
- trace("Recived a message with the type hello from the server");
- });
- connection.addMessageHandler("UserJoined", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
- updateOffer(offers);
- Online.text = String(howmany);
- if (!imhere)
- {
- imhere = true;
- lobbyConnection.send("here");
- };
- });
- connection.addMessageHandler("alert2", function (m:Message, who:String, mess:String):*{
- if (who == ("fb" + fbur))
- {
- alert(String(mess));
- }
- else
- {
- if (who == "all")
- {
- showmsg.mymsg.text = String(mess);
- showmsg.rec.gotoAndPlay(2);
- };
- };
- });
- connection.addMessageHandler("math", function (m:Message, who:String, whattheitem:String, howmany:int):*{
- showmsg.mymsg.text = String(who);
- showmsg.gotoAndStop(2);
- showmsg.theitem.gotoAndStop(String(whattheitem));
- showmsg.theitem.howmany.text = int(howmany);
- showmsg.answer.text = "";
- showmsg.enter_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- trace(showmsg.answer.text);
- lobbyConnection.send("myanswer", showmsg.answer.text);
- showmsg.gotoAndStop(1);
- });
- });
- connection.addMessageHandler("closemath", function (m:Message, who:String):*{
- showmsg.gotoAndStop(1);
- });
- connection.addMessageHandler("playersOnline", function (m:Message):*{
- handleOnlinePlayers(m);
- trace(m);
- });
- connection.addMessageHandler("heoffered", function (m:Message, isitme:String, whoishe:String, whichslotz:String, whattheitem:String):*{
- var rex:RegExp;
- var det:String;
- var det2:String;
- var mySound:Sound;
- rex = /[\s\r\n]+/gim;
- det = isitme;
- det2 = partnerid;
- det = det.replace(rex, "");
- det2 = det2.replace(rex, "");
- if (((("fb" + fbuid) == det) && (det2 == whoishe)))
- {
- mySound = new pck();
- if (whichslotz == "offer1")
- {
- MyOffer.hisoffer1.gotoAndStop(String(whattheitem));
- MyOffer.hisoffer1.howmany.text = "";
- };
- if (whichslotz == "offer2")
- {
- MyOffer.hisoffer2.gotoAndStop(String(whattheitem));
- MyOffer.hisoffer2.howmany.text = "";
- };
- if (whichslotz == "offer3")
- {
- MyOffer.hisoffer3.gotoAndStop(String(whattheitem));
- MyOffer.hisoffer3.howmany.text = "";
- };
- if (whichslotz == "offer4")
- {
- MyOffer.hisoffer4.gotoAndStop(String(whattheitem));
- MyOffer.hisoffer4.howmany.text = "";
- };
- if (whichslotz == "offer5")
- {
- MyOffer.hisoffer5.gotoAndStop(String(whattheitem));
- MyOffer.hisoffer5.howmany.text = "";
- };
- if (whichslotz == "offer6")
- {
- MyOffer.hisoffer6.gotoAndStop(String(whattheitem));
- MyOffer.hisoffer6.howmany.text = "";
- };
- };
- });
- connection.addMessageHandler("UserLeft", function (m:Message, myid:String, howmany:int, users:String, Skins:String, Badge:String, allfbid:String, num:int, offers:String):*{
- updateOffer(offers);
- Online.text = String(howmany);
- });
- connection.addMessageHandler("helock", function (m:Message, isitme:String, whoishe:String):*{
- var rex:RegExp;
- var det:String;
- var det2:String;
- var mySound:Sound;
- rex = /[\s\r\n]+/gim;
- det = isitme;
- det2 = partnerid;
- det = det.replace(rex, "");
- det2 = det2.replace(rex, "");
- if (((("fb" + fbuid) == det) && (det2 == partnerid)))
- {
- MyOffer.lockedmcc.visible = true;
- MyOffer.deal_btn.visible = true;
- MyOffer.unlock_btn.visible = true;
- MyOffer.unlock_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var mySound:Sound;
- mySound = new locksound();
- mySound.play();
- if (MyOffer.lockedmcc.visible)
- {
- MyOffer.lockedmcc.visible = false;
- MyOffer.deal_btn.visible = false;
- MyOffer.unlock_btn.visible = false;
- lobbyConnection.send("iunlock", partnerid);
- };
- });
- MyOffer.deal_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- var mySound:Sound;
- mySound = new button();
- mySound.play();
- if (MyOffer.lockedmcc.visible)
- {
- myOfferRefresh();
- dealload = new DealLoad();
- dealload.x = 0;
- dealload.y = 0;
- dealload.width = 650;
- dealload.height = 450;
- addChild(dealload);
- lobbyConnection.send("ideal", partnerid, fbuid);
- };
- });
- mySound = new locksound();
- mySound.play();
- };
- });
- connection.addMessageHandler("dealsuccess", function (m:Message, isitme:String, whoishe:String):*{
- var mySound:Sound;
- var mySound2:Sound;
- trace("Dealed");
- trace(("isitme:" + isitme));
- trace(whoishe);
- trace((("this is me: " + "fb") + fbuid));
- if (((("fb" + fbuid) == isitme) && (partnerid == whoishe)))
- {
- var callback:Function = function ():*{
- removeChild(deal);
- };
- canadd = true;
- ontrade = false;
- mySound = new success_sound();
- mySound.play();
- deal = new Deal();
- deal.width = 235;
- deal.height = 90;
- deal.x = 325;
- deal.y = 225;
- addChild(deal);
- partnerid = "";
- if (dealload != null)
- {
- removeChild(dealload);
- };
- lobbyConnection.send("imdone");
- hisOfferRefresh();
- TheConnection.send("loadplayer", fbuid, "newdb");
- };
- if (((("fb" + fbuid) == whoishe) && (isitme == partnerid)))
- {
- var callback2:Function = function ():*{
- removeChild(deal);
- };
- canadd = true;
- ontrade = false;
- mySound2 = new success_sound();
- mySound2.play();
- deal = new Deal();
- deal.width = 235;
- deal.height = 90;
- deal.x = 325;
- deal.y = 225;
- addChild(deal);
- partnerid = "";
- removeChild(dealload);
- TheConnection.send("loadplayer", fbuid, "newdb");
- };
- });
- connection.addMessageHandler("hedeal", function (m:Message, isitme:String, whoishe:String):*{
- var rex:RegExp;
- var det:String;
- var det2:String;
- rex = /[\s\r\n]+/gim;
- det = isitme;
- det2 = whoishe;
- det = det.replace(rex, "");
- det2 = det2.replace(rex, "");
- if (((("fb" + fbuid) == det) && (det2 == partnerid)))
- {
- ontrade = false;
- dealload = new DealLoad();
- dealload.x = 0;
- dealload.y = 0;
- dealload.width = 650;
- dealload.height = 450;
- addChild(dealload);
- HisOffer.x = -500;
- HisOffer.y = -500;
- HisOffer.fbname.text = "";
- HisOffer.hisoffer.gotoAndStop("none");
- HisOffer.offer1.gotoAndStop("none");
- HisOffer.offer2.gotoAndStop("none");
- HisOffer.offer3.gotoAndStop("none");
- HisOffer.offer4.gotoAndStop("none");
- HisOffer.offer5.gotoAndStop("none");
- HisOffer.offer6.gotoAndStop("none");
- HisOffer.lock_btn.visible = true;
- HisOffer.lockedmcc.visible = false;
- HisOffer.putcoins.visible = false;
- HisOffer.putdice.visible = false;
- HisOffer.putcoins.coinstxt.text = "0";
- HisOffer.putdice.dicetxt.text = "0";
- imbusy = false;
- imonoffer = false;
- };
- });
- connection.addMessageHandler("heunlock", function (m:Message, isitme:String, whoishe:String):*{
- var rex:RegExp;
- var det:String;
- var det2:String;
- rex = /[\s\r\n]+/gim;
- det = isitme;
- det2 = whoishe;
- det = det.replace(rex, "");
- det2 = det2.replace(rex, "");
- if (((("fb" + fbuid) == det) && (det2 == partnerid)))
- {
- canadd = true;
- HisOffer.lockedmcc.visible = false;
- HisOffer.lock_btn.visible = true;
- };
- });
- connection.addMessageHandler("BroadcastMessage", function (m:Message, ChatMessage:String):*{
- var mySound88:Sound;
- if (!ontrade)
- {
- chat_w.DisplayTextField.htmlText = (chat_w.DisplayTextField.htmlText + (ChatMessage + "\n"));
- chat_w.DisplayTextField.scrollV = chat_w.DisplayTextField.maxScrollV;
- chat_w.DisplayTextField.condenseWhite = true;
- mySound88 = new chatsound();
- mySound88.play();
- };
- });
- connection.addMessageHandler("PrivateMessage", function (m:Message, ChatMessage:String, partner:String):*{
- var mySound88:Sound;
- trace(("Someone talked:" + ChatMessage));
- trace(("who? = " + partner));
- if (((partner == ("fb" + fbuid)) || (partner == partnerid)))
- {
- chat_w.DisplayTextField.htmlText = (chat_w.DisplayTextField.htmlText + (ChatMessage + "\n"));
- chat_w.DisplayTextField.scrollV = chat_w.DisplayTextField.maxScrollV;
- chat_w.DisplayTextField.condenseWhite = true;
- mySound88 = new chatsound();
- mySound88.play();
- };
- });
- connection.addMessageHandler("leaveyah", function (m:Message, isitme:String, hisid:String):*{
- var rex:RegExp;
- var det:String;
- var det2:String;
- rex = /[\s\r\n]+/gim;
- det = isitme;
- det = det.replace(rex, "");
- det2 = hisid;
- det2 = det2.replace(rex, "");
- if (((("fb" + fbuid) == det) && (partnerid == det2)))
- {
- ontrade = false;
- MyOffer.fbname.text = "";
- MyOffer.picwhere.alpha = 0;
- MyOffer.kick_btn.visible = false;
- MyOffer.unlock_btn.visible = false;
- MyOffer.deal_btn.visible = false;
- MyOffer.lockedmcc.visible = false;
- MyOffer.hisoffer1.gotoAndStop("none");
- MyOffer.hisoffer2.gotoAndStop("none");
- MyOffer.hisoffer3.gotoAndStop("none");
- MyOffer.hisoffer4.gotoAndStop("none");
- MyOffer.hisoffer5.gotoAndStop("none");
- MyOffer.hisoffer6.gotoAndStop("none");
- MyOffer.hisoffer1.howmany.text = "";
- MyOffer.hisoffer2.howmany.text = "";
- MyOffer.hisoffer3.howmany.text = "";
- MyOffer.hisoffer4.howmany.text = "";
- MyOffer.hisoffer5.howmany.text = "";
- MyOffer.hisoffer6.howmany.text = "";
- MyOffer.unlock_btn.visible = false;
- MyOffer.deal_btn.visible = false;
- MyOffer.lockedmcc.visible = false;
- MyOffer.coinstxt.text = "0";
- MyOffer.dicetxt.text = "0";
- lobbyConnection.send("backtonormal");
- imbusy = false;
- partnerid = "";
- };
- });
- connection.addMessageHandler("UserLeft", function (m:Message, userid:uint):*{
- trace("Player with the userid", userid, "just left the room");
- });
- connection.addMessageHandler("*", this.handleMessages);
- }
- private function showInventory():void{
- var met:Array;
- var i:* = undefined;
- var t:DisplayObject;
- if (this.eButtons)
- {
- this.eButtons = false;
- this.inventoryopen = new InventoryOpen();
- this.inventoryopen.alpha = 0;
- this.inventoryopen.x = 125.05;
- this.inventoryopen.y = 24.7;
- this.inventoryopen.coinstxt.text = String(this.dbcoins);
- this.inventoryopen.dicetxt.text = String(this.dbdice);
- addChild(this.inventoryopen);
- Tweener.addTween(this.inventoryopen, {
- "x":125.05,
- "y":24.7,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- trace(this.gotmemepack);
- if (this.gotmemepack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.memepack.visible = true;
- this.inventoryopen.herepacks.memepack.item.gotoAndStop("memeset");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.memepack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.memepack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.memepack.unpack_btn.visible = false;
- inventoryopen.herepacks.memepack.loading.visible = true;
- unpack("memeset");
- });
- };
- trace(this.gotdwset);
- if (this.gotdwset)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.dwset.visible = true;
- this.inventoryopen.herepacks.dwset.item.gotoAndStop("dwset");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.dwset.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.dwset.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.dwset.unpack_btn.visible = false;
- inventoryopen.herepacks.dwset.loading.visible = true;
- unpack("dwset");
- });
- };
- trace(this.gotswagset);
- if (this.gotswagset)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.swagset.visible = true;
- this.inventoryopen.herepacks.swagset.item.gotoAndStop("swagset");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.swagset.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.swagset.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.swagset.unpack_btn.visible = false;
- inventoryopen.herepacks.swagset.loading.visible = true;
- unpack("swagset");
- });
- };
- trace(this.gotdarkpack);
- if (this.gotdarkpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.darkpack.visible = true;
- this.inventoryopen.herepacks.darkpack.item.gotoAndStop("darkpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.darkpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.darkpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.darkpack.unpack_btn.visible = false;
- inventoryopen.herepacks.darkpack.loading.visible = true;
- unpack("darkpack");
- });
- };
- trace(this.gotspeedpack);
- if (this.gotspeedpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.speedpack.visible = true;
- this.inventoryopen.herepacks.speedpack.item.gotoAndStop("speedpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.speedpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.speedpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.speedpack.unpack_btn.visible = false;
- inventoryopen.herepacks.speedpack.loading.visible = true;
- unpack("speedpack");
- });
- };
- trace(this.gotdealbgpack);
- if (this.gotdealbgpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.dealbgpack.visible = true;
- this.inventoryopen.herepacks.dealbgpack.item.gotoAndStop("dealbgpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.dealbgpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.dealbgpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.dealbgpack.unpack_btn.visible = false;
- inventoryopen.herepacks.dealbgpack.loading.visible = true;
- unpack("dealbgpack");
- });
- };
- trace(this.gotwlpack);
- if (this.gotwlpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.wlpack.visible = true;
- this.inventoryopen.herepacks.wlpack.item.gotoAndStop("wlpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.wlpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.wlpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.wlpack.unpack_btn.visible = false;
- inventoryopen.herepacks.wlpack.loading.visible = true;
- unpack("wlpack");
- });
- };
- trace(this.gotrainbowpack);
- if (this.gotrainbowpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.rainbowpack.visible = true;
- this.inventoryopen.herepacks.rainbowpack.item.gotoAndStop("rainbowpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.rainbowpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.rainbowpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.rainbowpack.unpack_btn.visible = false;
- inventoryopen.herepacks.rainbowpack.loading.visible = true;
- unpack("rainbowpack");
- });
- };
- trace(this.gotnewyearpack);
- if (this.gotnewyearpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.newyearpack.visible = true;
- this.inventoryopen.herepacks.newyearpack.item.gotoAndStop("newyearpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.newyearpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.newyearpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.rainbowpack.unpack_btn.visible = false;
- inventoryopen.herepacks.rainbowpack.loading.visible = true;
- unpack("newyearpack");
- });
- };
- trace(this.gotredpack);
- if (this.gotredpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.redpack.visible = true;
- this.inventoryopen.herepacks.redpack.item.gotoAndStop("redpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.redpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.redpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.redpack.unpack_btn.visible = false;
- inventoryopen.herepacks.redpack.loading.visible = true;
- unpack("redpack");
- });
- };
- trace(this.gotnovapack);
- if (this.gotnovapack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.novapack.visible = true;
- this.inventoryopen.herepacks.novapack.item.gotoAndStop("novapack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.novapack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.novapack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.novapack.unpack_btn.visible = false;
- inventoryopen.herepacks.novapack.loading.visible = true;
- unpack("novapack");
- });
- };
- trace(this.gotcrystalpack);
- if (this.gotcrystalpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.crystalpack.visible = true;
- this.inventoryopen.herepacks.crystalpack.item.gotoAndStop("crystalpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.crystalpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.crystalpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.crystalpack.unpack_btn.visible = false;
- inventoryopen.herepacks.crystalpack.loading.visible = true;
- unpack("crystalpack");
- });
- };
- trace(this.gotrarepack);
- if (this.gotrarepack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.rarepack.visible = true;
- this.inventoryopen.herepacks.rarepack.item.gotoAndStop("rarepack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.rarepack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.rarepack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.rarepack.unpack_btn.visible = false;
- inventoryopen.herepacks.rarepack.loading.visible = true;
- unpack("rarepack");
- });
- };
- trace(this.gotmilionerpack);
- if (this.gotmilionerpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.milionerpack.visible = true;
- this.inventoryopen.herepacks.milionerpack.item.gotoAndStop("milionerpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.milionerpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.milionerpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.milionerpack.unpack_btn.visible = false;
- inventoryopen.herepacks.milionerpack.loading.visible = true;
- unpack("milionerpack");
- });
- };
- trace(this.gotnvpack);
- if (this.gotnvpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.nvpack.visible = true;
- this.inventoryopen.herepacks.nvpack.item.gotoAndStop("nvpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.nvpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.nvpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.nvpack.unpack_btn.visible = false;
- inventoryopen.herepacks.nvpack.loading.visible = true;
- unpack("nvpack");
- });
- };
- trace(this.gotcupidpack);
- if (this.gotcupidpack)
- {
- this.inventoryopen.herepacks.visible = true;
- this.inventoryopen.herepacks.cupidpack.visible = true;
- this.inventoryopen.herepacks.cupidpack.item.gotoAndStop("cupidpack");
- this.inventoryopen.herepacks.close_btn.tabEnabled = false;
- this.inventoryopen.herepacks.cupidpack.unpack_btn.tabEnabled = false;
- this.inventoryopen.herepacks.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.visible = false;
- });
- this.inventoryopen.herepacks.cupidpack.unpack_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- inventoryopen.herepacks.close_btn.visible = false;
- inventoryopen.herepacks.cupidpack.unpack_btn.visible = false;
- inventoryopen.herepacks.cupidpack.loading.visible = true;
- unpack("cupidpack");
- });
- };
- this.inventoryopen.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (cancloseinventory)
- {
- TheConnection.send("loadplayer", fbuid, "newdb");
- removeChild(MovieClip(e.target.parent));
- eButtons = true;
- };
- });
- this.inventoryopen.medrag.addEventListener(MouseEvent.MOUSE_DOWN, function (e:MouseEvent):void{
- inventoryopen.startDrag();
- });
- this.inventoryopen.headr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("changesuit", "none", "head");
- inventoryopen.headitem.gotoAndStop("none");
- inventoryopen.stickman.toparea.head.gotoAndStop("none");
- });
- this.inventoryopen.eyesr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("changesuit", "none", "eyes");
- inventoryopen.eyesitem.gotoAndStop("none");
- inventoryopen.stickman.toparea.eyes.gotoAndStop("none");
- });
- this.inventoryopen.mouthr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("changesuit", "none", "mouth");
- inventoryopen.mouthitem.gotoAndStop("none");
- inventoryopen.stickman.toparea.mouth.gotoAndStop("none");
- });
- this.inventoryopen.handr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("changesuit", "none", "hands");
- inventoryopen.handitem.gotoAndStop("none");
- inventoryopen.stickman.toparea.hands.gotoAndStop("none");
- });
- this.inventoryopen.shoesr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("changesuit", "none", "foot");
- inventoryopen.footitem.gotoAndStop("none");
- inventoryopen.stickman.toparea.feet.gotoAndStop("none");
- });
- this.inventoryopen.wingsr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("changesuit", "none", "wings");
- inventoryopen.wingsitem.gotoAndStop("none");
- inventoryopen.stickman.toparea.wings.gotoAndStop("none");
- });
- this.inventoryopen.charr.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- TheConnection.send("changesuit", "none", "charcolor");
- inventoryopen.charcoloritem.gotoAndStop("none");
- inventoryopen.stickman.toparea.charcolor.gotoAndStop("none");
- inventoryopen.stickman.middle.charcolor.gotoAndStop("none");
- inventoryopen.stickman.bottomarea.charcolor.gotoAndStop("none");
- });
- this.inventoryopen.medrag.addEventListener(MouseEvent.MOUSE_UP, function (e:MouseEvent):void{
- inventoryopen.stopDrag();
- });
- this.inventoryopen.blockMC.visible = false;
- met = ["skinitem", "headitem", "eyesitem", "mouthitem", "footitem", "skinitem", "handitem", "dealitem", "wingsitem", "charcoloritem"];
- for (i in met)
- {
- t = this.inventoryopen.getChildByName(String(met[i]));
- t.addEventListener(MouseEvent.ROLL_OVER, this.mouseOverI);
- t.addEventListener(MouseEvent.ROLL_OUT, this.mouseOutI);
- };
- this.inventoryopen.stickman.toparea.head.gotoAndStop(this.dbhead);
- this.inventoryopen.stickman.toparea.hands.gotoAndStop(this.dbhands);
- this.inventoryopen.stickman.toparea.eyes.gotoAndStop(this.dbeyes);
- this.inventoryopen.stickman.toparea.feet.gotoAndStop(this.dbfoot);
- this.inventoryopen.stickman.toparea.wings.gotoAndStop(this.dbwings);
- this.inventoryopen.stickman.toparea.charcolor.gotoAndStop(this.dbcharcolor);
- this.inventoryopen.stickman.middle.charcolor.gotoAndStop(this.dbcharcolor);
- this.inventoryopen.stickman.bottomarea.charcolor.gotoAndStop(this.dbcharcolor);
- this.inventoryopen.headitem.gotoAndStop(String(this.dbhead));
- this.inventoryopen.eyesitem.gotoAndStop(String(this.dbeyes));
- this.inventoryopen.mouthitem.gotoAndStop(String(this.dbmouth));
- this.inventoryopen.handitem.gotoAndStop(String(this.dbhands));
- this.inventoryopen.footitem.gotoAndStop(String(this.dbfoot));
- this.inventoryopen.wingsitem.gotoAndStop(String(this.dbwings));
- this.inventoryopen.charcoloritem.gotoAndStop(String(this.dbcharcolor));
- this.inventoryopen.dealitem.gotoAndStop(String(this.dbdealbg));
- this.inventoryopen.skinitem.addEventListener(MouseEvent.CLICK, this.skinclick);
- this.inventoryopen.dealitem.addEventListener(MouseEvent.CLICK, this.dealbgclick);
- this.inventoryopen.headitem.addEventListener(MouseEvent.CLICK, this.headclick);
- this.inventoryopen.eyesitem.addEventListener(MouseEvent.CLICK, this.eyesclick);
- this.inventoryopen.mouthitem.addEventListener(MouseEvent.CLICK, this.mouthclick);
- this.inventoryopen.handitem.addEventListener(MouseEvent.CLICK, this.handsclick);
- this.inventoryopen.footitem.addEventListener(MouseEvent.CLICK, this.footclick);
- this.inventoryopen.wingsitem.addEventListener(MouseEvent.CLICK, this.wingsclick);
- this.inventoryopen.charcoloritem.addEventListener(MouseEvent.CLICK, this.charcolorclick);
- this.inventoryopen.skinitem.gotoAndStop(String(this.dbskin));
- };
- }
- private function unpack(item:String):void{
- if (!this.unpacking)
- {
- this.unpacking = true;
- this.TheConnection.send("task", "unpack", item);
- };
- }
- private function loadinvent(which:String):void{
- if (!this.openeditems)
- {
- trace(which);
- this.openeditems = true;
- this.TheConnection.send("myitems", this.fbuid, which);
- this.items = new Items();
- this.items.x = 419.35;
- this.items.y = 167.9;
- this.items.alpha = 0;
- addChild(this.items);
- if ((((((((((which == "head") || (which == "eyes")) || (which == "dealbg")) || (which == "skin")) || (which == "mouth")) || (which == "foot")) || (which == "hands")) || (which == "wings")) || (which == "charcolor")))
- {
- this.items.classestxt.visible = false;
- this.items.normal_btn.visible = false;
- this.items.prem_btn.visible = false;
- this.items.rare_btn.visible = false;
- this.items.ultra_btn.visible = false;
- this.items.special_btn.visible = false;
- };
- if (which == "normals")
- {
- this.items.normal_btn.gotoAndStop(2);
- };
- if (which == "prems")
- {
- this.items.prem_btn.gotoAndStop(2);
- };
- if (which == "rares")
- {
- this.items.rare_btn.gotoAndStop(2);
- };
- if (which == "ultras")
- {
- this.items.ultra_btn.gotoAndStop(2);
- };
- if (which == "specials")
- {
- this.items.special_btn.gotoAndStop(2);
- };
- Tweener.addTween(this.items, {
- "x":419.35,
- "y":167.9,
- "alpha":1,
- "time":0.3,
- "transition":"easeOutSine"
- });
- this.items.close_btn.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{
- if (!cancloseinventory)
- {
- removeChild(MovieClip(e.target.parent));
- cancloseinventory = true;
- openeditems = false;
- inventoryopen.blockMC.visible = false;
- changeSkin = false;
- changehead = false;
- changemouth = false;
- changeeyes = false;
- changehands = false;
- changefoot = false;
- changewings = false;
- changecharcolor = false;
- changedealbg = false;
- };
- if (((currentFrame == 3) && (iwilloffer)))
- {
- removeChild(MovieClip(e.target.parent));
- makeoffer.visible = true;
- openeditems = false;
- iwilloffer = false;
- };
- if (((currentFrame == 3) && (giveoffer == true)))
- {
- removeChild(MovieClip(e.target.parent));
- openeditems = false;
- giveoffer = false;
- whichslot = "";
- };
- });
- };
- }
- private function disablechange():void{
- if (!this.cancloseinventory)
- {
- this.inventoryopen.blockMC.visible = true;
- };
- }
- private function headclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("head");
- this.disablechange();
- this.changehead = true;
- }
- private function mouthclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("mouth");
- this.disablechange();
- this.changemouth = true;
- }
- private function skinclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("skin");
- this.disablechange();
- this.changeSkin = true;
- }
- private function dealbgclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("dealbg");
- this.disablechange();
- this.changedealbg = true;
- }
- private function eyesclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("eyes");
- this.disablechange();
- this.changeeyes = true;
- }
- private function handsclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("hands");
- this.disablechange();
- this.changehands = true;
- }
- private function footclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("foot");
- this.disablechange();
- this.changefoot = true;
- }
- private function wingsclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("wings");
- this.disablechange();
- this.changewings = true;
- }
- private function charcolorclick(e:MouseEvent):void{
- this.cancloseinventory = false;
- this.loadinvent("charcolor");
- this.disablechange();
- this.changecharcolor = true;
- }
- private function mouseOverU(e:MouseEvent):void{
- var mySound:Sound;
- mySound = new blub2();
- mySound.play();
- Tweener.addTween(MovieClip(e.currentTarget), {
- "scaleX":1,
- "scaleY":1.2,
- "time":0.1,
- "transition":"easeInSine"
- });
- }
- private function mouseOutU(e:MouseEvent):void{
- Tweener.addTween(MovieClip(e.currentTarget), {
- "scaleX":0.851119995117188,
- "scaleY":1.02371215820313,
- "time":0.3,
- "transition":"easeInSine"
- });
- }
- private function mouseOverI(e:MouseEvent):void{
- Tweener.addTween(MovieClip(e.currentTarget), {
- "scaleX":1,
- "scaleY":1,
- "time":0.1,
- "transition":"easeInSine"
- });
- }
- private function mouseOutI(e:MouseEvent):void{
- Tweener.addTween(MovieClip(e.currentTarget), {
- "scaleX":0.8,
- "scaleY":0.8,
- "time":0.3,
- "transition":"easeInSine"
- });
- }
- private function changeskin(theskin:String):void{
- this.TheConnection.send("changeskin", theskin);
- this.dbskin = theskin;
- this.newp.visible = false;
- this.dbhead = "none";
- this.dbeyes = "none";
- this.dbmouth = "none";
- this.dbhands = "none";
- this.dbfoot = "none";
- this.dbwings = "none";
- this.dbcharcolor = "none";
- this.dbcoins = 0;
- this.dbdice = 0;
- this.dblevel = 1;
- this.dbxp = 0;
- this.letsStart();
- }
- private function handleDisconnect():void{
- this.alert("Disconnected");
- gotoAndStop(5);
- }
- private function handleError(error:PlayerIOError):void{
- this.alert(String(error));
- }
- internal function frame3():*{
- this.groupgo.addEventListener(MouseEvent.CLICK, this.fl_ClickToGoToWebPage);
- this.pagego.addEventListener(MouseEvent.CLICK, this.fl_ClickToGoToWebPage_4);
- this.gotonovak.addEventListener(MouseEvent.CLICK, this.fl_ClickToGoToWebPage_6);
- stop();
- }
- }
- }//package
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement