STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228079
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2560 · P5120

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/85902416?noj=FRM85902416-1DC" width="1" height="1"></div>

chat.swf

This is the info page for
Flash #58053

(Click the ID number above for more basic data on this flash file.)


Text
<p align="left"><font face="Times New Roman" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1">Re-randomize color</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1">Reconnect</font></p>

<p align="left"></p>

<p align="left"></p>

<p align="left"></p>

<p align="left"><font face="Times New Roman" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1"><a href="event:changeNick">Change</a></font></p>

<p align="left"></p>

<p align="left"><font face="Times New Roman" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1">Mute</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1">Unmute</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#ffffff" letterSpacing="0.000000" kerning="1">Your nickname:</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#cccccc" letterSpacing="0.000000" kerning="1">Whisper to</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#cccccc" letterSpacing="0.000000" kerning="1">Kick</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#cccccc" letterSpacing="0.000000" kerning="1">Ban</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#cccccc" letterSpacing="0.000000" kerning="1">Pong</font></p>

<p align="left"><font face="Times New Roman" size="12" color="#666666" letterSpacing="0.000000" kerning="1"><a href="http://mecha-cynic.com/UAX/Changelog.html" target = "_blank">version</a></font></p>

<p align="left"><font face="Times New Roman" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p>

<p align="left"><font face="Times New Roman" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p>

ActionScript [AS3]

Section 1
//MainTimeline (Chat_fla.MainTimeline) package Chat_fla { import fl.controls.*; import flash.display.*; import pong.vec2d.*; import flash.events.*; import pong.paddle.*; import flash.text.*; import flash.utils.*; import flash.ui.*; import flash.system.*; import adobe.utils.*; import flash.accessibility.*; import flash.errors.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.xml.*; public dynamic class MainTimeline extends MovieClip { public var changeButton:SimpleButton; public var unmuteButton:SimpleButton; public var selectedUser; public var userList:TextField; public var adminPassword; public var muterButton:SimpleButton; public var fontColoring; public var hours; public var loadedNick; public var kickButton:SimpleButton; public var playingWith; public var checkTimer; public var playerScore1:TextField; public var playerScore2:TextField; public var timestamp; public var banButton:SimpleButton; public var pongTimer; public var reconnectTimer; public var bgColor; public var ball:Ball; public var userlistScrollbar:UIScrollBar; public var messagesScrollbar:UIScrollBar; public var randomizeButton:SimpleButton; public var timer; public var grid:MovieClip; public var pongButton:SimpleButton; public var vecb:Vec2d; public var vecc:Vec2d; public var nickLabel:MovieClip; public var chatBox:TextField; public var whisperButton:SimpleButton; public var reconnectButton:SimpleButton; public var muted; public var yOffset; public var player1:Paddle; public var player2:Paddle; public var adminGranted; public var xmlSock; public var currentNick; public var nicknameBox:TextField; public var seconds; public var port; public var mousex; public var mousey; public var adminName; public var sent; public var vec:Vec2d; public var host; public var localData; public var versionDisplay:TextField; public var time; public var endFont; public var version; public var messagesBox:TextField; public var score2; public var player; public var minutes; public var score1; public var pong; public function MainTimeline(){ addFrameScript(0, frame1); __setProp_messagesScrollbar_Scene1_Layer1_0(); __setProp_userlistScrollbar_Scene1_Layer1_0(); } public function kickButton_Clicked(_arg1){ xmlSock.send((((((("admin|kick|" + selectedUser) + "|") + adminName) + "|") + adminPassword) + "\n")); } public function mouseMoved(_arg1){ if (player == 1){ player1.yTarget = _arg1.localY.valueOf(); if (player1.yTarget < (player1.length / 2)){ player1.yTarget = (player1.length / 2); }; if (player1.yTarget > (199 - (player1.length / 2))){ player1.yTarget = (199 - (player1.length / 2)); }; } else { player2.yTarget = _arg1.localY.valueOf(); if (player2.yTarget < (player1.length / 2)){ player2.yTarget = (player1.length / 2); }; if (player2.yTarget > (199 - (player1.length / 2))){ player2.yTarget = (199 - (player1.length / 2)); }; }; } public function pongButton_Clicked(_arg1){ if (pong == true){ } else { player = 1; startPong(selectedUser); xmlSock.send((("pong|gameRequest|" + selectedUser) + "|you\n")); playingWith = selectedUser; }; } public function randomizeButton_Clicked(_arg1){ xmlSock.send(("ran" + "\n")); } public function userlistBox_LinkClicked(_arg1){ openMenu(_arg1.text); } public function whisperButton_Clicked(_arg1){ chatBox.text = (("/w \"" + selectedUser) + "\" "); } public function mouseMovedScore(_arg1){ if (player == 1){ player1.yTarget = (199 - (25 / 2)); } else { player2.yTarget = (199 - (25 / 2)); }; } public function stopPong(_arg1:Boolean){ yOffset = 0; if (pong == true){ playerScore1.visible = false; playerScore2.visible = false; pong = false; if (muted == true){ unmuteButton.y = 524; } else { muterButton.y = 524; }; reconnectButton.y = 524; randomizeButton.y = 524; changeButton.y = 524; nickLabel.y = 524; nicknameBox.y = 524; chatBox.y = (chatBox.y + 200); messagesBox.height = (messagesBox.height + 200); userList.height = (userList.height + 200); messagesScrollbar.height = (messagesScrollbar.height + 200); userlistScrollbar.height = (userlistScrollbar.height + 200); if (_arg1 == true){ xmlSock.send((("pong|gameStop|" + playingWith) + "\n")); }; }; } public function reconnectButton_Clicked(_arg1){ reconnectTimer.reset(); reconnect(null); } public function xmlEvents(_arg1){ switch (_arg1.type){ case "connect": messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>Connected!</b><br><b>System</b>: <i>To whisper, type /w nickname message. To reply to a whisper, you can type /r message. To emote, type /me emote.</i>") + endFont)); reconnectButton.visible = false; break; case "ioError": messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>Failed to connect. Perhaps the servers are down? :(<br>Attempting to reconnect in 5 seconds.</b><br>") + endFont)); reconnectButton.visible = true; messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); reconnectTimer.reset(); reconnectTimer.start(); break; case "close": messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>You have been disconnected.<br>Attempting to reconnect in 5 seconds.</b><br>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); beep(2); beep(1); beep(2); beep(1); reconnectButton.visible = true; reconnectTimer.reset(); reconnectTimer.start(); timer.reset(); break; case "securityError": messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>Policy server related error. It keeps going down every now and then, please bear with us. You might be able to fix this by refreshing.</b><br>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); beep(2); beep(1); beep(2); beep(1); reconnectButton.visible = true; break; }; } public function beep(_arg1){ } public function collision(_arg1:Ball, _arg2:Paddle, _arg3:Paddle){ var _local4:*; var _local5:* = {x1:(_arg1.x - 3), x2:(_arg1.x + 3), y1:(_arg1.y + 3), y2:(_arg1.y - 3)}; if (player == 1){ _local4 = {x1:_arg2.x, x2:_arg2.x, y1:(1 + (_arg2.y + (_arg2.length / 2))), y2:(1 + (_arg2.y - (_arg2.length / 2)))}; if (isColliding(_local5, _local4).x != null){ ball.directionX = (ball.directionX * -1); if (ball.directionX < 0){ ball.directionX = (ball.directionX - 0.5); } else { ball.directionX = (ball.directionX + 0.5); }; if (ball.directionY < 0){ ball.directionY = (ball.directionY - 0.5); } else { ball.directionY = (ball.directionY + 0.5); }; xmlSock.send((((((((("pong|update|" + ball.x.toString()) + "|") + ball.y.toString()) + "|") + ball.directionX.toString()) + "|") + ball.directionY.toString()) + "\n")); }; if ((ball.x - 3) < 0){ ball = new Ball(273.5, 100, 3, vecc, 0xFFFFFF, 1.5); ball.directionX = -3; ball.directionY = -3; score1++; playerScore1.text = score1.toString(); xmlSock.send("pong|score|0\n"); xmlSock.send((((((((("pong|update|" + ball.x.toString()) + "|") + ball.y.toString()) + "|") + ball.directionX.toString()) + "|") + ball.directionY.toString()) + "\n")); }; } else { _local4 = {x1:_arg3.x, x2:_arg3.x, y1:(1 + (_arg3.y + (_arg3.length / 2))), y2:(1 + (_arg3.y - (_arg3.length / 2)))}; if (isColliding(_local5, _local4).x != null){ ball.directionX = (ball.directionX * -1); if (ball.directionX < 0){ ball.directionX = (ball.directionX - 0.5); } else { ball.directionX = (ball.directionX + 0.5); }; if (ball.directionY < 0){ ball.directionY = (ball.directionY - 0.5); } else { ball.directionY = (ball.directionY + 0.5); }; xmlSock.send((((((((("pong|update|" + ball.x.toString()) + "|") + ball.y.toString()) + "|") + ball.directionX.toString()) + "|") + ball.directionY.toString()) + "\n")); }; if ((ball.x + 3) > 550){ ball = new Ball(273.5, 100, 3, vecc, 0xFFFFFF, 1.5); ball.directionX = 3; ball.directionY = 3; score2++; playerScore2.text = score2.toString(); xmlSock.send("pong|score|1\n"); xmlSock.send((((((((("pong|update|" + ball.x.toString()) + "|") + ball.y.toString()) + "|") + ball.directionX.toString()) + "|") + ball.directionY.toString()) + "\n")); }; }; if ((((ball.y <= 5)) || ((ball.y >= 195)))){ ball.directionY = (ball.directionY * -1); }; } public function newMessage(_arg1){ var _local3:*; var _local2:* = _arg1.data.split("|"); switch (_local2[0]){ case "t": getOldTime(Math.floor(Number(_local2[5].replace(",", ".")))); if ((((((((_local2[2].charAt(0) == "/")) && ((_local2[2].charAt(1) == "m")))) && ((_local2[2].charAt(2) == "e")))) && ((_local2[2].charAt(3) == " ")))){ messagesBox.htmlText = (messagesBox.htmlText + (((((((((fontColoring + timestamp) + "<font color=\"#") + _local2[4]) + "\"><i><b>") + _local2[1]) + "</b></font> ") + _local2[2].replace("/me ", "")) + "</i>") + endFont)); } else { messagesBox.htmlText = (messagesBox.htmlText + (((((((fontColoring + timestamp) + "<font color=\"#") + _local2[4]) + "\"><b>") + _local2[1]) + "</b></font>: ") + _local2[2])); }; messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); break; case "c": beep(_local2[3]); getTime(); if ((((((((_local2[2].charAt(0) == "/")) && ((_local2[2].charAt(1) == "m")))) && ((_local2[2].charAt(2) == "e")))) && ((_local2[2].charAt(3) == " ")))){ messagesBox.htmlText = (messagesBox.htmlText + (((((((((fontColoring + timestamp) + "<font color=\"#") + _local2[4]) + "\"><i><b>") + _local2[1]) + "</b></font> ") + _local2[2].replace("/me ", "")) + "</i>") + endFont)); } else { messagesBox.htmlText = (messagesBox.htmlText + (((((((fontColoring + timestamp) + "<font color=\"#") + _local2[4]) + "\"><b>") + _local2[1]) + "</b></font>: ") + _local2[2])); }; messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); break; case "ka": timer.reset(); timer.start(); xmlSock.send("ka\n"); break; case "n": getTime(); messagesBox.htmlText = (messagesBox.htmlText + (((((((fontColoring + timestamp) + "<b>System</b>: <i>") + _local2[1]) + " has changed their nick to ") + _local2[2]) + ".</i>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); userList.htmlText = userList.htmlText.replace((((("<P ALIGN=\"LEFT\"><FONT FACE=\"Times New Roman\" SIZE=\"13\" COLOR=\"#FFFFFF\" LETTERSPACING=\"0\" KERNING=\"0\"><A HREF=\"event:" + _local2[1]) + "\" TARGET=\"\">") + _local2[1]) + "</A></FONT></P>"), (((("<P ALIGN=\"LEFT\"><FONT FACE=\"Times New Roman\" SIZE=\"13\" COLOR=\"#FFFFFF\" LETTERSPACING=\"0\" KERNING=\"0\"><A HREF=\"event:" + _local2[2]) + "\" TARGET=\"\">") + _local2[2]) + "</A></FONT></P>")); break; case "v": beep(_local2[4]); getTime(); _local3 = "<font>"; if (_local2[3] == "1"){ _local3 = "<font color=\"#1A53FF\">"; } else { if (_local2[3] == "0"){ _local3 = "<font color=\"#FF1A53\">"; }; }; messagesBox.htmlText = (messagesBox.htmlText + (((((((fontColoring + timestamp) + _local3) + "<i>&gt; ") + _local2[1]) + ": ") + _local2[2]) + "</i></font>")); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); break; case "w": if (userList.htmlText.indexOf("event:") == -1){ userList.htmlText = ((((((fontColoring + "<A HREF=\"event:") + _local2[1]) + "\" TARGET=\"\">") + _local2[1]) + "</A>") + endFont); } else { userList.htmlText = (userList.htmlText + ((((((fontColoring + "<A HREF=\"event:") + _local2[1]) + "\" TARGET=\"\">") + _local2[1]) + "</A>") + endFont)); }; break; case "x": getTime(); messagesBox.htmlText = (messagesBox.htmlText + (((((fontColoring + timestamp) + "<b>System</b>: <i>") + _local2[1]) + " has disconnected.</i>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); userList.htmlText = userList.htmlText.replace((((("<P ALIGN=\"LEFT\"><FONT FACE=\"Times New Roman\" SIZE=\"13\" COLOR=\"#FFFFFF\" LETTERSPACING=\"0\" KERNING=\"0\"><A HREF=\"event:" + _local2[1]) + "\" TARGET=\"\">") + _local2[1]) + "</A></FONT></P>"), ""); break; case "y": getTime(); messagesBox.htmlText = (messagesBox.htmlText + (((((fontColoring + timestamp) + "<b>System</b>: <i>") + _local2[1]) + " has connected.</i>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); if (userList.htmlText.indexOf("event:") == -1){ userList.htmlText = ((((((fontColoring + "<A HREF=\"event:") + _local2[1]) + "\" TARGET=\"\">") + _local2[1]) + "</A>") + endFont); } else { userList.htmlText = (userList.htmlText + ((((((fontColoring + "<A HREF=\"event:") + _local2[1]) + "\" TARGET=\"\">") + _local2[1]) + "</A>") + endFont)); }; break; case "z": currentNick = _local2[1]; nicknameBox.text = _local2[1]; if (((!(sent)) && (!((loadedNick == null))))){ nicknameBox.text = loadedNick; changeButton_Clicked(null); sent = true; }; break; case "admin": if (_local2[1] == "reg"){ if (_local2[2] == 0){ adminName = _local2[3]; adminPassword = _local2[4]; adminGranted = true; localData.data.adminName = adminName; localData.data.adminPassword = adminPassword; localData.data.adminGranted = adminGranted; localData.flush(); messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + timestamp) + "<b>System</b>: <i>You have been accepted as a moderator.</i></font>")); }; }; break; case "banned": localData.data.banned = true; localData.flush(); break; case "pong": if ((((_local2[1] == "gameStop")) && ((_local2[2] == currentNick)))){ if (_local2[3] == 0){ stopPong(false); } else { stopPong(true); }; score1 = 0; score2 = 0; playerScore1.text = "0"; playerScore2.text = "0"; }; if (_local2[1] == "yourStuff"){ if (player == 1){ player1 = new Paddle(5, 100, 30, vec, Number(("0x" + _local2[2])), Number(_local2[3])); } else { player2 = new Paddle(534, 100, 30, vecb, Number(("0x" + _local2[2])), Number(_local2[3])); }; }; if (_local2[1] == "gameStart"){ startPong(_local2[2]); if (_local2[3] == 1){ player = 2; }; xmlSock.send((((("pong|yourStuff|" + _local2[4]) + "|") + _local2[5]) + "\n")); if (player == 2){ player1 = new Paddle(5, 100, 30, vec, Number(("0x" + _local2[4])), Number(_local2[5])); } else { player2 = new Paddle(534, 100, 30, vecb, Number(("0x" + _local2[4])), Number(_local2[5])); }; } else { if (_local2[1] == "m"){ if (player == 1){ player2.yTarget = Number(_local2[2]); } else { player1.yTarget = Number(_local2[2]); }; } else { if (_local2[1] == "update"){ ball.x = Number(_local2[2]); ball.y = Number(_local2[3]); ball.directionX = Number(_local2[4]); ball.directionY = Number(_local2[5]); } else { if (_local2[1] == "score"){ if (_local2[2] == "0"){ score1++; playerScore1.text = score1.toString(); } else { score2++; playerScore2.text = score2.toString(); }; }; }; }; }; break; }; } public function getTime(){ time = new Date(); hours = time.getHours(); seconds = time.getSeconds(); minutes = time.getMinutes(); if (hours < 10){ timestamp = ("(0" + hours); } else { timestamp = ("(" + hours); }; if (minutes < 10){ timestamp = (timestamp + (":0" + minutes)); } else { timestamp = (timestamp + (":" + minutes)); }; if (seconds < 10){ timestamp = (timestamp + ((":0" + seconds) + ") ")); } else { timestamp = (timestamp + ((":" + seconds) + ") ")); }; } public function reconnect(_arg1){ messagesBox.htmlText = ((fontColoring + "<b>Reconnected!</b>") + endFont); userList.htmlText = ""; if (localData.data.banned != true){ xmlSock.connect(host, port); } else { reconnectButton.visible = false; messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>System</b>: <i>You are perma-banned. :/</i>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); beep(2); beep(1); beep(2); beep(1); }; sent = false; loadedNick = localData.data.nickname; if (loadedNick == null){ sent = true; }; } public function getOldTime(_arg1:Number){ time = new Date(); hours = time.getHours(); minutes = time.getMinutes(); seconds = time.getSeconds(); var _local2:* = (hours + Math.floor(((minutes - (_arg1 / 60)) / 60))); while (_local2 < 0) { _local2 = (24 + _local2); }; var _local3:* = (_arg1 / 60); while (_local3 > 60) { _local3 = (_local3 - 60); }; var _local4:* = (minutes - Math.floor(_local3)); while (_local4 < 0) { _local4 = (60 + _local4); }; _local3 = _arg1; while (_local3 > 60) { _local3 = (_local3 - 60); }; var _local5:* = (seconds - Math.floor(_local3)); while (_local5 < 0) { _local5 = (60 + _local5); }; if (_local2 < 10){ timestamp = ("(0" + _local2); } else { timestamp = ("(" + _local2); }; if (_local4 < 10){ timestamp = (timestamp + (":0" + _local4)); } else { timestamp = (timestamp + (":" + _local4)); }; if (_local5 < 10){ timestamp = (timestamp + ((":0" + _local5) + ") ")); } else { timestamp = (timestamp + ((":" + _local5) + ") ")); }; } public function drawBall(_arg1:Ball){ grid.graphics.lineStyle(6, _arg1.color, 0xFF, true, "normal", "none"); grid.graphics.moveTo(_arg1.x, (_arg1.y + 3)); grid.graphics.lineTo(_arg1.x, (_arg1.y - 3)); } function frame1(){ version = "v1.1.14"; versionDisplay.htmlText = (("<a href=\"http://mecha-cynic.com/UAX/Changelog.html\" target=\"_blank\">" + version) + "</a>"); reconnectButton.visible = false; unmuteButton.enabled = false; unmuteButton.visible = false; unmuteButton.y = 50000; muterButton.enabled = false; muterButton.visible = false; pongTimer = new Timer(1); timer = new Timer(1000, 35); reconnectTimer = new Timer(5000, 1); checkTimer = new Timer(10000); checkTimer.reset(); checkTimer.addEventListener("timer", checkTick); reconnectTimer.reset(); reconnectTimer.addEventListener("timerComplete", reconnect); timer.reset(); timer.addEventListener("timerComplete", timedout); sent = false; port = 1337; host = "unknownax.is-a-geek.com"; time = new Date(); selectedUser = ""; muted = false; fontColoring = "<font color=\"#FFFFFF\" size=\"13\">"; endFont = "</font>"; bgColor = 0x232323; currentNick = ""; xmlSock = new XMLSocket(); localData = SharedObject.getLocal("unknownax_Data"); adminGranted = localData.data.adminGranted; adminName = localData.data.adminName; adminPassword = localData.data.adminPassword; loadedNick = localData.data.nickname; if (localData.data.banned == null){ localData.data.banned = false; }; if (adminGranted == null){ adminGranted = false; }; if (adminName == null){ adminName = ""; }; if (adminPassword == null){ adminPassword = ""; }; if (loadedNick == null){ sent = true; }; playerScore1.visible = false; playerScore2.visible = false; score1 = 0; score2 = 0; yOffset = 0; pong = false; vec = new Vec2d(270, 25, 5, 100); vecb = new Vec2d(270, 25, 534, 100); vecc = new Vec2d(270, 25, 534, 100); player1 = new Paddle(5, 100, 30, vec, 0xFF0000, 1.5); player2 = new Paddle(534, 100, 30, vecb, 0xFF0000, 1.5); ball = new Ball(273.5, 100, 3, vecc, 0xFFFFFF, 1.5); grid = new MovieClip(); grid.x = 0; grid.y = 350; addChild(grid); messagesBox.backgroundColor = bgColor; userList.backgroundColor = bgColor; chatBox.backgroundColor = bgColor; nicknameBox.backgroundColor = bgColor; if (localData.data.banned == true){ reconnectButton.visible = false; messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>System</b>: <i>You are perma-banned. :/</i>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); beep(2); beep(1); beep(2); beep(1); } else { xmlSock.addEventListener(Event.CONNECT, xmlEvents); xmlSock.addEventListener(IOErrorEvent.IO_ERROR, xmlEvents); xmlSock.addEventListener(Event.CLOSE, xmlEvents); xmlSock.addEventListener(DataEvent.DATA, newMessage); chatBox.addEventListener(KeyboardEvent.KEY_UP, chatBox_KeyPress); changeButton.addEventListener(MouseEvent.CLICK, changeButton_Clicked); muterButton.addEventListener(MouseEvent.MOUSE_UP, muterButton_Clicked); unmuteButton.addEventListener(MouseEvent.MOUSE_UP, muterButton_Clicked); reconnectButton.addEventListener(MouseEvent.CLICK, reconnectButton_Clicked); randomizeButton.addEventListener(MouseEvent.CLICK, randomizeButton_Clicked); this.addEventListener(Event.ENTER_FRAME, frameStart); this.addEventListener(MouseEvent.CLICK, mouseClicked); this.addEventListener(MouseEvent.MOUSE_MOVE, mouseMovedStage); grid.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoved); playerScore1.addEventListener(MouseEvent.MOUSE_MOVE, mouseMovedScore); playerScore2.addEventListener(MouseEvent.MOUSE_MOVE, mouseMovedScore); whisperButton.addEventListener(MouseEvent.MOUSE_UP, whisperButton_Clicked); pongButton.addEventListener(MouseEvent.MOUSE_UP, pongButton_Clicked); kickButton.addEventListener(MouseEvent.MOUSE_UP, kickButton_Clicked); banButton.addEventListener(MouseEvent.MOUSE_UP, banButton_Clicked); userList.addEventListener(TextEvent.LINK, userlistBox_LinkClicked); xmlSock.connect(host, port); }; } public function closeMenu(){ whisperButton.x = 50000; pongButton.x = 50000; kickButton.x = 50000; banButton.x = 50000; whisperButton.y = 50000; pongButton.y = 50000; kickButton.y = 50000; banButton.y = 50000; selectedUser = ""; } public function isColliding(_arg1, _arg2){ var _local9:*; var _local3:* = {x:(_arg1.x2 - _arg1.x1), y:(_arg1.y2 - _arg1.y1)}; var _local4:* = {x:(_arg2.x2 - _arg2.x1), y:(_arg2.y2 - _arg2.y1)}; var _local5:* = ((-(_local4.x) * _local3.y) + (_local3.x * _local4.y)); var _local6:* = {x:(_arg1.x1 - _arg2.x1), y:(_arg1.y1 - _arg2.y1)}; var _local7:* = (((-(_local3.y) * _local6.x) + (_local3.x * _local6.y)) / _local5); var _local8:* = (((_local4.x * _local6.y) - (_local4.y * _local6.x)) / _local5); if ((((((((_local7 >= 0)) && ((_local7 <= 1)))) && ((_local8 >= 0)))) && ((_local8 <= 1)))){ _local9 = {x:(_arg1.x1 + (_local8 * _local3.x)), y:(_arg1.y1 + (_local8 * _local3.y))}; return (_local9); }; return ({x:null, y:null}); } public function isInRange(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{ if (_arg2 > _arg3){ if ((((_arg1 > _arg3)) && ((_arg1 < _arg2)))){ return (true); }; return (false); //unresolved jump }; if ((((_arg1 > _arg2)) && ((_arg1 < _arg3)))){ return (true); }; return (false); } public function mouseMovedStage(_arg1){ mousex = _arg1.stageX; mousey = _arg1.stageY; } public function startPong(_arg1:String){ if ((((pong == false)) || ((pong == null)))){ score1 = 0; score2 = 0; playerScore1.text = score1.toString(); playerScore2.text = score2.toString(); playerScore1.visible = true; playerScore2.visible = true; ball = new Ball(273.5, 100, 3, vecc, 0xFFFFFF, 1.5); playingWith = _arg1; pong = true; yOffset = -200; if (muted == true){ unmuteButton.y = (524 - 200); } else { muterButton.y = (524 - 200); }; reconnectButton.y = (524 - 200); randomizeButton.y = (524 - 200); changeButton.y = (524 - 200); nickLabel.y = (524 - 200); nicknameBox.y = (524 - 200); chatBox.y = (chatBox.y - 200); messagesBox.height = (messagesBox.height - 200); userList.height = (userList.height - 200); messagesScrollbar.height = (messagesScrollbar.height - 200); userlistScrollbar.height = (userlistScrollbar.height - 200); getTime(); messagesBox.htmlText = (messagesBox.htmlText + ((((fontColoring + timestamp) + "<b>System</b>: <i>You have joined a game of pong with ") + _arg1) + ".</i></font>")); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); }; } public function chatBox_KeyPress(_arg1){ var _local2:RegExp; var _local3:RegExp; var _local4:RegExp; if ((((_arg1.charCode == 13)) && (!((chatBox.text == ""))))){ _local2 = /\|/g; _local3 = /</g; _local4 = />/g; chatBox.text = chatBox.text.replace(_local2, " "); chatBox.text = chatBox.text.replace(_local3, "&lt;"); chatBox.text = chatBox.text.replace(_local4, "&gt;"); xmlSock.send((("c|" + chatBox.text) + "\n")); chatBox.text = ""; }; } public function timedout(_arg1){ if (xmlSock.connected == true){ xmlSock.close(); messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>You have been timed out.<br>Attempting to reconnect in 5 seconds.</b></b><br>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); reconnectButton.visible = true; timer.stop(); timer.reset(); reconnectTimer.reset(); reconnectTimer.start(); }; } public function mouseClicked(_arg1){ var _local2:*; if (adminGranted == true){ _local2 = 100; } else { _local2 = 40; }; if ((((((((mousex > (whisperButton.x + whisperButton.width))) || ((mousex < whisperButton.x)))) || ((mousey < whisperButton.y)))) || ((mousey > (whisperButton.y + _local2))))){ closeMenu(); }; } public function checkTick(_arg1){ if (!xmlSock.connected){ messagesBox.htmlText = (messagesBox.htmlText + ((fontColoring + "<b>You have been disconnected.<br>Attempting to reconnect in 5 seconds.</b><br>") + endFont)); messagesBox.scrollV = (messagesBox.maxScrollV + 100); messagesScrollbar.update(); beep(2); beep(1); beep(2); beep(1); reconnectButton.visible = true; reconnectTimer.reset(); reconnectTimer.start(); timer.reset(); }; } public function drawPaddle(_arg1:Paddle){ grid.graphics.lineStyle(((Math.random() + 1) * 3), _arg1.color, 0xFF, true, "normal", "none"); grid.graphics.moveTo(_arg1.x, (_arg1.y - (_arg1.length / 2))); grid.graphics.lineTo(_arg1.x, (_arg1.y + (_arg1.length / 2))); } function __setProp_userlistScrollbar_Scene1_Layer1_0(){ try { userlistScrollbar["componentInspectorSetting"] = true; } catch(e:Error) { }; userlistScrollbar.direction = "vertical"; userlistScrollbar.scrollTargetName = "chatBox"; userlistScrollbar.visible = true; try { userlistScrollbar["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function openMenu(_arg1:String){ selectedUser = _arg1; whisperButton.x = mousex; pongButton.x = mousex; if (adminGranted == true){ kickButton.x = mousex; banButton.x = mousex; }; whisperButton.y = mousey; pongButton.y = (mousey + 20); if (adminGranted == true){ kickButton.y = (mousey + 40); banButton.y = (mousey + 60); }; } public function muterButton_Clicked(_arg1){ if (muted == true){ muted = false; if (pong){ muterButton.y = (524 + yOffset); } else { muterButton.y = 524; }; unmuteButton.y = 50000; } else { muted = true; muterButton.y = 5000; if (pong){ unmuteButton.y = (524 + yOffset); } else { unmuteButton.y = 524; }; }; } public function changeButton_Clicked(_arg1){ var _local2:RegExp = /\|/g; var _local3:RegExp = /</g; var _local4:RegExp = />/g; nicknameBox.text = nicknameBox.text.replace(_local2, " "); nicknameBox.text = nicknameBox.text.replace(_local3, "&lt;"); nicknameBox.text = nicknameBox.text.replace(_local4, "&gt;"); xmlSock.send((((("n|" + currentNick) + "|") + nicknameBox.text) + "\n")); currentNick = nicknameBox.text; localData.data.nickname = currentNick; localData.flush(); } function __setProp_messagesScrollbar_Scene1_Layer1_0(){ try { messagesScrollbar["componentInspectorSetting"] = true; } catch(e:Error) { }; messagesScrollbar.direction = "vertical"; messagesScrollbar.scrollTargetName = "messagesBox"; messagesScrollbar.visible = true; try { messagesScrollbar["componentInspectorSetting"] = false; } catch(e:Error) { }; } public function banButton_Clicked(_arg1){ xmlSock.send((((((("admin|ban|" + selectedUser) + "|") + adminName) + "|") + adminPassword) + "\n")); } public function frameStart(_arg1){ if (pong == true){ if (player == 1){ if (score2 >= 7){ stopPong(true); closeMenu(); xmlSock.send((((((("pong|announceScore|" + playingWith) + "|") + score2) + "|") + score1) + "\n")); score1 = 0; score2 = 0; playerScore1.text = "0"; playerScore2.text = "0"; }; } else { if (score1 >= 7){ stopPong(true); closeMenu(); xmlSock.send((((((("pong|announceScore|" + playingWith) + "|") + score1) + "|") + score2) + "\n")); score1 = 0; score2 = 0; playerScore1.text = "0"; playerScore2.text = "0"; }; }; pongTimer.start(); if (pongTimer.currentCount >= 66){ if (player == 1){ xmlSock.send((("pong|m|" + player1.yTarget) + "\n")); } else { xmlSock.send((("pong|m|" + player2.yTarget) + "\n")); }; pongTimer.reset(); pongTimer.start(); }; grid.graphics.clear(); grid.graphics.lineStyle(1, 0xFF0000, 0xFF, true, "normal", "none"); grid.graphics.beginFill(0x232323); grid.graphics.drawRect(0, 0, 539, 199); grid.graphics.endFill(); player1.update(); player2.update(); ball.update(); collision(ball, player1, player2); drawPaddle(player1); drawPaddle(player2); drawBall(ball); setChildIndex(playerScore1, (numChildren - 1)); setChildIndex(playerScore2, (numChildren - 1)); } else { grid.graphics.clear(); }; } } }//package Chat_fla
Section 2
//BaseButton (fl.controls.BaseButton) package fl.controls { import flash.display.*; import fl.core.*; import flash.events.*; import fl.events.*; import flash.utils.*; public class BaseButton extends UIComponent { protected var pressTimer:Timer; protected var _autoRepeat:Boolean;// = false protected var _selected:Boolean;// = false protected var background:DisplayObject; private var unlockedMouseState:String; protected var mouseState:String; private var _mouseStateLocked:Boolean;// = false private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35}; public function BaseButton(){ buttonMode = true; mouseChildren = false; useHandCursor = false; setupMouseEvents(); setMouseState("up"); pressTimer = new Timer(1, 0); pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true); } override public function get enabled():Boolean{ return (super.enabled); } protected function startPress():void{ if (_autoRepeat){ pressTimer.delay = Number(getStyleValue("repeatDelay")); pressTimer.start(); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } override protected function draw():void{ if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawBackground(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; super.draw(); } protected function drawLayout():void{ background.width = width; background.height = height; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; mouseEnabled = _arg1; } public function set autoRepeat(_arg1:Boolean):void{ _autoRepeat = _arg1; } protected function mouseEventHandler(_arg1:MouseEvent):void{ if (_arg1.type == MouseEvent.MOUSE_DOWN){ setMouseState("down"); startPress(); } else { if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){ setMouseState("over"); endPress(); } else { if (_arg1.type == MouseEvent.ROLL_OUT){ setMouseState("up"); endPress(); }; }; }; } protected function drawBackground():void{ var _local1:String = (enabled) ? mouseState : "disabled"; if (selected){ _local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1)); }; _local1 = (_local1 + "Skin"); var _local2:DisplayObject = background; background = getDisplayObjectInstance(getStyleValue(_local1)); addChildAt(background, 0); if (((!((_local2 == null))) && (!((_local2 == background))))){ removeChild(_local2); }; } public function get selected():Boolean{ return (_selected); } protected function setupMouseEvents():void{ addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true); addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true); } protected function endPress():void{ pressTimer.reset(); } public function set mouseStateLocked(_arg1:Boolean):void{ _mouseStateLocked = _arg1; if (_arg1 == false){ setMouseState(unlockedMouseState); } else { unlockedMouseState = mouseState; }; } public function get autoRepeat():Boolean{ return (_autoRepeat); } public function set selected(_arg1:Boolean):void{ if (_selected == _arg1){ return; }; _selected = _arg1; invalidate(InvalidationType.STATE); } protected function buttonDown(_arg1:TimerEvent):void{ if (!_autoRepeat){ endPress(); return; }; if (pressTimer.currentCount == 1){ pressTimer.delay = Number(getStyleValue("repeatInterval")); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } public function setMouseState(_arg1:String):void{ if (_mouseStateLocked){ unlockedMouseState = _arg1; return; }; if (mouseState == _arg1){ return; }; mouseState = _arg1; invalidate(InvalidationType.STATE); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 3
//Button (fl.controls.Button) package fl.controls { import flash.display.*; import fl.core.*; import fl.managers.*; public class Button extends LabelButton implements IFocusManagerComponent { protected var _emphasized:Boolean;// = false protected var emphasizedBorder:DisplayObject; private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2}; public static var createAccessibilityImplementation:Function; public function set emphasized(_arg1:Boolean):void{ _emphasized = _arg1; invalidate(InvalidationType.STYLES); } override protected function initializeAccessibility():void{ if (Button.createAccessibilityImplementation != null){ Button.createAccessibilityImplementation(this); }; } protected function drawEmphasized():void{ var _local2:Number; if (emphasizedBorder != null){ removeChild(emphasizedBorder); }; emphasizedBorder = null; if (!_emphasized){ return; }; var _local1:Object = getStyleValue("emphasizedSkin"); if (_local1 != null){ emphasizedBorder = getDisplayObjectInstance(_local1); }; if (emphasizedBorder != null){ addChildAt(emphasizedBorder, 0); _local2 = Number(getStyleValue("emphasizedPadding")); emphasizedBorder.x = (emphasizedBorder.y = -(_local2)); emphasizedBorder.width = (width + (_local2 * 2)); emphasizedBorder.height = (height + (_local2 * 2)); }; } public function get emphasized():Boolean{ return (_emphasized); } override protected function draw():void{ if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){ drawEmphasized(); }; super.draw(); if (emphasizedBorder != null){ setChildIndex(emphasizedBorder, (numChildren - 1)); }; } override public function drawFocus(_arg1:Boolean):void{ var _local2:Number; var _local3:*; super.drawFocus(_arg1); if (_arg1){ _local2 = Number(getStyleValue("emphasizedPadding")); if ((((_local2 < 0)) || (!(_emphasized)))){ _local2 = 0; }; _local3 = getStyleValue("focusRectPadding"); _local3 = ((_local3)==null) ? 2 : _local3; _local3 = (_local3 + _local2); uiFocusRect.x = -(_local3); uiFocusRect.y = -(_local3); uiFocusRect.width = (width + (_local3 * 2)); uiFocusRect.height = (height + (_local3 * 2)); }; } public static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles)); } } }//package fl.controls
Section 4
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement) package fl.controls { public class ButtonLabelPlacement { public static const TOP:String = "top"; public static const LEFT:String = "left"; public static const BOTTOM:String = "bottom"; public static const RIGHT:String = "right"; } }//package fl.controls
Section 5
//LabelButton (fl.controls.LabelButton) package fl.controls { import flash.display.*; import fl.core.*; import flash.events.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.ui.*; public class LabelButton extends BaseButton implements IFocusManagerComponent { protected var _toggle:Boolean;// = false public var textField:TextField; protected var mode:String;// = "center" protected var _labelPlacement:String;// = "right" protected var oldMouseState:String; protected var _label:String;// = "Label" protected var icon:DisplayObject; private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false}; public static var createAccessibilityImplementation:Function; override protected function draw():void{ if (textField.text != _label){ label = _label; }; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawBackground(); drawIcon(); drawTextFormat(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } override protected function drawLayout():void{ var _local7:Number; var _local8:Number; var _local1:Number = Number(getStyleValue("textPadding")); var _local2:String = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement; textField.height = (textField.textHeight + 4); var _local3:Number = (textField.textWidth + 4); var _local4:Number = (textField.textHeight + 4); var _local5:Number = ((icon)==null) ? 0 : (icon.width + _local1); var _local6:Number = ((icon)==null) ? 0 : (icon.height + _local1); textField.visible = (label.length > 0); if (icon != null){ icon.x = Math.round(((width - icon.width) / 2)); icon.y = Math.round(((height - icon.height) / 2)); }; if (textField.visible == false){ textField.width = 0; textField.height = 0; } else { if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){ _local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1)))); if ((height - 2) > _local4){ _local8 = _local4; } else { _local8 = (height - 2); }; _local3 = _local7; textField.width = _local3; _local4 = _local8; textField.height = _local4; textField.x = Math.round(((width - _local3) / 2)); textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0)); if (icon != null){ icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1)); }; } else { _local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1)))); _local3 = _local7; textField.width = _local3; textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0)); textField.y = Math.round(((height - textField.height) / 2)); if (icon != null){ icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1)); }; }; }; super.drawLayout(); } protected function toggleSelected(_arg1:MouseEvent):void{ selected = !(selected); dispatchEvent(new Event(Event.CHANGE, true)); } override protected function keyUpHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ setMouseState(oldMouseState); oldMouseState = null; endPress(); dispatchEvent(new MouseEvent(MouseEvent.CLICK)); }; } public function get labelPlacement():String{ return (_labelPlacement); } public function get toggle():Boolean{ return (_toggle); } protected function setEmbedFont(){ var _local1:Object = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } override public function get selected():Boolean{ return ((_toggle) ? _selected : false); } override protected function configUI():void{ super.configUI(); textField = new TextField(); textField.type = TextFieldType.DYNAMIC; textField.selectable = false; addChild(textField); } override protected function initializeAccessibility():void{ if (LabelButton.createAccessibilityImplementation != null){ LabelButton.createAccessibilityImplementation(this); }; } public function set labelPlacement(_arg1:String):void{ _labelPlacement = _arg1; invalidate(InvalidationType.SIZE); } protected function drawIcon():void{ var _local1:DisplayObject = icon; var _local2:String = (enabled) ? mouseState : "disabled"; if (selected){ _local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1)); }; _local2 = (_local2 + "Icon"); var _local3:Object = getStyleValue(_local2); if (_local3 == null){ _local3 = getStyleValue("icon"); }; if (_local3 != null){ icon = getDisplayObjectInstance(_local3); }; if (icon != null){ addChildAt(icon, 1); }; if (((!((_local1 == null))) && (!((_local1 == icon))))){ removeChild(_local1); }; } public function set label(_arg1:String):void{ _label = _arg1; if (textField.text != _label){ textField.text = _label; dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE)); }; invalidate(InvalidationType.SIZE); invalidate(InvalidationType.STYLES); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ if (oldMouseState == null){ oldMouseState = mouseState; }; setMouseState("down"); startPress(); }; } public function set toggle(_arg1:Boolean):void{ if (((!(_arg1)) && (super.selected))){ selected = false; }; _toggle = _arg1; if (_toggle){ addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true); } else { removeEventListener(MouseEvent.CLICK, toggleSelected); }; invalidate(InvalidationType.STATE); } override public function set selected(_arg1:Boolean):void{ _selected = _arg1; if (_toggle){ invalidate(InvalidationType.STATE); }; } protected function drawTextFormat():void{ var _local1:Object = UIComponent.getStyleDefinition(); var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); } public function get label():String{ return (_label); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition())); } } }//package fl.controls
Section 6
//ScrollBar (fl.controls.ScrollBar) package fl.controls { import fl.core.*; import flash.events.*; import fl.events.*; public class ScrollBar extends UIComponent { private var _direction:String;// = "vertical" private var _minScrollPosition:Number;// = 0 private var _pageSize:Number;// = 10 private var _maxScrollPosition:Number;// = 0 protected var downArrow:BaseButton; private var _lineScrollSize:Number;// = 1 protected var upArrow:BaseButton; private var _scrollPosition:Number;// = 0 private var thumbScrollOffset:Number; protected var track:BaseButton; protected var thumb:LabelButton; protected var inDrag:Boolean;// = false private var _pageScrollSize:Number;// = 0 protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0}; public static const WIDTH:Number = 15; protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"}; protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"}; protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"}; private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35}; public function ScrollBar(){ setStyles(); focusEnabled = false; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition)))))); updateThumb(); } override public function setSize(_arg1:Number, _arg2:Number):void{ if (_direction == ScrollBarDirection.HORIZONTAL){ super.setSize(_arg2, _arg1); } else { super.setSize(_arg1, _arg2); }; } public function set lineScrollSize(_arg1:Number):void{ if (_arg1 > 0){ _lineScrollSize = _arg1; }; } public function get minScrollPosition():Number{ return (_minScrollPosition); } protected function updateThumb():void{ var _local1:Number = ((_maxScrollPosition - _minScrollPosition) + _pageSize); if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){ thumb.height = 12; thumb.visible = false; } else { thumb.height = Math.max(13, ((_pageSize / _local1) * track.height)); thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition)))); thumb.visible = enabled; }; } public function set minScrollPosition(_arg1:Number):void{ setScrollProperties(_pageSize, _arg1, _maxScrollPosition); } public function get lineScrollSize():Number{ return (_lineScrollSize); } public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{ var _local3:Number = scrollPosition; _scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1)); if (_local3 == _scrollPosition){ return; }; if (_arg2){ dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition)); }; updateThumb(); } public function get maxScrollPosition():Number{ return (_maxScrollPosition); } public function get scrollPosition():Number{ return (_scrollPosition); } override public function get height():Number{ return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height); } public function get pageSize():Number{ return (_pageSize); } public function set maxScrollPosition(_arg1:Number):void{ setScrollProperties(_pageSize, _minScrollPosition, _arg1); } protected function thumbReleaseHandler(_arg1:MouseEvent):void{ inDrag = false; mouseChildren = true; thumb.mouseStateLocked = false; stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag); stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler); } public function set pageScrollSize(_arg1:Number):void{ if (_arg1 >= 0){ _pageScrollSize = _arg1; }; } public function set scrollPosition(_arg1:Number):void{ setScrollPosition(_arg1, true); } override public function get enabled():Boolean{ return (super.enabled); } override protected function draw():void{ var _local1:Number; if (isInvalid(InvalidationType.SIZE)){ _local1 = super.height; downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height))); track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height)))); updateThumb(); }; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ setStyles(); }; downArrow.drawNow(); upArrow.drawNow(); track.drawNow(); thumb.drawNow(); validate(); } override public function get width():Number{ return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width); } override protected function configUI():void{ super.configUI(); track = new BaseButton(); track.move(0, 14); track.useHandCursor = false; track.autoRepeat = true; track.focusEnabled = false; addChild(track); thumb = new LabelButton(); thumb.label = ""; thumb.setSize(WIDTH, 15); thumb.move(0, 15); thumb.focusEnabled = false; addChild(thumb); downArrow = new BaseButton(); downArrow.setSize(WIDTH, 14); downArrow.autoRepeat = true; downArrow.focusEnabled = false; addChild(downArrow); upArrow = new BaseButton(); upArrow.setSize(WIDTH, 14); upArrow.move(0, 0); upArrow.autoRepeat = true; upArrow.focusEnabled = false; addChild(upArrow); upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true); downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true); track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true); thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true); enabled = false; } public function set pageSize(_arg1:Number):void{ if (_arg1 > 0){ _pageSize = _arg1; }; } public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{ this.pageSize = _arg1; _minScrollPosition = _arg2; _maxScrollPosition = _arg3; if (_arg4 >= 0){ _pageScrollSize = _arg4; }; enabled = (_maxScrollPosition > _minScrollPosition); setScrollPosition(_scrollPosition, false); updateThumb(); } public function get pageScrollSize():Number{ return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize); } protected function handleThumbDrag(_arg1:MouseEvent):void{ var _local2:Number = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset))); setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition)); } protected function setStyles():void{ copyStylesToChild(downArrow, DOWN_ARROW_STYLES); copyStylesToChild(thumb, THUMB_STYLES); copyStylesToChild(track, TRACK_STYLES); copyStylesToChild(upArrow, UP_ARROW_STYLES); } protected function scrollPressHandler(_arg1:ComponentEvent):void{ var _local2:Number; var _local3:Number; _arg1.stopImmediatePropagation(); if (_arg1.currentTarget == upArrow){ setScrollPosition((_scrollPosition - _lineScrollSize)); } else { if (_arg1.currentTarget == downArrow){ setScrollPosition((_scrollPosition + _lineScrollSize)); } else { _local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition); _local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize; if (_scrollPosition < _local2){ setScrollPosition(Math.min(_local2, (_scrollPosition + _local3))); } else { if (_scrollPosition > _local2){ setScrollPosition(Math.max(_local2, (_scrollPosition - _local3))); }; }; }; }; } protected function thumbPressHandler(_arg1:MouseEvent):void{ inDrag = true; thumbScrollOffset = (mouseY - thumb.y); thumb.mouseStateLocked = true; mouseChildren = false; stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true); } public function set direction(_arg1:String):void{ if (_direction == _arg1){ return; }; _direction = _arg1; if (isLivePreview){ return; }; setScaleY(1); var _local2 = (_direction == ScrollBarDirection.HORIZONTAL); if (((_local2) && (componentInspectorSetting))){ if (rotation == 90){ return; }; setScaleX(-1); rotation = -90; }; if (!componentInspectorSetting){ if (((_local2) && ((rotation == 0)))){ rotation = -90; setScaleX(-1); } else { if (((!(_local2)) && ((rotation == -90)))){ rotation = 0; setScaleX(1); }; }; }; invalidate(InvalidationType.SIZE); } public function get direction():String{ return (_direction); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 7
//ScrollBarDirection (fl.controls.ScrollBarDirection) package fl.controls { public class ScrollBarDirection { public static const HORIZONTAL:String = "horizontal"; public static const VERTICAL:String = "vertical"; } }//package fl.controls
Section 8
//UIScrollBar (fl.controls.UIScrollBar) package fl.controls { import fl.core.*; import flash.events.*; import fl.events.*; import flash.text.*; public class UIScrollBar extends ScrollBar { protected var inEdit:Boolean;// = false protected var inScroll:Boolean;// = false protected var _scrollTarget:TextField; private static var defaultStyles:Object = {}; protected function updateScrollTargetProperties():void{ var _local1:Boolean; var _local2:Number; if (_scrollTarget == null){ setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, pageScrollSize); scrollPosition = 0; } else { _local1 = (direction == ScrollBarDirection.HORIZONTAL); _local2 = (_local1) ? _scrollTarget.width : 10; setScrollProperties(_local2, (_local1) ? 0 : 1, (_local1) ? _scrollTarget.maxScrollH : _scrollTarget.maxScrollV, pageScrollSize); scrollPosition = (_local1) ? _scrollTarget.scrollH : _scrollTarget.scrollV; }; } override public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{ var _local5:Number = _arg3; var _local6:Number = ((_arg2)<0) ? 0 : _arg2; if (_scrollTarget != null){ if (direction == ScrollBarDirection.HORIZONTAL){ _local5 = ((_arg3)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local5; } else { _local5 = ((_arg3)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local5; }; }; super.setScrollProperties(_arg1, _local6, _local5, _arg4); } protected function handleTargetScroll(_arg1:Event):void{ if (inDrag){ return; }; if (!enabled){ return; }; inEdit = true; updateScrollTargetProperties(); scrollPosition = ((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV; inEdit = false; } override public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{ super.setScrollPosition(_arg1, _arg2); if (!_scrollTarget){ inScroll = false; return; }; updateTargetScroll(); } public function get scrollTargetName():String{ return (_scrollTarget.name); } override protected function draw():void{ if (isInvalid(InvalidationType.DATA)){ updateScrollTargetProperties(); }; super.draw(); } override public function set direction(_arg1:String):void{ if (isLivePreview){ return; }; super.direction = _arg1; updateScrollTargetProperties(); } protected function updateTargetScroll(_arg1:ScrollEvent=null):void{ if (inEdit){ return; }; if (direction == ScrollBarDirection.HORIZONTAL){ _scrollTarget.scrollH = scrollPosition; } else { _scrollTarget.scrollV = scrollPosition; }; } override public function set minScrollPosition(_arg1:Number):void{ super.minScrollPosition = ((_arg1)<0) ? 0 : _arg1; } override public function set maxScrollPosition(_arg1:Number):void{ var _local2:Number = _arg1; if (_scrollTarget != null){ if (direction == ScrollBarDirection.HORIZONTAL){ _local2 = ((_local2)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local2; } else { _local2 = ((_local2)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local2; }; }; super.maxScrollPosition = _local2; } protected function handleTargetChange(_arg1:Event):void{ inEdit = true; setScrollPosition(((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV, true); updateScrollTargetProperties(); inEdit = false; } public function update():void{ inEdit = true; updateScrollTargetProperties(); inEdit = false; } public function set scrollTargetName(_arg1:String):void{ var target = _arg1; try { scrollTarget = (parent.getChildByName(target) as TextField); } catch(error:Error) { throw (new Error("ScrollTarget not found, or is not a TextField")); }; } public function set scrollTarget(_arg1:TextField):void{ if (_scrollTarget != null){ _scrollTarget.removeEventListener(Event.CHANGE, handleTargetChange, false); _scrollTarget.removeEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false); _scrollTarget.removeEventListener(Event.SCROLL, handleTargetScroll, false); removeEventListener(ScrollEvent.SCROLL, updateTargetScroll, false); }; _scrollTarget = _arg1; if (_scrollTarget != null){ _scrollTarget.addEventListener(Event.CHANGE, handleTargetChange, false, 0, true); _scrollTarget.addEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false, 0, true); _scrollTarget.addEventListener(Event.SCROLL, handleTargetScroll, false, 0, true); addEventListener(ScrollEvent.SCROLL, updateTargetScroll, false, 0, true); }; invalidate(InvalidationType.DATA); } public function get scrollTarget():TextField{ return (_scrollTarget); } override public function get direction():String{ return (super.direction); } public static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition())); } } }//package fl.controls
Section 9
//ComponentShim (fl.core.ComponentShim) package fl.core { import flash.display.*; public dynamic class ComponentShim extends MovieClip { } }//package fl.core
Section 10
//InvalidationType (fl.core.InvalidationType) package fl.core { public class InvalidationType { public static const SIZE:String = "size"; public static const ALL:String = "all"; public static const DATA:String = "data"; public static const SCROLL:String = "scroll"; public static const STATE:String = "state"; public static const STYLES:String = "styles"; public static const SELECTED:String = "selected"; public static const RENDERER_STYLES:String = "rendererStyles"; } }//package fl.core
Section 11
//UIComponent (fl.core.UIComponent) package fl.core { import flash.display.*; import flash.events.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.utils.*; import flash.system.*; public class UIComponent extends Sprite { protected var _x:Number; protected var _enabled:Boolean;// = true protected var callLaterMethods:Dictionary; private var _mouseFocusEnabled:Boolean;// = true private var tempText:TextField; private var _focusEnabled:Boolean;// = true protected var startHeight:Number; protected var _height:Number; protected var invalidateFlag:Boolean;// = false protected var _oldIMEMode:String;// = null protected var _inspector:Boolean;// = false protected var startWidth:Number; public var focusTarget:IFocusManagerComponent; protected var errorCaught:Boolean;// = false protected var invalidHash:Object; protected var sharedStyles:Object; protected var uiFocusRect:DisplayObject; protected var isLivePreview:Boolean;// = false protected var _imeMode:String;// = null protected var _width:Number; protected var instanceStyles:Object; public var version:String;// = "3.0.0.16" protected var isFocused:Boolean;// = false protected var _y:Number; public static var inCallLaterPhase:Boolean = false; private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)}; public static var createAccessibilityImplementation:Function; private static var focusManagers:Dictionary = new Dictionary(false); public function UIComponent(){ instanceStyles = {}; sharedStyles = {}; invalidHash = {}; callLaterMethods = new Dictionary(); StyleManager.registerInstance(this); configUI(); invalidate(InvalidationType.ALL); tabEnabled = (this is IFocusManagerComponent); focusRect = false; if (tabEnabled){ addEventListener(FocusEvent.FOCUS_IN, focusInHandler); addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler); addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); addEventListener(KeyboardEvent.KEY_UP, keyUpHandler); }; initializeFocusManager(); addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true); } public function getStyle(_arg1:String):Object{ return (instanceStyles[_arg1]); } protected function checkLivePreview():Boolean{ var className:String; if (parent == null){ return (false); }; try { className = getQualifiedClassName(parent); } catch(e:Error) { }; return ((className == "fl.livepreview::LivePreviewParent")); } private function callLaterDispatcher(_arg1:Event):void{ var _local3:Object; if (_arg1.type == Event.ADDED_TO_STAGE){ removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher); stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); return; }; _arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher); if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); return; }; inCallLaterPhase = true; var _local2:Dictionary = callLaterMethods; for (_local3 in _local2) { _local3(); delete _local2[_local3]; }; inCallLaterPhase = false; } protected function validate():void{ invalidHash = {}; } protected function focusOutHandler(_arg1:FocusEvent):void{ if (isOurFocus((_arg1.target as DisplayObject))){ drawFocus(false); isFocused = false; }; } public function set mouseFocusEnabled(_arg1:Boolean):void{ _mouseFocusEnabled = _arg1; } public function getFocus():InteractiveObject{ if (stage){ return (stage.focus); }; return (null); } override public function get height():Number{ return (_height); } private function addedHandler(_arg1:Event):void{ removeEventListener("addedToStage", addedHandler); initializeFocusManager(); } protected function getStyleValue(_arg1:String):Object{ return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]); } public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{ invalidHash[_arg1] = true; if (_arg2){ this.callLater(draw); }; } protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((_arg1 == this)); } public function get enabled():Boolean{ return (_enabled); } protected function getScaleX():Number{ return (super.scaleX); } protected function getScaleY():Number{ return (super.scaleY); } public function get focusEnabled():Boolean{ return (_focusEnabled); } protected function afterComponentParameters():void{ } override public function get scaleY():Number{ return ((height / startHeight)); } protected function setIMEMode(_arg1:Boolean){ var enabled = _arg1; if (_imeMode != null){ if (enabled){ IME.enabled = true; _oldIMEMode = IME.conversionMode; try { if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _imeMode; }; errorCaught = false; } catch(e:Error) { errorCaught = true; throw (new Error(("IME mode not supported: " + _imeMode))); }; } else { if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){ IME.conversionMode = _oldIMEMode; }; IME.enabled = false; }; }; } protected function draw():void{ if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } override public function set height(_arg1:Number):void{ if (_height == _arg1){ return; }; setSize(width, _arg1); } protected function configUI():void{ isLivePreview = checkLivePreview(); var _local1:Number = rotation; rotation = 0; var _local2:Number = super.width; var _local3:Number = super.height; var _local4 = 1; super.scaleY = _local4; super.scaleX = _local4; setSize(_local2, _local3); move(super.x, super.y); rotation = _local1; startWidth = _local2; startHeight = _local3; if (numChildren > 0){ removeChildAt(0); }; } protected function setScaleY(_arg1:Number):void{ super.scaleY = _arg1; } override public function get scaleX():Number{ return ((width / startWidth)); } protected function setScaleX(_arg1:Number):void{ super.scaleX = _arg1; } private function initializeFocusManager():void{ if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true); } else { createFocusManager(); }; } protected function keyDownHandler(_arg1:KeyboardEvent):void{ } public function set focusManager(_arg1:IFocusManager):void{ UIComponent.focusManagers[this] = _arg1; } public function clearStyle(_arg1:String):void{ setStyle(_arg1, null); } protected function isInvalid(_arg1:String, ... _args):Boolean{ if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){ return (true); }; while (_args.length > 0) { if (invalidHash[_args.pop()]){ return (true); }; }; return (false); } public function setStyle(_arg1:String, _arg2:Object):void{ if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; instanceStyles[_arg1] = _arg2; invalidate(InvalidationType.STYLES); } override public function get visible():Boolean{ return (super.visible); } protected function focusInHandler(_arg1:FocusEvent):void{ var _local2:IFocusManager; if (isOurFocus((_arg1.target as DisplayObject))){ _local2 = focusManager; if (((_local2) && (_local2.showFocusIndicator))){ drawFocus(true); isFocused = true; }; }; } public function get componentInspectorSetting():Boolean{ return (_inspector); } override public function get x():Number{ return ((isNaN(_x)) ? super.x : _x); } override public function get y():Number{ return ((isNaN(_y)) ? super.y : _y); } public function set enabled(_arg1:Boolean):void{ if (_arg1 == _enabled){ return; }; _enabled = _arg1; invalidate(InvalidationType.STATE); } public function setSize(_arg1:Number, _arg2:Number):void{ _width = _arg1; _height = _arg2; invalidate(InvalidationType.SIZE); dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false)); } protected function keyUpHandler(_arg1:KeyboardEvent):void{ } public function setSharedStyle(_arg1:String, _arg2:Object):void{ if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; sharedStyles[_arg1] = _arg2; if (instanceStyles[_arg1] == null){ invalidate(InvalidationType.STYLES); }; } public function set focusEnabled(_arg1:Boolean):void{ _focusEnabled = _arg1; } override public function set width(_arg1:Number):void{ if (_width == _arg1){ return; }; setSize(_arg1, height); } public function setFocus():void{ if (stage){ stage.focus = this; }; } override public function set scaleX(_arg1:Number):void{ setSize((startWidth * _arg1), height); } public function get mouseFocusEnabled():Boolean{ return (_mouseFocusEnabled); } override public function set scaleY(_arg1:Number):void{ setSize(width, (startHeight * _arg1)); } protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{ var skin = _arg1; var classDef:Object; if ((skin is Class)){ return ((new (skin) as DisplayObject)); }; if ((skin is DisplayObject)){ (skin as DisplayObject).x = 0; (skin as DisplayObject).y = 0; return ((skin as DisplayObject)); }; try { classDef = getDefinitionByName(skin.toString()); } catch(e:Error) { try { classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object); } catch(e:Error) { }; }; if (classDef == null){ return (null); }; return ((new (classDef) as DisplayObject)); } protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{ var _local3:String; for (_local3 in _arg2) { _arg1.setStyle(_local3, getStyleValue(_arg2[_local3])); }; } protected function initializeAccessibility():void{ if (UIComponent.createAccessibilityImplementation != null){ UIComponent.createAccessibilityImplementation(this); }; } public function get focusManager():IFocusManager{ var _local1:DisplayObject = this; while (_local1) { if (UIComponent.focusManagers[_local1] != null){ return (IFocusManager(UIComponent.focusManagers[_local1])); }; _local1 = _local1.parent; }; return (null); } override public function get width():Number{ return (_width); } protected function beforeComponentParameters():void{ } protected function callLater(_arg1:Function):void{ if (inCallLaterPhase){ return; }; callLaterMethods[_arg1] = true; if (stage != null){ stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); stage.invalidate(); } else { addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); }; } public function move(_arg1:Number, _arg2:Number):void{ _x = _arg1; _y = _arg2; super.x = Math.round(_arg1); super.y = Math.round(_arg2); dispatchEvent(new ComponentEvent(ComponentEvent.MOVE)); } public function validateNow():void{ invalidate(InvalidationType.ALL, false); draw(); } override public function set visible(_arg1:Boolean):void{ if (super.visible == _arg1){ return; }; super.visible = _arg1; var _local2:String = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE; dispatchEvent(new ComponentEvent(_local2, true)); } protected function createFocusManager():void{ if (focusManagers[stage] == null){ focusManagers[stage] = new FocusManager(stage); }; } protected function hookAccessibility(_arg1:Event):void{ removeEventListener(Event.ENTER_FRAME, hookAccessibility); initializeAccessibility(); } public function set componentInspectorSetting(_arg1:Boolean):void{ _inspector = _arg1; if (_inspector){ beforeComponentParameters(); } else { afterComponentParameters(); }; } override public function set y(_arg1:Number):void{ move(_x, _arg1); } public function drawFocus(_arg1:Boolean):void{ var _local2:Number; isFocused = _arg1; if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){ removeChild(uiFocusRect); uiFocusRect = null; }; if (_arg1){ uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite); if (uiFocusRect == null){ return; }; _local2 = Number(getStyleValue("focusRectPadding")); uiFocusRect.x = -(_local2); uiFocusRect.y = -(_local2); uiFocusRect.width = (width + (_local2 * 2)); uiFocusRect.height = (height + (_local2 * 2)); addChildAt(uiFocusRect, 0); }; } override public function set x(_arg1:Number):void{ move(_arg1, _y); } public function drawNow():void{ draw(); } public static function getStyleDefinition():Object{ return (defaultStyles); } public static function mergeStyles(... _args):Object{ var _local5:Object; var _local6:String; var _local2:Object = {}; var _local3:uint = _args.length; var _local4:uint; while (_local4 < _local3) { _local5 = _args[_local4]; for (_local6 in _local5) { if (_local2[_local6] != null){ } else { _local2[_local6] = _args[_local4][_local6]; }; }; _local4++; }; return (_local2); } } }//package fl.core
Section 12
//ComponentEvent (fl.events.ComponentEvent) package fl.events { import flash.events.*; public class ComponentEvent extends Event { public static const HIDE:String = "hide"; public static const BUTTON_DOWN:String = "buttonDown"; public static const MOVE:String = "move"; public static const RESIZE:String = "resize"; public static const ENTER:String = "enter"; public static const LABEL_CHANGE:String = "labelChange"; public static const SHOW:String = "show"; public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function toString():String{ return (formatToString("ComponentEvent", "type", "bubbles", "cancelable")); } override public function clone():Event{ return (new ComponentEvent(type, bubbles, cancelable)); } } }//package fl.events
Section 13
//ScrollEvent (fl.events.ScrollEvent) package fl.events { import flash.events.*; public class ScrollEvent extends Event { private var _direction:String; private var _position:Number; private var _delta:Number; public static const SCROLL:String = "scroll"; public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){ super(ScrollEvent.SCROLL, false, false); _direction = _arg1; _delta = _arg2; _position = _arg3; } public function get position():Number{ return (_position); } public function get direction():String{ return (_direction); } public function get delta():Number{ return (_delta); } override public function toString():String{ return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position")); } override public function clone():Event{ return (new ScrollEvent(_direction, _delta, _position)); } } }//package fl.events
Section 14
//FocusManager (fl.managers.FocusManager) package fl.managers { import fl.controls.*; import flash.display.*; import fl.core.*; import flash.events.*; import flash.text.*; import flash.utils.*; import flash.ui.*; public class FocusManager implements IFocusManager { private var focusableObjects:Dictionary; private var _showFocusIndicator:Boolean;// = true private var defButton:Button; private var focusableCandidates:Array; private var _form:DisplayObjectContainer; private var _defaultButtonEnabled:Boolean;// = true private var activated:Boolean;// = false private var _defaultButton:Button; private var calculateCandidates:Boolean;// = true private var lastFocus:InteractiveObject; private var lastAction:String; public function FocusManager(_arg1:DisplayObjectContainer){ focusableObjects = new Dictionary(true); if (_arg1 != null){ _form = _arg1; addFocusables(DisplayObject(_arg1)); _arg1.addEventListener(Event.ADDED, addedHandler); _arg1.addEventListener(Event.REMOVED, removedHandler); activate(); }; } public function get showFocusIndicator():Boolean{ return (_showFocusIndicator); } private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{ var _local7:DisplayObject; var _local8:IFocusManagerGroup; var _local9:int; var _local10:DisplayObject; var _local11:IFocusManagerGroup; var _local5:int = focusableCandidates.length; var _local6:int = _arg1; while (true) { if (_arg2){ _arg1--; } else { _arg1++; }; if (_arg3){ if (((_arg2) && ((_arg1 < 0)))){ break; }; if (((!(_arg2)) && ((_arg1 == _local5)))){ break; }; } else { _arg1 = ((_arg1 + _local5) % _local5); if (_local6 == _arg1){ break; }; }; if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){ _local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1])); if ((_local7 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local7); _local9 = 0; while (_local9 < focusableCandidates.length) { _local10 = focusableCandidates[_local9]; if ((_local10 is IFocusManagerGroup)){ _local11 = IFocusManagerGroup(_local10); if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){ _arg1 = _local9; break; }; }; _local9++; }; }; return (_arg1); }; }; return (_arg1); } private function mouseFocusChangeHandler(_arg1:FocusEvent):void{ if ((_arg1.relatedObject is TextField)){ return; }; _arg1.preventDefault(); } public function set form(_arg1:DisplayObjectContainer):void{ _form = _arg1; } private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{ var focusable:IFocusManagerComponent; var io:InteractiveObject; var doc:DisplayObjectContainer; var i:int; var child:DisplayObject; var o = _arg1; var skipTopLevel = _arg2; if (!skipTopLevel){ if ((o is IFocusManagerComponent)){ focusable = IFocusManagerComponent(o); if (focusable.focusEnabled){ if (((focusable.tabEnabled) && (isTabVisible(o)))){ focusableObjects[o] = true; calculateCandidates = true; }; o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); }; } else { if ((o is InteractiveObject)){ io = (o as InteractiveObject); if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){ focusableObjects[io] = true; calculateCandidates = true; }; io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); }; }; }; if ((o is DisplayObjectContainer)){ doc = DisplayObjectContainer(o); o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){ i = 0; while (i < doc.numChildren) { try { child = doc.getChildAt(i); if (child != null){ addFocusables(doc.getChildAt(i)); }; } catch(error:SecurityError) { }; i = (i + 1); }; }; }; } private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{ return (_arg1.getChildIndex(_arg2)); } public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{ var _local2:InteractiveObject = _arg1; while (_arg1) { if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){ return (_arg1); }; _arg1 = _arg1.parent; }; return (_local2); } private function focusOutHandler(_arg1:FocusEvent):void{ var _local2:InteractiveObject = (_arg1.target as InteractiveObject); } private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{ var _local3:IFocusManagerGroup; if (!isEnabledAndVisible(_arg1)){ return (false); }; if ((_arg1 is IFocusManagerGroup)){ _local3 = IFocusManagerGroup(_arg1); if (_arg2 == _local3.groupName){ return (false); }; }; return (true); } private function setFocusToNextObject(_arg1:FocusEvent):void{ if (!hasFocusableObjects()){ return; }; var _local2:InteractiveObject = getNextFocusManagerComponent(_arg1.shiftKey); if (_local2){ setFocus(_local2); }; } private function sortFocusableObjectsTabIndex():void{ var _local1:Object; var _local2:InteractiveObject; focusableCandidates = []; for (_local1 in focusableObjects) { _local2 = InteractiveObject(_local1); if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){ focusableCandidates.push(_local2); }; }; focusableCandidates.sort(sortByTabIndex); } private function removeFocusables(_arg1:DisplayObject):void{ var _local2:Object; var _local3:DisplayObject; if ((_arg1 is DisplayObjectContainer)){ _arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); _arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); for (_local2 in focusableObjects) { _local3 = DisplayObject(_local2); if (DisplayObjectContainer(_arg1).contains(_local3)){ if (_local3 == lastFocus){ lastFocus = null; }; _local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); delete focusableObjects[_local2]; calculateCandidates = true; }; }; }; } private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{ while (_arg1 != InteractiveObject(form)) { if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){ return (_arg1); }; _arg1 = _arg1.parent; if (_arg1 == null){ break; }; }; return (null); } public function sendDefaultButtonEvent():void{ defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); } private function addedHandler(_arg1:Event):void{ var _local2:DisplayObject = DisplayObject(_arg1.target); if (_local2.stage){ addFocusables(DisplayObject(_arg1.target)); }; } private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{ var _local3:TextField; var _local4:SimpleButton; var _local2:DisplayObjectContainer = DisplayObject(form).parent; while (_arg1 != _local2) { if ((_arg1 is UIComponent)){ if (!UIComponent(_arg1).enabled){ return (false); }; } else { if ((_arg1 is TextField)){ _local3 = TextField(_arg1); if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){ return (false); }; } else { if ((_arg1 is SimpleButton)){ _local4 = SimpleButton(_arg1); if (!_local4.enabled){ return (false); }; }; }; }; if (!_arg1.visible){ return (false); }; _arg1 = _arg1.parent; }; return (true); } private function tabChildrenChangeHandler(_arg1:Event):void{ if (_arg1.target != _arg1.currentTarget){ return; }; calculateCandidates = true; var _local2:DisplayObjectContainer = DisplayObjectContainer(_arg1.target); if (_local2.tabChildren){ addFocusables(_local2, true); } else { removeFocusables(_local2); }; } private function deactivateHandler(_arg1:Event):void{ var _local2:InteractiveObject = InteractiveObject(_arg1.target); } public function setFocus(_arg1:InteractiveObject):void{ if ((_arg1 is IFocusManagerComponent)){ IFocusManagerComponent(_arg1).setFocus(); } else { form.stage.focus = _arg1; }; } public function getFocus():InteractiveObject{ var _local1:InteractiveObject = form.stage.focus; return (findFocusManagerComponent(_local1)); } private function hasFocusableObjects():Boolean{ var _local1:Object; for (_local1 in focusableObjects) { return (true); }; return (false); } private function tabIndexChangeHandler(_arg1:Event):void{ calculateCandidates = true; } public function set defaultButton(_arg1:Button):void{ var _local2:Button = (_arg1) ? Button(_arg1) : null; if (_local2 != _defaultButton){ if (_defaultButton){ _defaultButton.emphasized = false; }; if (defButton){ defButton.emphasized = false; }; _defaultButton = _local2; defButton = _local2; if (_local2){ _local2.emphasized = true; }; }; } private function sortFocusableObjects():void{ var _local1:Object; var _local2:InteractiveObject; focusableCandidates = []; for (_local1 in focusableObjects) { _local2 = InteractiveObject(_local1); if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){ sortFocusableObjectsTabIndex(); return; }; focusableCandidates.push(_local2); }; focusableCandidates.sort(sortByDepth); } private function keyFocusChangeHandler(_arg1:FocusEvent):void{ showFocusIndicator = true; if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){ setFocusToNextObject(_arg1); _arg1.preventDefault(); }; } private function getIndexOfFocusedObject(_arg1:DisplayObject):int{ var _local2:int = focusableCandidates.length; var _local3:int; _local3 = 0; while (_local3 < _local2) { if (focusableCandidates[_local3] == _arg1){ return (_local3); }; _local3++; }; return (-1); } public function hideFocus():void{ } private function removedHandler(_arg1:Event):void{ var _local2:int; var _local4:InteractiveObject; var _local3:DisplayObject = DisplayObject(_arg1.target); if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){ if (_local3 == lastFocus){ IFocusManagerComponent(lastFocus).drawFocus(false); lastFocus = null; }; _local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); delete focusableObjects[_local3]; calculateCandidates = true; } else { if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){ _local4 = (_local3 as InteractiveObject); if (_local4){ if (_local4 == lastFocus){ lastFocus = null; }; delete focusableObjects[_local4]; calculateCandidates = true; }; _local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); }; }; removeFocusables(_local3); } private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{ var _local5:int; var _local6:String; var _local7:String; var _local3 = ""; var _local4 = ""; var _local8 = "0000"; var _local9:DisplayObject = DisplayObject(_arg1); var _local10:DisplayObject = DisplayObject(_arg2); while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) { _local5 = getChildIndex(_local9.parent, _local9); _local6 = _local5.toString(16); if (_local6.length < 4){ _local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); }; _local3 = (_local7 + _local3); _local9 = _local9.parent; }; while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) { _local5 = getChildIndex(_local10.parent, _local10); _local6 = _local5.toString(16); if (_local6.length < 4){ _local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); }; _local4 = (_local7 + _local4); _local10 = _local10.parent; }; return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0); } public function get defaultButton():Button{ return (_defaultButton); } private function activateHandler(_arg1:Event):void{ var _local2:InteractiveObject = InteractiveObject(_arg1.target); if (lastFocus){ if ((lastFocus is IFocusManagerComponent)){ IFocusManagerComponent(lastFocus).setFocus(); } else { form.stage.focus = lastFocus; }; }; lastAction = "ACTIVATE"; } public function showFocus():void{ } public function set defaultButtonEnabled(_arg1:Boolean):void{ _defaultButtonEnabled = _arg1; } public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{ var _local8:IFocusManagerGroup; if (!hasFocusableObjects()){ return (null); }; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; var _local2:DisplayObject = form.stage.focus; _local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2))); var _local3 = ""; if ((_local2 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local2); _local3 = _local8.groupName; }; var _local4:int = getIndexOfFocusedObject(_local2); var _local5:Boolean; var _local6:int = _local4; if (_local4 == -1){ if (_arg1){ _local4 = focusableCandidates.length; }; _local5 = true; }; var _local7:int = getIndexOfNextObject(_local4, _arg1, _local5, _local3); return (findFocusManagerComponent(focusableCandidates[_local7])); } private function mouseDownHandler(_arg1:MouseEvent):void{ if (_arg1.isDefaultPrevented()){ return; }; var _local2:InteractiveObject = getTopLevelFocusTarget(InteractiveObject(_arg1.target)); if (!_local2){ return; }; showFocusIndicator = false; if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){ setFocus(_local2); }; lastAction = "MOUSEDOWN"; } private function isTabVisible(_arg1:DisplayObject):Boolean{ var _local2:DisplayObjectContainer = _arg1.parent; while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) { if (!_local2.tabChildren){ return (false); }; _local2 = _local2.parent; }; return (true); } public function get nextTabIndex():int{ return (0); } private function keyDownHandler(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.TAB){ lastAction = "KEY"; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; }; if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){ sendDefaultButtonEvent(); }; } private function focusInHandler(_arg1:FocusEvent):void{ var _local3:Button; var _local2:InteractiveObject = InteractiveObject(_arg1.target); if (form.contains(_local2)){ lastFocus = findFocusManagerComponent(InteractiveObject(_local2)); if ((lastFocus is Button)){ _local3 = Button(lastFocus); if (defButton){ defButton.emphasized = false; defButton = _local3; _local3.emphasized = true; }; } else { if (((defButton) && (!((defButton == _defaultButton))))){ defButton.emphasized = false; defButton = _defaultButton; _defaultButton.emphasized = true; }; }; }; } private function tabEnabledChangeHandler(_arg1:Event):void{ calculateCandidates = true; var _local2:InteractiveObject = InteractiveObject(_arg1.target); var _local3 = (focusableObjects[_local2] == true); if (_local2.tabEnabled){ if (((!(_local3)) && (isTabVisible(_local2)))){ if (!(_local2 is IFocusManagerComponent)){ _local2.focusRect = false; }; focusableObjects[_local2] = true; }; } else { if (_local3){ delete focusableObjects[_local2]; }; }; } public function set showFocusIndicator(_arg1:Boolean):void{ _showFocusIndicator = _arg1; } public function get form():DisplayObjectContainer{ return (_form); } private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{ return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2)); } public function get defaultButtonEnabled():Boolean{ return (_defaultButtonEnabled); } public function activate():void{ if (activated){ return; }; form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true); form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true); form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true); form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true); form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = true; if (lastFocus){ setFocus(lastFocus); }; } public function deactivate():void{ form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler); form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); form.stage.removeEventListener(Event.ACTIVATE, activateHandler); form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler); form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); activated = false; } } }//package fl.managers
Section 15
//IFocusManager (fl.managers.IFocusManager) package fl.managers { import fl.controls.*; import flash.display.*; public interface IFocusManager { function getFocus():InteractiveObject; function deactivate():void; function set defaultButton(_arg1:Button):void; function set showFocusIndicator(_arg1:Boolean):void; function get defaultButtonEnabled():Boolean; function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject; function get nextTabIndex():int; function get defaultButton():Button; function get showFocusIndicator():Boolean; function hideFocus():void; function activate():void; function showFocus():void; function set defaultButtonEnabled(_arg1:Boolean):void; function setFocus(_arg1:InteractiveObject):void; function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject; } }//package fl.managers
Section 16
//IFocusManagerComponent (fl.managers.IFocusManagerComponent) package fl.managers { public interface IFocusManagerComponent { function set focusEnabled(_arg1:Boolean):void; function drawFocus(_arg1:Boolean):void; function setFocus():void; function get focusEnabled():Boolean; function get tabEnabled():Boolean; function get tabIndex():int; function get mouseFocusEnabled():Boolean; } }//package fl.managers
Section 17
//IFocusManagerGroup (fl.managers.IFocusManagerGroup) package fl.managers { public interface IFocusManagerGroup { function get groupName():String; function get selected():Boolean; function set groupName(_arg1:String):void; function set selected(_arg1:Boolean):void; } }//package fl.managers
Section 18
//StyleManager (fl.managers.StyleManager) package fl.managers { import fl.core.*; import flash.text.*; import flash.utils.*; public class StyleManager { private var classToInstancesDict:Dictionary; private var globalStyles:Object; private var styleToClassesHash:Object; private var classToStylesDict:Dictionary; private var classToDefaultStylesDict:Dictionary; private static var _instance:StyleManager; public function StyleManager(){ styleToClassesHash = {}; classToInstancesDict = new Dictionary(true); classToStylesDict = new Dictionary(true); classToDefaultStylesDict = new Dictionary(true); globalStyles = UIComponent.getStyleDefinition(); } public static function clearComponentStyle(_arg1:Object, _arg2:String):void{ var _local3:Class = getClassDef(_arg1); var _local4:Object = getInstance().classToStylesDict[_local3]; if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){ delete _local4[_arg2]; invalidateComponentStyle(_local3, _arg2); }; } private static function getClassDef(_arg1:Object):Class{ var component = _arg1; if ((component is Class)){ return ((component as Class)); }; try { return ((getDefinitionByName(getQualifiedClassName(component)) as Class)); } catch(e:Error) { if ((component is UIComponent)){ try { return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class)); } catch(e:Error) { }; }; }; return (null); } public static function clearStyle(_arg1:String):void{ setStyle(_arg1, null); } public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{ var _local4:Class = getClassDef(_arg1); var _local5:Object = getInstance().classToStylesDict[_local4]; if (_local5 == null){ _local5 = (getInstance().classToStylesDict[_local4] = {}); }; if (_local5 == _arg3){ return; }; _local5[_arg2] = _arg3; invalidateComponentStyle(_local4, _arg2); } private static function setSharedStyles(_arg1:UIComponent):void{ var _local5:String; var _local2:StyleManager = getInstance(); var _local3:Class = getClassDef(_arg1); var _local4:Object = _local2.classToDefaultStylesDict[_local3]; for (_local5 in _local4) { _arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5)); }; } public static function getComponentStyle(_arg1:Object, _arg2:String):Object{ var _local3:Class = getClassDef(_arg1); var _local4:Object = getInstance().classToStylesDict[_local3]; return (((_local4)==null) ? null : _local4[_arg2]); } private static function getInstance(){ if (_instance == null){ _instance = new (StyleManager); }; return (_instance); } private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{ var _local4:Object; var _local5:UIComponent; var _local3:Dictionary = getInstance().classToInstancesDict[_arg1]; if (_local3 == null){ return; }; for (_local4 in _local3) { _local5 = (_local4 as UIComponent); if (_local5 == null){ } else { _local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2)); }; }; } private static function invalidateStyle(_arg1:String):void{ var _local3:Object; var _local2:Dictionary = getInstance().styleToClassesHash[_arg1]; if (_local2 == null){ return; }; for (_local3 in _local2) { invalidateComponentStyle(Class(_local3), _arg1); }; } public static function registerInstance(_arg1:UIComponent):void{ var target:Class; var defaultStyles:Object; var styleToClasses:Object; var n:String; var instance = _arg1; var inst:StyleManager = getInstance(); var classDef:Class = getClassDef(instance); if (classDef == null){ return; }; if (inst.classToInstancesDict[classDef] == null){ inst.classToInstancesDict[classDef] = new Dictionary(true); target = classDef; while (defaultStyles == null) { if (target["getStyleDefinition"] != null){ defaultStyles = target["getStyleDefinition"](); break; }; try { target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class); } catch(err:Error) { try { target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class); } catch(e:Error) { defaultStyles = UIComponent.getStyleDefinition(); break; }; }; }; styleToClasses = inst.styleToClassesHash; for (n in defaultStyles) { if (styleToClasses[n] == null){ styleToClasses[n] = new Dictionary(true); }; styleToClasses[n][classDef] = true; }; inst.classToDefaultStylesDict[classDef] = defaultStyles; if (inst.classToStylesDict[classDef] == null){ inst.classToStylesDict[classDef] = {}; }; }; inst.classToInstancesDict[classDef][instance] = true; setSharedStyles(instance); } public static function getStyle(_arg1:String):Object{ return (getInstance().globalStyles[_arg1]); } private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{ var _local3:Class = getClassDef(_arg1); var _local4:StyleManager = getInstance(); var _local5:Object = _local4.classToStylesDict[_local3][_arg2]; if (_local5 != null){ return (_local5); }; _local5 = _local4.globalStyles[_arg2]; if (_local5 != null){ return (_local5); }; return (_local4.classToDefaultStylesDict[_local3][_arg2]); } public static function setStyle(_arg1:String, _arg2:Object):void{ var _local3:Object = getInstance().globalStyles; if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; _local3[_arg1] = _arg2; invalidateStyle(_arg1); } } }//package fl.managers
Section 19
//Ball (pong.paddle.Ball) package pong.paddle { public class Ball { public var pitch; public var size:Number; public var color; public var directionX;// = 3 public var yTarget:Number; public var x:Number; public var y:Number; public var directionY;// = 3 public var collision; public function Ball(_arg1:Number, _arg2:Number, _arg3:Number, _arg4, _arg5, _arg6):void{ this.x = _arg1; this.y = _arg2; this.yTarget = _arg2; this.size = _arg3; collision = _arg4; this.color = _arg5; this.pitch = _arg6; } public function update(){ directionX = clamp(-7.5, 7.5, directionX); directionY = clamp(-7.5, 7.5, directionY); this.x = (this.x + directionX); this.y = (this.y + directionY); } public function clamp(_arg1:Number, _arg2:Number, _arg3:Number){ if (_arg3 < _arg1){ _arg3 = _arg1; } else { if (_arg3 > _arg2){ _arg3 = _arg2; }; }; return (_arg3); } } }//package pong.paddle
Section 20
//Paddle (pong.paddle.Paddle) package pong.paddle { public class Paddle { public var pitch; public var collision; public var color; public var yTarget:Number; public var length:Number; public var x:Number; public var y:Number; public function Paddle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4, _arg5, _arg6):void{ this.x = _arg1; this.y = _arg2; this.yTarget = _arg2; this.length = _arg3; collision = _arg4; this.color = _arg5; this.pitch = _arg6; } public function update(){ var _local3:*; var _local1:* = 10; var _local2:* = 1; if (this.yTarget < this.y){ _local3 = (this.y - 5); if ((((_local3 <= (this.yTarget + 5))) && ((_local3 >= (this.yTarget - 5))))){ _local3 = this.yTarget; }; } else { _local3 = (this.y + 5); if ((((_local3 <= (this.yTarget + 5))) && ((_local3 >= (this.yTarget - 5))))){ _local3 = this.yTarget; }; }; this.y = _local3; collision.posy = (this.y + (25 / 2)); } } }//package pong.paddle
Section 21
//DPoint (pong.vec2d.DPoint) package pong.vec2d { public class DPoint { public var x; public var y; public function DPoint(_arg1:Number, _arg2:Number){ this.x = _arg1; this.y = _arg2; } } }//package pong.vec2d
Section 22
//Vec2d (pong.vec2d.Vec2d) package pong.vec2d { public class Vec2d { public var b; public var posx; public var posy; public var compx; public var k; public var magnitude; public var compy; public var angle; public function Vec2d(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){ this.posx = _arg3; this.posy = _arg4; this.angle = (_arg1 * (Math.PI / 180)); this.magnitude = _arg2; compx = (this.magnitude * Math.cos(this.angle)); compy = (this.magnitude * Math.sin(this.angle)); this.k = Math.tan(this.angle); this.b = (this.posy - (this.k * this.posx)); } public function add(_arg1:Vec2d){ } public function setmagnitude(_arg1:Number){ } public function isInRange(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{ if (_arg2 > _arg3){ if ((((_arg1 > _arg3)) && ((_arg1 < _arg2)))){ return (true); }; return (false); //unresolved jump }; if ((((_arg1 > _arg2)) && ((_arg1 < _arg3)))){ return (true); }; return (false); } public function setangle(_arg1:Number){ } public function checkcollision(_arg1:Vec2d):DPoint{ var _local2:*; var _local3:*; _local2 = ((_arg1.b - this.b) / (this.k - _arg1.k)); _local3 = ((this.k * _local2) + this.b); if (((this.isInRange(_local2, this.posx, (this.posx + this.compx))) && (this.isInRange(_local3, this.posy, (this.posy + this.compy))))){ return (new DPoint(_local2, _local3)); }; return (new DPoint(5000, -5000)); } } }//package pong.vec2d
Section 23
//focusRectSkin (focusRectSkin) package { import flash.display.*; public dynamic class focusRectSkin extends MovieClip { } }//package
Section 24
//reconnectbutt (reconnectbutt) package { import flash.display.*; public dynamic class reconnectbutt extends SimpleButton { public var reconnectButton:SimpleButton; } }//package
Section 25
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_disabledSkin extends MovieClip { } }//package
Section 26
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_downSkin extends MovieClip { } }//package
Section 27
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_overSkin extends MovieClip { } }//package
Section 28
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_upSkin extends MovieClip { } }//package
Section 29
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_disabledSkin extends MovieClip { } }//package
Section 30
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_downSkin extends MovieClip { } }//package
Section 31
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_overSkin extends MovieClip { } }//package
Section 32
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_upSkin extends MovieClip { } }//package
Section 33
//ScrollBar_thumbIcon (ScrollBar_thumbIcon) package { import flash.display.*; public dynamic class ScrollBar_thumbIcon extends MovieClip { } }//package
Section 34
//ScrollThumb_downSkin (ScrollThumb_downSkin) package { import flash.display.*; public dynamic class ScrollThumb_downSkin extends MovieClip { } }//package
Section 35
//ScrollThumb_overSkin (ScrollThumb_overSkin) package { import flash.display.*; public dynamic class ScrollThumb_overSkin extends MovieClip { } }//package
Section 36
//ScrollThumb_upSkin (ScrollThumb_upSkin) package { import flash.display.*; public dynamic class ScrollThumb_upSkin extends MovieClip { } }//package
Section 37
//ScrollTrack_skin (ScrollTrack_skin) package { import flash.display.*; public dynamic class ScrollTrack_skin extends MovieClip { } }//package
Section 38
//Symbol2 (Symbol2) package { import flash.display.*; public dynamic class Symbol2 extends SimpleButton { } }//package

Library Items

Symbol 1 FontUsed by:2 4 42 43 44 45 47 48 52 54 56 58 60 62 64 65 66
Symbol 2 EditableTextUses:1Used by:3
Symbol 3 Button {Symbol2}Uses:2Used by:51
Symbol 4 EditableTextUses:1Used by:5
Symbol 5 ButtonUses:4Used by:6
Symbol 6 Button {reconnectbutt}Uses:5Used by:50
Symbol 7 GraphicUsed by:8
Symbol 8 MovieClipUses:7Used by:40
Symbol 9 MovieClip {fl.core.ComponentShim}Used by:40
Symbol 10 GraphicUsed by:11
Symbol 11 MovieClip {focusRectSkin}Uses:10Used by:40
Symbol 12 GraphicUsed by:13
Symbol 13 MovieClip {ScrollTrack_skin}Uses:12Used by:40
Symbol 14 GraphicUsed by:17
Symbol 15 GraphicUsed by:16 19 23 33
Symbol 16 MovieClipUses:15Used by:17 27 29
Symbol 17 MovieClip {ScrollArrowUp_downSkin}Uses:14 16Used by:40
Symbol 18 GraphicUsed by:19
Symbol 19 MovieClip {ScrollArrowDown_downSkin}Uses:18 15Used by:40
Symbol 20 GraphicUsed by:21
Symbol 21 MovieClip {ScrollThumb_downSkin}Uses:20Used by:40
Symbol 22 GraphicUsed by:23
Symbol 23 MovieClip {ScrollArrowDown_overSkin}Uses:22 15Used by:40
Symbol 24 GraphicUsed by:25
Symbol 25 MovieClip {ScrollThumb_overSkin}Uses:24Used by:40
Symbol 26 GraphicUsed by:27
Symbol 27 MovieClip {ScrollArrowUp_overSkin}Uses:26 16Used by:40
Symbol 28 GraphicUsed by:29
Symbol 29 MovieClip {ScrollArrowUp_upSkin}Uses:28 16Used by:40
Symbol 30 GraphicUsed by:31
Symbol 31 MovieClip {ScrollThumb_upSkin}Uses:30Used by:40
Symbol 32 GraphicUsed by:33
Symbol 33 MovieClip {ScrollArrowDown_upSkin}Uses:32 15Used by:40
Symbol 34 GraphicUsed by:35
Symbol 35 MovieClip {ScrollArrowDown_disabledSkin}Uses:34Used by:40
Symbol 36 GraphicUsed by:37
Symbol 37 MovieClip {ScrollArrowUp_disabledSkin}Uses:36Used by:40
Symbol 38 GraphicUsed by:39
Symbol 39 MovieClip {ScrollBar_thumbIcon}Uses:38Used by:40
Symbol 40 MovieClip {fl.controls.UIScrollBar}Uses:8 9 11 13 17 19 21 23 25 27 29 31 33 35 37 39Used by:Timeline
Symbol 41 GraphicUsed by:57 59 61 63  Timeline
Symbol 42 EditableTextUses:1Used by:Timeline
Symbol 43 EditableTextUses:1Used by:Timeline
Symbol 44 EditableTextUses:1Used by:Timeline
Symbol 45 EditableTextUses:1Used by:46
Symbol 46 ButtonUses:45Used by:Timeline
Symbol 47 EditableTextUses:1Used by:Timeline
Symbol 48 EditableTextUses:1Used by:49
Symbol 49 ButtonUses:48Used by:Timeline
Symbol 50 ButtonUses:6Used by:Timeline
Symbol 51 ButtonUses:3Used by:Timeline
Symbol 52 EditableTextUses:1Used by:53
Symbol 53 ButtonUses:52Used by:Timeline
Symbol 54 EditableTextUses:1Used by:55
Symbol 55 MovieClipUses:54Used by:Timeline
Symbol 56 EditableTextUses:1Used by:57
Symbol 57 ButtonUses:41 56Used by:Timeline
Symbol 58 EditableTextUses:1Used by:59
Symbol 59 ButtonUses:41 58Used by:Timeline
Symbol 60 EditableTextUses:1Used by:61
Symbol 61 ButtonUses:41 60Used by:Timeline
Symbol 62 EditableTextUses:1Used by:63
Symbol 63 ButtonUses:41 62Used by:Timeline
Symbol 64 EditableTextUses:1Used by:Timeline
Symbol 65 EditableTextUses:1Used by:Timeline
Symbol 66 EditableTextUses:1Used by:Timeline
Symbol 67 MovieClip {fl.controls.Button}

Instance Names

"chatBox"Frame 1Symbol 42 EditableText
"messagesBox"Frame 1Symbol 43 EditableText
"messagesScrollbar"Frame 1Symbol 40 MovieClip {fl.controls.UIScrollBar}
"nicknameBox"Frame 1Symbol 44 EditableText
"changeButton"Frame 1Symbol 46 Button
"userList"Frame 1Symbol 47 EditableText
"userlistScrollbar"Frame 1Symbol 40 MovieClip {fl.controls.UIScrollBar}
"muterButton"Frame 1Symbol 49 Button
"reconnectButton"Frame 1Symbol 50 Button
"randomizeButton"Frame 1Symbol 51 Button
"unmuteButton"Frame 1Symbol 53 Button
"nickLabel"Frame 1Symbol 55 MovieClip
"whisperButton"Frame 1Symbol 57 Button
"kickButton"Frame 1Symbol 59 Button
"banButton"Frame 1Symbol 61 Button
"pongButton"Frame 1Symbol 63 Button
"versionDisplay"Frame 1Symbol 64 EditableText
"playerScore2"Frame 1Symbol 65 EditableText
"playerScore1"Frame 1Symbol 66 EditableText

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 11284 bytes "<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmln ..."




http://swfchan.com/12/58053/info.shtml
Created: 17/4 -2019 12:51:06 Last modified: 17/4 -2019 12:51:06 Server time: 01/05 -2024 15:43:11