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

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

dolphin_olympics_2.swf

This is the info page for
Flash #15151

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


Text
Loading

Loading.

Loading..

Loading...

Dolphin Cup

© copyright 2007, Alan Rawkins

<p align="center"></p>

Wind

0:15

3/3

1,232,232

0:56

Score:

Time Left:

Current Height:

Menu

Skip

Back to Main Menu

End Game

View Scores

Resume Game

Play Again

Restart Game

Start Game

Free Swim

How to Play

Final Score:

Enter Your Name:

Highest Jump:
Longest Jump:
Biggest Splash:

Longest Tailslide:
Highest Speed:
Longest Combo:

Time's Up

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

Submit

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

OR

visit www.dolphinolympics.com to compete for the global high scores

Name

Score

Records

Longest Jump

Highest Jump

Biggest Splash

Longest Tailslide

Highest Speed

Biggest Combo

-

-

Your Top Scores

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

How to Play

page 1/3

Land nose first for a
'nice entry' bonus

Use the LEFT and RIGHT arrow
keys to flip your dolphin while
airborne.

Score as many points as possible
in 2 minutes

Basic Techniques

Next Page

Next Page

Prev Page

Prev Page

page 2/3

Hold DOWN while approaching
the water to do a tailslide

Press UP while tailsliding to
jump out of your tailslide

Swim through rings to build
speed and get more time

Lead fish out of the water for
points and a speed bonus

Advanced Techniques

page 3/3

'Starsliding' increases your
'Slide boost', which gives you
more airtime when you jump
out of a tailslide

You can also tailslide in space!

Do a wide variety of tricks to
increase your speed and combo
multiplier

Take off quickly after landing to
chain one jump combo into
another.

Hold the DOWN key to roll
between jumps to keep your
combo going underwater

Hyper-Advanced Techniques

page 4/4

Sample Video

120

100

now

low

ActionScript [AS3]

Section 1
//DateFormat (ascb.util.DateFormat) package ascb.util { public class DateFormat { private var _sMask:String; public static const DAYSINMONTH:Array = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; public static const MONTHS_ABBREVIATED:Array = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; public static const DAYS_ABBREVIATED:Array = ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"]; public static const MONTHS:Array = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; public static const DAYS:Array = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; public function DateFormat(_arg1:String){ _sMask = _arg1; } public function format(_arg1:Date):String{ var _local2:Array; var _local3:Array; var _local4:Number; var _local5:Number; var _local6:NumberFormat; _local2 = getMaskElements(); _local3 = new Array(); _local4 = 0; while (_local4 < _local2.length) { switch (_local2[_local4].element){ case "a": if (_arg1.getHours() < 12){ _local3.push("am"); } else { _local3.push("pm"); }; break; case "A": if (_arg1.getHours() < 12){ _local3.push("AM"); } else { _local3.push("PM"); }; break; case "d": _local3.push(_arg1.getDate()); break; case "D": _local3.push(_slot1.DAYS_ABBREVIATED[_arg1.getDay()]); break; case "F": _local3.push(_slot1.MONTHS[_arg1.getMonth()]); break; case "g": _local5 = _arg1.getHours(); if (_local5 == 12){ _local3.push(12); } else { if (_local5 <= 12){ _local3.push(_local5); } else { _local3.push((_local5 - 12)); }; }; break; case "G": _local3.push(_arg1.getHours()); break; case "h": _local6 = new NumberFormat("00"); _local5 = _arg1.getHours(); if (_local5 == 12){ _local3.push(12); } else { if (_local5 <= 12){ _local3.push(_local6.format(_local5)); } else { _local3.push(_local6.format((_local5 - 12))); }; }; break; case "H": _local6 = new NumberFormat("00"); _local3.push(_local6.format(_arg1.getHours())); break; case "i": _local6 = new NumberFormat("00"); _local3.push(_local6.format(_arg1.getMinutes())); break; case "j": _local3.push(_arg1.getDate()); break; case "l": _local3.push(_slot1.DAYS[_arg1.getDay()]); break; case "m": _local6 = new NumberFormat("00"); _local3.push(_local6.format((_arg1.getMonth() + 1))); break; case "M": _local3.push(_slot1.MONTHS_ABBREVIATED[_arg1.getMonth()]); break; case "n": _local3.push((_arg1.getMonth() + 1)); break; case "s": _local6 = new NumberFormat("00"); _local3.push(_local6.format(_arg1.getSeconds())); break; case "t": _local3.push(_slot1.DAYSINMONTH[_arg1.getMonth()]); break; case "w": _local3.push(_arg1.getDay()); break; case "y": _local3.push(String(_arg1.getFullYear()).substring(2)); break; case "Y": _local3.push(_arg1.getFullYear()); break; case "\\": _local3.push((_local2[_local4].element + ((_local2[(_local4 + 1)].element)==undefined) ? "" : _local2[(_local4 + 1)].element)); _local4++; break; default: _local3.push(_local2[_local4].element); }; _local4++; }; return (_local3.join("")); } public function set mask(_arg1:String):void{ _sMask = _arg1; } private function getMaskElements(_arg1:Boolean=false):Array{ var _local2:Array; var _local3:Array; var _local4:Array; var _local5:RegExp; var _local6:Number; var _local7:Number; _local2 = _sMask.split("'"); _local3 = new Array(); _local5 = new RegExp("[a-zA-Z]"); _local6 = 0; while (_local6 < _local2.length) { if ((_local6 % 2) != 0){ _local3.push({type:"quoted", element:_local2[_local6]}); } else { _local4 = _local2[_local6].split(""); _local7 = 0; while (_local7 < _local4.length) { if (((_local5.test(_local4[_local7])) && (_arg1))){ _local3.push({type:"regular", element:_local4[_local7]}); } else { if (!_arg1){ _local3.push({type:"regular", element:_local4[_local7]}); }; }; _local7++; }; }; _local6++; }; return (_local3); } public function parse(_arg1:String):Date{ var _local2:Array; var _local3:Number; var _local4:Number; var _local5:RegExp; var _local6:Array; var _local7:Date; var _local8:String; var _local9:String; var _local10:String; var _local11:Number; _local2 = getMaskElements(true); _local4 = 0; while (_local4 < _local2.length) { _local3 = _arg1.indexOf(_local2[_local4].element); if (_local2[_local4].type == "quoted"){ if (_local3 != -1){ _arg1 = ((_arg1.substring(0, _local3) + " ") + _arg1.substring((_local3 + _local2[_local4].element.length))); _local2.splice(_local4, 1); _local4--; }; }; _local4++; }; _local5 = new RegExp("[^a-zA-Z0-9]+"); _local6 = _arg1.split(_local5); _local7 = new Date(0, 0, 0, 0, 0, 0, 0); _local4 = 0; while (_local4 < _local2.length) { _local9 = String(_local6.shift()); switch (_local2[_local4].element){ case "a": case "A": _local8 = _local9.toLowerCase(); break; case "d": _local7.setDate(parseInt(_local9)); break; case "F": _local10 = _local6.shift().toLowerCase(); _local11 = 0; while (_local11 < _slot1.MONTHS.length) { if (_local10 == _slot1.MONTHS[_local11].toLowerCase()){ _local7.setMonth(_local11); break; }; _local11++; }; break; case "g": case "G": case "h": case "H": _local7.setHours(parseInt(_local9)); break; case "i": _local7.setMinutes(parseInt(_local9)); break; case "j": _local7.setDate(parseInt(_local9)); break; case "m": case "n": _local7.setMonth((parseInt(_local9) - 1)); break; case "M": _local10 = _local9.toLowerCase(); _local11 = 0; while (_local11 < _slot1.MONTHS_ABBREVIATED.length) { if (_slot1.MONTHS_ABBREVIATED[_local11].toLowerCase() == _local10){ _local7.setMonth(_local11); break; }; _local11++; }; break; case "s": _local7.setSeconds(parseInt(_local9)); break; case "y": _local7.setFullYear((2000 + parseInt(_local9))); break; case "Y": _local7.setFullYear(parseInt(_local9)); break; }; _local4++; }; if (_local8 == "pm"){ if (_local7.getHours() < 12){ _local7.setHours((_local7.getHours() + 12)); }; } else { if (_local8 == "am"){ if (_local7.getHours() == 12){ _local7.setHours(0); }; }; }; return (_local7); } public function get mask():String{ return (_sMask); } public static function formatMilliseconds(_arg1:Number):String{ var _local2:Number; _local2 = (_arg1 / 1000); return (formatSeconds(_local2)); } public static function formatSeconds(_arg1:Number):String{ var _local2:NumberFormat; var _local3:String; var _local4:String; _local2 = new NumberFormat("00"); _local3 = _local2.format(Math.floor((_arg1 / 60))); _local4 = _local2.format(Math.round((_arg1 - (parseInt(_local3) * 60)))); return (((_local3 + ":") + _local4)); } } }//package ascb.util
Section 2
//Locale (ascb.util.Locale) package ascb.util { import flash.system.*; public class Locale { private var _sLanguage:String; private var _sVariant:String; public static const GERMAN:String = "de"; public static const CHINESE:String = "zh"; public static const ENGLISH:String = "en"; public static const SPANISH:String = "es"; public static const UK:String = "UK"; public static const US:String = "US"; public static const FRENCH:String = "fr"; public static const JAPANESE:String = "jp"; private static var __sLanguage:String; private static var __sVariant:String; public function Locale(_arg1:String=null, _arg2:String=null){ _sLanguage = _arg1; _sVariant = _arg2; } public function get variant():String{ if (_sVariant == null){ if (Locale.svariant == null){ if (Capabilities.language.length > 2){ _sVariant = Capabilities.language.substr(3); } else { if (language == ENGLISH){ if (new Date().getTimezoneOffset() > 120){ _sVariant = US; } else { _sVariant = UK; }; } else { if (language == SPANISH){ if (new Date().getTimezoneOffset() > 120){ _sVariant = "MX"; } else { _sVariant = "ES"; }; }; }; }; } else { _sVariant = Locale.svariant; }; }; return (_sVariant); } public function set variant(_arg1:String):void{ _sVariant = _arg1; } public function get languageVariant():String{ var _local1:String; _local1 = language; if (variant != null){ _local1 = (_local1 + ("-" + variant)); }; return (_local1); } public function set language(_arg1:String):void{ _sLanguage = _arg1; } public function reset():void{ _sLanguage = null; _sVariant = null; } public function set languageVariant(_arg1:String):void{ var _local2:Array; _local2 = _arg1.split("-"); _sLanguage = _local2[0]; _sVariant = _local2[1]; } public function get language():String{ if (_sLanguage == null){ if (Locale.slanguage == null){ _sLanguage = Capabilities.language.substr(0, 2); } else { _sLanguage = Locale.slanguage; }; }; return (_sLanguage); } public static function sreset():void{ __sLanguage = null; __sVariant = null; } public static function get slanguage():String{ return (__sLanguage); } public static function set slanguage(_arg1:String):void{ __sLanguage = _arg1; } public static function set svariant(_arg1:String):void{ __sVariant = _arg1; } public static function get svariant():String{ return (__sVariant); } public static function get slanguageVariant():String{ var _local1:String; _local1 = slanguage; if (svariant != null){ _local1 = (_local1 + ("-" + svariant)); }; return (_local1); } public static function set slanguageVariant(_arg1:String):void{ var _local2:Array; _local2 = _arg1.split("-"); __sLanguage = _local2[0]; __sVariant = _local2[1]; } } }//package ascb.util
Section 3
//NumberFormat (ascb.util.NumberFormat) package ascb.util { public class NumberFormat { private var _sMask:String; public function NumberFormat(_arg1:String=null){ _sMask = _arg1; } public function parse(_arg1:String, _arg2:Number, _arg3:Boolean, _arg4:Locale):Number{ var _local5:Object; var _local6:Array; var _local7:Number; if (_arg4 == null){ _arg4 = new Locale(); }; _local5 = getSymbols(_arg3, _arg4); _local6 = _arg1.split(""); if (isNaN(_arg2)){ if (_local6[0] == "O"){ if (_local6[1] == "x"){ _arg2 = 16; } else { _arg2 = 8; }; } else { if (_local6[0] == "#"){ _arg2 = 16; } else { _arg2 = (isNaN(_arg2)) ? 10 : _arg2; }; }; }; _local7 = 0; while (_local7 < _local6.length) { switch (_local6[_local7]){ case "0": case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": break; case _local5.decimal: _local6[_local7] = "."; break; default: if (_arg2 > 10){ if ((((((_local6[_local7].charCodeAt(0) > 64)) && ((_local6[_local7].charCodeAt(0) < 91)))) || ((((_local6[_local7].charCodeAt(0) > 96)) && ((_local6[_local7].charCodeAt(0) < 123)))))){ break; }; }; _local6.splice(_local7, 1); _local7--; }; _local7++; }; if (_arg2 == 10){ return (Number(_local6.join(""))); }; return (parseInt(_local6.join(""), _arg2)); } private function getSymbols(_arg1:Boolean, _arg2:Locale):Object{ var _local3:Object; _local3 = new Object(); switch (_arg2.languageVariant){ case "en-US": _local3.currency = "$"; _local3.group = ","; _local3.decimal = "."; _local3.before = true; break; case "en-UK": _local3.currency = "£"; _local3.group = ","; _local3.decimal = "."; _local3.before = true; break; case "es-MX": _local3.currency = "$"; _local3.group = ","; _local3.decimal = "."; _local3.before = true; break; case "es-ES": _local3.currency = "€"; _local3.group = "."; _local3.decimal = ","; _local3.before = false; break; case "fr": _local3.currency = "€"; _local3.group = "."; _local3.decimal = ","; _local3.before = false; break; case "sv": _local3.currency = "kr"; _local3.group = (_arg1) ? "," : " "; _local3.decimal = "."; _local3.before = false; break; case "jp": _local3.currency = " 5"; _local3.group = ","; _local3.decimal = "."; _local3.before = true; break; case "nl": _local3.currency = "€"; _local3.group = "."; _local3.decimal = ","; _local3.before = true; break; default: _local3.currency = "€"; _local3.group = "."; _local3.decimal = ","; _local3.before = true; break; }; return (_local3); } public function format(_arg1:Number, _arg2:Object=null, _arg3:Object=null):String{ var _local4:String; var _local5:String; var _local6:String; var _local7:Array; var _local8:Array; var _local9:Array; var _local10:Number; var _local11:String; var _local12:Object; var _local13:Locale; var _local14:Locale; var _local15:Number; var _local16:Number; var _local17:Array; var _local18:Array; var _local19:Array; var _local20:Number; var _local21:Number; var _local22:Boolean; var _local23:Array; var _local24:Number; if (typeof(_arg2) == "number"){ _local10 = Number(_arg2); _local4 = _arg1.toString(_local10); _local11 = ""; if (_local10 == 16){ _local11 = "0x"; }; if (_local10 == 8){ _local11 = "0"; }; if (_arg3 != null){ _local11 = String(_arg3); }; return ((_local11 + _local4.toUpperCase())); }; _local5 = ","; _local6 = "."; if (((!((_arg2 == null))) && (_arg2.hasOwnProperty("group")))){ _local12 = _arg2; } else { _local13 = Locale(_arg2); if (_local13 == null){ _local13 = new Locale(); }; _local14 = Locale(_local13); _local12 = getSymbols(false, _local14); }; _local5 = _local12.decimal; _local6 = _local12.group; _local7 = String(_arg1).split("."); _local8 = _local7[0].split(""); _local9 = ((_local7.length)>1) ? _local7[1].split("") : new Array(); if (_sMask == null){ _local15 = 1; _local8.reverse(); _local16 = 0; while (_local16 < _local8.length) { if (_local15 > 3){ _local15 = 0; _local8.splice(_local16, 0, _local6); }; _local15++; _local16++; }; _local8.reverse(); _local4 = _local8.join(""); if (_local7[1] != null){ _local4 = (_local4 + (_local5 + _local7[1])); }; } else { _local17 = _sMask.split(""); _local16 = 0; while (_local16 < _local17.length) { if (((((!((_local17[_local16] == "0"))) && (!((_local17[_local16] == "#"))))) && (!((_local17[_local16] == "."))))){ _local17.splice(_local16, 1); _local16--; }; _local16++; }; _local17 = _local17.join("").split("."); _local18 = _local17[0].split(""); _local19 = ((_local17.length)>1) ? _local17[1].split("") : new Array(); _local15 = _local18.length; _local20 = 0; _local21 = 0; _local4 = ""; if (_local15 < _local8.length){ _local16 = 0; while (_local16 < (_local8.length - _local15)) { _local4 = (_local4 + _local8[_local16]); _local20++; _local16++; }; } else { if (_local15 > _local8.length){ _local16 = 0; while (_local16 < (_local15 - _local8.length)) { if (_local18[_local16] == "0"){ _local4 = (_local4 + "0"); } else { if (_local18[_local16] == "#"){ _local4 = (_local4 + " "); }; }; _local21++; _local16++; }; }; }; _local22 = false; _local16 = _local21; while (_local16 < _local18.length) { if ((((_local18[_local16] == "0")) || ((_local18[_local16] == "#")))){ _local4 = (_local4 + ((_local8[_local20])==undefined) ? "" : _local8[_local20]); _local20++; }; _local16++; }; _local17 = _sMask.split("."); _local17 = _local17[0].split(""); _local23 = _local4.split(""); _local22 = false; _local16 = 0; while (_local16 < _local17.length) { if (((((!((_local17[_local16] == "0"))) && (!((_local17[_local16] == "#"))))) && (!((_local17[_local16] == "."))))){ if (_local22){ _local23.splice(_local16, 0, _local6); } else { _local23.splice(_local16, 0, " "); }; }; if (((!((_local23[_local16] == " "))) && (!((_local23[_local16] == "0"))))){ _local22 = true; }; _local16++; }; _local4 = _local23.join(""); if (_local19.length > 0){ _local4 = (_local4 + _local5); }; _local16 = 0; while (_local16 < _local19.length) { if (_local9[_local16] == null){ if (_local19[_local16] == "0"){ _local4 = (_local4 + "0"); } else { if (_local19[_local16] == "#"){ _local4 = (_local4 + " "); }; }; } else { _local24 = Number(((_local9[_local16] + "") + _local9[(_local16 + 1)])); if ((((_local16 == (_local19.length - 1))) && (!(isNaN(_local24))))){ _local4 = (_local4 + String(Math.round((_local24 / 10)))); } else { _local4 = (_local4 + _local9[_local16]); }; }; _local16++; }; }; return (_local4); } public function set mask(_arg1:String):void{ _sMask = _arg1; } public function currencyFormat(_arg1:Number, _arg2:Object=null):String{ var _local4:Locale; var _local5:String; var _local6:String; var _local7:String; var _local8:String; var _local9:Locale; var _local10:String; var _local11:Array; var _local12:Array; var _local13:Number; var _local14:String; var _local15:Object; var _local16:Number; _local4 = ((arguments[1] is Locale)) ? arguments[1] : new Locale(); if (((!((_arg2 == null))) && (_arg2.hasOwnProperty("group")))){ _local15 = _arg2; } else { _local15 = getSymbols(true, _local4); }; _local5 = _local15.currency; _local6 = _local15.group; _local7 = _local15.decimal; _local8 = _sMask; _sMask = null; _local9 = new Locale(); _local9.language = "en"; _local9.variant = "US"; _local10 = format(_arg1, _local9); _sMask = _local8; _local11 = _local10.split("."); if (_local11[1] == undefined){ _local11[1] = "00"; } else { _local11[1] = Number(_local11[1]); _local16 = String(_local11[1]).length; if (_local16 > 2){ _local11[1] = (_local11[1] / Math.pow(10, (_local16 - 2))); _local11[1] = Math.round(_local11[1]); }; }; _local10 = _local11.join("."); _local12 = _local10.split(""); _local13 = 0; while (_local13 < _local12.length) { if (_local12[_local13] == ","){ _local12[_local13] = _local6; } else { if (_local12[_local13] == "."){ _local12[_local13] = _local7; }; }; _local13++; }; _local14 = (((_local15.before) ? _local5 : "" + _local12.join("")) + (_local15.before) ? "" : _local5); return (_local14); } public function get mask():String{ return (_sMask); } } }//package ascb.util
Section 4
//Debug_fps (com.gamingyourway.fps.Debug_fps) package com.gamingyourway.fps { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; public class Debug_fps { private var checkRate:int; private var pos:Point; private var startTime:Number; private var checkCounter:int; private var fpsSymbol:MovieClip; public var fps:Number; private var highest:int; private var lowestResetCnt:int; private var frameRate:Number; private var lowest:int; private var fpsHolder:Sprite; private var stage:Stage; public function Debug_fps(_arg1:Stage, _arg2:Point):void{ stage = _arg1; pos = _arg2; lowest = (frameRate = stage["frameRate"]); highest = 0; checkCounter = 1; checkRate = 8; lowestResetCnt = (frameRate * 5); startTime = getTimer(); fpsHolder = new FPSCounter(); stage.addChild(fpsHolder); fpsHolder.x = pos.x; fpsHolder.y = pos.y; fpsHolder.addEventListener(Event.ENTER_FRAME, mainloop); } private function mainloop(_arg1:Event):void{ var _local2:int; var _local3:Number; if (--checkCounter == 0){ _local3 = (checkRate / ((getTimer() - startTime) / 1000)); _local3 = Math.round(((_local3 * 10) / 10)); if (_local3 > frameRate){ _local3 = frameRate; }; fpsHolder["fps"].text = _local3; fps = _local3; if (_local3 < lowest){ lowest = (fpsHolder["lowestValue"].text = _local3); }; if (_local3 > highest){ highest = _local3; }; startTime = getTimer(); checkCounter = checkRate; }; if (--lowestResetCnt == 0){ lowest = (fpsHolder["lowestValue"].text = highest); lowestResetCnt = (frameRate * 6); }; fpsHolder["bar"].height = (((fpsHolder["fps"].text / frameRate) * 100) / 4); _local2 = (stage.numChildren - 1); if (stage.getChildIndex(fpsHolder) < _local2){ stage.setChildIndex(fpsHolder, _local2); }; } public function toString():String{ return ("Debug_fps"); } } }//package com.gamingyourway.fps
Section 5
//SHA1 (com.meychi.ascrypt3.SHA1) package com.meychi.ascrypt3 { public class SHA1 { private function sha1_kt(_arg1:Number):Number{ return (((_arg1)<20) ? 1518500249 : ((_arg1)<40) ? 1859775393 : ((_arg1)<60) ? -1894007588 : -899497514); } private function binb2hex(_arg1:Array):String{ var _local2:String; var _local3:String; var _local4:Number; _local2 = new String(""); _local3 = new String("0123456789abcdef"); _local4 = 0; while (_local4 < (_arg1.length * 4)) { _local2 = (_local2 + (_local3.charAt(((_arg1[(_local4 >> 2)] >> (((3 - (_local4 % 4)) * 8) + 4)) & 15)) + _local3.charAt(((_arg1[(_local4 >> 2)] >> ((3 - (_local4 % 4)) * 8)) & 15)))); _local4++; }; return (_local2); } private function core_sha1(_arg1:Array, _arg2:Number):Array{ var _local3:Array; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; _arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (24 - (_arg2 % 32)))); _arg1[((((_arg2 + 64) >> 9) << 4) + 15)] = _arg2; _local3 = new Array(80); _local4 = 1732584193; _local5 = -271733879; _local6 = -1732584194; _local7 = 271733878; _local8 = -1009589776; _local9 = 0; while (_local9 < _arg1.length) { _local10 = _local4; _local11 = _local5; _local12 = _local6; _local13 = _local7; _local14 = _local8; _local15 = 0; while (_local15 < 80) { if (_local15 < 16){ _local3[_local15] = _arg1[(_local9 + _local15)]; } else { _local3[_local15] = rol((((_local3[(_local15 - 3)] ^ _local3[(_local15 - 8)]) ^ _local3[(_local15 - 14)]) ^ _local3[(_local15 - 16)]), 1); }; _local16 = safe_add(safe_add(rol(_local4, 5), sha1_ft(_local15, _local5, _local6, _local7)), safe_add(safe_add(_local8, _local3[_local15]), sha1_kt(_local15))); _local8 = _local7; _local7 = _local6; _local6 = rol(_local5, 30); _local5 = _local4; _local4 = _local16; _local15++; }; _local4 = safe_add(_local4, _local10); _local5 = safe_add(_local5, _local11); _local6 = safe_add(_local6, _local12); _local7 = safe_add(_local7, _local13); _local8 = safe_add(_local8, _local14); _local9 = (_local9 + 16); }; return (new Array(_local4, _local5, _local6, _local7, _local8)); } public function calculate(_arg1:String):String{ return (hex_sha1(_arg1)); } private function sha1_ft(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ if (_arg1 < 20){ return (((_arg2 & _arg3) | (~(_arg2) & _arg4))); }; if (_arg1 < 40){ return (((_arg2 ^ _arg3) ^ _arg4)); }; if (_arg1 < 60){ return ((((_arg2 & _arg3) | (_arg2 & _arg4)) | (_arg3 & _arg4))); }; return (((_arg2 ^ _arg3) ^ _arg4)); } private function hex_sha1(_arg1:String):String{ return (binb2hex(core_sha1(str2binb(_arg1), (_arg1.length * 8)))); } private function rol(_arg1:Number, _arg2:Number):Number{ return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2)))); } private function safe_add(_arg1:Number, _arg2:Number):Number{ var _local3:Number; var _local4:Number; _local3 = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF)); _local4 = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16)); return (((_local4 << 16) | (_local3 & 0xFFFF))); } private function str2binb(_arg1:String):Array{ var _local2:Array; var _local3:Number; var _local4:Number; _local2 = new Array(); _local3 = ((1 << 8) - 1); _local4 = 0; while (_local4 < (_arg1.length * 8)) { _local2[(_local4 >> 5)] = (_local2[(_local4 >> 5)] | ((_arg1.charCodeAt((_local4 / 8)) & _local3) << (24 - (_local4 % 32)))); _local4 = (_local4 + 8); }; return (_local2); } } }//package com.meychi.ascrypt3
Section 6
//State (com.rawkins.fsm.State) package com.rawkins.fsm { public interface State { function enter():void; function update():void; function exit():void; } }//package com.rawkins.fsm
Section 7
//StateMachine (com.rawkins.fsm.StateMachine) package com.rawkins.fsm { public class StateMachine { private var currentState:State; private var previousState:State; private var nextState:State; public function StateMachine():void{ currentState = null; } public function setNextState(_arg1:State):void{ nextState = _arg1; } public function changeState(_arg1:State):void{ if (currentState){ currentState.exit(); }; previousState = currentState; currentState = _arg1; currentState.enter(); } public function update():void{ if (currentState){ currentState.update(); }; } public function goToPreviousState():void{ changeState(previousState); } public function goToNextState():void{ changeState(nextState); } } }//package com.rawkins.fsm
Section 8
//Anim (com.rawkins.fx.Anim) package com.rawkins.fx { import flash.events.*; import flash.display.*; public class Anim extends EventDispatcher { public const SPRING_DONE:String = "spring done"; public const MOVE_DONE:String = "move done"; public const SHAKE_DONE:String = "shake done"; public const FADE_DONE:String = "fade done"; public const WIPE_DONE:String = "wipe done"; private var springAX:Number;// = 0 private var springAY:Number;// = 0 private var springVY:Number;// = 0 private var shakeX:Number; private var shakeY:Number; private var shakeEase;// = 2 private var springVX:Number;// = 0 private var shakeOrgX:Number; private var shakeOrgY:Number; private var springTargetX:Number; private var springTargetY:Number; private var shakeDir;// = 1 private var fadeSpeed:Number; private var springFriction:Number; private var springing:Boolean;// = false private var shakeTarget:DisplayObject; private var fading:Boolean;// = false private var wipeTarget:Number; private var shaking:Boolean;// = false private var wiping:Boolean;// = false private var wipeSpeed:Number; private var wipeMask:Shape; private var moveTargetY; private var moveEasing; private var moving:Boolean;// = false private var springForce:Number; private var fadeDir:int; private var lastSpringX:Number; private var moveTargetX; private var lastSpringY:Number; public function Anim():void{ shaking = false; shakeDir = 1; shakeEase = 2; fading = false; springing = false; springAX = 0; springAY = 0; springVX = 0; springVY = 0; moving = false; wiping = false; super(); } private function onFade(_arg1:Event):void{ var _local2:DisplayObject; var _local3:Number; _local2 = DisplayObject(_arg1.target); _local3 = 0; if (fadeDir == 1){ _local3 = ((1 - _local2.alpha) * fadeSpeed); } else { if (fadeDir == -1){ _local3 = (_local2.alpha * fadeSpeed); }; }; _local2.alpha = (_local2.alpha + _local3); if ((((((fadeDir == 1)) && ((_local2.alpha >= 0.98)))) || ((((fadeDir == -1)) && ((_local2.alpha <= 0.02)))))){ _local2.removeEventListener(Event.ENTER_FRAME, onFade); _local2.dispatchEvent(new Event(FADE_DONE)); fading = false; }; } public function moveTo(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number=2){ if (!moving){ moving = true; moveTargetX = _arg2; moveTargetY = _arg3; moveEasing = (_arg4 / 10); if (moveEasing > 1){ moveEasing = 1; } else { if (moveEasing < 0){ moveEasing = 0.9; }; }; _arg1.addEventListener(Event.ENTER_FRAME, onMove); } else { trace("Already moving something"); }; } private function onMove(_arg1:Event):void{ var _local2:DisplayObject; var _local3:Number; var _local4:Number; _local2 = DisplayObject(_arg1.target); _local3 = (moveTargetX - _local2.x); _local4 = (moveTargetY - _local2.y); _local2.x = (_local2.x + (_local3 * moveEasing)); _local2.y = (_local2.y + (_local4 * moveEasing)); if ((((Math.abs(_local3) < 0.25)) && ((Math.abs(_local4) < 0.25)))){ _local2.removeEventListener(Event.ENTER_FRAME, onMove); _local2.dispatchEvent(new Event(MOVE_DONE)); moving = false; }; } public function shake(_arg1:DisplayObject, _arg2:Number=50, _arg3:Number=50):void{ if (!shaking){ shakeX = _arg2; shakeY = _arg3; shakeOrgX = _arg1.x; shakeOrgY = _arg1.y; shaking = true; _arg1.addEventListener(Event.ENTER_FRAME, onShake); }; } public function onSpring(_arg1:Event):void{ var _local2:DisplayObject; var _local3:Number; var _local4:Number; _local2 = DisplayObject(_arg1.target); lastSpringX = _local2.x; lastSpringY = _local2.y; _local3 = (springTargetX - _local2.x); _local4 = (springTargetY - _local2.y); springAX = (_local3 * springForce); springAY = (_local4 * springForce); springVX = (springVX + springAX); springVY = (springVY + springAY); springVX = (springVX * springFriction); springVY = (springVY * springFriction); _local2.x = (_local2.x + springVX); _local2.y = (_local2.y + springVY); if ((((_local2.x == lastSpringX)) && ((_local2.y == lastSpringY)))){ _local2.removeEventListener(Event.ENTER_FRAME, onSpring); _local2.dispatchEvent(new Event(SPRING_DONE)); springing = false; }; } public function wipe(_arg1:DisplayObjectContainer, _arg2:Boolean=true, _arg3:Number=1, _arg4:Boolean=false){ if (!wiping){ wiping = true; wipeMask = new Shape(); wipeMask.graphics.beginFill(0xFF0000); wipeMask.graphics.drawRect(0, 0, _arg1.width, _arg1.height); if (_arg4){ if (_arg2){ wipeMask.graphics.moveTo(0, 0); wipeMask.graphics.lineTo(0, _arg1.height); wipeMask.graphics.lineTo(-50, _arg1.height); wipeMask.graphics.lineTo(0, 0); } else { wipeMask.graphics.moveTo((_arg1.width + 50), 0); wipeMask.graphics.lineTo(_arg1.width, _arg1.height); wipeMask.graphics.lineTo(_arg1.width, 0); }; }; wipeMask.graphics.endFill(); wipeSpeed = (_arg3 / 10); if (!_arg2){ wipeTarget = -50; wipeMask.x = (wipeMask.x - _arg1.width); if (_arg4){ wipeMask.x = (wipeMask.x - 50); }; } else { wipeTarget = (_arg1.width + 50); }; if (_arg4){ wipeTarget = (wipeTarget + 50); }; if (wipeSpeed > 1){ wipeSpeed = 1; } else { if (wipeSpeed < 0){ wipeSpeed = 0.9; }; }; _arg1.mask = wipeMask; _arg1.addChild(wipeMask); _arg1.addEventListener(Event.ENTER_FRAME, onWipe); }; } private function onShake(_arg1:Event):void{ var _local2:DisplayObject; var _local3:Number; var _local4:Number; _local2 = DisplayObject(_arg1.target); _local3 = (shakeOrgX + (shakeX * shakeDir)); _local4 = (shakeOrgY + (shakeY * shakeDir)); _local2.x = _local3; _local2.y = _local4; shakeDir = (shakeDir * -1); shakeX = (shakeX / shakeEase); shakeY = (shakeY / shakeEase); if ((((shakeX < 1)) && ((shakeY < 1)))){ _local2.removeEventListener(Event.ENTER_FRAME, onShake); _local2.x = shakeOrgX; _local2.y = shakeOrgY; _local2.dispatchEvent(new Event(SHAKE_DONE)); shaking = false; }; } public function springTo(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number=1, _arg5:Number=0.75){ if (!springing){ springTargetX = _arg2; springTargetY = _arg3; springForce = _arg4; springFriction = _arg5; springing = true; _arg1.addEventListener(Event.ENTER_FRAME, onSpring); }; } public function fade(_arg1:String, _arg2:DisplayObject, _arg3:Number=10):void{ if (!fading){ if (_arg1 == "in"){ fadeDir = 1; } else { if (_arg1 == "out"){ fadeDir = -1; } else { trace("invalid fade direction"); return; }; }; fadeSpeed = ((_arg3 / 100) * fadeDir); fading = true; _arg2.addEventListener(Event.ENTER_FRAME, onFade); }; } private function onWipe(_arg1:Event):void{ var _local2:DisplayObjectContainer; var _local3:Number; _local2 = DisplayObjectContainer(_arg1.target); _local3 = (wipeTarget - wipeMask.x); wipeMask.x = (wipeMask.x + (_local3 * wipeSpeed)); if (Math.abs(_local3) < 2){ wiping = false; _local2.mask = null; _local2.removeChild(wipeMask); wipeMask.graphics.clear(); wipeMask = null; _local2.removeEventListener(Event.ENTER_FRAME, onWipe); _local2.dispatchEvent(new Event(WIPE_DONE)); }; } } }//package com.rawkins.fx
Section 9
//Particle (com.rawkins.fx.Particle) package com.rawkins.fx { import flash.events.*; import flash.display.*; import com.rawkins.utils.*; public class Particle extends Sprite { public var id:uint; protected var _vy:Number; protected var _vz:Number; protected var _color:Number; protected var _vx:Number; public var dead:Boolean;// = false public var bounded:Boolean;// = true protected var _age:Number; protected var _angle:Number; protected var _life:Number; public function Particle(_arg1:Number=0, _arg2:Number=0, _arg3:Number=10, _arg4:Number=0xFFFFFF):void{ dead = false; bounded = true; super(); this.angle = _arg2; this.vz = _arg1; this._life = _arg3; this._age = 0; this._color = _arg4; } public function draw():void{ graphics.beginFill(color); graphics.lineStyle(0, 0, 0); graphics.drawCircle(2, 2, 2); graphics.endFill(); cacheAsBitmap = true; } public function get color():Number{ return (_color); } public function set vx(_arg1:Number):void{ _vx = _arg1; } public function set vy(_arg1:Number):void{ _vy = _arg1; } public function set vz(_arg1:Number):void{ this.vx = (Math.cos(MathSG.rad(angle)) * _arg1); this.vy = (Math.sin(MathSG.rad(angle)) * _arg1); _vz = _arg1; } public function die():void{ graphics.clear(); this.dead = true; } public function set angle(_arg1:Number):void{ _angle = _arg1; } private function onEnterFrame(_arg1:Event):void{ } public function get vy():Number{ return (_vy); } public function update():void{ if (!dead){ this.x = (this.x + vx); this.y = (this.y + vy); this._age++; if (this._age > this._life){ this.die(); }; }; } public function get vx():Number{ return (_vx); } public function set color(_arg1:Number):void{ _color = _arg1; } public function get angle():Number{ return (_angle); } public function get vz():Number{ return (_vz); } } }//package com.rawkins.fx
Section 10
//ParticleManager (com.rawkins.fx.ParticleManager) package com.rawkins.fx { import flash.display.*; public class ParticleManager extends Sprite { private var particleCount:uint;// = 0 private var particles:Array; public function ParticleManager():void{ particleCount = 0; super(); particles = new Array(); } public function addParticle(_arg1:Particle):void{ particles.push(_arg1); addChild(_arg1); _arg1.name = ("particle_" + particleCount); _arg1.id = particleCount; particleCount++; } public function update():void{ var _local1:uint; var _local2:Particle; var _local3:Number; var _local4:Number; _local1 = 0; while (_local1 < particles.length) { _local2 = particles[_local1]; if (_local2 != null){ _local2.update(); if (_local2.bounded){ _local3 = (_local2.x + this.x); if ((((_local3 < 0)) || ((_local3 > 640)))){ _local2.dead = true; } else { _local4 = (parent.y + _local2.y); if ((((_local4 > 480)) || ((_local4 < 0)))){ _local2.dead = true; }; }; }; if (_local2.dead){ removeChild(_local2); particles.splice(_local1, 1); _local2 = null; _local1--; }; }; _local1++; }; } } }//package com.rawkins.fx
Section 11
//Background (com.rawkins.games.dolphinOlympics.Background) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import flash.geom.*; public class Background extends Sprite { protected var rb:Number; public var speed:Number; protected var bb:Number; protected var tb:Number; protected var lb:Number; protected var tiles:Array; protected var scrollTiles:Array; public function Background(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1):void{ tiles = new Array(); scrollTiles = new Array(); tb = _arg1; rb = _arg2; bb = _arg3; lb = _arg4; speed = _arg5; addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function checkChildren():void{ var _local1:int; var _local2:DisplayObject; var _local3:Point; var _local4:Point; _local1 = 0; while (_local1 < tiles.length) { _local2 = tiles[_local1]; _local3 = new Point(); _local3.x = _local2.x; _local3.y = _local2.y; _local4 = localToGlobal(_local3); if ((((_local4.y > (bb + _local2.height))) || (((_local4.y + _local2.height) < tb)))){ if (contains(_local2)){ removeChild(_local2); }; } else { if (_local2.parent == null){ addChild(_local2); }; }; _local1++; }; } public function removeTile(_arg1:DisplayObject):void{ var _local2:int; var _local3:DisplayObject; if (contains(_arg1)){ removeChild(_arg1); }; _local2 = 0; while (_local2 < tiles.length) { _local3 = tiles[_local2]; if (_local3 == _arg1){ tiles.splice(_local2, 1); }; _local2++; }; _local2 = 0; while (_local2 < scrollTiles.length) { _local3 = scrollTiles[_local2]; if (_local3 == _arg1){ scrollTiles.splice(_local2, 1); }; _local2++; }; } public function debug():void{ var _local1:int; var _local2:DisplayObject; _local1 = 0; while (_local1 < tiles.length) { _local2 = tiles[_local1]; _local1++; }; } protected function slice(_arg1:DisplayObject):Array{ var _local2:Number; var _local3:int; var _local4:Array; var _local5:int; var _local6:BitmapData; var _local7:BitmapData; var _local8:Bitmap; _local2 = 200; _local3 = (Math.floor((_arg1.height / _local2)) + 1); _local4 = new Array(); _local5 = 0; while (_local5 < _local3) { _local6 = new BitmapData(_arg1.width, _arg1.height, true, 0); _local6.draw(_arg1, null, null, null, new Rectangle(0, (_local5 * _local2), _arg1.width, _local2)); _local7 = new BitmapData(_arg1.width, _local2, true, 0); _local7.copyPixels(_local6, new Rectangle(0, (_local5 * _local2), _arg1.width, _local2), new Point(0, 0)); _local8 = new Bitmap(_local7); _local8.y = (_arg1.y + (_local5 * _local2)); _local8.x = _arg1.x; _local4.push(_local8); _local5++; }; return (_local4); } private function onEnterFrame(_arg1:Event):void{ checkChildren(); } public function scroll(_arg1:Number):void{ var _local2:Number; var _local3:uint; var _local4:Object; _local2 = (_arg1 * speed); _local3 = 0; while (_local3 < scrollTiles.length) { _local4 = scrollTiles[_local3]; scrollTiles[_local3].x = (_local4.x - _local2); if (_local4.x > rb){ _local4.x = (lb + (_local4.x - rb)); }; if (_local4.x < lb){ _local4.x = (rb + (_local4.x - lb)); }; _local3++; }; } public function addTile(_arg1:DisplayObject, _arg2:Boolean=false, _arg3:Boolean=false):DisplayObject{ var _local4:Array; if (_arg3){ _local4 = slice(_arg1); for each (s in _local4) { tiles.push(s); if (_arg2){ scrollTiles.push(s); }; addChild(s); }; } else { tiles.push(_arg1); if (_arg2){ scrollTiles.push(_arg1); }; addChild(_arg1); }; } } }//package com.rawkins.games.dolphinOlympics
Section 12
//Bluefish (com.rawkins.games.dolphinOlympics.Bluefish) package com.rawkins.games.dolphinOlympics { import flash.utils.*; public class Bluefish extends Fish { private var landTimer:Timer; private var turnCounter:Number;// = 0 public function Bluefish(_arg1:Number=0, _arg2:Number=0):void{ turnCounter = 0; addFrameScript(29, frame30, 39, frame40, 44, frame45); super(_arg1, _arg2); landTimer = new Timer(1000, 1); _scalar = ((Math.random() / 6) + 0.35); scaleX = (scaleY = _scalar); } override protected function jump():void{ super.jump(); angle = (angle + 0.2); } override protected function swim():void{ updateSpeed(); if (!activated){ if (this.y > _bottom){ if ((((_angle > (Math.PI / 2))) && ((_angle < (Math.PI * 1.5))))){ _angle = (_angle + 0.1); } else { _angle = (_angle - 0.1); }; } else { changeDir(); }; } else { follow(); }; this.x = (this.x + _vx); this.y = (this.y + _vy); } function frame30(){ gotoAndPlay("normal"); } function frame40(){ gotoAndPlay("active"); } function frame45(){ stop(); } override protected function changeDir():void{ if (!landTimer.running){ angle = ((Math.sin(turnCounter) * Math.cos((turnCounter / 4))) + dirAdjust); turnCounter = (turnCounter + 0.05); if (turnCounter > (2 * Math.PI)){ turnCounter = (-2 * Math.PI); }; }; } override public function endJump():void{ super.endJump(); _turnCounter = Math.sin(angle); landTimer.start(); } override public function startJump():void{ super.startJump(); if ((((angle > (Math.PI / 2))) && ((angle < (Math.PI * 1.5))))){ dirAdjust = Math.PI; } else { dirAdjust = 0; }; } } }//package com.rawkins.games.dolphinOlympics
Section 13
//Collidable (com.rawkins.games.dolphinOlympics.Collidable) package com.rawkins.games.dolphinOlympics { import flash.display.*; import flash.utils.*; public class Collidable extends MovieClip { protected var _active:Boolean;// = false protected var _activeTimer:Timer; protected var _onScreen:Boolean;// = true protected var _hitZone:Shape; public static var COLLIDABLE_DEAD = "collidable_dead"; public function Collidable():void{ _active = false; _onScreen = true; super(); _hitZone = new Shape(); drawHitZone(); addChild(_hitZone); _activeTimer = new Timer(5000, 1); } public function activate(_arg1:MovieClip):String{ _activeTimer.start(); return ("collidable"); } public function get onScreen():Boolean{ return (_onScreen); } public function set onScreen(_arg1:Boolean){ _onScreen = _arg1; } public function deactivate():void{ _activeTimer.stop(); _activeTimer.reset(); } protected function drawHitZone(_arg1:Number=100):void{ _hitZone.graphics.clear(); _hitZone.graphics.lineStyle(0, 0, 0); _hitZone.graphics.beginFill(0, 0); _hitZone.graphics.drawCircle(0, 0, _arg1); _hitZone.graphics.endFill(); } public function update():void{ } public function get activated():Boolean{ return (_activeTimer.running); } public function get hitZone():Shape{ return (_hitZone); } } }//package com.rawkins.games.dolphinOlympics
Section 14
//Constants (com.rawkins.games.dolphinOlympics.Constants) package com.rawkins.games.dolphinOlympics { public class Constants { public static const WATER_FRICTION:Number = 0.2; public static const FRAMERATE:uint = 31; public static const GRAVITY:Number = 0.45; public static function get countries():Array{ var _local1:Array; _local1 = [{data:"AD", label:"Andorra"}, {data:"AE", label:"United Arab Emirates"}, {data:"AF", label:"Afghanistan"}, {data:"AG", label:"Antigua & Barbuda"}, {data:"AI", label:"Anguilla"}, {data:"AL", label:"Albania"}, {data:"AM", label:"Armenia"}, {data:"AN", label:"Netherlands Antilles"}, {data:"AO", label:"Angola"}, {data:"AQ", label:"Antarctica"}, {data:"AR", label:"Argentina"}, {data:"AS", label:"American Samoa"}, {data:"AT", label:"Austria"}, {data:"AU", label:"Australia"}, {data:"AW", label:"Aruba"}, {data:"AZ", label:"Azerbaijan"}, {data:"BA", label:"Bosnia and Herzegovina"}, {data:"BB", label:"Barbados"}, {data:"BD", label:"Bangladesh"}, {data:"BE", label:"Belgium"}, {data:"BF", label:"Burkina Faso"}, {data:"BG", label:"Bulgaria"}, {data:"BH", label:"Bahrain"}, {data:"BI", label:"Burundi"}, {data:"BJ", label:"Benin"}, {data:"BM", label:"Bermuda"}, {data:"BN", label:"Brunei Darussalam"}, {data:"BO", label:"Bolivia"}, {data:"BR", label:"Brazil"}, {data:"BS", label:"Bahama"}, {data:"BT", label:"Bhutan"}, {data:"BU", label:"Burma (no longer exists)"}, {data:"BV", label:"Bouvet Island"}, {data:"BW", label:"Botswana"}, {data:"BY", label:"Belarus"}, {data:"BZ", label:"Belize"}, {data:"CC", label:"Cocos (Keeling) Islands"}, {data:"CF", label:"Central African Republic"}, {data:"CG", label:"Congo"}, {data:"CH", label:"Switzerland"}, {data:"CI", label:"C�te D'ivoire (Ivory Coast)"}, {data:"CK", label:"Cook Iislands"}, {data:"CL", label:"Chile"}, {data:"CM", label:"Cameroon"}, {data:"CN", label:"China"}, {data:"CO", label:"Colombia"}, {data:"CR", label:"Costa Rica"}, {data:"CS", label:"Czechoslovakia (no longer exists)"}, {data:"CU", label:"Cuba"}, {data:"CV", label:"Cape Verde"}, {data:"CX", label:"Christmas Island"}, {data:"CY", label:"Cyprus"}, {data:"CZ", label:"Czech Republic"}, {data:"DE", label:"Germany"}, {data:"DJ", label:"Djibouti"}, {data:"DK", label:"Denmark"}, {data:"DM", label:"Dominica"}, {data:"DO", label:"Dominican Republic"}, {data:"DZ", label:"Algeria"}, {data:"EC", label:"Ecuador"}, {data:"EE", label:"Estonia"}, {data:"EG", label:"Egypt"}, {data:"EH", label:"Western Sahara"}, {data:"ER", label:"Eritrea"}, {data:"ES", label:"Spain"}, {data:"ET", label:"Ethiopia"}, {data:"FI", label:"Finland"}, {data:"FJ", label:"Fiji"}, {data:"FK", label:"Falkland Islands (Malvinas)"}, {data:"FM", label:"Micronesia"}, {data:"FO", label:"Faroe Islands"}, {data:"FR", label:"France"}, {data:"FX", label:"France, Metropolitan"}, {data:"GA", label:"Gabon"}, {data:"GB", label:"United Kingdom (Great Britain)"}, {data:"GD", label:"Grenada"}, {data:"GE", label:"Georgia"}, {data:"GF", label:"French Guiana"}, {data:"GH", label:"Ghana"}, {data:"GI", label:"Gibraltar"}, {data:"GL", label:"Greenland"}, {data:"GM", label:"Gambia"}, {data:"GN", label:"Guinea"}, {data:"GP", label:"Guadeloupe"}, {data:"GQ", label:"Equatorial Guinea"}, {data:"GR", label:"Greece"}, {data:"GS", label:"South Georgia and the South Sandwich Islands"}, {data:"GT", label:"Guatemala"}, {data:"GU", label:"Guam"}, {data:"GW", label:"Guinea-Bissau"}, {data:"GY", label:"Guyana"}, {data:"HK", label:"Hong Kong"}, {data:"HM", label:"Heard & McDonald Islands"}, {data:"HN", label:"Honduras"}, {data:"HR", label:"Croatia"}, {data:"HT", label:"Haiti"}, {data:"HU", label:"Hungary"}, {data:"ID", label:"Indonesia"}, {data:"IE", label:"Ireland"}, {data:"IL", label:"Israel"}, {data:"IN", label:"India"}, {data:"IO", label:"British Indian Ocean Territory"}, {data:"IQ", label:"Iraq"}, {data:"IR", label:"Islamic Republic of Iran"}, {data:"IS", label:"Iceland"}, {data:"IT", label:"Italy"}, {data:"JM", label:"Jamaica"}, {data:"JO", label:"Jordan"}, {data:"JP", label:"Japan"}, {data:"KE", label:"Kenya"}, {data:"KG", label:"Kyrgyzstan"}, {data:"KH", label:"Cambodia"}, {data:"KI", label:"Kiribati"}, {data:"KM", label:"Comoros"}, {data:"KN", label:"St. Kitts and Nevis"}, {data:"KP", label:"Korea, Democratic People's Republic of"}, {data:"KR", label:"Korea, Republic of"}, {data:"KW", label:"Kuwait"}, {data:"KY", label:"Cayman Islands"}, {data:"KZ", label:"Kazakhstan"}, {data:"LA", label:"Lao People's Democratic Republic"}, {data:"LB", label:"Lebanon"}, {data:"LC", label:"Saint Lucia"}, {data:"LI", label:"Liechtenstein"}, {data:"LK", label:"Sri Lanka"}, {data:"LR", label:"Liberia"}, {data:"LS", label:"Lesotho"}, {data:"LT", label:"Lithuania"}, {data:"LU", label:"Luxembourg"}, {data:"LV", label:"Latvia"}, {data:"LY", label:"Libyan Arab Jamahiriya"}, {data:"MA", label:"Morocco"}, {data:"MC", label:"Monaco"}, {data:"MD", label:"Moldova, Republic of"}, {data:"MG", label:"Madagascar"}, {data:"MH", label:"Marshall Islands"}, {data:"ML", label:"Mali"}, {data:"MN", label:"Mongolia"}, {data:"MM", label:"Myanmar"}, {data:"MO", label:"Macau"}, {data:"MP", label:"Northern Mariana Islands"}, {data:"MQ", label:"Martinique"}, {data:"MR", label:"Mauritania"}, {data:"MS", label:"Monserrat"}, {data:"MT", label:"Malta"}, {data:"MU", label:"Mauritius"}, {data:"MV", label:"Maldives"}, {data:"MW", label:"Malawi"}, {data:"MX", label:"Mexico"}, {data:"MY", label:"Malaysia"}, {data:"MZ", label:"Mozambique"}, {data:"NA", label:"Namibia"}, {data:"NC", label:"New Caledonia"}, {data:"NE", label:"Niger"}, {data:"NF", label:"Norfolk Island"}, {data:"NG", label:"Nigeria"}, {data:"NI", label:"Nicaragua"}, {data:"NL", label:"Netherlands"}, {data:"NO", label:"Norway"}, {data:"NP", label:"Nepal"}, {data:"NR", label:"Nauru"}, {data:"NT", label:"Neutral Zone (no longer exists)"}, {data:"NU", label:"Niue"}, {data:"NZ", label:"New Zealand"}, {data:"OM", label:"Oman"}, {data:"PA", label:"Panama"}, {data:"PE", label:"Peru"}, {data:"PF", label:"French Polynesia"}, {data:"PG", label:"Papua New Guinea"}, {data:"PH", label:"Philippines"}, {data:"PK", label:"Pakistan"}, {data:"PL", label:"Poland"}, {data:"PM", label:"St. Pierre & Miquelon"}, {data:"PN", label:"Pitcairn"}, {data:"PR", label:"Puerto Rico"}, {data:"PT", label:"Portugal"}, {data:"PW", label:"Palau"}, {data:"PY", label:"Paraguay"}, {data:"QA", label:"Qatar"}, {data:"RE", label:"R&eacute;union"}, {data:"RO", label:"Romania"}, {data:"RU", label:"Russian Federation"}, {data:"RW", label:"Rwanda"}, {data:"SA", label:"Saudi Arabia"}, {data:"SB", label:"Solomon Islands"}, {data:"SC", label:"Seychelles"}, {data:"SD", label:"Sudan"}, {data:"SE", label:"Sweden"}, {data:"SG", label:"Singapore"}, {data:"SH", label:"St. Helena"}, {data:"SI", label:"Slovenia"}, {data:"SJ", label:"Svalbard & Jan Mayen Islands"}, {data:"SK", label:"Slovakia"}, {data:"SL", label:"Sierra Leone"}, {data:"SM", label:"San Marino"}, {data:"SN", label:"Senegal"}, {data:"SO", label:"Somalia"}, {data:"SR", label:"Suriname"}, {data:"ST", label:"Sao Tome & Principe"}, {data:"SU", label:"Union of Soviet Socialist Republics (no longer exists)"}, {data:"SV", label:"El Salvador"}, {data:"SY", label:"Syrian Arab Republic"}, {data:"SZ", label:"Swaziland"}, {data:"TC", label:"Turks & Caicos Islands"}, {data:"TD", label:"Chad"}, {data:"TF", label:"French Southern Territories"}, {data:"TG", label:"Togo"}, {data:"TH", label:"Thailand"}, {data:"TJ", label:"Tajikistan"}, {data:"TK", label:"Tokelau"}, {data:"TM", label:"Turkmenistan"}, {data:"TN", label:"Tunisia"}, {data:"TO", label:"Tonga"}, {data:"TP", label:"East Timor"}, {data:"TR", label:"Turkey"}, {data:"TT", label:"Trinidad & Tobago"}, {data:"TV", label:"Tuvalu"}, {data:"TW", label:"Taiwan, Province of China"}, {data:"TZ", label:"Tanzania, United Republic of"}, {data:"UA", label:"Ukraine"}, {data:"UG", label:"Uganda"}, {data:"UM", label:"United States Minor Outlying Islands"}, {data:"UY", label:"Uruguay"}, {data:"UZ", label:"Uzbekistan"}, {data:"VA", label:"Vatican City State (Holy See)"}, {data:"VC", label:"St. Vincent & the Grenadines"}, {data:"VE", label:"Venezuela"}, {data:"VG", label:"British Virgin Islands"}, {data:"VI", label:"United States Virgin Islands"}, {data:"VN", label:"Viet Nam"}, {data:"VU", label:"Vanuatu"}, {data:"WF", label:"Wallis & Futuna Islands"}, {data:"WS", label:"Samoa"}, {data:"YD", label:"Democratic Yemen (no longer exists)"}, {data:"YE", label:"Yemen"}, {data:"YT", label:"Mayotte"}, {data:"YU", label:"Yugoslavia"}, {data:"ZA", label:"South Africa"}, {data:"ZM", label:"Zambia"}, {data:"ZR", label:"Zaire"}, {data:"ZW", label:"Zimbabwe"}]; _local1.sortOn("label"); _local1.unshift({data:"US", label:"United States of America"}); _local1.unshift({data:"CA", label:"Canada"}); _local1.unshift({data:"--", label:"None Selected"}); return (_local1); } } }//package com.rawkins.games.dolphinOlympics
Section 15
//Controller (com.rawkins.games.dolphinOlympics.Controller) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import com.rawkins.sg.*; public class Controller extends KeyController { private var player:Player; public function Controller(_arg1:DisplayObject, _arg2:Player):void{ super(_arg1); this.player = _arg2; } override protected function fireEvent(_arg1:Array):void{ var _local2:KeyboardEvent; _local2 = new KeyboardEvent(_arg1[1]); _local2.keyCode = _arg1[2]; player.vz = _arg1[3]; player.angle = _arg1[4]; player.dispatchEvent(_local2); } private function onDash():void{ if (player.jumping){ player.maverick(); }; } override protected function checkKeys(_arg1:uint):void{ if (_arg1 == LEFT){ leftDown = false; player.endTurn("left"); } else { if (_arg1 == RIGHT){ rightDown = false; player.endTurn("right"); } else { if (_arg1 == UP){ upDown = false; player.accelerating = false; } else { if (_arg1 == DOWN){ downDown = false; player.slideReady = false; player.stopRoll(); }; }; }; }; } private function onHelicopter():void{ if (player.jumping){ player.helicopter(); }; } override protected function onDown():void{ if (!player.sliding){ player.slideReady = true; }; player.startRoll(); } override protected function onLeft():void{ if (!player.sliding){ player.startTurn("left"); }; } override protected function onKeyDown(_arg1:KeyboardEvent):void{ super.onKeyDown(_arg1); if ((((((_arg1.keyCode == UP)) && (player.sliding))) && (!(downDown)))){ player.popSlide(); }; } override protected function recordEvent(_arg1:KeyboardEvent):void{ var _local2:String; var _local3:uint; var _local4:Date; var _local5:Number; var _local6:Number; var _local7:Array; _local2 = _arg1.type; _local3 = _arg1.keyCode; _local4 = new Date(); _local5 = _local4.time; _local6 = (_local5 - startTime); _local7 = [_local6, _local2, _local3, player.vz, player.angle]; inputRecord.push(_local7); } override protected function onUp():void{ if (!downDown){ player.startAccelerating(); }; } override protected function onRight():void{ if (!player.sliding){ player.startTurn("right"); }; } } }//package com.rawkins.games.dolphinOlympics
Section 16
//Creature (com.rawkins.games.dolphinOlympics.Creature) package com.rawkins.games.dolphinOlympics { import com.rawkins.utils.*; public class Creature extends Collidable { protected var _scalar:Number;// = 0.65 protected var _vBoost:Number;// = 0 protected var _speed:Number;// = 10 protected var _vz:Number;// = 0 protected var _vy:Number;// = 0 protected var _vx:Number;// = 0 protected var dirAdjust:Number; protected var _chaseSpeed:Number;// = 14 protected var _angle:Number;// = 0 protected var _vMax:Number;// = 14 public function Creature():void{ var _local1:Number; _angle = 0; _vx = 0; _vy = 0; _vz = 0; _speed = 10; _chaseSpeed = 14; _vMax = 14; _vBoost = 0; _scalar = 0.65; super(); _local1 = MathSG.randNum(0, 2); if (_local1 == 0){ dirAdjust = Math.PI; } else { dirAdjust = 0; }; } public function get angle():Number{ return (_angle); } public function set chaseSpeed(_arg1:Number):void{ _chaseSpeed = _arg1; } public function get speed():Number{ return (_speed); } public function set speed(_arg1:Number):void{ _speed = _arg1; } public function set vBoost(_arg1:Number):void{ _vBoost = _arg1; } public function set angle(_arg1:Number):void{ this.rotation = MathSG.deg(_arg1); if ((((_arg1 > (Math.PI / 2))) && ((_arg1 < (Math.PI * 1.5))))){ this.scaleY = -(_scalar); } else { this.scaleY = _scalar; }; _angle = _arg1; } public function get vBoost():Number{ return (_vBoost); } public function get chaseSpeed():Number{ return (_chaseSpeed); } } }//package com.rawkins.games.dolphinOlympics
Section 17
//Firework (com.rawkins.games.dolphinOlympics.Firework) package com.rawkins.games.dolphinOlympics { import flash.display.*; import com.rawkins.fx.*; import flash.filters.*; public class Firework extends Particle { private var airFric:Number;// = 0.9 private var bmpd:BitmapData; private var bmp:Bitmap; private var glowColor:Number; public function Firework(_arg1:Number=0, _arg2:Number=0, _arg3:Number=100, _arg4:Number=0xFF00FF):void{ airFric = 0.9; super(_arg1, _arg2, _arg3); this.glowColor = _arg4; bounded = false; } override public function draw():void{ var _local1:GlowFilter; var _local2:Array; super.draw(); _local1 = new GlowFilter(glowColor); _local2 = [_local1]; this.filters = _local2; } override public function update():void{ this.vz = (this.vz * airFric); this.vy = (this.vy + (Constants.GRAVITY / 2)); super.update(); } } }//package com.rawkins.games.dolphinOlympics
Section 18
//Fish (com.rawkins.games.dolphinOlympics.Fish) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import flash.utils.*; import com.rawkins.utils.*; public class Fish extends Creature { protected var _turnSpeed:Number;// = 0.175 protected var _top:Number; protected var _target:MovieClip; protected var _playing:Boolean;// = true protected var _followRand:Number;// = 0 protected var _bottom:Number; protected var _loopTimer:Timer; protected var _jumping:Boolean;// = false protected var _depth:Number; public function Fish(_arg1:Number=0, _arg2:Number=0):void{ var _local3:Number; _jumping = false; _turnSpeed = 0.175; _followRand = 0; _playing = true; addFrameScript(11, frame12, 20, frame21, 25, frame26); super(); this.depth = this.y; this._bottom = _arg2; this._top = _arg1; _local3 = MathSG.randNum(1, 10); if (_local3 == 1){ this.angle = Math.PI; }; _activeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, endFollow); _speed = MathSG.randNum(6, 8); _loopTimer = new Timer(1000); scaleX = (scaleY = _scalar); } protected function jump():void{ _vy = (_vy + Constants.GRAVITY); this.x = (this.x + _vx); this.y = (this.y + _vy); this.angle = Math.atan2(_vy, _vx); } function frame12(){ gotoAndPlay("normal"); } function frame26(){ stop(); } protected function endFollow(_arg1:TimerEvent):void{ var _local2:Number; var _local3:Number; var _local4:Number; _local2 = (_target.x - this.x); _local3 = (_target.y - this.y); _local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3))); if (_local4 > 300){ deactivate(); } else { _activeTimer.reset(); _activeTimer.start(); }; } override public function deactivate():void{ super.deactivate(); gotoAndPlay("moving"); _vBoost = 0; target = null; this.filters = []; } function frame21(){ gotoAndPlay("active"); } protected function swim():void{ var _local1:Number; updateSpeed(); if (!activated){ if (this.y > _bottom){ if ((((_angle > (Math.PI / 2))) && ((_angle < (Math.PI * 1.5))))){ _angle = (_angle + 0.1); } else { _angle = (_angle - 0.1); }; } else { _local1 = MathSG.randNum(1, 10); if (_local1 == 1){ changeDir(); }; }; } else { follow(); }; this.x = (this.x + _vx); this.y = (this.y + _vy); } protected function changeDir():void{ angle = (angle + (0.1 * MathSG.randNum(-1, 2))); } public function get depth():Number{ return (_depth); } override public function update():void{ if (_playing){ if ((((x < 0)) || ((x > 640)))){ stop(); _playing = false; }; } else { if ((((x >= 0)) && ((x <= 640)))){ play(); _playing = true; }; }; if (!_jumping){ swim(); } else { jump(); }; } override public function activate(_arg1:MovieClip):String{ if (!_jumping){ if (_arg1.vBoost != null){ _vBoost = (_vBoost + (_arg1.vBoost * 0.75)); }; _activeTimer.start(); this.target = _arg1; gotoAndPlay("active"); this.filters = _arg1.filters; }; return ("fish"); } protected function updateSpeed():void{ var _local1:Number; if (!activated){ _vx = (Math.cos(_angle) * (speed + vBoost)); _vy = (Math.sin(_angle) * (speed + vBoost)); } else { _local1 = (chaseSpeed + vBoost); if (_local1 > target.vz){ _local1 = (target.vz + 0.5); }; if (_local1 <= 2){ _local1 = 7; }; _vx = (Math.cos(_angle) * _local1); _vy = (Math.sin(_angle) * _local1); if (chaseSpeed > _vMax){ chaseSpeed = (chaseSpeed - Constants.WATER_FRICTION); }; }; } public function set target(_arg1:MovieClip){ _target = _arg1; } public function get jumping(){ return (_jumping); } public function get target():MovieClip{ return (_target); } public function set depth(_arg1:Number):void{ _depth = _arg1; } public function endJump():void{ _vy = speed; this._jumping = false; gotoAndPlay("moving"); } public function startJump():void{ deactivate(); _jumping = true; gotoAndPlay("jumping"); } protected function follow():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:*; var _local5:*; _local1 = (_target.x - this.x); _local2 = (_target.y - this.y); _local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2))); _local4 = Math.atan2(_local2, _local1); _local5 = (_local4 - angle); if ((((_local5 > Math.PI)) || ((_local5 < -(Math.PI))))){ if (angle > 0){ angle = ((-2 * Math.PI) + angle); } else { angle = ((Math.PI * 2) + angle); }; return; }; angle = (angle + ((_local5 * _turnSpeed) + (Math.sin(_followRand) / 10))); _followRand = (_followRand + 0.01); } } }//package com.rawkins.games.dolphinOlympics
Section 19
//Freestyle (com.rawkins.games.dolphinOlympics.Freestyle) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import flash.geom.*; import ascb.util.*; import com.rawkins.fx.*; import flash.text.*; import com.senocular.drawing.*; import flash.utils.*; import com.rawkins.utils.*; import flash.ui.*; public class Freestyle extends Game { private var entryAng:Number; private var biggestCombo:Number; private var slideTotal:Number;// = 0 private var lastFlip:String; private var carouselReady:Boolean;// = false private var longestStarslide:Number; private var restauranted:Boolean;// = false private var watchingSlide:Boolean;// = false private var nebulad:Boolean;// = false private var biggestSchool:Number; protected var text:Sprite; private var fireworkTimer:Timer; protected var scoreSubmit:ScoreSubmitForm; protected var bc_txt:TextField; private var neptuned:Boolean;// = false private var celebrated:Boolean;// = false private var hailed:Boolean;// = false private var combo:Array; private var _score:int; private var flips:uint; private var saturned:Boolean;// = false private var multiplier:Number; private var plutoed:Boolean;// = false protected var anim:Anim; private var biggestBoost:Number; private var lastSlideTime:Number;// = 0 private var marsed:Boolean;// = false private var uranused:Boolean;// = false private var lastTrick:Trick; private var comboGap:uint; private var gameTimer:Timer; private var sinceJump:uint;// = 0 private var totalDegs:Number; private var jupitered:Boolean;// = false private var scoring:Boolean; private var waterDegs:Number; private var ticker:uint; private var numFormat:NumberFormat; protected var bc_tf:TextFormat; protected var broadcastBase:Number; private var endID:Number; private var _gameTime:uint; private var endCarousel:Boolean;// = false private var mooned:Boolean;// = false private var lastAng:Number; private var tricks:Object; protected var scoreBoard:Scoreboard; private var heightTricks:Array; private var slideSecs:Number; protected var swLoader:Loader; private var jumpTotal:Number; private var scoreTimer:Timer; private var exitAng:Number; private var startCarousel:Boolean;// = false protected var labels:Sprite; public function Freestyle(_arg1:SimpleGame, _arg2:Level):void{ watchingSlide = false; lastSlideTime = 0; sinceJump = 0; comboGap = Constants.FRAMERATE; slideTotal = 0; celebrated = false; mooned = false; hailed = false; marsed = false; nebulad = false; jupitered = false; saturned = false; neptuned = false; uranused = false; plutoed = false; restauranted = false; carouselReady = false; startCarousel = false; endCarousel = false; super(_arg1, _arg2); fireworkTimer = new Timer(100, 5); fireworkTimer.addEventListener(TimerEvent.TIMER, onFirework); } override protected function launchPlayer():void{ var _local1:Number; var _local2:String; var _local3:String; var _local4:SchoolBell; super.launchPlayer(); sinceJump = 0; if (((((controller.leftDown) || (controller.rightDown))) && (!(carouselReady)))){ carouselReady = true; }; if (carouselReady){ carouselReady = false; startCarousel = true; }; if (player.betweenJumps){ _local1 = player.angle; _local2 = ""; _local3 = ""; if ((((_local1 > 90)) && ((_local1 < 270)))){ _local2 = "left"; } else { _local2 = "right"; }; if ((((entryAng > 90)) && ((entryAng < 270)))){ _local3 = "left"; } else { _local3 = "right"; }; if (_local2 != _local3){ addToCombo(tricks.reversal); } else { if (waterDegs >= 200){ addToCombo(tricks.wraparound); }; }; }; player.betweenJumps = false; if (activeCreatures.length >= 7){ _local4 = new SchoolBell(); _local4.play(); addToCombo(tricks.schoolsOut); }; for each (c in activeCreatures) { addToCombo(tricks.schooled); player.vBoost = (player.vBoost + 0.25); }; } private function onBoardClosed(_arg1:Event):void{ if (over){ endMenu.alpha = 0; addChild(endMenu); endMenu.fadeIn(); }; } override protected function landPlayer():void{ super.landPlayer(); player.betweenJumps = true; this.entryAng = player.angle; this.lastAng = this.entryAng; this.waterDegs = 0; lastFlip = ""; watchingSlide = false; resetHeightTricks(); swimming = true; if (over){ endGame(); }; } private function checkHeightTricks():void{ var _local1:HeightTrick; for each (_local1 in heightTricks) { if (((!(_local1.done)) && ((level.bg.y > -(_local1.height))))){ _local1.done = true; addToCombo(_local1); }; }; } private function broadcast(_arg1:String){ var _local2:Number; var _local3:Number; var _local4:Number; if (bc_txt.text != ""){ _arg1 = (" + " + _arg1); }; _local2 = bc_txt.textHeight; bc_txt.appendText(_arg1); bc_txt.setTextFormat(bc_tf); if (_local2 > 0){ _local3 = bc_txt.textHeight; _local4 = (_local3 - _local2); if (_local4 > 0){ bc_txt.y = (bc_txt.y - _local4); }; }; } override protected function onKeyDown(_arg1:KeyboardEvent):void{ super.onKeyDown(_arg1); if ((((_arg1.keyCode == controller.LEFT)) || ((((_arg1.keyCode == controller.RIGHT)) && (!(carouselReady)))))){ carouselReady = true; }; } protected function onRing(_arg1:Event):void{ var _local2:WaterPowerUp; var _local3:AirPowerUp; if (!player.jumping){ player.vz = (player.vz + 12.5); player.betweenJumps = true; _local2 = new WaterPowerUp(); _local2.play(); } else { player.vy = (player.vy - 17.5); _local3 = new AirPowerUp(); _local3.play(); }; for each (c in activeCreatures) { if (c.chaseSpeed){ c.chaseSpeed = (c.chaseSpeed + 12.5); c.vBoost = (c.vBoost + 0.5); }; }; player.vBoost = (player.vBoost + 0.5); sinceJump = 0; player.speedTrail(); gameTime++; addToCombo(tricks.extension); } override public function update():void{ var _local1:Number; if (((!(paused)) && (!(over)))){ checkPaths(); if (player.y < level.surfaceHeight){ player.swimming = false; if (((!(player.jumping)) && (!(player.sliding)))){ launchPlayer(); } else { if (player.sliding){ continueSlide(); watchSlide(); } else { if (player.jumping){ continueJump(); watchJump(); }; }; }; } else { if (player.jumping){ landPlayer(); } else { if (player.y > level.bottom){ crashPlayer(); } else { if (player.hitFloor){ continueCrash(); } else { applyFriction(); if (player.betweenJumps){ _local1 = Math.abs((player.angle - lastAng)); if (_local1 > 20){ _local1 = 20; }; waterDegs = (waterDegs + _local1); lastAng = player.angle; }; }; }; }; }; ticker++; if (ticker >= Constants.FRAMERATE){ ticker = 0; tick(); }; if (player.betweenJumps){ if (((!(player.rolling)) && (!(player.sliding)))){ sinceJump++; }; if (sinceJump > comboGap){ sinceJump = 0; endCombo(); }; }; if (!player.sliding){ scroll((player.vx + player.crash_vx), (player.vy + player.crash_vy)); }; checkHeightTricks(); updateObjs(); player.update(); }; } private function onSubmitClick(_arg1:MouseEvent):void{ if (_arg1.target.name == "playAgain_btn"){ removeChild(scoreSubmit); sg.startGame(null); }; } override public function init():void{ var _local1:Trick; super.init(); tricks = {frontFlip:new Trick("Front Flip", 500), backFlip:new Trick("Back Flip", 500), niceEntry:new Trick("Nice Entry", 50), frontRewind:new Trick("Frontside Rewind", 750), backRewind:new Trick("Backside Rewind", 750), tailslide:new Trick("Tailslide", 150), starslide:new Trick("Starslide", 1500), corkscrew:new Trick("Corkscrew", 150), reversal:new Trick("Reversal", 300), wraparound:new Trick("Wraparound", 600), carousel:new Trick("Carnival", 1500), schooled:new Trick("Schooled", 150), celebration:new HeightTrick("Firecracker!", 1000, level.celebHeight, onCelebration), moon:new HeightTrick("Apollo 18!", 2500, level.moonHeight), mars:new HeightTrick("Mission to Mars!", 5000, level.marsHeight), nebulous:new HeightTrick("Nebulous!", 10000, level.nebulaHeight), jupiter:new HeightTrick("Wandering Star!", 20000, level.jupiterHeight), saturn:new HeightTrick("Ringer!", 50000, level.saturnHeight), neptune:new HeightTrick("Wizard's Eye!", 500000, level.neptuneHeight), uranus:new HeightTrick("Passing Gas!", 250000, level.uranusHeight), pluto:new HeightTrick("New Horizons!", 750000, level.plutoHeight), restaurant:new HeightTrick("So long and thanks for all the flips!", 1000000, level.endHeight), extension:new Trick("Extension", 250), schoolsOut:new Trick("School's Out!", 15000)}; heightTricks = new Array(); for each (_local1 in tricks) { if ((_local1 is HeightTrick)){ heightTricks.push(_local1); }; }; player.addEventListener("Roll", onRoll); stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp); anim = new Anim(); } override protected function nice_entry(_arg1:Boolean):void{ if (_arg1){ player.vBoost = (player.vBoost + (2 + (combo.length / 3))); addToCombo(tricks.niceEntry); if (startCarousel){ addToCombo(tricks.carousel); carouselReady = true; } else { if (carouselReady){ carouselReady = false; startCarousel = true; }; }; } else { player.vBoost = 0; endCombo(); }; } public function set score(_arg1:int):void{ text.score_txt.text = numFormat.format(_arg1); _score = _arg1; } override public function exit():void{ level.removeEventListener(Ring.RING_HIT, onRing); super.exit(); } private function clearBroadcast():void{ var _local1:TextField; bc_txt.text = ""; bc_txt.y = broadcastBase; _local1 = text.liveScore_txt; _local1.text = ""; } private function onFirework(_arg1:TimerEvent){ level.fireworks(320, (240 - level.bg.y), 1, player.vx, player.vy); } private function endCombo():void{ var _local1:int; var _local2:uint; jumpTotal = (jumpTotal * multiplier); score = (score + Math.round(jumpTotal)); _local1 = 0; _local2 = 0; while (_local2 < combo.length) { _local1 = (_local1 + combo[_local2].count); combo[_local2].count = 0; _local2++; }; if (_local1 > biggestCombo){ biggestCombo = _local1; }; combo = new Array(); clearBroadcast(); (lastFlip == ""); flips = 0; jumpTotal = 0; player.spinDegs = 0; totalDegs = 0; multiplier = 0; player.betweenJumps = false; watchingSlide = false; scoring = false; for each (trick in tricks) { trick.count = 0; }; } override protected function buildUI():void{ var _local1:SimpleButton; var _local2:SimpleButton; super.buildUI(); _local1 = new RestartButton(); _local1.name = "Restart Game"; menu.addButton(_local1, sg.startGame); _local2 = new ScoreButton(); _local2.name = "View Scores"; menu.addButton(_local2, showScores); numFormat = new NumberFormat(); labels = new FreestyleUI_labels(); labels.x = (labels.x + 10); labels.y = (473 - labels.height); labels.cacheAsBitmap = true; ui.addChild(labels); text = new FreestyleUI_text(); bc_txt = new TextField(); bc_txt.width = 540; bc_txt.height = 36; bc_txt.wordWrap = true; bc_txt.autoSize = TextFieldAutoSize.CENTER; bc_txt.antiAliasType = "advanced"; bc_txt.embedFonts = true; bc_tf = new TextFormat("GrilledCheese BTN", null, 0xFFFFFF); bc_tf.size = 14; bc_tf.align = "center"; bc_txt.x = 50; bc_txt.y = 381; addChild(bc_txt); broadcastBase = bc_txt.y; ui.addChild(text); scoreSubmit = new ScoreSubmitForm(); scoreSubmit.x = (scoreSubmit.x + 50); scoreSubmit.y = (scoreSubmit.y + 25); scoreSubmit.addEventListener("Score_Submitted", onScoreSubmit); scoreSubmit.addEventListener(MouseEvent.CLICK, onSubmitClick); scoreBoard = new Scoreboard(sg); scoreBoard.x = (scoreBoard.x + 50); scoreBoard.y = (scoreBoard.y + 25); } protected function showScores(_arg1:Event):void{ scoreBoard.alpha = 0; addChild(scoreBoard); scoreBoard.loadMyScores(); scoreBoard.fadeIn(); scoreBoard.addEventListener("Closed", onBoardClosed); } override protected function endSlide(_arg1:Event):void{ super.endSlide(_arg1); } protected function tick():void{ gameTime--; if (gameTime <= 0){ ticker = Constants.FRAMERATE; if (player.swimming){ endGame(); }; }; } public function watchJump(){ var _local1:Number; var _local2:uint; var _local3:Trick; _local1 = player.spinDegs; _local2 = player.rollCount; _local3 = null; if (_local1 >= 360){ if (lastFlip == "Back Flip"){ _local3 = tricks.backRewind; lastFlip = ""; } else { _local3 = tricks.frontFlip; lastFlip = "Front Flip"; }; } else { if (_local1 <= -360){ if (lastFlip == "Front Flip"){ _local3 = tricks.frontRewind; lastFlip = ""; } else { _local3 = tricks.backFlip; lastFlip = "Back Flip"; }; }; }; if (_local3 != null){ addToCombo(_local3); player.spinDegs = 0; }; } public function get gameTime():int{ return (_gameTime); } protected function onScoreSubmit(_arg1:Event):void{ removeChild(scoreSubmit); showScores(_arg1); } override public function pause():void{ super.pause(); if (paused){ level.stopRings(); } else { level.startRings(); }; } public function set liveScore(_arg1:int):void{ var _local2:String; _local2 = ""; if (_arg1 != 0){ _local2 = numFormat.format(_arg1); if (multiplier > 1){ _local2 = (_local2 + (" x " + MathSG.roundTo(multiplier, 2))); }; text.liveScore_txt.text = _local2; }; } public function watchSlide():void{ if (!watchingSlide){ watchingSlide = true; if (onWater){ addToCombo(tricks.tailslide); } else { addToCombo(tricks.starslide); }; }; if (onWater){ jumpTotal = (jumpTotal + Math.floor((player.slideTime * 2))); } else { jumpTotal = (jumpTotal + Math.floor((player.slideTime * 3.5))); }; liveScore = jumpTotal; } private function endKeyDown(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ENTER){ removeEventListener(KeyboardEvent.KEY_DOWN, endKeyDown); sg.startGame(); }; } override protected function startSlide():void{ super.startSlide(); slideTotal = 0; sinceJump = 0; player.betweenJumps = false; lastFlip = ""; level.moveBG(10); } private function resetHeightTricks():void{ var _local1:HeightTrick; for each (_local1 in heightTricks) { if (_local1.done){ _local1.done = false; }; }; } override protected function endTimerComplete(_arg1:Event):void{ endCombo(); clearBroadcast(); scoreSubmit.alpha = 0; addChild(scoreSubmit); scoreSubmit.longest_jump = MathSG.roundTo((longest_jump / 50), 2); scoreSubmit.highest_jump = MathSG.roundTo((highest_jump / 50), 2); scoreSubmit.biggest_splash = MathSG.roundTo((biggest_splash / 4), 2); scoreSubmit.longest_tailslide = MathSG.roundTo((longest_tailslide / 50), 2); scoreSubmit.highest_speed = MathSG.roundTo(((highest_speed * 31) / 50), 2); scoreSubmit.biggest_combo = biggestCombo; scoreSubmit.final_score = score; scoreSubmit.fadeIn(); } public function get score():int{ return (_score); } override protected function onMenuButtonClick(_arg1:MouseEvent):void{ if (scoreBoard.parent != null){ removeChild(scoreBoard); addChild(menu); } else { super.onMenuButtonClick(_arg1); }; } protected function onKeyUp(_arg1:KeyboardEvent):void{ if ((((_arg1.keyCode == controller.LEFT)) || ((_arg1.keyCode == controller.RIGHT)))){ startCarousel = false; carouselReady = false; }; } override public function enter():void{ super.enter(); if (paused){ pause(); }; level.addEventListener(Ring.RING_HIT, onRing); } private function onRoll(_arg1:Event):void{ addToCombo(tricks.corkscrew); } override protected function startGame():void{ super.startGame(); over = false; score = 0; liveScore = 0; multiplier = 0; gameTime = 120; ticker = 0; flips = 0; jumpTotal = 0; player.spinDegs = 0; totalDegs = 0; lastTrick = new Trick(""); combo = new Array(); biggestCombo = 0; longest_jump = 0; highest_jump = 0; biggest_splash = 0; longest_tailslide = 0; highest_speed = 0; endTimer.reset(); if (menu.parent != null){ removeChild(menu); }; clearBroadcast(); if (scoreBoard.parent != null){ scoreBoard.parent.removeChild(scoreBoard); }; if (scoreSubmit.parent != null){ scoreSubmit.parent.removeChild(scoreSubmit); }; for each (trick in tricks) { trick.count = 0; }; level.startRings(); } protected function onCelebration():void{ var _local1:FireworkSound; fireworkTimer.reset(); fireworkTimer.start(); _local1 = new FireworkSound(); _local1.play(); } private function findCollisionPoint(_arg1:Path):Number{ var _local2:Number; var _local3:Point; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; _local2 = 0; while (_local2 < 1) { _local3 = _arg1.pointAt(_local2); _local4 = player.x; _local5 = (player.x + player.width); _local6 = player.y; _local7 = (player.y + player.height); if ((((((((_local3.x > _local4)) && ((_local3.x < _local5)))) && ((_local3.y + _local6)))) && ((_local3.y < _local7)))){ break; }; _local2 = (_local2 + 0.025); }; return (_local2); } public function set gameTime(_arg1:int):void{ if (_arg1 >= 0){ text.time_txt.text = DateFormat.formatSeconds(_arg1).substr(1); }; _gameTime = _arg1; } private function addToCombo(_arg1:Trick):void{ var _local2:Boolean; var _local3:uint; _local2 = false; _local3 = 0; while (_local3 < combo.length) { if (combo[_local3].name == _arg1.name){ _local2 = true; }; _local3++; }; if (!_local2){ combo.push(_arg1); }; _arg1.count++; jumpTotal = (jumpTotal + _arg1.value); multiplier = (multiplier + (1 / _arg1.count)); clearBroadcast(); _local3 = 0; while (_local3 < combo.length) { broadcast(combo[_local3].name); _local3++; }; liveScore = jumpTotal; lastTrick = _arg1; if (_arg1.action != null){ _arg1.action(); }; } } }//package com.rawkins.games.dolphinOlympics
Section 20
//Freeswim (com.rawkins.games.dolphinOlympics.Freeswim) package com.rawkins.games.dolphinOlympics { import ascb.util.*; public class Freeswim extends Freestyle { protected var numFormat:NumberFormat; public function Freeswim(_arg1:SimpleGame, _arg2:Level):void{ super(_arg1, _arg2); } override public function init():void{ super.init(); } override protected function buildUI():void{ super.buildUI(); menu.removeItem("Restart Game"); menu.removeItem("View Scores"); ui.removeChild(labels); ui.removeChild(text); removeChild(bc_txt); } override protected function tick():void{ } } }//package com.rawkins.games.dolphinOlympics
Section 21
//Game (com.rawkins.games.dolphinOlympics.Game) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.utils.*; import com.rawkins.utils.*; import com.gamingyourway.fps.*; import com.rawkins.sg.*; public class Game extends MainState { protected var trail:Array; protected var biggest_combo:Number;// = 0 protected var slideTimer:Number;// = 0 protected var slideBase:Number; protected var playing:Boolean;// = false protected var waterSound:Sound; protected var windMAX:Number;// = 7 protected var windAX:Number;// = 0 protected var records:Array; protected var level_bmp:Bitmap; protected var windAY:Number;// = 0 protected var pathPoint:Number;// = 0 protected var starting:Boolean;// = false protected var jumpSoundChannel:SoundChannel; protected var jump_vx:Number; protected var jump_vy:Number; protected var onWater:Boolean;// = false protected var fx_bmp:Bitmap; protected var lastPoint:Point; protected var ui:Sprite; protected var windUI:Sprite; protected var onPath:Boolean;// = false protected var muteButton:MovieClip; protected var windAng:Number; protected var slide_distance:Number;// = 0 protected var windVX:Number;// = 0 protected var windVY:Number;// = 0 protected var fx_bmpd:BitmapData; protected var over:Boolean;// = false protected var jump_xTotal:Number;// = 0 protected var player:Player; protected var splashSound:Sound; protected var longest_tailslide:Number;// = 0 protected var inSpace:Boolean;// = false protected var trail1:BitmapData; protected var highest_jump:Number;// = 0 protected var highest_speed:Number;// = 0 protected var trail3:BitmapData; protected var windStr:Number; protected var trail2:BitmapData; protected var splashSoundChannel:SoundChannel; protected var spaceSoundChannel:SoundChannel; protected var endTimer:Timer; protected var currentPath:SlidePath; protected var slideSpeed:Number; protected var trailCounter:int;// = 1 protected var text_bmpd:BitmapData; protected var level_bmpd:BitmapData; protected var landingInfo:Object; protected var swimSound:SoundLoop; protected var muted:Boolean;// = false protected var menuButton:SimpleButton; protected var text_bmp:Bitmap; protected var landingTimer:Number;// = 0 protected var checkBuff:int;// = 0 protected var jump_yTotal:Number;// = 0 protected var jumpSound:SoundLoop; protected var level:Level; protected var seashore:Sound; protected var text_buffer:BitmapData; protected var thisPoint:Point; protected var controller:Controller; protected var trailStarted:Boolean;// = false protected var spaceSound:SoundLoop; protected var activeCreatures:Array; protected var jumpTimer:Number;// = 0 protected var swimSoundChannel:SoundChannel; protected var dismountTimer:Timer; protected var longest_jump:Number;// = 0 protected var crashTimer:Number;// = 0 protected var biggest_splash:Number;// = 0 protected var counter:Debug_fps; public function Game(_arg1:SimpleGame, _arg2:Level):void{ windVX = 0; windVY = 0; windAX = 0; windAY = 0; windMAX = 7; jumpTimer = 0; landingTimer = 0; crashTimer = 0; slideTimer = 0; jump_xTotal = 0; jump_yTotal = 0; slide_distance = 0; onPath = false; pathPoint = 0; onWater = false; longest_jump = 0; highest_jump = 0; biggest_splash = 0; longest_tailslide = 0; highest_speed = 0; biggest_combo = 0; records = [longest_jump, highest_jump, biggest_splash, longest_tailslide, highest_speed, biggest_combo]; playing = false; over = false; starting = false; inSpace = false; trailCounter = 1; trailStarted = false; checkBuff = 0; muted = false; super(_arg1); setLevel(_arg2); } protected function checkSpeed(_arg1:Event):void{ var _local2:Number; _local2 = (player.vz + player.vBoost); if (_local2 > highest_speed){ highest_speed = _local2; }; } public function setLevel(_arg1:Level):void{ this.level = _arg1; } protected function endTimerComplete(_arg1:Event):void{ endMenu.alpha = 0; addChild(endMenu); endMenu.fadeIn(); } protected function launchPlayer():void{ var _local1:Number; var _local2:Number; _local1 = player.vx; _local2 = player.angle; swimSound.pause(); jumpSoundChannel = jumpSound.resume(); player.jumping = true; this.jump_xTotal = 0; this.jump_yTotal = 0; if (player.crash_vx != 0){ player.vx = (player.vx + player.crash_vx); player.crash_vx = 0; }; if (player.crash_vy != 0){ player.vy = (player.vy + player.crash_vy); player.crash_vy = 0; }; level.splash(320, 0, player.vz); splashSound.play(2000); } protected function startSlide():void{ var _local1:Number; var _local2:DolphinChirp1; var _local3:SoundChannel; var _local4:SpaceDolphin; var _local5:SoundChannel; thisPoint = currentPath.path.pointAt(pathPoint); _local1 = MathSG.normalize(((currentPath.path.angleAt(pathPoint) * 180) / Math.PI)); if ((((_local1 > 90)) && ((_local1 < 270)))){ player.vx = -(player.vx); }; player.angle = (_local1 - 90); slideSpeed = (1 / (currentPath.length / player.vx)); slideBase = level.bg.y; if (slideBase <= 300){ onWater = true; }; if (player.vx > 0){ player.startSlide("right", currentPath); } else { player.startSlide("left", currentPath); }; if (!inSpace){ _local2 = new DolphinChirp1(); _local3 = _local2.play(); _local3.soundTransform = new SoundTransform(0.7); swimSound.pause(); jumpSoundChannel = jumpSound.resume(); } else { _local4 = new SpaceDolphin(); _local5 = _local4.play(); _local5.soundTransform = new SoundTransform(0.8); }; } protected function applyFriction():void{ var _local1:Number; var _local2:*; _local1 = player.vz; if (_local1 > 1){ player.vz = (player.vz - WATER_FRICTION); } else { if (_local1 < -1){ player.vz = (player.vz + WATER_FRICTION); } else { if (level.bottom > 275){ player.vy = GRAVITY; } else { player.vy = 0; }; }; }; _local2 = player.crash_vz; if (_local2 > WATER_FRICTION){ player.crash_vz = (player.crash_vz - WATER_FRICTION); } else { if (_local2 < -(WATER_FRICTION)){ player.crash_vz = (player.crash_vz + WATER_FRICTION); } else { if ((((_local2 < _local1)) && (!((_local2 == 0))))){ player.vz = (_local1 + _local2); player.crash_vz = 0; player.crash_angle = player.angle; }; }; }; } protected function onMute(_arg1:MouseEvent):void{ if (!muted){ SoundMixer.soundTransform = new SoundTransform(0); muted = true; muteButton.gotoAndStop("off"); } else { muted = false; SoundMixer.soundTransform = new SoundTransform(1); muteButton.gotoAndStop("on"); }; } protected function landPlayer():void{ var _local1:Number; var _local2:Number; var _local3:*; var _local4:Number; var _local5:Boolean; var _local6:*; var _local7:Number; var _local8:SoundChannel; var _local9:Sound; jump_xTotal = Math.abs(jump_xTotal); if (jump_xTotal > longest_jump){ longest_jump = jump_xTotal; }; if (jump_yTotal > highest_jump){ highest_jump = jump_yTotal; }; jump_yTotal = 0; jump_xTotal = 0; _local1 = (player.vx + windVX); _local2 = MathSG.deg(Math.atan2((player.vy + windVY), Math.abs(_local1))); if (_local1 < 0){ _local2 = (180 - _local2); }; _local3 = player.angle; if (_local3 > (_local2 + 180)){ _local3 = (_local3 - 360); }; _local4 = Math.abs((_local3 - _local2)); _local5 = false; if (_local4 > 90){ _local4 = (180 - _local4); _local5 = true; }; _local6 = (((player.vy * _local4) / 100) * 2.5); if (_local6 > biggest_splash){ biggest_splash = _local6; }; level.splash(320, 0, _local6); if (((_local5) || ((_local4 > 28)))){ _local7 = (_local4 / 100); player.crash_angle = _local2; player.crash_vx = (player.vx * (1 - _local7)); player.vx = 0; player.crash_vy = (player.vy * (1 - _local7)); if (_local5){ player.crash_vx = (player.crash_vx / 2); player.crash_vy = (player.crash_vy / 2); }; player.vy = 0; player.slideBoost = 0; nice_entry(false); _local8 = splashSound.play(); _local8.soundTransform = new SoundTransform(0.5); } else { if (jumpTimer > 40){ nice_entry(true); _local9 = new AirPowerUp(); _local9.play(); }; }; jumpTimer = 0; windVX = (windVY = 0); player.land(); jumpSoundChannel = jumpSound.pause(); swimSoundChannel = swimSound.resume(); if (controller.upDown){ player.startAccelerating(); }; } protected function drawText(_arg1:TextField):void{ } protected function onMenuButtonClick(_arg1:MouseEvent):void{ if (sg.helpScreen.parent != null){ sg.removeChild(sg.helpScreen); } else { pause(); }; } protected function updateObjs():void{ var _local1:Array; var _local2:Array; var _local3:Array; var _local4:int; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:int; var _local9:Collidable; _local1 = level.collidables; _local2 = level.fish; _local3 = level.birds; for each (_local9 in _local1) { _local5 = _local9.y; if ((((_local5 < 480)) || ((_local5 > 0)))){ _local9.update(); _local6 = (_local9.hitZone.height / 2); if (((((((!(player.sliding)) && (!(_local9.activated)))) && ((_local5 > (240 - _local6))))) && ((_local5 < (240 + _local6))))){ _local7 = _local9.x; if ((((_local7 > (320 - _local6))) && ((_local7 < (320 + _local6))))){ _local9.activate(player); _local8 = _local9.name.indexOf("ring"); if ((((_local8 == -1)) && (!(player.jumping)))){ activeCreatures.push(_local9); }; }; }; }; }; for each (fish in _local2) { _local5 = fish.y; if ((((_local5 < level.bg.y)) && (!(fish.jumping)))){ fish.startJump(); } else { if ((((_local5 > level.bg.y)) && (fish.jumping))){ fish.endJump(); }; }; }; _local4 = 0; while (_local4 < activeCreatures.length) { _local9 = activeCreatures[_local4]; if (!_local9.activated){ activeCreatures.splice(_local4, 1); }; _local4++; }; } protected function checkPaths():void{ var _local1:Array; var _local2:Boolean; var _local3:Number; var _local4:Number; var _local5:*; var _local6:*; var _local7:int; var _local8:Number; var _local9:Number; if (((((player.slideReady) && (!(player.sliding)))) && ((player.vy < 50)))){ _local1 = level.paths; _local2 = false; for each (path in _local1) { _local3 = path.x; _local4 = (level.bg.y + path.y); if ((((level.bg.y <= 400)) && ((player.vy > 0)))){ break; }; if ((((((((_local3 >= -(path.width))) && ((_local3 < (640 + path.width))))) && ((_local4 > -(path.height))))) && ((_local4 < (path.height + 480))))){ _local5 = player.vz; _local6 = player.angle; _local7 = 0; while (_local7 < _local5) { _local8 = ((Math.cos(MathSG.rad(_local6)) * _local7) + 320); _local9 = ((Math.sin(MathSG.rad(_local6)) * _local7) + 240); if (path.hitTestPoint(_local8, _local9, true)){ _local2 = true; path.x = (path.x - (_local8 - 320)); level.moveBG(-((_local9 - 240))); break; }; _local7 = (_local7 + 15); }; }; if (((((_local2) && ((Math.abs(player.vx) > 2)))) && (!(dismountTimer.running)))){ pathPoint = path.findCollisionPoint(player); currentPath = path; startSlide(); break; }; }; }; } override public function update():void{ if (((!(super.paused)) && (!(over)))){ checkPaths(); if (player.y < level.surfaceHeight){ player.swimming = false; if (((!(player.jumping)) && (!(player.sliding)))){ launchPlayer(); } else { if (player.sliding){ continueSlide(); } else { if (player.jumping){ continueJump(); }; }; }; } else { if (player.jumping){ landPlayer(); } else { if (player.y > level.bottom){ crashPlayer(); } else { if (player.hitFloor){ continueCrash(); } else { applyFriction(); }; }; }; }; if (!player.sliding){ scroll((player.vx + player.crash_vx), (player.vy + player.crash_vy)); }; updateObjs(); player.update(); }; } protected function scroll(_arg1:Number, _arg2:Number):void{ level.scrollLevel(_arg1, _arg2); if (!inSpace){ if (level.bg.y > -(level.moonHeight)){ inSpace = true; jumpSound.fadeOut(); spaceSound.fadeIn(); }; } else { if (level.bg.y < -(level.moonHeight)){ inSpace = false; jumpSound.fadeIn(); spaceSound.fadeOut(); }; }; } override public function enter():void{ super.enter(); level.resume(); player.particleManager = level.particleManager; swimSoundChannel = swimSound.play(); startGame(); } override public function init():void{ super.init(); addChildAt(level, 0); this.player = sg.player; player.stop(); GRAVITY = Constants.GRAVITY; WATER_FRICTION = Constants.WATER_FRICTION; controller = new Controller(stage, player); controller.enable(); controller.enableCombos(); dismountTimer = new Timer(500, 1); player.addEventListener("EndSlide", endSlide); player.addEventListener("VelocityChanged", checkSpeed); activeCreatures = new Array(); waterSound = new Underwater(); swimSound = new SoundLoop(waterSound, 0.4); seashore = new Seashore(); jumpSound = new SoundLoop(seashore, 0.4); spaceSound = new SoundLoop(new SpaceLoop1(), 0.5); splashSound = new SplashSound(); buildUI(); endTimer = new Timer(1000, 1); endTimer.addEventListener(TimerEvent.TIMER_COMPLETE, endTimerComplete); } override public function exit():void{ level.pause(); SoundMixer.stopAll(); super.exit(); } private function playTailSplash(_arg1:Event):void{ splashSoundChannel = splashSound.play(1000); } protected function nice_entry(_arg1:Boolean):void{ if (_arg1){ player.vBoost = (player.vBoost + 2); } else { player.vBoost = 0; }; } protected function continueSlide():void{ var _local1:Number; var _local2:Number; player.slide(); slide_distance = (slide_distance + player.vx); _local1 = currentPath.friction; if (player.vx > 1){ player.vx = (player.vx - _local1); } else { if (player.vx < -1){ player.vx = (player.vx + _local1); } else { player.vx = 0; }; }; slideSpeed = (1 / (currentPath.length / player.vx)); _local2 = MathSG.normalize(((currentPath.path.angleAt(pathPoint) * 180) / Math.PI)); player.angle = (_local2 - 90); if (onWater){ level.scrollLevel(player.vx, 0); slideTimer++; if (slideTimer == 3){ if (onWater){ level.splash(320, 0, player.vx, true); }; slideTimer = 0; }; } else { lastPoint = thisPoint; thisPoint = currentPath.path.pointAt(pathPoint); level.scrollLevel((thisPoint.x - lastPoint.x), (thisPoint.y - lastPoint.y)); pathPoint = (pathPoint + slideSpeed); }; if ((((((((((player.vx < 1)) && ((player.vx >= 0)))) || ((((player.vx > -1)) && ((player.vx <= 0)))))) || ((pathPoint >= 1)))) || ((pathPoint < 0)))){ if ((((_local2 > 90)) && ((_local2 < 270)))){ player.vx = -(player.vx); }; player.endSlide(); onWater = false; pathPoint = 0; dismountTimer.start(); }; } protected function endGame():void{ controller.disable(); over = true; player.stop(); player.vBoost = 0; player.vz = 0; endTimer.start(); } protected function crashPlayer():void{ var _local1:Sound; player.clearState(); controller.disable(); if (player.crash_vy == 0){ player.crash_angle = (360 - player.angle); level.moveBG(player.vy); } else { player.crash_angle = (360 - player.crash_angle); level.moveBG(player.crash_vy); }; player.crash_vy = -7; player.crash_vx = (player.vx / 4); player.gotoAndPlay("crashingRight"); player.vy = 0; player.vx = 0; player.hitFloor = true; _local1 = new Impact(); _local1.play(); } protected function continueCrash():void{ if (crashTimer >= 40){ player.hitFloor = false; player.crash_vy = 0; player.vx = player.crash_vx; player.crash_vx = 0; player.vBoost = 0; player.slideBoost = 0; controller.enable(); player.gotoAndPlay("accelerating"); crashTimer = 0; } else { crashTimer++; applyFriction(); level.scrollLevel(player.crash_vx, player.crash_vy); }; } protected function buildUI():void{ ui = new Sprite(); addChild(ui); menuButton = new MenuButton(); menuButton.focusRect = false; menuButton.x = ((640 - menuButton.width) - 10); menuButton.y = ((480 - menuButton.height) - 10); menuButton.addEventListener(MouseEvent.CLICK, onMenuButtonClick); ui.addChild(menuButton); menu.addButton(new HelpButton(), sg.showHelp); muteButton = new MuteButton(); muteButton.x = ((menuButton.x - muteButton.width) - 30); muteButton.y = ((menuButton.y + menuButton.height) - muteButton.height); muteButton.buttonMode = true; addChild(muteButton); muteButton.addEventListener(MouseEvent.CLICK, onMute); } protected function startGame():void{ player.clearState(); player.gotoAndStop("moving"); player.vz = 0; player.crash_vz = 0; player.vBoost = 0; player.slideBoost = 0; player.angle = 0; player.jumping = false; player.sliding = false; level.y = 0; level.reset(); player.particleManager = level.particleManager; controller.resetKeys(); player.startSparkle(); controller.enable(); over = false; } protected function setWind():void{ var _local1:int; var _local2:Number; var _local3:Number; _local1 = MathSG.randNum(0, 2); _local2 = 0; if (_local1 == 1){ _local2 = MathSG.normalize(MathSG.randNum(-40, 40)); } else { _local2 = MathSG.randNum(140, 220); }; windUI.windVane.rotation = _local2; _local3 = (MathSG.randNum(0, 60) + (MathSG.randNum(1, 11) / 10)); _local3 = 0; windUI.wind_txt.text = (_local3 + " km/h"); windUI.wind_txt.cacheAsBitmap = true; _local2 = MathSG.rad(_local2); windAX = ((Math.cos(_local2) * _local3) / 400); windAY = ((Math.sin(_local2) * _local3) / 400); windVX = (windVY = 0); windAng = _local2; windStr = _local3; player.drag = windAX; } protected function continueJump():void{ player.vy = (player.vy + GRAVITY); jump_xTotal = (jump_xTotal + Math.abs(player.vx)); if (player.vy < 0){ jump_yTotal = (jump_yTotal - player.vy); }; jumpTimer++; } protected function endSlide(_arg1:Event):void{ var _local2:Sound; player.slideBoost = (player.slideBoost + currentPath.slideBoost); currentPath.slideBoost = (currentPath.slideBoost / 2); currentPath = null; if (((!(onWater)) && ((player.vy < -2)))){ _local2 = new Explosion(); _local2.play(); }; onWater = false; if (slide_distance > longest_tailslide){ longest_tailslide = slide_distance; }; slide_distance = 0; } override public function pause():void{ super.pause(); if (paused){ controller.disable(); player.endSparkle(); } else { controller.enable(); player.startSparkle(); }; } } }//package com.rawkins.games.dolphinOlympics
Section 22
//Greenfish (com.rawkins.games.dolphinOlympics.Greenfish) package com.rawkins.games.dolphinOlympics { import flash.utils.*; public class Greenfish extends Fish { private var landTimer:Timer; private var turnCounter:Number;// = 0 public function Greenfish(_arg1:Number=0, _arg2:Number=0):void{ turnCounter = 0; addFrameScript(18, frame19, 29, frame30, 30, frame31); super(_arg1, _arg2); landTimer = new Timer(1000, 1); _scalar = ((Math.random() / 6) + 0.25); scaleX = (scaleY = _scalar); } function frame19(){ gotoAndPlay("normal"); } override protected function swim():void{ updateSpeed(); if (!activated){ if (this.y > _bottom){ if ((((_angle > (Math.PI / 2))) && ((_angle < (Math.PI * 1.5))))){ _angle = (_angle + 0.1); } else { _angle = (_angle - 0.1); }; } else { changeDir(); }; } else { follow(); }; this.x = (this.x + _vx); this.y = (this.y + _vy); } function frame30(){ gotoAndPlay("active"); } function frame31(){ stop(); } override protected function changeDir():void{ if (!landTimer.running){ angle = (Math.sin(turnCounter) + dirAdjust); turnCounter = (turnCounter + 0.1); }; } override public function endJump():void{ super.endJump(); _turnCounter = Math.sin(angle); landTimer.start(); } override public function startJump():void{ super.startJump(); if ((((angle > (Math.PI / 2))) && ((angle < (Math.PI * 1.5))))){ dirAdjust = Math.PI; } else { dirAdjust = 0; }; } } }//package com.rawkins.games.dolphinOlympics
Section 23
//HeightTrick (com.rawkins.games.dolphinOlympics.HeightTrick) package com.rawkins.games.dolphinOlympics { public class HeightTrick extends Trick { private var _done:Boolean; private var _height:Number; public function HeightTrick(_arg1:String, _arg2:uint, _arg3:Number, _arg4:Function=null):void{ super(_arg1, _arg2, _arg4); _done = false; _height = _arg3; } public function set done(_arg1:Boolean):void{ _done = _arg1; } public function get height():Number{ return (_height); } public function get done():Boolean{ return (_done); } } }//package com.rawkins.games.dolphinOlympics
Section 24
//Level (com.rawkins.games.dolphinOlympics.Level) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import com.rawkins.fx.*; import flash.utils.*; import com.rawkins.utils.*; public class Level extends Sprite { private var _clouds:Background; private var watchList:Array; private var bottomBound:int;// = 580 private var _water:Water; public var starHeight:Number;// = -1500 private var _oceanObjects:Background; private var midGround2:Array; private var _starPaths:Background; public var bg:Sprite; private var wave1:Sprite; private var wave2:Sprite; private var _sky:Background; public var marsHeight:Number;// = -6000 public var celebHeight:Number;// = -1750 public var plutoHeight:Number;// = -45000 private var sLeftBound:Number;// = -5000 private var _creatures:Array; private var _planets:Background; public var jupiterHeight:Number;// = -11000 protected var skyRingCount:int;// = 0 private var surface:SlidePath; private var oceanObjs:Array; protected var ringCount:int;// = 0 public var fg:Sprite; private var rightBound:Number;// = 640 private var _floor2:Background; private var _floor3:Background; public var saturnHeight:Number;// = -14000 public var time:Date; public var uranusHeight:Number;// = -20000 private var _reef:Background; protected var ringTimer:Timer; protected var floorDepth1:int;// = 500 protected var floorDepth3:int;// = 700 protected var floorDepth2:int;// = 600 private var _floor:Background; private var topBound:int;// = -100 private var sky:Sprite; private var _fish:Array; protected var maxRings:int;// = 5 private var _scrollable:Array; private var backGround:Array; private var splash_sound:Sound; public var nebulaHeight:Number;// = -8000 protected var waterRingBase:Point; protected var skyRingBase:Point; private var foreGround:Array; protected var waterRingCount:int;// = 0 protected var collCount:int;// = 0 protected var ringSwitch:Number;// = 0 public var moonHeight:Number;// = -3500 private var sRightBound:Number;// = 5000 public var neptuneHeight:Number;// = -30000 public var mg:Sprite; private var starFields:Array; private var leftBound:Number;// = -640 public var collidables:Array; private var slidePaths:Array; private var _birds:Array; public var endHeight:Number;// = -100000 private var midGround:Array; private var stars1:Starfield; private var stars2:Starfield; private var stars3:Starfield; private var theHour:uint; private var pm:ParticleManager; private var _ocean:Background; public function Level():void{ var _local1:Date; leftBound = -640; rightBound = 640; sLeftBound = -5000; sRightBound = 5000; topBound = -100; bottomBound = 580; floorDepth1 = 500; floorDepth2 = 600; floorDepth3 = 700; starHeight = -1500; celebHeight = -1750; moonHeight = -3500; marsHeight = -6000; nebulaHeight = -8000; jupiterHeight = -11000; saturnHeight = -14000; neptuneHeight = -30000; uranusHeight = -20000; plutoHeight = -45000; endHeight = -100000; collCount = 0; ringCount = 0; skyRingCount = 0; waterRingCount = 0; maxRings = 5; ringSwitch = 0; super(); foreGround = new Array(); midGround2 = new Array(); midGround = new Array(); backGround = new Array(); slidePaths = new Array(); bg = new Sprite(); mg = new Sprite(); fg = new Sprite(); addChild(bg); _local1 = new Date(); theHour = _local1.hours; watchList = new Array(); _creatures = new Array(); _fish = new Array(); _birds = new Array(); collidables = new Array(); _oceanObjects = new Background(topBound, rightBound, bottomBound, leftBound); ringTimer = new Timer(10000); ringTimer.addEventListener(TimerEvent.TIMER, addRing); } public function pause():void{ } public function get creatures():Array{ return (_creatures); } public function set creatures(_arg1:Array):void{ _creatures = _arg1; } public function get bottom():Number{ return (((bg.y + _water.height) - 20)); } public function resume():void{ } public function get surfaceHeight():Number{ return (bg.y); } public function get fish():Array{ return (_fish); } public function splash(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean=false){ var _local5:Number; var _local6:uint; var _local7:WaterDrop; var _local8:int; _local5 = Math.abs(_arg3); _local6 = 0; while (_local6 < (_local5 * 2)) { _local7 = new WaterDrop(); if (!_arg4){ _local7.bounded = false; }; _local8 = Math.floor((Math.random() * 2)); if (_local8 == 0){ _local8 = -1; }; _local7.vx = (_local8 * (Math.random() + (_local5 / 200))); _local7.vy = (((Math.random() * 5) * -(Math.random())) - (_local5 / 6)); _local7.x = ((_arg1 - pm.x) - ((Math.random() * _arg3) / 2)); _local7.y = _arg2; _local7.draw(); _local7.cacheAsBitmap = true; pm.addParticle(_local7); _local6++; }; } public function get particleManager():ParticleManager{ return (pm); } protected function addRing(_arg1:TimerEvent):void{ var _local2:Number; var _local3:Point; var _local4:Ring; if (ringCount < maxRings){ _local2 = MathSG.randNum(0, 2); if (_local2 == 1){ if ((((skyRingCount == 0)) || ((skyRingBase == null)))){ if (skyRingBase == null){ skyRingBase = new Point(MathSG.randNum(leftBound, rightBound), MathSG.randNum(-650, -200)); } else { skyRingBase.x = (skyRingBase.x + 4000); skyRingBase.y = MathSG.randNum(-650, -200); }; }; _local3 = skyRingBase; } else { if ((((waterRingCount == 0)) || ((waterRingBase == null)))){ if (waterRingBase == null){ waterRingBase = new Point(MathSG.randNum(leftBound, rightBound), MathSG.randNum(200, 600)); } else { waterRingBase.x = (waterRingBase.x + 4000); waterRingBase.y = MathSG.randNum(200, 600); }; }; _local3 = waterRingBase; }; if (_local3.y < 0){ _local4 = new Ring(0xFF0000); skyRingCount++; } else { _local4 = new Ring(); waterRingCount++; }; _local4.x = (_local3.x + (ringCount * 600)); _local4.y = ((_local3.y + (150 * Math.sin(ringSwitch))) + bg.y); ringSwitch = (ringSwitch + (Math.PI / 2)); collCount++; _local4.name = ("ring" + collCount); _oceanObjects.addTile(_local4); collidables.push(_local4); _local4.addEventListener(Collidable.COLLIDABLE_DEAD, killColl); ringCount++; }; } private function addFish(_arg1:uint):void{ var _local2:int; var _local3:Number; var _local4:Number; var _local5:int; var _local6:MovieClip; _local2 = 0; while (_local2 < _arg1) { _local3 = MathSG.randNum(sLeftBound, sRightBound); _local4 = MathSG.randNum(100, 600); _local5 = MathSG.randNum(1, 5); switch (_local5){ case 1: _local6 = new Orangefish(bg.y, _water.height); break; case 2: _local6 = new Fish(bg.y, _water.height); break; case 3: _local6 = new Greenfish(bg.y, _water.height); break; case 4: _local6 = new Bluefish(bg.y, _water.height); break; }; _local6.x = _local3; _local6.y = _local4; _oceanObjects.addTile(_local6); collidables.push(_local6); _fish.push(_local6); _local2++; }; } private function buildStars():void{ var _local1:Sprite; var _local2:Sprite; var _local3:Sprite; var _local4:Sprite; var _local5:Sprite; var _local6:Sprite; var _local7:Sprite; var _local8:Sprite; var _local9:Sprite; var _local10:StarPath; var _local11:StarPath; var _local12:StarPath; var _local13:StarPath; var _local14:StarPath; var _local15:StarPath; var _local16:StarPath; var _local17:StarPath; var _local18:StarPath; var _local19:StarPath; var _local20:StarPath; stars1 = new Starfield(25, 100); stars1.y = starHeight; stars2 = new Starfield(25, 100); stars2.y = (starHeight - 480); stars3 = new Starfield(25, 100); stars3.y = (starHeight - 960); bg.addChild(stars1); bg.addChild(stars2); bg.addChild(stars3); stars1.build(); stars2.build(); stars3.build(); starFields = [stars1, stars2, stars3]; _planets = new Background(topBound, rightBound, bottomBound, leftBound); _local1 = new Moon(); _local1.y = moonHeight; _planets.addTile(_local1); _local1.cacheAsBitmap = true; _local2 = new Mars(); _local2.y = marsHeight; _local2.x = (600 - _local2.width); _planets.addTile(_local2); _local2.cacheAsBitmap = true; _local3 = new Nebula(); _local3.y = nebulaHeight; _local3.cacheAsBitmap = true; _planets.addTile(_local3); _local4 = new Jupiter(); _local4.y = jupiterHeight; _local4.x = (640 - _local4.width); _local4.cacheAsBitmap = true; _planets.addTile(_local4); _local5 = new Saturn(); _local5.y = saturnHeight; _local5.x = (_local5.x + 100); _local5.cacheAsBitmap = true; _planets.addTile(_local5); _local6 = new Neptune(); _local6.y = neptuneHeight; _local6.cacheAsBitmap = true; _planets.addTile(_local6); _local7 = new Uranus(); _local7.y = uranusHeight; _local7.x = 340; _local7.cacheAsBitmap = true; _planets.addTile(_local7); _local8 = new Pluto(); _local8.y = plutoHeight; _local8.x = 170; _local8.cacheAsBitmap = true; _planets.addTile(_local8); _local9 = new Diner(); _local9.y = endHeight; _local9.x = (_local9.x - 15); _local9.cacheAsBitmap = true; _planets.addTile(_local9); bg.addChild(_planets); _starPaths = new Background(topBound, sRightBound, bottomBound, sLeftBound); _scrollable.push(_starPaths); _local10 = new StarPath(); _local10.curveTo(408, 288, 884, -4); _local10.curveTo(1368, -348, 1820, 0); _local10.drawPath(); _local10.draw(); _local10.y = (_local10.y + (moonHeight - 300)); slidePaths.push(_local10); _starPaths.addTile(_local10, true); _local11 = new StarPath(); _local11.curveTo(288, 84, 546, -18); _local11.curveTo(852, -138, 984, -402); _local11.curveTo(1134, -702, 1032, -936); _local11.curveTo(834, -1320, 354, -1236); _local11.curveTo(6, -1104, 24, -738); _local11.curveTo(66, -402, 432, -234); _local11.curveTo(840, -60, 1308, -42); _local11.curveTo(1980, -6, 2190, 252); _local11.curveTo(2394, 636, 2112, 942); _local11.curveTo(1686, 1170, 1428, 738); _local11.curveTo(1350, 390, 1668, 294); _local11.curveTo(2088, 192, 2508, 276); _local11.curveTo(2778, 300, 2934, 204); _local11.drawPath(); _local11.draw(); _local11.y = (marsHeight + 200); _local11.x = (_local11.x + 4950); slidePaths.push(_local11); _starPaths.addTile(_local11, true); _local12 = new StarPath(); _local12.curveTo(456, 444, 1278, 330); _local12.curveTo(2184, 180, 2628, 414); _local12.curveTo(3300, 702, 3666, 300); _local12.y = (nebulaHeight + 450); _local12.x = (_local12.x - 4950); _local12.drawPath(); _local12.draw(); slidePaths.push(_local12); _starPaths.addTile(_local12, true); _local13 = new StarPath(); _local13.curveTo(260, -128, 484, -4); _local13.curveTo(808, 164, 1052, -12); _local13.curveTo(1376, -252, 1248, -640); _local13.curveTo(1136, -884, 804, -868); _local13.curveTo(464, -820, 484, -520); _local13.curveTo(516, -216, 868, -200); _local13.curveTo(1400, -220, 1576, -32); _local13.curveTo(1824, 228, 2124, 12); _local13.curveTo(2456, -228, 1900, -476); _local13.curveTo(1612, -632, 1708, -800); _local13.curveTo(1844, -1024, 2264, -696); _local13.y = (nebulaHeight - 250); _local13.x = 500; _local13.drawPath(); _local13.draw(); slidePaths.push(_local13); _starPaths.addTile(_local13, true); _local14 = new StarPath(); _local14.curveTo(904, 32, 1044, -456); _local14.curveTo(1496, -1132, 596, -1232); _local14.curveTo(28, -1304, 184, -1692); _local14.curveTo(372, -1992, 752, -1892); _local14.y = (jupiterHeight + 300); _local14.x = 3500; _local14.drawPath(); _local14.draw(); slidePaths.push(_local14); _starPaths.addTile(_local14, true); _local15 = new StarPath(); _local15.curveTo(4, -484, 664, -424); _local15.curveTo(1296, -356, 1772, -560); _local15.curveTo(2260, -780, 2420, -456); _local15.y = (saturnHeight - 300); _local15.x = (_local15.x + 4500); _local15.drawPath(); _local15.draw(); slidePaths.push(_local15); _starPaths.addTile(_local15, true); _local16 = new StarPath(); _local16.curveTo(776, -68, 932, -232); _local16.curveTo(1100, -368, 936, -436); _local16.curveTo(640, -540, -76, -460); _local16.curveTo(-420, -388, -100, -284); _local16.curveTo(452, -220, 736, -384); _local16.curveTo(1016, -544, 740, -592); _local16.curveTo(472, -676, 12, -636); _local16.curveTo(-140, -588, -12, -524); _local16.curveTo(412, -464, 576, -580); _local16.curveTo(732, -700, 564, -760); _local16.curveTo(468, -808, 296, -808); _local16.curveTo(140, -768, 276, -716); _local16.curveTo(476, -708, 504, -900); _local16.curveTo(492, -1060, 408, -1044); _local16.y = (neptuneHeight + 300); _local16.x = (_local16.x - 2000); _local16.drawPath(); _local16.draw(); slidePaths.push(_local16); _starPaths.addTile(_local16, true); _local17 = new StarPath(); _local17.curveTo(138, 612, 0x0300, 408); _local17.curveTo(2076, -66, 2682, 300); _local17.curveTo(2976, 492, 2994, 732); _local17.curveTo(2964, 1056, 2640, 1190); _local17.curveTo(1974, 1368, 1805, 888); _local17.y = (saturnHeight - 1300); _local17.x = (_local17.x - 1000); _local17.drawPath(); _local17.draw(); _local17.cacheAsBitmap = false; slidePaths.push(_local17); _starPaths.addTile(_local17, true); _local18 = new StarPath(); _local18.curveTo(628, -4, 684, -556); _local18.curveTo(676, -1060, 0, -1164); _local18.curveTo(-660, -1080, -628, -544); _local18.curveTo(-536, -136, -124, -188); _local18.curveTo(416, -216, 376, -588); _local18.curveTo(376, -924, 24, -948); _local18.curveTo(-300, -880, -284, -624); _local18.curveTo(-236, -360, 4, -372); _local18.curveTo(221, -404, 208, -600); _local18.curveTo(204, -788, 4, -782); _local18.y = neptuneHeight; _local18.x = (_local18.x + -4950); _local18.drawPath(); _local18.draw(); slidePaths.push(_local18); _starPaths.addTile(_local18, true); _local19 = new StarPath(); _local19.curveTo(165, -195, 475, -185); _local19.curveTo(775, -190, 910, -30); _local19.curveTo(1030, 190, 915, 345); _local19.curveTo(765, 520, 560, 530); _local19.curveTo(260, 485, 245, 245); _local19.curveTo(295, 15, 545, 25); _local19.curveTo(910, 15, 1345, 345); _local19.curveTo(1640, 550, 1980, 460); _local19.curveTo(2415, 360, 2535, 20); _local19.curveTo(2710, -535, 2015, -760); _local19.curveTo(1530, -815, 1455, -435); _local19.curveTo(1410, -125, 1905, -80); _local19.curveTo(2185, -35, 2415, -290); _local19.y = (uranusHeight + 250); _local19.x = (_local19.x + 0); _local19.drawPath(); _local19.draw(); slidePaths.push(_local19); _starPaths.addTile(_local19, true); _local20 = new StarPath(); _local20.curveTo(540, 268, 1204, 20); _local20.curveTo(1828, -296, 1636, -792); _local20.curveTo(1392, -1192, 772, -1044); _local20.curveTo(292, -820, 540, -360); _local20.curveTo(804, 52, 2112, -204); _local20.curveTo(2676, -280, 2976, -592); _local20.curveTo(3252, -880, 3704, -688); _local20.y = (_local20.y + (plutoHeight - 2000)); _local20.x = (_local20.x + 4000); _local20.drawPath(); _local20.draw(); slidePaths.push(_local20); _starPaths.addTile(_local20, true); bg.addChild(_starPaths); } private function darken(_arg1:DisplayObject, _arg2:Number=-50){ var _local3:ColorTransform; _local3 = new ColorTransform(); _local3.blueOffset = (_local3.redOffset = (_local3.greenOffset = _arg2)); _arg1.transform.colorTransform = _local3; } public function scrollLevel(_arg1:Number, _arg2:Number){ for each (c in collidables) { c.x = (c.x - _arg1); c.y = (c.y - _arg2); if (c.x < sLeftBound){ c.x = (sRightBound - c.width); } else { if (c.x > sRightBound){ c.x = (sLeftBound + c.width); }; }; }; bg.y = (bg.y - _arg2); for each (background in _scrollable) { background.scroll(_arg1); }; scrollStars(_arg2); pm.update(); pm.x = (pm.x - _arg1); } public function scrollTiles(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number=0, _arg5:Number=0):void{ var _local6:uint; var _local7:Object; if (_arg4 == 0){ _arg4 = rightBound; }; if (_arg5 == 0){ _arg5 = leftBound; }; _local6 = 0; while (_local6 < _arg1.length) { _local7 = _arg1[_local6]; if (_local7.name != "surface"){ _local7.x = (_local7.x - _arg2); }; if (_local7.x > _arg4){ _local7.x = _arg5; }; if (_local7.x < _arg5){ _local7.x = _arg4; }; _local6++; }; } public function set fish(_arg1:Array){ _fish = _arg1; } public function get birds():Array{ return (_birds); } public function refresh():void{ for each (path in slidePaths) { path.slideBoost = 1; }; for each (f in _fish) { f.x = MathSG.randNum(sLeftBound, sRightBound); }; surface.slideBoost = 0; } private function addClouds(_arg1:uint){ var _local2:uint; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Sprite; _local2 = 0; while (_local2 < _arg1) { _local3 = MathSG.randNum(0, 3); _local4 = MathSG.randNum(leftBound, rightBound); _local5 = MathSG.randNum(-600, -400); _local6 = MathSG.randNum(0, 2); if (_local6 == 1){ _local4 = -(_local4); }; _local7 = null; switch (_local3){ case 0: _local7 = new Cloud1(); break; case 1: _local7 = new Cloud2(); break; case 2: _local7 = new Cloud3(); break; }; _local7.x = _local4; _local7.y = _local5; _local7.cacheAsBitmap = true; _clouds.addTile(_local7, true, true); _local2++; }; } public function get paths():Array{ return (slidePaths); } public function startRings():void{ if (!ringTimer.running){ ringTimer.start(); }; } public function fireworks(_arg1:Number, _arg2:Number, _arg3:int=3, _arg4:Number=0, _arg5:Number=0):void{ var _local6:int; var _local7:int; var _local8:Number; var _local9:int; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:int; var _local15:Number; var _local16:int; var _local17:Firework; _local6 = _arg3; _local7 = 50; _local8 = (360 / _local7); _local9 = 0; while (_local9 < _local6) { _local10 = 100; _local11 = MathSG.randNum(-(_local10), _local10); _local12 = MathSG.randNum(-(_local10), _local10); _local14 = MathSG.randNum(0, 6); switch (_local14){ case 0: _local13 = 0xFFFF; break; case 1: _local13 = 0xFF; break; case 2: _local13 = 0xFFFF00; break; case 3: _local13 = 0xFF00; break; case 4: _local13 = 0xFF0000; break; case 5: _local13 = 0xFF00FF; break; }; _local15 = MathSG.randNum(13, 20); _local16 = 0; while (_local16 < _local7) { _local17 = new Firework((_local15 + (Math.random() * 2)), (_local16 * _local8), 20, _local13); _local17.x = (((_arg1 - pm.x) + _local11) + (_arg4 * 8)); _local17.y = ((_arg2 + _local12) + (_arg5 * 8)); _local17.draw(); pm.addParticle(_local17); _local16++; }; _local9++; }; } private function addGulls(_arg1:uint):void{ var _local2:int; var _local3:Number; var _local4:Number; var _local5:MovieClip; _local2 = 0; while (_local2 < _arg1) { _local3 = MathSG.randNum(sLeftBound, sRightBound); _local4 = MathSG.randNum(-350, -450); _local5 = new Seagull(-200, 200); _local5.x = _local3; _local5.y = _local4; _oceanObjects.addTile(_local5); collidables.push(_local5); birds.push(_local5); _local2++; }; } public function addJumpBar():Sprite{ var _local1:Sprite; _local1 = new Sprite(); _local1.graphics.lineStyle(1, 1, 1); _local1.graphics.beginFill(0xFFFFFF, 1); _local1.graphics.drawCircle(0, 0, 10); addChild(_local1); return (_local1); } public function reset():void{ bg.y = Math.floor(bg.y); while (bg.y != 0) { if (bg.y > 0){ scrollLevel(0, 1); } else { if (bg.y < 0){ scrollLevel(0, -1); }; }; }; refresh(); wave1.x = 0; wave2.x = 0; wave2.x = -(wave2.width); ringBase = null; } protected function killColl(_arg1:Event):void{ var _local2:Collidable; var _local3:int; var _local4:Collidable; var _local5:int; _local2 = _arg1.target; _local2.removeEventListener(Collidable.COLLIDABLE_DEAD, killColl); _local3 = 0; while (_local3 < collidables.length) { _local4 = collidables[_local3]; if (_local2.name == _local4.name){ collidables.splice(_local3, 1); _local5 = _local2.name.indexOf("ring"); if (_local5 != -1){ if (_local2.y < 0){ skyRingCount--; } else { waterRingCount--; }; ringCount--; }; }; _local3++; }; _oceanObjects.removeTile(_local2); } public function stopRings():void{ if (ringTimer.running){ ringTimer.stop(); }; } private function scrollStars(_arg1):void{ if ((((_arg1 < 0)) && ((bg.y > (-(starHeight) - 480))))){ for each (sf in starFields) { if (bg.y > -((sf.y - 480))){ sf.y = (sf.y - 1440); sf.showMore(); }; }; } else { if ((((_arg1 > 0)) && ((bg.y > (-(starHeight) + 480))))){ for each (sf in starFields) { if (bg.y < -((sf.y + 480))){ sf.y = (sf.y + 1440); sf.showLess(); }; }; }; }; } public function set birds(_arg1:Array){ _birds = _arg1; } public function buildLevel(){ var _local1:Floor3; var _local2:Floor4; var _local3:Floor5; var _local4:Floor6; var _local5:FullReef1; var _local6:FullReef2; var _local7:Floor1; var _local8:Floor2; var _local9:FloorBase; var _local10:*; _scrollable = new Array(); this.y = (this.y + 200); _ocean = new Background(topBound, rightBound, bottomBound, leftBound); _scrollable.push(_ocean); _water = new Water(); _ocean.addTile(_water, false, true); bg.addChild(_ocean); wave1 = new Waves(); wave2 = new Waves(); wave1.cacheAsBitmap = (wave2.cacheAsBitmap = true); wave2.x = -(wave2.width); wave1.y = (wave2.y = (-(wave1.height) + 2)); _ocean.addTile(wave1, true); _ocean.addTile(wave2, true); surface = new SlidePath(0.2); surface.curveTo(0, 0, 640, 0); surface.drawPath(); surface.draw(); surface.y = (surface.y - wave1.height); bg.addChild(surface); surface.visible = true; surface.name = "surface"; slidePaths.push(surface); _floor2 = new Background(topBound, rightBound, bottomBound, leftBound, 0.125); _scrollable.push(_floor2); _local1 = new Floor3(); _local2 = new Floor4(); _local1.cacheAsBitmap = (_local2.cacheAsBitmap = true); _local2.x = -(_local2.width); _floor2.y = ((_water.height + _water.y) - _local2.height); _floor2.addTile(_local1, true, true); _floor2.addTile(_local2, true, true); _floor3 = new Background(topBound, rightBound, bottomBound, leftBound, 0.05); _scrollable.push(_floor3); _local3 = new Floor5(); _local4 = new Floor6(); new Floor6().x = -(_local4.width); _floor3.addTile(_local3, true, true); _floor3.addTile(_local4, true, true); _floor3.y = ((_water.height + _water.y) - _local3.height); bg.addChild(_floor3); bg.addChild(_floor2); _reef = new Background(topBound, rightBound, bottomBound, leftBound, 0.25); _scrollable.push(_reef); _reef.y = ((_water.height + _water.y) - 10); _local5 = new FullReef1(); _local6 = new FullReef2(); new FullReef2().x = -(_local6.width); _local5.cacheAsBitmap = true; _local6.cacheAsBitmap = true; _reef.addTile(_local5, true, true); _reef.addTile(_local6, true, true); _reef.y = (_reef.y - 75); bg.addChild(_reef); _floor = new Background(topBound, rightBound, bottomBound, leftBound); _scrollable.push(_floor); _floor.y = (_water.height + _water.y); _local7 = new Floor1(); _local8 = new Floor2(); _local7.cacheAsBitmap = (_local8.cacheAsBitmap = true); _local8.x = -(_local8.width); _floor.addTile(_local7, true); _floor.addTile(_local8, true); _local9 = new FloorBase(); _floor.addTile(_local9); _local9.y = _local7.height; _floor.y = (_floor.y - 32); bg.addChild(_floor); _local9.y = (_local9.y - 1); buildStars(); addFish(25); addGulls(3); pm = new ParticleManager(); bg.addChild(pm); _sky = new Background(topBound, rightBound, bottomBound, leftBound, 0.5); _scrollable.push(_sky); if ((((theHour >= 19)) && ((theHour < 22)))){ sky = new EveningSky(); starHeight = (starHeight + 400); darken(_ocean, -50); darken(_floor2, -50); darken(_floor3, -50); darken(_reef, -50); } else { if ((((theHour >= 22)) || ((theHour <= 4)))){ sky = new NightSky(); darken(_ocean, -90); starHeight = (starHeight + 750); darken(_floor2, -90); darken(_floor3, -90); darken(_reef, -90); } else { sky = new SunnySky(); _local10 = new WaterRays(); _local10.alpha = 0.46; _ocean.addTile(_local10, false, true); }; }; sky.y = (sky.y - (sky.height - 2)); sky.cacheAsBitmap = true; _sky.addTile(sky, false, false); bg.addChildAt(_sky, 0); _clouds = new Background(topBound, rightBound, bottomBound, leftBound, 0.5); _scrollable.push(_clouds); bg.addChild(_clouds); addClouds(MathSG.randNum(2, 4)); addChild(_oceanObjects); } public function moveBG(_arg1:Number):void{ bg.y = (bg.y + _arg1); } public function removeJumpBar(_arg1:Sprite):void{ if (contains(_arg1)){ removeChild(_arg1); }; } } }//package com.rawkins.games.dolphinOlympics
Section 25
//Orangefish (com.rawkins.games.dolphinOlympics.Orangefish) package com.rawkins.games.dolphinOlympics { import flash.utils.*; import com.rawkins.utils.*; public class Orangefish extends Fish { private var landTimer:Timer; private var turnCounter:Number;// = 0 public function Orangefish(_arg1:Number=0, _arg2:Number=0):void{ turnCounter = 0; addFrameScript(12, frame13, 26, frame27, 42, frame43); super(_arg1, _arg2); landTimer = new Timer(1000, 1); _turnSpeed = 0.15; angle = MathSG.randNum(0, (Math.PI * 2)); } override protected function jump():void{ super.jump(); angle = (angle + 0.2); } function frame13(){ gotoAndPlay("normal"); } override protected function swim():void{ updateSpeed(); if (!activated){ if (this.y > _bottom){ if ((((_angle > (Math.PI / 2))) && ((_angle < (Math.PI * 1.5))))){ _angle = (_angle + 0.1); } else { _angle = (_angle - 0.1); }; } else { changeDir(); }; } else { follow(); }; this.x = (this.x + _vx); this.y = (this.y + _vy); } function frame27(){ gotoAndPlay("active"); } function frame43(){ gotoAndPlay("jumping"); } override protected function changeDir():void{ if (!landTimer.running){ angle = (angle + (0.25 * Math.sin(turnCounter))); turnCounter = (turnCounter + 0.1); }; } override public function endJump():void{ super.endJump(); _turnCounter = Math.sin(angle); landTimer.start(); } override public function startJump():void{ super.startJump(); if ((((angle > (Math.PI / 2))) && ((angle < (Math.PI * 1.5))))){ dirAdjust = Math.PI; } else { dirAdjust = 0; }; } } }//package com.rawkins.games.dolphinOlympics
Section 26
//Pirateship (com.rawkins.games.dolphinOlympics.Pirateship) package com.rawkins.games.dolphinOlympics { public class Pirateship extends Collidable { public function Pirateship():void{ } } }//package com.rawkins.games.dolphinOlympics
Section 27
//Player (com.rawkins.games.dolphinOlympics.Player) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import com.rawkins.fx.*; import flash.utils.*; import com.rawkins.utils.*; import flash.filters.*; public dynamic class Player extends MovieClip { private var maxTurn:Number; private var _crasy_vz:Number; public var hitzone_mc:hitzone; var landing:Boolean; private var _slideBoost:Number; public var slideTime:Number; private var startHeight:Number; private var sparkCount:Number;// = 0 var upsideDown:Boolean; var sliding:Boolean; private var slideHeight:Number;// = 15 var rolling:Boolean;// = false public var extensionTimer:Timer; var hitFloor:Boolean; private var stateRecord:Array; private var pointing:String; var moving:Boolean; var accelerating:Boolean; private var rollInterval:uint;// = 2 private var thisClip_mc:MovieClip; private var stamina:Number; private var staminaBoost:Number; private var sparkTimer:Timer; private var _crash_angle:Number; private var weight:Number; var slowingDown:Boolean; public var spinDegs:Number; var slideReady:Boolean;// = false private var spinDrag:Number;// = 0 public var ui; public var rollCount:uint;// = 0 private var slideHeightRatio:Number; var turningRight:Boolean; private var slideRatio:Number; var swimming:Boolean;// = true private var trailTimer:Timer; var betweenJumps:Boolean;// = false private var power:Number;// = 1.4 private var shadowSpeed:Number;// = 15 private var slideDir:String; var jumping:Boolean; private var glowing:Boolean;// = false private var rollBuffer:uint;// = 0 var exhausted:Boolean; private var _vy:Number; private var _vz:Number; var kicked:Boolean;// = false private var sparkSpeed:Number;// = 30 private var turnRadius:Number; private var _vx:Number; private var slidePath:SlidePath; var resting:Boolean; public var controller; private var powerBoost:Number; public var flips:uint; private var thisGame:Game; private var _crash_vx:Number; private var _crash_vy:Number; private var oldBoost:uint;// = 0 private var turnSpeed:Number; private var shadowCount:Number;// = 0 private var _angle:Number; private var _vBoost:Number; public var replay:Boolean;// = false private var restID:Number; private var recording:Boolean;// = false var turningLeft:Boolean; private var pm:ParticleManager; public var rollFrameCount:uint;// = 0 private static var sparkMax:uint = 10; private static var org_vMax; private static var sparkSpread:uint = 40; private static var staminaMax:Number = 100; private static var vMax:Number = 13; private static var baseGlow:uint = 2; public function Player():void{ power = 1.4; slideHeight = 15; spinDrag = 0; swimming = true; slideReady = false; kicked = false; rolling = false; betweenJumps = false; recording = false; replay = false; sparkCount = 0; sparkSpeed = 30; glowing = false; oldBoost = 0; shadowCount = 0; shadowSpeed = 15; rollFrameCount = 0; rollCount = 0; rollBuffer = 0; rollInterval = 2; super(); addFrameScript(31, frame32, 78, frame79, 115, frame116, 152, frame153, 168, frame169); sparkTimer = new Timer(15); sparkTimer.addEventListener(TimerEvent.TIMER, sparkle); powerBoost = 0; crash_vx = 0; crash_vy = 0; angle = 0; vx = 0; vy = 0; vz = 0; crash_angle = 0; turnRadius = 2; maxTurn = 10.5; minTurn = 2; vBoost = 0; slideBoost = 0; flips = 0; spinDegs = 0; accelerating = false; moving = false; turningLeft = false; turningRight = false; upsideDown = false; jumping = false; landing = false; hitFloor = false; direction = "right"; exhausted = false; sliding = false; slideDir = ""; scaleX = (scaleY = 0.9); extensionTimer = new Timer(500, 2); trailTimer = new Timer(50, 12); trailTimer.addEventListener(TimerEvent.TIMER, leaveTrail); } public function speedTrail():void{ trailTimer.reset(); trailTimer.start(); } function frame153(){ gotoAndPlay("accelerating_left"); } public function startTurn(_arg1:String):void{ if ((((_arg1 == "left")) && (!(turningLeft)))){ turningLeft = true; if (!rolling){ gotoAndStop("turningLeft"); }; } else { if ((((_arg1 == "right")) && (!(turningRight)))){ turningRight = true; if (!rolling){ gotoAndStop("turningRight"); }; }; }; } function frame169(){ gotoAndPlay("rolling"); } public function get crash_angle():Number{ return (_crash_angle); } public function clearState():void{ this.accelerating = false; this.turningLeft = false; this.turningRight = false; this.moving = false; this.upsideDown = false; this.slowingDown = false; this.sliding = false; } public function startSparkle():void{ sparkTimer.start(); } public function get crash_vx():Number{ return (_crash_vx); } public function startSlide(_arg1:String, _arg2:SlidePath):void{ this.slidePath = _arg2; this.kicked = false; clearState(); this.sliding = true; slideTime = 0; gotoAndPlay("tailslide"); y = (y - slideHeight); startHeight = y; slideDir = _arg1; vy = 0; slideRatio = (90 / vx); } public function get crash_vz():Number{ return (Math.sqrt(((crash_vx * crash_vx) + (crash_vy * crash_vy)))); } public function set drag(_arg1:Number):void{ spinDrag = _arg1; } private function turn(_arg1:String):void{ var _local2:*; var _local3:*; var _local4:Number; _local2 = 0; if (_arg1 == "left"){ _local2 = -1; } else { _local2 = 1; }; _local3 = ((vz / turnRadius) + minTurn); if (_local3 > maxTurn){ _local3 = maxTurn; } else { if (_local3 < -(maxTurn)){ _local3 = -(maxTurn); }; }; if (jumping){ _local4 = 2.5; if ((((_local3 < _local4)) && ((_local3 > 0)))){ _local3 = _local4; } else { if ((((_local3 > -(_local4))) && ((_local3 < 0)))){ _local3 = -(_local4); }; }; if (rolling){ _local3 = (_local3 / 1.3); }; spinDegs = (spinDegs + (_local2 * _local3)); _angle = (_angle + (_local2 * _local3)); } else { _angle = (_angle + (_local2 * _local3)); }; if (_angle < 0){ _angle = (_angle + 360); } else { if (_angle > 360){ _angle = (_angle - 360); }; }; rotation = _angle; if ((((((_angle > 90)) && ((_angle < 270)))) || ((((_angle < -90)) && ((_angle > -270)))))){ pointing = "left"; } else { pointing = "right"; }; } public function set crash_angle(_arg1:Number):void{ _crash_angle = _arg1; } public function set particleManager(_arg1:ParticleManager){ pm = _arg1; } private function roll(){ var _local1:*; if (!sliding){ rollBuffer++; if (rollBuffer >= rollInterval){ rollBuffer = 0; nextFrame(); rollFrameCount = (rollFrameCount + 1); if (rollFrameCount >= 14){ gotoAndStop("rolling"); rollFrameCount = 0; if (jumping){ rollCount++; _local1 = new Event("Roll"); dispatchEvent(_local1); }; }; }; }; } public function startRoll(){ if (!rolling){ rolling = true; gotoAndStop("rolling"); }; } public function maverick():void{ var _local1:Number; _local1 = (vy / 2); vy = (vy + _local1); if (vx > 0){ vx = (vx + Math.abs(_local1)); } else { vx = (vx - Math.abs(_local1)); }; } public function get slideBoost():Number{ return (_slideBoost); } function frame32(){ gotoAndPlay(1); } public function get crash_vy():Number{ return (_crash_vy); } public function set crash_vz(_arg1:Number):void{ crash_vx = (Math.cos(((crash_angle * Math.PI) / 180)) * _arg1); crash_vy = (Math.sin(((crash_angle * Math.PI) / 180)) * _arg1); } public function set crash_vy(_arg1:Number):void{ _crash_vy = _arg1; } public function get vy():Number{ return (_vy); } public function update():void{ if (this.accelerating){ accelerate(); }; if (this.rolling){ roll(); }; if (this.turningLeft){ turn("left"); } else { if (this.turningRight){ turn("right"); }; }; } public function set crash_vx(_arg1:Number):void{ _crash_vx = _arg1; } public function get vBoost():Number{ return (_vBoost); } public function get vx():Number{ return (_vx); } public function get vz():Number{ return (Math.sqrt(((vx * vx) + (vy * vy)))); } public function get angle():Number{ return (_angle); } public function sparkle(_arg1:TimerEvent):void{ var _local2:Number; var _local3:GlowFilter; var _local4:Spark; var _local5:Shadow; var _local6:GlowFilter; if (vBoost > 0){ if (vBoost != oldBoost){ _local3 = new GlowFilter(); _local3.blurX = (baseGlow + (vBoost * 0.5)); _local3.blurY = (baseGlow + (vBoost * 0.5)); _local3.alpha = (0.6 - (1.5 / vBoost)); _local3.strength = (3 - ((1 / vBoost) / 2)); _local3.color = 0xFFFFFF; filters = [_local3]; glowing = true; }; oldBoost = vBoost; _local2 = (2 / vBoost); if (sparkCount >= _local2){ _local4 = new Spark(0, 0, 50); _local4.x = (((320 - pm.x) + (Math.random() * sparkSpread)) + (Math.random() * -(sparkSpread))); _local4.y = (((240 - pm.parent.y) + (Math.random() * sparkSpread)) + (Math.random() * -(sparkSpread))); _local4.draw(); pm.addParticle(_local4); sparkCount = 0; } else { sparkCount = (sparkCount + 0.1); }; if (slideBoost > 0){ if (shadowCount > shadowSpeed){ _local5 = new Shadow(this); _local5.x = (320 - pm.x); _local5.y = (240 - pm.parent.y); if (sliding){ _local5.y = (_local5.y - 10); }; _local5.draw(); pm.addParticle(_local5); shadowCount = 0; } else { shadowCount = (shadowCount + slideBoost); }; }; } else { if (glowing){ if (filters[0].alpha > 0){ _local6 = filters[0]; filters[0].alpha = (_local6.alpha - 0.075); filters = [_local6]; } else { glowing = false; filters = null; }; }; }; } public function set slideBoost(_arg1:Number):void{ _slideBoost = _arg1; if (_slideBoost > 10){ _slideBoost = 10; }; } public function accelerate():void{ if (((((!(exhausted)) && (!(jumping)))) && (!(rolling)))){ if (this.vz < (vMax + vBoost)){ this.vz = (this.vz + power); }; if (crash_vz > power){ crash_vz = (crash_vz - (power * 0.65)); this.vz = (this.vz + (power * 0.65)); }; }; } function frame79(){ gotoAndPlay("crashingRight"); } public function set vx(_arg1:Number):void{ _vx = _arg1; } function frame116(){ gotoAndPlay("tailslide"); } private function leaveTrail(_arg1:TimerEvent):void{ var _local2:Shadow; _local2 = new Shadow(this, 0, 0, 70, false); _local2.x = (320 - pm.x); _local2.y = (240 - pm.parent.y); if (sliding){ _local2.y = (_local2.y - 10); }; _local2.draw(); pm.addParticle(_local2); } public function set vy(_arg1:Number):void{ _vy = _arg1; } public function set vz(_arg1:Number):void{ dispatchEvent(new Event("VelocityChanged")); vx = (Math.cos(((angle * Math.PI) / 180)) * _arg1); vy = (Math.sin(((angle * Math.PI) / 180)) * _arg1); } public function set vBoost(_arg1:Number):void{ _vBoost = _arg1; dispatchEvent(new Event("VelocityChanged")); } public function endSlide():void{ var _local1:*; if (slideDir == "right"){ gotoAndStop("turningRight"); angle = (180 + ((vx * slideRatio) * 2)); } else { if (slideDir == "left"){ gotoAndStop("turningLeft"); angle = (360 - ((vx * slideRatio) * 2)); }; }; slideTime = 0; this.sliding = false; this.jumping = true; crash_vz = 0; slideReady = false; y = 240; vy = (vy - 2); _local1 = new Event("EndSlide"); dispatchEvent(_local1); } public function stopRoll(){ this.rolling = false; rollFrameCount = 0; if (!sliding){ if (turningRight){ gotoAndStop("turningRight"); } else { if (turningLeft){ gotoAndStop("turningLeft"); } else { if (accelerating){ gotoAndPlay("accelerating"); }; }; }; }; } public function glide():void{ if ((!(moving) & !(rolling))){ clearState(); this.moving = true; this.gotoAndStop("moving"); }; } public function slide():void{ slideTime++; } public function endSparkle():void{ sparkTimer.stop(); } public function set angle(_arg1:Number):void{ _angle = _arg1; rotation = angle; } public function helicopter():void{ var _local1:Number; if (vx != 0){ _local1 = (vx / 2); vy = (vy - Math.abs(vx)); vx = _local1; }; } public function popSlide():void{ var _local1:*; if (!kicked){ this.kicked = true; gotoAndStop("moving"); vy = ((-(Math.abs((this.vx / 1.5))) * slidePath.popMult) + slideBoost); if (slideBoost > 0){ vy = (vy * (1 + (slideBoost / 4))); }; if ((((angle > 0)) && ((angle < 180)))){ vx = -(vx); }; _local1 = (360 + MathSG.deg(Math.atan2(this.vy, this.vx))); if (slideDir == "right"){ angle = _local1; } else { angle = (180 + Math.abs(_local1)); }; endSlide(); }; } public function startAccelerating():void{ if (((!(accelerating)) && (!(sliding)))){ this.accelerating = true; if (((((((!(rolling)) && (!(turningLeft)))) && (!(turningRight)))) && (!(jumping)))){ this.gotoAndPlay("accelerating"); }; }; } public function land():void{ this.jumping = false; this.sliding = false; this.kicked = false; this.swimming = true; if (((((accelerating) && (!(turningLeft)))) && (!(turningRight)))){ gotoAndPlay("accelerating"); }; spinDegs = 0; } public function endTurn(_arg1:String):void{ if (_arg1 == "left"){ turningLeft = false; } else { if (_arg1 == "right"){ turningRight = false; }; }; if (((!(rolling)) && (!(sliding)))){ if (turningRight){ gotoAndStop("turningRight"); } else { if (turningLeft){ gotoAndStop("turningLeft"); } else { if (((accelerating) && (!(jumping)))){ gotoAndPlay("accelerating"); } else { gotoAndStop("moving"); }; }; }; }; } } }//package com.rawkins.games.dolphinOlympics
Section 28
//Ring (com.rawkins.games.dolphinOlympics.Ring) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.display.*; import com.rawkins.fx.*; import flash.utils.*; import flash.filters.*; public class Ring extends Collidable { private var radX:Number;// = 26 private var radY:Number;// = 85 private var anim:Anim; private var sparkCount:uint;// = 0 private var sparks:Array; private var offColor:Number; private var speed:Number;// = 0.1 private var flip:int;// = 0 private var sparkBuffer;// = 0 private var sparkTimer:Timer; private var radius:Number;// = 85 private var maxSparks;// = 15 private var centerX:Number;// = 0 private var angle:Number;// = 0 private var centerY:Number;// = 0 private var pm:ParticleManager; public static var RING_HIT:String = "ring_hit"; public function Ring(_arg1:Number=0xFFCC00):void{ sparkCount = 0; maxSparks = 15; sparkBuffer = 0; radius = 85; centerX = 0; centerY = 0; radX = 26; radY = 85; speed = 0.1; angle = 0; flip = 0; super(); this.offColor = _arg1; pm = new ParticleManager(); addChild(pm); anim = new Anim(); sparks = new Array(); addEventListener(Event.ENTER_FRAME, addSpark); _activeTimer.addEventListener(TimerEvent.TIMER, die); } override protected function drawHitZone(_arg1:Number=65):void{ _hitZone.graphics.clear(); _hitZone.graphics.lineStyle(0, 0, 0); _hitZone.graphics.beginFill(0, 0); _hitZone.graphics.drawCircle(0, 0, (_arg1 + 10)); _hitZone.graphics.endFill(); _hitZone.scaleX = 0.3; _hitZone.cacheAsBitmap = true; } private function die(_arg1:TimerEvent):void{ var _local2:Event; _activeTimer.stop(); _activeTimer.removeEventListener(TimerEvent.TIMER, die); _local2 = new Event(COLLIDABLE_DEAD); dispatchEvent(_local2); } protected function addSpark(_arg1:Event):void{ var _local2:Number; var _local3:Particle; var _local4:GlowFilter; if (sparkCount <= maxSparks){ if (sparkBuffer >= 3){ _local2 = 0xFFFFFF; if (flip == 1){ _local2 = offColor; flip = 0; } else { flip++; }; _local3 = new Particle(0, 0, 20, _local2); _local3.bounded = false; _local3.x = radX; _local3.draw(); _local4 = new GlowFilter(_local2); _local3.filters = [_local4]; pm.addParticle(_local3); sparks.push(_local3); sparkCount++; sparkBuffer = 0; } else { sparkBuffer++; }; } else { removeEventListener(Event.ENTER_FRAME, addSpark); }; } override public function update():void{ if (!activated){ for each (spark in sparks) { spark.x = (centerX + (Math.sin(spark.angle) * radX)); spark.y = (centerY + (Math.cos(spark.angle) * radY)); spark.angle = (spark.angle + speed); }; } else { pm.update(); }; } override public function activate(_arg1:MovieClip):String{ var _local2:Event; _activeTimer.start(); for each (spark in sparks) { spark.vx = (Math.cos(spark.angle) * 10); spark.vy = (Math.sin(spark.angle) * 10); }; _local2 = new Event(RING_HIT, true); dispatchEvent(_local2); return ("ring"); } } }//package com.rawkins.games.dolphinOlympics
Section 29
//Scoreboard (com.rawkins.games.dolphinOlympics.Scoreboard) package com.rawkins.games.dolphinOlympics { import flash.net.*; import flash.events.*; import flash.display.*; import ascb.util.*; import com.rawkins.fx.*; import flash.text.*; import flash.system.*; import flash.ui.*; public class Scoreboard extends MovieClip { protected var serverPath:String;// = "http://www.rawkins.com/games/do2/" protected var labelFormat:TextFormat; protected var loader:URLLoader; protected var anim:Anim; protected var todaysScores:Sprite; protected var bg:Sprite; public var name_10:TextField; public var hs_score:TextField; protected var flags:Array; public var lj_score:TextField; protected var flagLabels:Array; public var lj_name:TextField; protected var recordFlags:Array; public var lt_name:TextField; public var score_10:TextField; protected var myScores:Sprite; public var bc_score:TextField; public var hj_score:TextField; public var lt_score:TextField; protected var allScores:Sprite; public var bs_score:TextField; protected var numFormat:NumberFormat; public var linkTab:MovieClip; public var hs_name:TextField; protected var scoreData:Object; public var name_1:TextField; public var name_3:TextField; public var name_5:TextField; public var name_6:TextField; public var name_7:TextField; public var name_8:TextField; public var name_9:TextField; public var name_4:TextField; public var close_btn:SimpleButton; public var name_2:TextField; public var hj_name:TextField; protected var context:LoaderContext; public var bs_name:TextField; protected var recordFlagLabels:Array; public var score_2:TextField; public var score_5:TextField; public var score_6:TextField; public var score_7:TextField; public var score_9:TextField; public var score_3:TextField; public var score_4:TextField; public var bc_name:TextField; public var score_8:TextField; public var score_1:TextField; public function Scoreboard(_arg1:SimpleGame=null):void{ serverPath = "http://www.rawkins.com/games/do2/"; super(); addFrameScript(0, frame1); this.focusRect = false; anim = new Anim(); numFormat = new NumberFormat(); close_btn.addEventListener(MouseEvent.CLICK, onClose); loadMyScores(); } public function loadTodaysScores():void{ var _local1:URLRequest; _local1 = new URLRequest(((serverPath + "get_score.php?today=1&flash=1&ck=") + new Date())); loader.load(_local1); } private function onFadeOut(_arg1:Event):void{ parent.removeChild(this); } function frame1(){ linkTab.buttonMode = true; linkTab.addEventListener(MouseEvent.CLICK, onTabClick); } private function onTodayButton(_arg1:MouseEvent):void{ loadTodaysScores(); } protected function buildFlags():void{ var _local1:int; var _local2:Loader; var _local3:TextField; flags = new Array(); flagLables = new Array(); labelFormat = new TextFormat(); labelFormat.color = 13158; labelFormat.font = "Verdana"; _local1 = 0; while (_local1 < 10) { _local2 = new Loader(); addChild(_local2); _local2.x = 28.4; _local2.y = (90 + (_local1 * 28)); flags.push(_local2); _local3 = new TextField(); _local3.y = (_local2.y + 20); _local3.x = (_local2.x + 20); _local3.setTextFormat(labelFormat); _local3.text = "Country name here"; flagLables.push(_local3); _local1++; }; recordFlags = new Array(); _local1 = 0; while (_local1 < 6) { _local2 = new Loader(); addChild(_local2); _local2.x = 340; _local2.y = (117 + (_local1 * 43.8)); recordFlags.push(_local2); _local1++; }; } private function onKeyUp(_arg1:KeyboardEvent):void{ if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.ESCAPE)))){ removeEventListener(KeyboardEvent.KEY_UP, onKeyUp); this.close(); }; } public function fadeIn():void{ if (this.parent != null){ anim.fade("in", this, 20); }; stage.focus = this; } private function onMyButton(_arg1:MouseEvent):void{ loadMyScores(); } private function hilite(_arg1:SimpleButton){ hilite_mc.x = (_arg1.x - 3); hilite_mc.width = (_arg1.width - 1); } protected function onScoresLoaded(_arg1:Event):void{ scoreData = loader.data; showScores(); } public function fadeOut():void{ if (this.parent != null){ anim.fade("out", this, 30); anim.addEventListener(anim.FADE_DONE, onFadeOut); }; } private function catchIOError(_arg1:IOErrorEvent):void{ trace(("Error caught: " + _arg1.type)); } private function onClose(_arg1:MouseEvent):void{ this.close(); } public function loadTopScores():void{ var _local1:URLRequest; _local1 = new URLRequest(((serverPath + "get_score.php?flash=1&ck=") + new Date())); loader.load(_local1); } protected function showScores():void{ var _local1:int; var _local2:TextFormat; var _local3:String; var _local4:String; _local1 = 1; while (_local1 < 11) { _local2 = new TextFormat(); _local2.color = 0xFFFFFF; _local2.font = "Verdana"; _local3 = "-"; if (scoreData[("name" + _local1)] != null){ _local3 = scoreData[("name" + _local1)]; }; _local4 = "-"; if (scoreData[("score" + _local1)] != null){ _local4 = numFormat.format(Number(scoreData[("score" + _local1)])); }; this[("name_" + _local1)].text = _local3; this[("score_" + _local1)].text = _local4; _local1++; }; if (scoreData.lj_name == null){ scoreData.lj_name = "-"; }; if (scoreData.lj_score == null){ scoreData.lj_score = 0; }; lj_name.text = scoreData.lj_name; lj_score.text = (numFormat.format(scoreData.lj_score) + " m"); if (scoreData.hj_name == null){ scoreData.hj_name = "-"; }; if (scoreData.hj_score == null){ scoreData.hj_score = 0; }; hj_name.text = scoreData.hj_name; hj_score.text = (numFormat.format(scoreData.hj_score) + " m"); if (scoreData.bs_name == null){ scoreData.bs_name = "-"; }; if (scoreData.bs_score == null){ scoreData.bs_score = 0; }; bs_name.text = scoreData.bs_name; bs_score.text = (numFormat.format(scoreData.bs_score) + " litres"); if (scoreData.lt_name == null){ scoreData.lt_name = "-"; }; if (scoreData.lt_score == null){ scoreData.lt_score = 0; }; lt_name.text = scoreData.lt_name; lt_score.text = (numFormat.format(scoreData.lt_score) + " m"); if (scoreData.hs_name == null){ scoreData.hs_name = "-"; }; if (scoreData.hs_score == null){ scoreData.hs_score = 0; }; hs_name.text = scoreData.hs_name; hs_score.text = (numFormat.format(scoreData.hs_score) + " m/s"); if (scoreData.bc_name == null){ scoreData.bc_name = "-"; }; if (scoreData.bc_score == null){ scoreData.bc_score = 0; }; bc_name.text = scoreData.bc_name; bc_score.text = (numFormat.format(scoreData.bc_score) + " tricks"); } private function onTopButton(_arg1:MouseEvent):void{ loadTopScores(); } public function onTabClick(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.dolphinolympics.com"); navigateToURL(_local2, "_blank"); } public function loadMyScores():void{ var _local1:SharedObject; var _local2:int; _local1 = SharedObject.getLocal("myScores"); if (_local1.data.scoreData != null){ scoreData = _local1.data.scoreData; } else { scoreData = new Object(); _local2 = 1; while (_local2 <= 10) { scoreData[("name" + _local2)] = "-"; scoreData[("score" + _local2)] = 0; _local2++; }; scoreData.lj_score = 0; scoreData.hj_score = 0; scoreData.bs_score = 0; scoreData.lt_score = 0; scoreData.hs_score = 0; scoreData.bc_score = 0; _local1.data.scoreData = scoreData; _local1.flush(); }; showScores(); } private function close():void{ parent.removeChild(this); dispatchEvent(new Event("Closed")); } } }//package com.rawkins.games.dolphinOlympics
Section 30
//ScoreSubmitForm (com.rawkins.games.dolphinOlympics.ScoreSubmitForm) package com.rawkins.games.dolphinOlympics { import flash.net.*; import flash.events.*; import flash.display.*; import fl.controls.*; import ascb.util.*; import fl.data.*; import com.rawkins.fx.*; import flash.text.*; import com.meychi.ascrypt3.*; import flash.ui.*; public class ScoreSubmitForm extends MovieClip { public var fs_txt:TextField; private var serverPath:String;// = "http://www.rawkins.com/games/do2/" private var hj:Number;// = 0 private var hs:Number;// = 0 public var playAgain_btn:SkipButton; private var numFormat:NumberFormat; private var countryIndex:int; public var lj_txt:TextField; public var hs_txt:TextField; private var anim:Anim; public var lt_txt:TextField; private var bc:Number;// = 0 private var bs:Number;// = 0 private var countryBox:ComboBox; public var bs_txt:TextField; private var lt:Number;// = 0 private var score:Number;// = 0 public var lc_txt:TextField; public var name_ti:TextField; public var hj_txt:TextField; public var submit_btn:SimpleButton; private var lj:Number;// = 0 public var error_txt:TextField; private var country:String;// = "--" private var countriesXML:XML; private var countryPref:SharedObject; public function ScoreSubmitForm():void{ serverPath = "http://www.rawkins.com/games/do2/"; hj = 0; lj = 0; bs = 0; lt = 0; hs = 0; bc = 0; score = 0; country = "--"; super(); anim = new Anim(); numFormat = new NumberFormat(); submit_btn.addEventListener(MouseEvent.MOUSE_UP, onSubmit); name_ti.addEventListener(FocusEvent.FOCUS_IN, onInput); } public function set biggest_combo(_arg1:Number):void{ lc_txt.text = String((_arg1 + " tricks")); this.bc = _arg1; } private function onInput(_arg1:Event):void{ _arg1.target.addEventListener(KeyboardEvent.KEY_UP, onKeyUp); } public function set longest_tailslide(_arg1:Number):void{ lt_txt.text = String((_arg1 + " m")); this.lt = _arg1; } public function set final_score(_arg1:Number):void{ fs_txt.text = numFormat.format(_arg1); this.score = _arg1; } public function fadeOut():void{ anim.fade("out", this, 20); } public function submitScore(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{ var _local9:URLVariables; var _local10:SharedObject; var _local11:Object; var _local12:Array; var _local13:Array; var _local14:int; _local9 = new URLVariables(((((((((((((((("name=" + _arg1) + "&score=") + _arg2) + "&longest_jump=") + _arg3) + "&highest_jump=") + _arg4) + "&biggest_splash=") + _arg5) + "&longest_tailslide=") + _arg6) + "&highest_speed=") + _arg7) + "&biggest_combo=") + _arg8)); _local10 = SharedObject.getLocal("myScores"); if (_local10.data.scoreData != null){ _local11 = _local10.data.scoreData; } else { _local11 = new Object(); _local14 = 1; while (_local14 <= 10) { _local11[("name" + _local14)] = "-"; _local11[("score" + _local14)] = 0; _local14++; }; _local11.lj_score = 0; _local11.hj_score = 0; _local11.bs_score = 0; _local11.lt_score = 0; _local11.hs_score = 0; _local11.bc_score = 0; }; _local12 = new Array(); _local13 = new Array(); _local14 = 1; while (_local14 <= 10) { _local12[_local14] = _local11[("score" + _local14)]; _local13[_local14] = _local11[("name" + _local14)]; _local14++; }; _local14 = 1; while (_local14 <= _local12.length) { if (_local12[_local14] < _arg2){ _local12.splice(_local14, 0, _arg2); _local13.splice(_local14, 0, _arg1); break; }; _local14++; }; _local14 = 1; while (_local14 <= 10) { _local11[("name" + _local14)] = _local13[_local14]; _local11[("score" + _local14)] = _local12[_local14]; _local14++; }; if (_local11.lj_score < _arg3){ _local11.lj_name = _arg1; _local11.lj_score = _arg3; }; if (_local11.hj_score < _arg4){ _local11.hj_name = _arg1; _local11.hj_score = _arg4; }; if (_local11.bs_score < _arg5){ _local11.bs_name = _arg1; _local11.bs_score = _arg5; }; if (_local11.lt_score < _arg6){ _local11.lt_name = _arg1; _local11.lt_score = _arg6; }; if (_local11.hs_score < _arg7){ _local11.hs_name = _arg1; _local11.hs_score = _arg7; }; if (_local11.bc_score < _arg8){ _local11.bc_name = _arg1; _local11.bc_score = _arg8; }; _local10.data.scoreData = _local11; _local10.flush(); } protected function scoreSent(_arg1:Event):void{ dispatchEvent(new Event("Score_Submitted")); } private function makeKey():String{ var _local1:SHA1; var _local2:Number; var _local3:String; _local1 = new SHA1(); if (hs == 0){ hs = 1; }; _local2 = Math.floor((((((((((hj + lj) / hs) * 43) + 96) + (121 / 12)) + (score * 23)) + (bc * 12)) + (bs * 11)) + (lt * 22))); _local3 = _local1.calculate(String(_local2)); trace(_local3); return (_local3); } private function onKeyUp(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ENTER){ _arg1.target.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp); onSubmit(_arg1); }; } public function set longest_jump(_arg1:Number):void{ lj_txt.text = (String(_arg1) + " m"); this.lj = _arg1; } protected function changeCountry(_arg1:Event):void{ country = countryBox.selectedItem.data.toLowerCase(); countryIndex = countryBox.selectedIndex; countryPref = SharedObject.getLocal("countryPref"); countryPref.data.country = countryIndex; countryPref.flush(); } public function set biggest_splash(_arg1:Number):void{ bs_txt.text = (String(_arg1) + " litres"); this.bs = _arg1; } public function set highest_jump(_arg1:Number):void{ hj_txt.text = (String(_arg1) + " m"); this.hj = _arg1; } private function setCountries():void{ var _local1:Array; var _local2:DataProvider; _local1 = Constants.countries; _local2 = new DataProvider(_local1); countryBox.dataProvider = _local2; } protected function onSubmit(_arg1:Event):void{ var _local2:Event; _local2 = new Event("Score_Submitted"); if (name_ti.text == ""){ error_txt.text = "Please enter a name"; } else { submitScore(name_ti.text, score, lj, hj, bs, lt, hs, bc); dispatchEvent(_local2); }; } public function fadeIn():void{ anim.fade("in", this, 20); stage.focus = name_ti; } public function set highest_speed(_arg1:Number):void{ hs_txt.text = String((_arg1 + " m/s")); this.hs = _arg1; } } }//package com.rawkins.games.dolphinOlympics
Section 31
//Seagull (com.rawkins.games.dolphinOlympics.Seagull) package com.rawkins.games.dolphinOlympics { import flash.events.*; import flash.utils.*; import com.rawkins.utils.*; public class Seagull extends Creature { private var _altitude:Number; private var _flapPower:Number;// = 1 private var maxVY:Number;// = 2 private var _minAlt:Number; private var startY:Number; private var dy:Number;// = 0 private var _flapTimer:Timer; private var _maxAlt:Number; public function Seagull(_arg1:Number=0, _arg2:Number=0):void{ _flapPower = 1; maxVY = 2; dy = 0; addFrameScript(13, frame14, 26, frame27); super(); startY = y; _speed = 2; _maxAlt = _arg1; _minAlt = _arg2; _vx = _speed; _flapTimer = new Timer(500, 3); _flapTimer.addEventListener(TimerEvent.TIMER, onFlapTimer); } function frame14(){ gotoAndPlay("gliding"); } private function flap():void{ gotoAndPlay("flapping"); _vy = (_vy - _flapPower); if (_vy > maxVY){ _vy = maxVY; }; } function frame27(){ gotoAndPlay("gliding"); } private function onFlapTimer(_arg1:TimerEvent):void{ flap(); } override public function update():void{ var _local1:Number; var _local2:Number; this.x = (this.x + _vx); this.y = (this.y + _vy); dy = (dy + _vy); if (dy > _minAlt){ _local2 = (dy - _minAlt); y = (y - _local2); dy = (dy - _local2); _vy = 0; } else { if (dy < _maxAlt){ _local2 = Math.abs((dy - _maxAlt)); y = (y + _local2); dy = (dy + _local2); _vy = 0; }; }; _vy = (_vy + (Constants.GRAVITY / 25)); if (_vy < -(maxVY)){ _vy = -(maxVY); }; _local1 = MathSG.randNum(0, 40); if (_local1 == 0){ flap(); }; } } }//package com.rawkins.games.dolphinOlympics
Section 32
//Shadow (com.rawkins.games.dolphinOlympics.Shadow) package com.rawkins.games.dolphinOlympics { import flash.display.*; import flash.geom.*; import com.rawkins.fx.*; import com.rawkins.utils.*; public class Shadow extends Particle { protected var colored:Boolean; protected var target:DisplayObject; protected var fx_bmp:Bitmap; protected var fx_bmpd:BitmapData; public function Shadow(_arg1:DisplayObject, _arg2:Number=0, _arg3:Number=0, _arg4:Number=70, _arg5:Boolean=true):void{ super(_arg2, _arg3, _arg4); this.target = _arg1; fx_bmpd = new BitmapData(_arg1.width, _arg1.height, true, 0); fx_bmp = new Bitmap(fx_bmpd); addChild(fx_bmp); fx_bmp.x = (fx_bmp.x - (_arg1.width / 2)); fx_bmp.y = (fx_bmp.y - (_arg1.height / 2)); this.colored = _arg5; } override public function draw():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:*; _local1 = MathSG.rad(target.angle); _local2 = Math.cos(_local1); _local3 = Math.sin(_local1); fx_bmpd.draw(target, new Matrix(_local2, _local3, -(_local3), _local2, (target.width / 2), (target.height / 2))); if (colored){ _local4 = new ColorTransform(Math.random(), Math.random(), Math.random()); fx_bmp.transform.colorTransform = _local4; } else { _local4 = new ColorTransform(1, 1, 1, 1, 150, 150, 150); fx_bmp.transform.colorTransform = _local4; }; } override public function update():void{ var _local1:ColorTransform; _local1 = new ColorTransform(); _local1.alphaOffset = -15; fx_bmpd.colorTransform(new Rectangle(0, 0, fx_bmp.width, fx_bmp.height), _local1); super.update(); } } }//package com.rawkins.games.dolphinOlympics
Section 33
//SlidePath (com.rawkins.games.dolphinOlympics.SlidePath) package com.rawkins.games.dolphinOlympics { import flash.display.*; import flash.geom.*; import com.rawkins.fx.*; import com.senocular.drawing.*; public class SlidePath extends Sprite { public const pathWidth:Number = 35; protected var len:Number; public var path:Path; protected var atPoint:Number; public var popMult:Number;// = 1 public var slideBoost:Number;// = 0 protected var curvePoints:Array; public var hitZone:Sprite; public var friction:Number; protected var pm:ParticleManager; public function SlidePath(_arg1:Number=0):void{ popMult = 1; slideBoost = 0; super(); curvePoints = new Array(); hitZone = new Sprite(); addChild(hitZone); hitZone.visible = false; path = new Path(); this.friction = _arg1; pm = new ParticleManager(); } protected function calculateLength():void{ var _local1:Number; var _local2:Point; var _local3:Point; var _local4:Number; var _local5:Number; var _local6:Number; _local1 = 0; len = 0; while (_local1 < 0.99) { _local2 = path.pointAt(_local1); _local1 = (_local1 + 0.01); _local3 = path.pointAt(_local1); _local4 = (_local3.x - _local2.x); _local5 = (_local3.y - _local2.y); _local6 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5))); len = (len + _local6); }; } public function draw():void{ hitZone.graphics.clear(); hitZone.graphics.lineStyle(pathWidth, 0xFFFFFF, 1); path.draw(hitZone.graphics); hitZone.cacheAsBitmap = true; } public function drawPath():void{ path.clear(); path.moveTo(0, 0); for each (point in curvePoints) { path.curveTo(point.cx, point.cy, point.x, point.y); }; calculateLength(); } public function findCollisionPoint(_arg1:DisplayObject):Number{ var _local2:Number; var _local3:Point; var _local4:Shape; _local2 = 0; while (_local2 < 1) { _local3 = path.pointAt(_local2); _local4 = new Shape(); _local4.graphics.lineStyle(0, 0, 0); _local4.graphics.drawCircle(_local3.x, _local3.y, 10); addChild(_local4); if (_arg1.hitTestObject(_local4)){ removeChild(_local4); break; }; removeChild(_local4); _local2 = (_local2 + 0.0025); }; atPoint = _local2; return (_local2); } public function curveTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{ var _local5:Object; _local5 = {cx:_arg1, cy:_arg2, x:_arg3, y:_arg4}; curvePoints.push(_local5); } public function get length():Number{ return (len); } } }//package com.rawkins.games.dolphinOlympics
Section 34
//Spark (com.rawkins.games.dolphinOlympics.Spark) package com.rawkins.games.dolphinOlympics { import flash.display.*; import com.rawkins.fx.*; public class Spark extends Particle { private var starBurst:MovieClip; public function Spark(_arg1:Number=0, _arg2:Number=0, _arg3:Number=100):void{ super(_arg1, _arg2, _arg3); } override public function draw():void{ starBurst = new StarBurst(); addChild(starBurst); starBurst.play(); } } }//package com.rawkins.games.dolphinOlympics
Section 35
//Starfield (com.rawkins.games.dolphinOlympics.Starfield) package com.rawkins.games.dolphinOlympics { import flash.display.*; import com.rawkins.utils.*; import flash.filters.*; public class Starfield extends Sprite { private var layer2:Sprite; private var layer3:Sprite; private var layerCount:int;// = 1 private var blur:BlurFilter; private var brightness:Number; private var glow:GlowFilter; private var density:uint; public function Starfield(_arg1:uint, _arg2:Number){ layerCount = 1; super(); this.density = _arg1; this.brightness = _arg2; this.glow = new GlowFilter(0xFFFFFF, 1, 12, 12); this.blur = new BlurFilter(2, 2, 5); } public function showLess():void{ if (layerCount == 3){ removeChild(layer2); } else { if (layerCount == 6){ removeChild(layer3); }; }; layerCount--; if (layerCount < 1){ layerCount = 1; }; } public function build():void{ var _local1:Number; var _local2:Number; _local1 = 640; _local2 = 480; buildQuadrant(this, 0, 0); } private function buildQuadrant(_arg1:Sprite, _arg2:Number, _arg3:Number):void{ var _local4:uint; var _local5:Array; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Shape; var _local10:Number; _local4 = 0; while (_local4 < density) { _local6 = (Math.random() * 640); _local7 = (Math.random() * 480); addStar(_arg1, _local6, _local7); _local4++; }; layer2 = new Sprite(); _local4 = 0; while (_local4 < density) { _local6 = (Math.random() * 640); _local7 = (Math.random() * 480); addStar(layer2, _local6, _local7, Math.round((Math.random() * 0xFFFFFF)), ((Math.random() * 2) + 1)); _local4++; }; layer3 = new Sprite(); _local4 = 0; while (_local4 < (density / 2)) { _local6 = (Math.random() * 640); _local7 = (Math.random() * 480); _local8 = Math.round((Math.random() * 0xFFFFFF)); _local9 = new Shape(); addStar(_local9, 0, 0, 0xFFFFFF, ((Math.random() * 3) + 1)); _local9.x = _local6; _local9.y = _local7; _local9.graphics.lineStyle(1, _local8); _local10 = MathSG.randNum(5, 15); _local9.graphics.moveTo(0, -(_local10)); _local9.graphics.lineTo(0, _local10); _local9.graphics.moveTo(-(_local10), 0); _local9.graphics.lineTo(_local10, 0); _local9.cacheAsBitmap = true; layer3.addChild(_local9); _local4++; }; layer2.cacheAsBitmap = true; _local5 = new Array(); _local5.push(blur); layer3.filters = _local5; layer3.cacheAsBitmap = true; } private function addStar(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number=0xFFFFFF, _arg5=1):void{ _arg1.graphics.beginFill(_arg4, brightness); _arg1.graphics.drawCircle(_arg2, _arg3, _arg5); } public function showMore():void{ layerCount++; if (layerCount == 3){ addChild(layer2); } else { if (layerCount == 6){ addChild(layer3); }; }; } } }//package com.rawkins.games.dolphinOlympics
Section 36
//StarPath (com.rawkins.games.dolphinOlympics.StarPath) package com.rawkins.games.dolphinOlympics { import flash.display.*; import flash.geom.*; import com.rawkins.utils.*; public class StarPath extends SlidePath { private var spread:Number;// = 25 private var density:Number;// = 0.02 public function StarPath(_arg1:Number=0.075):void{ spread = 25; density = 0.02; super(_arg1); popMult = 1.05; slideBoost = 1; } override public function draw():void{ var _local1:Number; var _local2:Point; var _local3:Number; var _local4:Number; var _local5:Sprite; var _local6:Number; density = (20 / path.length); _local1 = 0; while (_local1 < 1) { _local2 = path.pointAt(_local1); _local3 = (_local2.x + MathSG.randNum(-(spread), spread)); _local4 = (_local2.y + MathSG.randNum(-(spread), spread)); _local5 = new StarPic(); _local5.x = _local3; _local5.y = _local4; _local6 = (0.8 + (MathSG.randNum(-(spread), spread) / 35)); _local5.scaleX = _local6; _local5.scaleY = _local6; _local5.cacheAsBitmap = true; addChild(_local5); _local1 = (_local1 + density); }; super.draw(); } } }//package com.rawkins.games.dolphinOlympics
Section 37
//TitleScreen (com.rawkins.games.dolphinOlympics.TitleScreen) package com.rawkins.games.dolphinOlympics { import flash.events.*; import com.rawkins.utils.*; import com.rawkins.sg.*; public class TitleScreen extends IntroState { protected var swimSound:SoundLoop; protected var scoreBoard:Scoreboard; public function TitleScreen(_arg1:SimpleGame=null):void{ stop(); scoreBoard = new Scoreboard(sg); scoreBoard.x = (scoreBoard.x + 50); scoreBoard.y = (scoreBoard.y + 50); super(_arg1); if (sg != null){ menu.addButton(new HelpButton(), sg.showHelp); menu.addButton(new FreeswimButton(), sg.practiceGame); menu.addButton(new ScoreButton(), showScores); swimSound = new SoundLoop(new Seashore(), 0.5); } else { swimSound = null; }; } override public function init():void{ initialized = true; menu.x = ((320 - (menu.width / 2)) + 90); menu.y = (240 - 100); } override public function exit():void{ swimSound.pause(); super.exit(); } private function showScores(_arg1:Event):void{ scoreBoard.alpha = 0; addChild(scoreBoard); scoreBoard.fadeIn(); } override public function enter():void{ swimSound.fadeIn(); super.enter(); } } }//package com.rawkins.games.dolphinOlympics
Section 38
//Trick (com.rawkins.games.dolphinOlympics.Trick) package com.rawkins.games.dolphinOlympics { public class Trick { private var _count:uint; private var _name:String; private var _value:uint; private var _quantifier:String; private var _action:Function; private static var quantifiers:Array = ["", "Double", "Triple", "Quadruple", "Quintuple", "Sextuple", "Septuple", "Octuple", "Nonuple", "Decuple"]; public function Trick(_arg1:String, _arg2:uint=0, _arg3:Function=null):void{ _name = _arg1; _value = _arg2; _quantifier = ""; _action = _arg3; } public function set value(_arg1:uint):void{ _value = _arg1; } public function get name():String{ return ((_quantifier + _name)); } public function get count():uint{ return (_count); } public function get value():uint{ return (_value); } public function get action():Function{ return (_action); } public function set count(_arg1:uint):void{ _count = _arg1; updateQuantifier(); } private function updateQuantifier():void{ var _local1:*; _local1 = ""; if (count < quantifiers.length){ _local1 = quantifiers[(count - 1)]; } else { _local1 = ((count + 1) + "-Tuple"); }; if (count > 1){ _quantifier = (_local1 + " "); } else { _quantifier = _local1; }; } } }//package com.rawkins.games.dolphinOlympics
Section 39
//WaterDrop (com.rawkins.games.dolphinOlympics.WaterDrop) package com.rawkins.games.dolphinOlympics { import com.rawkins.fx.*; import flash.filters.*; public class WaterDrop extends Particle { public function WaterDrop(_arg1:Number=0, _arg2:Number=0, _arg3:Number=100):void{ super(_arg1, _arg2, _arg3); } override public function draw():void{ var _local1:uint; var _local2:Number; var _local3:BlurFilter; var _local4:Array; _local1 = Math.floor(((Math.random() * 3) + 1)); if (_local1 == 1){ graphics.beginFill(13106428); } else { if (_local1 == 2){ graphics.beginFill(16776444); } else { if (_local1 == 3){ graphics.beginFill(15204093); }; }; }; graphics.lineStyle(0, 0, 0); _local2 = Math.floor(((Math.random() * 1) + 1)); graphics.drawCircle(_local2, _local2, _local2); graphics.endFill(); _local3 = new BlurFilter(5, 5, BitmapFilterQuality.LOW); _local4 = new Array(); _local4.push(_local3); filters = _local4; cacheAsBitmap = true; } override public function update():void{ if (!dead){ vy = (vy + (Constants.GRAVITY / 2)); this.x = (this.x + vx); this.y = (this.y + vy); if (y > 0){ this.die(); }; }; } } }//package com.rawkins.games.dolphinOlympics
Section 40
//EndState (com.rawkins.sg.EndState) package com.rawkins.sg { import flash.display.*; import com.rawkins.fsm.*; public class EndState extends Sprite implements State { private var sg:SimpleGame; private var menu:Menu; private var initialized:Boolean;// = false public function EndState(_arg1:SimpleGame):void{ initialized = false; super(); sg = _arg1; menu = new Menu(); menu.addButton(new PlayAgainButton(), sg.startGame); menu.addButton(new BackButton(), sg.initGame); addChild(menu); } public function init():void{ initialized = true; menu.x = (320 - (menu.width / 2)); } public function exit():void{ sg.removeChild(this); } public function update():void{ } public function enter():void{ sg.addChild(this); if (!initialized){ this.init(); }; } } }//package com.rawkins.sg
Section 41
//IntroState (com.rawkins.sg.IntroState) package com.rawkins.sg { import flash.display.*; import com.rawkins.fsm.*; public class IntroState extends MovieClip implements State { protected var sg:SimpleGame; protected var menu:Menu; protected var initialized:Boolean;// = false public function IntroState(_arg1:SimpleGame=null):void{ initialized = false; super(); sg = _arg1; menu = new Menu(); if (sg != null){ menu.addButton(new StartButton(), sg.startGame); }; addChild(menu); } public function enter():void{ sg.addChild(this); menu.focus(); if (!initialized){ this.init(); }; } public function init():void{ initialized = true; menu.x = ((320 - (menu.width / 2)) + 90); menu.y = (240 + 20); } public function exit():void{ sg.removeChild(this); } public function update():void{ } } }//package com.rawkins.sg
Section 42
//KeyController (com.rawkins.sg.KeyController) package com.rawkins.sg { import flash.net.*; import flash.events.*; import flash.display.*; import flash.utils.*; public class KeyController extends EventDispatcher { public const RIGHT:uint = 39; public const LEFT:uint = 37; public const UP:uint = 38; public const DOWN:uint = 40; public const A:uint = 65; public const D:uint = 68; public const S:uint = 83; public const W:uint = 87; protected var rightTimer:Timer; protected var recordTimer:Timer; protected var target:DisplayObject; private var currentCombo:Array; private var combos:Array; private var keyTimer:Timer; protected var inputRecord:Array; protected var downTimer:Timer; public var leftDown:Boolean; protected var startTime:Number; private var checkCombos:Boolean;// = false public var upDown:Boolean; public var rightDown:Boolean; public var downDown:Boolean; private var lastKey:uint; protected var upTimer:Timer; protected var recording:Boolean;// = false private var doubleTapBuffer:Number;// = 2.5 protected var repeatSpeed:uint; protected var playBackTimer:Timer; protected var leftTimer:Timer; public function KeyController(_arg1:DisplayObject){ doubleTapBuffer = 2.5; checkCombos = false; recording = false; super(); this.target = _arg1; this.keyTimer = new Timer(75); this.combos = new Array(); this.currentCombo = new Array(); leftDown = (rightDown = (upDown = (downDown = false))); repeatSpeed = 50; } protected function fireEvent(_arg1:Array):void{ var _local2:KeyboardEvent; _local2 = new KeyboardEvent(_arg1[1]); _local2.keyCode = _arg1[2]; target.dispatchEvent(_local2); } public function enable():void{ this.target.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown, false, 0, true); this.target.addEventListener(KeyboardEvent.KEY_UP, this.onKeyUp, false, 0, true); if (leftDown){ onLeft(); }; if (rightDown){ onRight(); }; if (downDown){ onDown(); }; if (upDown){ onUp(); }; } public function enableCombos():void{ this.checkCombos = true; } protected function onDown():void{ } protected function checkKeys(_arg1:uint):void{ if ((((_arg1 == LEFT)) || ((_arg1 == A)))){ leftDown = false; } else { if ((((_arg1 == RIGHT)) || ((_arg1 == D)))){ rightDown = false; } else { if ((((_arg1 == UP)) || ((_arg1 == W)))){ upDown = false; } else { if ((((_arg1 == DOWN)) || ((_arg1 == S)))){ downDown = false; }; }; }; }; } protected function onLeft():void{ } public function startPlayBack():void{ playBackTimer.start(); } protected function onKeyUp(_arg1:KeyboardEvent):void{ var _local2:*; var _local3:uint; var _local4:Function; if (recording){ recordEvent(_arg1); }; if (checkCombos){ currentCombo.push(_arg1.keyCode); if (keyTimer.running){ if (keyTimer.currentCount < doubleTapBuffer){ _local2 = currentCombo.toString(); _local3 = 0; while (_local3 < combos.length) { if (combos[_local3]["combo"].toString() == _local2){ _local4 = combos[_local3]["func"]; _local4(); break; }; _local3++; }; }; currentCombo = new Array(); keyTimer.stop(); } else { keyTimer.reset(); keyTimer.start(); }; }; checkKeys(_arg1.keyCode); } protected function onKeyDown(_arg1:KeyboardEvent):void{ if ((((((_arg1.keyCode == LEFT)) || ((_arg1.keyCode == A)))) && (!(leftDown)))){ leftDown = true; onLeft(); } else { if ((((((_arg1.keyCode == UP)) || ((_arg1.keyCode == W)))) && (!(upDown)))){ upDown = true; onUp(); } else { if ((((((_arg1.keyCode == RIGHT)) || ((_arg1.keyCode == D)))) && (!(rightDown)))){ rightDown = true; onRight(); } else { if ((((((_arg1.keyCode == DOWN)) || ((_arg1.keyCode == S)))) && (!(downDown)))){ downDown = true; onDown(); }; }; }; }; } public function disableCombos():void{ this.checkCombos = false; } protected function recordEvent(_arg1:KeyboardEvent):void{ var _local2:String; var _local3:uint; var _local4:Date; var _local5:Number; var _local6:Number; var _local7:Array; _local2 = _arg1.type; _local3 = _arg1.keyCode; _local4 = new Date(); _local5 = _local4.time; _local6 = (_local5 - startTime); _local7 = [_local6, _local2, _local3]; inputRecord.push(_local7); } public function startRecord():void{ var _local1:SharedObject; _local1 = SharedObject.getLocal("inputRecord"); if (_local1.data.inputRecord != null){ inputRecord = _local1.data.inputRecord; startPlayBack(); } else { recordTimer.start(); recording = true; }; } protected function record(_arg1:TimerEvent):void{ } protected function onUp():void{ } public function resetKeys():void{ } public function addCombo(_arg1:String, _arg2:Array, _arg3:Function):void{ var _local4:*; _local4 = {name:_arg1, combo:_arg2, func:_arg3}; combos.push(_local4); } public function disable():void{ this.target.removeEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown); this.target.removeEventListener(KeyboardEvent.KEY_UP, this.onKeyUp); rightDown = (leftDown = (downDown = (upDown = false))); checkKeys(this.DOWN); } public function stopRecord():void{ var _local1:SharedObject; recording = false; recordTimer.stop(); _local1 = SharedObject.getLocal("inputRecord"); _local1.data.inputRecord = inputRecord; trace(_local1.data.inputRecord); _local1.flush(); } protected function onRight():void{ } } }//package com.rawkins.sg
Section 43
//MainState (com.rawkins.sg.MainState) package com.rawkins.sg { import flash.events.*; import flash.display.*; import com.rawkins.fsm.*; import flash.text.*; import flash.ui.*; public class MainState extends Sprite implements State { protected var paused:Boolean; protected var background:Sprite; protected var sg:SimpleGame; protected var menu:Menu; protected var debug_txt:TextField; protected var label_txt:TextField; protected var box:Sprite; protected var initialized:Boolean;// = false protected var endMenu:Menu; public function MainState(_arg1:SimpleGame):void{ initialized = false; super(); sg = _arg1; menu = new Menu(); menu.addButton(new BackButton(), sg.initGame); menu.addButton(new ResumeButton(), onResume); endMenu = new Menu(); endMenu.addButton(new PlayAgainButton(), sg.startGame); endMenu.addButton(new BackButton(), sg.initGame); debug_txt = new TextField(); debug_txt.textColor = 0xFFFFFF; debug_txt.x = 50; debug_txt.y = 50; } private function onResume(_arg1:Event):void{ pause(); } public function init():void{ initialized = true; menu.x = (endMenu.x = (320 - (menu.width / 2))); } public function exit():void{ stage.removeEventListener(KeyboardEvent.KEY_DOWN, pause); sg.removeChild(this); if (paused){ paused = false; removeChild(menu); }; if (this.contains(endMenu)){ removeChild(endMenu); }; } public function debug(_arg1:String, _arg2):void{ debug_txt.text = (((_arg1 + ": ") + _arg2) + "\n"); } protected function onKeyDown(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ESCAPE){ pause(); }; } public function update():void{ } public function enter():void{ sg.addChild(this); stage.focus = this; stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); if (!initialized){ init(); }; } public function pause():void{ if (paused){ paused = false; removeChild(menu); stage.focus = this; } else { paused = true; menu.alpha = 0; addChild(menu); menu.fadeIn(); }; } } }//package com.rawkins.sg
Section 44
//Menu (com.rawkins.sg.Menu) package com.rawkins.sg { import flash.events.*; import flash.display.*; import com.rawkins.fx.*; import flash.text.*; public class Menu extends Sprite { private var title_txt:TextField; private var bgColor:uint; private var padding:Array; private var anim:Anim; private var _title:String; private var items:Array; public function Menu(_arg1:String=null, _arg2:uint=0xFFFFFF, _arg3:Number=450, _arg4:Number=350, _arg5:Number=10, _arg6:Number=10, _arg7:Number=50):void{ items = new Array(); if (_arg1 != null){ addMenuTitle(_arg1); title = _arg1; }; padding = [_arg7, (_arg7 / 4), _arg7, (_arg7 / 4)]; anim = new Anim(); } public function fadeOut():void{ anim.fade("out", this, 20); } public function addItem(_arg1:String, _arg2:Function):void{ var _local3:Sprite; var _local4:TextField; _local3 = new Sprite(); _local3.graphics.lineStyle(1, 1, 1); _local3.graphics.beginFill(0xFFFFFF); _local3.graphics.drawRect(0, 0, 200, 30); addChild(_local3); _local4 = new TextField(); _local4.name = _arg1; _local4.text = _arg1; items.push([_arg1, _arg2, _local3]); _local3.y = (_local3.y + (this.numItems * padding[0])); _local3.x = (_local3.x + padding[3]); _local4.selectable = false; _local3.addChild(_local4); _local3.buttonMode = true; _local3.addEventListener(MouseEvent.CLICK, _arg2); } public function get title():String{ return (_title); } public function addButton(_arg1:SimpleButton, _arg2:Function):void{ if (_arg1.name == null){ _arg1.name = ("Button" + this.numItems); }; items.push([_arg1.name, _arg2, _arg1]); addChild(_arg1); _arg1.y = (_arg1.y + (this.numItems * padding[0])); _arg1.addEventListener(MouseEvent.CLICK, _arg2); _arg1.focusRect = true; } private function onFadeIn(_arg1:Event):void{ } private function addMenuTitle(_arg1:String):void{ title_txt = new TextField(); addChild(title_txt); title_txt.width = 500; title_txt.height = 200; } public function keyDown(_arg1:KeyboardEvent):void{ } public function addBG(_arg1:DisplayObject):void{ this.addChildAt(_arg1, 0); } public function set title(_arg1:String):void{ name = _arg1; _title = _arg1; title_txt.htmlText = (("<h1 class=\"menuTitle\">" + _title) + "</h1>"); } public function removeItem(_arg1:String):Boolean{ var _local2:uint; _local2 = 0; while (_local2 < this.numItems) { if (items[_local2][0] == _arg1){ removeChild(items[_local2][2]); items.splice(_local2, 1); return (true); }; _local2++; }; return (false); } public function fadeIn():void{ anim.fade("in", this, 20); addEventListener(anim.FADE_DONE, onFadeIn); stage.focus = items[0][2]; } public function get numItems():uint{ return (items.length); } public function focus():void{ if (stage != null){ stage.focus = items[0][2]; }; } } }//package com.rawkins.sg
Section 45
//MathSG (com.rawkins.utils.MathSG) package com.rawkins.utils { public class MathSG { public function MathSG():void{ } public static function normRad(_arg1:Number):Number{ var _local2:Number; _local2 = (2 * Math.PI); if (_arg1 < 0){ _arg1 = (_arg1 + _local2); } else { if (_arg1 > _local2){ _arg1 = (_arg1 - _local2); }; }; return (_arg1); } public static function randNum(_arg1:Number, _arg2:Number):Number{ return ((Math.floor((Math.random() * (_arg2 - _arg1))) + _arg1)); } public static function rad(_arg1:Number):Number{ return (((_arg1 * Math.PI) / 180)); } public static function deg(_arg1:Number):Number{ return (((_arg1 * 180) / Math.PI)); } public static function roundTo(_arg1:Number, _arg2:int):Number{ var _local3:int; var _local4:Number; _local3 = Math.pow(10, _arg2); _local4 = Math.round((_arg1 * _local3)); return ((_local4 / _local3)); } public static function checkMax(_arg1:Number, _arg2:Number):Number{ if (_arg1 > _arg2){ _arg1 = _arg2; } else { if (_arg1 < -(_arg2)){ _arg1 = -(_arg2); }; }; return (_arg1); } public static function normalize(_arg1:Number):Number{ if (_arg1 < 0){ _arg1 = (_arg1 + 360); } else { if (_arg1 > 360){ _arg1 = (_arg1 - 360); }; }; return (_arg1); } } }//package com.rawkins.utils
Section 46
//SoundLoop (com.rawkins.utils.SoundLoop) package com.rawkins.utils { import flash.events.*; import flash.media.*; import flash.utils.*; public class SoundLoop { private var channel:SoundChannel; private var fadeTransform:SoundTransform; private var fadingOut:Boolean;// = false private var sound:Sound; private var volume:Number; private var fadeTimer:Timer; private var fadeSpeed:Number;// = 0.05 private var transform:SoundTransform; private var playing:Boolean;// = false private var pausePoint:Number;// = 0 private var fadingIn:Boolean;// = false public function SoundLoop(_arg1:Sound, _arg2:Number):void{ pausePoint = 0; playing = false; fadeSpeed = 0.05; fadingIn = false; fadingOut = false; super(); this.sound = _arg1; transform = new SoundTransform(_arg2); fadeTransform = new SoundTransform(_arg2); fadeTimer = new Timer(100); this.volume = _arg2; } private function onFadeIn(_arg1:Event):void{ fadeTransform.volume = (fadeTransform.volume + fadeSpeed); channel.soundTransform = fadeTransform; if (fadeTransform.volume >= volume){ endFadeIn(); }; } public function fadeIn():void{ if (fadingOut){ endFadeOut(); }; fadingIn = true; fadeTransform.volume = 0; channel = resume(); channel.soundTransform = fadeTransform; fadeTimer.addEventListener(TimerEvent.TIMER, onFadeIn); fadeTimer.start(); } private function onSoundComplete(_arg1:Event):void{ channel = sound.play(0, 99999); channel.soundTransform = transform; channel.removeEventListener(Event.SOUND_COMPLETE, onSoundComplete); } private function endFadeIn(){ fadeTimer.stop(); fadeTimer.removeEventListener(TimerEvent.TIMER, onFadeIn); fadingIn = false; } public function play():SoundChannel{ channel = sound.play(0, 99999); channel.soundTransform = transform; playing = true; return (channel); } private function onFadeOut(_arg1:Event):void{ fadeTransform.volume = (fadeTransform.volume - fadeSpeed); if (fadeTransform.volume <= 0){ endFadeOut(); } else { channel.soundTransform = fadeTransform; }; } private function endFadeOut():void{ this.pause(); fadeTimer.stop(); fadeTimer.removeEventListener(TimerEvent.TIMER, onFadeOut); fadingOut = false; } public function resume():SoundChannel{ if (!playing){ playing = true; channel = sound.play(pausePoint); if (channel != null){ channel.soundTransform = transform; channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete); }; }; return (channel); } public function fadeOut():void{ if (fadingIn){ endFadeIn(); }; fadeTransform.volume = volume; fadeTimer.addEventListener(TimerEvent.TIMER, onFadeOut); fadeTimer.start(); } public function pause():SoundChannel{ if (playing){ if (channel != null){ pausePoint = channel.position; channel.stop(); } else { pausePoint = 0; }; playing = false; }; return (channel); } } }//package com.rawkins.utils
Section 47
//Path (com.senocular.drawing.Path) package com.senocular.drawing { import flash.geom.*; public class Path { protected var _length:Number;// = 0 protected var _position:Point; protected var _moveToHasLength:Boolean;// = false private var _lengthValid:Boolean;// = true protected var _segments:Array; public function Path():void{ _lengthValid = true; _length = 0; _moveToHasLength = false; super(); init(); } public function draw(_arg1, _arg2:Number=0, _arg3:Number=1):void{ var _local4:Array; var _local5:int; var _local6:int; _arg2 = cleant(_arg2, 0); _arg3 = cleant(_arg3, 1); if (_arg3 < _arg2){ draw(_arg1, _arg2, 1); draw(_arg1, 0, _arg3); return; }; _local4 = getSegmentsToDraw(_arg2, _arg3); if (_local4.length){ _arg1.moveTo(_local4[0]._start.x, _local4[0]._start.y); _local5 = _local4.length; _local6 = 0; while (_local6 < _local5) { _local4[_local6].draw(_arg1); _local6++; }; }; } private function cleant(_arg1:Number, _arg2:Number=0):Number{ if (isNaN(_arg1)){ _arg1 = _arg2; } else { if ((((_arg1 < 0)) || ((_arg1 > 1)))){ _arg1 = (_arg1 % 1); if (_arg1 == 0){ _arg1 = _arg2; } else { if (_arg1 < 0){ _arg1 = (_arg1 + 1); }; }; }; }; return (_arg1); } public function traceSegments():void{ var _local1:uint; _local1 = 0; while (_local1 < _segments.length) { trace(_segments[_local1]); _local1++; }; } public function clear():void{ init(); } public function curveTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{ var _local5:Point; _lengthValid = false; _local5 = new Point(_arg3, _arg4); _segments.push(new PathCurveSegment(_position, new Point(_arg1, _arg2), _local5)); _position = _local5; } public function set position(_arg1:Point):void{ _position = _arg1.clone(); _segments.push(new PathSegment(_position)); } public function get moveToHasLength():Boolean{ return (_moveToHasLength); } public function lineTo(_arg1:Number, _arg2:Number):void{ var _local3:Point; _lengthValid = false; _local3 = new Point(_arg1, _arg2); _segments.push(new PathLineSegment(_position, _local3)); _position = _local3; } private function init():void{ _lengthValid = false; _segments = new Array(); _position = new Point(0, 0); } private function getSegmentsToDraw(_arg1:Number, _arg2:Number):Array{ var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:int; var _local8:int; var _local9:Number; var _local10:Number; var _local11:Array; var _local12:PathSegment; var _local13:int; var _local14:int; var _local15:int; _local3 = (_arg1 * length); _local4 = (_arg2 * length); _local5 = 0; _local6 = 0; _local7 = -1; _local8 = -1; _local9 = 0; _local10 = 1; _local11 = new Array(); _local13 = _segments.length; _local14 = 0; for (;_local14 < _local13;_local14++) { _local12 = _segments[_local14]; if (((((_moveToHasLength) || (!((_local12._command == "moveTo"))))) && (_local12.length))){ _local5 = (_local5 + _local12.length); } else { continue; }; if ((((_local3 < _local5)) && ((_local7 == -1)))){ _local7 = _local14; _local9 = ((_arg1)==0) ? 0 : ((_local3 - _local6) / _local12.length); }; if (_local4 <= _local5){ _local8 = _local14; _local10 = ((_arg2)==1) ? 1 : ((_local4 - _local6) / _local12.length); break; }; _local6 = _local5; }; if ((((_local7 < 0)) || ((_local8 < 0)))){ return (_local11); }; _local11 = _segments.slice(_local7, (_local8 + 1)); if (_local7 == _local8){ if (((!((_local9 == 0))) || (!((_local10 == 1))))){ _local11[0] = _local11[0].segment(_local9, _local10); }; } else { if (_local9 != 0){ _local11[0] = _local11[0].segment(_local9, 1); }; if (_local10 != 1){ _local15 = (_local11.length - 1); _local11[_local15] = _local11[_local15].segment(0, _local10); }; }; return (_local11); } public function pointAt(_arg1:Number):Point{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:PathSegment; var _local6:int; var _local7:int; var _local8:int; _arg1 = cleant(_arg1); if (_arg1 == 0){ return (_segments[0].pointAt(_arg1)); }; if (_arg1 == 1){ _local8 = (_segments.length - 1); return (_segments[_local8].pointAt(_arg1)); }; _local2 = (_arg1 * length); _local3 = 0; _local4 = 0; _local6 = _segments.length; _local7 = 0; for (;_local7 < _local6;_local7++) { _local5 = _segments[_local7]; if (((((_moveToHasLength) || (!((_local5._command == "moveTo"))))) && (_local5.length))){ _local3 = (_local3 + _local5.length); } else { continue; }; if (_local2 <= _local3){ return (_local5.pointAt(((_local2 - _local4) / _local5.length))); }; _local4 = _local3; }; return (new Point(0, 0)); } public function get length():Number{ var _local1:PathSegment; var _local2:int; if (!_lengthValid){ _lengthValid = true; _length = 0; _local2 = _segments.length; while (_local2--) { _local1 = _segments[_local2]; if (((_moveToHasLength) || (!((_local1 is PathMoveSegment))))){ _length = (_length + _local1.length); }; }; }; return (_length); } public function set moveToHasLength(_arg1:Boolean):void{ _lengthValid = false; _moveToHasLength = _arg1; } public function get position():Point{ return (_position.clone()); } public function circleTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{ var _local5:Point; _lengthValid = false; _local5 = new Point(_arg3, _arg4); _segments.push(new PathCircleSegment(_position, new Point(_arg1, _arg2), _local5)); _position = _local5; } public function moveTo(_arg1:Number, _arg2:Number):void{ var _local3:Point; if (_moveToHasLength){ _lengthValid = false; }; _local3 = new Point(_arg1, _arg2); _segments.push(new PathMoveSegment(_position, _local3)); _position = _local3; } public function angleAt(_arg1:Number):Number{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:PathSegment; var _local6:int; var _local7:int; _arg1 = cleant(_arg1); _local2 = (_arg1 * length); _local3 = 0; _local4 = 0; _local6 = _segments.length; _local7 = 0; for (;_local7 < _local6;_local7++) { _local5 = _segments[_local7]; if (((((_moveToHasLength) || (!((_local5._command == "moveTo"))))) && (_local5.length))){ _local3 = (_local3 + _local5.length); } else { continue; }; if (_local2 <= _local3){ return (_local5.angleAt(((_local2 - _local4) / _local5.length))); }; _local4 = _local3; }; return (0); } } }//package com.senocular.drawing import flash.geom.*; class PathLineSegment extends PathSegment { private function PathLineSegment(_arg1:Point, _arg2:Point){ super(_arg1); _end = _arg2.clone(); _command = "lineTo"; _constructor = prototype.constructor; } private function segment(_arg1:Number, _arg2:Number):PathSegment{ var _local3:PathSegment; if (_arg2 == 1){ if (_arg1 == 0){ return (this); }; return (trim(_arg1, true)); }; _local3 = trim(_arg2); if (_arg1 != 0){ _local3 = _local3.trim((_arg1 / _arg2), true); }; return (_local3); } override private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{ var _local3:Point; var _local4:Point; var _local5:Point; var _local6:Point; var _local7:Number; var _local8:Number; if (_arg2){ _local4 = _start; _local3 = _end; _arg1 = (1 - _arg1); } else { _local3 = _start; _local4 = _end; }; _local5 = _local3; _local6 = _local3; _local7 = (_local4.x - _local3.x); _local8 = (_local4.y - _local3.y); if (_arg2){ _local5 = new Point((_local3.x + (_local7 * _arg1)), (_local3.y + (_local8 * _arg1))); } else { _local6 = new Point((_local3.x + (_local7 * _arg1)), (_local3.y + (_local8 * _arg1))); }; return (new _constructor(_local5, _local6)); } override private function get length():Number{ if (isNaN(_length)){ _length = lineLength(); }; return (_length); } protected function lineLength(_arg1:Point=null, _arg2:Point=null):Number{ var _local3:Number; var _local4:Number; if (!_arg1){ _arg1 = _start; }; if (!_arg2){ _arg2 = _end; }; _local3 = (_arg2.x - _arg1.x); _local4 = (_arg2.y - _arg1.y); return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4)))); } override private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{ var _local4:Number; var _local5:Number; if (!_arg2){ _arg2 = _start; }; if (!_arg3){ _arg3 = _end; }; _local4 = (_arg3.x - _arg2.x); _local5 = (_arg3.y - _arg2.y); return (new Point((_arg2.x + (_local4 * _arg1)), (_arg2.y + (_local5 * _arg1)))); } override private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{ if (!_arg2){ _arg2 = _start; }; if (!_arg3){ _arg3 = _end; }; return (Math.atan2((_arg3.y - _arg2.y), (_arg3.x - _arg2.x))); } } class PathMoveSegment extends PathLineSegment { private function PathMoveSegment(_arg1:Point, _arg2:Point){ super(_arg1, _arg2); _command = "moveTo"; _constructor = prototype.constructor; } } class PathCurveSegment extends PathLineSegment { private var _control:Point; private function PathCurveSegment(_arg1:Point, _arg2:Point, _arg3:Point){ super(_arg1, _arg3); _control = _arg2.clone(); _command = "curveTo"; _constructor = prototype.constructor; } override private function draw(_arg1):void{ var _local2 = _arg1; _local2[command](_control.x, _control.y, _end.x, _end.y); } private function get control():Point{ return (_control.clone()); } override private function get length():Number{ if (isNaN(_length)){ _length = curveLength(); }; return (_length); } override private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{ var _local3:Point; var _local4:Point; var _local5:Point; var _local6:Point; var _local7:Point; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; if (_arg2){ _local4 = _start; _local3 = _end; _arg1 = (1 - _arg1); } else { _local3 = _start; _local4 = _end; }; _local5 = _local3; _local7 = _local3; _local8 = (_control.x - _local3.x); _local9 = (_control.y - _local3.y); _local10 = (_local4.x - _control.x); _local11 = (_local4.y - _control.y); _local6 = new Point((_local3.x + (_local8 * _arg1)), (_local3.y + (_local9 * _arg1))); _local12 = ((_control.x + (_local10 * _arg1)) - _local6.x); _local13 = ((_control.y + (_local11 * _arg1)) - _local6.y); if (_arg2){ _local5 = new Point((_local6.x + (_local12 * _arg1)), (_local6.y + (_local13 * _arg1))); } else { _local7 = new Point((_local6.x + (_local12 * _arg1)), (_local6.y + (_local13 * _arg1))); }; return (new _constructor(_local5, _local6, _local7)); } override private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{ var _local4:Point; var _local5:Point; _local4 = Point.interpolate(_control, _start, _arg1); _local5 = Point.interpolate(_end, _control, _arg1); return (Point.interpolate(_local5, _local4, _arg1)); } override private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{ _arg2 = super.pointAt(_arg1, _start, _control); _arg3 = super.pointAt(_arg1, _control, _end); return (super.angleAt(_arg1, _arg2, _arg3)); } private function curveLength(_arg1:Point=null, _arg2:Point=null, _arg3:Point=null):Number{ var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Point; var _local13:Point; var _local14:int; if (!_arg1){ _arg1 = _start; }; if (!_arg2){ _arg2 = _control; }; if (!_arg3){ _arg3 = _end; }; _local4 = (_arg3.x - _arg1.x); _local5 = (_arg3.y - _arg1.y); _local6 = ((_local4)==0) ? 0 : ((_arg2.x - _arg1.x) / _local4); _local7 = ((_local5)==0) ? 0 : ((_arg2.y - _arg1.y) / _local5); _local11 = 0; _local12 = _arg1; _local14 = 1; while (_local14 < curveAccuracy) { _local10 = (_local14 / curveAccuracy); _local8 = ((2 * _local10) * (1 - _local10)); _local9 = (_local10 * _local10); _local13 = new Point((_arg1.x + (_local4 * ((_local8 * _local6) + _local9))), (_arg1.y + (_local5 * ((_local8 * _local7) + _local9)))); _local11 = (_local11 + lineLength(_local12, _local13)); _local12 = _local13; _local14++; }; return ((_local11 + lineLength(_local12, _arg3))); } } class PathSegment { private var _start:Point; protected var _length:Number; private var _command:String;// = "moveTo" private var _constructor:Class; private var _end:Point; private static var curveAccuracy:int = 5; private function PathSegment(_arg1:Point){ _command = "moveTo"; super(); _start = _arg1.clone(); _end = _start; _constructor = prototype.constructor; } private function get start():Point{ return (_start.clone()); } private function toString():String{ return ((("[" + command) + "]")); } private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{ return (this); } private function get command():String{ return (_command); } private function get length():Number{ return (0); } private function draw(_arg1):void{ var _local2 = _arg1; _local2[command](_end.x, _end.y); } private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{ return (_start.clone()); } private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{ return (0); } private function get end():Point{ return (_end.clone()); } } class PathCircleSegment extends PathLineSegment { private var angleEnd:Number;// = 0 private var radius:Number;// = 0 private var angleStart:Number;// = 0 private var arc:Number;// = 0 private var _control:Point; private var _center:Point; private function PathCircleSegment(_arg1:Point, _arg2:Point, _arg3:Point){ radius = 0; angleStart = 0; angleEnd = 0; arc = 0; super(_arg1, _arg3); _control = _arg2.clone(); _command = "circleTo"; _center = getCircleCenter(_start, _control, _end); _constructor = prototype.constructor; if (_center){ radius = lineLength(_start, _center); angleStart = Math.atan2((_start.y - _center.y), (_start.x - _center.x)); angleEnd = Math.atan2((_end.y - _center.y), (_end.x - _center.x)); if (angleEnd < angleStart){ angleEnd = (angleEnd + (Math.PI * 2)); }; arc = (angleEnd - angleStart); }; } override private function draw(_arg1):void{ var _local2:Number; var _local3:Number; var _local4:int; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:int; if (!_center){ return; }; _local2 = angleStart; _local4 = (Math.floor((arc / (Math.PI / 4))) + 1); _local5 = (arc / (2 * _local4)); _local6 = Math.cos(_local5); _local7 = (_local6) ? (radius / _local6) : 0; _local8 = 0; while (_local8 < _local4) { _local3 = (_local2 + _local5); _local2 = (_local3 + _local5); _arg1.curveTo((_center.x + (Math.cos(_local3) * _local7)), (_center.y + (Math.sin(_local3) * _local7)), (_center.x + (Math.cos(_local2) * radius)), (_center.y + (Math.sin(_local2) * radius))); _local8++; }; } private function getCircleCenter(_arg1:Point, _arg2:Point, _arg3:Point):Point{ var _local4:Point; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; if ((((_arg1.x == _arg2.x)) || ((_arg1.y == _arg2.y)))){ _local4 = _arg1; _arg1 = _arg3; _arg3 = _local4; }; if (_arg2.x == _arg3.x){ _local4 = _arg1; _arg1 = _arg2; _arg2 = _local4; }; if ((((_arg1.x == _arg2.x)) || ((_arg2.x == _arg3.x)))){ return (null); }; _local5 = ((_arg2.y - _arg1.y) / (_arg2.x - _arg1.x)); _local6 = ((_arg3.y - _arg2.y) / (_arg3.x - _arg2.x)); if (_local5 == _local6){ return (null); }; _local7 = (_arg1.x + _arg2.x); _local8 = (_arg2.x + _arg3.x); _local9 = (((((_local5 * _local6) * (_arg1.y - _arg3.y)) + (_local6 * _local7)) - (_local5 * _local8)) / (2 * (_local6 - _local5))); _local10 = (_local5) ? (((_arg1.y + _arg2.y) / 2) - ((_local9 - (_local7 / 2)) / _local5)) : (((_arg2.y + _arg3.y) / 2) - ((_local9 - (_local8 / 2)) / _local6)); return (new Point(_local9, _local10)); } private function get control():Point{ return (_control.clone()); } override private function get length():Number{ if (isNaN(_length)){ _length = circleLength(); }; return (_length); } override private function trim(_arg1:Number, _arg2:Boolean=false):PathSegment{ var _local3:Point; var _local4:Point; var _local5:Point; var _local6:Point; var _local7:Point; var _local8:Number; if (_arg2){ _local4 = _start; _local3 = _end; } else { _local3 = _start; _local4 = _end; }; _local5 = _local3; _local7 = _local3; _local8 = (angleStart + (_arg1 * arc)); if (_arg2){ _local5 = new Point((_center.x + (Math.cos(_local8) * radius)), (_center.y + (Math.sin(_local8) * radius))); _local8 = ((angleEnd + _local8) / 2); } else { _local7 = new Point((_center.x + (Math.cos(_local8) * radius)), (_center.y + (Math.sin(_local8) * radius))); _local8 = ((angleStart + _local8) / 2); }; _local6 = new Point((_center.x + (Math.cos(_local8) * radius)), (_center.y + (Math.sin(_local8) * radius))); return (new _constructor(_local5, _local6, _local7)); } override private function pointAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Point{ var _local4:Number; if (!_center){ return (_start.clone()); }; _local4 = (angleStart + (_arg1 * arc)); return (new Point((_center.x + (Math.cos(_local4) * radius)), (_center.y + (Math.sin(_local4) * radius)))); } override private function angleAt(_arg1:Number, _arg2:Point=null, _arg3:Point=null):Number{ var _local4:Number; _local4 = (((angleStart + (_arg1 * arc)) + (Math.PI / 2)) % (Math.PI * 2)); if (_local4 > Math.PI){ _local4 = (_local4 - (Math.PI * 2)); } else { if (_local4 < -(Math.PI)){ _local4 = (_local4 + (Math.PI * 2)); }; }; return (_local4); } private function circleLength():Number{ return ((radius * arc)); } }
Section 48
//loadtext_5 (do2_free_fla.loadtext_5) package do2_free_fla { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.filters.*; import flash.system.*; import flash.ui.*; import flash.accessibility.*; import flash.errors.*; public dynamic class loadtext_5 extends MovieClip { public function loadtext_5(){ addFrameScript(16, frame17); } function frame17(){ gotoAndPlay(1); } } }//package do2_free_fla
Section 49
//MainTimeline (do2_free_fla.MainTimeline) package do2_free_fla { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.filters.*; import flash.system.*; import flash.ui.*; import flash.accessibility.*; import flash.errors.*; public dynamic class MainTimeline extends MovieClip { public var app; public var outline:MovieClip; public var rawkinsTimer:Timer; public var loadBar:MovieClip; public var centerY; public var centerX; public var loadtxt:MovieClip; public function MainTimeline(){ addFrameScript(0, frame1, 1, frame2, 16, frame17, 18, frame19, 30, frame31); } public function rawLogoDone(_arg1:Event):void{ rawkinsTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, rawLogoDone); rawkinsTimer.stop(); play(); } function frame1(){ MochiAd.showPreloaderAd({clip:this.root, id:"a49656eb15613d29", res:"640x480"}); } function frame19(){ gotoAndStop("loader"); } function frame17(){ stop(); this.addEventListener("enterFrame", onEnterFrame); } function frame2(){ stop(); centerX = (stage.stageWidth / 2); centerY = (stage.stageHeight / 2); rawkinsTimer = new Timer(3000, 1); rawkinsTimer.addEventListener(TimerEvent.TIMER_COMPLETE, rawLogoDone); rawkinsTimer.start(); } function frame31(){ stop(); app = new App(); addChild(app); } public function onEnterFrame(_arg1:Event){ var _local2:Number; _local2 = (this.root.loaderInfo.bytesLoaded / this.root.loaderInfo.bytesTotal); loadBar.scaleX = _local2; if (this.root.loaderInfo.bytesLoaded == this.root.loaderInfo.bytesTotal){ this.removeEventListener("enterFrame", onEnterFrame); removeChild(loadtxt); removeChild(outline); removeChild(loadBar); gotoAndPlay("gameStart"); }; } } }//package do2_free_fla
Section 50
//movingWaves_13 (do2_free_fla.movingWaves_13) package do2_free_fla { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.filters.*; import flash.system.*; import flash.ui.*; import flash.accessibility.*; import flash.errors.*; public dynamic class movingWaves_13 extends MovieClip { public function movingWaves_13(){ addFrameScript(89, frame90); } function frame90(){ gotoAndPlay(1); } } }//package do2_free_fla
Section 51
//rawkinsLogo_1 (do2_free_fla.rawkinsLogo_1) package do2_free_fla { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.filters.*; import flash.system.*; import flash.ui.*; import flash.accessibility.*; import flash.errors.*; public dynamic class rawkinsLogo_1 extends MovieClip { public function rawkinsLogo_1(){ addFrameScript(14, frame15); } function frame15(){ stop(); } } }//package do2_free_fla
Section 52
//BaseScrollPane (fl.containers.BaseScrollPane) package fl.containers { import fl.core.*; import flash.events.*; import flash.display.*; import flash.geom.*; import fl.controls.*; import fl.events.*; public class BaseScrollPane extends UIComponent { protected var defaultLineScrollSize:Number;// = 4 protected var _maxHorizontalScrollPosition:Number;// = 0 protected var vScrollBar:Boolean; protected var disabledOverlay:Shape; protected var hScrollBar:Boolean; protected var availableWidth:Number; protected var _verticalPageScrollSize:Number;// = 0 protected var vOffset:Number;// = 0 protected var _verticalScrollBar:ScrollBar; protected var useFixedHorizontalScrolling:Boolean;// = false protected var contentWidth:Number;// = 0 protected var contentHeight:Number;// = 0 protected var _horizontalPageScrollSize:Number;// = 0 protected var background:DisplayObject; protected var _useBitmpScrolling:Boolean;// = false protected var contentPadding:Number;// = 0 protected var availableHeight:Number; protected var _horizontalScrollBar:ScrollBar; protected var contentScrollRect:Rectangle; protected var _horizontalScrollPolicy:String; protected var _verticalScrollPolicy:String; protected static const SCROLL_BAR_STYLES:Object = {upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"}; private static var defaultStyles:Object = {repeatDelay:500, repeatInterval:35, skin:"ScrollPane_upSkin", contentPadding:0, disabledAlpha:0.5}; public function BaseScrollPane(){ contentWidth = 0; contentHeight = 0; contentPadding = 0; vOffset = 0; _maxHorizontalScrollPosition = 0; _horizontalPageScrollSize = 0; _verticalPageScrollSize = 0; defaultLineScrollSize = 4; useFixedHorizontalScrolling = false; _useBitmpScrolling = false; super(); } protected function handleWheel(_arg1:MouseEvent):void{ if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){ return; }; _verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize)); setVerticalScrollPosition(_verticalScrollBar.scrollPosition); dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition)); } public function get verticalScrollPosition():Number{ return (_verticalScrollBar.scrollPosition); } protected function drawDisabledOverlay():void{ if (enabled){ if (contains(disabledOverlay)){ removeChild(disabledOverlay); }; } else { disabledOverlay.x = (disabledOverlay.y = contentPadding); disabledOverlay.width = availableWidth; disabledOverlay.height = availableHeight; disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number); addChild(disabledOverlay); }; } public function set verticalScrollPosition(_arg1:Number):void{ drawNow(); _verticalScrollBar.scrollPosition = _arg1; setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false); } protected function setContentSize(_arg1:Number, _arg2:Number):void{ if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){ return; }; contentWidth = _arg1; contentHeight = _arg2; invalidate(InvalidationType.SIZE); } public function get horizontalScrollPosition():Number{ return (_horizontalScrollBar.scrollPosition); } public function get horizontalScrollBar():ScrollBar{ return (_horizontalScrollBar); } override public function set enabled(_arg1:Boolean):void{ if (enabled == _arg1){ return; }; _verticalScrollBar.enabled = _arg1; _horizontalScrollBar.enabled = _arg1; super.enabled = _arg1; } public function get verticalLineScrollSize():Number{ return (_verticalScrollBar.lineScrollSize); } public function get horizontalScrollPolicy():String{ return (_horizontalScrollPolicy); } protected function calculateAvailableSize():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local1 = ScrollBar.WIDTH; _local2 = (contentPadding = Number(getStyleValue("contentPadding"))); _local3 = ((height - (2 * _local2)) - vOffset); vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3))))); _local4 = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2)); _local5 = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4); hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0))))); if (hScrollBar){ _local3 = (_local3 - _local1); }; if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){ vScrollBar = true; _local4 = (_local4 - _local1); }; availableHeight = (_local3 + vOffset); availableWidth = _local4; } public function get maxVerticalScrollPosition():Number{ drawNow(); return (Math.max(0, (contentHeight - availableHeight))); } public function set horizontalScrollPosition(_arg1:Number):void{ drawNow(); _horizontalScrollBar.scrollPosition = _arg1; setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false); } public function get horizontalLineScrollSize():Number{ return (_horizontalScrollBar.lineScrollSize); } public function set verticalPageScrollSize(_arg1:Number):void{ _verticalPageScrollSize = _arg1; invalidate(InvalidationType.SIZE); } public function get verticalScrollPolicy():String{ return (_verticalScrollPolicy); } protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ } public function get useBitmapScrolling():Boolean{ return (_useBitmpScrolling); } protected function handleScroll(_arg1:ScrollEvent):void{ if (_arg1.target == _verticalScrollBar){ setVerticalScrollPosition(_arg1.position); } else { setHorizontalScrollPosition(_arg1.position); }; } public function set verticalLineScrollSize(_arg1:Number):void{ _verticalScrollBar.lineScrollSize = _arg1; } public function get verticalScrollBar():ScrollBar{ return (_verticalScrollBar); } protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ } public function set horizontalPageScrollSize(_arg1:Number):void{ _horizontalPageScrollSize = _arg1; invalidate(InvalidationType.SIZE); } override protected function draw():void{ if (isInvalid(InvalidationType.STYLES)){ setStyles(); drawBackground(); if (contentPadding != getStyleValue("contentPadding")){ invalidate(InvalidationType.SIZE, false); }; }; if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){ drawLayout(); }; updateChildren(); super.draw(); } public function set horizontalScrollPolicy(_arg1:String):void{ _horizontalScrollPolicy = _arg1; invalidate(InvalidationType.SIZE); } override protected function configUI():void{ var _local1:Graphics; super.configUI(); contentScrollRect = new Rectangle(0, 0, 85, 85); _verticalScrollBar = new ScrollBar(); _verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true); _verticalScrollBar.visible = false; _verticalScrollBar.lineScrollSize = defaultLineScrollSize; addChild(_verticalScrollBar); copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES); _horizontalScrollBar = new ScrollBar(); _horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL; _horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true); _horizontalScrollBar.visible = false; _horizontalScrollBar.lineScrollSize = defaultLineScrollSize; addChild(_horizontalScrollBar); copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES); disabledOverlay = new Shape(); _local1 = disabledOverlay.graphics; _local1.beginFill(0xFFFFFF); _local1.drawRect(0, 0, width, height); _local1.endFill(); addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true); } protected function calculateContentWidth():void{ } public function get verticalPageScrollSize():Number{ if (isNaN(availableHeight)){ drawNow(); }; return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize); } protected function drawLayout():void{ calculateAvailableSize(); calculateContentWidth(); background.width = width; background.height = height; if (vScrollBar){ _verticalScrollBar.visible = true; _verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding); _verticalScrollBar.y = contentPadding; _verticalScrollBar.height = availableHeight; } else { _verticalScrollBar.visible = false; }; _verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize); setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false); if (hScrollBar){ _horizontalScrollBar.visible = true; _horizontalScrollBar.x = contentPadding; _horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding); _horizontalScrollBar.width = availableWidth; } else { _horizontalScrollBar.visible = false; }; _horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize); setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false); drawDisabledOverlay(); } protected function drawBackground():void{ var _local1:DisplayObject; _local1 = background; background = getDisplayObjectInstance(getStyleValue("skin")); background.width = width; background.height = height; addChildAt(background, 0); if (((!((_local1 == null))) && (!((_local1 == background))))){ removeChild(_local1); }; } public function set horizontalLineScrollSize(_arg1:Number):void{ _horizontalScrollBar.lineScrollSize = _arg1; } public function get horizontalPageScrollSize():Number{ if (isNaN(availableWidth)){ drawNow(); }; return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize); } public function get maxHorizontalScrollPosition():Number{ drawNow(); return (Math.max(0, (contentWidth - availableWidth))); } protected function setStyles():void{ copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES); copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES); } protected function updateChildren():void{ _verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled); _verticalScrollBar.drawNow(); _horizontalScrollBar.drawNow(); } public function set verticalScrollPolicy(_arg1:String):void{ _verticalScrollPolicy = _arg1; invalidate(InvalidationType.SIZE); } public function set useBitmapScrolling(_arg1:Boolean):void{ _useBitmpScrolling = _arg1; invalidate(InvalidationType.STATE); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition())); } } }//package fl.containers
Section 53
//CellRenderer (fl.controls.listClasses.CellRenderer) package fl.controls.listClasses { import flash.events.*; import fl.controls.*; public class CellRenderer extends LabelButton implements ICellRenderer { protected var _data:Object; protected var _listData:ListData; private static var defaultStyles:Object = {upSkin:"CellRenderer_upSkin", downSkin:"CellRenderer_downSkin", overSkin:"CellRenderer_overSkin", disabledSkin:"CellRenderer_disabledSkin", selectedDisabledSkin:"CellRenderer_selectedDisabledSkin", selectedUpSkin:"CellRenderer_selectedUpSkin", selectedDownSkin:"CellRenderer_selectedDownSkin", selectedOverSkin:"CellRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5}; public function CellRenderer():void{ toggle = true; focusEnabled = false; } override protected function toggleSelected(_arg1:MouseEvent):void{ } override public function get selected():Boolean{ return (super.selected); } public function set listData(_arg1:ListData):void{ _listData = _arg1; label = _listData.label; setStyle("icon", _listData.icon); } override public function set selected(_arg1:Boolean):void{ super.selected = _arg1; } public function set data(_arg1:Object):void{ _data = _arg1; } public function get listData():ListData{ return (_listData); } override public function setSize(_arg1:Number, _arg2:Number):void{ super.setSize(_arg1, _arg2); } override protected function drawLayout():void{ var _local1:Number; var _local2:Number; var _local3:Number; _local1 = Number(getStyleValue("textPadding")); _local2 = 0; if (icon != null){ icon.x = _local1; icon.y = Math.round(((height - icon.height) >> 1)); _local2 = (icon.width + _local1); }; if (label.length > 0){ textField.visible = true; _local3 = Math.max(0, ((width - _local2) - (_local1 * 2))); textField.width = _local3; textField.height = (textField.textHeight + 4); textField.x = (_local2 + _local1); textField.y = Math.round(((height - textField.height) >> 1)); } else { textField.visible = false; }; background.width = width; background.height = height; } public function get data():Object{ return (_data); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls.listClasses
Section 54
//ICellRenderer (fl.controls.listClasses.ICellRenderer) package fl.controls.listClasses { public interface ICellRenderer { function setSize(_arg1:Number, _arg2:Number):void; function get listData():ListData; function get data():Object; function setMouseState(_arg1:String):void; function set x(_arg1:Number):void; function set y(_arg1:Number):void; function set data(_arg1:Object):void; function set selected(_arg1:Boolean):void; function set listData(_arg1:ListData):void; function get selected():Boolean; } }//package fl.controls.listClasses
Section 55
//ListData (fl.controls.listClasses.ListData) package fl.controls.listClasses { import fl.core.*; public class ListData { protected var _index:uint; protected var _owner:UIComponent; protected var _label:String; protected var _icon:Object;// = null protected var _row:uint; protected var _column:uint; public function ListData(_arg1:String, _arg2:Object, _arg3:UIComponent, _arg4:uint, _arg5:uint, _arg6:uint=0){ _icon = null; super(); _label = _arg1; _icon = _arg2; _owner = _arg3; _index = _arg4; _row = _arg5; _column = _arg6; } public function get owner():UIComponent{ return (_owner); } public function get label():String{ return (_label); } public function get row():uint{ return (_row); } public function get index():uint{ return (_index); } public function get icon():Object{ return (_icon); } public function get column():uint{ return (_column); } } }//package fl.controls.listClasses
Section 56
//BaseButton (fl.controls.BaseButton) package fl.controls { import fl.core.*; import flash.events.*; import flash.display.*; import fl.events.*; import flash.utils.*; public class BaseButton extends UIComponent { protected var _selected:Boolean;// = false private var unlockedMouseState:String; protected var pressTimer:Timer; protected var mouseState:String; protected var background:DisplayObject; private var _mouseStateLocked:Boolean;// = false protected var _autoRepeat: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(){ _selected = false; _autoRepeat = false; _mouseStateLocked = false; super(); buttonMode = true; mouseChildren = false; useHandCursor = false; setupMouseEvents(); setMouseState("up"); pressTimer = new Timer(1, 0); pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, 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 autoRepeat(_arg1:Boolean):void{ _autoRepeat = _arg1; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; mouseEnabled = _arg1; } public function get selected():Boolean{ return (_selected); } 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(); }; }; }; } public function setMouseState(_arg1:String):void{ if (_mouseStateLocked){ unlockedMouseState = _arg1; return; }; if (mouseState == _arg1){ return; }; mouseState = _arg1; invalidate(InvalidationType.STATE); } protected function startPress():void{ if (_autoRepeat){ pressTimer.delay = Number(getStyleValue("repeatDelay")); pressTimer.start(); }; dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); } 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 set selected(_arg1:Boolean):void{ if (_selected == _arg1){ return; }; _selected = _arg1; invalidate(InvalidationType.STATE); } override public function get enabled():Boolean{ return (super.enabled); } 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 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 drawLayout():void{ background.width = width; background.height = height; } protected function drawBackground():void{ var _local1:String; var _local2:DisplayObject; _local1 = (enabled) ? mouseState : "disabled"; if (selected){ _local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1)); }; _local1 = (_local1 + "Skin"); _local2 = background; background = getDisplayObjectInstance(getStyleValue(_local1)); addChildAt(background, 0); if (((!((_local2 == null))) && (!((_local2 == background))))){ removeChild(_local2); }; } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 57
//Button (fl.controls.Button) package fl.controls { import fl.core.*; import flash.display.*; import fl.managers.*; public class Button extends LabelButton implements IFocusManagerComponent { protected var emphasizedBorder:DisplayObject; protected var _emphasized:Boolean;// = false private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2}; public static var createAccessibilityImplementation:Function; public function Button(){ _emphasized = false; super(); } 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 function set emphasized(_arg1:Boolean):void{ _emphasized = _arg1; invalidate(InvalidationType.STYLES); } override protected function draw():void{ if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){ drawEmphasized(); }; super.draw(); if (emphasizedBorder != null){ setChildIndex(emphasizedBorder, (numChildren - 1)); }; } public function get emphasized():Boolean{ return (_emphasized); } override protected function initializeAccessibility():void{ if (Button.createAccessibilityImplementation != null){ Button.createAccessibilityImplementation(this); }; } protected function drawEmphasized():void{ var _local1:Object; var _local2:Number; if (emphasizedBorder != null){ removeChild(emphasizedBorder); }; emphasizedBorder = null; if (!_emphasized){ return; }; _local1 = 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 static function getStyleDefinition():Object{ return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles)); } } }//package fl.controls
Section 58
//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 59
//ComboBox (fl.controls.ComboBox) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.events.*; import flash.display.*; import flash.geom.*; import fl.data.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.ui.*; public class ComboBox extends UIComponent implements IFocusManagerComponent { protected var _dropdownWidth:Number; protected var highlightedCell:int;// = -1 protected var _prompt:String; protected var isOpen:Boolean;// = false protected var list:List; protected var _rowCount:uint;// = 5 protected var currentIndex:int; protected var isKeyDown:Boolean;// = false protected var _labels:Array; protected var background:BaseButton; protected var inputField:TextInput; protected var listOverIndex:uint; protected var editableValue:String; protected var _editable:Boolean;// = false private var collectionItemImport:SimpleCollectionItem; protected static const BACKGROUND_STYLES:Object = {overSkin:"overSkin", downSkin:"downSkin", upSkin:"upSkin", disabledSkin:"disabledSkin", repeatInterval:"repeatInterval"}; protected static const LIST_STYLES:Object = {upSkin:"comboListUpSkin", overSkin:"comboListOverSkin", downSkin:"comobListDownSkin", disabledSkin:"comboListDisabledSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval", textFormat:"textFormat", disabledAlpha:"disabledAlpha", skin:"listSkin"}; private static var defaultStyles:Object = {upSkin:"ComboBox_upSkin", downSkin:"ComboBox_downSkin", overSkin:"ComboBox_overSkin", disabledSkin:"ComboBox_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, buttonWidth:24, disabledAlpha:null, listSkin:null}; public static var createAccessibilityImplementation:Function; public function ComboBox(){ _rowCount = 5; _editable = false; isOpen = false; highlightedCell = -1; isKeyDown = false; super(); } protected function drawList():void{ list.rowCount = Math.max(0, Math.min(_rowCount, list.dataProvider.length)); } public function set imeMode(_arg1:String):void{ inputField.imeMode = _arg1; } public function get dropdown():List{ return (list); } public function get dropdownWidth():Number{ return (list.width); } public function sortItemsOn(_arg1:String, _arg2:Object=null){ return (list.sortItemsOn(_arg1, _arg2)); } protected function onEnter(_arg1:ComponentEvent):void{ _arg1.stopPropagation(); } public function removeItemAt(_arg1:uint):void{ list.removeItemAt(_arg1); invalidate(InvalidationType.DATA); } public function open():void{ currentIndex = selectedIndex; if (((isOpen) || ((length == 0)))){ return; }; dispatchEvent(new Event(Event.OPEN)); isOpen = true; addEventListener(Event.ENTER_FRAME, addCloseListener, false, 0, true); positionList(); list.scrollToSelected(); stage.addChild(list); } public function get selectedItem():Object{ return (list.selectedItem); } public function set text(_arg1:String):void{ if (!editable){ return; }; inputField.text = _arg1; } public function get labelField():String{ return (list.labelField); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ var _local2:int; var _local3:uint; var _local4:Number; var _local5:int; isKeyDown = true; if (_arg1.ctrlKey){ switch (_arg1.keyCode){ case Keyboard.UP: if (highlightedCell > -1){ selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; close(); break; case Keyboard.DOWN: open(); break; }; return; }; _arg1.stopPropagation(); _local2 = Math.max(((calculateAvailableHeight() / list.rowHeight) << 0), 1); _local3 = selectedIndex; _local4 = ((highlightedCell)==-1) ? selectedIndex : highlightedCell; _local5 = -1; switch (_arg1.keyCode){ case Keyboard.SPACE: if (isOpen){ close(); } else { open(); }; return; case Keyboard.ESCAPE: if (isOpen){ if (highlightedCell > -1){ selectedIndex = selectedIndex; }; close(); }; return; case Keyboard.UP: _local5 = Math.max(0, (_local4 - 1)); break; case Keyboard.DOWN: _local5 = Math.min((length - 1), (_local4 + 1)); break; case Keyboard.PAGE_UP: _local5 = Math.max((_local4 - _local2), 0); break; case Keyboard.PAGE_DOWN: _local5 = Math.min((_local4 + _local2), (length - 1)); break; case Keyboard.HOME: _local5 = 0; break; case Keyboard.END: _local5 = (length - 1); break; case Keyboard.ENTER: if (((_editable) && ((highlightedCell == -1)))){ editableValue = inputField.text; selectedIndex = -1; } else { if (((isOpen) && ((highlightedCell > -1)))){ editableValue = null; selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; }; dispatchEvent(new ComponentEvent(ComponentEvent.ENTER)); close(); return; default: if (editable){ break; }; _local5 = list.getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), _local4); break; }; if (_local5 > -1){ if (isOpen){ highlightCell(_local5); inputField.text = list.itemToLabel(getItemAt(_local5)); } else { highlightCell(); selectedIndex = _local5; dispatchEvent(new Event(Event.CHANGE)); }; }; } public function set dropdownWidth(_arg1:Number):void{ _dropdownWidth = _arg1; invalidate(InvalidationType.SIZE); } public function get editable():Boolean{ return (_editable); } override protected function focusInHandler(_arg1:FocusEvent):void{ super.focusInHandler(_arg1); if (editable){ stage.focus = inputField.textField; }; } protected function onStageClick(_arg1:MouseEvent):void{ if (!isOpen){ return; }; if (((!(contains((_arg1.target as DisplayObject)))) && (!(list.contains((_arg1.target as DisplayObject)))))){ if (highlightedCell != -1){ selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; close(); }; } protected function handleDataChange(_arg1:DataChangeEvent):void{ invalidate(InvalidationType.DATA); } override protected function keyUpHandler(_arg1:KeyboardEvent):void{ isKeyDown = false; } protected function onListItemUp(_arg1:MouseEvent):void{ var _local2:*; stage.removeEventListener(MouseEvent.MOUSE_UP, onListItemUp); if (((!((_arg1.target is ICellRenderer))) || (!(list.contains((_arg1.target as DisplayObject)))))){ return; }; editableValue = null; _local2 = selectedIndex; selectedIndex = _arg1.target.listData.index; if (_local2 != selectedIndex){ dispatchEvent(new Event(Event.CHANGE)); }; close(); } public function removeAll():void{ list.removeAll(); inputField.text = ""; invalidate(InvalidationType.DATA); } public function set selectedItem(_arg1:Object):void{ list.selectedItem = _arg1; invalidate(InvalidationType.SELECTED); } protected function highlightCell(_arg1:int=-1):void{ var _local2:ICellRenderer; if (highlightedCell > -1){ _local2 = list.itemToCellRenderer(getItemAt(highlightedCell)); if (_local2 != null){ _local2.setMouseState("up"); }; }; if (_arg1 == -1){ return; }; list.scrollToIndex(_arg1); list.drawNow(); _local2 = list.itemToCellRenderer(getItemAt(_arg1)); if (_local2 != null){ _local2.setMouseState("over"); highlightedCell = _arg1; }; } public function itemToLabel(_arg1:Object):String{ if (_arg1 == null){ return (""); }; return (list.itemToLabel(_arg1)); } public function addItemAt(_arg1:Object, _arg2:uint):void{ list.addItemAt(_arg1, _arg2); invalidate(InvalidationType.DATA); } public function replaceItemAt(_arg1:Object, _arg2:uint):Object{ return (list.replaceItemAt(_arg1, _arg2)); } protected function showPrompt():void{ inputField.text = _prompt; } public function set rowCount(_arg1:uint):void{ _rowCount = _arg1; invalidate(InvalidationType.SIZE); } public function get restrict():String{ return (inputField.restrict); } protected function setEmbedFonts():void{ var _local1:Object; _local1 = getStyleValue("embedFonts"); if (_local1 != null){ inputField.textField.embedFonts = _local1; }; } public function sortItems(... _args){ return (list.sortItems.apply(list, _args)); } public function set labelField(_arg1:String):void{ list.labelField = _arg1; invalidate(InvalidationType.DATA); } public function set editable(_arg1:Boolean):void{ _editable = _arg1; drawTextField(); } public function set prompt(_arg1:String):void{ if (_arg1 == ""){ _prompt = null; } else { _prompt = _arg1; }; invalidate(InvalidationType.STATE); } public function get length():int{ return (list.length); } protected function drawTextField():void{ inputField.setStyle("upSkin", ""); inputField.setStyle("disabledSkin", ""); inputField.enabled = enabled; inputField.editable = _editable; inputField.textField.selectable = ((enabled) && (_editable)); inputField.mouseEnabled = (inputField.mouseChildren = ((enabled) && (_editable))); inputField.focusEnabled = false; if (_editable){ inputField.addEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus, false, 0, true); inputField.addEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut, false, 0, true); } else { inputField.removeEventListener(FocusEvent.FOCUS_IN, onInputFieldFocus); inputField.removeEventListener(FocusEvent.FOCUS_OUT, onInputFieldFocusOut); }; } protected function onInputFieldFocusOut(_arg1:FocusEvent):void{ inputField.removeEventListener(ComponentEvent.ENTER, onEnter); selectedIndex = selectedIndex; } protected function passEvent(_arg1:Event):void{ dispatchEvent(_arg1); } public function get imeMode():String{ return (inputField.imeMode); } public function get labelFunction():Function{ return (list.labelFunction); } protected function calculateAvailableHeight():Number{ var _local1:Number; _local1 = Number(getStyleValue("contentPadding")); return ((list.height - (_local1 * 2))); } public function get selectedIndex():int{ return (list.selectedIndex); } override protected function focusOutHandler(_arg1:FocusEvent):void{ isKeyDown = false; if (isOpen){ if (((!(_arg1.relatedObject)) || (!(list.contains(_arg1.relatedObject))))){ if (((!((highlightedCell == -1))) && (!((highlightedCell == selectedIndex))))){ selectedIndex = highlightedCell; dispatchEvent(new Event(Event.CHANGE)); }; close(); }; }; super.focusOutHandler(_arg1); } public function get selectedLabel():String{ if (editableValue != null){ return (editableValue); }; if (selectedIndex == -1){ return (null); }; return (itemToLabel(selectedItem)); } public function get text():String{ return (inputField.text); } protected function onListChange(_arg1:Event):void{ editableValue = null; dispatchEvent(_arg1); invalidate(InvalidationType.SELECTED); if (isKeyDown){ return; }; close(); } protected function onToggleListVisibility(_arg1:MouseEvent):void{ _arg1.stopPropagation(); dispatchEvent(_arg1); if (isOpen){ close(); } else { open(); stage.addEventListener(MouseEvent.MOUSE_UP, onListItemUp, false, 0, true); }; } override protected function draw():void{ var _local1:*; _local1 = selectedIndex; if ((((_local1 == -1)) && (((((!((prompt == null))) || (editable))) || ((length == 0)))))){ _local1 = Math.max(-1, Math.min(_local1, (length - 1))); } else { editableValue = null; _local1 = Math.max(0, Math.min(_local1, (length - 1))); }; if (list.selectedIndex != _local1){ list.selectedIndex = _local1; invalidate(InvalidationType.SELECTED, false); }; if (isInvalid(InvalidationType.STYLES)){ setStyles(); setEmbedFonts(); invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.STATE)){ drawTextFormat(); drawLayout(); invalidate(InvalidationType.DATA); }; if (isInvalid(InvalidationType.DATA)){ drawList(); invalidate(InvalidationType.SELECTED, true); }; if (isInvalid(InvalidationType.SELECTED)){ if ((((_local1 == -1)) && (!((editableValue == null))))){ inputField.text = editableValue; } else { if (_local1 > -1){ if (length > 0){ inputField.horizontalScrollPosition = 0; inputField.text = itemToLabel(list.selectedItem); }; } else { if ((((_local1 == -1)) && (!((_prompt == null))))){ showPrompt(); } else { inputField.text = ""; }; }; }; if (((((editable) && ((selectedIndex > -1)))) && ((stage.focus == inputField.textField)))){ inputField.setSelection(0, inputField.length); }; }; drawTextField(); super.draw(); } public function addItem(_arg1:Object):void{ list.addItem(_arg1); invalidate(InvalidationType.DATA); } public function get rowCount():uint{ return (_rowCount); } override protected function configUI():void{ super.configUI(); background = new BaseButton(); background.focusEnabled = false; copyStylesToChild(background, BACKGROUND_STYLES); background.addEventListener(MouseEvent.MOUSE_DOWN, onToggleListVisibility, false, 0, true); addChild(background); inputField = new TextInput(); inputField.focusTarget = (this as IFocusManagerComponent); inputField.focusEnabled = false; inputField.addEventListener(Event.CHANGE, onTextInput, false, 0, true); addChild(inputField); list = new List(); list.focusEnabled = false; copyStylesToChild(list, LIST_STYLES); list.addEventListener(Event.CHANGE, onListChange, false, 0, true); list.addEventListener(ListEvent.ITEM_CLICK, onListChange, false, 0, true); list.addEventListener(ListEvent.ITEM_ROLL_OUT, passEvent, false, 0, true); list.addEventListener(ListEvent.ITEM_ROLL_OVER, passEvent, false, 0, true); list.verticalScrollBar.addEventListener(Event.SCROLL, passEvent, false, 0, true); } protected function positionList():void{ var _local1:Point; _local1 = localToGlobal(new Point(0, 0)); list.x = _local1.x; if (((_local1.y + height) + list.height) > stage.stageHeight){ list.y = (_local1.y - list.height); } else { list.y = (_local1.y + height); }; } public function get value():String{ var _local1:Object; if (editableValue != null){ return (editableValue); }; _local1 = selectedItem; if (((!(_editable)) && (!((_local1.data == null))))){ return (_local1.data); }; return (itemToLabel(_local1)); } public function get prompt():String{ return (_prompt); } public function set dataProvider(_arg1:DataProvider):void{ _arg1.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true); list.dataProvider = _arg1; invalidate(InvalidationType.DATA); } public function set restrict(_arg1:String):void{ if (((componentInspectorSetting) && ((_arg1 == "")))){ _arg1 = null; }; if (!_editable){ return; }; inputField.restrict = _arg1; } protected function onTextInput(_arg1:Event):void{ _arg1.stopPropagation(); if (!_editable){ return; }; editableValue = inputField.text; selectedIndex = -1; dispatchEvent(new Event(Event.CHANGE)); } protected function onInputFieldFocus(_arg1:FocusEvent):void{ inputField.addEventListener(ComponentEvent.ENTER, onEnter, false, 0, true); close(); } public function getItemAt(_arg1:uint):Object{ return (list.getItemAt(_arg1)); } override protected function initializeAccessibility():void{ if (ComboBox.createAccessibilityImplementation != null){ ComboBox.createAccessibilityImplementation(this); }; } protected function drawLayout():void{ var _local1:Number; var _local2:Number; _local1 = (getStyleValue("buttonWidth") as Number); _local2 = (getStyleValue("textPadding") as Number); background.setSize(width, height); inputField.x = (inputField.y = _local2); inputField.setSize(((width - _local1) - _local2), (height - _local2)); list.width = (isNaN(_dropdownWidth)) ? width : _dropdownWidth; background.enabled = enabled; background.drawNow(); } public function removeItem(_arg1:Object):Object{ return (list.removeItem(_arg1)); } private function addCloseListener(_arg1:Event){ removeEventListener(Event.ENTER_FRAME, addCloseListener); if (!isOpen){ return; }; stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageClick, false, 0, true); } public function get dataProvider():DataProvider{ return (list.dataProvider); } public function get textField():TextInput{ return (inputField); } protected function setStyles():void{ copyStylesToChild(background, BACKGROUND_STYLES); copyStylesToChild(list, LIST_STYLES); } public function set labelFunction(_arg1:Function):void{ list.labelFunction = _arg1; invalidate(InvalidationType.DATA); } protected function drawTextFormat():void{ var _local1:TextFormat; _local1 = (getStyleValue((_enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local1 == null){ _local1 = new TextFormat(); }; inputField.textField.defaultTextFormat = _local1; inputField.textField.setTextFormat(_local1); setEmbedFonts(); } public function set selectedIndex(_arg1:int):void{ list.selectedIndex = _arg1; highlightCell(); invalidate(InvalidationType.SELECTED); } public function close():void{ highlightCell(); highlightedCell = -1; if (!isOpen){ return; }; dispatchEvent(new Event(Event.CLOSE)); stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageClick); isOpen = false; stage.removeChild(list); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, List.getStyleDefinition())); } } }//package fl.controls
Section 60
//LabelButton (fl.controls.LabelButton) package fl.controls { import fl.core.*; import flash.events.*; import flash.display.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.ui.*; public class LabelButton extends BaseButton implements IFocusManagerComponent { protected var _labelPlacement:String;// = "right" protected var _toggle:Boolean;// = false protected var icon:DisplayObject; protected var oldMouseState:String; protected var mode:String;// = "center" public var textField:TextField; protected var _label:String;// = "Label" 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; public function LabelButton(){ _labelPlacement = ButtonLabelPlacement.RIGHT; _toggle = false; _label = "Label"; mode = "center"; super(); } protected function toggleSelected(_arg1:MouseEvent):void{ selected = !(selected); dispatchEvent(new Event(Event.CHANGE, true)); } public function get labelPlacement():String{ return (_labelPlacement); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ if (!enabled){ return; }; if (_arg1.keyCode == Keyboard.SPACE){ if (oldMouseState == null){ oldMouseState = mouseState; }; setMouseState("down"); startPress(); }; } protected function setEmbedFont(){ var _local1:Object; _local1 = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } 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)); }; } override public function get selected():Boolean{ return ((_toggle) ? _selected : false); } public function set labelPlacement(_arg1:String):void{ _labelPlacement = _arg1; invalidate(InvalidationType.SIZE); } 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); } public function get label():String{ return (_label); } override public function set selected(_arg1:Boolean):void{ _selected = _arg1; if (_toggle){ invalidate(InvalidationType.STATE); }; } 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(); } public function get toggle():Boolean{ return (_toggle); } override protected function configUI():void{ super.configUI(); textField = new TextField(); textField.type = TextFieldType.DYNAMIC; textField.selectable = false; addChild(textField); } override protected function drawLayout():void{ var _local1:Number; var _local2:String; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; _local1 = Number(getStyleValue("textPadding")); _local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement; textField.height = (textField.textHeight + 4); _local3 = (textField.textWidth + 4); _local4 = (textField.textHeight + 4); _local5 = ((icon)==null) ? 0 : (icon.width + _local1); _local6 = ((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(); } override protected function initializeAccessibility():void{ if (LabelButton.createAccessibilityImplementation != null){ LabelButton.createAccessibilityImplementation(this); }; } protected function drawIcon():void{ var _local1:DisplayObject; var _local2:String; var _local3:Object; _local1 = icon; _local2 = (enabled) ? mouseState : "disabled"; if (selected){ _local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1)); }; _local2 = (_local2 + "Icon"); _local3 = 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); } protected function drawTextFormat():void{ var _local1:Object; var _local2:TextFormat; var _local3:TextFormat; _local1 = UIComponent.getStyleDefinition(); _local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); _local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition())); } } }//package fl.controls
Section 61
//List (fl.controls.List) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.events.*; import flash.display.*; import flash.geom.*; import fl.managers.*; import flash.utils.*; import flash.ui.*; public class List extends SelectableList implements IFocusManagerComponent { protected var _labelField:String;// = "label" protected var _rowHeight:Number;// = 20 protected var _cellRenderer:Object; protected var _iconField:String;// = "icon" protected var _labelFunction:Function; protected var _iconFunction:Function; private static var defaultStyles:Object = {focusRectSkin:null, focusRectPadding:null}; public static var createAccessibilityImplementation:Function; public function List(){ _rowHeight = 20; _labelField = "label"; _iconField = "icon"; super(); } public function get iconField():String{ return (_iconField); } protected function doKeySelection(_arg1:int, _arg2:Boolean, _arg3:Boolean):void{ var _local4:Boolean; var _local5:int; var _local6:Array; var _local7:int; var _local8:int; _local4 = false; if (_arg2){ _local6 = []; _local7 = lastCaretIndex; _local8 = _arg1; if (_local7 == -1){ _local7 = ((caretIndex)!=-1) ? caretIndex : _arg1; }; if (_local7 > _local8){ _local8 = _local7; _local7 = _arg1; }; _local5 = _local7; while (_local5 <= _local8) { _local6.push(_local5); _local5++; }; selectedIndices = _local6; caretIndex = _arg1; _local4 = true; } else { selectedIndex = _arg1; caretIndex = (lastCaretIndex = _arg1); _local4 = true; }; if (_local4){ dispatchEvent(new Event(Event.CHANGE)); }; invalidate(InvalidationType.DATA); } override protected function drawList():void{ var _local1:Rectangle; var _local2:uint; var _local3:uint; var _local4:uint; var _local5:Object; var _local6:ICellRenderer; var _local7:Dictionary; var _local8:Dictionary; var _local9:Boolean; var _local10:String; var _local11:Object; var _local12:Sprite; var _local13:String; listHolder.x = (listHolder.y = contentPadding); _local1 = listHolder.scrollRect; _local1.x = _horizontalScrollPosition; _local1.y = (Math.floor(_verticalScrollPosition) % rowHeight); listHolder.scrollRect = _local1; listHolder.cacheAsBitmap = useBitmapScrolling; _local2 = Math.floor((_verticalScrollPosition / rowHeight)); _local3 = Math.min(length, ((_local2 + rowCount) + 1)); _local7 = (renderedItems = new Dictionary(true)); _local4 = _local2; while (_local4 < _local3) { _local7[_dataProvider.getItemAt(_local4)] = true; _local4++; }; _local8 = new Dictionary(true); while (activeCellRenderers.length > 0) { _local6 = (activeCellRenderers.pop() as ICellRenderer); _local5 = _local6.data; if ((((_local7[_local5] == null)) || ((invalidItems[_local5] == true)))){ availableCellRenderers.push(_local6); } else { _local8[_local5] = _local6; invalidItems[_local5] = true; }; list.removeChild((_local6 as DisplayObject)); }; invalidItems = new Dictionary(true); _local4 = _local2; while (_local4 < _local3) { _local9 = false; _local5 = _dataProvider.getItemAt(_local4); if (_local8[_local5] != null){ _local9 = true; _local6 = _local8[_local5]; delete _local8[_local5]; } else { if (availableCellRenderers.length > 0){ _local6 = (availableCellRenderers.pop() as ICellRenderer); } else { _local6 = (getDisplayObjectInstance(getStyleValue("cellRenderer")) as ICellRenderer); _local12 = (_local6 as Sprite); if (_local12 != null){ _local12.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true); _local12.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true); _local12.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true); _local12.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true); _local12.doubleClickEnabled = true; _local12.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true); if (_local12["setStyle"] != null){ for (_local13 in rendererStyles) { var _local16 = _local12; _local16["setStyle"](_local13, rendererStyles[_local13]); }; }; }; }; }; list.addChild((_local6 as Sprite)); activeCellRenderers.push(_local6); _local6.y = (rowHeight * (_local4 - _local2)); _local6.setSize((availableWidth + _maxHorizontalScrollPosition), rowHeight); _local10 = itemToLabel(_local5); _local11 = null; if (_iconFunction != null){ _local11 = _iconFunction(_local5); } else { if (_iconField != null){ _local11 = _local5[_iconField]; }; }; if (!_local9){ _local6.data = _local5; }; _local6.listData = new ListData(_local10, _local11, this, _local4, _local4, 0); _local6.selected = !((_selectedIndices.indexOf(_local4) == -1)); if ((_local6 is UIComponent)){ (_local6 as UIComponent).drawNow(); }; _local4++; }; } public function get iconFunction():Function{ return (_iconFunction); } public function set iconField(_arg1:String):void{ if (_arg1 == _iconField){ return; }; _iconField = _arg1; invalidate(InvalidationType.DATA); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ var _local2:int; if (!selectable){ return; }; switch (_arg1.keyCode){ case Keyboard.UP: case Keyboard.DOWN: case Keyboard.END: case Keyboard.HOME: case Keyboard.PAGE_UP: case Keyboard.PAGE_DOWN: moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection))); break; case Keyboard.LEFT: case Keyboard.RIGHT: moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection))); break; case Keyboard.SPACE: if (caretIndex == -1){ caretIndex = 0; }; doKeySelection(caretIndex, _arg1.shiftKey, _arg1.ctrlKey); scrollToSelected(); break; default: _local2 = getNextIndexAtLetter(String.fromCharCode(_arg1.keyCode), selectedIndex); if (_local2 > -1){ selectedIndex = _local2; scrollToSelected(); }; break; }; _arg1.stopPropagation(); } override public function itemToLabel(_arg1:Object):String{ if (_labelFunction != null){ return (String(_labelFunction(_arg1))); }; return (((_arg1[_labelField])!=null) ? String(_arg1[_labelField]) : ""); } public function get labelField():String{ return (_labelField); } override protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ var _local4:int; var _local5:int; var _local6:int; _local4 = Math.max(Math.floor((calculateAvailableHeight() / rowHeight)), 1); _local5 = -1; _local6 = 0; switch (_arg1){ case Keyboard.UP: if (caretIndex > 0){ _local5 = (caretIndex - 1); }; break; case Keyboard.DOWN: if (caretIndex < (length - 1)){ _local5 = (caretIndex + 1); }; break; case Keyboard.PAGE_UP: if (caretIndex > 0){ _local5 = Math.max((caretIndex - _local4), 0); }; break; case Keyboard.PAGE_DOWN: if (caretIndex < (length - 1)){ _local5 = Math.min((caretIndex + _local4), (length - 1)); }; break; case Keyboard.HOME: if (caretIndex > 0){ _local5 = 0; }; break; case Keyboard.END: if (caretIndex < (length - 1)){ _local5 = (length - 1); }; break; }; if (_local5 >= 0){ doKeySelection(_local5, _arg2, _arg3); scrollToSelected(); }; } public function set labelField(_arg1:String):void{ if (_arg1 == _labelField){ return; }; _labelField = _arg1; invalidate(InvalidationType.DATA); } public function set rowCount(_arg1:uint):void{ var _local2:Number; var _local3:Number; _local2 = Number(getStyleValue("contentPadding")); _local3 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0; height = (((rowHeight * _arg1) + (2 * _local2)) + _local3); } override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ list.x = -(_arg1); super.setHorizontalScrollPosition(_arg1, true); } public function set iconFunction(_arg1:Function):void{ if (_iconFunction == _arg1){ return; }; _iconFunction = _arg1; invalidate(InvalidationType.DATA); } public function get labelFunction():Function{ return (_labelFunction); } override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ } override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ invalidate(InvalidationType.SCROLL); super.setVerticalScrollPosition(_arg1, true); } protected function calculateAvailableHeight():Number{ var _local1:Number; _local1 = Number(getStyleValue("contentPadding")); return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0)); } override protected function draw():void{ var _local1:Boolean; _local1 = !((contentHeight == (rowHeight * length))); contentHeight = (rowHeight * length); if (isInvalid(InvalidationType.STYLES)){ setStyles(); drawBackground(); if (contentPadding != getStyleValue("contentPadding")){ invalidate(InvalidationType.SIZE, false); }; if (_cellRenderer != getStyleValue("cellRenderer")){ _invalidateList(); _cellRenderer = getStyleValue("cellRenderer"); }; }; if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){ drawLayout(); }; if (isInvalid(InvalidationType.RENDERER_STYLES)){ updateRendererStyles(); }; if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){ drawList(); }; updateChildren(); validate(); } override protected function configUI():void{ useFixedHorizontalScrolling = true; _horizontalScrollPolicy = ScrollPolicy.AUTO; _verticalScrollPolicy = ScrollPolicy.AUTO; super.configUI(); } override public function get rowCount():uint{ return (Math.ceil((calculateAvailableHeight() / rowHeight))); } override protected function initializeAccessibility():void{ if (List.createAccessibilityImplementation != null){ List.createAccessibilityImplementation(this); }; } override public function scrollToIndex(_arg1:int):void{ var _local2:uint; var _local3:uint; drawNow(); _local2 = (Math.floor(((_verticalScrollPosition + availableHeight) / rowHeight)) - 1); _local3 = Math.ceil((_verticalScrollPosition / rowHeight)); if (_arg1 < _local3){ verticalScrollPosition = (_arg1 * rowHeight); } else { if (_arg1 > _local2){ verticalScrollPosition = (((_arg1 + 1) * rowHeight) - availableHeight); }; }; } public function get rowHeight():Number{ return (_rowHeight); } public function set labelFunction(_arg1:Function):void{ if (_labelFunction == _arg1){ return; }; _labelFunction = _arg1; invalidate(InvalidationType.DATA); } public function set rowHeight(_arg1:Number):void{ _rowHeight = _arg1; invalidate(InvalidationType.SIZE); } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition())); } } }//package fl.controls
Section 62
//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" protected var inDrag:Boolean;// = false protected var upArrow:BaseButton; private var _pageScrollSize:Number;// = 0 protected var downArrow:BaseButton; private var _pageSize:Number;// = 10 private var thumbScrollOffset:Number; private var _maxScrollPosition:Number;// = 0 private var _scrollPosition:Number;// = 0 protected var track:BaseButton; private var _minScrollPosition:Number;// = 0 private var _lineScrollSize:Number;// = 1 protected var thumb:LabelButton; 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(){ _pageSize = 10; _pageScrollSize = 0; _lineScrollSize = 1; _minScrollPosition = 0; _maxScrollPosition = 0; _scrollPosition = 0; _direction = ScrollBarDirection.VERTICAL; inDrag = false; super(); setStyles(); focusEnabled = false; } public function get minScrollPosition():Number{ return (_minScrollPosition); } public function set minScrollPosition(_arg1:Number):void{ setScrollProperties(_pageSize, _arg1, _maxScrollPosition); } public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{ var _local3:Number; _local3 = 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 set scrollPosition(_arg1:Number):void{ setScrollPosition(_arg1, true); } public function get pageScrollSize():Number{ return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize); } 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(); } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition)))))); updateThumb(); } protected function updateThumb():void{ var _local1:Number; _local1 = ((_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; }; } 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); } 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; }; } protected function handleThumbDrag(_arg1:MouseEvent):void{ var _local2:Number; _local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset))); setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition)); } public function set direction(_arg1:String):void{ var _local2:Boolean; if (_direction == _arg1){ return; }; _direction = _arg1; if (isLivePreview){ return; }; setScaleY(1); _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 set lineScrollSize(_arg1:Number):void{ if (_arg1 > 0){ _lineScrollSize = _arg1; }; } override public function get height():Number{ return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height); } 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))); }; }; }; }; } public function get pageSize():Number{ return (_pageSize); } public function set maxScrollPosition(_arg1:Number):void{ setScrollProperties(_pageSize, _minScrollPosition, _arg1); } public function get scrollPosition():Number{ return (_scrollPosition); } 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 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 get direction():String{ return (_direction); } public function get lineScrollSize():Number{ return (_lineScrollSize); } override public function setSize(_arg1:Number, _arg2:Number):void{ if (_direction == ScrollBarDirection.HORIZONTAL){ super.setSize(_arg2, _arg1); } else { super.setSize(_arg1, _arg2); }; } public function get maxScrollPosition():Number{ return (_maxScrollPosition); } override public function get width():Number{ return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width); } protected function setStyles():void{ copyStylesToChild(downArrow, DOWN_ARROW_STYLES); copyStylesToChild(thumb, THUMB_STYLES); copyStylesToChild(track, TRACK_STYLES); copyStylesToChild(upArrow, UP_ARROW_STYLES); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 63
//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 64
//ScrollPolicy (fl.controls.ScrollPolicy) package fl.controls { public class ScrollPolicy { public static const OFF:String = "off"; public static const ON:String = "on"; public static const AUTO:String = "auto"; } }//package fl.controls
Section 65
//SelectableList (fl.controls.SelectableList) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.events.*; import flash.display.*; import fl.data.*; import fl.managers.*; import fl.events.*; import flash.utils.*; import fl.containers.*; import flash.ui.*; public class SelectableList extends BaseScrollPane implements IFocusManagerComponent { protected var invalidItems:Dictionary; protected var renderedItems:Dictionary; protected var listHolder:Sprite; protected var _allowMultipleSelection:Boolean;// = false protected var lastCaretIndex:int;// = -1 protected var _selectedIndices:Array; protected var availableCellRenderers:Array; protected var list:Sprite; protected var caretIndex:int;// = -1 protected var updatedRendererStyles:Object; protected var preChangeItems:Array; protected var activeCellRenderers:Array; protected var rendererStyles:Object; protected var _verticalScrollPosition:Number; protected var _dataProvider:DataProvider; protected var _horizontalScrollPosition:Number; private var collectionItemImport:SimpleCollectionItem; protected var _selectable:Boolean;// = true private static var defaultStyles:Object = {skin:"List_skin", cellRenderer:CellRenderer, contentPadding:null, disabledAlpha:null}; public static var createAccessibilityImplementation:Function; public function SelectableList(){ _allowMultipleSelection = false; _selectable = true; caretIndex = -1; lastCaretIndex = -1; super(); activeCellRenderers = []; availableCellRenderers = []; invalidItems = new Dictionary(true); renderedItems = new Dictionary(true); _selectedIndices = []; if (dataProvider == null){ dataProvider = new DataProvider(); }; verticalScrollPolicy = ScrollPolicy.AUTO; rendererStyles = {}; updatedRendererStyles = {}; } protected function drawList():void{ } public function set allowMultipleSelection(_arg1:Boolean):void{ if (_arg1 == _allowMultipleSelection){ return; }; _allowMultipleSelection = _arg1; if (((!(_arg1)) && ((_selectedIndices.length > 1)))){ _selectedIndices = [_selectedIndices.pop()]; invalidate(InvalidationType.DATA); }; } public function sortItemsOn(_arg1:String, _arg2:Object=null){ return (_dataProvider.sortOn(_arg1, _arg2)); } public function removeItemAt(_arg1:uint):Object{ return (_dataProvider.removeItemAt(_arg1)); } public function get selectedItem():Object{ return (((_selectedIndices.length)==0) ? null : _dataProvider.getItemAt(selectedIndex)); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ if (!selectable){ return; }; switch (_arg1.keyCode){ case Keyboard.UP: case Keyboard.DOWN: case Keyboard.END: case Keyboard.HOME: case Keyboard.PAGE_UP: case Keyboard.PAGE_DOWN: moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection))); _arg1.stopPropagation(); break; case Keyboard.LEFT: case Keyboard.RIGHT: moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection))); _arg1.stopPropagation(); break; }; } public function get selectable():Boolean{ return (_selectable); } public function itemToCellRenderer(_arg1:Object):ICellRenderer{ var _local2:*; var _local3:ICellRenderer; if (_arg1 != null){ for (_local2 in activeCellRenderers) { _local3 = (activeCellRenderers[_local2] as ICellRenderer); if (_local3.data == _arg1){ return (_local3); }; }; }; return (null); } public function getNextIndexAtLetter(_arg1:String, _arg2:int=-1):int{ var _local3:int; var _local4:Number; var _local5:Number; var _local6:Object; var _local7:String; if (length == 0){ return (-1); }; _arg1 = _arg1.toUpperCase(); _local3 = (length - 1); _local4 = 0; while (_local4 < _local3) { _local5 = ((_arg2 + 1) + _local4); if (_local5 > (length - 1)){ _local5 = (_local5 - length); }; _local6 = getItemAt(_local5); if (_local6 == null){ break; }; _local7 = itemToLabel(_local6); if (_local7 == null){ } else { if (_local7.charAt(0).toUpperCase() == _arg1){ return (_local5); }; }; _local4++; }; return (-1); } public function invalidateList():void{ _invalidateList(); invalidate(InvalidationType.DATA); } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; list.mouseChildren = _enabled; } public function get selectedIndices():Array{ return (_selectedIndices.concat()); } public function set selectable(_arg1:Boolean):void{ if (_arg1 == _selectable){ return; }; if (!_arg1){ selectedIndices = []; }; _selectable = _arg1; } public function itemToLabel(_arg1:Object):String{ return (_arg1["label"]); } public function addItemAt(_arg1:Object, _arg2:uint):void{ _dataProvider.addItemAt(_arg1, _arg2); invalidateList(); } public function replaceItemAt(_arg1:Object, _arg2:uint):Object{ return (_dataProvider.replaceItemAt(_arg1, _arg2)); } protected function handleDataChange(_arg1:DataChangeEvent):void{ var _local2:int; var _local3:int; var _local4:String; var _local5:uint; _local2 = _arg1.startIndex; _local3 = _arg1.endIndex; _local4 = _arg1.changeType; if (_local4 == DataChangeType.INVALIDATE_ALL){ clearSelection(); invalidateList(); } else { if (_local4 == DataChangeType.INVALIDATE){ _local5 = 0; while (_local5 < _arg1.items.length) { invalidateItem(_arg1.items[_local5]); _local5++; }; } else { if (_local4 == DataChangeType.ADD){ _local5 = 0; while (_local5 < _selectedIndices.length) { if (_selectedIndices[_local5] >= _local2){ _selectedIndices[_local5] = (_selectedIndices[_local5] + (_local2 - _local3)); }; _local5++; }; } else { if (_local4 == DataChangeType.REMOVE){ _local5 = 0; while (_local5 < _selectedIndices.length) { if (_selectedIndices[_local5] >= _local2){ if (_selectedIndices[_local5] <= _local3){ delete _selectedIndices[_local5]; } else { _selectedIndices[_local5] = (_selectedIndices[_local5] - ((_local2 - _local3) + 1)); }; }; _local5++; }; } else { if (_local4 == DataChangeType.REMOVE_ALL){ clearSelection(); } else { if (_local4 == DataChangeType.REPLACE){ } else { selectedItems = preChangeItems; preChangeItems = null; }; }; }; }; }; }; invalidate(InvalidationType.DATA); } protected function _invalidateList():void{ availableCellRenderers = []; while (activeCellRenderers.length > 0) { list.removeChild((activeCellRenderers.pop() as DisplayObject)); }; } protected function updateRendererStyles():void{ var _local1:Array; var _local2:uint; var _local3:uint; var _local4:String; _local1 = availableCellRenderers.concat(activeCellRenderers); _local2 = _local1.length; _local3 = 0; while (_local3 < _local2) { if (_local1[_local3].setStyle == null){ } else { for (_local4 in updatedRendererStyles) { _local1[_local3].setStyle(_local4, updatedRendererStyles[_local4]); }; _local1[_local3].drawNow(); }; _local3++; }; updatedRendererStyles = {}; } public function set selectedItem(_arg1:Object):void{ var _local2:int; _local2 = _dataProvider.getItemIndex(_arg1); selectedIndex = _local2; } public function sortItems(... _args){ return (_dataProvider.sort.apply(_dataProvider, _args)); } public function removeAll():void{ _dataProvider.removeAll(); } protected function handleCellRendererChange(_arg1:Event):void{ var _local2:ICellRenderer; var _local3:uint; _local2 = (_arg1.currentTarget as ICellRenderer); _local3 = _local2.listData.index; _dataProvider.invalidateItemAt(_local3); } protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ } override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ var _local3:Number; if (_arg1 == _horizontalScrollPosition){ return; }; _local3 = (_arg1 - _horizontalScrollPosition); _horizontalScrollPosition = _arg1; if (_arg2){ dispatchEvent(new ScrollEvent(ScrollBarDirection.HORIZONTAL, _local3, _arg1)); }; } public function scrollToSelected():void{ scrollToIndex(selectedIndex); } public function invalidateItem(_arg1:Object):void{ if (renderedItems[_arg1] == null){ return; }; invalidItems[_arg1] = true; invalidate(InvalidationType.DATA); } protected function handleCellRendererClick(_arg1:MouseEvent):void{ var _local2:ICellRenderer; var _local3:uint; var _local4:int; var _local5:int; var _local6:uint; if (!_enabled){ return; }; _local2 = (_arg1.currentTarget as ICellRenderer); _local3 = _local2.listData.index; if (((!(dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)))) || (!(_selectable)))){ return; }; _local4 = selectedIndices.indexOf(_local3); if (!_allowMultipleSelection){ if (_local4 != -1){ return; }; _local2.selected = true; _selectedIndices = [_local3]; lastCaretIndex = (caretIndex = _local3); } else { if (_arg1.shiftKey){ _local6 = ((_selectedIndices.length)>0) ? _selectedIndices[0] : _local3; _selectedIndices = []; if (_local6 > _local3){ _local5 = _local6; while (_local5 >= _local3) { _selectedIndices.push(_local5); _local5--; }; } else { _local5 = _local6; while (_local5 <= _local3) { _selectedIndices.push(_local5); _local5++; }; }; caretIndex = _local3; } else { if (_arg1.ctrlKey){ if (_local4 != -1){ _local2.selected = false; _selectedIndices.splice(_local4, 1); } else { _local2.selected = true; _selectedIndices.push(_local3); }; caretIndex = _local3; } else { _selectedIndices = [_local3]; lastCaretIndex = (caretIndex = _local3); }; }; }; dispatchEvent(new Event(Event.CHANGE)); invalidate(InvalidationType.DATA); } public function get length():uint{ return (_dataProvider.length); } public function get allowMultipleSelection():Boolean{ return (_allowMultipleSelection); } protected function onPreChange(_arg1:DataChangeEvent):void{ switch (_arg1.changeType){ case DataChangeType.REMOVE: case DataChangeType.ADD: case DataChangeType.INVALIDATE: case DataChangeType.REMOVE_ALL: case DataChangeType.REPLACE: case DataChangeType.INVALIDATE_ALL: break; default: preChangeItems = selectedItems; break; }; } public function getRendererStyle(_arg1:String, _arg2:int=-1):Object{ return (rendererStyles[_arg1]); } override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ var _local3:Number; if (_arg1 == _verticalScrollPosition){ return; }; _local3 = (_arg1 - _verticalScrollPosition); _verticalScrollPosition = _arg1; if (_arg2){ dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _local3, _arg1)); }; } protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ } public function set selectedIndices(_arg1:Array):void{ if (!_selectable){ return; }; _selectedIndices = ((_arg1)==null) ? [] : _arg1.concat(); invalidate(InvalidationType.SELECTED); } public function get selectedIndex():int{ return (((_selectedIndices.length)==0) ? -1 : _selectedIndices[(_selectedIndices.length - 1)]); } override protected function draw():void{ super.draw(); } override protected function configUI():void{ super.configUI(); listHolder = new Sprite(); addChild(listHolder); listHolder.scrollRect = contentScrollRect; list = new Sprite(); listHolder.addChild(list); } public function addItem(_arg1:Object):void{ _dataProvider.addItem(_arg1); invalidateList(); } protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{ var _local2:ICellRenderer; var _local3:String; _local2 = (_arg1.target as ICellRenderer); _local3 = ((_arg1.type)==MouseEvent.ROLL_OVER) ? ListEvent.ITEM_ROLL_OVER : ListEvent.ITEM_ROLL_OUT; dispatchEvent(new ListEvent(_local3, false, false, _local2.listData.column, _local2.listData.row, _local2.listData.index, _local2.data)); } public function clearRendererStyle(_arg1:String, _arg2:int=-1):void{ delete rendererStyles[_arg1]; updatedRendererStyles[_arg1] = null; invalidate(InvalidationType.RENDERER_STYLES); } protected function handleCellRendererDoubleClick(_arg1:MouseEvent):void{ var _local2:ICellRenderer; var _local3:uint; if (!_enabled){ return; }; _local2 = (_arg1.currentTarget as ICellRenderer); _local3 = _local2.listData.index; dispatchEvent(new ListEvent(ListEvent.ITEM_DOUBLE_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)); } public function get rowCount():uint{ return (0); } public function isItemSelected(_arg1:Object):Boolean{ return ((selectedItems.indexOf(_arg1) > -1)); } public function set dataProvider(_arg1:DataProvider):void{ if (_dataProvider != null){ _dataProvider.removeEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange); _dataProvider.removeEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange); }; _dataProvider = _arg1; _dataProvider.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true); _dataProvider.addEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange, false, 0, true); clearSelection(); invalidateList(); } override protected function drawLayout():void{ super.drawLayout(); contentScrollRect = listHolder.scrollRect; contentScrollRect.width = availableWidth; contentScrollRect.height = availableHeight; listHolder.scrollRect = contentScrollRect; } public function getItemAt(_arg1:uint):Object{ return (_dataProvider.getItemAt(_arg1)); } override protected function initializeAccessibility():void{ if (SelectableList.createAccessibilityImplementation != null){ SelectableList.createAccessibilityImplementation(this); }; } public function scrollToIndex(_arg1:int):void{ } public function removeItem(_arg1:Object):Object{ return (_dataProvider.removeItem(_arg1)); } public function get dataProvider():DataProvider{ return (_dataProvider); } public function set maxHorizontalScrollPosition(_arg1:Number):void{ _maxHorizontalScrollPosition = _arg1; invalidate(InvalidationType.SIZE); } public function setRendererStyle(_arg1:String, _arg2:Object, _arg3:uint=0):void{ if (rendererStyles[_arg1] == _arg2){ return; }; updatedRendererStyles[_arg1] = _arg2; rendererStyles[_arg1] = _arg2; invalidate(InvalidationType.RENDERER_STYLES); } public function invalidateItemAt(_arg1:uint):void{ var _local2:Object; _local2 = _dataProvider.getItemAt(_arg1); if (_local2 != null){ invalidateItem(_local2); }; } public function set selectedItems(_arg1:Array):void{ var _local2:Array; var _local3:uint; var _local4:int; if (_arg1 == null){ selectedIndices = null; return; }; _local2 = []; _local3 = 0; while (_local3 < _arg1.length) { _local4 = _dataProvider.getItemIndex(_arg1[_local3]); if (_local4 != -1){ _local2.push(_local4); }; _local3++; }; selectedIndices = _local2; } public function clearSelection():void{ selectedIndex = -1; } override public function get maxHorizontalScrollPosition():Number{ return (_maxHorizontalScrollPosition); } public function get selectedItems():Array{ var _local1:Array; var _local2:uint; _local1 = []; _local2 = 0; while (_local2 < _selectedIndices.length) { _local1.push(_dataProvider.getItemAt(_selectedIndices[_local2])); _local2++; }; return (_local1); } public function set selectedIndex(_arg1:int):void{ selectedIndices = ((_arg1)==-1) ? null : [_arg1]; } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition())); } } }//package fl.controls
Section 66
//TextInput (fl.controls.TextInput) package fl.controls { import fl.core.*; import flash.events.*; import flash.display.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.ui.*; public class TextInput extends UIComponent implements IFocusManagerComponent { protected var _html:Boolean;// = false protected var _savedHTML:String; protected var background:DisplayObject; protected var _editable:Boolean;// = true public var textField:TextField; private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false}; public static var createAccessibilityImplementation:Function; public function TextInput(){ _editable = true; _html = false; super(); } override public function drawFocus(_arg1:Boolean):void{ if (focusTarget != null){ focusTarget.drawFocus(_arg1); return; }; super.drawFocus(_arg1); } public function set imeMode(_arg1:String):void{ _imeMode = _arg1; } override protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((((_arg1 == textField)) || (super.isOurFocus(_arg1)))); } protected function handleKeyDown(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ENTER){ dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true)); }; } public function set text(_arg1:String):void{ textField.text = _arg1; _html = false; invalidate(InvalidationType.DATA); invalidate(InvalidationType.STYLES); } protected function updateTextFieldType():void{ textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC; textField.selectable = enabled; } public function get selectionEndIndex():int{ return (textField.selectionEndIndex); } public function get editable():Boolean{ return (_editable); } override protected function focusInHandler(_arg1:FocusEvent):void{ var _local2:IFocusManager; if (_arg1.target == this){ stage.focus = textField; }; _local2 = focusManager; if (((editable) && (_local2))){ _local2.showFocusIndicator = true; if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){ setSelection(0, textField.length); }; }; super.focusInHandler(_arg1); if (editable){ setIMEMode(true); }; } public function get selectionBeginIndex():int{ return (textField.selectionBeginIndex); } public function set alwaysShowSelection(_arg1:Boolean):void{ textField.alwaysShowSelection = _arg1; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; updateTextFieldType(); } protected function setEmbedFont(){ var _local1:Object; _local1 = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; } public function get horizontalScrollPosition():int{ return (textField.scrollH); } public function set condenseWhite(_arg1:Boolean):void{ textField.condenseWhite = _arg1; } public function set displayAsPassword(_arg1:Boolean):void{ textField.displayAsPassword = _arg1; } public function set horizontalScrollPosition(_arg1:int):void{ textField.scrollH = _arg1; } public function get restrict():String{ return (textField.restrict); } public function get textWidth():Number{ return (textField.textWidth); } public function get textHeight():Number{ return (textField.textHeight); } public function set editable(_arg1:Boolean):void{ _editable = _arg1; updateTextFieldType(); } public function get maxChars():int{ return (textField.maxChars); } public function get length():int{ return (textField.length); } public function getLineMetrics(_arg1:int):TextLineMetrics{ return (textField.getLineMetrics(_arg1)); } public function get imeMode():String{ return (_imeMode); } override protected function focusOutHandler(_arg1:FocusEvent):void{ super.focusOutHandler(_arg1); if (editable){ setIMEMode(false); }; } public function set htmlText(_arg1:String):void{ if (_arg1 == ""){ text = ""; return; }; _html = true; _savedHTML = _arg1; textField.htmlText = _arg1; invalidate(InvalidationType.DATA); invalidate(InvalidationType.STYLES); } public function get text():String{ return (textField.text); } override public function get enabled():Boolean{ return (super.enabled); } public function get condenseWhite():Boolean{ return (textField.condenseWhite); } public function get alwaysShowSelection():Boolean{ return (textField.alwaysShowSelection); } override protected function draw():void{ var _local1:Object; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawTextFormat(); drawBackground(); _local1 = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; invalidate(InvalidationType.SIZE, false); }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; super.draw(); } protected function handleTextInput(_arg1:TextEvent):void{ _arg1.stopPropagation(); dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text)); } override protected function configUI():void{ super.configUI(); tabChildren = true; textField = new TextField(); addChild(textField); updateTextFieldType(); textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true); textField.addEventListener(Event.CHANGE, handleChange, false, 0, true); textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true); } public function setSelection(_arg1:int, _arg2:int):void{ textField.setSelection(_arg1, _arg2); } public function get displayAsPassword():Boolean{ return (textField.displayAsPassword); } public function appendText(_arg1:String):void{ textField.appendText(_arg1); } public function set restrict(_arg1:String):void{ if (((componentInspectorSetting) && ((_arg1 == "")))){ _arg1 = null; }; textField.restrict = _arg1; } public function get htmlText():String{ return (textField.htmlText); } protected function drawBackground():void{ var _local1:DisplayObject; var _local2:String; _local1 = background; _local2 = (enabled) ? "upSkin" : "disabledSkin"; background = getDisplayObjectInstance(getStyleValue(_local2)); if (background == null){ return; }; addChildAt(background, 0); if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){ removeChild(_local1); }; } override public function setFocus():void{ stage.focus = textField; } protected function drawLayout():void{ var _local1:Number; _local1 = Number(getStyleValue("textPadding")); if (background != null){ background.width = width; background.height = height; }; textField.width = (width - (2 * _local1)); textField.height = (height - (2 * _local1)); textField.x = (textField.y = _local1); } public function set maxChars(_arg1:int):void{ textField.maxChars = _arg1; } public function get maxHorizontalScrollPosition():int{ return (textField.maxScrollH); } protected function drawTextFormat():void{ var _local1:Object; var _local2:TextFormat; var _local3:TextFormat; _local1 = UIComponent.getStyleDefinition(); _local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); textField.setTextFormat(_local2); _local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); if (_local3 != null){ textField.setTextFormat(_local3); } else { _local3 = _local2; }; textField.defaultTextFormat = _local3; setEmbedFont(); if (_html){ textField.htmlText = _savedHTML; }; } protected function handleChange(_arg1:Event):void{ _arg1.stopPropagation(); dispatchEvent(new Event(Event.CHANGE, true)); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 67
//ComponentShim (fl.core.ComponentShim) package fl.core { import flash.display.*; public dynamic class ComponentShim extends MovieClip { } }//package fl.core
Section 68
//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 69
//UIComponent (fl.core.UIComponent) package fl.core { import flash.events.*; import flash.display.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.utils.*; import flash.system.*; public class UIComponent extends Sprite { protected var _enabled:Boolean;// = true private var _mouseFocusEnabled:Boolean;// = true protected var startHeight:Number; protected var _height:Number; protected var _oldIMEMode:String;// = null protected var startWidth:Number; public var focusTarget:IFocusManagerComponent; protected var errorCaught:Boolean;// = false protected var uiFocusRect:DisplayObject; protected var _width:Number; public var version:String;// = "3.0.0.15" protected var isFocused:Boolean;// = false protected var callLaterMethods:Dictionary; private var _focusEnabled:Boolean;// = true private var tempText:TextField; protected var invalidateFlag:Boolean;// = false protected var _inspector:Boolean;// = false protected var sharedStyles:Object; protected var invalidHash:Object; protected var isLivePreview:Boolean;// = false protected var _imeMode:String;// = null protected var instanceStyles:Object; protected var _x:Number; 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(){ version = "3.0.0.15"; isLivePreview = false; invalidateFlag = false; _enabled = true; isFocused = false; _focusEnabled = true; _mouseFocusEnabled = true; _imeMode = null; _oldIMEMode = null; errorCaught = false; _inspector = false; super(); 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 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); }; } private function callLaterDispatcher(_arg1:Event):void{ var _local2:Dictionary; 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; _local2 = callLaterMethods; for (_local3 in _local2) { _local3(); delete _local2[_local3]; }; inCallLaterPhase = false; } private function addedHandler(_arg1:Event):void{ removeEventListener("addedToStage", addedHandler); initializeFocusManager(); } protected function getStyleValue(_arg1:String):Object{ return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]); } protected function isOurFocus(_arg1:DisplayObject):Boolean{ return ((_arg1 == this)); } override public function get scaleX():Number{ return ((width / startWidth)); } override public function get scaleY():Number{ return ((height / startHeight)); } override public function set height(_arg1:Number):void{ if (_height == _arg1){ return; }; setSize(width, _arg1); } protected function keyDownHandler(_arg1:KeyboardEvent):void{ } 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 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); } 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); } 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; }; }; } public function set enabled(_arg1:Boolean):void{ if (_arg1 == _enabled){ return; }; _enabled = _arg1; invalidate(InvalidationType.STATE); } 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); }; } protected function keyUpHandler(_arg1:KeyboardEvent):void{ } public function set focusEnabled(_arg1:Boolean):void{ _focusEnabled = _arg1; } 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 classDef:Object; var skin = _arg1; classDef = null; 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 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); }; } protected function createFocusManager():void{ if (focusManagers[stage] == null){ focusManagers[stage] = new FocusManager(stage); }; } override public function set visible(_arg1:Boolean):void{ var _local2:String; if (super.visible == _arg1){ return; }; super.visible = _arg1; _local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE; dispatchEvent(new ComponentEvent(_local2, true)); } 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 x(_arg1:Number):void{ move(_arg1, _y); } public function drawNow():void{ draw(); } override public function set y(_arg1:Number):void{ move(_x, _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")); } 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); } protected function validate():void{ invalidHash = {}; } override public function get height():Number{ return (_height); } public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{ invalidHash[_arg1] = true; if (_arg2){ this.callLater(draw); }; } 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{ } protected function draw():void{ if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ if (((isFocused) && (focusManager.showFocusIndicator))){ drawFocus(true); }; }; validate(); } protected function configUI():void{ var _local1:Number; var _local2:Number; var _local3:Number; isLivePreview = checkLivePreview(); _local1 = rotation; rotation = 0; _local2 = super.width; _local3 = 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 setScaleX(_arg1:Number):void{ super.scaleX = _arg1; } protected function setScaleY(_arg1:Number):void{ super.scaleY = _arg1; } private function initializeFocusManager():void{ if (stage == null){ addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true); } else { createFocusManager(); }; } 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 setSize(_arg1:Number, _arg2:Number):void{ _width = _arg1; _height = _arg2; invalidate(InvalidationType.SIZE); dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false)); } override public function set width(_arg1:Number):void{ if (_width == _arg1){ return; }; setSize(_arg1, height); } public function setFocus():void{ if (stage){ stage.focus = this; }; } protected function initializeAccessibility():void{ if (UIComponent.createAccessibilityImplementation != null){ UIComponent.createAccessibilityImplementation(this); }; } public function get focusManager():IFocusManager{ var _local1:DisplayObject; _local1 = 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); } 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(); } public function getStyle(_arg1:String):Object{ return (instanceStyles[_arg1]); } public static function getStyleDefinition():Object{ return (defaultStyles); } public static function mergeStyles(... _args):Object{ var _local2:Object; var _local3:uint; var _local4:uint; var _local5:Object; var _local6:String; _local2 = {}; _local3 = _args.length; _local4 = 0; 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 70
//DataProvider (fl.data.DataProvider) package fl.data { import flash.events.*; import fl.events.*; public class DataProvider extends EventDispatcher { protected var data:Array; public function DataProvider(_arg1:Object=null){ if (_arg1 == null){ data = []; } else { data = getDataFromObject(_arg1); }; } protected function dispatchPreChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{ dispatchEvent(new DataChangeEvent(DataChangeEvent.PRE_DATA_CHANGE, _arg1, _arg2, _arg3, _arg4)); } public function invalidateItemAt(_arg1:int):void{ checkIndex(_arg1, (data.length - 1)); dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _arg1); } public function getItemIndex(_arg1:Object):int{ return (data.indexOf(_arg1)); } protected function getDataFromObject(_arg1:Object):Array{ var _local2:Array; var _local3:Array; var _local4:uint; var _local5:Object; var _local6:XML; var _local7:XMLList; var _local8:XML; var _local9:XMLList; var _local10:XML; var _local11:XMLList; var _local12:XML; if ((_arg1 is Array)){ _local3 = (_arg1 as Array); if (_local3.length > 0){ if ((((_local3[0] is String)) || ((_local3[0] is Number)))){ _local2 = []; _local4 = 0; while (_local4 < _local3.length) { _local5 = {label:String(_local3[_local4]), data:_local3[_local4]}; _local2.push(_local5); _local4++; }; return (_local2); }; }; return (_arg1.concat()); } else { if ((_arg1 is DataProvider)){ return (_arg1.toArray()); }; if ((_arg1 is XML)){ _local6 = (_arg1 as XML); _local2 = []; _local7 = _local6.*; for each (_local8 in _local7) { _arg1 = {}; _local9 = _local8.attributes(); for each (_local10 in _local9) { _arg1[_local10.localName()] = _local10.toString(); }; _local11 = _local8.*; for each (_local12 in _local11) { if (_local12.hasSimpleContent()){ _arg1[_local12.localName()] = _local12.toString(); }; }; _local2.push(_arg1); }; return (_local2); //unresolved jump }; }; throw (new ((!NULL! + !NULL!) + " to Array or DataProvider.").TypeError(!NULL!)); } public function removeItemAt(_arg1:uint):Object{ var _local2:Array; checkIndex(_arg1, (data.length - 1)); dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1); _local2 = data.splice(_arg1, 1); dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1); return (_local2[0]); } public function addItem(_arg1:Object):void{ dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1)); data.push(_arg1); dispatchChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1)); } public function sortOn(_arg1:Object, _arg2:Object=null){ var _local3:Array; dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); _local3 = data.sortOn(_arg1, _arg2); dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); return (_local3); } public function sort(... _args){ var _local2:Array; dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); _local2 = data.sort.apply(data, _args); dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); return (_local2); } public function addItems(_arg1:Object):void{ addItemsAt(_arg1, data.length); } public function concat(_arg1:Object):void{ addItems(_arg1); } public function clone():DataProvider{ return (new DataProvider(data)); } public function toArray():Array{ return (data.concat()); } public function get length():uint{ return (data.length); } public function addItemAt(_arg1:Object, _arg2:uint):void{ checkIndex(_arg2, data.length); dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2); data.splice(_arg2, 0, _arg1); dispatchChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2); } public function getItemAt(_arg1:uint):Object{ checkIndex(_arg1, (data.length - 1)); return (data[_arg1]); } override public function toString():String{ return ((("DataProvider [" + data.join(" , ")) + "]")); } public function invalidateItem(_arg1:Object):void{ var _local2:uint; _local2 = getItemIndex(_arg1); if (_local2 == -1){ return; }; invalidateItemAt(_local2); } protected function dispatchChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{ dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, _arg1, _arg2, _arg3, _arg4)); } protected function checkIndex(_arg1:int, _arg2:int):void{ if ((((_arg1 > _arg2)) || ((_arg1 < 0)))){ throw (new RangeError((((("DataProvider index (" + _arg1) + ") is not in acceptable range (0 - ") + _arg2) + ")"))); }; } public function addItemsAt(_arg1:Object, _arg2:uint):void{ var _local3:Array; checkIndex(_arg2, data.length); _local3 = getDataFromObject(_arg1); dispatchPreChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1)); data.splice.apply(data, [_arg2, 0].concat(_local3)); dispatchChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1)); } public function replaceItem(_arg1:Object, _arg2:Object):Object{ var _local3:int; _local3 = getItemIndex(_arg2); if (_local3 != -1){ return (replaceItemAt(_arg1, _local3)); }; return (null); } public function removeItem(_arg1:Object):Object{ var _local2:int; _local2 = getItemIndex(_arg1); if (_local2 != -1){ return (removeItemAt(_local2)); }; return (null); } public function merge(_arg1:Object):void{ var _local2:Array; var _local3:uint; var _local4:uint; var _local5:uint; var _local6:Object; _local2 = getDataFromObject(_arg1); _local3 = _local2.length; _local4 = data.length; dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1)); _local5 = 0; while (_local5 < _local3) { _local6 = _local2[_local5]; if (getItemIndex(_local6) == -1){ data.push(_local6); }; _local5++; }; if (data.length > _local4){ dispatchChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1)); } else { dispatchChangeEvent(DataChangeType.ADD, [], -1, -1); }; } public function replaceItemAt(_arg1:Object, _arg2:uint):Object{ var _local3:Array; checkIndex(_arg2, (data.length - 1)); _local3 = [data[_arg2]]; dispatchPreChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2); data[_arg2] = _arg1; dispatchChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2); return (_local3[0]); } public function invalidate():void{ dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, DataChangeType.INVALIDATE_ALL, data.concat(), 0, data.length)); } public function removeAll():void{ var _local1:Array; _local1 = data.concat(); dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length); data = []; dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length); } } }//package fl.data
Section 71
//SimpleCollectionItem (fl.data.SimpleCollectionItem) package fl.data { public dynamic class SimpleCollectionItem { public var label:String; public var data:String; public function toString():String{ return ((((("[SimpleCollectionItem: " + label) + ",") + data) + "]")); } } }//package fl.data
Section 72
//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 73
//DataChangeEvent (fl.events.DataChangeEvent) package fl.events { import flash.events.*; public class DataChangeEvent extends Event { protected var _items:Array; protected var _endIndex:uint; protected var _changeType:String; protected var _startIndex:uint; public static const PRE_DATA_CHANGE:String = "preDataChange"; public static const DATA_CHANGE:String = "dataChange"; public function DataChangeEvent(_arg1:String, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{ super(_arg1); _changeType = _arg2; _startIndex = _arg4; _items = _arg3; _endIndex = ((_arg5)==-1) ? _startIndex : _arg5; } public function get changeType():String{ return (_changeType); } public function get startIndex():uint{ return (_startIndex); } public function get items():Array{ return (_items); } override public function clone():Event{ return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex)); } override public function toString():String{ return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable")); } public function get endIndex():uint{ return (_endIndex); } } }//package fl.events
Section 74
//DataChangeType (fl.events.DataChangeType) package fl.events { public class DataChangeType { public static const ADD:String = "add"; public static const REMOVE:String = "remove"; public static const REMOVE_ALL:String = "removeAll"; public static const CHANGE:String = "change"; public static const REPLACE:String = "replace"; public static const INVALIDATE:String = "invalidate"; public static const INVALIDATE_ALL:String = "invalidateAll"; public static const SORT:String = "sort"; } }//package fl.events
Section 75
//ListEvent (fl.events.ListEvent) package fl.events { import flash.events.*; public class ListEvent extends Event { protected var _index:int; protected var _item:Object; protected var _columnIndex:int; protected var _rowIndex:int; public static const ITEM_DOUBLE_CLICK:String = "itemDoubleClick"; public static const ITEM_ROLL_OUT:String = "itemRollOut"; public static const ITEM_ROLL_OVER:String = "itemRollOver"; public static const ITEM_CLICK:String = "itemClick"; public function ListEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:int=-1, _arg7:Object=null){ super(_arg1, _arg2, _arg3); _rowIndex = _arg5; _columnIndex = _arg4; _index = _arg6; _item = _arg7; } public function get rowIndex():Object{ return (_rowIndex); } public function get index():int{ return (_index); } public function get item():Object{ return (_item); } public function get columnIndex():int{ return (_columnIndex); } override public function clone():Event{ return (new ListEvent(type, bubbles, cancelable, _columnIndex, _rowIndex)); } override public function toString():String{ return (formatToString("ListEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "index", "item")); } } }//package fl.events
Section 76
//ScrollEvent (fl.events.ScrollEvent) package fl.events { import flash.events.*; public class ScrollEvent extends Event { private var _position:Number; private var _direction:String; 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; } override public function clone():Event{ return (new ScrollEvent(_direction, _delta, _position)); } public function get position():Number{ return (_position); } override public function toString():String{ return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position")); } public function get delta():Number{ return (_delta); } public function get direction():String{ return (_direction); } } }//package fl.events
Section 77
//FocusManager (fl.managers.FocusManager) package fl.managers { import fl.core.*; import flash.events.*; import flash.display.*; import fl.controls.*; 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){ activated = false; calculateCandidates = true; _showFocusIndicator = true; _defaultButtonEnabled = true; super(); 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 _local5:int; var _local6:int; var _local7:DisplayObject; var _local8:IFocusManagerGroup; var _local9:int; var _local10:DisplayObject; var _local11:IFocusManagerGroup; _local5 = focusableCandidates.length; _local6 = _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); } 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)); } private function mouseFocusChangeHandler(_arg1:FocusEvent):void{ if ((_arg1.relatedObject is TextField)){ return; }; _arg1.preventDefault(); } private function focusOutHandler(_arg1:FocusEvent):void{ var _local2:InteractiveObject; _local2 = (_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); } public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{ var _local2:InteractiveObject; _local2 = _arg1; while (_arg1) { if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){ return (_arg1); }; _arg1 = _arg1.parent; }; return (_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 addedHandler(_arg1:Event):void{ var _local2:DisplayObject; _local2 = DisplayObject(_arg1.target); if (_local2.stage){ addFocusables(DisplayObject(_arg1.target)); }; } 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); } private function tabChildrenChangeHandler(_arg1:Event):void{ var _local2:DisplayObjectContainer; if (_arg1.target != _arg1.currentTarget){ return; }; calculateCandidates = true; _local2 = DisplayObjectContainer(_arg1.target); if (_local2.tabChildren){ addFocusables(_local2, true); } else { removeFocusables(_local2); }; } public function sendDefaultButtonEvent():void{ defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); } public function getFocus():InteractiveObject{ var _local1:InteractiveObject; _local1 = form.stage.focus; return (findFocusManagerComponent(_local1)); } private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{ var _local2:DisplayObjectContainer; var _local3:TextField; var _local4:SimpleButton; _local2 = 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); } public function set defaultButton(_arg1:Button):void{ var _local2:Button; _local2 = (_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 deactivateHandler(_arg1:Event):void{ var _local2:InteractiveObject; _local2 = InteractiveObject(_arg1.target); } public function setFocus(_arg1:InteractiveObject):void{ if ((_arg1 is IFocusManagerComponent)){ IFocusManagerComponent(_arg1).setFocus(); } else { form.stage.focus = _arg1; }; } private function setFocusToNextObject(_arg1:FocusEvent):void{ var _local2:InteractiveObject; if (!hasFocusableObjects()){ return; }; _local2 = getNextFocusManagerComponent(_arg1.shiftKey); if (_local2){ setFocus(_local2); }; } private function hasFocusableObjects():Boolean{ var _local1:Object; for (_local1 in focusableObjects) { return (true); }; return (false); } private function tabIndexChangeHandler(_arg1:Event):void{ calculateCandidates = 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; var _local3:int; _local2 = focusableCandidates.length; _local3 = 0; _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 _local3:DisplayObject; var _local4:InteractiveObject; _local3 = 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 _local3:String; var _local4:String; var _local5:int; var _local6:String; var _local7:String; var _local8:String; var _local9:DisplayObject; var _local10:DisplayObject; _local3 = ""; _local4 = ""; _local8 = "0000"; _local9 = DisplayObject(_arg1); _local10 = 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; _local2 = 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 _local2:DisplayObject; var _local3:String; var _local4:int; var _local5:Boolean; var _local6:int; var _local7:int; var _local8:IFocusManagerGroup; if (!hasFocusableObjects()){ return (null); }; if (calculateCandidates){ sortFocusableObjects(); calculateCandidates = false; }; _local2 = form.stage.focus; _local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2))); _local3 = ""; if ((_local2 is IFocusManagerGroup)){ _local8 = IFocusManagerGroup(_local2); _local3 = _local8.groupName; }; _local4 = getIndexOfFocusedObject(_local2); _local5 = false; _local6 = _local4; if (_local4 == -1){ if (_arg1){ _local4 = focusableCandidates.length; }; _local5 = true; }; _local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3); return (findFocusManagerComponent(focusableCandidates[_local7])); } private function mouseDownHandler(_arg1:MouseEvent):void{ var _local2:InteractiveObject; if (_arg1.isDefaultPrevented()){ return; }; _local2 = 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; _local2 = _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 _local2:InteractiveObject; var _local3:Button; _local2 = 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{ var _local2:InteractiveObject; var _local3:Boolean; calculateCandidates = true; _local2 = InteractiveObject(_arg1.target); _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 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; } public function get defaultButtonEnabled():Boolean{ return (_defaultButtonEnabled); } } }//package fl.managers
Section 78
//IFocusManager (fl.managers.IFocusManager) package fl.managers { import flash.display.*; import fl.controls.*; 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 get nextTabIndex():int; function get defaultButton():Button; function get showFocusIndicator():Boolean; function setFocus(_arg1:InteractiveObject):void; function activate():void; function showFocus():void; function set defaultButtonEnabled(_arg1:Boolean):void; function hideFocus():void; function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject; function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject; } }//package fl.managers
Section 79
//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 80
//IFocusManagerGroup (fl.managers.IFocusManagerGroup) package fl.managers { public interface IFocusManagerGroup { function set groupName(_arg1:String):void; function set selected(_arg1:Boolean):void; function get groupName():String; function get selected():Boolean; } }//package fl.managers
Section 81
//StyleManager (fl.managers.StyleManager) package fl.managers { import fl.core.*; import flash.text.*; import flash.utils.*; public class StyleManager { private var globalStyles:Object; private var classToDefaultStylesDict:Dictionary; private var styleToClassesHash:Object; private var classToStylesDict:Dictionary; private var classToInstancesDict: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; var _local4:Object; _local3 = getClassDef(_arg1); _local4 = 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; var _local5:Object; _local4 = getClassDef(_arg1); _local5 = 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 _local2:StyleManager; var _local3:Class; var _local4:Object; var _local5:String; _local2 = getInstance(); _local3 = getClassDef(_arg1); _local4 = _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; var _local4:Object; _local3 = getClassDef(_arg1); _local4 = 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 _local3:Dictionary; var _local4:Object; var _local5:UIComponent; _local3 = 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 _local2:Dictionary; var _local3:Object; _local2 = getInstance().styleToClassesHash[_arg1]; if (_local2 == null){ return; }; for (_local3 in _local2) { invalidateComponentStyle(Class(_local3), _arg1); }; } public static function registerInstance(_arg1:UIComponent):void{ var inst:StyleManager; var classDef:Class; var target:Class; var defaultStyles:Object; var styleToClasses:Object; var n:String; var instance = _arg1; inst = getInstance(); classDef = 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; 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; var _local4:StyleManager; var _local5:Object; _local3 = getClassDef(_arg1); _local4 = getInstance(); _local5 = _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; _local3 = getInstance().globalStyles; if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ return; }; _local3[_arg1] = _arg2; invalidateStyle(_arg1); } } }//package fl.managers
Section 82
//AutoLayoutEvent (fl.video.AutoLayoutEvent) package fl.video { import flash.events.*; import flash.geom.*; public class AutoLayoutEvent extends LayoutEvent implements IVPEvent { private var _vp:uint; public static const AUTO_LAYOUT:String = "autoLayout"; public function AutoLayoutEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Rectangle=null, _arg5:Rectangle=null, _arg6:uint=0){ super(_arg1, _arg2, _arg3, _arg4, _arg5); _vp = _arg6; } override public function clone():Event{ return (new AutoLayoutEvent(type, bubbles, cancelable, Rectangle(oldBounds.clone()), Rectangle(oldRegistrationBounds.clone()), vp)); } public function set vp(_arg1:uint):void{ _vp = _arg1; } public function get vp():uint{ return (_vp); } } }//package fl.video
Section 83
//ConnectClient (fl.video.ConnectClient) package fl.video { import flash.net.*; public class ConnectClient { public var connIndex:uint; public var nc:NetConnection; public var pending:Boolean; public var owner:NCManager; public function ConnectClient(_arg1:NCManager, _arg2:NetConnection, _arg3:uint=0){ this.owner = _arg1; this.nc = _arg2; this.connIndex = _arg3; this.pending = false; } public function onBWCheck(... _args):Number{ return (++owner._payload); } public function onBWDone(... _args):void{ var _local2:Number; if (_args.length > 0){ _local2 = _args[0]; }; owner.onConnected(nc, _local2); } public function close():void{ } } }//package fl.video
Section 84
//ControlData (fl.video.ControlData) package fl.video { import flash.display.*; public class ControlData { public var state_mc:Array; public var origWidth:Number; public var handle_mc:Sprite; public var state:uint; public var leftMargin:Number; public var fullness_mc:DisplayObject; public var isDragging:Boolean; public var currentState_mc:DisplayObject; public var percentage:Number; public var owner:DisplayObject; public var origX:Number; public var origY:Number; public var bottomMargin:Number; public var disabled_mc:DisplayObject; public var enabled:Boolean; public var hit_mc:Sprite; public var origHeight:Number; public var index:int; public var mask_mc:DisplayObject; public var avatar:DisplayObject; public var fill_mc:DisplayObject; public var topMargin:Number; public var uiMgr:UIManager; public var progress_mc:DisplayObject; public var rightMargin:Number; public var ctrl:DisplayObject; public var origScaleX:Number; public var origScaleY:Number; public function ControlData(_arg1:UIManager, _arg2:DisplayObject, _arg3:DisplayObject, _arg4:int){ var uiMgr = _arg1; var ctrl = _arg2; var owner = _arg3; var index = _arg4; super(); this.uiMgr = uiMgr; this.index = index; this.ctrl = ctrl; this.owner = owner; try { ctrl["uiMgr"] = uiMgr; } catch(re:ReferenceError) { }; } } }//package fl.video
Section 85
//CuePointManager (fl.video.CuePointManager) package fl.video { public class CuePointManager { flvplayback_internal var _disabledCuePointsByNameOnly:Object; flvplayback_internal var navCuePoints:Array; flvplayback_internal var allCuePoints:Array; flvplayback_internal var _disabledCuePoints:Array; flvplayback_internal var _asCuePointTolerance:Number; flvplayback_internal var _linearSearchTolerance:Number; flvplayback_internal var _asCuePointIndex:int; flvplayback_internal var asCuePoints:Array; flvplayback_internal var flvCuePoints:Array; flvplayback_internal var _metadataLoaded:Boolean; flvplayback_internal var _id:uint; private var _owner:FLVPlayback; flvplayback_internal var eventCuePoints:Array; public static const SHORT_VERSION:String = "2.0"; public static const VERSION:String = "2.0.0.37"; flvplayback_internal static const DEFAULT_LINEAR_SEARCH_TOLERANCE:Number = 50; flvplayback_internal static var cuePointsReplace:Array = ["&quot;", "\"", "&#39;", "'", "&#44;", ",", "&amp;", "&"]; public function CuePointManager(_arg1:FLVPlayback, _arg2:uint){ _owner = _arg1; _id = _arg2; reset(); _asCuePointTolerance = (_owner.getVideoPlayer(_id).playheadUpdateInterval / 2000); _linearSearchTolerance = DEFAULT_LINEAR_SEARCH_TOLERANCE; } flvplayback_internal function getCuePoint(_arg1:Array, _arg2:Boolean, _arg3):Object{ var _local4:Object; var _local5:int; switch (typeof(_arg3)){ case "string": _local4 = {name:_arg3}; break; case "number": _local4 = {time:_arg3}; break; case "object": _local4 = _arg3; break; }; _local5 = getCuePointIndex(_arg1, _arg2, _local4.time, _local4.name); if (_local5 < 0){ return (null); }; _local4 = deepCopyObject(_arg1[_local5]); _local4.array = _arg1; _local4.index = _local5; return (_local4); } public function resetASCuePointIndex(_arg1:Number):void{ var _local2:int; if ((((_arg1 <= 0)) || ((asCuePoints == null)))){ _asCuePointIndex = 0; return; }; _local2 = getCuePointIndex(asCuePoints, true, _arg1); _asCuePointIndex = ((asCuePoints[_local2].time)<_arg1) ? (_local2 + 1) : _local2; } public function set playheadUpdateInterval(_arg1:Number):void{ _asCuePointTolerance = (_arg1 / 2000); } flvplayback_internal function addOrDisable(_arg1:Boolean, _arg2:Object):void{ if (_arg1){ if (_arg2.type == CuePointType.ACTIONSCRIPT){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "Cannot disable actionscript cue points")); }; setFLVCuePointEnabled(false, _arg2); } else { if (_arg2.type == CuePointType.ACTIONSCRIPT){ addASCuePoint(_arg2); }; }; } public function processFLVCuePoints(_arg1:Array):void{ var _local2:int; var _local3:Number; var _local4:Object; var _local5:Array; var _local6:Number; var _local7:int; _metadataLoaded = true; if ((((_arg1 == null)) || ((_arg1.length < 1)))){ flvCuePoints = null; navCuePoints = null; eventCuePoints = null; return; }; flvCuePoints = _arg1; navCuePoints = new Array(); eventCuePoints = new Array(); _local3 = -1; _local5 = _disabledCuePoints; _local6 = 0; _disabledCuePoints = new Array(); _local7 = 0; while ((_local4 = flvCuePoints[_local7++]) != undefined) { if ((((_local3 > 0)) && ((_local3 >= _local4.time)))){ flvCuePoints = null; navCuePoints = null; eventCuePoints = null; _disabledCuePoints = new Array(); _disabledCuePointsByNameOnly = new Object(); throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, ("Unsorted cuePoint found after time: " + _local3))); }; _local3 = _local4.time; while ((((_local6 < _local5.length)) && ((cuePointCompare(_local5[_local6].time, null, _local4) < 0)))) { _local6++; }; if (((!((_disabledCuePointsByNameOnly[_local4.name] == undefined))) || ((((_local6 < _local5.length)) && ((cuePointCompare(_local5[_local6].time, _local5[_local6].name, _local4) == 0)))))){ _disabledCuePoints.push({time:_local4.time, name:_local4.name}); }; if (_local4.type == CuePointType.NAVIGATION){ navCuePoints.push(_local4); } else { if (_local4.type == CuePointType.EVENT){ eventCuePoints.push(_local4); }; }; if ((((allCuePoints == null)) || ((allCuePoints.length < 1)))){ allCuePoints = new Array(); allCuePoints.push(_local4); } else { _local2 = getCuePointIndex(allCuePoints, true, _local4.time); _local2 = ((allCuePoints[_local2].time)>_local4.time) ? 0 : (_local2 + 1); allCuePoints.splice(_local2, 0, _local4); }; }; _disabledCuePointsByNameOnly = new Object(); } public function addASCuePoint(_arg1, _arg2:String=null, _arg3:Object=null):Object{ var _local4:Object; var _local5:Boolean; var _local6:Boolean; var _local7:int; var _local8:Number; var _local9:Object; var _local10:int; if (typeof(_arg1) == "object"){ _local4 = deepCopyObject(_arg1); } else { _local4 = {time:_arg1, name:_arg2, parameters:deepCopyObject(_arg3)}; }; if (_local4.parameters == null){ delete _local4.parameters; }; _local5 = ((isNaN(_local4.time)) || ((_local4.time < 0))); if (_local5){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number")); }; _local6 = (_local4.name == null); if (_local6){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be undefined or null")); }; _local4.type = CuePointType.ACTIONSCRIPT; if ((((asCuePoints == null)) || ((asCuePoints.length < 1)))){ _local7 = 0; asCuePoints = new Array(); asCuePoints.push(_local4); } else { _local7 = getCuePointIndex(asCuePoints, true, _local4.time); _local7 = ((asCuePoints[_local7].time)>_local4.time) ? 0 : (_local7 + 1); asCuePoints.splice(_local7, 0, _local4); }; if ((((allCuePoints == null)) || ((allCuePoints.length < 1)))){ allCuePoints = new Array(); allCuePoints.push(_local4); } else { _local10 = getCuePointIndex(allCuePoints, true, _local4.time); _local10 = ((allCuePoints[_local10].time)>_local4.time) ? 0 : (_local10 + 1); allCuePoints.splice(_local10, 0, _local4); }; _local8 = _owner.getVideoPlayer(_id).playheadTime; if (_local8 > 0){ if (_asCuePointIndex == _local7){ if (_local8 > asCuePoints[_local7].time){ _asCuePointIndex++; }; } else { if (_asCuePointIndex > _local7){ _asCuePointIndex++; }; }; } else { _asCuePointIndex = 0; }; _local9 = deepCopyObject(asCuePoints[_local7]); _local9.array = asCuePoints; _local9.index = _local7; return (_local9); } public function get metadataLoaded():Boolean{ return (_metadataLoaded); } public function reset():void{ _metadataLoaded = false; allCuePoints = null; asCuePoints = null; _disabledCuePoints = new Array(); _disabledCuePointsByNameOnly = new Object(); flvCuePoints = null; navCuePoints = null; eventCuePoints = null; _asCuePointIndex = 0; } public function removeCuePoints(_arg1:Array, _arg2:Object):Number{ var _local3:int; var _local4:Object; var _local5:int; _local5 = 0; _local3 = getCuePointIndex(_arg1, true, -1, _arg2.name); while (_local3 >= 0) { _local4 = _arg1[_local3]; _arg1.splice(_local3, 1); _local3--; _local5++; _local3 = getNextCuePointIndexWithName(_local4.name, _arg1, _local3); }; return (_local5); } flvplayback_internal function unescape(_arg1:String):String{ var _local2:String; var _local3:int; _local2 = _arg1; _local3 = 0; while (_local3 < cuePointsReplace.length) { var _temp1 = _local3; _local3 = (_local3 + 1); var _temp2 = _local3; _local3 = (_local3 + 1); _local2 = _local2.replace(cuePointsReplace[_temp1], cuePointsReplace[_temp2]); }; return (_local2); } public function setFLVCuePointEnabled(_arg1:Boolean, _arg2):int{ var _local3:Object; var _local4:Boolean; var _local5:Boolean; var _local6:uint; var _local7:int; var _local8:int; var _local9:Object; switch (typeof(_arg2)){ case "string": _local3 = {name:_arg2}; break; case "number": _local3 = {time:_arg2}; break; case "object": _local3 = _arg2; break; }; _local4 = ((isNaN(_local3.time)) || ((_local3.time < 0))); _local5 = (_local3.name == null); if (((_local4) && (_local5))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null")); }; _local6 = 0; if (_local4){ if (!_metadataLoaded){ if (_disabledCuePointsByNameOnly[_local3.name] == undefined){ if (!_arg1){ _disabledCuePointsByNameOnly[_local3.name] = new Array(); }; } else { if (_arg1){ delete _disabledCuePointsByNameOnly[_local3.name]; }; return (-1); }; removeCuePoints(_disabledCuePoints, _local3); return (-1); }; if (_arg1){ _local6 = removeCuePoints(_disabledCuePoints, _local3); } else { _local7 = getCuePointIndex(flvCuePoints, true, -1, _local3.name); while (_local7 >= 0) { _local9 = flvCuePoints[_local7]; _local8 = getCuePointIndex(_disabledCuePoints, true, _local9.time); if ((((_local8 < 0)) || (!((_disabledCuePoints[_local8].time == _local9.time))))){ _disabledCuePoints = insertCuePoint(_local8, _disabledCuePoints, {name:_local9.name, time:_local9.time}); _local6 = (_local6 + 1); }; _local7 = getNextCuePointIndexWithName(_local9.name, flvCuePoints, _local7); }; }; return (_local6); }; _local7 = getCuePointIndex(_disabledCuePoints, false, _local3.time, _local3.name); if (_local7 < 0){ if (_arg1){ if (!_metadataLoaded){ _local7 = getCuePointIndex(_disabledCuePoints, false, _local3.time); if (_local7 < 0){ _local8 = getCuePointIndex(_disabledCuePointsByNameOnly[_local3.name], true, _local3.time); if (cuePointCompare(_local3.time, null, _disabledCuePointsByNameOnly[_local3.name]) != 0){ _disabledCuePointsByNameOnly[_local3.name] = insertCuePoint(_local8, _disabledCuePointsByNameOnly[_local3.name], _local3); }; } else { _disabledCuePoints.splice(_local7, 1); }; }; return ((_metadataLoaded) ? 0 : -1); }; } else { if (_arg1){ _disabledCuePoints.splice(_local7, 1); _local6 = 1; } else { _local6 = 0; }; return ((_metadataLoaded) ? _local6 : -1); }; if (_metadataLoaded){ _local7 = getCuePointIndex(flvCuePoints, false, _local3.time, _local3.name); if (_local7 < 0){ return (0); }; if (_local5){ _local3.name = flvCuePoints[_local7].name; }; }; _local8 = getCuePointIndex(_disabledCuePoints, true, _local3.time); _disabledCuePoints = insertCuePoint(_local8, _disabledCuePoints, _local3); _local6 = 1; return ((_metadataLoaded) ? _local6 : -1); } public function isFLVCuePointEnabled(_arg1):Boolean{ var _local2:Object; var _local3:Boolean; var _local4:Boolean; var _local5:int; if (!_metadataLoaded){ return (true); }; switch (typeof(_arg1)){ case "string": _local2 = {name:_arg1}; break; case "number": _local2 = {time:_arg1}; break; case "object": _local2 = _arg1; break; }; _local3 = ((isNaN(_local2.time)) || ((_local2.time < 0))); _local4 = (_local2.name == null); if (((_local3) && (_local4))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null")); }; if (_local3){ _local5 = getCuePointIndex(flvCuePoints, true, -1, _local2.name); if (_local5 < 0){ return (true); }; while (_local5 >= 0) { if (getCuePointIndex(_disabledCuePoints, false, flvCuePoints[_local5].time, flvCuePoints[_local5].name) < 0){ return (true); }; _local5 = getNextCuePointIndexWithName(_local2.name, flvCuePoints, _local5); }; return (false); }; return ((getCuePointIndex(_disabledCuePoints, false, _local2.time, _local2.name) < 0)); } public function removeASCuePoint(_arg1):Object{ var _local2:Object; var _local3:int; if ((((asCuePoints == null)) || ((asCuePoints.length < 1)))){ return (null); }; switch (typeof(_arg1)){ case "string": _local2 = {name:_arg1}; break; case "number": _local2 = {time:_arg1}; break; case "object": _local2 = _arg1; break; }; _local3 = getCuePointIndex(asCuePoints, false, _local2.time, _local2.name); if (_local3 < 0){ return (null); }; _local2 = asCuePoints[_local3]; asCuePoints.splice(_local3, 1); _local3 = getCuePointIndex(allCuePoints, false, _local2.time, _local2.name); if (_local3 > 0){ allCuePoints.splice(_local3, 1); }; if (_owner.getVideoPlayer(_id).playheadTime > 0){ if (_asCuePointIndex > _local3){ _asCuePointIndex--; }; } else { _asCuePointIndex = 0; }; return (_local2); } public function get id():uint{ return (_id); } public function processCuePointsProperty(_arg1:Array):void{ var _local2:uint; var _local3:uint; var _local4:String; var _local5:String; var _local6:Object; var _local7:Boolean; var _local8:int; if ((((_arg1 == null)) || ((_arg1.length == 0)))){ return; }; _local2 = 0; _local8 = 0; while (_local8 < (_arg1.length - 1)) { switch (_local2){ case 6: addOrDisable(_local7, _local6); _local2 = 0; case 0: var _temp1 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp1] != "t"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number")); }; _local6 = new Object(); _local6.time = (_arg1[_local8] / 1000); _local2++; break; case 1: var _temp2 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp2] != "n"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (_arg1[_local8] == undefined){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be null or undefined")); }; _local6.name = unescape(_arg1[_local8]); _local2++; break; case 2: var _temp3 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp3] != "t"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "type must be number")); }; switch (_arg1[_local8]){ case 0: _local6.type = CuePointType.EVENT; break; case 1: _local6.type = CuePointType.NAVIGATION; break; case 2: _local6.type = CuePointType.ACTIONSCRIPT; break; default: throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "type must be 0, 1 or 2")); }; _local2++; break; case 3: var _temp4 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp4] != "d"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "disabled must be number")); }; _local7 = !((_arg1[_local8] == 0)); _local2++; break; case 4: var _temp5 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp5] != "p"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "num params must be number")); }; _local3 = _arg1[_local8]; _local2++; if (_local3 == 0){ _local2++; } else { _local6.parameters = new Object(); }; break; case 5: var _temp6 = _local8; _local8 = (_local8 + 1); _local4 = _arg1[_temp6]; _local5 = _arg1[_local8]; if ((_local4 is String)){ _local4 = unescape(_local4); }; if ((_local5 is String)){ _local5 = unescape(_local5); }; _local6.parameters[_local4] = _local5; _local3--; if (_local3 == 0){ _local2++; }; break; }; _local8++; }; if (_local2 == 6){ addOrDisable(_local7, _local6); } else { throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected end of cuePoint param string")); }; } flvplayback_internal function getNextCuePointIndexWithName(_arg1:String, _arg2:Array, _arg3:int):int{ var _local4:int; if (_arg1 == null){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be undefined or null")); }; if (_arg2 == null){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint.array undefined")); }; if (((((isNaN(_arg3)) || ((_arg3 < -1)))) || ((_arg3 >= _arg2.length)))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint.index must be number between -1 and cuePoint.array.length")); }; _local4 = (_arg3 + 1); while (_local4 < _arg2.length) { if (_arg2[_local4].name == _arg1){ break; }; _local4++; }; if (_local4 < _arg2.length){ return (_local4); }; return (-1); } public function dispatchASCuePoints():void{ var _local1:Number; _local1 = _owner.getVideoPlayer(_id).playheadTime; if (((_owner.getVideoPlayer(_id).stateResponsive) && (!((asCuePoints == null))))){ while ((((_asCuePointIndex < asCuePoints.length)) && ((asCuePoints[_asCuePointIndex].time <= (_local1 + _asCuePointTolerance))))) { _owner.dispatchEvent(new MetadataEvent(MetadataEvent.CUE_POINT, false, false, deepCopyObject(asCuePoints[_asCuePointIndex++]), _id)); }; }; } flvplayback_internal function getNextCuePointWithName(_arg1:Object):Object{ var _local2:int; var _local3:Object; if (_arg1 == null){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint parameter undefined")); }; if (((isNaN(_arg1.time)) || ((_arg1.time < 0)))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number")); }; _local2 = getNextCuePointIndexWithName(_arg1.name, _arg1.array, _arg1.index); if (_local2 < 0){ return (null); }; _local3 = deepCopyObject(_arg1.array[_local2]); _local3.array = _arg1.array; _local3.index = _local2; return (_local3); } public function insertCuePoint(_arg1:int, _arg2:Array, _arg3:Object):Array{ if (_arg1 < 0){ _arg2 = new Array(); _arg2.push(_arg3); } else { if (_arg2[_arg1].time > _arg3.time){ _arg1 = 0; } else { _arg1++; }; _arg2.splice(_arg1, 0, _arg3); }; return (_arg2); } flvplayback_internal function getCuePointIndex(_arg1:Array, _arg2:Boolean, _arg3:Number=NaN, _arg4:String=null, _arg5:int=-1, _arg6:int=-1):int{ var _local7:Boolean; var _local8:Boolean; var _local9:int; var _local10:int; var _local11:int; var _local12:int; var _local13:int; var _local14:int; var _local15:int; if ((((_arg1 == null)) || ((_arg1.length < 1)))){ return (-1); }; _local7 = ((isNaN(_arg3)) || ((_arg3 < 0))); _local8 = (_arg4 == null); if (((_local7) && (_local8))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null")); }; if (_arg5 < 0){ _arg5 = 0; }; if (_arg6 < 0){ _arg6 = _arg1.length; }; if (((!(_local8)) && (((_arg2) || (_local7))))){ if (_local7){ _local12 = _arg5; } else { _local12 = getCuePointIndex(_arg1, _arg2, _arg3); }; _local13 = _local12; while (_local13 >= _arg5) { if (_arg1[_local13].name == _arg4){ break; }; _local13--; }; if (_local13 >= _arg5){ return (_local13); }; _local13 = (_local12 + 1); while (_local13 < _arg6) { if (_arg1[_local13].name == _arg4){ break; }; _local13++; }; if (_local13 < _arg6){ return (_local13); }; return (-1); }; if (_arg6 <= _linearSearchTolerance){ _local14 = (_arg5 + _arg6); _local15 = _arg5; while (_local15 < _local14) { _local9 = cuePointCompare(_arg3, _arg4, _arg1[_local15]); if (_local9 == 0){ return (_local15); }; if (_local9 < 0){ break; }; _local15++; }; if (_arg2){ if (_local15 > 0){ return ((_local15 - 1)); }; return (0); }; return (-1); }; _local10 = int((_arg6 / 2)); _local11 = (_arg5 + _local10); _local9 = cuePointCompare(_arg3, _arg4, _arg1[_local11]); if (_local9 < 0){ return (getCuePointIndex(_arg1, _arg2, _arg3, _arg4, _arg5, _local10)); }; if (_local9 > 0){ return (getCuePointIndex(_arg1, _arg2, _arg3, _arg4, (_local11 + 1), ((_local10 - 1) + (_arg6 % 2)))); }; return (_local11); } flvplayback_internal static function deepCopyObject(_arg1:Object, _arg2:uint=0):Object{ var _local3:Object; var _local4:*; if (_arg1 == null){ return (_arg1); }; _local3 = new Object(); for (_local4 in _arg1) { if ((((_arg2 == 0)) && ((((_local4 == "array")) || ((_local4 == "index")))))){ } else { if (typeof(_arg1[_local4]) == "object"){ _local3[_local4] = deepCopyObject(_arg1[_local4], (_arg2 + 1)); } else { _local3[_local4] = _arg1[_local4]; }; }; }; return (_local3); } flvplayback_internal static function cuePointCompare(_arg1:Number, _arg2:String, _arg3:Object):int{ var _local4:Number; var _local5:Number; _local4 = Math.round((_arg1 * 1000)); _local5 = Math.round((_arg3.time * 1000)); if (_local4 < _local5){ return (-1); }; if (_local4 > _local5){ return (1); }; if (_arg2 != null){ if (_arg2 == _arg3.name){ return (0); }; if (_arg2 < _arg3.name){ return (-1); }; return (1); }; return (0); } } }//package fl.video
Section 86
//CuePointType (fl.video.CuePointType) package fl.video { public final class CuePointType { public static const FLV:String = "flv"; public static const ALL:String = "all"; public static const ACTIONSCRIPT:String = "actionscript"; public static const EVENT:String = "event"; public static const NAVIGATION:String = "navigation"; } }//package fl.video
Section 87
//FLVPlayback (fl.video.FLVPlayback) package fl.video { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.utils.*; public class FLVPlayback extends Sprite { private var _playheadUpdateInterval:Number; private var _align:String; flvplayback_internal var videoPlayerStateDict:Dictionary; flvplayback_internal var cuePointMgrs:Array; private var _volume:Number; private var _origHeight:Number; flvplayback_internal var videoPlayerStates:Array; private var _progressInterval:Number; private var _seekToPrevOffset:Number; private var _origWidth:Number; private var _scaleMode:String; flvplayback_internal var resizingNow:Boolean; flvplayback_internal var videoPlayers:Array; private var _bufferTime:Number; private var _aspectRatio:Boolean; private var _autoRewind:Boolean; flvplayback_internal var uiMgr:UIManager; private var previewImage_mc:Loader; private var _componentInspectorSetting:Boolean; flvplayback_internal var _firstStreamShown:Boolean; private var _visibleVP:uint; private var _idleTimeout:Number; private var _soundTransform:SoundTransform; public var boundingBox_mc:DisplayObject; flvplayback_internal var skinShowTimer:Timer; private var preview_mc:MovieClip; private var livePreviewHeight:Number; flvplayback_internal var _firstStreamReady:Boolean; private var _activeVP:uint; private var isLivePreview:Boolean; private var _topVP:uint; private var livePreviewWidth:Number; private var __forceNCMgr:NCManager; private var previewImageUrl:String; public static const SEEK_TO_PREV_OFFSET_DEFAULT:Number = 1; public static const SHORT_VERSION:String = "2.0"; flvplayback_internal static const skinShowTimerInterval:Number = 2000; public static const VERSION:String = "2.0.0.37"; flvplayback_internal static const DEFAULT_SKIN_SHOW_TIMER_INTERVAL:Number = 2000; public function FLVPlayback(){ var _local1:VideoPlayer; super(); isLivePreview = ((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent"))); _componentInspectorSetting = false; _origWidth = super.width; _origHeight = super.height; super.scaleX = 1; super.scaleY = 1; _local1 = new VideoPlayer(0, 0); _local1.setSize(_origWidth, _origHeight); videoPlayers = new Array(); videoPlayers[0] = _local1; _align = _local1.align; _autoRewind = _local1.autoRewind; _scaleMode = _local1.scaleMode; _bufferTime = _local1.bufferTime; _idleTimeout = _local1.idleTimeout; _playheadUpdateInterval = _local1.playheadUpdateInterval; _progressInterval = _local1.progressInterval; _soundTransform = _local1.soundTransform; _volume = _local1.volume; _seekToPrevOffset = SEEK_TO_PREV_OFFSET_DEFAULT; _firstStreamReady = false; _firstStreamShown = false; resizingNow = false; uiMgr = new UIManager(this); if (isLivePreview){ uiMgr.visible = true; }; _activeVP = 0; _visibleVP = 0; _topVP = 0; videoPlayerStates = new Array(); videoPlayerStateDict = new Dictionary(true); cuePointMgrs = new Array(); createVideoPlayer(0); boundingBox_mc.visible = false; removeChild(boundingBox_mc); boundingBox_mc = null; if (isLivePreview){ previewImageUrl = ""; createLivePreviewMovieClip(); setSize(_origWidth, _origHeight); }; } public function set fullScreenTakeOver(_arg1:Boolean):void{ uiMgr.fullScreenTakeOver = _arg1; } public function pause():void{ var _local1:VideoPlayerState; var _local2:VideoPlayer; if (!_firstStreamShown){ _local1 = videoPlayerStates[_activeVP]; queueCmd(_local1, QueuedCommand.PAUSE); } else { _local2 = videoPlayers[_activeVP]; _local2.pause(); }; } public function setScale(_arg1:Number, _arg2:Number):void{ var _local3:Rectangle; var _local4:Rectangle; var _local5:int; var _local6:VideoPlayer; _local3 = new Rectangle(x, y, width, height); _local4 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight); resizingNow = true; _local5 = 0; while (_local5 < videoPlayers.length) { _local6 = videoPlayers[_local5]; if (_local6 !== null){ _local6.setSize((_origWidth * _arg1), (_origWidth * _arg2)); }; _local5++; }; resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4)); } public function stop():void{ var _local1:VideoPlayerState; var _local2:VideoPlayer; if (!_firstStreamShown){ _local1 = videoPlayerStates[_activeVP]; queueCmd(_local1, QueuedCommand.STOP); } else { _local2 = videoPlayers[_activeVP]; _local2.stop(); }; } public function set align(_arg1:String):void{ var _local2:VideoPlayer; if (_activeVP == 0){ _align = _arg1; }; _local2 = videoPlayers[_activeVP]; _local2.align = _arg1; } public function getVideoPlayer(_arg1:Number):VideoPlayer{ return (videoPlayers[_arg1]); } public function get playheadTime():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.playheadTime); } public function get progressInterval():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.progressInterval); } public function set skinFadeTime(_arg1:int):void{ uiMgr.skinFadeTime = _arg1; } public function get seekToPrevOffset():Number{ return (_seekToPrevOffset); } public function set playheadTime(_arg1:Number):void{ seek(_arg1); } public function get source():String{ var _local1:VideoPlayerState; var _local2:VideoPlayer; _local1 = videoPlayerStates[_activeVP]; if (_local1.isWaiting){ return (_local1.url); }; _local2 = videoPlayers[_activeVP]; return (_local2.source); } public function get activeVideoPlayerIndex():uint{ return (_activeVP); } public function get skinFadeTime():int{ return (uiMgr.skinFadeTime); } public function set scaleMode(_arg1:String):void{ var _local2:VideoPlayer; if (_activeVP == 0){ _scaleMode = _arg1; }; _local2 = videoPlayers[_activeVP]; _local2.scaleMode = _arg1; } public function set bufferingBar(_arg1:Sprite):void{ uiMgr.setControl(UIManager.BUFFERING_BAR, _arg1); } public function get metadataLoaded():Boolean{ var _local1:CuePointManager; _local1 = cuePointMgrs[_activeVP]; return (_local1.metadataLoaded); } public function closeVideoPlayer(_arg1:uint):void{ var _local2:VideoPlayer; if (_arg1 == 0){ throw (new VideoError(VideoError.DELETE_DEFAULT_PLAYER)); }; if (videoPlayers[_arg1] == undefined){ return; }; _local2 = videoPlayers[_arg1]; if (_visibleVP == _arg1){ visibleVideoPlayerIndex = 0; }; if (_activeVP == _arg1){ activeVideoPlayerIndex = 0; }; removeChild(_local2); _local2.close(); delete videoPlayers[_arg1]; delete videoPlayerStates[_arg1]; delete videoPlayerStateDict[_local2]; } public function get scaleMode():String{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.scaleMode); } public function set progressInterval(_arg1:Number):void{ var _local2:VideoPlayer; if (_activeVP == 0){ _progressInterval = _arg1; }; _local2 = videoPlayers[_activeVP]; _local2.progressInterval = _arg1; } public function get playing():Boolean{ return ((state == VideoState.PLAYING)); } public function get totalTime():Number{ var _local1:VideoPlayerState; var _local2:VideoPlayer; if (isLivePreview){ return (1); }; _local1 = videoPlayerStates[_activeVP]; if (_local1.totalTimeSet){ return (_local1.totalTime); }; _local2 = videoPlayers[_activeVP]; return (_local2.totalTime); } public function get ncMgr():INCManager{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.ncMgr); } public function set volume(_arg1:Number):void{ var _local2:VideoPlayer; if (_volume == _arg1){ return; }; _volume = _arg1; if (!scrubbing){ _local2 = videoPlayers[_visibleVP]; _local2.volume = _volume; }; dispatchEvent(new SoundEvent(SoundEvent.SOUND_UPDATE, false, false, _local2.soundTransform)); } public function get skinAutoHide():Boolean{ return (uiMgr.skinAutoHide); } public function set source(_arg1:String):void{ var _local2:VideoPlayerState; var _local3:CuePointManager; if (isLivePreview){ return; }; if (_arg1 == null){ _arg1 = ""; }; if (_componentInspectorSetting){ _local2 = videoPlayerStates[_activeVP]; _local2.url = _arg1; if (_arg1.length > 0){ _local2.isWaiting = true; addEventListener(Event.ENTER_FRAME, doContentPathConnect); }; } else { if (source == _arg1){ return; }; _local3 = cuePointMgrs[_activeVP]; _local3.reset(); _local2 = videoPlayerStates[_activeVP]; _local2.url = _arg1; _local2.isWaiting = true; doContentPathConnect(_activeVP); }; } public function set activeVideoPlayerIndex(_arg1:uint):void{ if (_activeVP == _arg1){ return; }; _activeVP = _arg1; if (videoPlayers[_activeVP] == undefined){ createVideoPlayer(_activeVP); }; } override public function set soundTransform(_arg1:SoundTransform):void{ var _local2:VideoPlayer; if (_arg1 == null){ return; }; _volume = _arg1.volume; _soundTransform.volume = (scrubbing) ? 0 : _arg1.volume; _soundTransform.leftToLeft = _arg1.leftToLeft; _soundTransform.leftToRight = _arg1.leftToRight; _soundTransform.rightToLeft = _arg1.rightToLeft; _soundTransform.rightToRight = _arg1.rightToRight; _local2 = videoPlayers[_activeVP]; _local2.soundTransform = _soundTransform; dispatchEvent(new SoundEvent(SoundEvent.SOUND_UPDATE, false, false, _local2.soundTransform)); } public function set seekToPrevOffset(_arg1:Number):void{ _seekToPrevOffset = _arg1; } public function set seekBarScrubTolerance(_arg1:Number):void{ uiMgr.seekBarScrubTolerance = _arg1; } override public function get scaleX():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_visibleVP]; return ((_local1.width / _origWidth)); } override public function get scaleY():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_visibleVP]; return ((_local1.height / _origHeight)); } public function get bytesLoaded():uint{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.bytesLoaded); } override public function set height(_arg1:Number):void{ var _local2:Rectangle; var _local3:Rectangle; var _local4:int; var _local5:VideoPlayer; if (isLivePreview){ setSize(this.width, _arg1); return; }; _local2 = new Rectangle(x, y, width, height); _local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight); resizingNow = true; _local4 = 0; while (_local4 < videoPlayers.length) { _local5 = videoPlayers[_local4]; if (_local5 != null){ _local5.height = _arg1; }; _local4++; }; resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } public function get forwardButton():Sprite{ return (uiMgr.getControl(UIManager.FORWARD_BUTTON)); } public function get seekBarInterval():Number{ return (uiMgr.seekBarInterval); } public function set totalTime(_arg1:Number):void{ var _local2:VideoPlayerState; _local2 = videoPlayerStates[_activeVP]; _local2.totalTime = _arg1; _local2.totalTimeSet = true; } public function set skinAutoHide(_arg1:Boolean):void{ if (isLivePreview){ return; }; uiMgr.skinAutoHide = _arg1; } public function set bufferTime(_arg1:Number):void{ var _local2:VideoPlayer; _local2 = videoPlayers[_activeVP]; _local2.bufferTime = _arg1; } public function get fullScreenSkinDelay():int{ return (uiMgr.fullScreenSkinDelay); } public function seekToNavCuePoint(_arg1):void{ var _local2:Object; var _local3:Object; if ((_arg1 is String)){ _local2 = {name:String(_arg1)}; } else { if ((_arg1 is Number)){ _local2 = {time:Number(_arg1)}; } else { _local2 = _arg1; }; }; if (_local2.name == undefined){ seekToNextNavCuePoint(_local2.time); return; }; if (isNaN(_local2.time)){ _local2.time = 0; }; _local3 = findNearestCuePoint(_arg1, CuePointType.NAVIGATION); while (((!((_local3 == null))) && ((((_local3.time < _local2.time)) || (!(isFLVCuePointEnabled(_local3))))))) { _local3 = findNextCuePointWithName(_local3); }; if (_local3 == null){ throw (new VideoError(VideoError.INVALID_SEEK)); }; seek(_local3.time); } private function onCompletePreview(_arg1:Event):void{ var e = _arg1; try { previewImage_mc.width = livePreviewWidth; previewImage_mc.height = livePreviewHeight; } catch(e:Error) { }; } public function set isLive(_arg1:Boolean):void{ var _local2:VideoPlayerState; _local2 = videoPlayerStates[_activeVP]; _local2.isLive = _arg1; _local2.isLiveSet = true; } flvplayback_internal function showSkinNow(_arg1:TimerEvent):void{ skinShowTimer = null; uiMgr.visible = true; } override public function get x():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_visibleVP]; return ((super.x + _local1.x)); } override public function get y():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_visibleVP]; return ((super.y + _local1.y)); } public function get seekBar():Sprite{ return (uiMgr.getControl(UIManager.SEEK_BAR)); } public function get volumeBarInterval():Number{ return (uiMgr.volumeBarInterval); } public function set registrationHeight(_arg1:Number):void{ height = _arg1; } public function get bufferingBarHidesAndDisablesOthers():Boolean{ return (uiMgr.bufferingBarHidesAndDisablesOthers); } public function seek(_arg1:Number):void{ var _local2:VideoPlayerState; var _local3:VideoPlayer; _local2 = videoPlayerStates[_activeVP]; if (!_firstStreamShown){ _local2.preSeekTime = 0; queueCmd(_local2, QueuedCommand.SEEK, _arg1); } else { _local2.preSeekTime = playheadTime; _local3 = videoPlayers[_activeVP]; _local3.seek(_arg1); }; } public function get state():String{ var _local1:VideoPlayer; var _local2:String; var _local3:VideoPlayerState; if (isLivePreview){ return (VideoState.STOPPED); }; _local1 = videoPlayers[_activeVP]; if ((((_activeVP == _visibleVP)) && (scrubbing))){ return (VideoState.SEEKING); }; _local2 = _local1.state; if (_local2 == VideoState.RESIZING){ return (VideoState.LOADING); }; _local3 = videoPlayerStates[_activeVP]; if ((((((_local3.prevState == VideoState.LOADING)) && (_local3.autoPlay))) && ((_local2 == VideoState.STOPPED)))){ return (VideoState.LOADING); }; return (_local2); } public function set autoRewind(_arg1:Boolean):void{ var _local2:VideoPlayer; if (_activeVP == 0){ _autoRewind = _arg1; }; _local2 = videoPlayers[_activeVP]; _local2.autoRewind = _arg1; } public function get volumeBar():Sprite{ return (uiMgr.getControl(UIManager.VOLUME_BAR)); } flvplayback_internal function skinError(_arg1:String):void{ if (isLivePreview){ return; }; if (((_firstStreamReady) && (!(_firstStreamShown)))){ showFirstStream(); }; dispatchEvent(new SkinErrorEvent(SkinErrorEvent.SKIN_ERROR, false, false, _arg1)); } override public function set scaleX(_arg1:Number):void{ var _local2:Rectangle; var _local3:Rectangle; var _local4:int; var _local5:VideoPlayer; _local2 = new Rectangle(x, y, width, height); _local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight); resizingNow = true; _local4 = 0; while (_local4 < videoPlayers.length) { _local5 = videoPlayers[_local4]; if (_local5 !== null){ _local5.width = (_origWidth * _arg1); }; _local4++; }; resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } override public function set scaleY(_arg1:Number):void{ var _local2:Rectangle; var _local3:Rectangle; var _local4:int; var _local5:VideoPlayer; _local2 = new Rectangle(x, y, width, height); _local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight); resizingNow = true; _local4 = 0; while (_local4 < videoPlayers.length) { _local5 = videoPlayers[_local4]; if (_local5 !== null){ _local5.height = (_origHeight * _arg1); }; _local4++; }; resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } flvplayback_internal function createVideoPlayer(_arg1:Number):void{ var vp:VideoPlayer; var added:Boolean; var vpState:VideoPlayerState; var cpMgr:CuePointManager; var skinDepth:int; var index = _arg1; if (isLivePreview){ return; }; vp = videoPlayers[index]; if (vp == null){ var _local3 = new VideoPlayer(0, 0); vp = _local3; videoPlayers[index] = _local3; vp.setSize(registrationWidth, registrationHeight); }; vp.visible = false; vp.volume = 0; vp.name = String(index); added = false; if (uiMgr.skin_mc != null){ try { skinDepth = getChildIndex(uiMgr.skin_mc); if (skinDepth > 0){ addChildAt(vp, skinDepth); added = true; }; } catch(err:Error) { }; }; if (!added){ addChild(vp); }; _topVP = index; vp.autoRewind = _autoRewind; vp.scaleMode = _scaleMode; vp.bufferTime = _bufferTime; vp.idleTimeout = _idleTimeout; vp.playheadUpdateInterval = _playheadUpdateInterval; vp.progressInterval = _progressInterval; vp.soundTransform = _soundTransform; vpState = new VideoPlayerState(vp, index); videoPlayerStates[index] = vpState; videoPlayerStateDict[vp] = vpState; vp.addEventListener(AutoLayoutEvent.AUTO_LAYOUT, handleAutoLayoutEvent); vp.addEventListener(MetadataEvent.CUE_POINT, handleMetadataEvent); vp.addEventListener(MetadataEvent.METADATA_RECEIVED, handleMetadataEvent); vp.addEventListener(VideoProgressEvent.PROGRESS, handleVideoProgressEvent); vp.addEventListener(VideoEvent.AUTO_REWOUND, handleVideoEvent); vp.addEventListener(VideoEvent.CLOSE, handleVideoEvent); vp.addEventListener(VideoEvent.COMPLETE, handleVideoEvent); vp.addEventListener(VideoEvent.PLAYHEAD_UPDATE, handleVideoEvent); vp.addEventListener(VideoEvent.STATE_CHANGE, handleVideoEvent); vp.addEventListener(VideoEvent.READY, handleVideoEvent); cpMgr = new CuePointManager(this, index); cuePointMgrs[index] = cpMgr; cpMgr.playheadUpdateInterval = _playheadUpdateInterval; } public function findNearestCuePoint(_arg1, _arg2:String="all"):Object{ var _local3:CuePointManager; _local3 = cuePointMgrs[_activeVP]; switch (_arg2){ case "event": return (_local3.getCuePoint(_local3.eventCuePoints, true, _arg1)); case "navigation": return (_local3.getCuePoint(_local3.navCuePoints, true, _arg1)); case "flv": return (_local3.getCuePoint(_local3.flvCuePoints, true, _arg1)); case "actionscript": return (_local3.getCuePoint(_local3.asCuePoints, true, _arg1)); case "all": default: return (_local3.getCuePoint(_local3.allCuePoints, true, _arg1)); }; } public function get muteButton():Sprite{ return (uiMgr.getControl(UIManager.MUTE_BUTTON)); } public function seekPercent(_arg1:Number):void{ var _local2:VideoPlayer; _local2 = videoPlayers[_activeVP]; if (((((((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > 100)))) || (isNaN(_local2.totalTime)))) || ((_local2.totalTime <= 0)))){ throw (new VideoError(VideoError.INVALID_SEEK)); }; seek(((_local2.totalTime * _arg1) / 100)); } public function set forwardButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.FORWARD_BUTTON, _arg1); } public function get registrationWidth():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_visibleVP]; return (_local1.registrationWidth); } flvplayback_internal function queueCmd(_arg1:VideoPlayerState, _arg2:Number, _arg3:Number=NaN):void{ if (_arg1.cmdQueue == null){ _arg1.cmdQueue = new Array(); }; _arg1.cmdQueue.push(new QueuedCommand(_arg2, null, false, _arg3)); } private function doContentPathConnect(_arg1):void{ var _local2:int; var _local3:VideoPlayer; var _local4:VideoPlayerState; if (isLivePreview){ return; }; _local2 = 0; if ((_arg1 is int)){ _local2 = int(_arg1); } else { removeEventListener(Event.ENTER_FRAME, doContentPathConnect); }; _local3 = videoPlayers[_local2]; _local4 = videoPlayerStates[_local2]; if (!_local4.isWaiting){ return; }; if (((_local4.autoPlay) && (_firstStreamShown))){ _local3.play(_local4.url, _local4.totalTime, _local4.isLive); } else { _local3.load(_local4.url, _local4.totalTime, _local4.isLive); }; _local4.isLiveSet = false; _local4.totalTimeSet = false; _local4.isWaiting = false; } public function get registrationX():Number{ return (super.x); } public function bringVideoPlayerToFront(_arg1:uint):void{ var vp:VideoPlayer; var moved:Boolean; var skinDepth:int; var index = _arg1; if (index == _topVP){ return; }; vp = videoPlayers[index]; if (vp == null){ createVideoPlayer(index); vp = videoPlayers[index]; }; moved = false; if (uiMgr.skin_mc != null){ try { skinDepth = getChildIndex(uiMgr.skin_mc); if (skinDepth > 0){ setChildIndex(vp, (skinDepth - 1)); moved = true; }; } catch(err:Error) { }; }; if (!moved){ setChildIndex(vp, (numChildren - 1)); }; _topVP = index; } public function get registrationY():Number{ return (super.y); } public function get pauseButton():Sprite{ return (uiMgr.getControl(UIManager.PAUSE_BUTTON)); } public function set seekBarInterval(_arg1:Number):void{ uiMgr.seekBarInterval = _arg1; } public function addASCuePoint(_arg1, _arg2:String=null, _arg3:Object=null):Object{ var _local4:CuePointManager; _local4 = cuePointMgrs[_activeVP]; return (_local4.addASCuePoint(_arg1, _arg2, _arg3)); } public function get playheadPercentage():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; if (isNaN(_local1.totalTime)){ return (NaN); }; return (((_local1.playheadTime / _local1.totalTime) * 100)); } public function setFLVCuePointEnabled(_arg1:Boolean, _arg2):Number{ var _local3:CuePointManager; _local3 = cuePointMgrs[_activeVP]; return (_local3.setFLVCuePointEnabled(_arg1, _arg2)); } public function set fullScreenSkinDelay(_arg1:int):void{ uiMgr.fullScreenSkinDelay = _arg1; } public function seekToNextNavCuePoint(_arg1:Number=NaN):void{ var _local2:VideoPlayer; var _local3:Object; var _local4:Number; _local2 = videoPlayers[_activeVP]; if (((isNaN(_arg1)) || ((_arg1 < 0)))){ _arg1 = (_local2.playheadTime + 0.001); }; _local3 = findNearestCuePoint(_arg1, CuePointType.NAVIGATION); if (_local3 == null){ seek(_local2.totalTime); return; }; _local4 = _local3.index; if (_local3.time < _arg1){ _local4++; }; while ((((_local4 < _local3.array.length)) && (!(isFLVCuePointEnabled(_local3.array[_local4]))))) { _local4++; }; if (_local4 >= _local3.array.length){ _arg1 = _local2.totalTime; if (_local3.array[(_local3.array.length - 1)].time > _arg1){ _arg1 = _local3.array[(_local3.array.length - 1)]; }; seek(_arg1); } else { seek(_local3.array[_local4].time); }; } public function load(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false):void{ if ((((_arg1 == null)) || ((_arg1.length == 0)))){ return; }; if (_arg1 == this.source){ return; }; this.autoPlay = false; this.totalTime = _arg2; this.isLive = _arg3; this.source = _arg1; } public function seekSeconds(_arg1:Number):void{ seek(_arg1); } public function get fullScreenButton():Sprite{ return (uiMgr.getControl(UIManager.FULL_SCREEN_BUTTON)); } public function get scrubbing():Boolean{ var _local1:Sprite; var _local2:ControlData; _local1 = seekBar; if (_local1 != null){ _local2 = uiMgr.ctrlDataDict[_local1]; return (_local2.isDragging); }; return (false); } override public function set y(_arg1:Number):void{ var _local2:VideoPlayer; _local2 = videoPlayers[_visibleVP]; super.y = (_arg1 - _local2.y); } public function removeASCuePoint(_arg1):Object{ var _local2:CuePointManager; _local2 = cuePointMgrs[_activeVP]; return (_local2.removeASCuePoint(_arg1)); } public function get fullScreenTakeOver():Boolean{ return (uiMgr.fullScreenTakeOver); } override public function set x(_arg1:Number):void{ var _local2:VideoPlayer; _local2 = videoPlayers[_visibleVP]; super.x = (_arg1 - _local2.x); } public function get backButton():Sprite{ return (uiMgr.getControl(UIManager.BACK_BUTTON)); } public function set seekBar(_arg1:Sprite):void{ uiMgr.setControl(UIManager.SEEK_BAR, _arg1); } public function set skin(_arg1:String):void{ uiMgr.skin = _arg1; } public function set componentInspectorSetting(_arg1:Boolean):void{ _componentInspectorSetting = _arg1; } public function get preferredHeight():int{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.videoHeight); } public function set volumeBarInterval(_arg1:Number):void{ uiMgr.volumeBarInterval = _arg1; } public function set autoPlay(_arg1:Boolean):void{ var _local2:VideoPlayerState; _local2 = videoPlayerStates[_activeVP]; _local2.autoPlay = _arg1; } public function set visibleVideoPlayerIndex(_arg1:uint):void{ var _local2:VideoPlayer; var _local3:VideoPlayer; var _local4:uint; var _local5:Rectangle; var _local6:Rectangle; if (_visibleVP == _arg1){ return; }; if (videoPlayers[_arg1] == undefined){ createVideoPlayer(_arg1); }; _local2 = videoPlayers[_arg1]; _local3 = videoPlayers[_visibleVP]; _local3.visible = false; _local3.volume = 0; _visibleVP = _arg1; if (_firstStreamShown){ uiMgr.setupSkinAutoHide(false); _local2.visible = true; _soundTransform.volume = (scrubbing) ? _volume : 0; _local2.soundTransform = _soundTransform; } else { if (((((((_local2.stateResponsive) || ((_local2.state == VideoState.CONNECTION_ERROR)))) || ((_local2.state == VideoState.DISCONNECTED)))) && (uiMgr.skinReady))){ uiMgr.visible = true; uiMgr.setupSkinAutoHide(false); _firstStreamReady = true; if (uiMgr.skin == ""){ uiMgr.hookUpCustomComponents(); }; showFirstStream(); }; }; if (((!((_local2.height == _local3.height))) || (!((_local2.width == _local3.width))))){ _local5 = new Rectangle((_local3.x + super.x), (_local3.y + super.y), _local3.width, _local3.height); _local6 = new Rectangle((_local3.registrationX + super.x), (_local3.registrationY + super.y), _local3.registrationWidth, _local3.registrationHeight); dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local5, _local6)); }; _local4 = _activeVP; _activeVP = _visibleVP; uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, state, playheadTime, _visibleVP)); uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE, false, false, state, playheadTime, _visibleVP)); if (_local2.isRTMP){ uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.READY, false, false, state, playheadTime, _visibleVP)); } else { uiMgr.handleIVPEvent(new VideoProgressEvent(VideoProgressEvent.PROGRESS, false, false, bytesLoaded, bytesTotal, _visibleVP)); }; _activeVP = _local4; } public function get bufferingBar():Sprite{ return (uiMgr.getControl(UIManager.BUFFERING_BAR)); } flvplayback_internal function _scrubStart():void{ var _local1:Number; var _local2:VideoPlayer; _local1 = playheadTime; _local2 = videoPlayers[_visibleVP]; _volume = _local2.volume; _local2.volume = 0; dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, VideoState.SEEKING, _local1, _visibleVP)); dispatchEvent(new VideoEvent(VideoEvent.SCRUB_START, false, false, VideoState.SEEKING, _local1, _visibleVP)); } public function get align():String{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.align); } flvplayback_internal function handleAutoLayoutEvent(_arg1:AutoLayoutEvent):void{ var _local2:VideoPlayerState; var _local3:AutoLayoutEvent; var _local4:Rectangle; var _local5:Rectangle; _local2 = videoPlayerStateDict[_arg1.currentTarget]; _local3 = AutoLayoutEvent(_arg1.clone()); _local3.oldBounds.x = (_local3.oldBounds.x + super.x); _local3.oldBounds.y = (_local3.oldBounds.y + super.y); _local3.oldRegistrationBounds.x = (_local3.oldRegistrationBounds.x + super.y); _local3.oldRegistrationBounds.y = (_local3.oldRegistrationBounds.y + super.y); _local3.vp = _local2.index; dispatchEvent(_local3); if (((!(resizingNow)) && ((_local2.index == _visibleVP)))){ _local4 = Rectangle(_arg1.oldBounds.clone()); _local5 = Rectangle(_arg1.oldRegistrationBounds.clone()); _local4.x = (_local4.x + super.x); _local4.y = (_local4.y + super.y); _local5.x = (_local5.x + super.y); _local5.y = (_local5.y + super.y); dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local4, _local5)); }; } public function findNextCuePointWithName(_arg1:Object):Object{ var _local2:CuePointManager; _local2 = cuePointMgrs[_activeVP]; return (_local2.getNextCuePointWithName(_arg1)); } public function set playButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.PLAY_BUTTON, _arg1); } public function set bitrate(_arg1:Number):void{ ncMgr.bitrate = _arg1; } public function set bufferingBarHidesAndDisablesOthers(_arg1:Boolean):void{ uiMgr.bufferingBarHidesAndDisablesOthers = _arg1; } override public function get soundTransform():SoundTransform{ var _local1:VideoPlayer; var _local2:SoundTransform; _local1 = videoPlayers[_visibleVP]; _local2 = _local1.soundTransform; if (scrubbing){ _local2.volume = _volume; }; return (_local2); } public function get stateResponsive():Boolean{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.stateResponsive); } public function get idleTimeout():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.idleTimeout); } override public function get height():Number{ var _local1:VideoPlayer; if (isLivePreview){ return (livePreviewHeight); }; _local1 = videoPlayers[_visibleVP]; return (_local1.height); } public function set registrationWidth(_arg1:Number):void{ width = _arg1; } public function get metadata():Object{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.metadata); } public function set skinBackgroundColor(_arg1:uint):void{ uiMgr.skinBackgroundColor = _arg1; } public function get volume():Number{ return (_volume); } public function play(_arg1:String=null, _arg2:Number=NaN, _arg3:Boolean=false):void{ var _local4:VideoPlayerState; var _local5:VideoPlayer; if (_arg1 == null){ if (!_firstStreamShown){ _local4 = videoPlayerStates[_activeVP]; queueCmd(_local4, QueuedCommand.PLAY); } else { _local5 = videoPlayers[_activeVP]; _local5.play(); }; } else { if (_arg1 == this.source){ return; }; this.autoPlay = true; this.totalTime = _arg2; this.isLive = _arg3; this.source = _arg1; }; } public function get paused():Boolean{ return ((state == VideoState.PAUSED)); } flvplayback_internal function handleVideoEvent(_arg1:VideoEvent):void{ var _local2:VideoPlayerState; var _local3:CuePointManager; var _local4:VideoEvent; var _local5:String; var _local6:Number; _local2 = videoPlayerStateDict[_arg1.currentTarget]; _local3 = cuePointMgrs[_local2.index]; _local4 = VideoEvent(_arg1.clone()); _local4.vp = _local2.index; _local5 = ((((_local2.index == _visibleVP)) && (scrubbing))) ? VideoState.SEEKING : _arg1.state; switch (_arg1.type){ case VideoEvent.AUTO_REWOUND: dispatchEvent(_local4); dispatchEvent(new VideoEvent(VideoEvent.REWIND, false, false, _local5, _arg1.playheadTime, _local2.index)); _local3.resetASCuePointIndex(_arg1.playheadTime); break; case VideoEvent.PLAYHEAD_UPDATE: _local4.state = _local5; dispatchEvent(_local4); if (((!(isNaN(_local2.preSeekTime))) && (!((_arg1.state == VideoState.SEEKING))))){ _local6 = _local2.preSeekTime; _local2.preSeekTime = NaN; _local3.resetASCuePointIndex(_arg1.playheadTime); dispatchEvent(new VideoEvent(VideoEvent.SEEKED, false, false, _arg1.state, _arg1.playheadTime, _local2.index)); if (_local6 < _arg1.playheadTime){ dispatchEvent(new VideoEvent(VideoEvent.FAST_FORWARD, false, false, _arg1.state, _arg1.playheadTime, _local2.index)); } else { if (_local6 > _arg1.playheadTime){ dispatchEvent(new VideoEvent(VideoEvent.REWIND, false, false, _arg1.state, _arg1.playheadTime, _local2.index)); }; }; }; _local3.dispatchASCuePoints(); break; case VideoEvent.STATE_CHANGE: if ((((_local2.index == _visibleVP)) && (scrubbing))){ break; }; if (_arg1.state == VideoState.RESIZING){ break; }; if ((((((_local2.prevState == VideoState.LOADING)) && (_local2.autoPlay))) && ((_arg1.state == VideoState.STOPPED)))){ return; }; if ((((((((_arg1.state == VideoState.CONNECTION_ERROR)) && ((_arg1.vp == _visibleVP)))) && (!(_firstStreamShown)))) && (uiMgr.skinReady))){ showFirstStream(); uiMgr.visible = true; if (uiMgr.skin == ""){ uiMgr.hookUpCustomComponents(); }; if (skinShowTimer != null){ skinShowTimer.reset(); skinShowTimer = null; }; }; _local2.prevState = _arg1.state; _local4.state = _local5; dispatchEvent(_local4); if (_local2.owner.state != _arg1.state){ return; }; switch (_arg1.state){ case VideoState.BUFFERING: dispatchEvent(new VideoEvent(VideoEvent.BUFFERING_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; case VideoState.PAUSED: dispatchEvent(new VideoEvent(VideoEvent.PAUSED_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; case VideoState.PLAYING: dispatchEvent(new VideoEvent(VideoEvent.PLAYING_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; case VideoState.STOPPED: dispatchEvent(new VideoEvent(VideoEvent.STOPPED_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; }; break; case VideoEvent.READY: if (!_firstStreamReady){ if (_local2.index == _visibleVP){ _firstStreamReady = true; if (((uiMgr.skinReady) && (!(_firstStreamShown)))){ uiMgr.visible = true; if (uiMgr.skin == ""){ uiMgr.hookUpCustomComponents(); }; showFirstStream(); }; }; } else { if (((((_firstStreamShown) && ((_arg1.state == VideoState.STOPPED)))) && (_local2.autoPlay))){ if (_local2.owner.isRTMP){ _local2.owner.play(); } else { _local2.prevState = VideoState.STOPPED; _local2.owner.playWhenEnoughDownloaded(); }; }; }; _local4.state = _local5; dispatchEvent(_local4); break; case VideoEvent.CLOSE: case VideoEvent.COMPLETE: _local4.state = _local5; dispatchEvent(_local4); break; }; } public function set volumeBar(_arg1:Sprite):void{ uiMgr.setControl(UIManager.VOLUME_BAR, _arg1); } public function set fullScreenBackgroundColor(_arg1:uint):void{ uiMgr.fullScreenBackgroundColor = _arg1; } public function get isLive():Boolean{ var _local1:VideoPlayerState; var _local2:VideoPlayer; _local1 = videoPlayerStates[_activeVP]; if (_local1.isLiveSet){ return (_local1.isLive); }; _local2 = videoPlayers[_activeVP]; return (_local2.isLive); } public function get bufferTime():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.bufferTime); } public function get registrationHeight():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_visibleVP]; return (_local1.registrationHeight); } public function get playPauseButton():Sprite{ return (uiMgr.getControl(UIManager.PLAY_PAUSE_BUTTON)); } flvplayback_internal function showFirstStream():void{ var _local1:VideoPlayer; var _local2:int; var _local3:VideoPlayerState; var _local4:int; _firstStreamShown = true; _local1 = videoPlayers[_visibleVP]; _local1.visible = true; if (!scrubbing){ _soundTransform.volume = _volume; _local1.soundTransform = _soundTransform; }; _local2 = 0; while (_local2 < videoPlayers.length) { _local1 = videoPlayers[_local2]; if (_local1 != null){ _local3 = videoPlayerStates[_local2]; if ((((_local1.state == VideoState.STOPPED)) && (_local3.autoPlay))){ if (_local1.isRTMP){ _local1.play(); } else { _local3.prevState = VideoState.STOPPED; _local1.playWhenEnoughDownloaded(); }; }; if (_local3.cmdQueue != null){ _local4 = 0; while (_local4 < _local3.cmdQueue.length) { switch (_local3.cmdQueue[_local4].type){ case QueuedCommand.PLAY: _local1.play(); break; case QueuedCommand.PAUSE: _local1.pause(); break; case QueuedCommand.STOP: _local1.stop(); break; case QueuedCommand.SEEK: _local1.seek(_local3.cmdQueue[_local4].time); break; case QueuedCommand.PLAY_WHEN_ENOUGH: _local1.playWhenEnoughDownloaded(); break; }; _local4++; }; _local3.cmdQueue = null; }; }; _local2++; }; } public function set volumeBarScrubTolerance(_arg1:Number):void{ uiMgr.volumeBarScrubTolerance = _arg1; } public function set skinBackgroundAlpha(_arg1:Number):void{ uiMgr.skinBackgroundAlpha = _arg1; } public function get playheadUpdateInterval():Number{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.playheadUpdateInterval); } public function set muteButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.MUTE_BUTTON, _arg1); } public function get autoRewind():Boolean{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.autoRewind); } flvplayback_internal function handleMetadataEvent(_arg1:MetadataEvent):void{ var _local2:VideoPlayerState; var _local3:CuePointManager; var _local4:MetadataEvent; _local2 = videoPlayerStateDict[_arg1.currentTarget]; _local3 = cuePointMgrs[_local2.index]; switch (_arg1.type){ case MetadataEvent.METADATA_RECEIVED: _local3.processFLVCuePoints(_arg1.info.cuePoints); break; case MetadataEvent.CUE_POINT: if (!_local3.isFLVCuePointEnabled(_arg1.info)){ return; }; break; }; _local4 = MetadataEvent(_arg1.clone()); _local4.vp = _local2.index; dispatchEvent(_local4); } public function playWhenEnoughDownloaded():void{ var _local1:VideoPlayerState; var _local2:VideoPlayer; if (!_firstStreamShown){ _local1 = videoPlayerStates[_activeVP]; queueCmd(_local1, QueuedCommand.PLAY_WHEN_ENOUGH); } else { _local2 = videoPlayers[_activeVP]; _local2.playWhenEnoughDownloaded(); }; } public function get bitrate():Number{ return (ncMgr.bitrate); } public function get fullScreenBackgroundColor():uint{ return (uiMgr.fullScreenBackgroundColor); } public function get skin():String{ return (uiMgr.skin); } public function set registrationX(_arg1:Number):void{ super.x = _arg1; } public function set registrationY(_arg1:Number):void{ super.y = _arg1; } public function setSize(_arg1:Number, _arg2:Number):void{ var _local3:Rectangle; var _local4:Rectangle; var _local5:int; var _local6:VideoPlayer; _local3 = new Rectangle(x, y, this.width, this.height); _local4 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight); if (isLivePreview){ livePreviewWidth = _arg1; livePreviewHeight = _arg2; if (previewImage_mc != null){ previewImage_mc.width = _arg1; previewImage_mc.height = _arg2; }; preview_mc.box_mc.width = _arg1; preview_mc.box_mc.height = _arg2; if ((((preview_mc.box_mc.width < preview_mc.icon_mc.width)) || ((preview_mc.box_mc.height < preview_mc.icon_mc.height)))){ preview_mc.icon_mc.visible = false; } else { preview_mc.icon_mc.visible = true; preview_mc.icon_mc.x = ((preview_mc.box_mc.width - preview_mc.icon_mc.width) / 2); preview_mc.icon_mc.y = ((preview_mc.box_mc.height - preview_mc.icon_mc.height) / 2); }; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4)); return; }; resizingNow = true; _local5 = 0; while (_local5 < videoPlayers.length) { _local6 = videoPlayers[_local5]; if (_local6 != null){ _local6.setSize(_arg1, _arg2); }; _local5++; }; resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4)); } public function get isRTMP():Boolean{ var _local1:VideoPlayer; if (isLivePreview){ return (true); }; _local1 = videoPlayers[_activeVP]; return (_local1.isRTMP); } public function set preview(_arg1:String):void{ var filename = _arg1; if (!isLivePreview){ return; }; previewImageUrl = filename; if (previewImage_mc != null){ removeChild(previewImage_mc); }; previewImage_mc = new Loader(); previewImage_mc.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompletePreview); previewImage_mc.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{ }); previewImage_mc.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (_arg1:SecurityErrorEvent):void{ }); addChildAt(previewImage_mc, 1); previewImage_mc.load(new URLRequest(previewImageUrl)); } override public function set width(_arg1:Number):void{ var _local2:Rectangle; var _local3:Rectangle; var _local4:int; var _local5:VideoPlayer; if (isLivePreview){ setSize(_arg1, this.height); return; }; _local2 = new Rectangle(x, y, width, height); _local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight); resizingNow = true; _local4 = 0; while (_local4 < videoPlayers.length) { _local5 = videoPlayers[_local4]; if (_local5 != null){ _local5.width = _arg1; }; _local4++; }; resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } public function get playButton():Sprite{ return (uiMgr.getControl(UIManager.PLAY_BUTTON)); } public function set pauseButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.PAUSE_BUTTON, _arg1); } public function get bytesTotal():uint{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.bytesTotal); } public function seekToPrevNavCuePoint(_arg1:Number=NaN):void{ var _local2:Object; var _local3:Number; var _local4:VideoPlayer; if (((isNaN(_arg1)) || ((_arg1 < 0)))){ _local4 = videoPlayers[_activeVP]; _arg1 = _local4.playheadTime; }; _local2 = findNearestCuePoint(_arg1, CuePointType.NAVIGATION); if (_local2 == null){ seek(0); return; }; _local3 = _local2.index; while ((((_local3 >= 0)) && (((!(isFLVCuePointEnabled(_local2.array[_local3]))) || ((_local2.array[_local3].time >= (_arg1 - _seekToPrevOffset))))))) { _local3--; }; if (_local3 < 0){ seek(0); } else { seek(_local2.array[_local3].time); }; } public function get autoPlay():Boolean{ var _local1:VideoPlayerState; _local1 = videoPlayerStates[_activeVP]; return (_local1.autoPlay); } public function set playheadPercentage(_arg1:Number):void{ seekPercent(_arg1); } public function isFLVCuePointEnabled(_arg1):Boolean{ var _local2:CuePointManager; _local2 = cuePointMgrs[_activeVP]; return (_local2.isFLVCuePointEnabled(_arg1)); } public function get buffering():Boolean{ return ((state == VideoState.BUFFERING)); } public function get volumeBarScrubTolerance():Number{ return (uiMgr.volumeBarScrubTolerance); } public function get skinBackgroundColor():uint{ return (uiMgr.skinBackgroundColor); } public function get visibleVideoPlayerIndex():uint{ return (_visibleVP); } public function set stopButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.STOP_BUTTON, _arg1); } public function get skinBackgroundAlpha():Number{ return (uiMgr.skinBackgroundAlpha); } public function get preferredWidth():int{ var _local1:VideoPlayer; _local1 = videoPlayers[_activeVP]; return (_local1.videoWidth); } override public function get width():Number{ var _local1:VideoPlayer; if (isLivePreview){ return (livePreviewWidth); }; _local1 = videoPlayers[_visibleVP]; return (_local1.width); } public function get stopped():Boolean{ return ((state == VideoState.STOPPED)); } public function set fullScreenButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.FULL_SCREEN_BUTTON, _arg1); } public function get stopButton():Sprite{ return (uiMgr.getControl(UIManager.STOP_BUTTON)); } public function set playheadUpdateInterval(_arg1:Number):void{ var _local2:CuePointManager; var _local3:VideoPlayer; if (_activeVP == 0){ _playheadUpdateInterval = _arg1; }; _local2 = cuePointMgrs[_activeVP]; _local2.playheadUpdateInterval = _arg1; _local3 = videoPlayers[_activeVP]; _local3.playheadUpdateInterval = _arg1; } private function createLivePreviewMovieClip():void{ preview_mc = new MovieClip(); preview_mc.name = "preview_mc"; preview_mc.box_mc = new MovieClip(); preview_mc.box_mc.name = "box_mc"; preview_mc.box_mc.graphics.beginFill(0); preview_mc.box_mc.graphics.moveTo(0, 0); preview_mc.box_mc.graphics.lineTo(0, 100); preview_mc.box_mc.graphics.lineTo(100, 100); preview_mc.box_mc.graphics.lineTo(100, 0); preview_mc.box_mc.graphics.lineTo(0, 0); preview_mc.box_mc.graphics.endFill(); preview_mc.addChild(preview_mc.box_mc); preview_mc.icon_mc = new Icon(); preview_mc.icon_mc.name = "icon_mc"; preview_mc.addChild(preview_mc.icon_mc); addChild(preview_mc); } public function set idleTimeout(_arg1:Number):void{ var _local2:VideoPlayer; if (_activeVP == 0){ _idleTimeout = _arg1; }; _local2 = videoPlayers[_activeVP]; _local2.idleTimeout = _arg1; } flvplayback_internal function skinLoaded():void{ var _local1:VideoPlayer; if (isLivePreview){ return; }; _local1 = videoPlayers[_visibleVP]; if (((((_firstStreamReady) || ((_local1.state == VideoState.CONNECTION_ERROR)))) || ((_local1.state == VideoState.DISCONNECTED)))){ uiMgr.visible = true; if (!_firstStreamShown){ showFirstStream(); }; } else { if (skinShowTimer != null){ skinShowTimer.reset(); skinShowTimer = null; }; skinShowTimer = new Timer(DEFAULT_SKIN_SHOW_TIMER_INTERVAL, 1); skinShowTimer.addEventListener(TimerEvent.TIMER, showSkinNow); skinShowTimer.start(); }; dispatchEvent(new VideoEvent(VideoEvent.SKIN_LOADED, false, false, state, playheadTime, _visibleVP)); } flvplayback_internal function _scrubFinish():void{ var _local1:Number; var _local2:String; var _local3:VideoPlayer; _local1 = playheadTime; _local2 = state; _local3 = videoPlayers[_visibleVP]; _soundTransform.volume = _volume; _local3.soundTransform = _soundTransform; if (_local2 != VideoState.SEEKING){ dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, _local2, _local1, _visibleVP)); }; dispatchEvent(new VideoEvent(VideoEvent.SCRUB_FINISH, false, false, _local2, _local1, _visibleVP)); } public function set playPauseButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.PLAY_PAUSE_BUTTON, _arg1); } public function set backButton(_arg1:Sprite):void{ uiMgr.setControl(UIManager.BACK_BUTTON, _arg1); } public function set cuePoints(_arg1:Array):void{ if (!_componentInspectorSetting){ return; }; cuePointMgrs[0].processCuePointsProperty(_arg1); } public function findCuePoint(_arg1, _arg2:String="all"):Object{ var _local3:CuePointManager; _local3 = cuePointMgrs[_activeVP]; switch (_arg2){ case "event": return (_local3.getCuePoint(_local3.eventCuePoints, false, _arg1)); case "navigation": return (_local3.getCuePoint(_local3.navCuePoints, false, _arg1)); case "flv": return (_local3.getCuePoint(_local3.flvCuePoints, false, _arg1)); case "actionscript": return (_local3.getCuePoint(_local3.asCuePoints, false, _arg1)); case "all": default: return (_local3.getCuePoint(_local3.allCuePoints, false, _arg1)); }; } public function get seekBarScrubTolerance():Number{ return (uiMgr.seekBarScrubTolerance); } flvplayback_internal function handleVideoProgressEvent(_arg1:VideoProgressEvent):void{ var _local2:VideoPlayerState; var _local3:VideoProgressEvent; _local2 = videoPlayerStateDict[_arg1.currentTarget]; _local3 = VideoProgressEvent(_arg1.clone()); _local3.vp = _local2.index; dispatchEvent(_local3); } } }//package fl.video
Section 88
//flvplayback_internal (fl.video.flvplayback_internal) package fl.video { public namespace flvplayback_internal = "http://www.adobe.com/2007/flash/flvplayback/internal"; }//package fl.video
Section 89
//FPADManager (fl.video.FPADManager) package fl.video { import flash.net.*; import flash.events.*; public class FPADManager { flvplayback_internal var _parseResults:ParseResults; flvplayback_internal var rtmpURL:String; flvplayback_internal var _url:String; flvplayback_internal var xmlLoader:URLLoader; flvplayback_internal var xml:XML; flvplayback_internal var _uriParam:String; private var _owner:INCManager; public static const VERSION:String = "2.0.0.37"; public static const SHORT_VERSION:String = "2.0"; public function FPADManager(_arg1:INCManager){ _owner = _arg1; } flvplayback_internal function connectXML(_arg1:String, _arg2:String, _arg3:String, _arg4:ParseResults):Boolean{ _uriParam = _arg2; _parseResults = _arg4; _url = ((_arg1 + "uri=") + _parseResults.protocol); if (_parseResults.serverName != null){ _url = (_url + ("/" + _parseResults.serverName)); }; if (_parseResults.portNumber != null){ _url = (_url + (":" + _parseResults.portNumber)); }; if (_parseResults.wrappedURL != null){ _url = (_url + ("/?" + _parseResults.wrappedURL)); }; _url = (_url + ("/" + _parseResults.appName)); _url = (_url + _arg3); xml = new XML(); xmlLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, xmlLoadEventHandler); xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlLoadEventHandler); xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, xmlLoadEventHandler); xmlLoader.load(new URLRequest(_url)); return (false); } flvplayback_internal function xmlLoadEventHandler(_arg1:Event):void{ var proxy:String; var e = _arg1; try { if (e.type != Event.COMPLETE){ _owner.helperDone(this, false); } else { xml = new XML(xmlLoader.data); if ((((xml == null)) || ((xml.localName() == null)))){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" No root node found; if url is for an flv it must have .flv extension and take no parameters"))); } else { if (xml.localName() != "fpad"){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Root node not fpad"))); }; }; proxy = null; if ((((((xml.proxy.length() > 0)) && (xml.proxy.hasSimpleContent()))) && ((xml.proxy.*[0].nodeKind() == "text")))){ proxy = xml.proxy.*[0].toString(); }; if (proxy == null){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" fpad xml requires proxy tag."))); }; rtmpURL = ((((_parseResults.protocol + "/") + proxy) + "/?") + _uriParam); _owner.helperDone(this, true); }; } catch(err:Error) { _owner.helperDone(this, false); throw (err); }; } } }//package fl.video
Section 90
//Icon (fl.video.Icon) package fl.video { import flash.display.*; public dynamic class Icon extends MovieClip { } }//package fl.video
Section 91
//INCManager (fl.video.INCManager) package fl.video { import flash.net.*; public interface INCManager { function set timeout(_arg1:uint):void; function get streamLength():Number; function get timeout():uint; function connectToURL(_arg1:String):Boolean; function get streamName():String; function get bitrate():Number; function get streamHeight():int; function helperDone(_arg1:Object, _arg2:Boolean):void; function getProperty(_arg1:String); function get streamWidth():int; function connectAgain():Boolean; function reconnect():void; function set videoPlayer(_arg1:VideoPlayer):void; function setProperty(_arg1:String, _arg2):void; function set bitrate(_arg1:Number):void; function get netConnection():NetConnection; function get videoPlayer():VideoPlayer; function get isRTMP():Boolean; function close():void; } }//package fl.video
Section 92
//IVPEvent (fl.video.IVPEvent) package fl.video { public interface IVPEvent { function set vp(_arg1:uint):void; function get vp():uint; function get type():String; } }//package fl.video
Section 93
//LayoutEvent (fl.video.LayoutEvent) package fl.video { import flash.events.*; import flash.geom.*; public class LayoutEvent extends Event { private var _oldBounds:Rectangle; private var _oldRegistrationBounds:Rectangle; public static const LAYOUT:String = "layout"; public function LayoutEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Rectangle=null, _arg5:Rectangle=null){ super(_arg1, _arg2, _arg3); _oldBounds = _arg4; _oldRegistrationBounds = _arg5; } public function get oldRegistrationBounds():Rectangle{ return (_oldRegistrationBounds); } override public function clone():Event{ return (new LayoutEvent(type, bubbles, cancelable, Rectangle(oldBounds.clone()), Rectangle(oldRegistrationBounds.clone()))); } public function set oldRegistrationBounds(_arg1:Rectangle):void{ _oldRegistrationBounds = _arg1; } public function set oldBounds(_arg1:Rectangle):void{ _oldBounds = _arg1; } public function get oldBounds():Rectangle{ return (_oldBounds); } } }//package fl.video
Section 94
//MetadataEvent (fl.video.MetadataEvent) package fl.video { import flash.events.*; public class MetadataEvent extends Event implements IVPEvent { private var _info:Object; private var _vp:uint; public static const METADATA_RECEIVED:String = "metadataReceived"; public static const CUE_POINT:String = "cuePoint"; public function MetadataEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Object=null, _arg5:uint=0){ super(_arg1, _arg2, _arg3); _info = _arg4; _vp = _arg5; } public function get vp():uint{ return (_vp); } public function set info(_arg1:Object):void{ _info = _arg1; } override public function clone():Event{ return (new MetadataEvent(type, bubbles, cancelable, info, vp)); } public function get info():Object{ return (_info); } public function set vp(_arg1:uint):void{ _vp = _arg1; } } }//package fl.video
Section 95
//NCManager (fl.video.NCManager) package fl.video { import flash.net.*; import flash.events.*; import flash.utils.*; public class NCManager implements INCManager { public const DEFAULT_TIMEOUT:uint = 60000; flvplayback_internal var _serverName:String; flvplayback_internal var _tryNCTimer:Timer; flvplayback_internal var _autoSenseBW:Boolean; flvplayback_internal var _fpadZone:Number; flvplayback_internal var _appName:String; flvplayback_internal var _ncConnected:Boolean; flvplayback_internal var _fpadMgr:FPADManager; flvplayback_internal var _bitrate:Number; flvplayback_internal var _timeoutTimer:Timer; flvplayback_internal var _wrappedURL:String; flvplayback_internal var _payload:Number; flvplayback_internal var _proxyType:String; flvplayback_internal var _nc:NetConnection; flvplayback_internal var _streamLength:Number; flvplayback_internal var _connTypeCounter:uint; flvplayback_internal var _streamWidth:int; flvplayback_internal var _ncUri:String; flvplayback_internal var _contentPath:String; flvplayback_internal var _smilMgr:SMILManager; flvplayback_internal var _streamHeight:int; flvplayback_internal var _isRTMP:Boolean; flvplayback_internal var _tryNC:Array; flvplayback_internal var _owner:VideoPlayer; flvplayback_internal var _streams:Array; flvplayback_internal var _portNumber:String; flvplayback_internal var _streamName:String; flvplayback_internal var _objectEncoding:uint; public var fallbackServerName:String; flvplayback_internal var _protocol:String; public static const SHORT_VERSION:String = "2.0"; flvplayback_internal static const RTMP_CONN:Array = [{protocol:"rtmp:/", port:"1935"}, {protocol:"rtmp:/", port:"443"}, {protocol:"rtmpt:/", port:"80"}, {protocol:"rtmps:/", port:"443"}]; public static const VERSION:String = "2.0.0.37"; public function NCManager(){ _fpadZone = NaN; _objectEncoding = ObjectEncoding.AMF0; _proxyType = "best"; _timeoutTimer = new Timer(DEFAULT_TIMEOUT); _timeoutTimer.addEventListener(TimerEvent.TIMER, this._onFMSConnectTimeOut); _tryNCTimer = new Timer(1500); _tryNCTimer.addEventListener(TimerEvent.TIMER, this.nextConnect); initNCInfo(); initOtherInfo(); _nc = null; _ncConnected = false; } flvplayback_internal function initNCInfo():void{ _isRTMP = false; _serverName = null; _wrappedURL = null; _portNumber = null; _appName = null; } flvplayback_internal function cleanConns():void{ var _local1:uint; _tryNCTimer.stop(); if (_tryNC != null){ _local1 = 0; while (_local1 < _tryNC.length) { if (((!((_tryNC[_local1] == null))) && (!((_tryNC[_local1] == undefined))))){ _tryNC[_local1].removeEventListener(NetStatusEvent.NET_STATUS, connectOnStatus); if (_tryNC[_local1].client.pending){ _tryNC[_local1].addEventListener(NetStatusEvent.NET_STATUS, disconnectOnStatus); } else { _tryNC[_local1].close(); }; }; _tryNC[_local1] = null; _local1++; }; _tryNC = null; }; } public function get streamWidth():int{ return (_streamWidth); } public function connectToURL(_arg1:String):Boolean{ var parseResults:ParseResults; var canReuse:Boolean; var url = _arg1; initOtherInfo(); _contentPath = url; if ((((_contentPath == null)) || ((_contentPath == "")))){ throw (new VideoError(VideoError.INVALID_SOURCE)); }; parseResults = parseURL(_contentPath); if ((((parseResults.streamName == null)) || ((parseResults.streamName == "")))){ throw (new VideoError(VideoError.INVALID_SOURCE, url)); }; if (parseResults.isRTMP){ canReuse = canReuseOldConnection(parseResults); _isRTMP = true; _protocol = parseResults.protocol; _streamName = parseResults.streamName; _serverName = parseResults.serverName; _wrappedURL = parseResults.wrappedURL; _portNumber = parseResults.portNumber; _appName = parseResults.appName; if ((((((((_appName == null)) || ((_appName == "")))) || ((_streamName == null)))) || ((_streamName == "")))){ throw (new VideoError(VideoError.INVALID_SOURCE, url)); }; _autoSenseBW = (_streamName.indexOf(",") >= 0); return (((canReuse) || (connectRTMP()))); } else { if ((((parseResults.streamName.indexOf("?") < 0)) && ((parseResults.streamName.slice(-4).toLowerCase() == ".flv")))){ canReuse = canReuseOldConnection(parseResults); _isRTMP = false; _streamName = parseResults.streamName; return (((canReuse) || (connectHTTP()))); }; if (parseResults.streamName.indexOf("/fms/fpad") >= 0){ try { return (connectFPAD(parseResults.streamName)); } catch(err:Error) { }; }; }; new this.SMILManager(!NULL!)._smilMgr = !NULL!; return (_smilMgr.connectXML(parseResults.streamName)); } public function get streamName():String{ return (_streamName); } flvplayback_internal function reconnectOnStatus(_arg1:NetStatusEvent):void{ if ((((_arg1.info.code == "NetConnection.Connect.Failed")) || ((_arg1.info.code == "NetConnection.Connect.Rejected")))){ _nc = null; _ncConnected = false; _owner.ncReconnected(); }; } public function get videoPlayer():VideoPlayer{ return (_owner); } flvplayback_internal function getStreamLengthResult(_arg1:Number):void{ trace((("calling getStreamLengthResult(" + _arg1) + ")")); if (_arg1 > 0){ _streamLength = _arg1; }; _owner.ncConnected(); } flvplayback_internal function canReuseOldConnection(_arg1:ParseResults):Boolean{ if ((((_nc == null)) || (!(_ncConnected)))){ return (false); }; if (!_arg1.isRTMP){ if (!_isRTMP){ return (true); }; _owner.close(); _nc = null; _ncConnected = false; initNCInfo(); return (false); }; if (_isRTMP){ if ((((((((((_arg1.serverName == _serverName)) && ((_arg1.appName == _appName)))) && ((_arg1.protocol == _protocol)))) && ((_arg1.portNumber == _portNumber)))) && ((_arg1.wrappedURL == _wrappedURL)))){ return (true); }; _owner.close(); _nc = null; _ncConnected = false; }; initNCInfo(); return (false); } public function getProperty(_arg1:String){ switch (_arg1){ case "fallbackServerName": return (fallbackServerName); case "fpadZone": return (_fpadZone); case "objectEncoding": return (_objectEncoding); case "proxyType": return (_proxyType); default: throw (new VideoError(VideoError.UNSUPPORTED_PROPERTY, _arg1)); }; } flvplayback_internal function connectRTMP():Boolean{ var _local1:uint; _timeoutTimer.stop(); _timeoutTimer.start(); _tryNC = new Array(); _local1 = 0; while (_local1 < RTMP_CONN.length) { _tryNC[_local1] = new NetConnection(); _tryNC[_local1].objectEncoding = _objectEncoding; _tryNC[_local1].proxyType = _proxyType; if (!isNaN(_fpadZone)){ _tryNC[_local1].fpadZone = _fpadZone; }; _tryNC[_local1].client = new ConnectClient(this, _tryNC[_local1], _local1); _tryNC[_local1].addEventListener(NetStatusEvent.NET_STATUS, connectOnStatus); _local1++; }; nextConnect(); return (false); } public function reconnect():void{ if (!_isRTMP){ throw (new Error("Cannot call reconnect on an http connection")); }; _nc.client = new ReconnectClient(this); _nc.addEventListener(NetStatusEvent.NET_STATUS, reconnectOnStatus); _nc.connect(_ncUri, false); } public function helperDone(_arg1:Object, _arg2:Boolean):void{ var _local3:ParseResults; var _local4:String; var _local5:Boolean; var _local6:uint; var _local7:Number; if (!_arg2){ _nc = null; _ncConnected = false; _owner.ncConnected(); _smilMgr = null; _fpadMgr = null; return; }; _local5 = false; if (_arg1 == _fpadMgr){ _local4 = _fpadMgr.rtmpURL; _fpadMgr = null; _local3 = parseURL(_local4); _isRTMP = _local3.isRTMP; _protocol = _local3.protocol; _serverName = _local3.serverName; _portNumber = _local3.portNumber; _wrappedURL = _local3.wrappedURL; _appName = _local3.appName; _streamName = _local3.streamName; _local7 = _fpadZone; _fpadZone = NaN; connectRTMP(); _fpadZone = _local7; return; }; if (_arg1 != _smilMgr){ return; }; _streamWidth = _smilMgr.width; _streamHeight = _smilMgr.height; _local4 = _smilMgr.baseURLAttr[0]; if (((!((_local4 == null))) && (!((_local4 == ""))))){ if (_local4.charAt((_local4.length - 1)) != "/"){ _local4 = (_local4 + "/"); }; _local3 = parseURL(_local4); _isRTMP = _local3.isRTMP; _local5 = true; _streamName = _local3.streamName; if (_isRTMP){ _protocol = _local3.protocol; _serverName = _local3.serverName; _portNumber = _local3.portNumber; _wrappedURL = _local3.wrappedURL; _appName = _local3.appName; if ((((_appName == null)) || ((_appName == "")))){ _smilMgr = null; throw (new VideoError(VideoError.INVALID_XML, ("Base RTMP URL must include application name: " + _local4))); }; if (_smilMgr.baseURLAttr.length > 1){ _local3 = parseURL(_smilMgr.baseURLAttr[1]); if (_local3.serverName != null){ fallbackServerName = _local3.serverName; }; }; }; }; _streams = _smilMgr.videoTags; _smilMgr = null; _local6 = 0; while (_local6 < _streams.length) { _local4 = _streams[_local6].src; _local3 = parseURL(_local4); if (!_local5){ _isRTMP = _local3.isRTMP; _local5 = true; if (_isRTMP){ _protocol = _local3.protocol; if (_streams.length > 1){ throw (new VideoError(VideoError.INVALID_XML, "Cannot switch between multiple absolute RTMP URLs, must use meta tag base attribute.")); }; _serverName = _local3.serverName; _portNumber = _local3.portNumber; _wrappedURL = _local3.wrappedURL; _appName = _local3.appName; if ((((_appName == null)) || ((_appName == "")))){ throw (new VideoError(VideoError.INVALID_XML, ("Base RTMP URL must include application name: " + _local4))); }; } else { if ((((_local3.streamName.indexOf("/fms/fpad") >= 0)) && ((_streams.length > 1)))){ throw (new VideoError(VideoError.INVALID_XML, "Cannot switch between multiple absolute fpad URLs, must use meta tag base attribute.")); }; }; } else { if (((((((!((_streamName == null))) && (!((_streamName == ""))))) && (!(_local3.isRelative)))) && ((_streams.length > 1)))){ throw (new VideoError(VideoError.INVALID_XML, "When using meta tag base attribute, cannot use absolute URLs for video or ref tag src attributes.")); }; }; _streams[_local6].parseResults = _local3; _local6++; }; _autoSenseBW = (_streams.length > 1); if (!_autoSenseBW){ if (_streamName != null){ _streamName = (_streamName + _streams[0].parseResults.streamName); } else { _streamName = _streams[0].parseResults.streamName; }; if (((_isRTMP) && ((_streamName.substr(-4).toLowerCase() == ".flv")))){ _streamName = _streamName.substr(0, (_streamName.length - 4)); }; _streamLength = _streams[0].dur; }; if (_isRTMP){ connectRTMP(); } else { if (((!((_streamName == null))) && ((_streamName.indexOf("/fms/fpad") >= 0)))){ connectFPAD(_streamName); } else { if (_autoSenseBW){ bitrateMatch(); }; connectHTTP(); _owner.ncConnected(); }; }; } public function get netConnection():NetConnection{ return (_nc); } public function get bitrate():Number{ return (_bitrate); } public function setProperty(_arg1:String, _arg2):void{ switch (_arg1){ case "fallbackServerName": fallbackServerName = String(_arg2); break; case "fpadZone": _fpadZone = Number(_arg2); break; case "objectEncoding": _objectEncoding = uint(_arg2); break; case "proxyType": _proxyType = String(_arg2); break; default: throw (new VideoError(VideoError.UNSUPPORTED_PROPERTY, _arg1)); }; } public function get timeout():uint{ return (_timeoutTimer.delay); } public function set videoPlayer(_arg1:VideoPlayer):void{ _owner = _arg1; } flvplayback_internal function bitrateMatch():void{ var _local1:Number; var _local2:uint; var _local3:uint; _local1 = _bitrate; if (isNaN(_local1)){ _local1 = 0; }; _local2 = _streams.length; _local3 = 0; while (_local3 < _streams.length) { if (((isNaN(_streams[_local3].bitrate)) || ((_local1 >= _streams[_local3].bitrate)))){ _local2 = _local3; break; }; _local3++; }; if (_local2 == _streams.length){ throw (new VideoError(VideoError.NO_BITRATE_MATCH)); }; if (_streamName != null){ _streamName = (_streamName + _streams[_local2].src); } else { _streamName = _streams[_local2].src; }; if (((_isRTMP) && ((_streamName.substr(-4).toLowerCase() == ".flv")))){ _streamName = _streamName.substr(0, (_streamName.length - 4)); }; _streamLength = _streams[_local2].dur; } flvplayback_internal function disconnectOnStatus(_arg1:NetStatusEvent):void{ if (_arg1.info.code == "NetConnection.Connect.Success"){ _arg1.target.removeEventListener(NetStatusEvent.NET_STATUS, disconnectOnStatus); _arg1.target.close(); }; } flvplayback_internal function nextConnect(_arg1:TimerEvent=null):void{ var _local2:String; var _local3:String; var _local4:String; var _local5:uint; _tryNCTimer.stop(); if (_connTypeCounter == 0){ _local2 = _protocol; if (_portNumber != null){ _local3 = _portNumber; } else { _local5 = 0; while (_local5 < RTMP_CONN.length) { if (_local2 == RTMP_CONN[_local5].protocol){ _local3 = RTMP_CONN[_local5].port; break; }; _local5++; }; }; } else { _local2 = RTMP_CONN[_connTypeCounter].protocol; _local3 = RTMP_CONN[_connTypeCounter].port; }; _local4 = (((_local2 + ((_serverName)==null) ? "" : (((("/" + _serverName) + ":") + _local3) + "/")) + ((_wrappedURL)==null) ? "" : (_wrappedURL + "/")) + _appName); _tryNC[_connTypeCounter].client.pending = true; _tryNC[_connTypeCounter].connect(_local4, _autoSenseBW); if (_connTypeCounter < (RTMP_CONN.length - 1)){ _connTypeCounter++; _tryNCTimer.start(); }; } flvplayback_internal function connectFPAD(_arg1:String):Boolean{ var _local2:Object; var _local3:String; var _local4:String; var _local5:String; var _local6:ParseResults; _local2 = /^(.+)(\?|\&)(uri=)([^&]+)(\&.*)?$/.exec(_arg1); if (_local2 == null){ throw (new VideoError(VideoError.INVALID_SOURCE, ("fpad url must include uri parameter: " + _arg1))); }; _local3 = (_local2[1] + _local2[2]); _local4 = _local2[4]; _local5 = ((_local2[5])==undefined) ? "" : _local2[5]; _local6 = parseURL(_local4); if (!_local6.isRTMP){ throw (new VideoError(VideoError.INVALID_SOURCE, ("fpad url uri parameter must be rtmp url: " + _arg1))); }; _fpadMgr = new FPADManager(this); return (_fpadMgr.connectXML(_local3, _local4, _local5, _local6)); } flvplayback_internal function connectHTTP():Boolean{ _nc = new NetConnection(); _nc.connect(null); _ncConnected = true; return (true); } public function get isRTMP():Boolean{ return (_isRTMP); } public function get streamLength():Number{ return (_streamLength); } public function connectAgain():Boolean{ var _local1:int; var _local2:String; _local1 = _appName.indexOf("/"); if (_local1 < 0){ _local1 = _streamName.indexOf("/"); if (_local1 >= 0){ _appName = (_appName + "/"); _appName = (_appName + _streamName.slice(0, _local1)); _streamName = _streamName.slice((_local1 + 1)); }; return (false); }; _local2 = _appName.slice((_local1 + 1)); _local2 = (_local2 + "/"); _local2 = (_local2 + _streamName); _streamName = _local2; _appName = _appName.slice(0, _local1); close(); _payload = 0; _connTypeCounter = 0; cleanConns(); connectRTMP(); return (true); } flvplayback_internal function parseURL(_arg1:String):ParseResults{ var _local2:ParseResults; var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:String; var _local8:ParseResults; _local2 = new ParseResults(); _local3 = 0; _local4 = _arg1.indexOf(":/", _local3); if (_local4 >= 0){ _local4 = (_local4 + 2); _local2.protocol = _arg1.slice(_local3, _local4).toLowerCase(); _local2.isRelative = false; } else { _local2.isRelative = true; }; if (((!((_local2.protocol == null))) && ((((((_local2.protocol == "rtmp:/")) || ((_local2.protocol == "rtmpt:/")))) || ((_local2.protocol == "rtmps:/")))))){ _local2.isRTMP = true; _local3 = _local4; if (_arg1.charAt(_local3) == "/"){ _local3++; _local5 = _arg1.indexOf(":", _local3); _local6 = _arg1.indexOf("/", _local3); if (_local6 < 0){ if (_local5 < 0){ _local2.serverName = _arg1.slice(_local3); } else { _local4 = _local5; _local2.portNumber = _arg1.slice(_local3, _local4); _local3 = (_local4 + 1); _local2.serverName = _arg1.slice(_local3); }; return (_local2); }; if ((((_local5 >= 0)) && ((_local5 < _local6)))){ _local4 = _local5; _local2.serverName = _arg1.slice(_local3, _local4); _local3 = (_local4 + 1); _local4 = _local6; _local2.portNumber = _arg1.slice(_local3, _local4); } else { _local4 = _local6; _local2.serverName = _arg1.slice(_local3, _local4); }; _local3 = (_local4 + 1); }; if (_arg1.charAt(_local3) == "?"){ _local7 = _arg1.slice((_local3 + 1)); _local8 = parseURL(_local7); if ((((_local8.protocol == null)) || (!(_local8.isRTMP)))){ throw (new VideoError(VideoError.INVALID_SOURCE, _arg1)); }; _local2.wrappedURL = "?"; _local2.wrappedURL = (_local2.wrappedURL + _local8.protocol); if (_local8.serverName != null){ _local2.wrappedURL = (_local2.wrappedURL + "/"); _local2.wrappedURL = (_local2.wrappedURL + _local8.serverName); }; if (_local8.portNumber != null){ _local2.wrappedURL = (_local2.wrappedURL + (":" + _local8.portNumber)); }; if (_local8.wrappedURL != null){ _local2.wrappedURL = (_local2.wrappedURL + "/"); _local2.wrappedURL = (_local2.wrappedURL + _local8.wrappedURL); }; _local2.appName = _local8.appName; _local2.streamName = _local8.streamName; return (_local2); }; _local4 = _arg1.indexOf("/", _local3); if (_local4 < 0){ _local2.appName = _arg1.slice(_local3); return (_local2); }; _local2.appName = _arg1.slice(_local3, _local4); _local3 = (_local4 + 1); _local4 = _arg1.indexOf("/", _local3); if (_local4 < 0){ _local2.streamName = _arg1.slice(_local3); if (_local2.streamName.slice(-4).toLowerCase() == ".flv"){ _local2.streamName = _local2.streamName.slice(0, -4); }; return (_local2); }; _local2.appName = (_local2.appName + "/"); _local2.appName = (_local2.appName + _arg1.slice(_local3, _local4)); _local3 = (_local4 + 1); _local2.streamName = _arg1.slice(_local3); if (_local2.streamName.slice(-4).toLowerCase() == ".flv"){ _local2.streamName = _local2.streamName.slice(0, -4); }; } else { _local2.isRTMP = false; _local2.streamName = _arg1; }; return (_local2); } flvplayback_internal function initOtherInfo():void{ _contentPath = null; _streamName = null; _streamWidth = -1; _streamHeight = -1; _streamLength = NaN; _streams = null; _autoSenseBW = false; _payload = 0; _connTypeCounter = 0; cleanConns(); } public function set timeout(_arg1:uint):void{ _timeoutTimer.delay = _arg1; } flvplayback_internal function _onFMSConnectTimeOut(_arg1:TimerEvent=null):void{ cleanConns(); _nc = null; _ncConnected = false; if (!connectAgain()){ _owner.ncConnected(); }; } public function get streamHeight():int{ return (_streamHeight); } flvplayback_internal function connectOnStatus(_arg1:NetStatusEvent):void{ _arg1.target.client.pending = false; if (_arg1.info.code == "NetConnection.Connect.Success"){ _nc = _tryNC[_arg1.target.client.connIndex]; cleanConns(); } else { if ((((((_arg1.info.code == "NetConnection.Connect.Failed")) || ((_arg1.info.code == "NetConnection.Connect.Rejected")))) && ((_arg1.target.client.connIndex == (RTMP_CONN.length - 1))))){ if (!connectAgain()){ tryFallBack(); }; }; }; } flvplayback_internal function onReconnected():void{ _ncConnected = true; _owner.ncReconnected(); } flvplayback_internal function tryFallBack():void{ if ((((_serverName == fallbackServerName)) || ((fallbackServerName == null)))){ _nc = null; _ncConnected = false; _owner.ncConnected(); } else { _connTypeCounter = 0; cleanConns(); _serverName = fallbackServerName; connectRTMP(); }; } public function set bitrate(_arg1:Number):void{ if (!_isRTMP){ _bitrate = _arg1; }; } flvplayback_internal function onConnected(_arg1:NetConnection, _arg2:Number):void{ var _local3:Array; var _local4:uint; var _local5:String; _timeoutTimer.stop(); _arg1.removeEventListener(NetStatusEvent.NET_STATUS, connectOnStatus); _nc = _arg1; _ncUri = _nc.uri; _ncConnected = true; if (_autoSenseBW){ _bitrate = (_arg2 * 0x0400); if (_streams != null){ bitrateMatch(); } else { _local3 = _streamName.split(","); _local4 = 0; while (_local4 < _local3.length) { _local5 = stripFrontAndBackWhiteSpace(_local3[_local4]); if ((_local4 + 1) < _local3.length){ if (_arg2 <= Number(_local3[(_local4 + 1)])){ _streamName = _local5; break; }; } else { _streamName = _local5; break; }; _local4 = (_local4 + 2); }; if (_streamName.slice(-4).toLowerCase() == ".flv"){ _streamName = _streamName.slice(0, -4); }; }; }; trace(("_streamLength = " + _streamLength)); if (((!(_owner.isLive)) && (isNaN(_streamLength)))){ trace("calling getStreamLength"); _nc.call("getStreamLength", new Responder(getStreamLengthResult), _streamName); } else { _owner.ncConnected(); }; } public function close():void{ if (_nc){ _nc.close(); _ncConnected = false; }; } flvplayback_internal static function stripFrontAndBackWhiteSpace(_arg1:String):String{ var _local2:uint; var _local3:uint; var _local4:int; var _local5:int; _local3 = _arg1.length; _local4 = 0; _local5 = _local3; _local2 = 0; for (;_local2 < _local3;_local2++) { switch (_arg1.charCodeAt(_local2)){ case 9: case 10: case 13: case 32: continue; }; _local4 = _local2; break; }; _local2 = _local3; for (;_local2 >= 0;_local2--) { switch (_arg1.charCodeAt(_local2)){ case 9: case 10: case 13: case 32: continue; }; _local5 = (_local2 + 1); break; }; if (_local5 <= _local4){ return (""); }; return (_arg1.slice(_local4, _local5)); } } }//package fl.video
Section 96
//ParseResults (fl.video.ParseResults) package fl.video { public class ParseResults { public var portNumber:String; public var streamName:String; public var serverName:String; public var isRTMP:Boolean; public var appName:String; public var isRelative:Boolean; public var protocol:String; public var wrappedURL:String; } }//package fl.video
Section 97
//QueuedCommand (fl.video.QueuedCommand) package fl.video { public class QueuedCommand { public var type:uint; public var time:Number; public var url:String; public var isLive:Boolean; public static const LOAD:uint = 1; public static const STOP:uint = 3; public static const PLAY_WHEN_ENOUGH:uint = 5; public static const PLAY:uint = 0; public static const PAUSE:uint = 2; public static const SEEK:uint = 4; public function QueuedCommand(_arg1:uint, _arg2:String, _arg3:Boolean, _arg4:Number){ this.type = _arg1; this.url = _arg2; this.isLive = _arg3; this.time = _arg4; } } }//package fl.video
Section 98
//ReconnectClient (fl.video.ReconnectClient) package fl.video { public class ReconnectClient { public var owner:NCManager; public function ReconnectClient(_arg1:NCManager){ this.owner = _arg1; } public function close():void{ } public function onBWDone(... _args):void{ owner.onReconnected(); } } }//package fl.video
Section 99
//SkinErrorEvent (fl.video.SkinErrorEvent) package fl.video { import flash.events.*; public class SkinErrorEvent extends ErrorEvent { public static const SKIN_ERROR:String = "skinError"; public function SkinErrorEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=""){ super(_arg1, _arg2, _arg3, _arg4); } override public function clone():Event{ return (new SkinErrorEvent(type, bubbles, cancelable, text)); } } }//package fl.video
Section 100
//SMILManager (fl.video.SMILManager) package fl.video { import flash.net.*; import flash.events.*; public class SMILManager { flvplayback_internal var width:int; flvplayback_internal var xmlLoader:URLLoader; flvplayback_internal var xml:XML; flvplayback_internal var height:int; private var _url:String; flvplayback_internal var videoTags:Array; flvplayback_internal var baseURLAttr:Array; private var _owner:INCManager; public static const VERSION:String = "2.0.0.37"; public static const SHORT_VERSION:String = "2.0"; public function SMILManager(_arg1:INCManager){ _owner = _arg1; width = -1; height = -1; } flvplayback_internal function parseVideo(_arg1:XML):Object{ var _local2:Object; _local2 = new Object(); if (_arg1.@src.length() > 0){ _local2.src = _arg1.@src.toString(); }; if (_arg1.@["system-bitrate"].length() > 0){ _local2.bitrate = int(_arg1.@["system-bitrate"].toString()); }; if (_arg1.@dur.length() > 0){ _local2.dur = parseTime(_arg1.@dur.toString()); }; return (_local2); } flvplayback_internal function connectXML(_arg1:String):Boolean{ _url = fixURL(_arg1); xmlLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, xmlLoadEventHandler); xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlLoadEventHandler); xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, xmlLoadEventHandler); xmlLoader.load(new URLRequest(_url)); return (false); } flvplayback_internal function parseSwitch(_arg1:XML):void{ var _local2:String; var _local3:XML; for (_local2 in _arg1.*) { _local3 = _arg1.*[_local2]; if (_local3.nodeKind() != "element"){ } else { switch (_local3.localName()){ case "video": case "ref": videoTags.push(parseVideo(_local3)); break; default: break; }; }; }; } flvplayback_internal function fixURL(_arg1:String):String{ var _local2:String; if (/^(http:|https:)/i.test(_arg1)){ _local2 = ((_arg1.indexOf("?"))>=0) ? "&" : "?"; return ((((_arg1 + _local2) + "FLVPlaybackVersion=") + SHORT_VERSION)); }; return (_arg1); } flvplayback_internal function xmlLoadEventHandler(_arg1:Event):void{ var e = _arg1; try { if (e.type != Event.COMPLETE){ _owner.helperDone(this, false); } else { baseURLAttr = new Array(); videoTags = new Array(); xml = new XML(xmlLoader.data); if ((((xml == null)) || ((xml.localName() == null)))){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" No root node found; if url is for an flv it must have .flv extension and take no parameters"))); } else { if (xml.localName() != "smil"){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Root node not smil"))); }; }; checkForIllegalNodes(xml, "element", ["head", "body"]); if (xml.head.length() > 0){ parseHead(xml.head[0]); }; if (xml.body.length() < 1){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Tag body is required."))); } else { parseBody(xml.body[0]); }; _owner.helperDone(this, true); }; } catch(err:Error) { _owner.helperDone(this, false); throw (err); } finally { xmlLoader.removeEventListener(Event.COMPLETE, xmlLoadEventHandler); xmlLoader.removeEventListener(IOErrorEvent.IO_ERROR, xmlLoadEventHandler); xmlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, xmlLoadEventHandler); xmlLoader = null; }; } flvplayback_internal function checkForIllegalNodes(_arg1:XML, _arg2:String, _arg3:Array):void{ var _local4:String; var _local5:Boolean; var _local6:XML; var _local7:String; var _local8:String; for (_local4 in _arg1.*) { _local5 = false; _local6 = _arg1.*[_local4]; if (_local6.nodeKind() != _arg2){ } else { _local7 = _local6.localName(); for (_local8 in _arg3) { if (_arg3[_local8] == _local7){ _local5 = true; break; }; }; if (!_local5){ throw (new VideoError(VideoError.INVALID_XML, (((((((("URL: \"" + _url) + "\" ") + _arg2) + " ") + _local7) + " not supported in ") + _arg1.localName()) + " tag."))); }; }; }; } flvplayback_internal function parseHead(_arg1:XML):void{ checkForIllegalNodes(_arg1, "element", ["meta", "layout"]); if (_arg1.meta.length() > 0){ checkForIllegalNodes(_arg1.meta[0], "element", []); checkForIllegalNodes(_arg1.meta[0], "attribute", ["base"]); if (_arg1.meta.@base.length() > 0){ baseURLAttr.push(_arg1.meta.@base.toString()); }; }; if (_arg1.layout.length() > 0){ parseLayout(_arg1.layout[0]); }; } flvplayback_internal function parseBody(_arg1:XML):void{ var _local2:XML; var _local3:String; var _local4:Object; if (((!((_arg1.*.length() == 1))) || (!((_arg1.*[0].nodeKind() == "element"))))){ throw (new VideoError(VideoError.INVALID_XML, (((("URL: \"" + _url) + "\" Tag ") + _arg1.localName()) + " is required to contain exactly one tag."))); }; _local2 = _arg1.*[0]; _local3 = _local2.localName(); switch (_local3){ case "switch": parseSwitch(_local2); break; case "video": case "ref": _local4 = parseVideo(_local2); videoTags.push(_local4); break; default: throw (new VideoError(VideoError.INVALID_XML, (((((("URL: \"" + _url) + "\" Tag ") + _local3) + " not supported in ") + _arg1.localName()) + " tag."))); }; if (videoTags.length < 1){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" At least one video of ref tag is required."))); }; } flvplayback_internal function parseTime(_arg1:String):Number{ var _local2:Object; var _local3:Number; var _local4:Number; _local2 = /^((\d+):)?(\d+):((\d+)(.\d+)?)$/.exec(_arg1); if (_local2 == null){ _local3 = Number(_arg1); if (((isNaN(_local3)) || ((_local3 < 0)))){ throw (new VideoError(VideoError.INVALID_XML, ("Invalid dur value: " + _arg1))); }; return (_local3); //unresolved jump }; _local4 = 0; _local4 = (_local4 + ((uint(_local2[2]) * 60) * 60)); _local4 = (_local4 + (uint(_local2[3]) * 60)); _local4 = (_local4 + Number(_local2[4])); return (_local4); } flvplayback_internal function parseLayout(_arg1:XML):void{ var _local2:XML; var _local3:Number; var _local4:Number; checkForIllegalNodes(_arg1, "element", ["root-layout"]); if (_arg1["root-layout"].length() > 1){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Only one base attribute supported in meta tag."))); }; if (_arg1["root-layout"].length() > 0){ _local2 = _arg1["root-layout"][0]; if (_local2.@width.length() > 0){ _local3 = Number(_local2.@width[0]); }; if (_local2.@height.length() > 0){ _local4 = Number(_local2.@height[0]); }; if (((((((isNaN(_local3)) || ((_local3 < 0)))) || (isNaN(_local4)))) || ((_local4 < 0)))){ throw (new VideoError(VideoError.INVALID_XML, (((("URL: \"" + _url) + "\" Tag ") + _arg1.localName()) + " requires attributes width and height. Width and height must be numbers greater than or equal to 0."))); }; width = Math.round(_local3); height = Math.round(_local4); }; } } }//package fl.video
Section 101
//SoundEvent (fl.video.SoundEvent) package fl.video { import flash.events.*; import flash.media.*; public class SoundEvent extends Event { private var _soundTransform:SoundTransform; public static const SOUND_UPDATE:String = "soundUpdate"; public function SoundEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:SoundTransform=null){ super(_arg1, _arg2, _arg3); _soundTransform = _arg4; } public function get soundTransform():SoundTransform{ return (_soundTransform); } override public function clone():Event{ return (new SoundEvent(type, bubbles, cancelable, soundTransform)); } } }//package fl.video
Section 102
//UIManager (fl.video.UIManager) package fl.video { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; public class UIManager { flvplayback_internal var _bufferingDelayTimer:Timer; public var ctrlDataDict:Dictionary; flvplayback_internal var _skinAutoHide:Boolean; flvplayback_internal var placeholderLeft:Number; flvplayback_internal var _playAfterScrub:Boolean; public var customClips:Array; flvplayback_internal var _skinFadeStartTime:int; flvplayback_internal var delayedControls:Array; flvplayback_internal var _lastScrubPos:Number; flvplayback_internal var _skinAutoHideLastMotionTime:int; flvplayback_internal var _volumeBarTimer:Timer; flvplayback_internal var borderScale9Rects:Array; flvplayback_internal var _volumeBarScrubTolerance:Number; flvplayback_internal var _skin:String; flvplayback_internal var videoRight:Number; flvplayback_internal var _bufferingBarHides:Boolean; flvplayback_internal var placeholderRight:Number; flvplayback_internal var cachedSoundLevel:Number; flvplayback_internal var videoBottom:Number; flvplayback_internal var border_mc:DisplayObject; flvplayback_internal var _skinFadingTimer:Timer; flvplayback_internal var borderAlpha:Number; flvplayback_internal var borderColorTransform:ColorTransform; flvplayback_internal var borderColor:uint; flvplayback_internal var __visible:Boolean; flvplayback_internal var cacheFLVPlaybackLocation:Rectangle; flvplayback_internal var cacheFLVPlaybackIndex:int; flvplayback_internal var _skinReady:Boolean; flvplayback_internal var controls:Array; flvplayback_internal var _skinAutoHideMouseX:Number; flvplayback_internal var _skinAutoHideMouseY:Number; flvplayback_internal var layout_mc:Sprite; flvplayback_internal var cacheSkinAutoHide:Boolean; flvplayback_internal var cacheStageScaleMode:String; flvplayback_internal var videoTop:Number; flvplayback_internal var _skinFadingMaxTime:int; flvplayback_internal var placeholderTop:Number; flvplayback_internal var _lastVolumePos:Number; flvplayback_internal var mouseCaptureCtrl:int; flvplayback_internal var _seekBarScrubTolerance:Number; flvplayback_internal var borderPrevRect:Rectangle; flvplayback_internal var skinTemplate:Sprite; flvplayback_internal var _progressPercent:Number; flvplayback_internal var videoLeft:Number; flvplayback_internal var _isMuted:Boolean; flvplayback_internal var _skinAutoHideTimer:Timer; flvplayback_internal var _fullScreenBgColor:uint; flvplayback_internal var _vc:FLVPlayback; flvplayback_internal var _bufferingOn:Boolean; flvplayback_internal var _seekBarTimer:Timer; flvplayback_internal var _controlsEnabled:Boolean; flvplayback_internal var _fullScreen:Boolean; flvplayback_internal var placeholderBottom:Number; flvplayback_internal var _fullScreenTakeOver:Boolean; flvplayback_internal var skin_mc:Sprite; flvplayback_internal var skinLoadDelayCount:uint; flvplayback_internal var _skinFadingIn:Boolean; flvplayback_internal var _skinAutoHideMotionTimeout:int; flvplayback_internal var borderCopy:Sprite; flvplayback_internal var cacheStageAlign:String; flvplayback_internal var cacheFLVPlaybackParent:DisplayObjectContainer; flvplayback_internal var skinLoader:Loader; public static const VOLUME_BAR_HIT:int = 12; public static const MUTE_OFF_BUTTON:int = 10; public static const BACK_BUTTON:int = 5; public static const FORWARD_BUTTON:int = 6; public static const STOP_BUTTON:int = 2; public static const NUM_BUTTONS:int = 13; public static const NORMAL_STATE:uint = 0; public static const SEEK_BAR_HANDLE:int = 3; public static const PLAY_BUTTON:int = 1; public static const MUTE_BUTTON:int = 15; public static const DOWN_STATE:uint = 2; public static const SEEK_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 5; public static const FULL_SCREEN_OFF_BUTTON:int = 8; flvplayback_internal static const SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT:Number = 3000; public static const SEEK_BAR:int = 17; public static const VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 0; public static const FULL_SCREEN_ON_BUTTON:int = 7; public static const FULL_SCREEN_BUTTON:int = 14; public static const BUFFERING_BAR:int = 16; public static const VERSION:String = "2.0.0.37"; public static const VOLUME_BAR_HANDLE:int = 11; public static const PAUSE_BUTTON:int = 0; flvplayback_internal static const SKIN_AUTO_HIDE_INTERVAL:Number = 200; public static const OVER_STATE:uint = 1; flvplayback_internal static const SKIN_FADING_INTERVAL:Number = 100; public static const VOLUME_BAR:int = 18; public static const SHORT_VERSION:String = "2.0"; public static const SEEK_BAR_INTERVAL_DEFAULT:Number = 250; flvplayback_internal static const SKIN_FADING_MAX_TIME_DEFAULT:Number = 500; public static const SEEK_BAR_HIT:int = 4; public static const PLAY_PAUSE_BUTTON:int = 13; public static const BUFFERING_DELAY_INTERVAL_DEFAULT:Number = 1000; public static const MUTE_ON_BUTTON:int = 9; public static const NUM_CONTROLS:int = 19; public static const VOLUME_BAR_INTERVAL_DEFAULT:Number = 250; flvplayback_internal static var layoutNameToIndexMappings:Object = null; flvplayback_internal static var buttonSkinLinkageIDs:Array = ["upLinkageID", "overLinkageID", "downLinkageID"]; flvplayback_internal static var layoutNameArray:Array = ["pause_mc", "play_mc", "stop_mc", null, null, "back_mc", "forward_mc", null, null, null, null, null, null, "playpause_mc", "fullScreenToggle_mc", "volumeMute_mc", "bufferingBar_mc", "seekBar_mc", "volumeBar_mc", "seekBarHandle_mc", "seekBarHit_mc", "seekBarProgress_mc", "seekBarFullness_mc", "volumeBarHandle_mc", "volumeBarHit_mc", "volumeBarProgress_mc", "volumeBarFullness_mc", "progressFill_mc"]; flvplayback_internal static var skinClassPrefixes:Array = ["pauseButton", "playButton", "stopButton", null, null, "backButton", "forwardButton", "fullScreenButtonOn", "fullScreenButtonOff", "muteButtonOn", "muteButtonOff", null, null, null, null, null, "bufferingBar", "seekBar", "volumeBar"]; flvplayback_internal static var customComponentClassNames:Array = ["PauseButton", "PlayButton", "StopButton", null, null, "BackButton", "ForwardButton", null, null, null, null, null, null, "PlayPauseButton", "FullScreenButton", "MuteButton", "BufferingBar", "SeekBar", "VolumeBar"]; public function UIManager(_arg1:FLVPlayback){ var vc = _arg1; super(); _vc = vc; _skin = null; _skinAutoHide = false; cacheSkinAutoHide = _skinAutoHide; _skinFadingMaxTime = SKIN_FADING_MAX_TIME_DEFAULT; _skinAutoHideMotionTimeout = SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT; _skinReady = true; __visible = false; _bufferingBarHides = false; _controlsEnabled = true; _lastScrubPos = 0; _lastVolumePos = 0; cachedSoundLevel = _vc.volume; _isMuted = false; controls = new Array(); customClips = null; ctrlDataDict = new Dictionary(true); skin_mc = null; skinLoader = null; skinTemplate = null; layout_mc = null; border_mc = null; borderCopy = null; borderPrevRect = null; borderScale9Rects = null; borderAlpha = 0.85; borderColor = 4697035; borderColorTransform = new ColorTransform(0, 0, 0, 0, 71, 171, 203, (0xFF * borderAlpha)); _seekBarScrubTolerance = SEEK_BAR_SCRUB_TOLERANCE_DEFAULT; _volumeBarScrubTolerance = VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT; _bufferingOn = false; mouseCaptureCtrl = -1; _seekBarTimer = new Timer(SEEK_BAR_INTERVAL_DEFAULT); _seekBarTimer.addEventListener(TimerEvent.TIMER, seekBarListener); _volumeBarTimer = new Timer(VOLUME_BAR_INTERVAL_DEFAULT); _volumeBarTimer.addEventListener(TimerEvent.TIMER, volumeBarListener); _bufferingDelayTimer = new Timer(BUFFERING_DELAY_INTERVAL_DEFAULT, 1); _bufferingDelayTimer.addEventListener(TimerEvent.TIMER, doBufferingDelay); _skinAutoHideTimer = new Timer(SKIN_AUTO_HIDE_INTERVAL); _skinAutoHideTimer.addEventListener(TimerEvent.TIMER, skinAutoHideHitTest); _skinFadingTimer = new Timer(SKIN_FADING_INTERVAL); _skinFadingTimer.addEventListener(TimerEvent.TIMER, skinFadeMore); _vc.addEventListener(MetadataEvent.METADATA_RECEIVED, handleIVPEvent); _vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE, handleIVPEvent); _vc.addEventListener(VideoProgressEvent.PROGRESS, handleIVPEvent); _vc.addEventListener(VideoEvent.STATE_CHANGE, handleIVPEvent); _vc.addEventListener(VideoEvent.READY, handleIVPEvent); _vc.addEventListener(LayoutEvent.LAYOUT, handleLayoutEvent); _vc.addEventListener(AutoLayoutEvent.AUTO_LAYOUT, handleLayoutEvent); _vc.addEventListener(SoundEvent.SOUND_UPDATE, handleSoundEvent); _vc.addEventListener(Event.ADDED_TO_STAGE, handleEvent); _fullScreen = false; _fullScreenTakeOver = true; _fullScreenBgColor = 0; if (_vc.stage != null){ try { _fullScreen = (_vc.stage.displayState == StageDisplayState.FULL_SCREEN); _vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreenEvent); } catch(se:SecurityError) { }; }; if (layoutNameToIndexMappings == null){ initLayoutNameToIndexMappings(); }; } flvplayback_internal function removeButtonListeners(_arg1:Sprite):void{ if (_arg1 == null){ return; }; _arg1.removeEventListener(MouseEvent.ROLL_OVER, handleButtonEvent); _arg1.removeEventListener(MouseEvent.ROLL_OUT, handleButtonEvent); _arg1.removeEventListener(MouseEvent.MOUSE_DOWN, handleButtonEvent); _arg1.removeEventListener(MouseEvent.CLICK, handleButtonEvent); _arg1.removeEventListener(Event.ENTER_FRAME, skinButtonControl); } public function set skinFadeTime(_arg1:int):void{ _skinFadingMaxTime = _arg1; } public function get skinFadeTime():int{ return (_skinFadingMaxTime); } flvplayback_internal function finishLoad(_arg1:Event):void{ var i:int; var cachedActivePlayerIndex:int; var state:String; var j:int; var e = _arg1; try { skinLoadDelayCount++; if (skinLoadDelayCount < 2){ return; } else { _vc.removeEventListener(Event.ENTER_FRAME, finishLoad); }; i = 0; while (i < NUM_CONTROLS) { if (delayedControls[i] != undefined){ setControl(i, delayedControls[i]); }; i = (i + 1); }; if (_fullScreenTakeOver){ enterFullScreenTakeOver(); } else { exitFullScreenTakeOver(); }; layoutSkin(); setupSkinAutoHide(false); skin_mc.visible = __visible; _vc.addChild(skin_mc); _skinReady = true; _vc.skinLoaded(); cachedActivePlayerIndex = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; state = _vc.state; j = 0; while (j < NUM_CONTROLS) { if (controls[j] == undefined){ } else { setEnabledAndVisibleForState(j, state); if (j < NUM_BUTTONS){ skinButtonControl(controls[j]); }; }; j = (j + 1); }; _vc.activeVideoPlayerIndex = cachedActivePlayerIndex; } catch(err:Error) { _vc.skinError(err.message); removeSkin(); }; } flvplayback_internal function downloadSkin():void{ if (skinLoader == null){ skinLoader = new Loader(); skinLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoad); skinLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleLoadErrorEvent); skinLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleLoadErrorEvent); }; skinLoader.load(new URLRequest(_skin)); } flvplayback_internal function removeSkin():void{ var i:int; if (skinLoader != null){ try { skinLoader.close(); } catch(e1:Error) { }; skinLoader = null; }; if (skin_mc != null){ i = 0; while (i < NUM_CONTROLS) { if (controls[i] == undefined){ } else { if (i < NUM_BUTTONS){ removeButtonListeners(controls[i]); }; delete ctrlDataDict[controls[i]]; delete controls[i]; }; i = (i + 1); }; try { skin_mc.parent.removeChild(skin_mc); } catch(e2:Error) { }; skin_mc = null; }; skinTemplate = null; layout_mc = null; border_mc = null; borderCopy = null; borderPrevRect = null; borderScale9Rects = null; } flvplayback_internal function positionBar(_arg1:Sprite, _arg2:String, _arg3:Number):void{ var ctrlData:ControlData; var bar:DisplayObject; var barData:ControlData; var ctrl = _arg1; var type = _arg2; var percent = _arg3; try { if ((((ctrl["positionBar"] is Function)) && (ctrl["positionBar"](type, percent)))){ return; }; } catch(re2:ReferenceError) { }; ctrlData = ctrlDataDict[ctrl]; bar = ctrlData[(type + "_mc")]; if (bar == null){ return; }; barData = ctrlDataDict[bar]; if (bar.parent == ctrl){ if (barData.fill_mc == null){ bar.scaleX = ((barData.origScaleX * percent) / 100); } else { positionMaskedFill(bar, percent); }; } else { bar.x = (ctrl.x + barData.leftMargin); bar.y = (ctrl.y + barData.origY); if (barData.fill_mc == null){ bar.width = ((((ctrl.width - barData.leftMargin) - barData.rightMargin) * percent) / 100); } else { positionMaskedFill(bar, percent); }; }; } flvplayback_internal function setupButtonSkin(_arg1:int):Sprite{ var _local2:String; var _local3:Sprite; var _local4:ControlData; _local2 = skinClassPrefixes[_arg1]; if (_local2 == null){ return (null); }; _local3 = new Sprite(); _local4 = new ControlData(this, _local3, null, _arg1); ctrlDataDict[_local3] = _local4; _local4.state_mc = new Array(); _local4.state_mc[NORMAL_STATE] = setupButtonSkinState(_local3, skinTemplate, (_local2 + "NormalState")); _local4.state_mc[NORMAL_STATE].visible = true; _local4.state_mc[OVER_STATE] = setupButtonSkinState(_local3, skinTemplate, (_local2 + "OverState"), _local4.state_mc[NORMAL_STATE]); _local4.state_mc[DOWN_STATE] = setupButtonSkinState(_local3, skinTemplate, (_local2 + "DownState"), _local4.state_mc[NORMAL_STATE]); _local4.disabled_mc = setupButtonSkinState(_local3, skinTemplate, (_local2 + "DisabledState"), _local4.state_mc[NORMAL_STATE]); return (_local3); } public function get skinReady():Boolean{ return (_skinReady); } public function get skinAutoHide():Boolean{ return (_skinAutoHide); } flvplayback_internal function dispatchMessage(_arg1:int):void{ var _local2:int; var _local3:Sprite; var _local4:ControlData; var _local5:Sprite; if ((((_arg1 == SEEK_BAR_HANDLE)) || ((_arg1 == SEEK_BAR_HIT)))){ _vc._scrubStart(); }; _local2 = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; switch (_arg1){ case PAUSE_BUTTON: _vc.pause(); break; case PLAY_BUTTON: _vc.play(); break; case STOP_BUTTON: _vc.stop(); break; case SEEK_BAR_HIT: case SEEK_BAR_HANDLE: _local3 = controls[SEEK_BAR]; _local4 = ctrlDataDict[_local3]; calcPercentageFromHandle(_local3); _lastScrubPos = _local4.percentage; if (_arg1 == SEEK_BAR_HIT){ _local5 = controls[SEEK_BAR_HANDLE]; controls[SEEK_BAR_HANDLE].x = _local5.parent.mouseX; _local5.y = _local5.parent.mouseY; }; _vc.removeEventListener(VideoEvent.PLAYHEAD_UPDATE, handleIVPEvent); if (((_vc.playing) || (_vc.buffering))){ _playAfterScrub = true; } else { if (_vc.state != VideoState.SEEKING){ _playAfterScrub = false; }; }; _seekBarTimer.start(); startHandleDrag(_local3); _vc.pause(); break; case VOLUME_BAR_HIT: case VOLUME_BAR_HANDLE: _local3 = controls[VOLUME_BAR]; _local4 = ctrlDataDict[_local3]; calcPercentageFromHandle(_local3); _lastVolumePos = _local4.percentage; if (_arg1 == VOLUME_BAR_HIT){ _local5 = controls[VOLUME_BAR_HANDLE]; controls[VOLUME_BAR_HANDLE].x = _local5.parent.mouseX; _local5.y = _local5.parent.mouseY; }; _vc.removeEventListener(SoundEvent.SOUND_UPDATE, handleSoundEvent); _volumeBarTimer.start(); startHandleDrag(_local3); break; case BACK_BUTTON: _vc.seekToPrevNavCuePoint(); break; case FORWARD_BUTTON: _vc.seekToNextNavCuePoint(); break; case MUTE_ON_BUTTON: if (!_isMuted){ _isMuted = true; cachedSoundLevel = _vc.volume; _vc.volume = 0; setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING); skinButtonControl(controls[MUTE_OFF_BUTTON]); setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING); skinButtonControl(controls[MUTE_ON_BUTTON]); }; break; case MUTE_OFF_BUTTON: if (_isMuted){ _isMuted = false; _vc.volume = cachedSoundLevel; setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING); skinButtonControl(controls[MUTE_OFF_BUTTON]); setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING); skinButtonControl(controls[MUTE_ON_BUTTON]); }; break; case FULL_SCREEN_ON_BUTTON: if (((!(_fullScreen)) && (!((_vc.stage == null))))){ _vc.stage.displayState = StageDisplayState.FULL_SCREEN; setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]); setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]); }; break; case FULL_SCREEN_OFF_BUTTON: if (((_fullScreen) && (!((_vc.stage == null))))){ _vc.stage.displayState = StageDisplayState.NORMAL; setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]); setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]); }; break; default: throw (new Error("Unknown ButtonControl")); }; _vc.activeVideoPlayerIndex = _local2; } flvplayback_internal function handleFullScreenEvent(_arg1:FullScreenEvent):void{ _fullScreen = _arg1.fullScreen; setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]); setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]); if (((_fullScreen) && (_fullScreenTakeOver))){ enterFullScreenTakeOver(); } else { if (!_fullScreen){ exitFullScreenTakeOver(); }; }; } flvplayback_internal function handleLayoutEvent(_arg1:LayoutEvent):void{ layoutSkin(); setupSkinAutoHide(false); } flvplayback_internal function seekBarListener(_arg1:TimerEvent):void{ var _local2:int; var _local3:Sprite; var _local4:ControlData; var _local5:Number; _local2 = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; _local3 = controls[SEEK_BAR]; if (_local3 == null){ return; }; _local4 = ctrlDataDict[_local3]; calcPercentageFromHandle(_local3); _local5 = _local4.percentage; if (_arg1 == null){ _seekBarTimer.stop(); if (_local5 != _lastScrubPos){ _vc.seekPercent(_local5); }; _vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE, handleIVPEvent); if (_playAfterScrub){ _vc.play(); }; } else { if (_vc.getVideoPlayer(_vc.visibleVideoPlayerIndex).state == VideoState.SEEKING){ } else { if ((((((((_seekBarScrubTolerance <= 0)) || ((Math.abs((_local5 - _lastScrubPos)) > _seekBarScrubTolerance)))) || ((_local5 < _seekBarScrubTolerance)))) || ((_local5 > (100 - _seekBarScrubTolerance))))){ if (_local5 != _lastScrubPos){ _lastScrubPos = _local5; _vc.seekPercent(_local5); }; }; }; }; _vc.activeVideoPlayerIndex = _local2; } public function get seekBarInterval():Number{ return (_seekBarTimer.delay); } public function set skinAutoHide(_arg1:Boolean):void{ if (_arg1 == _skinAutoHide){ return; }; _skinAutoHide = _arg1; cacheSkinAutoHide = _arg1; setupSkinAutoHide(true); } flvplayback_internal function setCustomClip(_arg1:DisplayObject):void{ var dCopy:DisplayObject; var ctrlData:ControlData; var scale9Grid:Rectangle; var diff:Number; var numBorderBitmaps:int; var i:int; var lastXDim:Number; var lastYDim:Number; var newRect:Rectangle; var dispObj = _arg1; dCopy = new (dispObj["constructor"]); skin_mc.addChild(dCopy); ctrlData = new ControlData(this, dCopy, null, -1); ctrlDataDict[dCopy] = ctrlData; ctrlData.avatar = dispObj; customClips.push(dCopy); if (dispObj.name == "border_mc"){ border_mc = dCopy; try { borderCopy = (ctrlData.avatar["colorMe"]) ? new Sprite() : null; } catch(re:ReferenceError) { borderCopy = null; }; if (borderCopy != null){ border_mc.visible = false; scale9Grid = border_mc.scale9Grid; scale9Grid.x = Math.round(scale9Grid.x); scale9Grid.y = Math.round(scale9Grid.y); scale9Grid.width = Math.round(scale9Grid.width); diff = ((scale9Grid.x + scale9Grid.width) - border_mc.scale9Grid.right); if (diff > 0.5){ scale9Grid.width--; } else { if (diff < -0.5){ scale9Grid.width++; }; }; scale9Grid.height = Math.round(scale9Grid.height); diff = ((scale9Grid.y + scale9Grid.height) - border_mc.scale9Grid.bottom); if (diff > 0.5){ scale9Grid.height--; } else { if (diff < -0.5){ scale9Grid.height++; }; }; if (scale9Grid != null){ borderScale9Rects = new Array(); lastXDim = (border_mc.width - (scale9Grid.x + scale9Grid.width)); lastXDim = (Math.floor(lastXDim) + 1); lastYDim = (border_mc.height - (scale9Grid.y + scale9Grid.height)); lastYDim = (Math.floor(lastYDim) + 1); newRect = new Rectangle(0, 0, scale9Grid.x, scale9Grid.y); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(scale9Grid.x, 0, scale9Grid.width, scale9Grid.y); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle((scale9Grid.x + scale9Grid.width), 0, lastXDim, scale9Grid.y); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(0, scale9Grid.y, scale9Grid.x, scale9Grid.height); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(scale9Grid.x, scale9Grid.y, scale9Grid.width, scale9Grid.height); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle((scale9Grid.x + scale9Grid.width), scale9Grid.y, lastXDim, scale9Grid.height); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(0, (scale9Grid.y + scale9Grid.height), scale9Grid.x, lastYDim); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(scale9Grid.x, (scale9Grid.y + scale9Grid.height), scale9Grid.width, lastYDim); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle((scale9Grid.x + scale9Grid.width), (scale9Grid.y + scale9Grid.height), lastXDim, lastYDim); borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); i = 0; while (i < borderScale9Rects.length) { if (borderScale9Rects[i] != null){ break; }; i = (i + 1); }; if (i >= borderScale9Rects.length){ borderScale9Rects = null; }; }; numBorderBitmaps = ((borderScale9Rects)==null) ? 1 : 9; i = 0; while (i < numBorderBitmaps) { if ((((borderScale9Rects == null)) || (!((borderScale9Rects[i] == null))))){ borderCopy.addChild(new Bitmap()); }; i = (i + 1); }; skin_mc.addChild(borderCopy); borderPrevRect = null; }; }; } public function get fullScreenSkinDelay():int{ return (_skinAutoHideMotionTimeout); } flvplayback_internal function doBufferingDelay(_arg1:TimerEvent):void{ var _local2:int; _bufferingDelayTimer.reset(); _local2 = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; if (_vc.state == VideoState.BUFFERING){ _bufferingOn = true; handleIVPEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, VideoState.BUFFERING, NaN, _vc.visibleVideoPlayerIndex)); }; _vc.activeVideoPlayerIndex = _local2; } flvplayback_internal function volumeBarListener(_arg1:TimerEvent):void{ var _local2:Sprite; var _local3:ControlData; var _local4:Number; var _local5:Boolean; _local2 = controls[VOLUME_BAR]; if (_local2 == null){ return; }; _local3 = ctrlDataDict[_local2]; calcPercentageFromHandle(_local2); _local4 = _local3.percentage; _local5 = (_arg1 == null); if (_local5){ _volumeBarTimer.stop(); _vc.addEventListener(SoundEvent.SOUND_UPDATE, handleSoundEvent); }; if (((((((((_local5) || ((_volumeBarScrubTolerance <= 0)))) || ((Math.abs((_local4 - _lastVolumePos)) > _volumeBarScrubTolerance)))) || ((_local4 < _volumeBarScrubTolerance)))) || ((_local4 > (100 - _volumeBarScrubTolerance))))){ if (_local4 != _lastVolumePos){ if (_isMuted){ cachedSoundLevel = (_local4 / 100); } else { _vc.volume = (_local4 / 100); }; _lastVolumePos = _local4; }; }; } public function get visible():Boolean{ return (__visible); } flvplayback_internal function fixUpBar(_arg1:DisplayObject, _arg2:String, _arg3:DisplayObject, _arg4:String):void{ var ctrlData:ControlData; var bar:DisplayObject; var barData:ControlData; var definitionHolder = _arg1; var propPrefix = _arg2; var ctrl = _arg3; var name = _arg4; ctrlData = ctrlDataDict[ctrl]; if (ctrlData[name] != null){ return; }; try { bar = ctrl[name]; } catch(re:ReferenceError) { bar = null; }; if (bar == null){ try { bar = createSkin(definitionHolder, (propPrefix + "LinkageID")); } catch(ve:VideoError) { bar = null; }; if (bar == null){ return; }; if (ctrl.parent != null){ if (getBooleanPropSafe(ctrl, (propPrefix + "Below"))){ ctrl.parent.addChildAt(bar, ctrl.parent.getChildIndex(ctrl)); } else { ctrl.parent.addChild(bar); }; }; }; ctrlData[name] = bar; barData = ctrlDataDict[bar]; if (barData == null){ barData = new ControlData(this, bar, ctrl, -1); ctrlDataDict[bar] = barData; }; } public function get volumeBarInterval():Number{ return (_volumeBarTimer.delay); } public function get bufferingBarHidesAndDisablesOthers():Boolean{ return (_bufferingBarHides); } flvplayback_internal function calcLayoutControl(_arg1:DisplayObject):Rectangle{ var rect:Rectangle; var ctrlData:ControlData; var anchorRight:Boolean; var anchorLeft:Boolean; var anchorTop:Boolean; var anchorBottom:Boolean; var ctrl = _arg1; rect = new Rectangle(); if (ctrl == null){ return (rect); }; ctrlData = ctrlDataDict[ctrl]; if (ctrlData == null){ return (rect); }; if (ctrlData.avatar == null){ return (rect); }; anchorRight = false; anchorLeft = true; anchorTop = false; anchorBottom = true; try { anchorRight = ctrlData.avatar["anchorRight"]; } catch(re1:ReferenceError) { anchorRight = false; }; try { anchorLeft = ctrlData.avatar["anchorLeft"]; } catch(re1:ReferenceError) { anchorLeft = true; }; try { anchorTop = ctrlData.avatar["anchorTop"]; } catch(re1:ReferenceError) { anchorTop = false; }; try { anchorBottom = ctrlData.avatar["anchorBottom"]; } catch(re1:ReferenceError) { anchorBottom = true; }; if (anchorRight){ if (anchorLeft){ rect.x = ((ctrlData.avatar.x - placeholderLeft) + videoLeft); rect.width = ((((ctrlData.avatar.x + ctrlData.avatar.width) - placeholderRight) + videoRight) - rect.x); ctrlData.origWidth = NaN; } else { rect.x = ((ctrlData.avatar.x - placeholderRight) + videoRight); rect.width = ctrl.width; }; } else { rect.x = ((ctrlData.avatar.x - placeholderLeft) + videoLeft); rect.width = ctrl.width; }; if (anchorTop){ if (anchorBottom){ rect.y = ((ctrlData.avatar.y - placeholderTop) + videoTop); rect.height = ((((ctrlData.avatar.y + ctrlData.avatar.height) - placeholderBottom) + videoBottom) - rect.y); ctrlData.origHeight = NaN; } else { rect.y = ((ctrlData.avatar.y - placeholderTop) + videoTop); rect.height = ctrl.height; }; } else { rect.y = ((ctrlData.avatar.y - placeholderBottom) + videoBottom); rect.height = ctrl.height; }; try { if ((ctrl["layoutSelf"] is Function)){ rect = ctrl["layoutSelf"](rect); }; } catch(re3:ReferenceError) { }; return (rect); } flvplayback_internal function skinFadeMore(_arg1:TimerEvent):void{ var _local2:Number; if (((((!(_skinFadingIn)) && ((skin_mc.alpha <= 0.5)))) || (((_skinFadingIn) && ((skin_mc.alpha >= 0.95)))))){ skin_mc.visible = _skinFadingIn; skin_mc.alpha = 1; _skinFadingTimer.stop(); } else { _local2 = ((getTimer() - _skinFadeStartTime) / _skinFadingMaxTime); if (!_skinFadingIn){ _local2 = (1 - _local2); }; if (_local2 < 0){ _local2 = 0; } else { if (_local2 > 1){ _local2 = 1; }; }; skin_mc.alpha = _local2; }; } flvplayback_internal function resetPlayPause():void{ var _local1:int; if (controls[PLAY_PAUSE_BUTTON] == undefined){ return; }; _local1 = PAUSE_BUTTON; while (_local1 <= PLAY_BUTTON) { removeButtonListeners(controls[_local1]); delete ctrlDataDict[controls[_local1]]; delete controls[_local1]; _local1++; }; delete ctrlDataDict[controls[PLAY_PAUSE_BUTTON]]; delete controls[PLAY_PAUSE_BUTTON]; } public function setControl(_arg1:int, _arg2:Sprite):void{ var ctrlData:ControlData; var index = _arg1; var ctrl = _arg2; if (ctrl == controls[index]){ return; }; switch (index){ case PAUSE_BUTTON: case PLAY_BUTTON: resetPlayPause(); break; case PLAY_PAUSE_BUTTON: if ((((ctrl == null)) || (!((ctrl.parent == skin_mc))))){ resetPlayPause(); }; if (ctrl != null){ setControl(PAUSE_BUTTON, Sprite(ctrl.getChildByName("pause_mc"))); setControl(PLAY_BUTTON, Sprite(ctrl.getChildByName("play_mc"))); }; break; case FULL_SCREEN_BUTTON: if (ctrl != null){ setControl(FULL_SCREEN_ON_BUTTON, Sprite(ctrl.getChildByName("on_mc"))); setControl(FULL_SCREEN_OFF_BUTTON, Sprite(ctrl.getChildByName("off_mc"))); }; break; case MUTE_BUTTON: if (ctrl != null){ setControl(MUTE_ON_BUTTON, Sprite(ctrl.getChildByName("on_mc"))); setControl(MUTE_OFF_BUTTON, Sprite(ctrl.getChildByName("off_mc"))); }; break; }; if (controls[index] != null){ try { delete controls[index]["uiMgr"]; } catch(re:ReferenceError) { }; if (index < NUM_BUTTONS){ removeButtonListeners(controls[index]); }; delete ctrlDataDict[controls[index]]; delete controls[index]; }; if (ctrl == null){ return; }; ctrlData = ctrlDataDict[ctrl]; if (ctrlData == null){ ctrlData = new ControlData(this, ctrl, null, index); ctrlDataDict[ctrl] = ctrlData; } else { ctrlData.index = index; }; if (index >= NUM_BUTTONS){ controls[index] = ctrl; switch (index){ case SEEK_BAR: addBarControl(ctrl); break; case VOLUME_BAR: addBarControl(ctrl); ctrlData.percentage = (_vc.volume * 100); break; case BUFFERING_BAR: if (ctrl.parent == skin_mc){ finishAddBufferingBar(); } else { ctrl.addEventListener(Event.ENTER_FRAME, finishAddBufferingBar); }; break; }; setEnabledAndVisibleForState(index, _vc.state); } else { controls[index] = ctrl; addButtonControl(ctrl); }; } flvplayback_internal function bitmapCopyBorder():void{ var _local1:Rectangle; var _local2:BitmapData; var _local3:Matrix; var _local4:Number; var _local5:Number; var _local6:Rectangle; var _local7:int; var _local8:int; var _local9:Bitmap; var _local10:Number; var _local11:Number; if ((((border_mc == null)) || ((borderCopy == null)))){ return; }; _local1 = border_mc.getBounds(skin_mc); if ((((borderPrevRect == null)) || (!(borderPrevRect.equals(_local1))))){ borderCopy.x = _local1.x; borderCopy.y = _local1.y; _local3 = new Matrix(border_mc.scaleX, 0, 0, border_mc.scaleY, 0, 0); if (borderScale9Rects == null){ _local2 = new BitmapData(_local1.width, _local1.height, true, 0); _local2.draw(border_mc, _local3, borderColorTransform); Bitmap(borderCopy.getChildAt(0)).bitmapData = _local2; } else { _local4 = 0; _local5 = 0; _local6 = new Rectangle(0, 0, 0, 0); _local7 = 0; _local8 = 0; while (_local8 < borderScale9Rects.length) { if ((_local8 % 3) == 0){ _local4 = 0; _local5 = (_local5 + _local6.height); }; if (borderScale9Rects[_local8] == null){ } else { _local6 = Rectangle(borderScale9Rects[_local8]).clone(); _local3.a = 1; if ((((((_local8 == 1)) || ((_local8 == 4)))) || ((_local8 == 7)))){ _local10 = ((_local1.width - (_local4 * 2)) / _local6.width); _local6.x = (_local6.x * _local10); _local6.width = (_local6.width * _local10); _local6.width = Math.round(_local6.width); _local3.a = (_local3.a * _local10); }; _local3.tx = -(_local6.x); _local6.x = 0; _local3.d = 1; if ((((_local8 >= 3)) && ((_local8 <= 5)))){ _local11 = ((_local1.height - (_local5 * 2)) / _local6.height); _local6.y = (_local6.y * _local11); _local6.height = (_local6.height * _local11); _local6.height = Math.round(_local6.height); _local3.d = (_local3.d * _local11); }; _local3.ty = -(_local6.y); _local6.y = 0; _local2 = new BitmapData(_local6.width, _local6.height, true, 0); _local2.draw(border_mc, _local3, borderColorTransform, null, _local6, false); _local9 = Bitmap(borderCopy.getChildAt(_local7)); _local7++; _local9.bitmapData = _local2; _local9.x = _local4; _local9.y = _local5; _local4 = (_local4 + _local6.width); }; _local8++; }; }; borderPrevRect = _local1; }; } flvplayback_internal function createSkin(_arg1:DisplayObject, _arg2:String):DisplayObject{ var stateSkinDesc:*; var theClass:Class; var definitionHolder = _arg1; var skinName = _arg2; try { stateSkinDesc = definitionHolder[skinName]; if ((stateSkinDesc is String)){ try { theClass = Class(definitionHolder.loaderInfo.applicationDomain.getDefinition(stateSkinDesc)); } catch(err1:Error) { theClass = Class(getDefinitionByName(stateSkinDesc)); }; return (DisplayObject(new (theClass))); } else { if ((stateSkinDesc is Class)){ return (new (stateSkinDesc)); } else { if ((stateSkinDesc is DisplayObject)){ return (stateSkinDesc); }; }; }; } catch(err2:Error) { throw (new VideoError(VideoError.MISSING_SKIN_STYLE, skinName)); }; return (null); } flvplayback_internal function hookUpCustomComponents():void{ var searchHash:Object; var doTheSearch:Boolean; var i:int; var dispObj:DisplayObject; var name:String; var index:int; var ctrl:Sprite; searchHash = new Object(); doTheSearch = false; i = 0; while (i < NUM_CONTROLS) { if (controls[i] == null){ searchHash[customComponentClassNames[i]] = i; doTheSearch = true; }; i = (i + 1); }; if (!doTheSearch){ return; }; i = 0; while (i < _vc.parent.numChildren) { dispObj = _vc.parent.getChildAt(i); name = getQualifiedClassName(dispObj); if (searchHash[name] != undefined){ if (typeof(searchHash[name]) == "number"){ index = int(searchHash[name]); try { ctrl = Sprite(dispObj); if ((((((index >= NUM_BUTTONS)) || ((ctrl["placeholder_mc"] is DisplayObject)))) && ((ctrl["uiMgr"] == null)))){ setControl(index, ctrl); searchHash[name] = ctrl; }; } catch(err:Error) { }; }; }; i = (i + 1); }; } flvplayback_internal function addButtonControl(_arg1:Sprite):void{ var _local2:ControlData; var _local3:int; if (_arg1 == null){ return; }; _local2 = ctrlDataDict[_arg1]; _arg1.mouseChildren = false; _local3 = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; _local2.state = NORMAL_STATE; setEnabledAndVisibleForState(_local2.index, _vc.state); _arg1.addEventListener(MouseEvent.ROLL_OVER, handleButtonEvent); _arg1.addEventListener(MouseEvent.ROLL_OUT, handleButtonEvent); _arg1.addEventListener(MouseEvent.MOUSE_DOWN, handleButtonEvent); _arg1.addEventListener(MouseEvent.CLICK, handleButtonEvent); if (_arg1.parent == skin_mc){ skinButtonControl(_arg1); } else { _arg1.addEventListener(Event.ENTER_FRAME, skinButtonControl); }; _vc.activeVideoPlayerIndex = _local3; } flvplayback_internal function positionHandle(_arg1:Sprite):void{ var _local2:ControlData; var _local3:Sprite; var _local4:ControlData; var _local5:Number; var _local6:Number; if (_arg1 == null){ return; }; if ((((_arg1["positionHandle"] is Function)) && (_arg1["positionHandle"]()))){ return; }; _local2 = ctrlDataDict[_arg1]; _local3 = _local2.handle_mc; if (_local3 == null){ return; }; _local4 = ctrlDataDict[_local3]; _local5 = (isNaN(_local2.origWidth)) ? _arg1.width : _local2.origWidth; _local6 = ((_local5 - _local4.rightMargin) - _local4.leftMargin); _local3.x = ((_arg1.x + _local4.leftMargin) + ((_local6 * _local2.percentage) / 100)); _local3.y = (_arg1.y + _local4.origY); if (_local2.fullness_mc != null){ positionBar(_arg1, "fullness", _local2.percentage); }; } flvplayback_internal function exitFullScreenTakeOver():void{ var fullScreenBG:Sprite; if (cacheStageAlign == null){ return; }; _vc.removeEventListener(Event.ADDED_TO_STAGE, handleEvent); try { _vc.stage.align = cacheStageAlign; _vc.stage.scaleMode = cacheStageScaleMode; if (_vc.parent != cacheFLVPlaybackParent){ cacheFLVPlaybackParent.addChildAt(_vc, cacheFLVPlaybackIndex); } else { cacheFLVPlaybackParent.setChildIndex(_vc, cacheFLVPlaybackIndex); }; if (cacheStageAlign == null){ return; }; _vc.registrationX = cacheFLVPlaybackLocation.x; _vc.registrationY = cacheFLVPlaybackLocation.y; _vc.setSize(cacheFLVPlaybackLocation.width, cacheFLVPlaybackLocation.height); fullScreenBG = Sprite(_vc.getChildByName("fullScreenBG")); if (fullScreenBG != null){ _vc.removeChild(fullScreenBG); }; } catch(err:Error) { }; _vc.addEventListener(Event.ADDED_TO_STAGE, handleEvent); cacheStageAlign = null; cacheStageScaleMode = null; cacheFLVPlaybackParent = null; cacheFLVPlaybackIndex = 0; cacheFLVPlaybackLocation = null; if (_skinAutoHide != cacheSkinAutoHide){ _skinAutoHide = cacheSkinAutoHide; setupSkinAutoHide(false); }; } flvplayback_internal function positionMaskedFill(_arg1:DisplayObject, _arg2:Number):void{ var ctrlData:ControlData; var fill:DisplayObject; var mask:DisplayObject; var fillData:ControlData; var maskData:ControlData; var slideReveal:Boolean; var maskSprite:Sprite; var barData:ControlData; var ctrl = _arg1; var percent = _arg2; if (ctrl == null){ return; }; ctrlData = ctrlDataDict[ctrl]; fill = ctrlData.fill_mc; if (fill == null){ return; }; mask = ctrlData.mask_mc; if (ctrlData.mask_mc == null){ try { var _local4 = ctrl["mask_mc"]; mask = _local4; ctrlData.mask_mc = _local4; } catch(re:ReferenceError) { ctrlData.mask_mc = null; }; if (ctrlData.mask_mc == null){ maskSprite = new Sprite(); _local4 = maskSprite; mask = _local4; ctrlData.mask_mc = _local4; maskSprite.graphics.beginFill(0xFFFFFF); maskSprite.graphics.drawRect(0, 0, 1, 1); maskSprite.graphics.endFill(); barData = ctrlDataDict[fill]; maskSprite.x = barData.origX; maskSprite.y = barData.origY; maskSprite.width = barData.origWidth; maskSprite.height = barData.origHeight; maskSprite.visible = false; fill.parent.addChild(maskSprite); fill.mask = maskSprite; }; if (ctrlData.mask_mc != null){ calcBarMargins(ctrl, "mask", true); }; }; fillData = ctrlDataDict[fill]; maskData = ctrlDataDict[mask]; try { slideReveal = fill["slideReveal"]; } catch(re:ReferenceError) { slideReveal = false; }; if (fill.parent == ctrl){ if (slideReveal){ fill.x = ((maskData.origX - fillData.origWidth) + ((fillData.origWidth * percent) / 100)); } else { mask.width = ((fillData.origWidth * percent) / 100); }; } else { if (fill.parent == ctrl.parent){ if (slideReveal){ mask.x = (ctrl.x + maskData.leftMargin); mask.y = (ctrl.y + maskData.topMargin); mask.width = ((ctrl.width - maskData.rightMargin) - maskData.leftMargin); mask.height = ((ctrl.height - maskData.topMargin) - maskData.bottomMargin); fill.x = ((mask.x - fillData.origWidth) + ((maskData.origWidth * percent) / 100)); fill.y = (ctrl.y + fillData.topMargin); } else { fill.x = (ctrl.x + fillData.leftMargin); fill.y = (ctrl.y + fillData.topMargin); mask.x = fill.x; mask.y = fill.y; mask.width = ((((ctrl.width - fillData.rightMargin) - fillData.leftMargin) * percent) / 100); mask.height = ((ctrl.height - fillData.topMargin) - fillData.bottomMargin); }; }; }; } flvplayback_internal function calcPercentageFromHandle(_arg1:Sprite):void{ var _local2:ControlData; var _local3:Sprite; var _local4:ControlData; var _local5:Number; var _local6:Number; var _local7:Number; if (_arg1 == null){ return; }; _local2 = ctrlDataDict[_arg1]; if ((((_arg1["calcPercentageFromHandle"] is Function)) && (_arg1["calcPercentageFromHandle"]()))){ if (_local2.percentage < 0){ _local2.percentage = 0; }; if (_local2.percentage > 100){ _local2.percentage = 100; }; return; }; _local3 = _local2.handle_mc; if (_local3 == null){ return; }; _local4 = ctrlDataDict[_local3]; _local5 = (isNaN(_local2.origWidth)) ? _arg1.width : _local2.origWidth; _local6 = ((_local5 - _local4.rightMargin) - _local4.leftMargin); _local7 = (_local3.x - (_arg1.x + _local4.leftMargin)); _local2.percentage = ((_local7 / _local6) * 100); if (_local2.percentage < 0){ _local2.percentage = 0; }; if (_local2.percentage > 100){ _local2.percentage = 100; }; if (_local2.fullness_mc != null){ positionBar(_arg1, "fullness", _local2.percentage); }; } flvplayback_internal function skinAutoHideHitTest(_arg1:TimerEvent, _arg2:Boolean=true):void{ var visibleVP:VideoPlayer; var hit:Boolean; var e = _arg1; var doFade = _arg2; try { if (!__visible){ skin_mc.visible = false; } else { if (_vc.stage != null){ visibleVP = _vc.getVideoPlayer(_vc.visibleVideoPlayerIndex); hit = visibleVP.hitTestPoint(_vc.stage.mouseX, _vc.stage.mouseY, true); if (((((_fullScreen) && (_fullScreenTakeOver))) && (!((e == null))))){ if ((((_vc.stage.mouseX == _skinAutoHideMouseX)) && ((_vc.stage.mouseY == _skinAutoHideMouseY)))){ if ((getTimer() - _skinAutoHideLastMotionTime) > _skinAutoHideMotionTimeout){ hit = false; }; } else { _skinAutoHideLastMotionTime = getTimer(); _skinAutoHideMouseX = _vc.stage.mouseX; _skinAutoHideMouseY = _vc.stage.mouseY; }; }; if (((!(hit)) && (!((border_mc == null))))){ hit = border_mc.hitTestPoint(_vc.stage.mouseX, _vc.stage.mouseY, true); if (((((hit) && (_fullScreen))) && (_fullScreenTakeOver))){ _skinAutoHideLastMotionTime = getTimer(); }; }; if (((!(doFade)) || ((_skinFadingMaxTime <= 0)))){ _skinFadingTimer.stop(); skin_mc.visible = hit; skin_mc.alpha = 1; } else { if (((((((hit) && (skin_mc.visible))) && (((!(_skinFadingTimer.running)) || (_skinFadingIn))))) || (((!(hit)) && (((!(skin_mc.visible)) || (((_skinFadingTimer.running) && (!(_skinFadingIn)))))))))){ } else { _skinFadingTimer.stop(); _skinFadingIn = hit; if (((_skinFadingIn) && ((skin_mc.alpha == 1)))){ skin_mc.alpha = 0; }; _skinFadeStartTime = getTimer(); _skinFadingTimer.start(); skin_mc.visible = true; }; }; }; }; } catch(se:SecurityError) { _skinAutoHideTimer.stop(); _skinFadingTimer.stop(); skin_mc.visible = __visible; skin_mc.alpha = 1; }; } flvplayback_internal function handleRelease(_arg1:int):void{ var _local2:int; _local2 = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; if (_arg1 == SEEK_BAR){ seekBarListener(null); } else { if (_arg1 == VOLUME_BAR){ volumeBarListener(null); }; }; stopHandleDrag(controls[_arg1]); _vc.activeVideoPlayerIndex = _local2; if (_arg1 == SEEK_BAR){ _vc._scrubFinish(); }; } flvplayback_internal function setTwoButtonHolderSkin(_arg1:int, _arg2:int, _arg3:String, _arg4:int, _arg5:String):Sprite{ var _local6:Sprite; var _local7:Sprite; var _local8:ControlData; _local7 = new Sprite(); _local8 = new ControlData(this, _local7, null, _arg1); ctrlDataDict[_local7] = _local8; skin_mc.addChild(_local7); _local6 = setupButtonSkin(_arg2); _local6.name = _arg3; _local6.visible = true; _local7.addChild(_local6); _local6 = setupButtonSkin(_arg4); _local6.name = _arg5; _local6.visible = false; _local7.addChild(_local6); return (_local7); } public function set seekBarInterval(_arg1:Number):void{ if (_seekBarTimer.delay == _arg1){ return; }; _seekBarTimer.delay = _arg1; } flvplayback_internal function layoutControl(_arg1:DisplayObject):void{ var _local2:ControlData; var _local3:Rectangle; var _local4:Sprite; var _local5:Rectangle; if (_arg1 == null){ return; }; _local2 = ctrlDataDict[_arg1]; if (_local2 == null){ return; }; if (_local2.avatar == null){ return; }; _local3 = calcLayoutControl(_arg1); _arg1.x = _local3.x; _arg1.y = _local3.y; _arg1.width = _local3.width; _arg1.height = _local3.height; switch (_local2.index){ case SEEK_BAR: case VOLUME_BAR: if (((!((_local2.hit_mc == null))) && ((_local2.hit_mc.parent == skin_mc)))){ _local4 = _local2.hit_mc; _local5 = calcLayoutControl(_local4); _local4.x = _local5.x; _local4.y = _local5.y; _local4.width = _local5.width; _local4.height = _local5.height; }; if (_local2.progress_mc != null){ if (isNaN(_progressPercent)){ _progressPercent = (_vc.isRTMP) ? 100 : 0; }; positionBar(Sprite(_arg1), "progress", _progressPercent); }; positionHandle(Sprite(_arg1)); break; case BUFFERING_BAR: positionMaskedFill(_arg1, 100); break; }; } public function set fullScreenSkinDelay(_arg1:int):void{ _skinAutoHideMotionTimeout = _arg1; } flvplayback_internal function captureMouseEvent(_arg1:MouseEvent):void{ _arg1.stopPropagation(); } flvplayback_internal function handleMouseUp(_arg1:MouseEvent):void{ var _local2:Sprite; var _local3:ControlData; _local2 = controls[mouseCaptureCtrl]; if (_local2 != null){ _local3 = ctrlDataDict[_local2]; _local3.state = (_local2.hitTestPoint(_arg1.stageX, _arg1.stageY, true)) ? OVER_STATE : NORMAL_STATE; skinButtonControl(_local2); switch (mouseCaptureCtrl){ case SEEK_BAR_HANDLE: case SEEK_BAR_HIT: handleRelease(SEEK_BAR); break; case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: handleRelease(VOLUME_BAR); break; }; }; _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_OUT, captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_OVER, captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp); _arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OVER, captureMouseEvent, true); } public function set visible(_arg1:Boolean):void{ if (__visible == _arg1){ return; }; __visible = _arg1; if (!__visible){ skin_mc.visible = false; } else { setupSkinAutoHide(false); }; } public function get bufferingDelayInterval():Number{ return (_bufferingDelayTimer.delay); } public function set fullScreenBackgroundColor(_arg1:uint):void{ if (_fullScreenBgColor != _arg1){ _fullScreenBgColor = _arg1; if (_vc){ }; }; } public function get fullScreenTakeOver():Boolean{ return (_fullScreenTakeOver); } public function set skin(_arg1:String):void{ var _local2:String; if (_arg1 == null){ removeSkin(); _skin = null; _skinReady = true; } else { _local2 = String(_arg1); if (_arg1 == _skin){ return; }; removeSkin(); _skin = String(_arg1); _skinReady = (_skin == ""); if (!_skinReady){ downloadSkin(); }; }; } public function set volumeBarInterval(_arg1:Number):void{ if (_volumeBarTimer.delay == _arg1){ return; }; _volumeBarTimer.delay = _arg1; } flvplayback_internal function setSkin(_arg1:int, _arg2:DisplayObject):void{ var _local3:Sprite; var _local4:ControlData; var _local5:String; if (_arg1 >= NUM_CONTROLS){ return; }; if (_arg1 < NUM_BUTTONS){ _local3 = setupButtonSkin(_arg1); skin_mc.addChild(_local3); _local4 = ctrlDataDict[_local3]; } else { switch (_arg1){ case PLAY_PAUSE_BUTTON: _local3 = setTwoButtonHolderSkin(_arg1, PLAY_BUTTON, "play_mc", PAUSE_BUTTON, "pause_mc"); _local4 = ctrlDataDict[_local3]; break; case FULL_SCREEN_BUTTON: _local3 = setTwoButtonHolderSkin(_arg1, FULL_SCREEN_ON_BUTTON, "on_mc", FULL_SCREEN_OFF_BUTTON, "off_mc"); _local4 = ctrlDataDict[_local3]; break; case MUTE_BUTTON: _local3 = setTwoButtonHolderSkin(_arg1, MUTE_ON_BUTTON, "on_mc", MUTE_OFF_BUTTON, "off_mc"); _local4 = ctrlDataDict[_local3]; break; case SEEK_BAR: case VOLUME_BAR: _local5 = skinClassPrefixes[_arg1]; _local3 = Sprite(createSkin(skinTemplate, _local5)); if (_local3 != null){ skin_mc.addChild(_local3); _local4 = new ControlData(this, _local3, null, _arg1); ctrlDataDict[_local3] = _local4; _local4.progress_mc = setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Progress"), "progress_mc"); _local4.fullness_mc = setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Fullness"), "fullness_mc"); _local4.hit_mc = Sprite(setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Hit"), "hit_mc")); _local4.handle_mc = Sprite(setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Handle"), "handle_mc", true)); _local3.width = _arg2.width; _local3.height = _arg2.height; }; break; case BUFFERING_BAR: _local5 = skinClassPrefixes[_arg1]; _local3 = Sprite(createSkin(skinTemplate, _local5)); if (_local3 != null){ skin_mc.addChild(_local3); _local4 = new ControlData(this, _local3, null, _arg1); ctrlDataDict[_local3] = _local4; _local4.fill_mc = setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Fill"), "fill_mc"); _local3.width = _arg2.width; _local3.height = _arg2.height; }; break; }; }; _local4.avatar = _arg2; ctrlDataDict[_local3] = _local4; delayedControls[_arg1] = _local3; } public function set bufferingBarHidesAndDisablesOthers(_arg1:Boolean):void{ _bufferingBarHides = _arg1; } flvplayback_internal function handleSoundEvent(_arg1:SoundEvent):void{ var _local2:Sprite; var _local3:ControlData; if (((_isMuted) && ((_arg1.soundTransform.volume > 0)))){ _isMuted = false; setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING); skinButtonControl(controls[MUTE_OFF_BUTTON]); setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING); skinButtonControl(controls[MUTE_ON_BUTTON]); }; _local2 = controls[VOLUME_BAR]; if (_local2 != null){ _local3 = ctrlDataDict[_local2]; _local3.percentage = ((_isMuted) ? cachedSoundLevel : _arg1.soundTransform.volume * 100); if (_local3.percentage < 0){ _local3.percentage = 0; } else { if (_local3.percentage > 100){ _local3.percentage = 100; }; }; positionHandle(_local2); }; } flvplayback_internal function stopHandleDrag(_arg1:Sprite):void{ var ctrlData:ControlData; var handle:Sprite; var ctrl = _arg1; if (ctrl == null){ return; }; ctrlData = ctrlDataDict[ctrl]; try { if ((((ctrl["stopHandleDrag"] is Function)) && (ctrl["stopHandleDrag"]()))){ ctrlData.isDragging = false; return; }; } catch(re:ReferenceError) { }; handle = ctrlData.handle_mc; if (handle == null){ return; }; handle.stopDrag(); ctrlData.isDragging = false; } public function set skinBackgroundAlpha(_arg1:Number):void{ if (borderAlpha != _arg1){ borderAlpha = _arg1; borderColorTransform.alphaOffset = (0xFF * _arg1); borderPrevRect = null; layoutSkin(); }; } public function getControl(_arg1:int):Sprite{ return (controls[_arg1]); } public function set volumeBarScrubTolerance(_arg1:Number):void{ _volumeBarScrubTolerance = _arg1; } flvplayback_internal function calcBarMargins(_arg1:DisplayObject, _arg2:String, _arg3:Boolean):void{ var ctrlData:ControlData; var bar:DisplayObject; var barData:ControlData; var ctrl = _arg1; var type = _arg2; var symmetricMargins = _arg3; if (ctrl == null){ return; }; ctrlData = ctrlDataDict[ctrl]; bar = ctrlData[(type + "_mc")]; if (bar == null){ try { bar = ctrl[(type + "_mc")]; } catch(re:ReferenceError) { bar = null; }; if (bar == null){ return; }; ctrlData[(type + "_mc")] = bar; }; barData = ctrlDataDict[bar]; if (barData == null){ barData = new ControlData(this, bar, ctrl, -1); ctrlDataDict[bar] = barData; }; barData.leftMargin = getNumberPropSafe(ctrl, (type + "LeftMargin")); if (((isNaN(barData.leftMargin)) && ((bar.parent == ctrl.parent)))){ barData.leftMargin = (bar.x - ctrl.x); }; barData.rightMargin = getNumberPropSafe(ctrl, (type + "RightMargin")); if (isNaN(barData.rightMargin)){ if (symmetricMargins){ barData.rightMargin = barData.leftMargin; } else { if (bar.parent == ctrl.parent){ barData.rightMargin = (((ctrl.width - bar.width) - bar.x) + ctrl.x); }; }; }; barData.topMargin = getNumberPropSafe(ctrl, (type + "TopMargin")); if (((isNaN(barData.topMargin)) && ((bar.parent == ctrl.parent)))){ barData.topMargin = (bar.y - ctrl.y); }; barData.bottomMargin = getNumberPropSafe(ctrl, (type + "BottomMargin")); if (isNaN(barData.bottomMargin)){ if (symmetricMargins){ barData.bottomMargin = barData.topMargin; } else { if (bar.parent == ctrl.parent){ barData.bottomMargin = (((ctrl.height - bar.height) - bar.y) + ctrl.y); }; }; }; barData.origX = getNumberPropSafe(ctrl, (type + "X")); if (isNaN(barData.origX)){ if (bar.parent == ctrl.parent){ barData.origX = (bar.x - ctrl.x); } else { if (bar.parent == ctrl){ barData.origX = bar.x; }; }; }; barData.origY = getNumberPropSafe(ctrl, (type + "Y")); if (isNaN(barData.origY)){ if (bar.parent == ctrl.parent){ barData.origY = (bar.y - ctrl.y); } else { if (bar.parent == ctrl){ barData.origY = bar.y; }; }; }; barData.origWidth = bar.width; barData.origHeight = bar.height; barData.origScaleX = bar.scaleX; barData.origScaleY = bar.scaleY; } public function set skinBackgroundColor(_arg1:uint):void{ if (borderColor != _arg1){ borderColor = _arg1; borderColorTransform.redOffset = ((borderColor >> 16) & 0xFF); borderColorTransform.greenOffset = ((borderColor >> 8) & 0xFF); borderColorTransform.blueOffset = (borderColor & 0xFF); borderPrevRect = null; layoutSkin(); }; } flvplayback_internal function handleLoad(_arg1:Event):void{ var i:int; var dispObj:DisplayObject; var index:Number; var e = _arg1; try { skin_mc = new Sprite(); if (e != null){ skinTemplate = Sprite(skinLoader.content); }; layout_mc = skinTemplate; customClips = new Array(); delayedControls = new Array(); i = 0; while (i < layout_mc.numChildren) { dispObj = layout_mc.getChildAt(i); index = layoutNameToIndexMappings[dispObj.name]; if (!isNaN(index)){ setSkin(int(index), dispObj); } else { if (dispObj.name != "video_mc"){ setCustomClip(dispObj); }; }; i = (i + 1); }; skinLoadDelayCount = 0; _vc.addEventListener(Event.ENTER_FRAME, finishLoad); } catch(err:Error) { _vc.skinError(err.message); removeSkin(); }; } flvplayback_internal function finishAddBufferingBar(_arg1:Event=null):void{ var _local2:Sprite; if (_arg1 != null){ _arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, finishAddBufferingBar); }; _local2 = controls[BUFFERING_BAR]; calcBarMargins(_local2, "fill", true); fixUpBar(_local2, "fill", _local2, "fill_mc"); positionMaskedFill(_local2, 100); } flvplayback_internal function handleButtonEvent(_arg1:MouseEvent):void{ var ctrlData:ControlData; var topLevel:DisplayObject; var e = _arg1; ctrlData = ctrlDataDict[e.currentTarget]; switch (e.type){ case MouseEvent.ROLL_OVER: ctrlData.state = OVER_STATE; break; case MouseEvent.ROLL_OUT: ctrlData.state = NORMAL_STATE; break; case MouseEvent.MOUSE_DOWN: ctrlData.state = DOWN_STATE; mouseCaptureCtrl = ctrlData.index; switch (mouseCaptureCtrl){ case SEEK_BAR_HANDLE: case SEEK_BAR_HIT: case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: dispatchMessage(ctrlData.index); break; }; topLevel = _vc.stage; try { topLevel.addEventListener(MouseEvent.MOUSE_DOWN, captureMouseEvent, true); } catch(se:SecurityError) { topLevel = _vc.root; topLevel.addEventListener(MouseEvent.MOUSE_DOWN, captureMouseEvent, true); }; topLevel.addEventListener(MouseEvent.MOUSE_OUT, captureMouseEvent, true); topLevel.addEventListener(MouseEvent.MOUSE_OVER, captureMouseEvent, true); topLevel.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp); topLevel.addEventListener(MouseEvent.ROLL_OUT, captureMouseEvent, true); topLevel.addEventListener(MouseEvent.ROLL_OVER, captureMouseEvent, true); break; case MouseEvent.CLICK: switch (mouseCaptureCtrl){ case SEEK_BAR_HANDLE: case SEEK_BAR_HIT: case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: break; default: dispatchMessage(ctrlData.index); break; }; return; }; skinButtonControl(e.currentTarget); } flvplayback_internal function applySkinState(_arg1:ControlData, _arg2:DisplayObject):void{ if (_arg2 != _arg1.currentState_mc){ if (_arg1.currentState_mc != null){ _arg1.currentState_mc.visible = false; }; _arg1.currentState_mc = _arg2; _arg1.currentState_mc.visible = true; }; } flvplayback_internal function handleLoadErrorEvent(_arg1:ErrorEvent):void{ _skinReady = true; _vc.skinError(_arg1.toString()); } flvplayback_internal function addBarControl(_arg1:Sprite):void{ var _local2:ControlData; _local2 = ctrlDataDict[_arg1]; _local2.isDragging = false; _local2.percentage = 0; if ((((_arg1.parent == skin_mc)) && (!((skin_mc == null))))){ finishAddBarControl(_arg1); } else { _arg1.addEventListener(Event.REMOVED_FROM_STAGE, cleanupHandle); _arg1.addEventListener(Event.ENTER_FRAME, finishAddBarControl); }; } flvplayback_internal function handleEvent(_arg1:Event):void{ var e = _arg1; switch (e.type){ case Event.ADDED_TO_STAGE: _fullScreen = false; if (_vc.stage != null){ try { _fullScreen = (_vc.stage.displayState == StageDisplayState.FULL_SCREEN); _vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreenEvent); } catch(se:SecurityError) { }; }; setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]); setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]); if (((_fullScreen) && (_fullScreenTakeOver))){ enterFullScreenTakeOver(); } else { if (!_fullScreen){ exitFullScreenTakeOver(); }; }; layoutSkin(); setupSkinAutoHide(false); break; }; } flvplayback_internal function skinButtonControl(_arg1:Object):void{ var ctrl:Sprite; var ctrlData:ControlData; var e:Event; var ctrlOrEvent = _arg1; if (ctrlOrEvent == null){ return; }; if ((ctrlOrEvent is Event)){ e = Event(ctrlOrEvent); ctrl = Sprite(e.currentTarget); ctrl.removeEventListener(Event.ENTER_FRAME, skinButtonControl); } else { ctrl = Sprite(ctrlOrEvent); }; ctrlData = ctrlDataDict[ctrl]; if (ctrlData == null){ return; }; try { if (ctrl["placeholder_mc"] != undefined){ ctrl.removeChild(ctrl["placeholder_mc"]); ctrl["placeholder_mc"] = null; }; } catch(re:ReferenceError) { }; if (ctrlData.state_mc == null){ ctrlData.state_mc = new Array(); }; if (ctrlData.state_mc[NORMAL_STATE] == undefined){ ctrlData.state_mc[NORMAL_STATE] = setupButtonSkinState(ctrl, ctrl, buttonSkinLinkageIDs[NORMAL_STATE], null); }; if (((ctrlData.enabled) && (_controlsEnabled))){ if (ctrlData.state_mc[ctrlData.state] == undefined){ ctrlData.state_mc[ctrlData.state] = setupButtonSkinState(ctrl, ctrl, buttonSkinLinkageIDs[ctrlData.state], ctrlData.state_mc[NORMAL_STATE]); }; if (ctrlData.state_mc[ctrlData.state] != ctrlData.currentState_mc){ if (ctrlData.currentState_mc != null){ ctrlData.currentState_mc.visible = false; }; ctrlData.currentState_mc = ctrlData.state_mc[ctrlData.state]; ctrlData.currentState_mc.visible = true; }; applySkinState(ctrlData, ctrlData.state_mc[ctrlData.state]); } else { ctrlData.state = NORMAL_STATE; if (ctrlData.disabled_mc == null){ ctrlData.disabled_mc = setupButtonSkinState(ctrl, ctrl, "disabledLinkageID", ctrlData.state_mc[NORMAL_STATE]); }; applySkinState(ctrlData, ctrlData.disabled_mc); }; } public function set controlsEnabled(_arg1:Boolean):void{ var _local2:int; if (_controlsEnabled == _arg1){ return; }; _controlsEnabled = _arg1; _local2 = 0; while (_local2 < NUM_BUTTONS) { skinButtonControl(controls[_local2]); _local2++; }; } flvplayback_internal function setupSkinAutoHide(_arg1:Boolean):void{ if (((_skinAutoHide) && (!((skin_mc == null))))){ skinAutoHideHitTest(null, _arg1); _skinAutoHideTimer.start(); } else { if (skin_mc != null){ if (((((((_arg1) && ((_skinFadingMaxTime > 0)))) && (((!(skin_mc.visible)) || ((skin_mc.alpha < 1)))))) && (__visible))){ _skinFadingTimer.stop(); _skinFadeStartTime = getTimer(); _skinFadingIn = true; if (skin_mc.alpha == 1){ skin_mc.alpha = 0; }; _skinFadingTimer.start(); } else { if (_skinFadingMaxTime <= 0){ _skinFadingTimer.stop(); skin_mc.alpha = 1; }; }; skin_mc.visible = __visible; }; _skinAutoHideTimer.stop(); }; } flvplayback_internal function finishAddBarControl(_arg1:Object):void{ var ctrl:Sprite; var ctrlData:ControlData; var e:Event; var ctrlOrEvent = _arg1; if (ctrlOrEvent == null){ return; }; if ((ctrlOrEvent is Event)){ e = Event(ctrlOrEvent); ctrl = Sprite(e.currentTarget); ctrl.removeEventListener(Event.ENTER_FRAME, finishAddBarControl); } else { ctrl = Sprite(ctrlOrEvent); }; ctrlData = ctrlDataDict[ctrl]; try { if ((ctrl["addBarControl"] is Function)){ var _local3 = ctrl; _local3["addBarControl"](); }; } catch(re:ReferenceError) { }; ctrlData.origWidth = ctrl.width; ctrlData.origHeight = ctrl.height; fixUpBar(ctrl, "progress", ctrl, "progress_mc"); calcBarMargins(ctrl, "progress", false); if (ctrlData.progress_mc != null){ fixUpBar(ctrl, "progressBarFill", ctrlData.progress_mc, "fill_mc"); calcBarMargins(ctrlData.progress_mc, "fill", false); calcBarMargins(ctrlData.progress_mc, "mask", false); if (isNaN(_progressPercent)){ _progressPercent = (_vc.isRTMP) ? 100 : 0; }; positionBar(ctrl, "progress", _progressPercent); }; fixUpBar(ctrl, "fullness", ctrl, "fullness_mc"); calcBarMargins(ctrl, "fullness", false); if (ctrlData.fullness_mc != null){ fixUpBar(ctrl, "fullnessBarFill", ctrlData.fullness_mc, "fill_mc"); calcBarMargins(ctrlData.fullness_mc, "fill", false); calcBarMargins(ctrlData.fullness_mc, "mask", false); }; fixUpBar(ctrl, "hit", ctrl, "hit_mc"); fixUpBar(ctrl, "handle", ctrl, "handle_mc"); calcBarMargins(ctrl, "handle", true); switch (ctrlData.index){ case SEEK_BAR: setControl(SEEK_BAR_HANDLE, ctrlData.handle_mc); if (ctrlData.hit_mc != null){ setControl(SEEK_BAR_HIT, ctrlData.hit_mc); }; break; case VOLUME_BAR: setControl(VOLUME_BAR_HANDLE, ctrlData.handle_mc); if (ctrlData.hit_mc != null){ setControl(VOLUME_BAR_HIT, ctrlData.hit_mc); }; break; }; positionHandle(ctrl); } public function get skin():String{ return (_skin); } public function get fullScreenBackgroundColor():uint{ return (_fullScreenBgColor); } flvplayback_internal function startHandleDrag(_arg1:Sprite):void{ var ctrlData:ControlData; var handle:Sprite; var handleData:ControlData; var theY:Number; var theWidth:Number; var bounds:Rectangle; var ctrl = _arg1; if (ctrl == null){ return; }; ctrlData = ctrlDataDict[ctrl]; try { if ((((ctrl["startHandleDrag"] is Function)) && (ctrl["startHandleDrag"]()))){ ctrlData.isDragging = true; return; }; } catch(re:ReferenceError) { }; handle = ctrlData.handle_mc; if (handle == null){ return; }; handleData = ctrlDataDict[handle]; theY = (ctrl.y + handleData.origY); theWidth = (isNaN(ctrlData.origWidth)) ? ctrl.width : ctrlData.origWidth; bounds = new Rectangle((ctrl.x + handleData.leftMargin), theY, (theWidth - handleData.rightMargin), 0); handle.startDrag(false, bounds); ctrlData.isDragging = true; } flvplayback_internal function setupBarSkinPart(_arg1:Sprite, _arg2:DisplayObject, _arg3:Sprite, _arg4:String, _arg5:String, _arg6:Boolean=false):DisplayObject{ var part:DisplayObject; var partAvatar:DisplayObject; var ctrlData:ControlData; var partData:ControlData; var ctrl = _arg1; var avatar = _arg2; var definitionHolder = _arg3; var skinName = _arg4; var partName = _arg5; var required = _arg6; try { part = ctrl[partName]; } catch(re:ReferenceError) { part = null; }; if (part == null){ try { part = createSkin(definitionHolder, skinName); } catch(ve:VideoError) { if (required){ throw (ve); }; }; if (part != null){ skin_mc.addChild(part); part.x = ctrl.x; part.y = ctrl.y; partAvatar = layout_mc.getChildByName((skinName + "_mc")); if (partAvatar != null){ if (partName == "hit_mc"){ ctrlData = ctrlDataDict[ctrl]; partData = new ControlData(this, part, controls[ctrlData.index], -1); partData.avatar = partAvatar; ctrlDataDict[part] = partData; } else { part.x = (part.x + (partAvatar.x - avatar.x)); part.y = (part.y + (partAvatar.y - avatar.y)); part.width = partAvatar.width; part.height = partAvatar.height; }; }; }; }; if (((required) && ((part == null)))){ throw (new VideoError(VideoError.MISSING_SKIN_STYLE, skinName)); }; return (part); } public function get skinBackgroundAlpha():Number{ return (borderAlpha); } public function get volumeBarScrubTolerance():Number{ return (_volumeBarScrubTolerance); } public function get skinBackgroundColor():uint{ return (borderColor); } public function get controlsEnabled():Boolean{ return (_controlsEnabled); } flvplayback_internal function handleIVPEvent(_arg1:IVPEvent):void{ var _local2:uint; var _local3:int; var _local4:VideoEvent; var _local5:Sprite; var _local6:ControlData; var _local7:VideoProgressEvent; var _local8:VideoPlayerState; var _local9:Number; var _local10:Number; var _local11:Number; if (_arg1.vp != _vc.visibleVideoPlayerIndex){ return; }; _local2 = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; switch (_arg1.type){ case VideoEvent.STATE_CHANGE: _local4 = VideoEvent(_arg1); if (_local4.state == VideoState.BUFFERING){ if (!_bufferingOn){ _bufferingDelayTimer.reset(); _bufferingDelayTimer.start(); }; } else { _bufferingDelayTimer.reset(); _bufferingOn = false; }; if (_local4.state == VideoState.LOADING){ _progressPercent = (_vc.getVideoPlayer(_arg1.vp).isRTMP) ? 100 : 0; _local3 = SEEK_BAR; while (_local3 <= VOLUME_BAR) { _local5 = controls[_local3]; if (controls[_local3] == null){ } else { _local6 = ctrlDataDict[_local5]; if (_local6.progress_mc != null){ positionBar(_local5, "progress", _progressPercent); }; }; _local3++; }; }; _local3 = 0; while (_local3 < NUM_CONTROLS) { if (controls[_local3] == undefined){ } else { setEnabledAndVisibleForState(_local3, _local4.state); if (_local3 < NUM_BUTTONS){ skinButtonControl(controls[_local3]); }; }; _local3++; }; break; case VideoEvent.READY: case MetadataEvent.METADATA_RECEIVED: _local3 = 0; while (_local3 < NUM_CONTROLS) { if (controls[_local3] == undefined){ } else { setEnabledAndVisibleForState(_local3, _vc.state); if (_local3 < NUM_BUTTONS){ skinButtonControl(controls[_local3]); }; }; _local3++; }; if (_vc.getVideoPlayer(_arg1.vp).isRTMP){ _progressPercent = 100; _local3 = SEEK_BAR; while (_local3 <= VOLUME_BAR) { _local5 = controls[_local3]; if (_local5 == null){ } else { _local6 = ctrlDataDict[_local5]; if (_local6.progress_mc != null){ positionBar(_local5, "progress", _progressPercent); }; }; _local3++; }; }; break; case VideoEvent.PLAYHEAD_UPDATE: if (((((((!((controls[SEEK_BAR] == undefined))) && (!(_vc.isLive)))) && (!(isNaN(_vc.totalTime))))) && (!((_vc.getVideoPlayer(_vc.visibleVideoPlayerIndex).state == VideoState.SEEKING))))){ _local4 = VideoEvent(_arg1); _local10 = ((_local4.playheadTime / _vc.totalTime) * 100); if (_local10 < 0){ _local10 = 0; } else { if (_local10 > 100){ _local10 = 100; }; }; _local5 = controls[SEEK_BAR]; _local6 = ctrlDataDict[_local5]; _local6.percentage = _local10; positionHandle(_local5); }; break; case VideoProgressEvent.PROGRESS: _local7 = VideoProgressEvent(_arg1); _progressPercent = ((_local7.bytesTotal)<=0) ? 100 : ((_local7.bytesLoaded / _local7.bytesTotal) * 100); _local8 = _vc.videoPlayerStates[_arg1.vp]; _local9 = _local8.minProgressPercent; if (((!(isNaN(_local9))) && ((_local9 > _progressPercent)))){ _progressPercent = _local9; }; if (!isNaN(_vc.totalTime)){ _local11 = ((_vc.playheadTime / _vc.totalTime) * 100); if (_local11 > _progressPercent){ _progressPercent = _local11; _local8.minProgressPercent = _progressPercent; }; }; _local3 = SEEK_BAR; while (_local3 <= VOLUME_BAR) { _local5 = controls[_local3]; if (_local5 == null){ } else { _local6 = ctrlDataDict[_local5]; if (_local6.progress_mc != null){ positionBar(_local5, "progress", _progressPercent); }; }; _local3++; }; break; }; _vc.activeVideoPlayerIndex = _local2; } flvplayback_internal function setupButtonSkinState(_arg1:Sprite, _arg2:Sprite, _arg3:String, _arg4:DisplayObject=null):DisplayObject{ var stateSkin:DisplayObject; var ctrl = _arg1; var definitionHolder = _arg2; var skinName = _arg3; var defaultSkin = _arg4; try { stateSkin = createSkin(definitionHolder, skinName); } catch(ve:VideoError) { if (defaultSkin != null){ stateSkin = null; } else { throw (ve); }; }; if (stateSkin != null){ stateSkin.visible = false; ctrl.addChild(stateSkin); } else { if (defaultSkin != null){ stateSkin = defaultSkin; }; }; return (stateSkin); } flvplayback_internal function layoutSkin():void{ var video_mc:DisplayObject; var i:int; var borderRect:Rectangle; var forceSkinAutoHide:Boolean; var minWidth:Number; var vidWidth:Number; var minHeight:Number; var vidHeight:Number; if (layout_mc == null){ return; }; if (skinLoadDelayCount < 2){ return; }; video_mc = layout_mc["video_mc"]; if (video_mc == null){ throw (new Error("No layout_mc.video_mc")); }; placeholderLeft = video_mc.x; placeholderRight = (video_mc.x + video_mc.width); placeholderTop = video_mc.y; placeholderBottom = (video_mc.y + video_mc.height); videoLeft = (_vc.x - _vc.registrationX); videoRight = (videoLeft + _vc.width); videoTop = (_vc.y - _vc.registrationY); videoBottom = (videoTop + _vc.height); if (((((_fullScreen) && (_fullScreenTakeOver))) && (!((border_mc == null))))){ borderRect = calcLayoutControl(border_mc); forceSkinAutoHide = false; if ((((borderRect.width > 0)) && ((borderRect.height > 0)))){ if (borderRect.x < 0){ placeholderLeft = (placeholderLeft + (videoLeft - borderRect.x)); forceSkinAutoHide = true; }; if ((borderRect.x + borderRect.width) > _vc.registrationWidth){ placeholderRight = (placeholderRight + ((borderRect.x + borderRect.width) - videoRight)); forceSkinAutoHide = true; }; if (borderRect.y < 0){ placeholderTop = (placeholderTop + (videoTop - borderRect.y)); forceSkinAutoHide = true; }; if ((borderRect.y + borderRect.height) > _vc.registrationHeight){ placeholderBottom = (placeholderBottom + ((borderRect.y + borderRect.height) - videoBottom)); forceSkinAutoHide = true; }; if (forceSkinAutoHide){ _skinAutoHide = true; setupSkinAutoHide(true); }; }; }; try { if (!isNaN(layout_mc["minWidth"])){ minWidth = layout_mc["minWidth"]; vidWidth = (videoRight - videoLeft); if ((((minWidth > 0)) && ((minWidth > vidWidth)))){ videoLeft = (videoLeft - ((minWidth - vidWidth) / 2)); videoRight = (minWidth + videoLeft); }; }; } catch(re1:ReferenceError) { }; try { if (!isNaN(layout_mc["minHeight"])){ minHeight = layout_mc["minHeight"]; vidHeight = (videoBottom - videoTop); if ((((minHeight > 0)) && ((minHeight > vidHeight)))){ videoTop = (videoTop - ((minHeight - vidHeight) / 2)); videoBottom = (minHeight + videoTop); }; }; } catch(re2:ReferenceError) { }; i = 0; while (i < customClips.length) { layoutControl(customClips[i]); if (customClips[i] == border_mc){ bitmapCopyBorder(); }; i = (i + 1); }; i = 0; while (i < NUM_CONTROLS) { layoutControl(controls[i]); i = (i + 1); }; } public function set bufferingDelayInterval(_arg1:Number):void{ if (_bufferingDelayTimer.delay == _arg1){ return; }; _bufferingDelayTimer.delay = _arg1; } flvplayback_internal function setEnabledAndVisibleForState(_arg1:int, _arg2:String):void{ var _local3:int; var _local4:String; var _local5:Sprite; var _local6:ControlData; var _local7:Boolean; var _local8:ControlData; var _local9:ControlData; var _local10:ControlData; var _local11:ControlData; _local3 = _vc.activeVideoPlayerIndex; _vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex; _local4 = _arg2; if ((((_local4 == VideoState.BUFFERING)) && (!(_bufferingOn)))){ _local4 = VideoState.PLAYING; }; _local5 = controls[_arg1]; if (_local5 == null){ return; }; _local6 = ctrlDataDict[_local5]; if (_local6 == null){ return; }; switch (_arg1){ case VOLUME_BAR: case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: _local6.enabled = true; break; case FULL_SCREEN_ON_BUTTON: _local6.enabled = !(_fullScreen); if (controls[FULL_SCREEN_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case FULL_SCREEN_OFF_BUTTON: _local6.enabled = _fullScreen; if (controls[FULL_SCREEN_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case MUTE_ON_BUTTON: _local6.enabled = !(_isMuted); if (controls[MUTE_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case MUTE_OFF_BUTTON: _local6.enabled = _isMuted; if (controls[MUTE_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; default: switch (_local4){ case VideoState.LOADING: case VideoState.CONNECTION_ERROR: _local6.enabled = false; break; case VideoState.DISCONNECTED: _local6.enabled = ((!((_vc.source == null))) && (!((_vc.source == "")))); break; case VideoState.SEEKING: break; default: _local6.enabled = true; break; }; break; }; switch (_arg1){ case SEEK_BAR: switch (_local4){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.REWINDING: case VideoState.SEEKING: _local6.enabled = true; break; case VideoState.BUFFERING: _local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined))); break; default: _local6.enabled = false; break; }; if (_local6.enabled){ _local6.enabled = !(isNaN(_vc.totalTime)); }; if (_local6.handle_mc != null){ _local8 = ctrlDataDict[_local6.handle_mc]; _local8.enabled = _local6.enabled; _local6.handle_mc.visible = _local8.enabled; }; if (_local6.hit_mc != null){ _local9 = ctrlDataDict[_local6.hit_mc]; _local9.enabled = _local6.enabled; _local6.hit_mc.visible = _local9.enabled; }; _local7 = ((((((!(_bufferingBarHides)) || (_local6.enabled))) || ((controls[BUFFERING_BAR] == undefined)))) || (!(controls[BUFFERING_BAR].visible))); _local5.visible = _local7; if (_local6.progress_mc != null){ _local6.progress_mc.visible = _local7; _local10 = ctrlDataDict[_local6.progress_mc]; if (_local10.fill_mc != null){ _local10.fill_mc.visible = _local7; }; }; if (_local6.fullness_mc != null){ _local6.fullness_mc.visible = _local7; _local11 = ctrlDataDict[_local6.fullness_mc]; if (_local11.fill_mc != null){ _local11.fill_mc.visible = _local7; }; }; break; case BUFFERING_BAR: switch (_local4){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.REWINDING: case VideoState.SEEKING: _local6.enabled = false; break; default: _local6.enabled = true; break; }; _local5.visible = _local6.enabled; if (_local6.fill_mc != null){ _local6.fill_mc.visible = _local6.enabled; }; break; case PAUSE_BUTTON: switch (_local4){ case VideoState.DISCONNECTED: case VideoState.STOPPED: case VideoState.PAUSED: case VideoState.REWINDING: _local6.enabled = false; break; case VideoState.PLAYING: _local6.enabled = true; break; case VideoState.BUFFERING: _local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined))); break; }; if (controls[PLAY_PAUSE_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case PLAY_BUTTON: switch (_local4){ case VideoState.PLAYING: _local6.enabled = false; break; case VideoState.STOPPED: case VideoState.PAUSED: _local6.enabled = true; break; case VideoState.BUFFERING: _local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined))); break; }; if (controls[PLAY_PAUSE_BUTTON] != undefined){ _local5.visible = !(controls[PAUSE_BUTTON].visible); }; break; case STOP_BUTTON: switch (_local4){ case VideoState.DISCONNECTED: case VideoState.STOPPED: _local6.enabled = false; break; case VideoState.PAUSED: case VideoState.PLAYING: case VideoState.BUFFERING: _local6.enabled = true; break; }; break; case BACK_BUTTON: case FORWARD_BUTTON: switch (_local4){ case VideoState.BUFFERING: _local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined))); break; }; }; _local5.mouseEnabled = _local6.enabled; _vc.activeVideoPlayerIndex = _local3; } flvplayback_internal function cleanupHandle(_arg1:Object):void{ var e:Event; var ctrl:Sprite; var ctrlData:ControlData; var ctrlOrEvent = _arg1; try { if ((ctrlOrEvent is Event)){ e = Event(ctrlOrEvent); }; ctrl = ((e == null)) ? Sprite(ctrlOrEvent) : Sprite(e.currentTarget); ctrlData = ctrlDataDict[ctrl]; if ((((ctrlData == null)) || ((e == null)))){ ctrl.removeEventListener(Event.REMOVED_FROM_STAGE, cleanupHandle, false); if (ctrlData == null){ return; }; }; ctrl.removeEventListener(Event.ENTER_FRAME, finishAddBarControl); if (ctrlData.handle_mc != null){ if (ctrlData.handle_mc.parent != null){ ctrlData.handle_mc.parent.removeChild(ctrlData.handle_mc); }; delete ctrlDataDict[ctrlData.handle_mc]; ctrlData.handle_mc = null; }; if (ctrlData.hit_mc != null){ if (ctrlData.hit_mc.parent != null){ ctrlData.hit_mc.parent.removeChild(ctrlData.hit_mc); }; delete ctrlDataDict[ctrlData.hit_mc]; ctrlData.hit_mc = null; }; } catch(err:Error) { }; } flvplayback_internal function enterFullScreenTakeOver():void{ var fullScreenBG:Sprite; if (((!(_fullScreen)) || (!((cacheStageAlign == null))))){ return; }; _vc.removeEventListener(Event.ADDED_TO_STAGE, handleEvent); try { cacheStageAlign = _vc.stage.align; cacheStageScaleMode = _vc.stage.scaleMode; cacheFLVPlaybackParent = _vc.parent; cacheFLVPlaybackIndex = _vc.parent.getChildIndex(_vc); cacheFLVPlaybackLocation = new Rectangle(_vc.registrationX, _vc.registrationY, _vc.registrationWidth, _vc.registrationHeight); _vc.stage.align = StageAlign.TOP_LEFT; _vc.stage.scaleMode = StageScaleMode.NO_SCALE; if (_vc.stage != _vc.parent){ _vc.stage.addChild(_vc); } else { _vc.stage.setChildIndex(_vc, (_vc.stage.numChildren - 1)); }; _vc.registrationX = 0; _vc.registrationY = 0; _vc.setSize(_vc.stage.stageWidth, _vc.stage.stageHeight); fullScreenBG = Sprite(_vc.getChildByName("fullScreenBG")); if (fullScreenBG == null){ fullScreenBG = new Sprite(); fullScreenBG.name = "fullScreenBG"; _vc.addChildAt(fullScreenBG, 0); } else { _vc.setChildIndex(fullScreenBG, 0); }; fullScreenBG.graphics.beginFill(_fullScreenBgColor); fullScreenBG.graphics.drawRect(0, 0, _vc.stage.stageWidth, _vc.stage.stageHeight); } catch(err:Error) { }; _vc.addEventListener(Event.ADDED_TO_STAGE, handleEvent); } public function set seekBarScrubTolerance(_arg1:Number):void{ _seekBarScrubTolerance = _arg1; } public function set fullScreenTakeOver(_arg1:Boolean):void{ if (_fullScreenTakeOver != _arg1){ _fullScreenTakeOver = _arg1; if (_fullScreenTakeOver){ enterFullScreenTakeOver(); } else { exitFullScreenTakeOver(); }; }; } public function get seekBarScrubTolerance():Number{ return (_seekBarScrubTolerance); } flvplayback_internal static function getBooleanPropSafe(_arg1:Object, _arg2:String):Boolean{ var boolProp:*; var obj = _arg1; var propName = _arg2; try { boolProp = obj[propName]; return (Boolean(boolProp)); } catch(re:ReferenceError) { }; return (false); } flvplayback_internal static function initLayoutNameToIndexMappings():void{ var _local1:int; layoutNameToIndexMappings = new Object(); _local1 = 0; while (_local1 < layoutNameArray.length) { if (layoutNameArray[_local1] != null){ layoutNameToIndexMappings[layoutNameArray[_local1]] = _local1; }; _local1++; }; } flvplayback_internal static function getNumberPropSafe(_arg1:Object, _arg2:String):Number{ var numProp:*; var obj = _arg1; var propName = _arg2; try { numProp = obj[propName]; return (Number(numProp)); } catch(re:ReferenceError) { }; return (NaN); } } }//package fl.video
Section 103
//VideoAlign (fl.video.VideoAlign) package fl.video { public final class VideoAlign { public static const CENTER:String = "center"; public static const LEFT:String = "left"; public static const BOTTOM_RIGHT:String = "bottomRight"; public static const BOTTOM:String = "bottom"; public static const TOP_LEFT:String = "topLeft"; public static const TOP_RIGHT:String = "topRight"; public static const TOP:String = "top"; public static const BOTTOM_LEFT:String = "bottomLeft"; public static const RIGHT:String = "right"; } }//package fl.video
Section 104
//VideoError (fl.video.VideoError) package fl.video { public class VideoError extends Error { private var _code:uint; public static const INVALID_SOURCE:uint = 1004; flvplayback_internal static const ERROR_MSG:Array = ["Unable to make connection to server or to find FLV on server", "No matching cue point found", "Illegal cue point", "Invalid seek", "Invalid source", "Invalid xml", "No bitrate match, must be no default flv", "Cannot delete default VideoPlayer", "VideoPlayer.iNCManagerClass has not been set or its value is invalid", "Null url parameter sent to load()", "Skin is missing a required style definition or its value is invalid", "Unsupported property"]; public static const NULL_URL_LOAD:uint = 1009; public static const INVALID_XML:uint = 1005; flvplayback_internal static const BASE_ERROR_CODE:uint = 1000; public static const DELETE_DEFAULT_PLAYER:uint = 1007; public static const SHORT_VERSION:String = "2.0"; public static const UNSUPPORTED_PROPERTY:uint = 1011; public static const ILLEGAL_CUE_POINT:uint = 1002; public static const INVALID_SEEK:uint = 1003; public static const NO_CONNECTION:uint = 1000; public static const MISSING_SKIN_STYLE:uint = 1010; public static const INCMANAGER_CLASS_UNSET:uint = 1008; public static const NO_BITRATE_MATCH:uint = 1006; public static const VERSION:String = "2.0.0.37"; public function VideoError(_arg1:uint, _arg2:String=null){ super((((("" + _arg1) + ": ") + ERROR_MSG[(_arg1 - BASE_ERROR_CODE)]) + ((_arg2)==null) ? "" : (": " + _arg2))); name = "VideoError"; _code = _arg1; } public function get code():uint{ return (_code); } } }//package fl.video
Section 105
//VideoEvent (fl.video.VideoEvent) package fl.video { import flash.events.*; public class VideoEvent extends Event implements IVPEvent { private var _vp:uint; private var _playheadTime:Number; private var _state:String; public static const FAST_FORWARD:String = "fastForward"; public static const READY:String = "ready"; public static const SKIN_LOADED:String = "skinLoaded"; public static const SCRUB_FINISH:String = "scrubFinish"; public static const BUFFERING_STATE_ENTERED:String = "bufferingStateEntered"; public static const STOPPED_STATE_ENTERED:String = "stoppedStateEntered"; public static const AUTO_REWOUND:String = "autoRewound"; public static const SCRUB_START:String = "scrubStart"; public static const PLAYHEAD_UPDATE:String = "playheadUpdate"; public static const SEEKED:String = "seeked"; public static const PLAYING_STATE_ENTERED:String = "playingStateEntered"; public static const CLOSE:String = "close"; public static const PAUSED_STATE_ENTERED:String = "pausedStateEntered"; public static const COMPLETE:String = "complete"; public static const REWIND:String = "rewind"; public static const STATE_CHANGE:String = "stateChange"; public function VideoEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=null, _arg5:Number=NaN, _arg6:uint=0){ super(_arg1, _arg2, _arg3); _state = _arg4; _playheadTime = _arg5; _vp = _arg6; } public function set playheadTime(_arg1:Number):void{ _playheadTime = _arg1; } public function get playheadTime():Number{ return (_playheadTime); } public function get state():String{ return (_state); } public function get vp():uint{ return (_vp); } override public function clone():Event{ return (new VideoEvent(type, bubbles, cancelable, state, playheadTime, vp)); } public function set state(_arg1:String):void{ _state = _arg1; } public function set vp(_arg1:uint):void{ _vp = _arg1; } } }//package fl.video
Section 106
//VideoPlayer (fl.video.VideoPlayer) package fl.video { import flash.net.*; import flash.events.*; import flash.geom.*; import flash.media.*; import flash.utils.*; public class VideoPlayer extends Video { protected var _align:String; protected var _registrationWidth:Number; flvplayback_internal var _updateProgressTimer:Timer; flvplayback_internal var _atEndCheckPlayhead:Number; flvplayback_internal var _hiddenForResize:Boolean; flvplayback_internal var startProgressTime:Number; protected var _volume:Number; flvplayback_internal var _invalidSeekTime:Boolean; flvplayback_internal var _readyDispatched:Boolean; flvplayback_internal var lastUpdateTimeStuckCount:Number; protected var _ns:NetStream; protected var _isLive:Boolean; flvplayback_internal var _bufferState:String; protected var _streamLength:Number; flvplayback_internal var _rtmpDoSeekTimer:Timer; protected var _contentPath:String; flvplayback_internal var lastUpdateTimeStuckCountMax:int;// = 5 protected var _metadata:Object; protected var __visible:Boolean; flvplayback_internal var autoResizeMetadataDelayMax:Number;// = 5 protected var _scaleMode:String; flvplayback_internal var _lastUpdateTime:Number; flvplayback_internal var _sawPlayStop:Boolean; flvplayback_internal var _atEnd:Boolean; flvplayback_internal var _sawSeekNotify:Boolean; flvplayback_internal var _idleTimeoutTimer:Timer; flvplayback_internal var _prevVideoWidth:int; protected var _registrationX:Number; protected var _registrationY:Number; protected var _bufferTime:Number; flvplayback_internal var _cachedState:String; flvplayback_internal var totalDownloadTime:Number; flvplayback_internal var _cachedPlayheadTime:Number; protected var _autoPlay:Boolean; protected var _autoRewind:Boolean; flvplayback_internal var _invalidSeekRecovery:Boolean; flvplayback_internal var _hiddenRewindPlayheadTime:Number; flvplayback_internal var _prevVideoHeight:int; protected var _ncMgr:INCManager; protected var _soundTransform:SoundTransform; flvplayback_internal var _httpDoSeekCount:Number; flvplayback_internal var oldRegistrationBounds:Rectangle; flvplayback_internal var _cmdQueue:Array; flvplayback_internal var _updateTimeTimer:Timer; flvplayback_internal var httpDoSeekMaxCount:Number;// = 4 flvplayback_internal var _startingPlay:Boolean; flvplayback_internal var baselineProgressTime:Number; flvplayback_internal var _autoResizeTimer:Timer; flvplayback_internal var _autoResizeDone:Boolean; flvplayback_internal var _httpDoSeekTimer:Timer; protected var _state:String; protected var _videoWidth:int; flvplayback_internal var _finishAutoResizeTimer:Timer; flvplayback_internal var _currentPos:Number; flvplayback_internal var oldBounds:Rectangle; protected var _videoHeight:int; flvplayback_internal var waitingForEnough:Boolean; flvplayback_internal var _delayedBufferingTimer:Timer; protected var _registrationHeight:Number; flvplayback_internal var _hiddenForResizeMetadataDelay:Number; flvplayback_internal var autoResizePlayheadTimeout:Number;// = 0.5 flvplayback_internal var _rtmpDoStopAtEndTimer:Timer; flvplayback_internal var totalProgressTime:Number; flvplayback_internal static const DEFAULT_HTTP_DO_SEEK_MAX_COUNT:Number = 4; flvplayback_internal static const FINISH_AUTO_RESIZE_INTERVAL:Number = 250; flvplayback_internal static const DEFAULT_AUTO_RESIZE_PLAYHEAD_TIMEOUT:Number = 0.5; flvplayback_internal static const DEFAULT_AUTO_RESIZE_METADATA_DELAY_MAX:Number = 5; public static const SHORT_VERSION:String = "2.0"; flvplayback_internal static const HTTP_DO_SEEK_INTERVAL:Number = 250; flvplayback_internal static const RTMP_DO_SEEK_INTERVAL:Number = 100; flvplayback_internal static const HTTP_DELAYED_BUFFERING_INTERVAL:Number = 100; public static const DEFAULT_UPDATE_TIME_INTERVAL:Number = 250; flvplayback_internal static const AUTO_RESIZE_INTERVAL:Number = 100; flvplayback_internal static const DEFAULT_LAST_UPDATE_TIME_STUCK_COUNT_MAX:int = 5; flvplayback_internal static const RTMP_DO_STOP_AT_END_INTERVAL:Number = 500; public static const DEFAULT_IDLE_TIMEOUT_INTERVAL:Number = 300000; public static const VERSION:String = "2.0.0.37"; public static const DEFAULT_UPDATE_PROGRESS_INTERVAL:Number = 250; public static var iNCManagerClass:Object = "fl.video.NCManager"; flvplayback_internal static var BUFFER_FLUSH:String = "bufferFlush"; flvplayback_internal static var BUFFER_FULL:String = "bufferFull"; flvplayback_internal static var BUFFER_EMPTY:String = "bufferEmpty"; public function VideoPlayer(_arg1:int=320, _arg2:int=240){ autoResizePlayheadTimeout = DEFAULT_AUTO_RESIZE_PLAYHEAD_TIMEOUT; autoResizeMetadataDelayMax = DEFAULT_AUTO_RESIZE_METADATA_DELAY_MAX; httpDoSeekMaxCount = DEFAULT_HTTP_DO_SEEK_MAX_COUNT; lastUpdateTimeStuckCountMax = DEFAULT_LAST_UPDATE_TIME_STUCK_COUNT_MAX; super(_arg1, _arg2); _registrationX = x; _registrationY = y; _registrationWidth = _arg1; _registrationHeight = _arg2; _state = VideoState.DISCONNECTED; _cachedState = _state; _bufferState = BUFFER_EMPTY; _sawPlayStop = false; _cachedPlayheadTime = 0; _metadata = null; _startingPlay = false; _invalidSeekTime = false; _invalidSeekRecovery = false; _currentPos = 0; _atEnd = false; _streamLength = 0; _cmdQueue = new Array(); _readyDispatched = false; _autoResizeDone = false; _lastUpdateTime = NaN; lastUpdateTimeStuckCount = 0; _sawSeekNotify = false; _hiddenForResize = false; _hiddenForResizeMetadataDelay = 0; _videoWidth = -1; _videoHeight = -1; _prevVideoWidth = 0; _prevVideoHeight = 0; _updateTimeTimer = new Timer(DEFAULT_UPDATE_TIME_INTERVAL); _updateTimeTimer.addEventListener(TimerEvent.TIMER, doUpdateTime); _updateProgressTimer = new Timer(DEFAULT_UPDATE_PROGRESS_INTERVAL); _updateProgressTimer.addEventListener(TimerEvent.TIMER, doUpdateProgress); _idleTimeoutTimer = new Timer(DEFAULT_IDLE_TIMEOUT_INTERVAL, 1); _idleTimeoutTimer.addEventListener(TimerEvent.TIMER, doIdleTimeout); _autoResizeTimer = new Timer(AUTO_RESIZE_INTERVAL); _autoResizeTimer.addEventListener(TimerEvent.TIMER, doAutoResize); _rtmpDoStopAtEndTimer = new Timer(RTMP_DO_STOP_AT_END_INTERVAL); _rtmpDoStopAtEndTimer.addEventListener(TimerEvent.TIMER, rtmpDoStopAtEnd); _rtmpDoSeekTimer = new Timer(RTMP_DO_SEEK_INTERVAL); _rtmpDoSeekTimer.addEventListener(TimerEvent.TIMER, rtmpDoSeek); _httpDoSeekTimer = new Timer(HTTP_DO_SEEK_INTERVAL); _httpDoSeekTimer.addEventListener(TimerEvent.TIMER, httpDoSeek); _httpDoSeekCount = 0; _finishAutoResizeTimer = new Timer(FINISH_AUTO_RESIZE_INTERVAL, 1); _finishAutoResizeTimer.addEventListener(TimerEvent.TIMER, finishAutoResize); _delayedBufferingTimer = new Timer(HTTP_DELAYED_BUFFERING_INTERVAL); _delayedBufferingTimer.addEventListener(TimerEvent.TIMER, doDelayedBuffering); _isLive = false; _align = VideoAlign.CENTER; _scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO; _autoPlay = true; _autoRewind = false; _bufferTime = 0.1; _soundTransform = new SoundTransform(); _volume = _soundTransform.volume; __visible = true; _contentPath = ""; waitingForEnough = false; baselineProgressTime = NaN; startProgressTime = NaN; totalDownloadTime = NaN; totalProgressTime = NaN; } public function get playheadTime():Number{ var _local1:Number; _local1 = ((_ns)==null) ? _currentPos : _ns.time; if (((!((_metadata == null))) && (!((_metadata.audiodelay == undefined))))){ _local1 = (_local1 - _metadata.audiodelay); if (_local1 < 0){ _local1 = 0; }; }; return (_local1); } public function stop():void{ if (!isXnOK()){ if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; return; } else { if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; } else { if (!stateResponsive){ queueCmd(QueuedCommand.STOP); return; }; execQueuedCmds(); }; }; if ((((_state == VideoState.STOPPED)) || ((_ns == null)))){ return; }; if (_ncMgr.isRTMP){ if (((_autoRewind) && (!(_isLive)))){ _currentPos = 0; _play(0, 0); _state = VideoState.STOPPED; setState(VideoState.REWINDING); } else { closeNS(true); setState(VideoState.STOPPED); }; } else { _pause(true); if (_autoRewind){ _seek(0); _state = VideoState.STOPPED; setState(VideoState.REWINDING); } else { setState(VideoState.STOPPED); }; }; } flvplayback_internal function execQueuedCmds():void{ var nextCmd:Object; while ((((((_cmdQueue.length > 0)) && (((((stateResponsive) || ((_state == VideoState.DISCONNECTED)))) || ((_state == VideoState.CONNECTION_ERROR)))))) && (((!((_cmdQueue[0].url == null))) || (((!((_state == VideoState.DISCONNECTED))) && (!((_state == VideoState.CONNECTION_ERROR))))))))) { try { nextCmd = _cmdQueue.shift(); _cachedState = _state; _state = VideoState.EXEC_QUEUED_CMD; switch (nextCmd.type){ case QueuedCommand.PLAY: play(nextCmd.url, nextCmd.time, nextCmd.isLive); break; case QueuedCommand.LOAD: load(nextCmd.url, nextCmd.time, nextCmd.isLive); break; case QueuedCommand.PAUSE: pause(); break; case QueuedCommand.STOP: stop(); break; case QueuedCommand.SEEK: seek(nextCmd.time); break; case QueuedCommand.PLAY_WHEN_ENOUGH: playWhenEnoughDownloaded(); break; }; } finally { if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; }; }; }; } public function setScale(_arg1:Number, _arg2:Number):void{ super.scaleX = _arg1; super.scaleY = _arg2; _registrationWidth = width; _registrationHeight = height; switch (_scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: startAutoResize(); break; default: super.x = _registrationX; super.y = _registrationY; break; }; } public function set playheadTime(_arg1:Number):void{ seek(_arg1); } override public function get videoWidth():int{ if (_readyDispatched){ _videoWidth = super.videoWidth; }; return (_videoWidth); } public function get scaleMode():String{ return (_scaleMode); } public function get progressInterval():Number{ return (_updateProgressTimer.delay); } public function set align(_arg1:String):void{ if (_align != _arg1){ switch (_arg1){ case VideoAlign.CENTER: case VideoAlign.TOP: case VideoAlign.LEFT: case VideoAlign.BOTTOM: case VideoAlign.RIGHT: case VideoAlign.TOP_LEFT: case VideoAlign.TOP_RIGHT: case VideoAlign.BOTTOM_LEFT: case VideoAlign.BOTTOM_RIGHT: break; default: return; }; _align = _arg1; switch (_scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: startAutoResize(); break; }; }; } public function set scaleMode(_arg1:String):void{ if (_scaleMode != _arg1){ switch (_arg1){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: case VideoScaleMode.EXACT_FIT: break; default: return; }; _scaleMode = _arg1; startAutoResize(); }; } public function get source():String{ return (_contentPath); } flvplayback_internal function doUpdateTime(_arg1:TimerEvent=null):void{ var _local2:Number; _local2 = playheadTime; if (_local2 != _atEndCheckPlayhead){ _atEndCheckPlayhead = NaN; }; switch (_state){ case VideoState.STOPPED: case VideoState.PAUSED: case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: _updateTimeTimer.stop(); break; case VideoState.PLAYING: case VideoState.BUFFERING: if (((((((((!((_ncMgr == null))) && (!(_ncMgr.isRTMP)))) && ((_lastUpdateTime == _local2)))) && (!((_ns == null))))) && ((_ns.bytesLoaded == _ns.bytesTotal)))){ if (lastUpdateTimeStuckCount > lastUpdateTimeStuckCountMax){ lastUpdateTimeStuckCount = 0; httpDoStopAtEnd(); } else { lastUpdateTimeStuckCount++; }; }; }; if (_lastUpdateTime != _local2){ dispatchEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE, false, false, _state, _local2)); _lastUpdateTime = _local2; lastUpdateTimeStuckCount = 0; }; } flvplayback_internal function rtmpNetStatus(_arg1:NetStatusEvent):void{ if (_state == VideoState.CONNECTION_ERROR){ return; }; switch (_arg1.info.code){ case "NetStream.Play.Stop": if (_startingPlay){ return; }; switch (_state){ case VideoState.RESIZING: if (_hiddenForResize){ finishAutoResize(); }; break; case VideoState.LOADING: case VideoState.STOPPED: case VideoState.PAUSED: break; default: _sawPlayStop = true; break; }; break; case "NetStream.Buffer.Empty": switch (_bufferState){ case BUFFER_FULL: if (_sawPlayStop){ rtmpDoStopAtEnd(); } else { if (_state == VideoState.PLAYING){ setState(VideoState.BUFFERING); }; }; break; }; _bufferState = BUFFER_EMPTY; _sawPlayStop = false; break; case "NetStream.Buffer.Flush": if (((_sawSeekNotify) && ((_state == VideoState.SEEKING)))){ _bufferState = BUFFER_EMPTY; _sawPlayStop = false; setStateFromCachedState(false); doUpdateTime(); execQueuedCmds(); }; if (((_sawPlayStop) && ((((_bufferState == BUFFER_EMPTY)) || ((((_ns.bufferTime <= 0.1)) && ((_ns.bufferLength <= 0.1)))))))){ _cachedPlayheadTime = playheadTime; _rtmpDoStopAtEndTimer.reset(); _rtmpDoStopAtEndTimer.start(); }; switch (_bufferState){ case BUFFER_EMPTY: if (!_hiddenForResize){ if ((((((_state == VideoState.LOADING)) && ((_cachedState == VideoState.PLAYING)))) || ((_state == VideoState.BUFFERING)))){ setState(VideoState.PLAYING); } else { if (_cachedState == VideoState.BUFFERING){ _cachedState = VideoState.PLAYING; }; }; }; _bufferState = BUFFER_FLUSH; break; default: if (_state == VideoState.BUFFERING){ setStateFromCachedState(); }; break; }; break; case "NetStream.Buffer.Full": if (((_sawSeekNotify) && ((_state == VideoState.SEEKING)))){ _bufferState = BUFFER_EMPTY; _sawPlayStop = false; setStateFromCachedState(false); doUpdateTime(); execQueuedCmds(); }; switch (_bufferState){ case BUFFER_EMPTY: _bufferState = BUFFER_FULL; if (!_hiddenForResize){ if ((((((_state == VideoState.LOADING)) && ((_cachedState == VideoState.PLAYING)))) || ((_state == VideoState.BUFFERING)))){ setState(VideoState.PLAYING); } else { if (_cachedState == VideoState.BUFFERING){ _cachedState = VideoState.PLAYING; }; }; if (_rtmpDoStopAtEndTimer.running){ _sawPlayStop = true; _rtmpDoStopAtEndTimer.reset(); }; }; break; case BUFFER_FLUSH: _bufferState = BUFFER_FULL; if (_rtmpDoStopAtEndTimer.running){ _sawPlayStop = true; _rtmpDoStopAtEndTimer.reset(); }; break; }; if (_state == VideoState.BUFFERING){ setStateFromCachedState(); }; break; case "NetStream.Pause.Notify": if ((((_state == VideoState.RESIZING)) && (_hiddenForResize))){ finishAutoResize(); }; break; case "NetStream.Unpause.Notify": if (_state == VideoState.PAUSED){ _state = VideoState.PLAYING; setState(VideoState.BUFFERING); } else { _cachedState = VideoState.PLAYING; }; break; case "NetStream.Play.Start": _rtmpDoStopAtEndTimer.reset(); _bufferState = BUFFER_EMPTY; _sawPlayStop = false; if (_startingPlay){ _startingPlay = false; _cachedPlayheadTime = playheadTime; } else { if (_state == VideoState.PLAYING){ setState(VideoState.BUFFERING); }; }; break; case "NetStream.Play.Reset": _rtmpDoStopAtEndTimer.reset(); if (_state == VideoState.REWINDING){ _rtmpDoSeekTimer.reset(); if ((((playheadTime == 0)) || ((playheadTime < _cachedPlayheadTime)))){ setStateFromCachedState(); } else { _cachedPlayheadTime = playheadTime; _rtmpDoSeekTimer.start(); }; }; break; case "NetStream.Seek.Notify": if (playheadTime != _cachedPlayheadTime){ setStateFromCachedState(false); doUpdateTime(); execQueuedCmds(); } else { _sawSeekNotify = true; _rtmpDoSeekTimer.start(); }; break; case "Netstream.Play.UnpublishNotify": break; case "Netstream.Play.PublishNotify": break; case "NetStream.Play.StreamNotFound": if (!_ncMgr.connectAgain()){ setState(VideoState.CONNECTION_ERROR); }; break; case "NetStream.Play.Failed": case "NetStream.Failed": setState(VideoState.CONNECTION_ERROR); break; }; } public function set progressInterval(_arg1:Number):void{ _updateProgressTimer.delay = _arg1; } flvplayback_internal function onCuePoint(_arg1:Object):void{ if (((!(_hiddenForResize)) || (((!(isNaN(_hiddenRewindPlayheadTime))) && ((playheadTime < _hiddenRewindPlayheadTime)))))){ dispatchEvent(new MetadataEvent(MetadataEvent.CUE_POINT, false, false, _arg1)); }; } flvplayback_internal function createINCManager():void{ var theClass:Class; theClass = null; try { if ((iNCManagerClass is String)){ theClass = Class(getDefinitionByName(String(iNCManagerClass))); } else { if ((iNCManagerClass is Class)){ theClass = Class(iNCManagerClass); }; }; } catch(e:Error) { theClass = null; }; if (theClass == null){ throw (new VideoError(VideoError.INCMANAGER_CLASS_UNSET, iNCManagerClass.toString())); }; _ncMgr = new (theClass); _ncMgr.videoPlayer = this; } flvplayback_internal function doAutoResize(_arg1:TimerEvent=null):void{ var _local2:Number; var _local3:Number; if (_autoResizeTimer.running){ switch (_state){ case VideoState.RESIZING: case VideoState.LOADING: break; case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: _autoResizeTimer.reset(); return; default: if (!stateResponsive){ return; }; }; if (((((((((!((super.videoWidth == _prevVideoWidth))) || (!((super.videoHeight == _prevVideoHeight))))) || ((_bufferState == BUFFER_FULL)))) || ((_bufferState == BUFFER_FLUSH)))) || ((_ns.time > autoResizePlayheadTimeout)))){ if (((((_hiddenForResize) && ((_metadata == null)))) && ((_hiddenForResizeMetadataDelay < autoResizeMetadataDelayMax)))){ _hiddenForResizeMetadataDelay++; return; }; _videoWidth = super.videoWidth; _videoHeight = super.videoHeight; _autoResizeTimer.reset(); } else { return; }; }; if (_autoResizeDone){ setState(_cachedState); return; }; oldBounds = new Rectangle(x, y, width, height); oldRegistrationBounds = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight); _autoResizeDone = true; switch (_scaleMode){ case VideoScaleMode.NO_SCALE: super.width = _videoWidth; super.height = _videoHeight; break; case VideoScaleMode.EXACT_FIT: super.width = registrationWidth; super.height = registrationHeight; break; case VideoScaleMode.MAINTAIN_ASPECT_RATIO: default: _local2 = ((_videoWidth * _registrationHeight) / _videoHeight); _local3 = ((_videoHeight * _registrationWidth) / _videoWidth); if (_local3 < _registrationHeight){ super.width = _registrationWidth; super.height = _local3; } else { if (_local2 < _registrationWidth){ super.width = _local2; super.height = _registrationHeight; } else { super.width = _registrationWidth; super.height = _registrationHeight; }; }; }; switch (_align){ case VideoAlign.CENTER: case VideoAlign.TOP: case VideoAlign.BOTTOM: default: super.x = (_registrationX + ((_registrationWidth - width) / 2)); break; case VideoAlign.LEFT: case VideoAlign.TOP_LEFT: case VideoAlign.BOTTOM_LEFT: super.x = _registrationX; break; case VideoAlign.RIGHT: case VideoAlign.TOP_RIGHT: case VideoAlign.BOTTOM_RIGHT: super.x = (_registrationX + (_registrationWidth - width)); break; }; switch (_align){ case VideoAlign.CENTER: case VideoAlign.LEFT: case VideoAlign.RIGHT: default: super.y = (_registrationY + ((_registrationHeight - height) / 2)); break; case VideoAlign.TOP: case VideoAlign.TOP_LEFT: case VideoAlign.TOP_RIGHT: super.y = _registrationY; break; case VideoAlign.BOTTOM: case VideoAlign.BOTTOM_LEFT: case VideoAlign.BOTTOM_RIGHT: super.y = (_registrationY + (_registrationHeight - height)); break; }; if (_hiddenForResize){ _hiddenRewindPlayheadTime = playheadTime; if (_state == VideoState.LOADING){ _cachedState = VideoState.PLAYING; }; if (!_ncMgr.isRTMP){ _pause(true); _seek(0); _finishAutoResizeTimer.reset(); _finishAutoResizeTimer.start(); } else { if (!_isLive){ _currentPos = 0; _play(0, 0); setState(VideoState.RESIZING); } else { if (_autoPlay){ _finishAutoResizeTimer.reset(); _finishAutoResizeTimer.start(); } else { finishAutoResize(); }; }; }; } else { dispatchEvent(new AutoLayoutEvent(AutoLayoutEvent.AUTO_LAYOUT, false, false, oldBounds, oldRegistrationBounds)); }; } public function get totalTime():Number{ return (_streamLength); } public function get ncMgr():INCManager{ if (_ncMgr == null){ createINCManager(); }; return (_ncMgr); } public function set volume(_arg1:Number):void{ var _local2:SoundTransform; _local2 = soundTransform; _local2.volume = _arg1; soundTransform = _local2; } flvplayback_internal function _play(_arg1:int=0, _arg2:int=-1):void{ waitingForEnough = false; _rtmpDoStopAtEndTimer.reset(); _startingPlay = true; _ns.play(_ncMgr.streamName, (_isLive) ? -1 : _arg1, _arg2); } flvplayback_internal function finishAutoResize(_arg1:TimerEvent=null):void{ if (stateResponsive){ return; }; _hiddenForResize = false; super.visible = __visible; volume = _volume; dispatchEvent(new AutoLayoutEvent(AutoLayoutEvent.AUTO_LAYOUT, false, false, oldBounds, oldRegistrationBounds)); if (_autoPlay){ if (_ncMgr.isRTMP){ if (!_isLive){ _currentPos = 0; _play(0); }; if (_state == VideoState.RESIZING){ setState(VideoState.LOADING); _cachedState = VideoState.PLAYING; }; } else { waitingForEnough = true; _cachedState = _state; _state = VideoState.PAUSED; checkReadyForPlay(bytesLoaded, bytesTotal); if (waitingForEnough){ _state = _cachedState; setState(VideoState.PAUSED); } else { _cachedState = VideoState.PLAYING; }; }; } else { setState(VideoState.STOPPED); }; } public function set soundTransform(_arg1:SoundTransform):void{ if (_arg1 == null){ return; }; if (_hiddenForResize){ _volume = _arg1.volume; }; _soundTransform = new SoundTransform(); _soundTransform.volume = (_hiddenForResize) ? 0 : _arg1.volume; _soundTransform.leftToLeft = _arg1.leftToLeft; _soundTransform.leftToRight = _arg1.leftToRight; _soundTransform.rightToLeft = _arg1.rightToLeft; _soundTransform.rightToRight = _arg1.rightToRight; if (_ns != null){ _ns.soundTransform = _soundTransform; }; } flvplayback_internal function httpDoSeek(_arg1:TimerEvent):void{ var _local2:Boolean; _local2 = (((_state == VideoState.REWINDING)) || ((_state == VideoState.SEEKING))); if (((((_local2) && ((_httpDoSeekCount < httpDoSeekMaxCount)))) && ((((_cachedPlayheadTime == playheadTime)) || (_invalidSeekTime))))){ _httpDoSeekCount++; return; }; _httpDoSeekCount = 0; _httpDoSeekTimer.reset(); if (!_local2){ return; }; setStateFromCachedState(false); if (_invalidSeekTime){ _invalidSeekTime = false; _invalidSeekRecovery = true; seek(playheadTime); } else { doUpdateTime(); execQueuedCmds(); }; } public function get bytesLoaded():uint{ if ((((_ns == null)) || (_ncMgr.isRTMP))){ return (uint.MIN_VALUE); }; return (_ns.bytesLoaded); } override public function set height(_arg1:Number):void{ super.height = (_registrationHeight = _arg1); switch (_scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: startAutoResize(); break; default: super.height = _arg1; break; }; } flvplayback_internal function httpNetStatus(_arg1:NetStatusEvent):void{ switch (_arg1.info.code){ case "NetStream.Play.Stop": _delayedBufferingTimer.reset(); if (_invalidSeekTime){ _invalidSeekTime = false; _invalidSeekRecovery = true; setState(_cachedState); seek(playheadTime); } else { switch (_state){ case VideoState.PLAYING: case VideoState.BUFFERING: case VideoState.SEEKING: httpDoStopAtEnd(); break; }; }; break; case "NetStream.Seek.InvalidTime": if (_invalidSeekRecovery){ _invalidSeekTime = false; _invalidSeekRecovery = false; setState(_cachedState); seek(0); } else { _invalidSeekTime = true; }; break; case "NetStream.Buffer.Empty": _bufferState = BUFFER_EMPTY; if (_state == VideoState.PLAYING){ _delayedBufferingTimer.reset(); _delayedBufferingTimer.start(); }; break; case "NetStream.Buffer.Full": case "NetStream.Buffer.Flush": _delayedBufferingTimer.reset(); _bufferState = BUFFER_FULL; if (!_hiddenForResize){ if ((((((_state == VideoState.LOADING)) && ((_cachedState == VideoState.PLAYING)))) || ((_state == VideoState.BUFFERING)))){ setState(VideoState.PLAYING); } else { if (_cachedState == VideoState.BUFFERING){ _cachedState = VideoState.PLAYING; }; }; }; break; case "NetStream.Seek.Notify": _invalidSeekRecovery = false; switch (_state){ case VideoState.SEEKING: case VideoState.REWINDING: if (!_httpDoSeekTimer.running){ _httpDoSeekCount = 0; _httpDoSeekTimer.start(); }; break; }; break; case "NetStream.Play.StreamNotFound": setState(VideoState.CONNECTION_ERROR); break; }; } public function get netConnection():NetConnection{ if (_ncMgr != null){ return (_ncMgr.netConnection); }; return (null); } public function set bufferTime(_arg1:Number):void{ _bufferTime = _arg1; if (_ns != null){ _ns.bufferTime = _bufferTime; }; } flvplayback_internal function onMetaData(_arg1:Object):void{ if (_metadata != null){ return; }; _metadata = _arg1; if (isNaN(_streamLength)){ _streamLength = _arg1.duration; }; if (_videoWidth < 0){ _videoWidth = _arg1.width; }; if (_videoHeight < 0){ _videoHeight = _arg1.height; }; dispatchEvent(new MetadataEvent(MetadataEvent.METADATA_RECEIVED, false, false, _arg1)); } flvplayback_internal function queueCmd(_arg1:Number, _arg2:String=null, _arg3:Boolean=false, _arg4:Number=NaN):void{ _cmdQueue.push(new QueuedCommand(_arg1, _arg2, _arg3, _arg4)); } public function set registrationHeight(_arg1:Number):void{ height = _arg1; } override public function get visible():Boolean{ if (!_hiddenForResize){ __visible = super.visible; }; return (__visible); } public function seek(_arg1:Number):void{ if (_invalidSeekTime){ return; }; if (((isNaN(_arg1)) || ((_arg1 < 0)))){ throw (new VideoError(VideoError.INVALID_SEEK)); }; if (!isXnOK()){ if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; flushQueuedCmds(); queueCmd(QueuedCommand.SEEK, null, false, _arg1); setState(VideoState.LOADING); _cachedState = VideoState.LOADING; _ncMgr.reconnect(); return; } else { if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; } else { if (!stateResponsive){ queueCmd(QueuedCommand.SEEK, null, false, _arg1); return; }; execQueuedCmds(); }; }; if (_ns == null){ _createStream(); }; if (((_atEnd) && ((_arg1 < playheadTime)))){ _atEnd = false; }; switch (_state){ case VideoState.PLAYING: _state = VideoState.BUFFERING; case VideoState.BUFFERING: case VideoState.PAUSED: _seek(_arg1); setState(VideoState.SEEKING); break; case VideoState.STOPPED: if (_ncMgr.isRTMP){ _play(0); _pause(true); }; _seek(_arg1); _state = VideoState.PAUSED; setState(VideoState.SEEKING); break; }; } public function get state():String{ return (_state); } public function set autoRewind(_arg1:Boolean):void{ _autoRewind = _arg1; } override public function set scaleX(_arg1:Number):void{ super.scaleX = _arg1; _registrationWidth = width; switch (_scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: startAutoResize(); break; }; } override public function set scaleY(_arg1:Number):void{ super.scaleY = _arg1; _registrationHeight = height; switch (_scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: startAutoResize(); break; }; } public function get registrationWidth():Number{ return (_registrationWidth); } flvplayback_internal function flushQueuedCmds():void{ while (_cmdQueue.length > 0) { _cmdQueue.pop(); }; } public function get registrationX():Number{ return (_registrationX); } flvplayback_internal function _setUpStream():void{ if (((!(isNaN(_ncMgr.streamLength))) && ((_ncMgr.streamLength >= 0)))){ _streamLength = _ncMgr.streamLength; }; _videoWidth = ((_ncMgr.streamWidth)>=0) ? _ncMgr.streamWidth : -1; _videoHeight = ((_ncMgr.streamHeight)>=0) ? _ncMgr.streamHeight : -1; if (!_hiddenForResize){ __visible = super.visible; super.visible = false; _volume = volume; volume = 0; _hiddenForResize = true; }; _hiddenForResizeMetadataDelay = 0; _play(0); if (_currentPos > 0){ _seek(_currentPos); _currentPos = 0; }; _autoResizeTimer.reset(); _autoResizeTimer.start(); } public function get registrationY():Number{ return (_registrationY); } flvplayback_internal function httpDoStopAtEnd():void{ if ((((_atEndCheckPlayhead == playheadTime)) && (!((playheadTime == 0))))){ _atEnd = false; _seek(0); return; }; _atEndCheckPlayhead = NaN; _atEnd = true; if (isNaN(_streamLength)){ _streamLength = _ns.time; }; _pause(true); setState(VideoState.STOPPED); if (_state != VideoState.STOPPED){ return; }; doUpdateTime(); if (_state != VideoState.STOPPED){ return; }; dispatchEvent(new VideoEvent(VideoEvent.COMPLETE, false, false, _state, playheadTime)); if (_state != VideoState.STOPPED){ return; }; if (_autoRewind){ _atEnd = false; _pause(true); _seek(0); setState(VideoState.REWINDING); }; } public function ncConnected():void{ if ((((_ncMgr == null)) || ((_ncMgr.netConnection == null)))){ setState(VideoState.CONNECTION_ERROR); } else { _createStream(); _setUpStream(); }; } override public function set visible(_arg1:Boolean):void{ __visible = _arg1; if (!_hiddenForResize){ super.visible = __visible; }; } public function load(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false):void{ if (_arg1 == null){ throw (new VideoError(VideoError.NULL_URL_LOAD)); }; if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; } else { if (((((!(stateResponsive)) && (!((_state == VideoState.DISCONNECTED))))) && (!((_state == VideoState.CONNECTION_ERROR))))){ queueCmd(QueuedCommand.LOAD, _arg1, _arg3, _arg2); return; }; execQueuedCmds(); }; _autoPlay = false; _load(_arg1, _arg2, _arg3); } override public function set x(_arg1:Number):void{ var _local2:Number; if (this.x != _arg1){ _local2 = (_arg1 - this.x); super.x = _arg1; _registrationX = (_registrationX + _local2); }; } override public function set y(_arg1:Number):void{ var _local2:Number; if (this.y != _arg1){ _local2 = (_arg1 - this.y); super.y = _arg1; _registrationY = (_registrationY + _local2); }; } flvplayback_internal function _pause(_arg1:Boolean):void{ _atEndCheckPlayhead = playheadTime; _rtmpDoStopAtEndTimer.reset(); if (_arg1){ _ns.pause(); } else { _ns.resume(); }; } public function get playheadUpdateInterval():Number{ return (_updateTimeTimer.delay); } flvplayback_internal function doDelayedBuffering(_arg1:TimerEvent):void{ switch (_state){ case VideoState.LOADING: case VideoState.RESIZING: break; case VideoState.PLAYING: _delayedBufferingTimer.reset(); if (((((((((!(isNaN(totalTime))) && ((totalTime > 0)))) && ((bytesLoaded > 0)))) && ((bytesLoaded < uint.MAX_VALUE)))) && ((bytesLoaded < bytesTotal)))){ pause(); if (_state == VideoState.PAUSED){ waitingForEnough = true; playWhenEnoughDownloaded(); }; } else { setState(VideoState.BUFFERING); }; break; default: _delayedBufferingTimer.reset(); break; }; } public function get align():String{ return (_align); } public function set registrationWidth(_arg1:Number):void{ width = _arg1; } public function get stateResponsive():Boolean{ switch (_state){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.BUFFERING: return (true); default: return (false); }; } public function get volume():Number{ return (soundTransform.volume); } public function get soundTransform():SoundTransform{ var _local1:SoundTransform; if (_ns != null){ _soundTransform = _ns.soundTransform; }; _local1 = new SoundTransform(); _local1.volume = (_hiddenForResize) ? _volume : _soundTransform.volume; _local1.leftToLeft = _soundTransform.leftToLeft; _local1.leftToRight = _soundTransform.leftToRight; _local1.rightToLeft = _soundTransform.rightToLeft; _local1.rightToRight = _soundTransform.rightToRight; return (_local1); } public function get bufferTime():Number{ if (_ns != null){ _bufferTime = _ns.bufferTime; }; return (_bufferTime); } public function get metadata():Object{ return (_metadata); } public function play(_arg1:String=null, _arg2:Number=NaN, _arg3:Boolean=false):void{ if (_arg1 != null){ if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; } else { if (((((!(stateResponsive)) && (!((_state == VideoState.DISCONNECTED))))) && (!((_state == VideoState.CONNECTION_ERROR))))){ queueCmd(QueuedCommand.PLAY, _arg1, _arg3, _arg2); return; }; execQueuedCmds(); }; _autoPlay = true; _load(_arg1, _arg2, _arg3); return; }; if (!isXnOK()){ if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; flushQueuedCmds(); queueCmd(QueuedCommand.PLAY); setState(VideoState.LOADING); _cachedState = VideoState.LOADING; _ncMgr.reconnect(); return; } else { if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; } else { if (!stateResponsive){ queueCmd(QueuedCommand.PLAY); return; }; execQueuedCmds(); }; }; if (_ns == null){ _createStream(); }; switch (_state){ case VideoState.BUFFERING: if (_ncMgr.isRTMP){ _play(0); if (_atEnd){ _atEnd = false; _currentPos = 0; setState(VideoState.REWINDING); } else { if (_currentPos > 0){ _seek(_currentPos); _currentPos = 0; }; }; }; case VideoState.PLAYING: return; case VideoState.STOPPED: if (_ncMgr.isRTMP){ if (_isLive){ _play(-1); setState(VideoState.BUFFERING); } else { _play(0); if (_atEnd){ _atEnd = false; _currentPos = 0; _state = VideoState.BUFFERING; setState(VideoState.REWINDING); } else { if (_currentPos > 0){ _seek(_currentPos); _currentPos = 0; setState(VideoState.BUFFERING); } else { setState(VideoState.BUFFERING); }; }; }; } else { _pause(false); if (_atEnd){ _atEnd = false; _seek(0); _state = VideoState.BUFFERING; setState(VideoState.REWINDING); } else { if (_bufferState == BUFFER_EMPTY){ setState(VideoState.BUFFERING); } else { setState(VideoState.PLAYING); }; }; }; break; case VideoState.PAUSED: _pause(false); if (!_ncMgr.isRTMP){ if (_bufferState == BUFFER_EMPTY){ setState(VideoState.BUFFERING); } else { setState(VideoState.PLAYING); }; } else { setState(VideoState.BUFFERING); }; break; }; } public function get isLive():Boolean{ return (_isLive); } flvplayback_internal function setStateFromCachedState(_arg1:Boolean=true):void{ switch (_cachedState){ case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.BUFFERING: setState(_cachedState, _arg1); break; default: setState(VideoState.STOPPED, _arg1); break; }; } public function get idleTimeout():Number{ return (_idleTimeoutTimer.delay); } public function get registrationHeight():Number{ return (_registrationHeight); } public function ncReconnected():void{ if ((((_ncMgr == null)) || ((_ncMgr.netConnection == null)))){ setState(VideoState.CONNECTION_ERROR); } else { _ns = null; _state = VideoState.STOPPED; execQueuedCmds(); }; } flvplayback_internal function startAutoResize():void{ switch (_state){ case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: return; default: _autoResizeDone = false; if (((stateResponsive) && (((((((((!((super.videoWidth == 0))) || (!((super.videoHeight == 0))))) || ((_bufferState == BUFFER_FULL)))) || ((_bufferState == BUFFER_FLUSH)))) || ((_ns.time > autoResizePlayheadTimeout)))))){ doAutoResize(); } else { _autoResizeTimer.reset(); _autoResizeTimer.start(); break; }; }; } flvplayback_internal function setState(_arg1:String, _arg2:Boolean=true):void{ var _local3:String; if (_arg1 == _state){ return; }; _hiddenRewindPlayheadTime = NaN; _cachedState = _state; _cachedPlayheadTime = playheadTime; _state = _arg1; _local3 = _state; dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, _local3, playheadTime)); if (!_readyDispatched){ switch (_local3){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.BUFFERING: _readyDispatched = true; dispatchEvent(new VideoEvent(VideoEvent.READY, false, false, _local3, playheadTime)); break; }; }; switch (_cachedState){ case VideoState.REWINDING: dispatchEvent(new VideoEvent(VideoEvent.AUTO_REWOUND, false, false, _local3, playheadTime)); if (((_ncMgr.isRTMP) && ((_local3 == VideoState.STOPPED)))){ closeNS(); }; break; }; switch (_local3){ case VideoState.STOPPED: case VideoState.PAUSED: if (_ncMgr.isRTMP){ _idleTimeoutTimer.reset(); _idleTimeoutTimer.start(); }; break; case VideoState.SEEKING: case VideoState.REWINDING: _bufferState = BUFFER_EMPTY; _sawPlayStop = false; _idleTimeoutTimer.reset(); break; case VideoState.PLAYING: case VideoState.BUFFERING: _updateTimeTimer.start(); _idleTimeoutTimer.reset(); break; case VideoState.LOADING: case VideoState.RESIZING: _idleTimeoutTimer.reset(); break; }; if (_arg2){ execQueuedCmds(); }; } flvplayback_internal function _seek(_arg1:Number):void{ _rtmpDoStopAtEndTimer.reset(); if (((((!((_metadata == null))) && (!((_metadata.audiodelay == undefined))))) && (((isNaN(_streamLength)) || (((_arg1 + _metadata.audiodelay) < _streamLength)))))){ _arg1 = (_arg1 + _metadata.audiodelay); }; _ns.seek(_arg1); _invalidSeekTime = false; _bufferState = BUFFER_EMPTY; _sawPlayStop = false; _sawSeekNotify = false; } public function get autoRewind():Boolean{ return (_autoRewind); } flvplayback_internal function doIdleTimeout(_arg1:TimerEvent):void{ close(); } public function playWhenEnoughDownloaded():void{ if (((!((_ncMgr == null))) && (_ncMgr.isRTMP))){ play(); return; }; if (!isXnOK()){ throw (new VideoError(VideoError.NO_CONNECTION)); }; if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; } else { if (!stateResponsive){ queueCmd(QueuedCommand.PLAY_WHEN_ENOUGH); return; }; execQueuedCmds(); }; waitingForEnough = true; checkReadyForPlay(bytesLoaded, bytesTotal); } flvplayback_internal function rtmpDoSeek(_arg1:TimerEvent):void{ if (((!((_state == VideoState.REWINDING))) && (!((_state == VideoState.SEEKING))))){ _rtmpDoSeekTimer.reset(); _sawSeekNotify = false; } else { if (playheadTime != _cachedPlayheadTime){ _rtmpDoSeekTimer.reset(); _sawSeekNotify = false; setStateFromCachedState(false); doUpdateTime(); execQueuedCmds(); }; }; } public function get netStream():NetStream{ return (_ns); } override public function get videoHeight():int{ if (_readyDispatched){ _videoHeight = super.videoHeight; }; return (_videoHeight); } public function set registrationX(_arg1:Number):void{ var _local2:Number; if (_registrationX != _arg1){ _local2 = (_arg1 - _registrationX); _registrationX = _arg1; this.x = (this.x + _local2); }; } public function set registrationY(_arg1:Number):void{ var _local2:Number; if (_registrationY != _arg1){ _local2 = (_arg1 - _registrationY); _registrationY = _arg1; this.y = (this.y + _local2); }; } flvplayback_internal function doUpdateProgress(_arg1:TimerEvent):void{ var _local2:uint; var _local3:uint; if (_ns == null){ return; }; _local2 = _ns.bytesLoaded; _local3 = _ns.bytesTotal; if (_local3 < uint.MAX_VALUE){ dispatchEvent(new VideoProgressEvent(VideoProgressEvent.PROGRESS, false, false, _local2, _local3)); }; if ((((((_state == VideoState.DISCONNECTED)) || ((_state == VideoState.CONNECTION_ERROR)))) || ((_local2 >= _local3)))){ _updateProgressTimer.stop(); }; checkEnoughDownloaded(_local2, _local3); } override public function set width(_arg1:Number):void{ super.width = (_registrationWidth = _arg1); switch (_scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: startAutoResize(); break; default: super.width = _arg1; break; }; } public function get isRTMP():Boolean{ if (_ncMgr == null){ return (false); }; return (_ncMgr.isRTMP); } public function get bytesTotal():uint{ if ((((_ns == null)) || (_ncMgr.isRTMP))){ return (uint.MAX_VALUE); }; return (_ns.bytesTotal); } public function setSize(_arg1:Number, _arg2:Number):void{ super.width = (_registrationWidth = _arg1); super.height = (_registrationHeight = _arg2); switch (_scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: startAutoResize(); break; default: super.x = _registrationX; super.y = _registrationY; break; }; } flvplayback_internal function isXnOK():Boolean{ if (_state == VideoState.LOADING){ return (true); }; if (_state == VideoState.CONNECTION_ERROR){ return (false); }; if (_state != VideoState.DISCONNECTED){ if ((((((_ncMgr == null)) || ((_ncMgr.netConnection == null)))) || (!(_ncMgr.netConnection.connected)))){ setState(VideoState.DISCONNECTED); return (false); }; return (true); }; return (false); } flvplayback_internal function _createStream():void{ var _local1:NetStream; _ns = null; _local1 = new NetStream(_ncMgr.netConnection); if (_ncMgr.isRTMP){ _local1.addEventListener(NetStatusEvent.NET_STATUS, rtmpNetStatus); } else { _local1.addEventListener(NetStatusEvent.NET_STATUS, httpNetStatus); }; _local1.client = new VideoPlayerClient(this); _local1.bufferTime = _bufferTime; _local1.soundTransform = soundTransform; _ns = _local1; attachNetStream(_ns); } flvplayback_internal function checkReadyForPlay(_arg1:uint, _arg2:uint):void{ var _local3:Number; if (_arg1 >= _arg2){ waitingForEnough = false; _cachedState = _state; _state = VideoState.EXEC_QUEUED_CMD; play(); execQueuedCmds(); return; }; if (isNaN(baselineProgressTime)){ return; }; if (((isNaN(totalTime)) || ((totalTime < 0)))){ waitingForEnough = false; _cachedState = _state; _state = VideoState.EXEC_QUEUED_CMD; play(); execQueuedCmds(); } else { if (totalDownloadTime > 1.5){ _local3 = ((totalProgressTime - baselineProgressTime) / totalDownloadTime); if ((totalTime - playheadTime) > ((totalTime - totalProgressTime) / _local3)){ waitingForEnough = false; _cachedState = _state; _state = VideoState.EXEC_QUEUED_CMD; play(); execQueuedCmds(); }; }; }; } flvplayback_internal function closeNS(_arg1:Boolean=false):void{ if (_ns != null){ if (_arg1){ _updateTimeTimer.reset(); doUpdateTime(); _currentPos = _ns.time; }; _ns.removeEventListener(NetStatusEvent.NET_STATUS, rtmpNetStatus); _ns.removeEventListener(NetStatusEvent.NET_STATUS, httpNetStatus); _ns.close(); _ns = null; }; } flvplayback_internal function _load(_arg1:String, _arg2:Number, _arg3:Boolean):void{ var _local4:Boolean; _prevVideoWidth = super.videoWidth; _prevVideoHeight = super.videoHeight; _autoResizeDone = false; _cachedPlayheadTime = 0; _bufferState = BUFFER_EMPTY; _sawPlayStop = false; _metadata = null; _startingPlay = false; _invalidSeekTime = false; _invalidSeekRecovery = false; _isLive = _arg3; _contentPath = _arg1; _currentPos = 0; _streamLength = (((isNaN(_arg2)) || ((_arg2 <= 0)))) ? NaN : _arg2; _atEnd = false; _readyDispatched = false; _lastUpdateTime = NaN; lastUpdateTimeStuckCount = 0; _sawSeekNotify = false; waitingForEnough = false; baselineProgressTime = NaN; startProgressTime = NaN; totalDownloadTime = NaN; totalProgressTime = NaN; _updateTimeTimer.reset(); _updateProgressTimer.reset(); _idleTimeoutTimer.reset(); _autoResizeTimer.reset(); _rtmpDoStopAtEndTimer.reset(); _rtmpDoSeekTimer.reset(); _httpDoSeekTimer.reset(); _finishAutoResizeTimer.reset(); _delayedBufferingTimer.reset(); closeNS(false); if (_ncMgr == null){ createINCManager(); }; _local4 = _ncMgr.connectToURL(_contentPath); setState(VideoState.LOADING); _cachedState = VideoState.LOADING; if (_local4){ _createStream(); _setUpStream(); }; if (!_ncMgr.isRTMP){ _updateProgressTimer.start(); }; } flvplayback_internal function rtmpDoStopAtEnd(_arg1:TimerEvent=null):void{ if (_rtmpDoStopAtEndTimer.running){ switch (_state){ case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: _rtmpDoStopAtEndTimer.reset(); return; }; if ((((_arg1 == null)) || ((_cachedPlayheadTime == playheadTime)))){ _rtmpDoStopAtEndTimer.reset(); } else { _cachedPlayheadTime = playheadTime; return; }; }; if ((((((_atEndCheckPlayhead == playheadTime)) && (!(_isLive)))) && (!((playheadTime == 0))))){ _atEnd = false; _currentPos = 0; _play(0); return; }; _atEndCheckPlayhead = NaN; _bufferState = BUFFER_EMPTY; _sawPlayStop = false; _atEnd = true; setState(VideoState.STOPPED); if (_state != VideoState.STOPPED){ return; }; doUpdateTime(); if (_state != VideoState.STOPPED){ return; }; dispatchEvent(new VideoEvent(VideoEvent.COMPLETE, false, false, _state, playheadTime)); if (_state != VideoState.STOPPED){ return; }; if (((((_autoRewind) && (!(_isLive)))) && (!((playheadTime == 0))))){ _atEnd = false; _currentPos = 0; _play(0, 0); setState(VideoState.REWINDING); } else { closeNS(); }; } public function set idleTimeout(_arg1:Number):void{ _idleTimeoutTimer.delay = _arg1; } public function set playheadUpdateInterval(_arg1:Number):void{ _updateTimeTimer.delay = _arg1; } flvplayback_internal function checkEnoughDownloaded(_arg1:uint, _arg2:uint):void{ if ((((_arg1 == 0)) || ((_arg2 == uint.MAX_VALUE)))){ return; }; if (((isNaN(totalTime)) || ((totalTime <= 0)))){ if (((waitingForEnough) && (stateResponsive))){ waitingForEnough = false; _cachedState = _state; _state = VideoState.EXEC_QUEUED_CMD; play(); execQueuedCmds(); }; return; }; if (_arg1 >= _arg2){ if (waitingForEnough){ waitingForEnough = false; _cachedState = _state; _state = VideoState.EXEC_QUEUED_CMD; play(); execQueuedCmds(); }; return; }; if (isNaN(baselineProgressTime)){ baselineProgressTime = ((_arg1 / _arg2) * totalTime); }; if (isNaN(startProgressTime)){ startProgressTime = getTimer(); } else { totalDownloadTime = ((getTimer() - startProgressTime) / 1000); totalProgressTime = ((_arg1 / _arg2) * totalTime); if (waitingForEnough){ checkReadyForPlay(_arg1, _arg2); }; }; } public function close():void{ closeNS(true); if (((!((_ncMgr == null))) && (_ncMgr.isRTMP))){ _ncMgr.close(); }; setState(VideoState.DISCONNECTED); dispatchEvent(new VideoEvent(VideoEvent.CLOSE, false, false, _state, playheadTime)); } public function pause():void{ if (!isXnOK()){ if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; return; } else { if (_state == VideoState.EXEC_QUEUED_CMD){ _state = _cachedState; } else { if (!stateResponsive){ queueCmd(QueuedCommand.PAUSE); return; }; execQueuedCmds(); }; }; if ((((((_state == VideoState.PAUSED)) || ((_state == VideoState.STOPPED)))) || ((_ns == null)))){ return; }; _pause(true); setState(VideoState.PAUSED); } } }//package fl.video
Section 107
//VideoPlayerClient (fl.video.VideoPlayerClient) package fl.video { public dynamic class VideoPlayerClient { private var _owner:VideoPlayer; public function VideoPlayerClient(_arg1:VideoPlayer){ _owner = _arg1; } public function get owner():VideoPlayer{ return (_owner); } public function onCuePoint(_arg1:Object, ... _args):void{ _owner.onCuePoint(_arg1); } public function onMetaData(_arg1:Object, ... _args):void{ _owner.onMetaData(_arg1); } } }//package fl.video
Section 108
//VideoPlayerState (fl.video.VideoPlayerState) package fl.video { public class VideoPlayerState { public var autoPlay:Boolean; public var isWaiting:Boolean; public var isLiveSet:Boolean; public var index:int; public var prevState:String; public var preSeekTime:Number; public var minProgressPercent:Number; public var url:String; public var totalTime:Number; public var owner:VideoPlayer; public var isLive:Boolean; public var cmdQueue:Array; public var totalTimeSet:Boolean; public function VideoPlayerState(_arg1:VideoPlayer, _arg2:int){ this.owner = _arg1; this.index = _arg2; this.url = ""; this.isLive = false; this.isLiveSet = true; this.totalTime = NaN; this.totalTimeSet = true; this.autoPlay = (_arg2 == 0); this.isWaiting = false; this.preSeekTime = NaN; this.cmdQueue = null; } } }//package fl.video
Section 109
//VideoProgressEvent (fl.video.VideoProgressEvent) package fl.video { import flash.events.*; public class VideoProgressEvent extends ProgressEvent implements IVPEvent { private var _vp:uint; public static const PROGRESS:String = "progress"; public function VideoProgressEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:uint=0){ super(_arg1, _arg2, _arg3, _arg4, _arg5); _vp = _arg6; } override public function clone():Event{ return (new VideoProgressEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, vp)); } public function set vp(_arg1:uint):void{ _vp = _arg1; } public function get vp():uint{ return (_vp); } } }//package fl.video
Section 110
//VideoScaleMode (fl.video.VideoScaleMode) package fl.video { public final class VideoScaleMode { public static const EXACT_FIT:String = "exactFit"; public static const MAINTAIN_ASPECT_RATIO:String = "maintainAspectRatio"; public static const NO_SCALE:String = "noScale"; } }//package fl.video
Section 111
//VideoState (fl.video.VideoState) package fl.video { public final class VideoState { public static const CONNECTION_ERROR:String = "connectionError"; public static const BUFFERING:String = "buffering"; public static const SEEKING:String = "seeking"; public static const STOPPED:String = "stopped"; public static const PAUSED:String = "paused"; public static const RESIZING:String = "resizing"; public static const PLAYING:String = "playing"; public static const DISCONNECTED:String = "disconnected"; public static const LOADING:String = "loading"; public static const REWINDING:String = "rewinding"; flvplayback_internal static var EXEC_QUEUED_CMD:String = "execQueuedCmd"; } }//package fl.video
Section 112
//AirPowerUp (AirPowerUp) package { import flash.media.*; public dynamic class AirPowerUp extends Sound { } }//package
Section 113
//App (App) package { import flash.events.*; import flash.display.*; import com.rawkins.games.dolphinOlympics.*; import com.rawkins.fx.*; public dynamic class App extends SimpleGame { public var helpScreen:MovieClip; protected var anim:Anim; private var practiceState:Freeswim; private var level:Level; public var player:Player; public function App():void{ level = new Level(); player = new Player(); player.x = 320; player.y = 240; level.buildLevel(); level.addChild(player); level.y = 0; level.pause(); helpScreen = new HelpScreen(); helpScreen.x = (helpScreen.x + 50); helpScreen.y = (helpScreen.y + 50); anim = new Anim(); super(); } override public function initGame(_arg1:Event=null):void{ super.mainState = new Freestyle(this, level); practiceState = new Freeswim(this, level); super.introState = new TitleScreen(this); super.gameState.changeState(introState); } override public function endGame(_arg1:Event=null):void{ super.endGame(); } public function practiceGame(_arg1:Event=null):void{ super.gameState.changeState(practiceState); } public function showHelp(_arg1:Event=null):void{ helpScreen.alpha = 0; addChild(helpScreen); anim.fade("in", helpScreen, 20); } } }//package
Section 114
//Arrow (Arrow) package { import flash.display.*; public dynamic class Arrow extends MovieClip { } }//package
Section 115
//BackButton (BackButton) package { import flash.display.*; public dynamic class BackButton extends SimpleButton { } }//package
Section 116
//Ball (Ball) package { import flash.display.*; public dynamic class Ball extends MovieClip { } }//package
Section 117
//CellRenderer_disabledSkin (CellRenderer_disabledSkin) package { import flash.display.*; public dynamic class CellRenderer_disabledSkin extends MovieClip { } }//package
Section 118
//CellRenderer_downSkin (CellRenderer_downSkin) package { import flash.display.*; public dynamic class CellRenderer_downSkin extends MovieClip { } }//package
Section 119
//CellRenderer_overSkin (CellRenderer_overSkin) package { import flash.display.*; public dynamic class CellRenderer_overSkin extends MovieClip { } }//package
Section 120
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip { } }//package
Section 121
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedDownSkin extends MovieClip { } }//package
Section 122
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedOverSkin extends MovieClip { } }//package
Section 123
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedUpSkin extends MovieClip { } }//package
Section 124
//CellRenderer_upSkin (CellRenderer_upSkin) package { import flash.display.*; public dynamic class CellRenderer_upSkin extends MovieClip { } }//package
Section 125
//Cloud1 (Cloud1) package { import flash.display.*; public dynamic class Cloud1 extends MovieClip { } }//package
Section 126
//Cloud2 (Cloud2) package { import flash.display.*; public dynamic class Cloud2 extends MovieClip { } }//package
Section 127
//Cloud3 (Cloud3) package { import flash.display.*; public dynamic class Cloud3 extends MovieClip { } }//package
Section 128
//ComboBox_disabledSkin (ComboBox_disabledSkin) package { import flash.display.*; public dynamic class ComboBox_disabledSkin extends MovieClip { } }//package
Section 129
//ComboBox_downSkin (ComboBox_downSkin) package { import flash.display.*; public dynamic class ComboBox_downSkin extends MovieClip { } }//package
Section 130
//ComboBox_overSkin (ComboBox_overSkin) package { import flash.display.*; public dynamic class ComboBox_overSkin extends MovieClip { } }//package
Section 131
//ComboBox_upSkin (ComboBox_upSkin) package { import flash.display.*; public dynamic class ComboBox_upSkin extends MovieClip { } }//package
Section 132
//ComboExtended (ComboExtended) package { import flash.display.*; public dynamic class ComboExtended extends MovieClip { } }//package
Section 133
//Diner (Diner) package { import flash.display.*; public dynamic class Diner extends Sprite { } }//package
Section 134
//DolphinChirp1 (DolphinChirp1) package { import flash.media.*; public dynamic class DolphinChirp1 extends Sound { } }//package
Section 135
//EndButton (EndButton) package { import flash.display.*; public dynamic class EndButton extends SimpleButton { } }//package
Section 136
//EntryPowerUp (EntryPowerUp) package { import flash.media.*; public dynamic class EntryPowerUp extends Sound { } }//package
Section 137
//EveningSky (EveningSky) package { import flash.display.*; public dynamic class EveningSky extends MovieClip { } }//package
Section 138
//Explosion (Explosion) package { import flash.media.*; public dynamic class Explosion extends Sound { } }//package
Section 139
//FireworkSound (FireworkSound) package { import flash.media.*; public dynamic class FireworkSound extends Sound { } }//package
Section 140
//FishHit (FishHit) package { import flash.media.*; public dynamic class FishHit extends Sound { } }//package
Section 141
//Floor1 (Floor1) package { import flash.display.*; public dynamic class Floor1 extends Sprite { } }//package
Section 142
//Floor2 (Floor2) package { import flash.display.*; public dynamic class Floor2 extends Sprite { } }//package
Section 143
//Floor3 (Floor3) package { import flash.display.*; public dynamic class Floor3 extends Sprite { } }//package
Section 144
//Floor4 (Floor4) package { import flash.display.*; public dynamic class Floor4 extends MovieClip { } }//package
Section 145
//Floor5 (Floor5) package { import flash.display.*; public dynamic class Floor5 extends MovieClip { } }//package
Section 146
//Floor6 (Floor6) package { import flash.display.*; public dynamic class Floor6 extends MovieClip { } }//package
Section 147
//FloorBase (FloorBase) package { import flash.display.*; public dynamic class FloorBase extends MovieClip { } }//package
Section 148
//focusRectSkin (focusRectSkin) package { import flash.display.*; public dynamic class focusRectSkin extends MovieClip { } }//package
Section 149
//FPSCounter (FPSCounter) package { import flash.display.*; import flash.text.*; public dynamic class FPSCounter extends MovieClip { public var bar:MovieClip; public var lowestValue:TextField; public var fps:TextField; } }//package
Section 150
//FreestyleUI (FreestyleUI) package { import flash.display.*; public dynamic class FreestyleUI extends MovieClip { } }//package
Section 151
//FreestyleUI_labels (FreestyleUI_labels) package { import flash.display.*; public dynamic class FreestyleUI_labels extends MovieClip { } }//package
Section 152
//FreestyleUI_text (FreestyleUI_text) package { import flash.display.*; import flash.text.*; public dynamic class FreestyleUI_text extends MovieClip { public var time_txt:TextField; public var score_txt:TextField; public var liveScore_txt:TextField; } }//package
Section 153
//FreeswimButton (FreeswimButton) package { import flash.display.*; public dynamic class FreeswimButton extends SimpleButton { } }//package
Section 154
//FullReef1 (FullReef1) package { import flash.display.*; public dynamic class FullReef1 extends Sprite { } }//package
Section 155
//FullReef2 (FullReef2) package { import flash.display.*; public dynamic class FullReef2 extends Sprite { } }//package
Section 156
//HelpButton (HelpButton) package { import flash.display.*; public dynamic class HelpButton extends SimpleButton { } }//package
Section 157
//HelpScreen (HelpScreen) package { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.filters.*; import flash.system.*; import flash.ui.*; import flash.accessibility.*; import flash.errors.*; public dynamic class HelpScreen extends MovieClip { public var next_btn:SimpleButton; public var nextPage; public var prev_btn:SimpleButton; public var prevPage; public var close_btn:SimpleButton; public var currentPage; public function HelpScreen(){ addFrameScript(0, frame1, 5, frame6, 10, frame11, 15, frame16); } public function onKey(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ESCAPE){ onClose(_arg1); }; } function frame16(){ stop(); next_btn.visible = false; currentPage = "page4"; prevPage = "page3"; } function frame1(){ stop(); currentPage = "page1"; nextPage = "page2"; prevPage = "page1"; next_btn.addEventListener(MouseEvent.CLICK, onNext); prev_btn.addEventListener(MouseEvent.CLICK, onPrev); prev_btn.visible = false; next_btn.visible = true; close_btn.addEventListener(MouseEvent.CLICK, onClose); addEventListener(KeyboardEvent.KEY_DOWN, onKey); } function frame6(){ stop(); currentPage = "page2"; nextPage = "page3"; prevPage = "page1"; prev_btn.visible = true; next_btn.visible = true; } public function onClose(_arg1:Event):void{ if (parent != null){ parent.removeChild(this); }; } public function onNext(_arg1:Event):void{ gotoAndStop(nextPage); } function frame11(){ stop(); currentPage = "page3"; prevPage = "page2"; prev_btn.visible = true; next_btn.visible = false; } public function onPrev(_arg1:Event):void{ gotoAndStop(prevPage); } } }//package
Section 158
//HighJump_UI_labels (HighJump_UI_labels) package { import flash.display.*; public dynamic class HighJump_UI_labels extends MovieClip { } }//package
Section 159
//HighJump_UI_text (HighJump_UI_text) package { import flash.display.*; import flash.text.*; public dynamic class HighJump_UI_text extends MovieClip { public var time_txt:TextField; public var height_txt:TextField; public var liveScore_txt:TextField; } }//package
Section 160
//hitzone (hitzone) package { import flash.display.*; public dynamic class hitzone extends MovieClip { } }//package
Section 161
//Impact (Impact) package { import flash.media.*; public dynamic class Impact extends Sound { } }//package
Section 162
//Jupiter (Jupiter) package { import flash.display.*; public dynamic class Jupiter extends Sprite { } }//package
Section 163
//List_skin (List_skin) package { import flash.display.*; public dynamic class List_skin extends MovieClip { } }//package
Section 164
//Mars (Mars) package { import flash.display.*; public dynamic class Mars extends Sprite { } }//package
Section 165
//MenuButton (MenuButton) package { import flash.display.*; public dynamic class MenuButton extends SimpleButton { } }//package
Section 166
//MochiAd (MochiAd) package { import flash.net.*; import flash.events.*; import flash.display.*; import flash.utils.*; import flash.system.*; public class MochiAd { public static function getVersion():String{ return ("1.5"); } public static function showTimedAd(_arg1:Object):void{ var DEFAULTS:Object; var clip:Object; var ad_msec:Number; var ad_timeout:Number; var fadeout_time:Number; var mc:MovieClip; var wh:Array; var w:Number; var h:Number; var chk:MovieClip; var options = _arg1; DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{ this.clip.stop(); }, ad_finished:function ():void{ this.clip.play(); }}; options = _slot1._parseOptions(options, DEFAULTS); clip = options.clip; ad_msec = 11000; ad_timeout = options.ad_timeout; delete options.ad_timeout; fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!_slot1.load(options)){ options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ options.ad_finished(); }; wh = _slot1._getRes(options, clip); w = wh[0]; h = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local1:Number; var _local2:MovieClip; _local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { _local2 = this.parent.parent; _slot1.unload(_local2); delete this["onEnterFrame"]; }; }; mc.unloadAd = function ():void{ _slot1.unload(clip); }; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object; _local2 = mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = (_arg1 - 250); }; chk["onEnterFrame"] = function ():void{ var _local1:Object; var _local2:Number; var _local3:Boolean; var _local4:Number; _local1 = this.parent._mochiad_ctr; _local2 = (getTimer() - this.started); _local3 = false; if (!chk.showing){ _local4 = _local1.loaderInfo.bytesTotal; if ((((_local4 > 0)) || (("number" == "undefined")))){ chk.showing = true; chk.started = getTimer(); } else { if (_local2 > chk.ad_timeout){ _local3 = true; }; }; }; if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){ _local3 = true; }; if (_local3){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function _allowDomains(_arg1:String):String{ var _local2:String; _local2 = _arg1.split("/")[2].split(":")[0]; Security.allowDomain("*"); Security.allowDomain(_local2); Security.allowInsecureDomain("*"); Security.allowInsecureDomain(_local2); return (_local2); } public static function unload(_arg1:Object):Boolean{ if (((_arg1.clip) && (_arg1.clip._mochiad))){ _arg1 = _arg1.clip; }; if (!_arg1._mochiad){ return (false); }; if (_arg1._mochiad.onUnload){ _arg1._mochiad.onUnload(); }; _arg1.removeChild(_arg1._mochiad); delete _arg1._mochiad_loaded; delete _arg1._mochiad; return (true); } public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{ var _local4:MovieClip; _local4 = _slot1._loadCommunicator({clip:_arg1.clip, id:_arg1.id}); if (!_local4){ return (false); }; _local4.doSend(["sendHighScore", _arg1], _arg2, _arg3); return (true); } public static function _parseOptions(_arg1:Object, _arg2:Object):Object{ var _local3:Object; var _local4:String; var _local5:Array; var _local6:Number; var _local7:Array; _local3 = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; if (_arg1){ for (_local4 in _arg1) { _local3[_local4] = _arg1[_local4]; }; }; _arg1 = _local3.clip.loaderInfo.parameters.mochiad_options; if (_arg1){ _local5 = _arg1.split("&"); _local6 = 0; while (_local6 < _local5.length) { _local7 = _local5[_local6].split("="); _local3[unescape(_local7[0])] = unescape(_local7[1]); _local6++; }; }; return (_local3); } public static function _isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function load(_arg1:Object):MovieClip{ var DEFAULTS:Object; var clip:Object; var depth:Number; var mc:MovieClip; var wh:Array; var lv:URLVariables; var k:String; var server:String; var hostname:String; var lc:LocalConnection; var name:String; var loader:Loader; var f:Function; var req:URLRequest; var v:Object; var options = _arg1; DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"}; options = _slot1._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = _slot1.getVersion(); clip = options.clip; if (!_slot1._isNetworkAvailable()){ return (null); }; if (clip._mochiad_loaded){ return (null); }; depth = options.depth; delete options.depth; mc = createEmptyMovieClip(clip, "_mochiad", depth); wh = _slot1._getRes(options, clip); options.res = ((wh[0] + "x") + wh[1]); options.server = (options.server + options.id); delete options.id; clip._mochiad_loaded = true; lv = new URLVariables(); for (k in options) { v = options[k]; if (!(v is Function)){ lv[k] = v; }; }; if (clip.loaderInfo.loaderURL.indexOf("http") != 0){ options.no_page = true; }; server = lv.server; delete lv.server; hostname = _allowDomains(server); mc["onEnterFrame"] = function ():void{ if (!this._mochiad_ctr){ delete this["onEnterFrame"]; _slot1.unload(this.parent); }; }; doOnEnterFrame(mc); lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.lc = lc; lv.lc = name; lv.st = getTimer(); loader = new Loader(); f = function (_arg1:Object):void{ mc._mochiad_ctr_failed = true; }; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f); req = new URLRequest((server + ".swf")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader.load(req); mc.addChild(loader); mc._mochiad_ctr = loader; return (mc); } public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{ var _local4:MovieClip; _local4 = new MovieClip(); if (((false) && (_arg3))){ _arg1.addChildAt(_local4, _arg3); } else { _arg1.addChild(_local4); }; _arg1[_arg2] = _local4; _local4["_name"] = _arg2; return (_local4); } public static function _getRes(_arg1:Object, _arg2:Object):Array{ var _local3:Object; var _local4:Number; var _local5:Number; var _local6:Array; _local3 = _arg2.getBounds(_arg2.root); _local4 = 0; _local5 = 0; if (typeof(_arg1.res) != "undefined"){ _local6 = _arg1.res.split("x"); _local4 = parseFloat(_local6[0]); _local5 = parseFloat(_local6[1]); } else { _local4 = (_local3.xMax - _local3.xMin); _local5 = (_local3.yMax - _local3.yMin); }; if ((((_local4 == 0)) || ((_local5 == 0)))){ _local4 = _arg2.stage.stageWidth; _local5 = _arg2.stage.stageHeight; }; return ([_local4, _local5]); } public static function _loadCommunicator(_arg1:Object):MovieClip{ var DEFAULTS:Object; var clip:Object; var clipname:String; var server:String; var depth:Number; var mc:MovieClip; var lv:URLVariables; var k:String; var lc:LocalConnection; var name:String; var req:URLRequest; var loader:Loader; var options = _arg1; DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"}; options = _slot1._parseOptions(options, DEFAULTS); options.swfv = 9; options.mav = _slot1.getVersion(); clip = options.clip; clipname = ("_mochiad_com_" + options.id); if (!_slot1._isNetworkAvailable()){ return (null); }; if (clip[clipname]){ return (clip[clipname]); }; server = (options.com_server + options.id); _slot1._allowDomains(server); delete options.id; delete options.com_server; depth = options.depth; delete options.depth; mc = createEmptyMovieClip(clip, clipname, depth); lv = new URLVariables(); for (k in options) { lv[k] = options[k]; }; lc = new LocalConnection(); lc.client = mc; name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_"); lc.allowDomain("*", "localhost"); lc.allowInsecureDomain("*", "localhost"); lc.connect(name); mc.name = name; mc.lc = lc; lv.lc = name; mc._id = 0; mc._queue = []; mc.rpcResult = function (_arg1:Object):void{ var _local3:Array; var _local4:Array; var _local5:Number; var _local6:Object; var _local7:Object; _arg1 = parseInt(_arg1.toString()); _local3 = mc._callbacks[_arg1]; if (typeof(_local3) == "undefined"){ return; }; delete mc._callbacks[_arg1]; _local4 = []; _local5 = 2; while (_local5 < _local3.length) { _local4.push(_local3[_local5]); _local5++; }; _local5 = 1; while (_local5 < arguments.length) { _local4.push(arguments[_local5]); _local5++; }; _local6 = _local3[1]; _local7 = _local3[0]; if (((_local7) && ((typeof(_local6) == "string")))){ _local6 = _local7[_local6]; }; if (typeof(_local6) == "function"){ _local6.apply(_local7, _local4); }; }; mc._didConnect = function (_arg1:String):void{ var _local2:Array; var _local3:Function; var _local4:Number; var _local5:Array; mc._endpoint = _arg1; _local2 = mc._queue; delete mc._queue; _local3 = mc.doSend; _local4 = 0; while (_local4 < _local2.length) { _local5 = _local2[_local4]; _local3.apply(this, _local5); _local4++; }; }; mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{ var _local5:Number; var _local6:LocalConnection; var _local7:Array; var _local8:Number; if (mc._endpoint == null){ _local7 = []; _local8 = 0; while (_local8 < arguments.length) { _local7.push(arguments[_local8]); _local8++; }; mc._queue.push(_local7); return; }; mc._id = (mc._id + 1); _local5 = mc._id; mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))]; _local6 = new LocalConnection(); _local6.send(mc._endpoint, "rpc", _local5, _arg1); }; mc._callbacks = {}; mc._callbacks[0] = [mc, "_didConnect"]; lv.st = getTimer(); req = new URLRequest((server + ".swf")); req.contentType = "application/x-www-form-urlencoded"; req.method = URLRequestMethod.POST; req.data = lv; loader = new Loader(); loader.load(req); mc.addChild(loader); mc._mochiad_com = loader; return (mc); } public static function showPreloaderAd(_arg1:Object):void{ var DEFAULTS:Object; var clip:Object; var ad_msec:Number; var ad_timeout:Number; var fadeout_time:Number; var mc:MovieClip; var wh:Array; var w:Number; var h:Number; var chk:MovieClip; var bar:MovieClip; var bar_color:Number; var bar_background:Number; var bar_outline:Number; var backing_mc:MovieClip; var backing:Object; var inside_mc:MovieClip; var inside:Object; var outline_mc:MovieClip; var outline:Object; var options = _arg1; DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{ this.clip.stop(); }, ad_finished:function ():void{ this.clip.play(); }}; options = _slot1._parseOptions(options, DEFAULTS); clip = options.clip; ad_msec = 11000; ad_timeout = options.ad_timeout; delete options.ad_timeout; fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!_slot1.load(options)){ options.ad_finished(); return; }; options.ad_started(); mc = clip._mochiad; mc["onUnload"] = function ():void{ options.ad_finished(); }; wh = _slot1._getRes(options, clip); w = wh[0]; h = wh[1]; mc.x = (w * 0.5); mc.y = (h * 0.5); chk = createEmptyMovieClip(mc, "_mochiad_wait", 3); chk.x = (w * -0.5); chk.y = (h * -0.5); bar = createEmptyMovieClip(chk, "_mochiad_bar", 4); bar.x = 10; bar.y = (h - 20); bar_color = options.color; delete options.color; bar_background = options.background; delete options.background; bar_outline = options.outline; delete options.outline; backing_mc = createEmptyMovieClip(bar, "_outline", 1); backing = backing_mc.graphics; backing.beginFill(bar_background); backing.moveTo(0, 0); backing.lineTo((w - 20), 0); backing.lineTo((w - 20), 10); backing.lineTo(0, 10); backing.lineTo(0, 0); backing.endFill(); inside_mc = createEmptyMovieClip(bar, "_inside", 2); inside = inside_mc.graphics; inside.beginFill(bar_color); inside.moveTo(0, 0); inside.lineTo((w - 20), 0); inside.lineTo((w - 20), 10); inside.lineTo(0, 10); inside.lineTo(0, 0); inside.endFill(); inside_mc.scaleX = 0; outline_mc = createEmptyMovieClip(bar, "_outline", 3); outline = outline_mc.graphics; outline.lineStyle(0, bar_outline, 100); outline.moveTo(0, 0); outline.lineTo((w - 20), 0); outline.lineTo((w - 20), 10); outline.lineTo(0, 10); outline.lineTo(0, 0); chk.ad_msec = ad_msec; chk.ad_timeout = ad_timeout; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function ():void{ var _local1:Number; var _local2:MovieClip; _local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time))); if (_local1 > 0){ this.parent.alpha = (_local1 * 0.01); } else { _local2 = this.parent.parent; _slot1.unload(_local2); delete this["onEnterFrame"]; }; }; mc.unloadAd = function ():void{ _slot1.unload(clip); }; mc.adjustProgress = function (_arg1:Number):void{ var _local2:Object; _local2 = mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = _arg1; }; chk["onEnterFrame"] = function ():void{ var _local1:Object; var _local2:Object; var _local3:Number; var _local4:Boolean; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Object; var _local10:Number; var _local11:Number; _local1 = this.parent.parent.root; if (!_local1){ delete this["onEnterFrame"]; return; }; _local2 = this.parent._mochiad_ctr; _local3 = (getTimer() - this.started); _local4 = false; _local5 = _local1.loaderInfo.bytesTotal; _local6 = _local1.loaderInfo.bytesLoaded; _local7 = ((100 * _local6) / _local5); _local8 = ((100 * _local3) / chk.ad_msec); _local9 = this._mochiad_bar._inside; _local10 = Math.min(100, Math.min(((_local7) || (0)), _local8)); _local10 = Math.max(this.last_pcnt, _local10); this.last_pcnt = _local10; _local9.scaleX = (_local10 * 0.01); if (!chk.showing){ _local11 = _local2.loaderInfo.bytesTotal; if ((((_local11 > 0)) || (("number" == "undefined")))){ chk.showing = true; chk.started = getTimer(); } else { if (_local3 > chk.ad_timeout){ _local4 = true; }; }; }; if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){ _local4 = true; }; if ((((((_local5 > 0)) && ((_local6 >= _local5)))) && (_local4))){ if (this.server_control){ delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; }; }; }; doOnEnterFrame(chk); } public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{ var _local4:MovieClip; _local4 = _slot1._loadCommunicator({clip:_arg1.clip, id:_arg1.id}); if (!_local4){ return (false); }; _local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3); return (true); } public static function doOnEnterFrame(_arg1:MovieClip):void{ var f:Function; var mc = _arg1; f = function (_arg1:Object):void{ if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){ mc.onEnterFrame(); } else { mc.removeEventListener(Event.ENTER_FRAME, f); }; }; mc.addEventListener(Event.ENTER_FRAME, f); } } }//package
Section 167
//Moon (Moon) package { import flash.display.*; public dynamic class Moon extends Sprite { } }//package
Section 168
//morning_sky (morning_sky) package { import flash.display.*; public dynamic class morning_sky extends Sprite { } }//package
Section 169
//MuteButton (MuteButton) package { import flash.net.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.media.*; import flash.text.*; import flash.utils.*; import flash.filters.*; import flash.system.*; import flash.ui.*; import flash.accessibility.*; import flash.errors.*; public dynamic class MuteButton extends MovieClip { public function MuteButton(){ addFrameScript(0, frame1, 4, frame5); } function frame1(){ stop(); } function frame5(){ stop(); } } }//package
Section 170
//Nebula (Nebula) package { import flash.display.*; public dynamic class Nebula extends Sprite { } }//package
Section 171
//Neptune (Neptune) package { import flash.display.*; public dynamic class Neptune extends Sprite { } }//package
Section 172
//NightSky (NightSky) package { import flash.display.*; public dynamic class NightSky extends MovieClip { } }//package
Section 173
//PlayAgainButton (PlayAgainButton) package { import flash.display.*; public dynamic class PlayAgainButton extends SimpleButton { } }//package
Section 174
//Pluto (Pluto) package { import flash.display.*; public dynamic class Pluto extends Sprite { } }//package
Section 175
//PowerDown (PowerDown) package { import flash.media.*; public dynamic class PowerDown extends Sound { } }//package
Section 176
//Reef (Reef) package { import flash.display.*; public dynamic class Reef extends MovieClip { } }//package
Section 177
//Reef1 (Reef1) package { import flash.display.*; public dynamic class Reef1 extends Sprite { } }//package
Section 178
//Reef2 (Reef2) package { import flash.display.*; public dynamic class Reef2 extends Sprite { } }//package
Section 179
//RestartButton (RestartButton) package { import flash.display.*; public dynamic class RestartButton extends SimpleButton { } }//package
Section 180
//ResumeButton (ResumeButton) package { import flash.display.*; public dynamic class ResumeButton extends SimpleButton { } }//package
Section 181
//roundFrame (roundFrame) package { import flash.display.*; public dynamic class roundFrame extends MovieClip { } }//package
Section 182
//Saturn (Saturn) package { import flash.display.*; public dynamic class Saturn extends Sprite { } }//package
Section 183
//SchoolBell (SchoolBell) package { import flash.media.*; public dynamic class SchoolBell extends Sound { } }//package
Section 184
//ScoreBoardBG (ScoreBoardBG) package { import flash.display.*; public dynamic class ScoreBoardBG extends Sprite { } }//package
Section 185
//ScoreButton (ScoreButton) package { import flash.display.*; public dynamic class ScoreButton extends SimpleButton { } }//package
Section 186
//ScoresButton (ScoresButton) package { import flash.display.*; public dynamic class ScoresButton extends SimpleButton { } }//package
Section 187
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_disabledSkin extends MovieClip { } }//package
Section 188
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_downSkin extends MovieClip { } }//package
Section 189
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_overSkin extends MovieClip { } }//package
Section 190
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_upSkin extends MovieClip { } }//package
Section 191
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_disabledSkin extends MovieClip { } }//package
Section 192
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_downSkin extends MovieClip { } }//package
Section 193
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_overSkin extends MovieClip { } }//package
Section 194
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_upSkin extends MovieClip { } }//package
Section 195
//ScrollBar_thumbIcon (ScrollBar_thumbIcon) package { import flash.display.*; public dynamic class ScrollBar_thumbIcon extends MovieClip { } }//package
Section 196
//ScrollThumb_downSkin (ScrollThumb_downSkin) package { import flash.display.*; public dynamic class ScrollThumb_downSkin extends MovieClip { } }//package
Section 197
//ScrollThumb_overSkin (ScrollThumb_overSkin) package { import flash.display.*; public dynamic class ScrollThumb_overSkin extends MovieClip { } }//package
Section 198
//ScrollThumb_upSkin (ScrollThumb_upSkin) package { import flash.display.*; public dynamic class ScrollThumb_upSkin extends MovieClip { } }//package
Section 199
//ScrollTrack_skin (ScrollTrack_skin) package { import flash.display.*; public dynamic class ScrollTrack_skin extends MovieClip { } }//package
Section 200
//scrollZone (scrollZone) package { import flash.display.*; public dynamic class scrollZone extends MovieClip { } }//package
Section 201
//Seashore (Seashore) package { import flash.media.*; public dynamic class Seashore extends Sound { } }//package
Section 202
//SimpleGame (SimpleGame) package { import flash.events.*; import flash.display.*; import com.rawkins.fsm.*; import flash.text.*; import flash.utils.*; import com.rawkins.sg.*; public dynamic class SimpleGame extends MovieClip { protected var enableDomainCheck:Boolean;// = true public var mainState:MainState; public var endState:EndState; private var debug_txt:TextField; public var introState:IntroState; protected var allowLocal:Boolean;// = true public var centerY; public var centerX; public var gameState:StateMachine; private var checkStage:Timer; public function SimpleGame(){ allowLocal = true; enableDomainCheck = true; super(); this.addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage); } public function initGame(_arg1:Event=null):void{ gameState.changeState(introState); } private function handleAddedToStage(_arg1:Event):void{ initSG(); } public function endGame(_arg1:Event=null):void{ gameState.changeState(endState); } public function initSG():void{ var _local1:TextField; centerX = 320; centerY = 240; if (((((((((((((allowLocal) || (!(enableDomainCheck)))) || (onDomain("www.rawkins.com")))) || (onDomain("apps.facebook.com")))) || (onDomain("rawkins.ca")))) || (onDomain("kongregate.com")))) || (onDomain("greatgamesexperiment.com")))){ gameState = new StateMachine(); addEventListener(Event.ENTER_FRAME, mainLoop); initGame(); } else { _local1 = new TextField(); _local1.multiline = true; _local1.width = 500; _local1.height = 300; _local1.x = (centerX - (_local1.width / 2)); _local1.y = ((centerY / 2) - (_local1.height / 2)); _local1.htmlText = ("<p align='center'><font size='22px' face='Verdana, _sans' color='#FFFFFF'>UNFORTUNATELY...<br><br>" + "<font size='12px'>This game can currently only be played at <a href='http://www.rawkins.com/games/do2'>www.rawkins.com/games/do2</a><br> Sorry for the inconvenience.</font></font></p>"); addChild(_local1); }; } public function startGame(_arg1:Event=null):void{ gameState.changeState(mainState); } public function onDomain(_arg1:String):Boolean{ var _local2:String; var _local3:String; var _local4:uint; var _local5:String; _local2 = loaderInfo.loaderURL; _local3 = _local2.substr(0, _local2.indexOf(":")); if (_local3 == "http"){ _local4 = _local2.indexOf("//"); _local5 = _local2.substr((_local4 + 2), ((_local2.indexOf("/", (_local4 + 2)) - _local4) - 2)); _local5 = _local5.toLowerCase(); if (_local5.indexOf(_arg1) != -1){ return (true); }; return (false); //unresolved jump }; if ((((_local3 == "file")) && (allowLocal))){ return (true); }; if (allowLocal){ return (true); }; return (false); } private function onStageCheck(_arg1:TimerEvent):void{ if (stage != null){ checkStage.stop(); checkStage.removeEventListener(TimerEvent.TIMER, onStageCheck); checkStage = null; initSG(); }; } public function mainLoop(_arg1:Event):void{ gameState.update(); } } }//package
Section 203
//SkipButton (SkipButton) package { import flash.display.*; public dynamic class SkipButton extends SimpleButton { } }//package
Section 204
//SpaceDolphin (SpaceDolphin) package { import flash.media.*; public dynamic class SpaceDolphin extends Sound { } }//package
Section 205
//SpaceLoop1 (SpaceLoop1) package { import flash.media.*; public dynamic class SpaceLoop1 extends Sound { } }//package
Section 206
//SplashSound (SplashSound) package { import flash.media.*; public dynamic class SplashSound extends Sound { } }//package
Section 207
//StarBurst (StarBurst) package { import flash.display.*; public dynamic class StarBurst extends MovieClip { } }//package
Section 208
//starfield (starfield) package { import flash.display.*; public dynamic class starfield extends MovieClip { } }//package
Section 209
//StarPic (StarPic) package { import flash.display.*; public dynamic class StarPic extends Sprite { } }//package
Section 210
//StarPic2 (StarPic2) package { import flash.display.*; public dynamic class StarPic2 extends MovieClip { } }//package
Section 211
//StartButton (StartButton) package { import flash.display.*; public dynamic class StartButton extends SimpleButton { } }//package
Section 212
//sun (sun) package { import flash.display.*; public dynamic class sun extends MovieClip { } }//package
Section 213
//SunnySky (SunnySky) package { import flash.display.*; public dynamic class SunnySky extends MovieClip { } }//package
Section 214
//TextInput_disabledSkin (TextInput_disabledSkin) package { import flash.display.*; public dynamic class TextInput_disabledSkin extends MovieClip { } }//package
Section 215
//TextInput_upSkin (TextInput_upSkin) package { import flash.display.*; public dynamic class TextInput_upSkin extends MovieClip { } }//package
Section 216
//Underwater (Underwater) package { import flash.media.*; public dynamic class Underwater extends Sound { } }//package
Section 217
//Uranus (Uranus) package { import flash.display.*; public dynamic class Uranus extends Sprite { } }//package
Section 218
//Water (Water) package { import flash.display.*; public dynamic class Water extends MovieClip { } }//package
Section 219
//water_blur (water_blur) package { import flash.display.*; public dynamic class water_blur extends MovieClip { } }//package
Section 220
//WaterPowerUp (WaterPowerUp) package { import flash.media.*; public dynamic class WaterPowerUp extends Sound { } }//package
Section 221
//WaterRays (WaterRays) package { import flash.display.*; public dynamic class WaterRays extends MovieClip { } }//package
Section 222
//Waves (Waves) package { import flash.display.*; public dynamic class Waves extends Sprite { } }//package
Section 223
//WindUI (WindUI) package { import flash.display.*; import flash.text.*; public dynamic class WindUI extends Sprite { public var wind_txt:TextField; public var windVane:WindVane; } }//package
Section 224
//WindVane (WindVane) package { import flash.display.*; public dynamic class WindVane extends Sprite { } }//package

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClip {roundFrame}Uses:1Used by:Timeline
Symbol 3 GraphicUsed by:4
Symbol 4 MovieClipUses:3Used by:8
Symbol 5 BitmapUsed by:6
Symbol 6 GraphicUses:5Used by:7
Symbol 7 MovieClip {fl.video.Icon}Uses:6Used by:8
Symbol 8 MovieClip {fl.video.FLVPlayback}Uses:4 7
Symbol 9 BitmapUsed by:10
Symbol 10 GraphicUses:9Used by:11
Symbol 11 MovieClipUses:10Used by:12
Symbol 12 MovieClip {do2_free_fla.rawkinsLogo_1}Uses:11Used by:Timeline
Symbol 13 GraphicUsed by:14
Symbol 14 MovieClipUses:13Used by:Timeline
Symbol 15 GraphicUsed by:16
Symbol 16 MovieClipUses:15Used by:Timeline
Symbol 17 FontUsed by:18 19 20 21 31 70 315 332 397 399 401 405 407 419 429 431
Symbol 18 TextUses:17Used by:22
Symbol 19 TextUses:17Used by:22
Symbol 20 TextUses:17Used by:22
Symbol 21 TextUses:17Used by:22
Symbol 22 MovieClip {do2_free_fla.loadtext_5}Uses:18 19 20 21Used by:Timeline
Symbol 23 GraphicUsed by:24
Symbol 24 MovieClip {Arrow}Uses:23Used by:Timeline
Symbol 25 BitmapUsed by:26 260
Symbol 26 GraphicUses:25Used by:30
Symbol 27 BitmapUsed by:28
Symbol 28 GraphicUses:27Used by:29
Symbol 29 MovieClip {sun}Uses:28Used by:30 76  Timeline
Symbol 30 MovieClip {SunnySky}Uses:26 29Used by:76  Timeline
Symbol 31 TextUses:17Used by:32
Symbol 32 MovieClipUses:31Used by:76
Symbol 33 BitmapUsed by:34
Symbol 34 GraphicUses:33Used by:35
Symbol 35 MovieClipUses:34Used by:76
Symbol 36 GraphicUsed by:37
Symbol 37 MovieClipUses:36Used by:38
Symbol 38 MovieClip {Waves}Uses:37Used by:39  Timeline
Symbol 39 MovieClip {do2_free_fla.movingWaves_13}Uses:38Used by:76
Symbol 40 GraphicUsed by:76
Symbol 41 BitmapUsed by:45 74
Symbol 42 BitmapUsed by:45
Symbol 43 BitmapUsed by:45
Symbol 44 BitmapUsed by:45
Symbol 45 GraphicUses:41 42 43 44Used by:46
Symbol 46 MovieClipUses:45Used by:76
Symbol 47 BitmapUsed by:55
Symbol 48 BitmapUsed by:55
Symbol 49 BitmapUsed by:55
Symbol 50 BitmapUsed by:55
Symbol 51 BitmapUsed by:55
Symbol 52 BitmapUsed by:55
Symbol 53 BitmapUsed by:55
Symbol 54 BitmapUsed by:55
Symbol 55 GraphicUses:47 48 49 50 51 52 53 54Used by:76
Symbol 56 GraphicUsed by:57
Symbol 57 MovieClipUses:56Used by:76
Symbol 58 BitmapUsed by:65
Symbol 59 BitmapUsed by:65
Symbol 60 BitmapUsed by:65
Symbol 61 BitmapUsed by:65
Symbol 62 BitmapUsed by:65
Symbol 63 BitmapUsed by:65
Symbol 64 BitmapUsed by:65
Symbol 65 GraphicUses:58 59 60 61 62 63 64Used by:76
Symbol 66 BitmapUsed by:68
Symbol 67 BitmapUsed by:68
Symbol 68 GraphicUses:66 67Used by:69
Symbol 69 MovieClipUses:68Used by:76
Symbol 70 TextUses:17Used by:76
Symbol 71 BitmapUsed by:72
Symbol 72 GraphicUses:71Used by:73
Symbol 73 MovieClip {EveningSky}Uses:72Used by:76  Timeline
Symbol 74 GraphicUses:41Used by:75
Symbol 75 MovieClipUses:74Used by:76
Symbol 76 MovieClip {com.rawkins.games.dolphinOlympics.TitleScreen}Uses:30 29 32 35 39 40 46 55 57 65 69 70 73 75Used by:Timeline
Symbol 77 GraphicUsed by:78
Symbol 78 MovieClip {com.rawkins.games.dolphinOlympics.Pirateship}Uses:77Used by:Timeline
Symbol 79 MovieClip {ComboExtended}Used by:Timeline
Symbol 80 GraphicUsed by:81
Symbol 81 MovieClip {Reef1}Uses:80Used by:85 86  Timeline
Symbol 82 GraphicUsed by:83
Symbol 83 MovieClip {Reef2}Uses:82Used by:85 86  Timeline
Symbol 84 GraphicUsed by:85 86 196 438 441
Symbol 85 MovieClip {FullReef1}Uses:81 83 84Used by:Timeline
Symbol 86 MovieClip {FullReef2}Uses:81 83 84Used by:Timeline
Symbol 87 MovieClip {Reef}Used by:Timeline
Symbol 88 GraphicUsed by:89
Symbol 89 MovieClipUses:88Used by:90
Symbol 90 MovieClip {Floor3}Uses:89Used by:Timeline
Symbol 91 GraphicUsed by:92
Symbol 92 MovieClipUses:91Used by:94
Symbol 93 GraphicUsed by:94
Symbol 94 MovieClip {Floor4}Uses:92 93Used by:Timeline
Symbol 95 GraphicUsed by:96
Symbol 96 MovieClipUses:95Used by:97
Symbol 97 MovieClip {Floor5}Uses:96Used by:Timeline
Symbol 98 GraphicUsed by:99
Symbol 99 MovieClipUses:98Used by:100
Symbol 100 MovieClip {Floor6}Uses:99Used by:Timeline
Symbol 101 GraphicUsed by:106
Symbol 102 GraphicUsed by:103
Symbol 103 MovieClipUses:102Used by:106
Symbol 104 GraphicUsed by:105
Symbol 105 MovieClipUses:104Used by:106
Symbol 106 MovieClip {com.rawkins.games.dolphinOlympics.Seagull}Uses:101 103 105Used by:Timeline
Symbol 107 GraphicUsed by:108
Symbol 108 MovieClipUses:107Used by:118
Symbol 109 GraphicUsed by:110
Symbol 110 MovieClipUses:109Used by:118
Symbol 111 GraphicUsed by:112
Symbol 112 MovieClipUses:111Used by:118
Symbol 113 GraphicUsed by:114
Symbol 114 MovieClipUses:113Used by:118
Symbol 115 GraphicUsed by:118
Symbol 116 GraphicUsed by:118
Symbol 117 GraphicUsed by:118
Symbol 118 MovieClip {com.rawkins.games.dolphinOlympics.Greenfish}Uses:108 110 112 114 115 116 117Used by:Timeline
Symbol 119 GraphicUsed by:120
Symbol 120 MovieClipUses:119Used by:134
Symbol 121 GraphicUsed by:122
Symbol 122 MovieClipUses:121Used by:134
Symbol 123 GraphicUsed by:134
Symbol 124 GraphicUsed by:125
Symbol 125 MovieClipUses:124Used by:134
Symbol 126 GraphicUsed by:134
Symbol 127 GraphicUsed by:128
Symbol 128 MovieClipUses:127Used by:134
Symbol 129 GraphicUsed by:134
Symbol 130 GraphicUsed by:134
Symbol 131 GraphicUsed by:134
Symbol 132 GraphicUsed by:134
Symbol 133 GraphicUsed by:134
Symbol 134 MovieClip {com.rawkins.games.dolphinOlympics.Fish}Uses:120 122 123 125 126 128 129 130 131 132 133Used by:Timeline
Symbol 135 GraphicUsed by:136
Symbol 136 MovieClipUses:135Used by:149
Symbol 137 GraphicUsed by:138
Symbol 138 MovieClipUses:137Used by:149
Symbol 139 GraphicUsed by:149
Symbol 140 GraphicUsed by:141
Symbol 141 MovieClipUses:140Used by:149
Symbol 142 GraphicUsed by:149
Symbol 143 GraphicUsed by:144
Symbol 144 MovieClipUses:143Used by:149
Symbol 145 GraphicUsed by:149
Symbol 146 GraphicUsed by:149
Symbol 147 GraphicUsed by:149
Symbol 148 GraphicUsed by:149
Symbol 149 MovieClip {com.rawkins.games.dolphinOlympics.Orangefish}Uses:136 138 139 141 142 144 145 146 147 148Used by:Timeline
Symbol 150 GraphicUsed by:161
Symbol 151 GraphicUsed by:161
Symbol 152 GraphicUsed by:161
Symbol 153 GraphicUsed by:161
Symbol 154 GraphicUsed by:155
Symbol 155 MovieClipUses:154Used by:161
Symbol 156 GraphicUsed by:161
Symbol 157 GraphicUsed by:161
Symbol 158 GraphicUsed by:161
Symbol 159 GraphicUsed by:161
Symbol 160 GraphicUsed by:161
Symbol 161 MovieClip {com.rawkins.games.dolphinOlympics.Bluefish}Uses:150 151 152 153 155 156 157 158 159 160Used by:Timeline
Symbol 162 BitmapUsed by:163
Symbol 163 GraphicUses:162Used by:164
Symbol 164 MovieClip {Diner}Uses:163Used by:Timeline
Symbol 165 BitmapUsed by:166
Symbol 166 GraphicUses:165Used by:167
Symbol 167 MovieClip {Mars}Uses:166Used by:Timeline
Symbol 168 BitmapUsed by:169
Symbol 169 GraphicUses:168Used by:170
Symbol 170 MovieClip {Pluto}Uses:169Used by:Timeline
Symbol 171 BitmapUsed by:172
Symbol 172 GraphicUses:171Used by:173
Symbol 173 MovieClip {Saturn}Uses:172Used by:Timeline
Symbol 174 BitmapUsed by:175
Symbol 175 GraphicUses:174Used by:176
Symbol 176 MovieClip {Neptune}Uses:175Used by:Timeline
Symbol 177 BitmapUsed by:178
Symbol 178 GraphicUses:177Used by:179
Symbol 179 MovieClip {Uranus}Uses:178Used by:Timeline
Symbol 180 GraphicUsed by:181 255
Symbol 181 MovieClip {StarPic}Uses:180Used by:Timeline
Symbol 182 GraphicUsed by:183
Symbol 183 MovieClip {StarPic2}Uses:182Used by:Timeline
Symbol 184 GraphicUsed by:187
Symbol 185 MovieClipUsed by:187
Symbol 186 GraphicUsed by:187
Symbol 187 MovieClip {ScoreBoardBG}Uses:184 185 186Used by:330 386 432  Timeline
Symbol 188 GraphicUsed by:189
Symbol 189 MovieClip {WindVane}Uses:188Used by:193  Timeline
Symbol 190 FontUsed by:191 192 197 198 199 201 202 203 205 207 210 215 217 219 221 223 225 227 229 232 234 236 311 312 313 314 316 317 318 319 320 321 322 325 329 335 336 337 350 387 388 409 420 430
Symbol 191 EditableTextUses:190Used by:193
Symbol 192 TextUses:190Used by:193
Symbol 193 MovieClip {WindUI}Uses:189 191 192Used by:Timeline
Symbol 194 GraphicUsed by:195
Symbol 195 MovieClipUses:194Used by:196
Symbol 196 MovieClip {Cloud3}Uses:195 84Used by:Timeline
Symbol 197 EditableTextUses:190Used by:200
Symbol 198 EditableTextUses:190Used by:200
Symbol 199 EditableTextUses:190Used by:200
Symbol 200 MovieClip {HighJump_UI_text}Uses:197 198 199Used by:Timeline
Symbol 201 EditableTextUses:190Used by:204
Symbol 202 EditableTextUses:190Used by:204
Symbol 203 EditableTextUses:190Used by:204
Symbol 204 MovieClip {FreestyleUI_text}Uses:201 202 203Used by:238  Timeline
Symbol 205 TextUses:190Used by:206
Symbol 206 MovieClipUses:205Used by:209
Symbol 207 TextUses:190Used by:208
Symbol 208 MovieClipUses:207Used by:209 212
Symbol 209 MovieClip {FreestyleUI_labels}Uses:206 208Used by:Timeline
Symbol 210 TextUses:190Used by:211
Symbol 211 MovieClipUses:210Used by:212
Symbol 212 MovieClip {HighJump_UI_labels}Uses:208 211Used by:Timeline
Symbol 213 GraphicUsed by:214 216 218 220 222 224 226 228 230 231 233 235 237 326 403 408
Symbol 214 MovieClipUses:213Used by:216 218 220 222 224 226 228 230 231 233 235 237 326 403 408
Symbol 215 TextUses:190Used by:216
Symbol 216 Button {MenuButton}Uses:214 215 213Used by:Timeline
Symbol 217 TextUses:190Used by:218
Symbol 218 Button {SkipButton}Uses:214 217 213Used by:330  Timeline
Symbol 219 TextUses:190Used by:220
Symbol 220 Button {BackButton}Uses:214 219 213Used by:Timeline
Symbol 221 TextUses:190Used by:222
Symbol 222 Button {EndButton}Uses:214 221 213Used by:Timeline
Symbol 223 TextUses:190Used by:224 231
Symbol 224 Button {ScoreButton}Uses:214 223 213Used by:Timeline
Symbol 225 TextUses:190Used by:226
Symbol 226 Button {ResumeButton}Uses:214 225 213Used by:Timeline
Symbol 227 TextUses:190Used by:228
Symbol 228 Button {PlayAgainButton}Uses:214 227 213Used by:Timeline
Symbol 229 TextUses:190Used by:230
Symbol 230 Button {RestartButton}Uses:214 229 213Used by:Timeline
Symbol 231 Button {ScoresButton}Uses:214 223 213Used by:Timeline
Symbol 232 TextUses:190Used by:233
Symbol 233 Button {StartButton}Uses:214 232 213Used by:Timeline
Symbol 234 TextUses:190Used by:235
Symbol 235 Button {FreeswimButton}Uses:214 234 213Used by:Timeline
Symbol 236 TextUses:190Used by:237
Symbol 237 Button {HelpButton}Uses:214 236 213Used by:Timeline
Symbol 238 MovieClip {FreestyleUI}Uses:204Used by:Timeline
Symbol 239 BitmapUsed by:240
Symbol 240 GraphicUses:239Used by:241
Symbol 241 MovieClip {WaterRays}Uses:240Used by:Timeline
Symbol 242 GraphicUsed by:243
Symbol 243 MovieClip {Water}Uses:242Used by:Timeline
Symbol 244 GraphicUsed by:245
Symbol 245 MovieClip {Ball}Uses:244Used by:Timeline
Symbol 246 BitmapUsed by:247
Symbol 247 GraphicUses:246Used by:248
Symbol 248 MovieClip {Floor1}Uses:247Used by:Timeline
Symbol 249 BitmapUsed by:250
Symbol 250 GraphicUses:249Used by:251
Symbol 251 MovieClip {Floor2}Uses:250Used by:Timeline
Symbol 252 BitmapUsed by:253
Symbol 253 GraphicUses:252Used by:254
Symbol 254 MovieClip {Moon}Uses:253Used by:Timeline
Symbol 255 MovieClip {starfield}Uses:180Used by:Timeline
Symbol 256 GraphicUsed by:257
Symbol 257 MovieClip {FloorBase}Uses:256Used by:Timeline
Symbol 258 MovieClip {water_blur}Used by:Timeline
Symbol 259 GraphicUsed by:262
Symbol 260 GraphicUses:25Used by:261
Symbol 261 MovieClipUses:260Used by:262
Symbol 262 MovieClip {morning_sky}Uses:259 261Used by:Timeline
Symbol 263 GraphicUsed by:264
Symbol 264 MovieClip {scrollZone}Uses:263Used by:Timeline
Symbol 265 BitmapUsed by:266
Symbol 266 GraphicUses:265Used by:267
Symbol 267 MovieClip {NightSky}Uses:266Used by:Timeline
Symbol 268 BitmapUsed by:269
Symbol 269 GraphicUses:268Used by:270
Symbol 270 MovieClip {Jupiter}Uses:269Used by:Timeline
Symbol 271 BitmapUsed by:272
Symbol 272 GraphicUses:271Used by:273
Symbol 273 MovieClip {Nebula}Uses:272Used by:Timeline
Symbol 274 GraphicUsed by:275
Symbol 275 MovieClip {hitzone}Uses:274Used by:308  Timeline
Symbol 276 BitmapUsed by:277 278 290
Symbol 277 GraphicUses:276Used by:308
Symbol 278 GraphicUses:276Used by:308
Symbol 279 BitmapUsed by:280 281 291 293 294 300 301 302
Symbol 280 GraphicUses:279Used by:308
Symbol 281 GraphicUses:279Used by:308
Symbol 282 BitmapUsed by:283 284 292
Symbol 283 GraphicUses:282Used by:308
Symbol 284 GraphicUses:282Used by:308
Symbol 285 GraphicUsed by:308
Symbol 286 GraphicUsed by:308
Symbol 287 GraphicUsed by:308
Symbol 288 GraphicUsed by:308
Symbol 289 GraphicUsed by:308
Symbol 290 GraphicUses:276Used by:308
Symbol 291 GraphicUses:279Used by:308
Symbol 292 GraphicUses:282Used by:308
Symbol 293 GraphicUses:279Used by:308
Symbol 294 GraphicUses:279Used by:308
Symbol 295 GraphicUsed by:308
Symbol 296 GraphicUsed by:308
Symbol 297 GraphicUsed by:308
Symbol 298 GraphicUsed by:308
Symbol 299 GraphicUsed by:308
Symbol 300 GraphicUses:279Used by:308
Symbol 301 GraphicUses:279Used by:308
Symbol 302 GraphicUses:279Used by:308
Symbol 303 GraphicUsed by:308
Symbol 304 GraphicUsed by:308
Symbol 305 GraphicUsed by:308
Symbol 306 GraphicUsed by:308
Symbol 307 GraphicUsed by:308
Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player}Uses:277 275 278 280 281 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307Used by:Timeline
Symbol 309 GraphicUsed by:310
Symbol 310 MovieClipUses:309Used by:330
Symbol 311 TextUses:190Used by:330
Symbol 312 TextUses:190Used by:330
Symbol 313 TextUses:190Used by:330
Symbol 314 TextUses:190Used by:330
Symbol 315 EditableTextUses:17Used by:330
Symbol 316 EditableTextUses:190Used by:330
Symbol 317 EditableTextUses:190Used by:330
Symbol 318 EditableTextUses:190Used by:330
Symbol 319 EditableTextUses:190Used by:330
Symbol 320 EditableTextUses:190Used by:330
Symbol 321 TextUses:190Used by:330
Symbol 322 EditableTextUses:190Used by:330
Symbol 323 FontUsed by:324
Symbol 324 EditableTextUses:323Used by:330
Symbol 325 TextUses:190Used by:326
Symbol 326 ButtonUses:214 325 213Used by:330
Symbol 327 FontUsed by:328
Symbol 328 EditableTextUses:327Used by:330
Symbol 329 TextUses:190Used by:330
Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm}Uses:187 310 311 312 313 314 315 316 317 318 319 320 321 322 324 326 328 329 218Used by:Timeline
Symbol 331 GraphicUsed by:333
Symbol 332 TextUses:17Used by:333
Symbol 333 MovieClipUses:331 332Used by:386
Symbol 334 GraphicUsed by:386
Symbol 335 TextUses:190Used by:386
Symbol 336 TextUses:190Used by:386
Symbol 337 TextUses:190Used by:386
Symbol 338 FontUsed by:339 340 341 342 343 344
Symbol 339 TextUses:338Used by:386
Symbol 340 TextUses:338Used by:386
Symbol 341 TextUses:338Used by:386
Symbol 342 TextUses:338Used by:386
Symbol 343 TextUses:338Used by:386
Symbol 344 TextUses:338Used by:386
Symbol 345 GraphicUsed by:386
Symbol 346 FontUsed by:347 353 354 355 356 357 358 359 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
Symbol 347 EditableTextUses:346Used by:386
Symbol 348 FontUsed by:349 351 352 360 361 362
Symbol 349 EditableTextUses:348Used by:386
Symbol 350 TextUses:190Used by:386
Symbol 351 EditableTextUses:348Used by:386
Symbol 352 EditableTextUses:348Used by:386
Symbol 353 EditableTextUses:346Used by:386
Symbol 354 EditableTextUses:346Used by:386
Symbol 355 EditableTextUses:346Used by:386
Symbol 356 EditableTextUses:346Used by:386
Symbol 357 EditableTextUses:346Used by:386
Symbol 358 EditableTextUses:346Used by:386
Symbol 359 EditableTextUses:346Used by:386
Symbol 360 EditableTextUses:348Used by:386
Symbol 361 EditableTextUses:348Used by:386
Symbol 362 EditableTextUses:348Used by:386
Symbol 363 EditableTextUses:346Used by:386
Symbol 364 EditableTextUses:346Used by:386
Symbol 365 EditableTextUses:346Used by:386
Symbol 366 EditableTextUses:346Used by:386
Symbol 367 EditableTextUses:346Used by:386
Symbol 368 EditableTextUses:346Used by:386
Symbol 369 EditableTextUses:346Used by:386
Symbol 370 EditableTextUses:346Used by:386
Symbol 371 EditableTextUses:346Used by:386
Symbol 372 EditableTextUses:346Used by:386
Symbol 373 EditableTextUses:346Used by:386
Symbol 374 EditableTextUses:346Used by:386
Symbol 375 EditableTextUses:346Used by:386
Symbol 376 EditableTextUses:346Used by:386
Symbol 377 EditableTextUses:346Used by:386
Symbol 378 EditableTextUses:346Used by:386
Symbol 379 EditableTextUses:346Used by:386
Symbol 380 EditableTextUses:346Used by:386
Symbol 381 GraphicUsed by:385
Symbol 382 GraphicUsed by:385
Symbol 383 GraphicUsed by:385
Symbol 384 GraphicUsed by:385
Symbol 385 ButtonUses:381 382 383 384Used by:386 432
Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard}Uses:333 187 334 335 336 337 339 340 341 342 343 344 345 347 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 385Used by:Timeline
Symbol 387 TextUses:190Used by:432
Symbol 388 TextUses:190Used by:432
Symbol 389 GraphicUsed by:432
Symbol 390 BitmapUsed by:392
Symbol 391 BitmapUsed by:392
Symbol 392 GraphicUses:390 391Used by:432
Symbol 393 FontUsed by:394 395 396 411 412 415 416 422 423 424 425 426
Symbol 394 TextUses:393Used by:432
Symbol 395 TextUses:393Used by:432
Symbol 396 TextUses:393Used by:432
Symbol 397 TextUses:17Used by:432
Symbol 398 GraphicUsed by:403
Symbol 399 TextUses:17Used by:403
Symbol 400 GraphicUsed by:403
Symbol 401 TextUses:17Used by:403
Symbol 402 GraphicUsed by:403 408
Symbol 403 ButtonUses:214 398 399 400 401 213 402Used by:432
Symbol 404 GraphicUsed by:408
Symbol 405 TextUses:17Used by:408
Symbol 406 GraphicUsed by:408
Symbol 407 TextUses:17Used by:408
Symbol 408 ButtonUses:214 404 405 406 407 213 402Used by:432
Symbol 409 TextUses:190Used by:432
Symbol 410 GraphicUsed by:432
Symbol 411 TextUses:393Used by:432
Symbol 412 TextUses:393Used by:432
Symbol 413 BitmapUsed by:414
Symbol 414 GraphicUses:413Used by:432
Symbol 415 TextUses:393Used by:432
Symbol 416 TextUses:393Used by:432
Symbol 417 BitmapUsed by:418
Symbol 418 GraphicUses:417Used by:432
Symbol 419 TextUses:17Used by:432
Symbol 420 TextUses:190Used by:432
Symbol 421 GraphicUsed by:432
Symbol 422 TextUses:393Used by:432
Symbol 423 TextUses:393Used by:432
Symbol 424 TextUses:393Used by:432
Symbol 425 TextUses:393Used by:432
Symbol 426 TextUses:393Used by:432
Symbol 427 BitmapUsed by:428
Symbol 428 GraphicUses:427Used by:432
Symbol 429 TextUses:17Used by:432
Symbol 430 TextUses:190Used by:432
Symbol 431 TextUses:17Used by:432
Symbol 432 MovieClip {HelpScreen}Uses:187 387 388 389 392 394 395 396 397 403 408 385 409 410 411 412 414 415 416 418 419 420 421 422 423 424 425 426 428 429 430 431Used by:Timeline
Symbol 433 GraphicUsed by:434
Symbol 434 MovieClipUses:433Used by:435
Symbol 435 MovieClip {StarBurst}Uses:434Used by:Timeline
Symbol 436 GraphicUsed by:437
Symbol 437 MovieClipUses:436Used by:438
Symbol 438 MovieClip {Cloud1}Uses:437 84Used by:Timeline
Symbol 439 GraphicUsed by:440
Symbol 440 MovieClipUses:439Used by:441
Symbol 441 MovieClip {Cloud2}Uses:440 84Used by:Timeline
Symbol 442 GraphicUsed by:450
Symbol 443 GraphicUsed by:444
Symbol 444 MovieClipUses:443Used by:450
Symbol 445 FontUsed by:446 447 448 449
Symbol 446 EditableTextUses:445Used by:450
Symbol 447 EditableTextUses:445Used by:450
Symbol 448 TextUses:445Used by:450
Symbol 449 TextUses:445Used by:450
Symbol 450 MovieClip {FPSCounter}Uses:442 444 446 447 448 449Used by:Timeline
Symbol 451 GraphicUsed by:452
Symbol 452 MovieClip {focusRectSkin}Uses:451Used by:468 516 517 518  Timeline
Symbol 453 GraphicUsed by:454
Symbol 454 MovieClip {ComboBox_upSkin}Uses:453Used by:518  Timeline
Symbol 455 GraphicUsed by:456
Symbol 456 MovieClip {ComboBox_disabledSkin}Uses:455Used by:518  Timeline
Symbol 457 GraphicUsed by:458
Symbol 458 MovieClip {ComboBox_overSkin}Uses:457Used by:518  Timeline
Symbol 459 GraphicUsed by:460
Symbol 460 MovieClip {ComboBox_downSkin}Uses:459Used by:518  Timeline
Symbol 461 GraphicUsed by:462
Symbol 462 MovieClip {TextInput_disabledSkin}Uses:461Used by:468  Timeline
Symbol 463 GraphicUsed by:464
Symbol 464 MovieClip {TextInput_upSkin}Uses:463Used by:468  Timeline
Symbol 465 GraphicUsed by:466
Symbol 466 MovieClipUses:465Used by:468 517 518
Symbol 467 MovieClip {fl.core.ComponentShim}Used by:468 487 516 517 518
Symbol 468 MovieClip {fl.controls.TextInput}Uses:466 467 462 464 452Used by:518  Timeline
Symbol 469 GraphicUsed by:470
Symbol 470 MovieClip {List_skin}Uses:469Used by:517  Timeline
Symbol 471 GraphicUsed by:472
Symbol 472 MovieClip {CellRenderer_upSkin}Uses:471Used by:487  Timeline
Symbol 473 GraphicUsed by:474
Symbol 474 MovieClip {CellRenderer_disabledSkin}Uses:473Used by:487  Timeline
Symbol 475 GraphicUsed by:476
Symbol 476 MovieClip {CellRenderer_downSkin}Uses:475Used by:487  Timeline
Symbol 477 GraphicUsed by:478
Symbol 478 MovieClip {CellRenderer_overSkin}Uses:477Used by:487  Timeline
Symbol 479 GraphicUsed by:480
Symbol 480 MovieClip {CellRenderer_selectedDisabledSkin}Uses:479Used by:487  Timeline
Symbol 481 GraphicUsed by:482
Symbol 482 MovieClip {CellRenderer_selectedDownSkin}Uses:481Used by:487  Timeline
Symbol 483 GraphicUsed by:484
Symbol 484 MovieClip {CellRenderer_selectedOverSkin}Uses:483Used by:487  Timeline
Symbol 485 GraphicUsed by:486
Symbol 486 MovieClip {CellRenderer_selectedUpSkin}Uses:485Used by:487  Timeline
Symbol 487 MovieClip {fl.controls.listClasses.CellRenderer}Uses:472 467 474 476 478 480 482 484 486Used by:517  Timeline
Symbol 488 GraphicUsed by:489
Symbol 489 MovieClip {ScrollTrack_skin}Uses:488Used by:516  Timeline
Symbol 490 GraphicUsed by:493
Symbol 491 GraphicUsed by:492 495 499 509
Symbol 492 MovieClipUses:491Used by:493 503 505
Symbol 493 MovieClip {ScrollArrowUp_downSkin}Uses:490 492Used by:516  Timeline
Symbol 494 GraphicUsed by:495
Symbol 495 MovieClip {ScrollArrowDown_downSkin}Uses:494 491Used by:516  Timeline
Symbol 496 GraphicUsed by:497
Symbol 497 MovieClip {ScrollThumb_downSkin}Uses:496Used by:516  Timeline
Symbol 498 GraphicUsed by:499
Symbol 499 MovieClip {ScrollArrowDown_overSkin}Uses:498 491Used by:516  Timeline
Symbol 500 GraphicUsed by:501
Symbol 501 MovieClip {ScrollThumb_overSkin}Uses:500Used by:516  Timeline
Symbol 502 GraphicUsed by:503
Symbol 503 MovieClip {ScrollArrowUp_overSkin}Uses:502 492Used by:516  Timeline
Symbol 504 GraphicUsed by:505
Symbol 505 MovieClip {ScrollArrowUp_upSkin}Uses:504 492Used by:516  Timeline
Symbol 506 GraphicUsed by:507
Symbol 507 MovieClip {ScrollThumb_upSkin}Uses:506Used by:516  Timeline
Symbol 508 GraphicUsed by:509
Symbol 509 MovieClip {ScrollArrowDown_upSkin}Uses:508 491Used by:516  Timeline
Symbol 510 GraphicUsed by:511
Symbol 511 MovieClip {ScrollArrowDown_disabledSkin}Uses:510Used by:516  Timeline
Symbol 512 GraphicUsed by:513
Symbol 513 MovieClip {ScrollArrowUp_disabledSkin}Uses:512Used by:516  Timeline
Symbol 514 GraphicUsed by:515
Symbol 515 MovieClip {ScrollBar_thumbIcon}Uses:514Used by:516  Timeline
Symbol 516 MovieClip {fl.controls.ScrollBar}Uses:489 467 452 493 495 497 499 501 503 505 507 509 511 513 515Used by:517  Timeline
Symbol 517 MovieClip {fl.controls.List}Uses:466 467 470 487 452 516Used by:518  Timeline
Symbol 518 MovieClip {fl.controls.ComboBox}Uses:466 467 452 454 456 458 460 468 517Used by:Timeline
Symbol 519 BitmapUsed by:520
Symbol 520 GraphicUses:519Used by:523
Symbol 521 BitmapUsed by:522
Symbol 522 GraphicUses:521Used by:523
Symbol 523 MovieClip {MuteButton}Uses:520 522Used by:Timeline
Symbol 524 MovieClipUsed by:Timeline
Symbol 525 Sound {WaterPowerUp}Used by:540
Symbol 526 Sound {SplashSound}Used by:540
Symbol 527 Sound {Underwater}Used by:540
Symbol 528 Sound {AirPowerUp}Used by:540
Symbol 529 Sound {SpaceDolphin}Used by:540
Symbol 530 Sound {Seashore}Used by:540
Symbol 531 Sound {SchoolBell}Used by:540
Symbol 532 Sound {FishHit}Used by:540
Symbol 533 Sound {PowerDown}Used by:540
Symbol 534 Sound {Impact}Used by:540
Symbol 535 Sound {FireworkSound}Used by:540
Symbol 536 Sound {Explosion}Used by:540
Symbol 537 Sound {SpaceLoop1}Used by:540
Symbol 538 Sound {EntryPowerUp}Used by:540
Symbol 539 Sound {DolphinChirp1}Used by:540
Symbol 540 MovieClipUses:525 526 527 528 529 530 531 532 533 534 535 536 537 538 539Used by:Timeline

Instance Names

"loadBar"Frame 17Symbol 14 MovieClip
"outline"Frame 17Symbol 16 MovieClip
"loadtxt"Frame 17Symbol 22 MovieClip {do2_free_fla.loadtext_5}
"boundingBox_mc"Symbol 8 MovieClip {fl.video.FLVPlayback} Frame 1Symbol 4 MovieClip
"windVane"Symbol 193 MovieClip {WindUI} Frame 1Symbol 189 MovieClip {WindVane}
"wind_txt"Symbol 193 MovieClip {WindUI} Frame 1Symbol 191 EditableText
"time_txt"Symbol 200 MovieClip {HighJump_UI_text} Frame 1Symbol 197 EditableText
"liveScore_txt"Symbol 200 MovieClip {HighJump_UI_text} Frame 1Symbol 198 EditableText
"height_txt"Symbol 200 MovieClip {HighJump_UI_text} Frame 1Symbol 199 EditableText
"score_txt"Symbol 204 MovieClip {FreestyleUI_text} Frame 1Symbol 201 EditableText
"time_txt"Symbol 204 MovieClip {FreestyleUI_text} Frame 1Symbol 202 EditableText
"liveScore_txt"Symbol 204 MovieClip {FreestyleUI_text} Frame 1Symbol 203 EditableText
"hitzone_mc"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 1Symbol 275 MovieClip {hitzone}
"hitzone_mc"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 126Symbol 275 MovieClip {hitzone}
"fs_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 315 EditableText
"hj_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 316 EditableText
"lj_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 317 EditableText
"bs_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 318 EditableText
"lt_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 319 EditableText
"hs_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 320 EditableText
"lc_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 322 EditableText
"error_txt"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 324 EditableText
"submit_btn"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 326 Button
"name_ti"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 328 EditableText
"playAgain_btn"Symbol 330 MovieClip {com.rawkins.games.dolphinOlympics.ScoreSubmitForm} Frame 1Symbol 218 Button {SkipButton}
"linkTab"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 333 MovieClip
"name_7"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 347 EditableText
"name_1"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 349 EditableText
"name_2"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 351 EditableText
"name_3"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 352 EditableText
"name_4"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 353 EditableText
"name_5"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 354 EditableText
"name_6"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 355 EditableText
"name_8"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 356 EditableText
"name_9"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 357 EditableText
"name_10"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 358 EditableText
"score_7"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 359 EditableText
"score_1"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 360 EditableText
"score_2"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 361 EditableText
"score_3"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 362 EditableText
"score_4"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 363 EditableText
"score_5"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 364 EditableText
"score_6"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 365 EditableText
"score_8"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 366 EditableText
"score_9"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 367 EditableText
"score_10"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 368 EditableText
"lj_name"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 369 EditableText
"lj_score"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 370 EditableText
"hj_name"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 371 EditableText
"hj_score"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 372 EditableText
"bs_name"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 373 EditableText
"bs_score"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 374 EditableText
"lt_name"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 375 EditableText
"lt_score"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 376 EditableText
"hs_name"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 377 EditableText
"hs_score"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 378 EditableText
"bc_name"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 379 EditableText
"bc_score"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 380 EditableText
"close_btn"Symbol 386 MovieClip {com.rawkins.games.dolphinOlympics.Scoreboard} Frame 1Symbol 385 Button
"next_btn"Symbol 432 MovieClip {HelpScreen} Frame 1Symbol 403 Button
"prev_btn"Symbol 432 MovieClip {HelpScreen} Frame 1Symbol 408 Button
"close_btn"Symbol 432 MovieClip {HelpScreen} Frame 1Symbol 385 Button
"bar"Symbol 450 MovieClip {FPSCounter} Frame 1Symbol 444 MovieClip
"fps"Symbol 450 MovieClip {FPSCounter} Frame 1Symbol 446 EditableText
"lowestValue"Symbol 450 MovieClip {FPSCounter} Frame 1Symbol 447 EditableText

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS3.
Protect (24)Timeline Frame 131 bytes "..$1$NC$R.nPQDyyXtvUfHrg6MKsS1."

Labels

"loader"Frame 18
"gameStart"Frame 31
"day"Symbol 76 MovieClip {com.rawkins.games.dolphinOlympics.TitleScreen} Frame 1
"evening"Symbol 76 MovieClip {com.rawkins.games.dolphinOlympics.TitleScreen} Frame 3
"gliding"Symbol 106 MovieClip {com.rawkins.games.dolphinOlympics.Seagull} Frame 1
"flapping"Symbol 106 MovieClip {com.rawkins.games.dolphinOlympics.Seagull} Frame 15
"hit"Symbol 106 MovieClip {com.rawkins.games.dolphinOlympics.Seagull} Frame 30
"normal"Symbol 118 MovieClip {com.rawkins.games.dolphinOlympics.Greenfish} Frame 1
"active"Symbol 118 MovieClip {com.rawkins.games.dolphinOlympics.Greenfish} Frame 20
"jumping"Symbol 118 MovieClip {com.rawkins.games.dolphinOlympics.Greenfish} Frame 31
"normal"Symbol 134 MovieClip {com.rawkins.games.dolphinOlympics.Fish} Frame 1
"active"Symbol 134 MovieClip {com.rawkins.games.dolphinOlympics.Fish} Frame 13
"jumping"Symbol 134 MovieClip {com.rawkins.games.dolphinOlympics.Fish} Frame 22
"normal"Symbol 149 MovieClip {com.rawkins.games.dolphinOlympics.Orangefish} Frame 1
"active"Symbol 149 MovieClip {com.rawkins.games.dolphinOlympics.Orangefish} Frame 18
"jumping"Symbol 149 MovieClip {com.rawkins.games.dolphinOlympics.Orangefish} Frame 35
"normal"Symbol 161 MovieClip {com.rawkins.games.dolphinOlympics.Bluefish} Frame 1
"active"Symbol 161 MovieClip {com.rawkins.games.dolphinOlympics.Bluefish} Frame 31
"jumping"Symbol 161 MovieClip {com.rawkins.games.dolphinOlympics.Bluefish} Frame 41
"accelerating"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 1
"moving"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 33
"turningLeft"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 43
"turningRight"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 53
"crashingRight"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 64
"tailslide"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 80
"accelerating_left"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 117
"rolling"Symbol 308 MovieClip {com.rawkins.games.dolphinOlympics.Player} Frame 154
"page1"Symbol 432 MovieClip {HelpScreen} Frame 1
"page2"Symbol 432 MovieClip {HelpScreen} Frame 6
"page3"Symbol 432 MovieClip {HelpScreen} Frame 11
"page4"Symbol 432 MovieClip {HelpScreen} Frame 16
"on"Symbol 523 MovieClip {MuteButton} Frame 1
"off"Symbol 523 MovieClip {MuteButton} Frame 5




http://swfchan.com/4/15151/info.shtml
Created: 2/6 -2019 23:22:53 Last modified: 2/6 -2019 23:22:53 Server time: 22/12 -2024 19:45:54