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

A
Very
Merry Christmas!


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

Sheepy..swf

This is the info page for
Flash #59931

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


Text
Autofill?

Autofill?

Play Again

More Games

We Fiends

All High Scores

Game Over

You

Please wait while the leaderboard loads.
In a few cases, your rank may be inaccurate by one, in-game.
The online scoreboard should always be accurate.

High Scores

x2

x4

x8

x8

Ready?

Ready?

Programming by: Nicholas Barrios

Art and Design by: Kevin Barrios (Buzzwerd)

Music by: Stephanie Fung

Sound fx by: "Funny Laughter" by ffburn

Special Thanks to: D. Sandoval

Proudly sponsored by Armor Games

Medium

Hard

Don't lose count or you'll wake up!

Watch out: for black sheep you'll need to subtract one from your
count.

+1

-1

+1

but....

Fill your sheep-o-meter by getting a good sheep
count. Get a perfect count while it's glowing for a
score multiplier,

Let the meter fall to red and you'll wake up!

The uncertainty pod shows up every three levels.

Autofill - lost count? Use one of these to get a perfect count.

Sleeping Pill - adds 25% to your meter.

No Subtracting - having trouble subtracting?  Hope for this.

Cup 'o Joe - subtract 25% from your meter.

Shot of Adrenaline - subtracts 25% from you meter and makes the game harder.

The pod modifiers only apply to the next level, except for autofills, which you keep.

Tip: Having trouble keeping count of the flying or black sheep? Keep count of
them on your fingers and add or subtract them later.

Don't give up if you miss a few sheep.
You'll still get points if you're close!

Next

Next

Skip

Skip

Play

High Score

More Games

We Fiends

SHEEPY

Credits

Name

ActionScript [AS3]

Section 1
//Data (com.nickspeaks.sheepclass.Data) package com.nickspeaks.sheepclass { public class Data { private var sheepClipCount:int; public var ExtremeP:Number;// = 27.5 public var FastP:Number;// = 12.5 public var MediumP:Number;// = 20 public var ExtraSlowP:Number;// = 15 public var actualCount:int; public var SlowP:Number;// = 25 private var totalSheepCounted:int;// = 0 public function Data(){ ExtraSlowP = 15; SlowP = 25; MediumP = 20; FastP = 12.5; ExtremeP = 27.5; totalSheepCounted = 0; super(); } public function resetActualCount(){ totalSheepCounted = (totalSheepCounted + actualCount); actualCount = 0; } public function resetProb(){ ExtraSlowP = 15; SlowP = 25; MediumP = 20; FastP = 12.5; ExtremeP = 27.5; } public function whichWinPhrase():String{ var _local1:int; _local1 = (Math.round((Math.random() * 5)) + 1); if (_local1 == 1){ return ("Perfect!"); }; if (_local1 == 2){ return ("Sheeptastic!"); }; if (_local1 == 3){ return ("Sheeply Marvelous!"); }; if (_local1 == 4){ return ("Count Master!"); }; if (_local1 == 5){ return ("Ewe Rock!"); }; if (_local1 == 6){ return ("Fleecing Brilliant!"); }; return ("Perfect!"); } public function getSheepAmount():int{ return (sheepClipCount); } public function howMany(_arg1:int){ var _local2:Number; var _local3:Number; _arg1 = Math.round((_arg1 * 1.6)); _local2 = Math.round((_arg1 * (2 / 3))); _local3 = Math.round((_arg1 * (4 / 3))); sheepClipCount = (Math.round((Math.random() * (_local3 - _local2))) + _local2); } public function hardProb(){ ExtraSlowP = 15; SlowP = 25; MediumP = 20; FastP = 12.5; ExtremeP = 27.5; } public function reportProb(){ trace(((((((((("Extra Slow: " + ExtraSlowP) + "| Slow: ") + SlowP) + "| Medium: ") + MediumP) + "| Fast: ") + FastP) + "| Extreme: ") + ExtremeP)); } public function whichSpeed():int{ var _local1:Number; var _local2:int; _local1 = (Math.random() * 100); if ((((0 < _local1)) && ((_local1 < ExtraSlowP)))){ _local2 = 1; } else { if ((((ExtraSlowP < _local1)) && ((_local1 < (ExtraSlowP + SlowP))))){ _local2 = 2; } else { if ((((SlowP < _local1)) && ((_local1 < ((ExtraSlowP + SlowP) + MediumP))))){ _local2 = 3; } else { if ((((MediumP < _local1)) && ((_local1 < (((ExtraSlowP + SlowP) + MediumP) + FastP))))){ _local2 = 4; } else { if ((((FastP < _local1)) && ((_local1 < ((((ExtraSlowP + SlowP) + MediumP) + FastP) + ExtremeP))))){ _local2 = 5; }; }; }; }; }; return (_local2); } public function createSheepProb(){ var _local1:*; var _local2:*; _local1 = 12; _local2 = 0; if (ExtraSlowP > 0){ ExtraSlowP = (ExtraSlowP - _local1); if (ExtraSlowP < 0){ _local2 = (ExtraSlowP + _local1); ExtraSlowP = 0; }; if (_local2 > 0){ SlowP = (SlowP + _local2); } else { SlowP = (SlowP + _local1); }; } else { if (SlowP > 0){ SlowP = (SlowP - _local1); if (SlowP < 0){ _local2 = (SlowP + _local1); SlowP = 0; }; if (_local2 > 0){ MediumP = (MediumP + _local2); } else { MediumP = (MediumP + _local1); }; } else { if (MediumP > 0){ MediumP = (MediumP - _local1); if (MediumP < 0){ _local2 = (MediumP + _local1); MediumP = 0; }; if (_local2 > 0){ FastP = (FastP + _local2); } else { FastP = (FastP + _local1); }; } else { if (FastP > 0){ FastP = (FastP - _local1); if (FastP < 0){ _local2 = (FastP + _local1); FastP = 0; }; if (_local2 > 0){ ExtremeP = (ExtremeP + _local2); } else { ExtremeP = (ExtremeP + _local1); }; }; }; }; }; } } }//package com.nickspeaks.sheepclass
Section 2
//flyingSheep (com.nickspeaks.sheepclass.flyingSheep) package com.nickspeaks.sheepclass { import flash.display.*; import flash.events.*; import flash.media.*; public class flyingSheep extends MovieClip { var sheepSlow:sheepFlyingSlow; var flychan:SoundChannel; var sheepFast:sheepFlyingFast; var alreadyRunning:Boolean;// = false var difficultyInternal:String; var flys:FlyingSound; var sheepMedium:sheepFlyingMedium; public function flyingSheep(){ sheepSlow = new sheepFlyingSlow(); sheepMedium = new sheepFlyingMedium(); sheepFast = new sheepFlyingFast(); alreadyRunning = false; flys = new FlyingSound(); super(); sheepSlow.x = 700; sheepSlow.y = 20; sheepMedium.x = 700; sheepMedium.y = 20; sheepFast.x = 700; sheepFast.y = 20; } public function init(_arg1:int):Boolean{ if (!alreadyRunning){ if (_arg1 > 7){ if (shouldDraw(determineProb(_arg1))){ alreadyRunning = true; Draw(whichSpeed()); return (true); }; }; }; return (false); } private function whichSpeed():String{ var _local1:String; var _local2:int; _local2 = (Math.round((Math.random() * 2)) + 1); if (_local2 == 1){ _local1 = "slow"; } else { if (_local2 == 2){ _local1 = "med"; } else { if (_local2 == 3){ _local1 = "fast"; }; }; }; return (_local1); } private function determineProb(_arg1:int):Number{ var _local2:Number; var _local3:Number; _local2 = 0; _local3 = (_arg1 * 0.03); _local2 = (_local2 + _local3); if (_local2 < 0.85){ return (_local2); }; return (0.85); } private function Draw(_arg1:String){ flychan = flys.play(); if (_arg1 == "slow"){ sheepSlow.addEventListener(Event.COMPLETE, remove); sheepSlow.gotoAndPlay(1); this.addChild(sheepSlow); } else { if (_arg1 == "med"){ sheepMedium.addEventListener(Event.COMPLETE, remove); sheepMedium.gotoAndPlay(1); this.addChild(sheepMedium); } else { if (_arg1 == "fast"){ sheepFast.addEventListener(Event.COMPLETE, remove); sheepFast.gotoAndPlay(1); this.addChild(sheepFast); }; }; }; } private function remove(_arg1:Event){ _arg1.currentTarget.stop(); this.removeChildAt(0); alreadyRunning = false; } private function shouldDraw(_arg1:Number):Boolean{ var _local2:Number; _local2 = Math.random(); if (_local2 <= _arg1){ return (true); }; return (false); } public function setDiff(_arg1:String){ difficultyInternal = _arg1; } } }//package com.nickspeaks.sheepclass
Section 3
//GameOver (com.nickspeaks.sheepclass.GameOver) package com.nickspeaks.sheepclass { import fl.controls.*; import flash.display.*; import flash.events.*; import fl.data.*; import flash.text.*; import fl.controls.dataGridClasses.*; import flash.utils.*; import flash.media.*; import flash.net.*; public class GameOver extends MovieClip { var diff:String; var myDataGrid:DataGrid; var intscore:scoreKeeper; public var mGames:MoreGames; public var wFiends:WeFiends; var run:int;// = 1 public var hScores:HighScore; public var pAgain:sheepPlay; var nexts:NextS; var userName:String; public static var DONE:String = "done"; public function GameOver(_arg1:scoreKeeper, _arg2:String){ var _local3:Timer; run = 1; myDataGrid = new DataGrid(); intscore = new scoreKeeper(0); nexts = new NextS(); super(); addFrameScript(137, frame138, 159, frame160); this.x = -11; this.y = 11; _arg1.getScore(_arg2); intscore = _arg1; this.addEventListener(Event.COMPLETE, removeMe); this.pAgain.addEventListener(MouseEvent.CLICK, sheepyPlay); this.mGames.addEventListener(MouseEvent.CLICK, urltoMoreGames); this.wFiends.addEventListener(MouseEvent.CLICK, urltoWeFiends); this.hScores.addEventListener(MouseEvent.CLICK, urltoHighScore); _local3 = new Timer(1000, 5); _local3.addEventListener(TimerEvent.TIMER_COMPLETE, waitforXML); _local3.start(); } private function urltoWeFiends(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.wefiends.com/"); navigateToURL(_local2); } private function urltoHighScore(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.wefiends.com/highscore/"); navigateToURL(_local2); } function frame160(){ dispatchEvent(new Event(Event.COMPLETE)); } private function createTable(_arg1:XML):void{ var _local2:TextFormat; var _local3:DataProvider; var _local4:*; var _local5:Number; _local2 = new TextFormat(); _local2.color = 0; _local2.size = 12; _local2.align = TextFormatAlign.CENTER; _local2.font = "Futura"; myDataGrid.setStyle("textFormat", _local2); _local3 = new DataProvider(_arg1); _local4 = []; _local5 = 0; while (_local5 < _arg1.children()[0].children().length()) { _local4[_local5] = new DataGridColumn(); String(_arg1.children()[0].children()[_local5].name()); _local5++; }; _local4[0].width = 150; _local4[1].width = 20; _local4[2].width = 100; _local5 = 0; while (_local5 < _arg1.children()[0].children().length()) { myDataGrid.addColumn(_local4[_local5]); _local5++; }; myDataGrid.columns = ["Name", "Rank", "Score"]; myDataGrid.dataProvider = _local3; myDataGrid.width = 270; myDataGrid.rowCount = _local3.length; myDataGrid.move(222, 70); myDataGrid.sortableColumns = false; this.addChild(myDataGrid); } private function removeMe(_arg1:Event){ _arg1.currentTarget.stop(); this.parent.removeChildAt(0); done(); } private function waitforXML(_arg1:TimerEvent){ createTable(intscore.scoreGridXML); } private function urltoMoreGames(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.armorgames.com"); navigateToURL(_local2); } private function done():void{ dispatchEvent(new Event(GameOver.DONE)); } function frame138(){ stop(); } private function sheepyPlay(_arg1:MouseEvent){ var _local2:SoundChannel; _local2 = nexts.play(); _arg1.currentTarget.parent.play(); this.removeChild(myDataGrid); } } }//package com.nickspeaks.sheepclass
Section 4
//Intro (com.nickspeaks.sheepclass.Intro) package com.nickspeaks.sheepclass { import flash.display.*; import flash.events.*; import fl.events.*; import flash.text.*; import flash.media.*; import flash.net.*; public class Intro extends MovieClip { var diff:String; var weIntro:WeFiendsIntro; var armor:armorgames; var sheepTextFormat:TextFormat; var smenu:sheepMenu; var run:int;// = 1 var sname:sheepName; var diffclip:sheepDiff; var instruclip:sheepInstruc; var nexts:NextS; var userName:String; public static var DONE:String = "done"; public function Intro(){ smenu = new sheepMenu(); diffclip = new sheepDiff(); instruclip = new sheepInstruc(); sname = new sheepName(); weIntro = new WeFiendsIntro(); nexts = new NextS(); armor = new armorgames(); run = 1; sheepTextFormat = new TextFormat(); super(); sname.x = 283; sname.y = 65; instruclip.x = 0; instruclip.y = 26; diffclip.x = 285; diffclip.y = 65; armor.stop(); armor.x = 307; armor.y = 120; smenu.x = 10; smenu.y = 35; weIntro.x = 165; weIntro.y = 20; sheepTextFormat.size = 40; sheepTextFormat.font = "Futura"; sheepTextFormat.align = TextFormatAlign.CENTER; sname.Name.setStyle("embedFonts", true); sname.Name.setStyle("textFormat", sheepTextFormat); } public function getName():String{ return (userName); } private function urltoHighScore(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.wefiends.com/highscore/"); navigateToURL(_local2); } private function setName(_arg1:ComponentEvent){ userName = _arg1.currentTarget.text; sname.removeEventListener(ComponentEvent.ENTER, setName); } public function init(_arg1:int=0){ if (_arg1 > 0){ run = _arg1; }; if (run == 1){ run++; armor.gotoAndPlay(1); addChild(armor); armor.addEventListener(MouseEvent.CLICK, urltoMoreGames); armor.addEventListener(Event.COMPLETE, removeMe); } else { if (run == 2){ run++; weIntro.gotoAndPlay(1); addChild(weIntro); weIntro.addEventListener(MouseEvent.CLICK, urltoWeFiends); weIntro.addEventListener(Event.COMPLETE, removeMe); } else { if (run == 3){ run++; smenu.gotoAndPlay(1); addChild(smenu); smenu.Sheepy.addEventListener(MouseEvent.CLICK, urltoSheepy); smenu.SheepPlay.addEventListener(MouseEvent.CLICK, sheepMenuPlay); smenu.HighScore.addEventListener(MouseEvent.CLICK, urltoHighScore); smenu.MoreGames.addEventListener(MouseEvent.CLICK, urltoMoreGames); smenu.WeFiends.addEventListener(MouseEvent.CLICK, urltoWeFiends); smenu.Credits.addEventListener(MouseEvent.CLICK, openCredits); smenu.addEventListener(Event.COMPLETE, removeMe); } else { if (run == 4){ run++; sname.gotoAndPlay(1); addChild(sname); sname.Name.addEventListener(ComponentEvent.ENTER, setName); sname.addEventListener(ComponentEvent.ENTER, removeMe); } else { if (run == 5){ run++; diffclip.gotoAndPlay(1); addChild(diffclip); diffclip.addEventListener(MouseEvent.CLICK, setDifficulty); diffclip.addEventListener(Event.COMPLETE, removeMe); } else { if (run == 6){ run++; instruclip.gotoAndPlay(1); addChild(instruclip); instruclip.addEventListener(MouseEvent.CLICK, slideInstruc); instruclip.addEventListener(Event.COMPLETE, removeMe); } else { if (run == 7){ done(); }; }; }; }; }; }; }; } private function urltoWeFiends(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.wefiends.com/"); navigateToURL(_local2); } private function removeMe(_arg1:Event){ sname.removeEventListener(ComponentEvent.ENTER, removeMe); _arg1.currentTarget.stop(); this.removeChildAt(0); init(); } private function urltoSheepy(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.wefiends.com/sheepy/"); navigateToURL(_local2); } private function urltoMoreGames(_arg1:MouseEvent):void{ var _local2:URLRequest; _local2 = new URLRequest("http://www.armorgames.com"); navigateToURL(_local2); } private function removeCredits(_arg1:MouseEvent){ _arg1.currentTarget.play(); } private function skipInstruc(_arg1:MouseEvent){ trace(("Clicked on: " + _arg1.target.toString())); _arg1.currentTarget.gotoAndPlay(43); } private function slideInstruc(_arg1:MouseEvent){ var _local2:SoundChannel; trace(("Click on: " + _arg1.target.toString())); if (_arg1.target.toString() == "[object SimpleButton]"){ _local2 = nexts.play(); _arg1.currentTarget.play(); } else { if (_arg1.target.toString() == "[object Ready]"){ _local2 = nexts.play(); _arg1.currentTarget.play(); } else { if (_arg1.target.toString() == "[object Skip]"){ _local2 = nexts.play(); _arg1.currentTarget.gotoAndPlay(56); }; }; }; } private function done():void{ dispatchEvent(new Event(Intro.DONE)); } private function sheepMenuPlay(_arg1:MouseEvent){ var _local2:SoundChannel; _local2 = nexts.play(); _arg1.currentTarget.parent.play(); } private function setDifficulty(_arg1:MouseEvent){ var _local2:SoundChannel; if (_arg1.target.toString() == "[object EasyButton]"){ _local2 = nexts.play(); diff = "easy"; _arg1.currentTarget.play(); } else { if (_arg1.target.toString() == "[object MedButton]"){ _local2 = nexts.play(); diff = "med"; _arg1.currentTarget.play(); } else { if (_arg1.target.toString() == "[object HardButton]"){ _local2 = nexts.play(); diff = "hard"; _arg1.currentTarget.play(); }; }; }; } public function getDifficulty():String{ return (diff); } private function removeCreditsFromScreen(_arg1:Event){ this.removeChildAt(1); } private function openCredits(_arg1:MouseEvent):void{ var _local2:sheepCredits; _local2 = new sheepCredits(); _local2.x = 30; _local2.y = 40; _local2.addEventListener(MouseEvent.CLICK, removeCredits); _local2.addEventListener(Event.COMPLETE, removeCreditsFromScreen); this.addChild(_local2); } } }//package com.nickspeaks.sheepclass
Section 5
//jumpingSheep (com.nickspeaks.sheepclass.jumpingSheep) package com.nickspeaks.sheepclass { import flash.display.*; import flash.events.*; import flash.media.*; public class jumpingSheep extends MovieClip { var jumps:jumpSound; var jumpchannel:SoundChannel; var alreadyRunning:Boolean;// = false var sheepLeap:sheepJump; var difficultyInternal:String; var sheepPeak:sheepTop; public function jumpingSheep(){ sheepLeap = new sheepJump(); sheepPeak = new sheepTop(); alreadyRunning = false; jumps = new jumpSound(); super(); sheepLeap.x = 520; sheepLeap.y = 300; sheepPeak.x = 20; sheepPeak.y = -50; } public function init(_arg1:int):Boolean{ if (!alreadyRunning){ if (_arg1 > 2){ if (shouldDraw(determineProb(_arg1))){ alreadyRunning = true; Draw(whichSheep()); return (true); }; }; }; return (false); } private function whichSheep():String{ var _local1:String; var _local2:int; _local2 = (Math.round((Math.random() * 1)) + 1); if (_local2 == 1){ _local1 = "top"; } else { if (_local2 == 2){ _local1 = "bottom"; }; }; return (_local1); } private function determineProb(_arg1:int):Number{ var _local2:Number; var _local3:Number; _local2 = 0; _local3 = (_arg1 * 0.04); _local2 = (_local2 + _local3); if (_local2 < 0.85){ return (_local2); }; return (0.85); } private function Draw(_arg1:String){ if (_arg1 == "top"){ jumpchannel = jumps.play(); sheepPeak.addEventListener(Event.COMPLETE, remove); sheepPeak.gotoAndPlay(1); this.addChild(sheepPeak); } else { if (_arg1 == "bottom"){ jumpchannel = jumps.play(); sheepLeap.addEventListener(Event.COMPLETE, remove); sheepLeap.gotoAndPlay(1); this.addChild(sheepLeap); }; }; } private function remove(_arg1:Event){ _arg1.currentTarget.stop(); this.removeChildAt(0); alreadyRunning = false; } private function shouldDraw(_arg1:Number):Boolean{ var _local2:Number; _local2 = Math.random(); if (_local2 <= _arg1){ return (true); }; return (false); } public function setDiff(_arg1:String){ difficultyInternal = _arg1; } } }//package com.nickspeaks.sheepclass
Section 6
//levelBox (com.nickspeaks.sheepclass.levelBox) package com.nickspeaks.sheepclass { import flash.events.*; import flash.text.*; public class levelBox extends TextField { var scoreBoxFormat:TextFormat; public function levelBox(){ scoreBoxFormat = new TextFormat(); super(); scoreBoxFormat.color = 0xFFFFFF; scoreBoxFormat.size = 13; scoreBoxFormat.align = TextFormatAlign.CENTER; scoreBoxFormat.font = "Futura"; this.embedFonts = true; this.defaultTextFormat = scoreBoxFormat; this.width = 62; this.text = "Level 1"; this.x = 319; this.y = 327; } public function setLevel(_arg1:Event){ this.text = ("Level " + _arg1.currentTarget.level.toString()); } } }//package com.nickspeaks.sheepclass
Section 7
//Meter (com.nickspeaks.sheepclass.Meter) package com.nickspeaks.sheepclass { import flash.display.*; import flash.events.*; public class Meter extends MovieClip { public function Meter(_arg1:int){ this.gotoAndStop(_arg1); } public function updateMeter(_arg1:Event){ this.gotoAndStop(_arg1.currentTarget.onframe); } } }//package com.nickspeaks.sheepclass
Section 8
//Multiplier (com.nickspeaks.sheepclass.Multiplier) package com.nickspeaks.sheepclass { import flash.display.*; import flash.events.*; public class Multiplier extends MovieClip { public function Multiplier(_arg1:int){ this.gotoAndStop(_arg1); } public function updateMultiplier(_arg1:Event){ if (_arg1.currentTarget.multiplier == 1){ this.gotoAndStop(1); } else { if (_arg1.currentTarget.multiplier == 2){ this.gotoAndStop(2); } else { if (_arg1.currentTarget.multiplier == 4){ this.gotoAndStop(3); } else { if (_arg1.currentTarget.multiplier == 8){ this.gotoAndStop(4); }; }; }; }; } } }//package com.nickspeaks.sheepclass
Section 9
//Player (com.nickspeaks.sheepclass.Player) package com.nickspeaks.sheepclass { public class Player { public var level:int; var Pdifficulty:String; var Pcolor:String; public var Pname:String; public function Player(_arg1:String, _arg2:String){ Pname = _arg1; Pcolor = _arg2; } public function difficulty():String{ return (Pdifficulty); } public function setDifficulty(_arg1:String){ Pdifficulty = _arg1; } public function setName(_arg1:String){ Pname = _arg1; } public function get PlayerName():String{ return (Pname); } } }//package com.nickspeaks.sheepclass
Section 10
//scoreBox (com.nickspeaks.sheepclass.scoreBox) package com.nickspeaks.sheepclass { import flash.events.*; import flash.text.*; public class scoreBox extends TextField { var scoreBoxFormat:TextFormat; public function scoreBox(){ scoreBoxFormat = new TextFormat(); super(); scoreBoxFormat.color = 0xFFFFFF; scoreBoxFormat.size = 32; scoreBoxFormat.align = TextFormatAlign.RIGHT; scoreBoxFormat.font = "Futura"; this.embedFonts = true; this.defaultTextFormat = scoreBoxFormat; this.width = 125; this.text = "0"; this.x = 575; this.y = 286; } public function setScore(_arg1:Event){ this.text = _arg1.currentTarget.score.toString(); } } }//package com.nickspeaks.sheepclass
Section 11
//scoreKeeper (com.nickspeaks.sheepclass.scoreKeeper) package com.nickspeaks.sheepclass { import flash.events.*; import flash.net.*; public class scoreKeeper extends EventDispatcher { public var level:int; public var meter:int; var adder:int; public var score:int; public var pscore:int; var scoreXML:XML; public var autofill;// = 0 var difficulty:String; var playerid:int; var multiplier:int;// = 1 public var nosubtract:Boolean;// = false public var onframe:int; public var mask;// = false public var extrahard;// = false public static var UPDATE:String = "update"; public function scoreKeeper(_arg1:int){ multiplier = 1; nosubtract = false; autofill = 0; mask = false; extrahard = false; scoreXML = new XML(); super(); score = _arg1; meter = 50; onframe = 25; level = 1; } private function determineAdder(){ if (difficulty == "easy"){ adder = 500; } else { if (difficulty == "med"){ adder = 750; } else { if (difficulty == "hard"){ adder = 1000; }; }; }; } private function meterScore(_arg1:int){ if (difficulty == "easy"){ if (_arg1 == 1){ determineMeter(15); } else { if (_arg1 == 2){ determineMeter(3); } else { if (_arg1 == 3){ determineMeter(0); } else { if (_arg1 == 4){ determineMeter(-10); } else { if (_arg1 == 5){ determineMeter(-20); }; }; }; }; }; } else { if (difficulty == "med"){ if (_arg1 == 1){ determineMeter(10); } else { if (_arg1 == 2){ determineMeter(2); } else { if (_arg1 == 3){ determineMeter(0); } else { if (_arg1 == 4){ determineMeter(-20); } else { if (_arg1 == 5){ determineMeter(-30); }; }; }; }; }; } else { if (difficulty == "hard"){ if (_arg1 == 1){ determineMeter(5); } else { if (_arg1 == 2){ determineMeter(0); } else { if (_arg1 == 3){ determineMeter(-20); } else { if (_arg1 == 4){ determineMeter(-35); } else { if (_arg1 == 5){ determineMeter(-50); }; }; }; }; }; }; }; }; } public function setDiff(_arg1:String){ difficulty = _arg1; determineAdder(); } private function lastID(_arg1:Event){ trace(_arg1.target.data); playerid = _arg1.target.data; } private function sendScoreEvent():void{ dispatchEvent(new Event(scoreKeeper.UPDATE)); } public function setScore(_arg1:int, _arg2:int){ var _local3:Number; nosubtract = false; extrahard = false; mask = false; level++; _local3 = (_arg2 / _arg1); if (_local3 == 1){ if ((((multiplier < 5)) && ((onframe > 42)))){ multiplier = (multiplier * 2); }; score = (score + (adder * multiplier)); meterScore(1); } else { if ((((_local3 > 0.95)) && ((_local3 < 1.05)))){ multiplier = 1; score = (score + (adder * 0.75)); meterScore(2); } else { if ((((_local3 > 0.85)) && ((_local3 < 1.15)))){ multiplier = 1; score = (score + (adder * 0.5)); meterScore(3); } else { if ((((_local3 > 0.75)) && ((_local3 < 1.25)))){ multiplier = 1; score = (score + (adder * 0.25)); meterScore(4); } else { multiplier = 1; meterScore(5); }; }; }; }; } public function submitScore(_arg1:String){ var _local2:URLVariables; var _local3:URLRequest; var _local4:URLLoader; _local2 = new URLVariables(); if (_arg1 == null){ _arg1 = "Sheepy"; }; _local2.name = _arg1; _local2.score = pscore; _local3 = new URLRequest(); _local3.url = "http://www.wefiends.com/sheepy/submitScore.php"; _local3.data = _local2; _local4 = new URLLoader(); _local4.load(_local3); _local4.addEventListener(Event.COMPLETE, lastID); } public function scoreReset(){ pscore = score; score = 0; meter = 50; onframe = 25; level = 1; determineFrame(); } private function returnedScores(_arg1:Event){ scoreXML = XML(_arg1.target.data); } public function determineFrame(){ onframe = Math.round((meter / 2)); sendScoreEvent(); } public function getScore(_arg1:String){ var _local2:URLVariables; var _local3:URLRequest; var _local4:URLLoader; _local2 = new URLVariables(); _local2.lastid = playerid; if (_arg1 == null){ _arg1 = "Sheepy"; }; _local2.username = _arg1; _local2.score = pscore; _local3 = new URLRequest(); _local3.url = "http://www.wefiends.com/sheepy/getScore.php"; _local3.data = _local2; _local4 = new URLLoader(); _local4.load(_local3); _local4.addEventListener(Event.COMPLETE, returnedScores); } private function determineMeter(_arg1:int){ if ((_arg1 + meter) >= 100){ meter = 100; } else { if ((_arg1 + meter) <= 0){ meter = 0; } else { meter = (meter + _arg1); }; }; determineFrame(); } public function get scoreGridXML():XML{ return (scoreXML); } } }//package com.nickspeaks.sheepclass
Section 12
//sheepBonus (com.nickspeaks.sheepclass.sheepBonus) package com.nickspeaks.sheepclass { import flash.display.*; import flash.events.*; import flash.media.*; public class sheepBonus extends MovieClip { public var sbuzz1:GoodBuzz; public var sbuzz2:Buzz; public var sbuzz3:Buzz; public var sbuzz4:GoodBuzz; var powerName:String; public var sbuzz5:GoodBuzz; public var soundc3:SoundChannel; public var soundc1:SoundChannel; public var soundc4:SoundChannel; public var soundc5:SoundChannel; public var soundc2:SoundChannel; public function sheepBonus(_arg1:scoreKeeper):void{ addFrameScript(87, frame88, 92, frame93, 97, frame98, 103, frame104, 110, frame111, 118, frame119); powerName = choosePowerup(); checkMeterMods(_arg1); if (powerName == "nosubtract"){ _arg1.nosubtract = true; } else { if (powerName == "autofill"){ _arg1.autofill++; trace(("Autofills: " + _arg1.autofill)); } else { if (powerName == "mask"){ _arg1.mask = true; } else { if (powerName == "extrahard"){ _arg1.extrahard = true; }; }; }; }; trace(("Powerup choosen: " + powerName)); } function frame88(){ if (powerName == "mask"){ stop(); }; dispatchEvent(new Event(Event.COMPLETE)); } function frame98(){ if (powerName == "metersub"){ sbuzz2 = new Buzz(); soundc2 = sbuzz2.play(); stop(); }; } private function choosePowerup():String{ var _local1:int; _local1 = Math.round(((Math.random() * 5) + 1)); if (_local1 == 1){ return ("mask"); }; if (_local1 == 2){ return ("nosubtract"); }; if (_local1 == 3){ return ("metersub"); }; if (_local1 == 4){ return ("extrahard"); }; if (_local1 == 5){ return ("autofill"); }; if (_local1 == 6){ return ("meterplus"); }; return ("metersub"); } function frame104(){ if (powerName == "extrahard"){ sbuzz3 = new Buzz(); soundc3 = sbuzz3.play(); stop(); }; } function frame111(){ if (powerName == "autofill"){ sbuzz4 = new GoodBuzz(); soundc4 = sbuzz4.play(); stop(); }; } private function checkMeterMods(_arg1:scoreKeeper){ if ((((powerName == "metersub")) || ((powerName == "extrahard")))){ if (_arg1.meter > 25){ _arg1.meter = (_arg1.meter - 24); } else { _arg1.meter = 1; }; } else { if (powerName == "meterplus"){ if (_arg1.meter < 76){ _arg1.meter = (_arg1.meter + 25); } else { _arg1.meter = 100; }; }; }; _arg1.determineFrame(); } function frame93(){ if (powerName == "nosubtract"){ sbuzz1 = new GoodBuzz(); soundc1 = sbuzz1.play(); stop(); }; } function frame119(){ if (powerName == "meterplus"){ sbuzz5 = new GoodBuzz(); soundc5 = sbuzz5.play(); stop(); }; } } }//package com.nickspeaks.sheepclass
Section 13
//BaseScrollPane (fl.containers.BaseScrollPane) package fl.containers { import fl.core.*; import fl.controls.*; import flash.display.*; import flash.events.*; import fl.events.*; import flash.geom.*; 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 14
//DataGridCellEditor (fl.controls.dataGridClasses.DataGridCellEditor) package fl.controls.dataGridClasses { import fl.controls.listClasses.*; import fl.controls.*; public class DataGridCellEditor extends TextInput implements ICellRenderer { protected var _data:Object; protected var _listData:ListData; private static var defaultStyles:Object = {textPadding:1, textFormat:null, upSkin:"DataGridCellEditor_skin"}; public function DataGridCellEditor():void{ } public function get selected():Boolean{ return (false); } public function set listData(_arg1:ListData):void{ _listData = _arg1; text = _listData.label; } public function setMouseState(_arg1:String):void{ } public function set selected(_arg1:Boolean):void{ } public function set data(_arg1:Object):void{ _data = _arg1; } public function get listData():ListData{ return (_listData); } public function get data():Object{ return (_data); } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls.dataGridClasses
Section 15
//DataGridColumn (fl.controls.dataGridClasses.DataGridColumn) package fl.controls.dataGridClasses { import fl.core.*; import fl.controls.*; public class DataGridColumn { private var _headerText:String; public var editorDataField:String;// = "text" private var forceImport:DataGridCellEditor; private var _headerRenderer:Object; public var sortOptions:uint;// = 0 private var _cellRenderer:Object; private var _columnName:String; public var resizable:Boolean;// = true private var _sortCompareFunction:Function; private var _visible:Boolean;// = true public var sortDescending:Boolean;// = false public var owner:DataGrid; private var _imeMode:String; private var _width:Number;// = 100 public var editable:Boolean;// = true public var itemEditor:Object;// = "fl.controls.dataGridClasses.DataGridCellEditor" public var explicitWidth:Number; private var _minWidth:Number;// = 20 private var _labelFunction:Function; public var sortable:Boolean;// = true public var colNum:Number; public var dataField:String; public function DataGridColumn(_arg1:String=null){ _minWidth = 20; _width = 100; _visible = true; sortable = true; resizable = true; editable = true; itemEditor = "fl.controls.dataGridClasses.DataGridCellEditor"; editorDataField = "text"; sortDescending = false; sortOptions = 0; super(); if (_arg1){ dataField = _arg1; headerText = _arg1; }; } public function set headerRenderer(_arg1:Object):void{ _headerRenderer = _arg1; if (owner){ owner.invalidate(InvalidationType.DATA); }; } public function get imeMode():String{ return (_imeMode); } public function setWidth(_arg1:Number):void{ _width = _arg1; } public function set width(_arg1:Number):void{ var _local2:Boolean; explicitWidth = _arg1; if (owner != null){ _local2 = resizable; resizable = false; owner.resizeColumn(colNum, _arg1); resizable = _local2; } else { _width = _arg1; }; } public function set cellRenderer(_arg1:Object):void{ _cellRenderer = _arg1; if (owner){ owner.invalidate(InvalidationType.DATA); }; } public function get minWidth():Number{ return (_minWidth); } public function set imeMode(_arg1:String):void{ _imeMode = _arg1; } public function toString():String{ return ("[object DataGridColumn]"); } public function get visible():Boolean{ return (_visible); } public function itemToLabel(_arg1:Object):String{ var data = _arg1; if (!data){ return (" "); }; if (labelFunction != null){ return (labelFunction(data)); }; if (owner.labelFunction != null){ return (owner.labelFunction(data, this)); }; if ((((typeof(data) == "object")) || ((typeof(data) == "xml")))){ try { data = data[dataField]; } catch(e:Error) { data = null; }; }; if ((data is String)){ return (String(data)); }; try { return (data.toString()); } catch(e:Error) { }; return (" "); } public function set minWidth(_arg1:Number):void{ _minWidth = _arg1; if (_width < _arg1){ _width = _arg1; }; if (owner){ owner.invalidate(InvalidationType.SIZE); }; } public function set headerText(_arg1:String):void{ _headerText = _arg1; if (owner){ owner.invalidate(InvalidationType.DATA); }; } public function set sortCompareFunction(_arg1:Function):void{ _sortCompareFunction = _arg1; } public function get width():Number{ return (_width); } public function get cellRenderer():Object{ return (_cellRenderer); } public function set labelFunction(_arg1:Function):void{ if (_labelFunction == _arg1){ return; }; _labelFunction = _arg1; if (owner){ owner.invalidate(InvalidationType.DATA); }; } public function get headerText():String{ return (((_headerText)!=null) ? _headerText : dataField); } public function get sortCompareFunction():Function{ return (_sortCompareFunction); } public function get headerRenderer():Object{ return (_headerRenderer); } public function get labelFunction():Function{ return (_labelFunction); } public function set visible(_arg1:Boolean):void{ if (_visible != _arg1){ _visible = _arg1; if (owner){ owner.invalidate(InvalidationType.SIZE); }; }; } } }//package fl.controls.dataGridClasses
Section 16
//HeaderRenderer (fl.controls.dataGridClasses.HeaderRenderer) package fl.controls.dataGridClasses { import fl.controls.*; public class HeaderRenderer extends LabelButton { public var _column:uint; private static var defaultStyles:Object = {upSkin:"HeaderRenderer_upSkin", downSkin:"HeaderRenderer_downSkin", overSkin:"HeaderRenderer_overSkin", disabledSkin:"HeaderRenderer_disabledSkin", selectedDisabledSkin:"HeaderRenderer_selectedDisabledSkin", selectedUpSkin:"HeaderRenderer_selectedUpSkin", selectedDownSkin:"HeaderRenderer_selectedDownSkin", selectedOverSkin:"HeaderRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, textPadding:5}; public function HeaderRenderer():void{ focusEnabled = false; } public function set column(_arg1:uint):void{ _column = _arg1; } public function get column():uint{ return (_column); } override protected function drawLayout():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local1 = Number(getStyleValue("textPadding")); textField.height = (textField.textHeight + 4); textField.visible = (label.length > 0); _local2 = (textField.textWidth + 4); _local3 = (textField.textHeight + 4); _local4 = ((icon)==null) ? 0 : (icon.width + 4); _local5 = Math.max(0, Math.min(_local2, ((width - (2 * _local1)) - _local4))); if (icon != null){ icon.x = (((width - _local1) - icon.width) - 2); icon.y = Math.round(((height - icon.height) / 2)); }; textField.width = _local5; textField.x = _local1; textField.y = Math.round(((height - textField.height) / 2)); background.width = width; background.height = height; } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls.dataGridClasses
Section 17
//CellRenderer (fl.controls.listClasses.CellRenderer) package fl.controls.listClasses { import fl.controls.*; import flash.events.*; 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 18
//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 19
//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 20
//BaseButton (fl.controls.BaseButton) package fl.controls { import fl.core.*; import flash.display.*; import flash.events.*; 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 21
//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 22
//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 23
//DataGrid (fl.controls.DataGrid) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.display.*; import flash.events.*; import fl.data.*; import fl.managers.*; import fl.events.*; import fl.controls.dataGridClasses.*; import flash.utils.*; import flash.geom.*; import flash.ui.*; public class DataGrid extends SelectableList implements IFocusManagerComponent { protected var _showHeaders:Boolean;// = true protected var _sortIndex:int;// = -1 protected var _minColumnWidth:Number; protected var _headerRenderer:Object; public var sortableColumns:Boolean;// = true protected var activeCellRenderersMap:Dictionary; protected var _labelFunction:Function; protected var headerSortArrow:Sprite; protected var _sortDescending:Boolean;// = false protected var losingFocus:Boolean;// = false protected var maxHeaderHeight:Number;// = 25 protected var minColumnWidthInvalid:Boolean;// = false protected var _rowHeight:Number;// = 20 protected var _cellRenderer:Object; protected var proposedEditedItemPosition; public var editable:Boolean;// = false protected var dragHandlesMap:Dictionary; protected var header:Sprite; protected var availableCellRenderersMap:Dictionary; protected var _columns:Array; public var resizableColumns:Boolean;// = true protected var columnStretchStartWidth:Number; protected var actualRowIndex:int; protected var _editedItemPosition:Object; protected var editedItemPositionChanged:Boolean;// = false protected var actualColIndex:int; protected var columnStretchCursor:Sprite; protected var visibleColumns:Array; protected var headerMask:Sprite; public var itemEditorInstance:Object; protected var displayableColumns:Array; protected var columnStretchIndex:Number;// = -1 protected var columnsInvalid:Boolean;// = true protected var currentHoveredRow:int;// = -1 protected var isPressed:Boolean;// = false protected var lastSortIndex:int;// = -1 protected var columnStretchStartX:Number; protected var _headerHeight:Number;// = 25 protected static const HEADER_STYLES:Object = {disabledSkin:"headerDisabledSkin", downSkin:"headerDownSkin", overSkin:"headerOverSkin", upSkin:"headerUpSkin", textFormat:"headerTextFormat", disabledTextFormat:"headerDisabledTextFormat", textPadding:"headerTextPadding"}; private static var defaultStyles:Object = {headerUpSkin:"HeaderRenderer_upSkin", headerDownSkin:"HeaderRenderer_downSkin", headerOverSkin:"HeaderRenderer_overSkin", headerDisabledSkin:"HeaderRenderer_disabledSkin", headerSortArrowDescSkin:"HeaderSortArrow_descIcon", headerSortArrowAscSkin:"HeaderSortArrow_ascIcon", columnStretchCursorSkin:"ColumnStretch_cursor", columnDividerSkin:null, headerTextFormat:null, headerDisabledTextFormat:null, headerTextPadding:5, headerRenderer:HeaderRenderer, focusRectSkin:null, focusRectPadding:null, skin:"DataGrid_skin"}; public static var createAccessibilityImplementation:Function; public function DataGrid(){ _rowHeight = 20; _headerHeight = 25; _showHeaders = true; columnsInvalid = true; minColumnWidthInvalid = false; columnStretchIndex = -1; _sortIndex = -1; lastSortIndex = -1; _sortDescending = false; editedItemPositionChanged = false; isPressed = false; losingFocus = false; maxHeaderHeight = 25; currentHoveredRow = -1; editable = false; resizableColumns = true; sortableColumns = true; super(); if (_columns == null){ _columns = []; }; _horizontalScrollPolicy = ScrollPolicy.OFF; activeCellRenderersMap = new Dictionary(true); availableCellRenderersMap = new Dictionary(true); addEventListener(DataGridEvent.ITEM_EDIT_BEGINNING, itemEditorItemEditBeginningHandler, false, -50); addEventListener(DataGridEvent.ITEM_EDIT_BEGIN, itemEditorItemEditBeginHandler, false, -50); addEventListener(DataGridEvent.ITEM_EDIT_END, itemEditorItemEditEndHandler, false, -50); addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); } override protected function drawList():void{ var _local1:uint; var _local2:uint; var _local3:Number; var _local4:Number; var _local5:uint; var _local6:Object; var _local7:ICellRenderer; var _local8:Array; var _local9:DataGridColumn; var _local10:Boolean; var _local11:Dictionary; var _local12:DataGridColumn; var _local13:Sprite; var _local14:UIComponent; var _local15:Array; var _local16:uint; var _local17:uint; var _local18:Number; var _local19:DataGridColumn; var _local20:Object; var _local21:Array; var _local22:Dictionary; var _local23:Object; var _local24:HeaderRenderer; var _local25:Sprite; var _local26:Graphics; var _local27:Boolean; var _local28:String; if (showHeaders){ header.visible = true; header.x = (contentPadding - _horizontalScrollPosition); header.y = contentPadding; listHolder.y = (contentPadding + headerHeight); _local18 = Math.floor((availableHeight - headerHeight)); _verticalScrollBar.setScrollProperties(_local18, 0, (contentHeight - _local18), _verticalScrollBar.pageScrollSize); } else { header.visible = false; listHolder.y = contentPadding; }; listHolder.x = contentPadding; contentScrollRect = listHolder.scrollRect; contentScrollRect.x = _horizontalScrollPosition; contentScrollRect.y = (vOffset + (Math.floor(_verticalScrollPosition) % rowHeight)); listHolder.scrollRect = contentScrollRect; listHolder.cacheAsBitmap = useBitmapScrolling; _local1 = Math.min(Math.max((length - 1), 0), Math.floor((_verticalScrollPosition / rowHeight))); _local2 = Math.min(Math.max((length - 1), 0), ((_local1 + rowCount) + 1)); _local10 = list.hitTestPoint(stage.mouseX, stage.mouseY); calculateColumnSizes(); _local11 = (renderedItems = new Dictionary(true)); if (length > 0){ _local5 = _local1; while (_local5 <= _local2) { _local11[_dataProvider.getItemAt(_local5)] = true; _local5++; }; }; _local3 = 0; _local12 = (visibleColumns[0] as DataGridColumn); _local5 = 0; while (_local5 < displayableColumns.length) { _local19 = (displayableColumns[_local5] as DataGridColumn); if (_local19 != _local12){ _local3 = (_local3 + _local19.width); } else { break; }; _local5++; }; while (header.numChildren > 0) { header.removeChildAt(0); }; dragHandlesMap = new Dictionary(true); _local15 = []; _local16 = visibleColumns.length; _local17 = 0; while (_local17 < _local16) { _local9 = (visibleColumns[_local17] as DataGridColumn); _local15.push(_local9.colNum); if (showHeaders){ _local23 = ((_local9.headerRenderer)!=null) ? _local9.headerRenderer : _headerRenderer; _local24 = (getDisplayObjectInstance(_local23) as HeaderRenderer); if (_local24 != null){ _local24.addEventListener(MouseEvent.CLICK, handleHeaderRendererClick, false, 0, true); _local24.x = _local3; _local24.y = 0; _local24.setSize(_local9.width, headerHeight); _local24.column = _local9.colNum; _local24.label = _local9.headerText; header.addChildAt(_local24, _local17); copyStylesToChild(_local24, HEADER_STYLES); if ((((((sortIndex == -1)) && ((lastSortIndex == -1)))) || (!((_local9.colNum == sortIndex))))){ _local24.setStyle("icon", null); } else { _local24.setStyle("icon", (sortDescending) ? getStyleValue("headerSortArrowAscSkin") : getStyleValue("headerSortArrowDescSkin")); }; if ((((((_local17 < (_local16 - 1))) && (resizableColumns))) && (_local9.resizable))){ _local25 = new Sprite(); _local26 = _local25.graphics; _local26.beginFill(0, 0); _local26.drawRect(0, 0, 3, headerHeight); _local26.endFill(); _local25.x = ((_local3 + _local9.width) - 2); _local25.y = 0; _local25.alpha = 0; _local25.addEventListener(MouseEvent.MOUSE_OVER, handleHeaderResizeOver, false, 0, true); _local25.addEventListener(MouseEvent.MOUSE_OUT, handleHeaderResizeOut, false, 0, true); _local25.addEventListener(MouseEvent.MOUSE_DOWN, handleHeaderResizeDown, false, 0, true); header.addChild(_local25); dragHandlesMap[_local25] = _local9.colNum; }; if ((((((_local17 == (_local16 - 1))) && ((_horizontalScrollPosition == 0)))) && ((availableWidth > (_local3 + _local9.width))))){ _local4 = Math.floor((availableWidth - _local3)); _local24.setSize(_local4, headerHeight); } else { _local4 = _local9.width; }; _local24.drawNow(); }; }; _local20 = ((_local9.cellRenderer)!=null) ? _local9.cellRenderer : _cellRenderer; _local21 = availableCellRenderersMap[_local9]; _local8 = activeCellRenderersMap[_local9]; if (_local8 == null){ _local8 = []; activeCellRenderersMap[_local9] = _local8; }; if (_local21 == null){ _local21 = []; availableCellRenderersMap[_local9] = _local21; }; _local22 = new Dictionary(true); while (_local8.length > 0) { _local7 = _local8.pop(); _local6 = _local7.data; if ((((_local11[_local6] == null)) || ((invalidItems[_local6] == true)))){ _local21.push(_local7); } else { _local22[_local6] = _local7; invalidItems[_local6] = true; }; list.removeChild((_local7 as DisplayObject)); }; if (length > 0){ _local5 = _local1; while (_local5 <= _local2) { _local27 = false; _local6 = _dataProvider.getItemAt(_local5); if (_local22[_local6] != null){ _local27 = true; _local7 = _local22[_local6]; delete _local22[_local6]; } else { if (_local21.length > 0){ _local7 = (_local21.pop() as ICellRenderer); } else { _local7 = (getDisplayObjectInstance(_local20) as ICellRenderer); _local13 = (_local7 as Sprite); if (_local13 != null){ _local13.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true); _local13.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true); _local13.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true); _local13.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true); _local13.doubleClickEnabled = true; _local13.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true); if (_local13["setStyle"] != null){ for (_local28 in rendererStyles) { var _local31 = _local13; _local31["setStyle"](_local28, rendererStyles[_local28]); }; }; }; }; }; list.addChild((_local7 as Sprite)); _local8.push(_local7); _local7.x = _local3; _local7.y = (rowHeight * (_local5 - _local1)); _local7.setSize(((_local17)==(_local16 - 1)) ? _local4 : _local9.width, rowHeight); if (!_local27){ _local7.data = _local6; }; _local7.listData = new ListData(columnItemToLabel(_local9.colNum, _local6), null, this, _local5, _local5, _local17); if (((_local10) && (isHovered(_local7)))){ _local7.setMouseState("over"); currentHoveredRow = _local5; } else { _local7.setMouseState("up"); }; _local7.selected = !((_selectedIndices.indexOf(_local5) == -1)); if ((_local7 is UIComponent)){ _local14 = (_local7 as UIComponent); _local14.drawNow(); }; _local5++; }; }; _local3 = (_local3 + _local9.width); _local17++; }; _local5 = 0; while (_local5 < _columns.length) { if (_local15.indexOf(_local5) == -1){ removeCellRenderersByColumn((_columns[_local5] as DataGridColumn)); }; _local5++; }; if (editedItemPositionChanged){ editedItemPositionChanged = false; commitEditedItemPosition(proposedEditedItemPosition); proposedEditedItemPosition = undefined; }; invalidItems = new Dictionary(true); } protected function itemEditorItemEditBeginningHandler(_arg1:DataGridEvent):void{ if (!_arg1.isDefaultPrevented()){ setEditedItemPosition({columnIndex:_arg1.columnIndex, rowIndex:uint(_arg1.rowIndex)}); } else { if (!itemEditorInstance){ _editedItemPosition = null; editable = false; setFocus(); editable = true; }; }; } protected function itemEditorItemEditEndHandler(_arg1:DataGridEvent):void{ var _local2:Boolean; var _local3:Object; var _local4:String; var _local5:Object; var _local6:String; var _local7:XML; var _local8:IFocusManager; if (!_arg1.isDefaultPrevented()){ _local2 = false; if (((itemEditorInstance) && (!((_arg1.reason == DataGridEventReason.CANCELLED))))){ _local3 = itemEditorInstance[_columns[_arg1.columnIndex].editorDataField]; _local4 = _columns[_arg1.columnIndex].dataField; _local5 = _arg1.itemRenderer.data; _local6 = ""; for each (_local7 in describeType(_local5).variable) { if (_local4 == _local7.@name.toString()){ _local6 = _local7.@type.toString(); break; }; }; switch (_local6){ case "String": if (!(_local3 is String)){ _local3 = _local3.toString(); }; break; case "uint": if (!(_local3 is uint)){ _local3 = uint(_local3); }; break; case "int": if (!(_local3 is int)){ _local3 = int(_local3); }; break; case "Number": if (!(_local3 is Number)){ _local3 = Number(_local3); }; break; }; if (_local5[_local4] != _local3){ _local2 = true; _local5[_local4] = _local3; }; _arg1.itemRenderer.data = _local5; }; } else { if (_arg1.reason != DataGridEventReason.OTHER){ if (((itemEditorInstance) && (_editedItemPosition))){ if (selectedIndex != _editedItemPosition.rowIndex){ selectedIndex = _editedItemPosition.rowIndex; }; _local8 = focusManager; if ((itemEditorInstance is IFocusManagerComponent)){ _local8.setFocus(InteractiveObject(itemEditorInstance)); }; }; }; }; if ((((_arg1.reason == DataGridEventReason.OTHER)) || (!(_arg1.isDefaultPrevented())))){ destroyItemEditor(); }; } public function get editedItemPosition():Object{ if (_editedItemPosition){ return ({rowIndex:_editedItemPosition.rowIndex, columnIndex:_editedItemPosition.columnIndex}); }; return (_editedItemPosition); } protected function setEditedItemPosition(_arg1:Object):void{ editedItemPositionChanged = true; proposedEditedItemPosition = _arg1; if (((_arg1) && (!((_arg1.rowIndex == selectedIndex))))){ selectedIndex = _arg1.rowIndex; }; invalidate(InvalidationType.DATA); } public function set headerHeight(_arg1:Number):void{ maxHeaderHeight = _arg1; _headerHeight = Math.max(0, _arg1); invalidate(InvalidationType.SIZE); } protected function handleHeaderResizeDown(_arg1:MouseEvent):void{ var _local2:Sprite; var _local3:Number; var _local4:DataGridColumn; _local2 = (_arg1.currentTarget as Sprite); _local3 = dragHandlesMap[_local2]; _local4 = getColumnAt(_local3); columnStretchIndex = _local3; columnStretchStartX = _arg1.stageX; columnStretchStartWidth = _local4.width; stage.addEventListener(MouseEvent.MOUSE_MOVE, handleHeaderResizeMove, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_UP, handleHeaderResizeUp, false, 0, true); } protected function deactivateHandler(_arg1:Event):void{ if (itemEditorInstance){ endEdit(DataGridEventReason.OTHER); losingFocus = true; setFocus(); }; } protected function keyFocusChangeHandler(_arg1:FocusEvent):void{ if ((((((_arg1.keyCode == Keyboard.TAB)) && (!(_arg1.isDefaultPrevented())))) && (findNextItemRenderer(_arg1.shiftKey)))){ _arg1.preventDefault(); }; } override protected function handleDataChange(_arg1:DataChangeEvent):void{ super.handleDataChange(_arg1); if (_columns == null){ _columns = []; }; if (_columns.length == 0){ createColumnsFromDataProvider(); }; } public function set editedItemPosition(_arg1:Object):void{ var _local2:Object; _local2 = {rowIndex:_arg1.rowIndex, columnIndex:_arg1.columnIndex}; setEditedItemPosition(_local2); } override public function itemToCellRenderer(_arg1:Object):ICellRenderer{ return (null); } public function getCellRendererAt(_arg1:uint, _arg2:uint):ICellRenderer{ var _local3:DataGridColumn; var _local4:Array; var _local5:uint; var _local6:ICellRenderer; _local3 = (_columns[_arg2] as DataGridColumn); if (_local3 != null){ _local4 = (activeCellRenderersMap[_local3] as Array); if (_local4 != null){ _local5 = 0; while (_local5 < _local4.length) { _local6 = (_local4[_local5] as ICellRenderer); if (_local6.listData.row == _arg1){ return (_local6); }; _local5++; }; }; }; return (null); } override protected function keyDownHandler(_arg1:KeyboardEvent):void{ if (((!(selectable)) || (itemEditorInstance))){ 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; }; scrollToIndex(caretIndex); doKeySelection(caretIndex, _arg1.shiftKey, _arg1.ctrlKey); break; default: break; }; _arg1.stopPropagation(); } protected function handleHeaderResizeUp(_arg1:MouseEvent):void{ var _local2:Sprite; var _local3:DataGridColumn; var _local4:HeaderRenderer; var _local5:uint; var _local6:DataGridEvent; _local2 = (_arg1.currentTarget as Sprite); _local3 = (_columns[columnStretchIndex] as DataGridColumn); _local5 = 0; while (_local5 < header.numChildren) { _local4 = (header.getChildAt(_local5) as HeaderRenderer); if (((_local4) && ((_local4.column == columnStretchIndex)))){ break; }; _local5++; }; _local6 = new DataGridEvent(DataGridEvent.COLUMN_STRETCH, false, true, columnStretchIndex, -1, _local4, (_local3) ? _local3.dataField : null); dispatchEvent(_local6); columnStretchIndex = -1; showColumnStretchCursor(false); stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleHeaderResizeMove, false); stage.removeEventListener(MouseEvent.MOUSE_UP, handleHeaderResizeUp, false); } protected function handleHeaderResizeOver(_arg1:MouseEvent):void{ if (columnStretchIndex == -1){ showColumnStretchCursor(); }; } override protected function focusInHandler(_arg1:FocusEvent):void{ var _local2:Boolean; var _local3:DataGridColumn; if (_arg1.target != this){ return; }; if (losingFocus){ losingFocus = false; return; }; setIMEMode(true); super.focusInHandler(_arg1); if (((editable) && (!(isPressed)))){ _local2 = !((editedItemPosition == null)); if (!_editedItemPosition){ _editedItemPosition = {rowIndex:0, columnIndex:0}; while (_editedItemPosition.columnIndex < _columns.length) { _local3 = (_columns[_editedItemPosition.columnIndex] as DataGridColumn); if (((_local3.editable) && (_local3.visible))){ _local2 = true; break; }; _editedItemPosition.columnIndex++; }; }; if (_local2){ setEditedItemPosition(_editedItemPosition); }; }; if (editable){ addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); addEventListener(MouseEvent.MOUSE_DOWN, mouseFocusChangeHandler); }; } public function createItemEditor(_arg1:uint, _arg2:uint):void{ var _local3:DataGridColumn; var _local4:ICellRenderer; var _local5:Sprite; var _local6:int; if (displayableColumns.length != _columns.length){ _local6 = 0; while (_local6 < displayableColumns.length) { if (displayableColumns[_local6].colNum >= _arg1){ _arg1 = displayableColumns[_local6].colNum; break; }; _local6++; }; if (_local6 == displayableColumns.length){ _arg1 = 0; }; }; _local3 = (_columns[_arg1] as DataGridColumn); _local4 = getCellRendererAt(_arg2, _arg1); if (!itemEditorInstance){ itemEditorInstance = getDisplayObjectInstance(_local3.itemEditor); itemEditorInstance.tabEnabled = false; list.addChild(DisplayObject(itemEditorInstance)); }; list.setChildIndex(DisplayObject(itemEditorInstance), (list.numChildren - 1)); _local5 = (_local4 as Sprite); itemEditorInstance.visible = true; itemEditorInstance.move(_local5.x, _local5.y); itemEditorInstance.setSize(_local3.width, rowHeight); itemEditorInstance.drawNow(); DisplayObject(itemEditorInstance).addEventListener(FocusEvent.FOCUS_OUT, itemEditorFocusOutHandler); _local5.visible = false; DisplayObject(itemEditorInstance).addEventListener(KeyboardEvent.KEY_DOWN, editorKeyDownHandler); stage.addEventListener(MouseEvent.MOUSE_DOWN, editorMouseDownHandler, true, 0, true); } private function itemEditorFocusOutHandler(_arg1:FocusEvent):void{ if (((_arg1.relatedObject) && (contains(_arg1.relatedObject)))){ return; }; if (!_arg1.relatedObject){ return; }; if (itemEditorInstance){ endEdit(DataGridEventReason.OTHER); }; } override public function get horizontalScrollPolicy():String{ return (_horizontalScrollPolicy); } override protected function updateRendererStyles():void{ var _local1:Array; var _local2:Object; var _local3:uint; var _local4:uint; var _local5:String; _local1 = []; for (_local2 in availableCellRenderersMap) { _local1 = _local1.concat(availableCellRenderersMap[_local2]); }; for (_local2 in activeCellRenderersMap) { _local1 = _local1.concat(activeCellRenderersMap[_local2]); }; _local3 = _local1.length; _local4 = 0; while (_local4 < _local3) { if (_local1[_local4]["setStyle"] == null){ } else { for (_local5 in updatedRendererStyles) { _local1[_local4].setStyle(_local5, updatedRendererStyles[_local5]); }; _local1[_local4].drawNow(); }; _local4++; }; updatedRendererStyles = {}; } public function set minColumnWidth(_arg1:Number):void{ _minColumnWidth = _arg1; columnsInvalid = true; minColumnWidthInvalid = true; invalidate(InvalidationType.SIZE); } protected function showColumnStretchCursor(_arg1:Boolean=true):void{ if (columnStretchCursor == null){ columnStretchCursor = (getDisplayObjectInstance(getStyleValue("columnStretchCursorSkin")) as Sprite); columnStretchCursor.mouseEnabled = false; }; if (_arg1){ Mouse.hide(); stage.addChild(columnStretchCursor); stage.addEventListener(MouseEvent.MOUSE_MOVE, positionColumnStretchCursor, false, 0, true); columnStretchCursor.x = stage.mouseX; columnStretchCursor.y = stage.mouseY; } else { stage.removeEventListener(MouseEvent.MOUSE_MOVE, positionColumnStretchCursor, false); if (stage.contains(columnStretchCursor)){ stage.removeChild(columnStretchCursor); }; Mouse.show(); }; } protected function findNextEnterItemRenderer(_arg1:KeyboardEvent):void{ var _local2:int; var _local3:int; var _local4:int; var _local5:DataGridEvent; if (proposedEditedItemPosition !== undefined){ return; }; _local2 = _editedItemPosition.rowIndex; _local3 = _editedItemPosition.columnIndex; _local4 = (_editedItemPosition.rowIndex + (_arg1.shiftKey) ? -1 : 1); if ((((_local4 >= 0)) && ((_local4 < length)))){ _local2 = _local4; }; _local5 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, true, _local3, _local2); _local5.dataField = _columns[_local3].dataField; dispatchEvent(_local5); } protected function mouseFocusChangeHandler(_arg1:MouseEvent):void{ if (((((itemEditorInstance) && (!(_arg1.isDefaultPrevented())))) && (itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))))){ _arg1.preventDefault(); }; } public function get imeMode():String{ return (_imeMode); } public function editField(_arg1:uint, _arg2:String, _arg3:Object):void{ var _local4:Object; _local4 = getItemAt(_arg1); _local4[_arg2] = _arg3; replaceItemAt(_local4, _arg1); } protected function calculateAvailableHeight():Number{ var _local1:Number; var _local2:Number; _local1 = Number(getStyleValue("contentPadding")); _local2 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0; return ((((height - (_local1 * 2)) - _local2) - (showHeaders) ? headerHeight : 0)); } protected function mouseUpHandler(_arg1:MouseEvent):void{ if (((!(enabled)) || (!(selectable)))){ return; }; isPressed = false; } override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{ } public function resizeColumn(_arg1:int, _arg2:Number):void{ var _local3:DataGridColumn; var _local4:int; var _local5:Number; var _local6:int; var _local7:DataGridColumn; var _local8:DataGridColumn; var _local9:int; var _local10:Number; var _local11:Number; var _local12:Number; if (_columns.length == 0){ return; }; _local3 = (_columns[_arg1] as DataGridColumn); if (!_local3){ return; }; if (((!(visibleColumns)) || ((visibleColumns.length == 0)))){ _local3.setWidth(_arg2); return; }; if (_arg2 < _local3.minWidth){ _arg2 = _local3.minWidth; }; if ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((_horizontalScrollPolicy == ScrollPolicy.AUTO)))){ _local3.setWidth(_arg2); _local3.explicitWidth = _arg2; } else { _local4 = getVisibleColumnIndex(_local3); if (_local4 != -1){ _local5 = 0; _local6 = visibleColumns.length; _local9 = (_local4 + 1); while (_local9 < _local6) { _local7 = (visibleColumns[_local9] as DataGridColumn); if (((_local7) && (_local7.resizable))){ _local5 = (_local5 + _local7.width); }; _local9++; }; _local11 = ((_local3.width - _arg2) + _local5); if (_local5){ _local3.setWidth(_arg2); _local3.explicitWidth = _arg2; }; _local12 = 0; _local9 = (_local4 + 1); while (_local9 < _local6) { _local7 = (visibleColumns[_local9] as DataGridColumn); if (_local7.resizable){ _local10 = ((_local7.width * _local11) / _local5); if (_local10 < _local7.minWidth){ _local10 = _local7.minWidth; }; _local7.setWidth(_local10); _local12 = (_local12 + _local7.width); _local8 = _local7; }; _local9++; }; if (_local12 > _local11){ _local10 = ((_local3.width - _local12) + _local11); if (_local10 < _local3.minWidth){ _local10 = _local3.minWidth; }; _local3.setWidth(_local10); } else { if (_local8){ _local8.setWidth(((_local8.width - _local12) + _local11)); }; }; } else { _local3.setWidth(_arg2); _local3.explicitWidth = _arg2; }; }; columnsInvalid = true; invalidate(InvalidationType.SIZE); } protected function itemEditorItemEditBeginHandler(_arg1:DataGridEvent):void{ var _local2:IFocusManager; if (stage){ stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true); }; if (!_arg1.isDefaultPrevented()){ createItemEditor(_arg1.columnIndex, uint(_arg1.rowIndex)); ICellRenderer(itemEditorInstance).listData = ICellRenderer(editedItemRenderer).listData; ICellRenderer(itemEditorInstance).data = editedItemRenderer.data; itemEditorInstance.imeMode = ((columns[_arg1.columnIndex].imeMode)==null) ? _imeMode : columns[_arg1.columnIndex].imeMode; _local2 = focusManager; if ((itemEditorInstance is IFocusManagerComponent)){ _local2.setFocus(InteractiveObject(itemEditorInstance)); }; _local2.defaultButtonEnabled = false; _arg1 = new DataGridEvent(DataGridEvent.ITEM_FOCUS_IN, false, false, _editedItemPosition.columnIndex, _editedItemPosition.rowIndex, itemEditorInstance); dispatchEvent(_arg1); }; } 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")))) || (!((_headerRenderer == getStyleValue("headerRenderer")))))){ _invalidateList(); _cellRenderer = getStyleValue("cellRenderer"); _headerRenderer = getStyleValue("headerRenderer"); }; }; if (isInvalid(InvalidationType.SIZE)){ columnsInvalid = true; }; if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){ drawLayout(); drawDisabledOverlay(); }; if (isInvalid(InvalidationType.RENDERER_STYLES)){ updateRendererStyles(); }; if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){ drawList(); }; updateChildren(); validate(); } override public function set horizontalScrollPolicy(_arg1:String):void{ super.horizontalScrollPolicy = _arg1; columnsInvalid = true; } protected function getVisibleColumnIndex(_arg1:DataGridColumn):int{ var _local2:uint; _local2 = 0; while (_local2 < visibleColumns.length) { if (_arg1 == visibleColumns[_local2]){ return (_local2); }; _local2++; }; return (-1); } protected function itemRendererContains(_arg1:Object, _arg2:DisplayObject):Boolean{ if (((((!(_arg2)) || (!(_arg1)))) || (!((_arg1 is DisplayObjectContainer))))){ return (false); }; return (DisplayObjectContainer(_arg1).contains(_arg2)); } override protected function configUI():void{ var _local1:Graphics; useFixedHorizontalScrolling = false; super.configUI(); headerMask = new Sprite(); _local1 = headerMask.graphics; _local1.beginFill(0, 0.3); _local1.drawRect(0, 0, 100, 100); _local1.endFill(); headerMask.visible = false; addChild(headerMask); header = new Sprite(); addChild(header); header.mask = headerMask; _horizontalScrollPolicy = ScrollPolicy.OFF; _verticalScrollPolicy = ScrollPolicy.AUTO; } public function columnItemToLabel(_arg1:uint, _arg2:Object):String{ var _local3:DataGridColumn; _local3 = (_columns[_arg1] as DataGridColumn); if (_local3 != null){ return (_local3.itemToLabel(_arg2)); }; return (" "); } protected function endEdit(_arg1:String):Boolean{ var _local2:DataGridEvent; if (!editedItemRenderer){ return (true); }; _local2 = new DataGridEvent(DataGridEvent.ITEM_EDIT_END, false, true, editedItemPosition.columnIndex, editedItemPosition.rowIndex, editedItemRenderer, _columns[editedItemPosition.columnIndex].dataField, _arg1); dispatchEvent(_local2); return (!(_local2.isDefaultPrevented())); } override protected function drawLayout():void{ vOffset = (showHeaders) ? headerHeight : 0; super.drawLayout(); contentScrollRect = listHolder.scrollRect; if (showHeaders){ headerHeight = maxHeaderHeight; if (Math.floor((availableHeight - headerHeight)) <= 0){ _headerHeight = availableHeight; }; list.y = headerHeight; contentScrollRect = listHolder.scrollRect; contentScrollRect.y = (contentPadding + headerHeight); contentScrollRect.height = (availableHeight - headerHeight); listHolder.y = (contentPadding + headerHeight); headerMask.x = contentPadding; headerMask.y = contentPadding; headerMask.width = availableWidth; headerMask.height = headerHeight; } else { contentScrollRect.y = contentPadding; listHolder.y = 0; }; listHolder.scrollRect = contentScrollRect; } protected function commitEditedItemPosition(_arg1:Object):void{ var _local2:ICellRenderer; var _local3:DataGridEvent; var _local4:String; var _local5:int; if (((!(enabled)) || (!(editable)))){ return; }; if (((((((((itemEditorInstance) && (_arg1))) && ((itemEditorInstance is IFocusManagerComponent)))) && ((_editedItemPosition.rowIndex == _arg1.rowIndex)))) && ((_editedItemPosition.columnIndex == _arg1.columnIndex)))){ IFocusManagerComponent(itemEditorInstance).setFocus(); return; }; if (itemEditorInstance){ if (!_arg1){ _local4 = DataGridEventReason.OTHER; } else { if (((!(editedItemPosition)) || ((_arg1.rowIndex == editedItemPosition.rowIndex)))){ _local4 = DataGridEventReason.NEW_COLUMN; } else { _local4 = DataGridEventReason.NEW_ROW; }; }; if (((!(endEdit(_local4))) && (!((_local4 == DataGridEventReason.OTHER))))){ return; }; }; _editedItemPosition = _arg1; if (!_arg1){ return; }; actualRowIndex = _arg1.rowIndex; actualColIndex = _arg1.columnIndex; if (displayableColumns.length != _columns.length){ _local5 = 0; while (_local5 < displayableColumns.length) { if (displayableColumns[_local5].colNum >= actualColIndex){ actualColIndex = displayableColumns[_local5].colNum; break; }; _local5++; }; if (_local5 == displayableColumns.length){ actualColIndex = 0; }; }; scrollToPosition(actualRowIndex, actualColIndex); _local2 = getCellRendererAt(actualRowIndex, actualColIndex); _local3 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGIN, false, true, actualColIndex, actualRowIndex, _local2); dispatchEvent(_local3); if (editedItemPositionChanged){ editedItemPositionChanged = false; commitEditedItemPosition(proposedEditedItemPosition); proposedEditedItemPosition = undefined; }; if (!itemEditorInstance){ commitEditedItemPosition(null); }; } protected function handleHeaderRendererClick(_arg1:MouseEvent):void{ var _local2:HeaderRenderer; var _local3:uint; var _local4:DataGridColumn; var _local5:uint; var _local6:DataGridEvent; if (!_enabled){ return; }; _local2 = (_arg1.currentTarget as HeaderRenderer); _local3 = _local2.column; _local4 = (_columns[_local3] as DataGridColumn); if (((sortableColumns) && (_local4.sortable))){ _local5 = _sortIndex; _sortIndex = _local3; _local6 = new DataGridEvent(DataGridEvent.HEADER_RELEASE, false, true, _local3, -1, _local2, (_local4) ? _local4.dataField : null); if (((!(dispatchEvent(_local6))) || (!(_selectable)))){ _sortIndex = lastSortIndex; return; }; lastSortIndex = _local5; sortByColumn(_local3); invalidate(InvalidationType.DATA); }; } public function get showHeaders():Boolean{ return (_showHeaders); } public function get sortIndex():int{ return (_sortIndex); } public function set labelFunction(_arg1:Function):void{ if (_labelFunction == _arg1){ return; }; _labelFunction = _arg1; invalidate(InvalidationType.DATA); } public function getColumnIndex(_arg1:String):int{ var _local2:uint; var _local3:DataGridColumn; _local2 = 0; while (_local2 < _columns.length) { _local3 = (_columns[_local2] as DataGridColumn); if (_local3.dataField == _arg1){ return (_local2); }; _local2++; }; return (-1); } protected function createColumnsFromDataProvider():void{ var _local1:Object; var _local2:String; _columns = []; if (length > 0){ _local1 = _dataProvider.getItemAt(0); for (_local2 in _local1) { addColumn(_local2); }; }; } protected function editorMouseDownHandler(_arg1:MouseEvent):void{ var _local2:ICellRenderer; var _local3:uint; if (!itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))){ if ((((_arg1.target is ICellRenderer)) && (contains(DisplayObject(_arg1.target))))){ _local2 = (_arg1.target as ICellRenderer); _local3 = _local2.listData.row; if (_editedItemPosition.rowIndex == _local3){ endEdit(DataGridEventReason.NEW_COLUMN); } else { endEdit(DataGridEventReason.NEW_ROW); }; } else { endEdit(DataGridEventReason.OTHER); }; }; } public function addColumnAt(_arg1, _arg2:uint):DataGridColumn{ var _local3:DataGridColumn; var _local4:*; var _local5:uint; if (_arg2 < _columns.length){ _columns.splice(_arg2, 0, ""); _local5 = (_arg2 + 1); while (_local5 < _columns.length) { _local3 = (_columns[_local5] as DataGridColumn); _local3.colNum = _local5; _local5++; }; }; _local4 = _arg1; if (!(_local4 is DataGridColumn)){ if ((_local4 is String)){ _local4 = new DataGridColumn(_local4); } else { _local4 = new DataGridColumn(); }; }; _local3 = (_local4 as DataGridColumn); _local3.owner = this; _local3.colNum = _arg2; _columns[_arg2] = _local3; invalidate(InvalidationType.SIZE); columnsInvalid = true; return (_local3); } public function destroyItemEditor():void{ var _local1:DataGridEvent; if (itemEditorInstance){ DisplayObject(itemEditorInstance).removeEventListener(KeyboardEvent.KEY_DOWN, editorKeyDownHandler); stage.removeEventListener(MouseEvent.MOUSE_DOWN, editorMouseDownHandler, true); _local1 = new DataGridEvent(DataGridEvent.ITEM_FOCUS_OUT, false, false, _editedItemPosition.columnIndex, _editedItemPosition.rowIndex, itemEditorInstance); dispatchEvent(_local1); if (((itemEditorInstance) && ((itemEditorInstance is UIComponent)))){ UIComponent(itemEditorInstance).drawFocus(false); }; list.removeChild(DisplayObject(itemEditorInstance)); DisplayObject(editedItemRenderer).visible = true; itemEditorInstance = null; }; } public function set imeMode(_arg1:String):void{ _imeMode = _arg1; } 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 { if (_arg3){ caretIndex = _arg1; } else { selectedIndex = _arg1; caretIndex = (lastCaretIndex = _arg1); _local4 = true; }; }; if (_local4){ dispatchEvent(new Event(Event.CHANGE)); }; invalidate(InvalidationType.DATA); } public function get headerHeight():Number{ return (_headerHeight); } public function getColumnCount():uint{ return (_columns.length); } protected function sortByColumn(_arg1:int):void{ var _local2:DataGridColumn; var _local3:Boolean; var _local4:uint; _local2 = (columns[_arg1] as DataGridColumn); if (((((!(enabled)) || (!(_local2)))) || (!(_local2.sortable)))){ return; }; _local3 = _local2.sortDescending; _local4 = _local2.sortOptions; if (_local3){ _local4 = (_local4 | Array.DESCENDING); } else { _local4 = (_local4 & ~(Array.DESCENDING)); }; if (_local2.sortCompareFunction != null){ sortItems(_local2.sortCompareFunction, _local4); } else { sortItemsOn(_local2.dataField, _local4); }; _sortDescending = (_local2.sortDescending = !(_local3)); if ((((lastSortIndex >= 0)) && (!((lastSortIndex == sortIndex))))){ _local2 = (columns[lastSortIndex] as DataGridColumn); if (_local2 != null){ _local2.sortDescending = false; }; }; } public function get minColumnWidth():Number{ return (_minColumnWidth); } protected function isHovered(_arg1:ICellRenderer):Boolean{ var _local2:uint; var _local3:Number; var _local4:Point; _local2 = Math.min(Math.max((length - 1), 0), Math.floor((_verticalScrollPosition / rowHeight))); _local3 = ((_arg1.listData.row - _local2) * rowHeight); _local4 = list.globalToLocal(new Point(0, stage.mouseY)); return ((((_local4.y > _local3)) && ((_local4.y < (_local3 + rowHeight))))); } protected function mouseDownHandler(_arg1:MouseEvent):void{ if (((!(enabled)) || (!(selectable)))){ return; }; isPressed = true; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; header.mouseChildren = _enabled; } 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(); }; } protected function handleHeaderResizeOut(_arg1:MouseEvent):void{ if (columnStretchIndex == -1){ showColumnStretchCursor(false); }; } public function removeAllColumns():void{ if (_columns.length > 0){ removeCellRenderers(); _columns = []; invalidate(InvalidationType.SIZE); columnsInvalid = true; }; } public function set rowCount(_arg1:uint):void{ var _local2:Number; var _local3:Number; _local2 = Number(getStyleValue("contentPadding")); _local3 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && (hScrollBar))))) ? 15 : 0; height = ((((rowHeight * _arg1) + (2 * _local2)) + _local3) + (showHeaders) ? headerHeight : 0); } protected function removeCellRenderers():void{ var _local1:uint; _local1 = 0; while (_local1 < _columns.length) { removeCellRenderersByColumn((_columns[_local1] as DataGridColumn)); _local1++; }; } public function removeColumnAt(_arg1:uint):DataGridColumn{ var _local2:DataGridColumn; var _local3:uint; _local2 = (_columns[_arg1] as DataGridColumn); if (_local2 != null){ removeCellRenderersByColumn(_local2); _columns.splice(_arg1, 1); _local3 = _arg1; while (_local3 < _columns.length) { _local2 = (_columns[_local3] as DataGridColumn); if (_local2){ _local2.colNum = _local3; }; _local3++; }; invalidate(InvalidationType.SIZE); columnsInvalid = true; }; return (_local2); } override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ if (_arg1 == _horizontalScrollPosition){ return; }; contentScrollRect = listHolder.scrollRect; contentScrollRect.x = _arg1; listHolder.scrollRect = contentScrollRect; list.x = 0; header.x = -(_arg1); super.setHorizontalScrollPosition(_arg1, true); invalidate(InvalidationType.SCROLL); columnsInvalid = true; } public function get labelFunction():Function{ return (_labelFunction); } override protected function handleCellRendererClick(_arg1:MouseEvent):void{ var _local2:ICellRenderer; var _local3:DataGridColumn; var _local4:DataGridEvent; super.handleCellRendererClick(_arg1); _local2 = (_arg1.currentTarget as ICellRenderer); if (((((_local2) && (_local2.data))) && (!((_local2 == itemEditorInstance))))){ _local3 = (_columns[_local2.listData.column] as DataGridColumn); if (((((editable) && (_local3))) && (_local3.editable))){ _local4 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, true, _local2.listData.column, _local2.listData.row, _local2, _local3.dataField); dispatchEvent(_local4); }; }; } override protected function focusOutHandler(_arg1:FocusEvent):void{ setIMEMode(false); if (_arg1.target == this){ super.focusOutHandler(_arg1); }; if ((((_arg1.relatedObject == this)) && (itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))))){ return; }; if ((((_arg1.relatedObject == null)) && (itemRendererContains(editedItemRenderer, DisplayObject(_arg1.target))))){ return; }; if ((((_arg1.relatedObject == null)) && (itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))))){ return; }; if (((itemEditorInstance) && (((!(_arg1.relatedObject)) || (!(itemRendererContains(itemEditorInstance, _arg1.relatedObject))))))){ endEdit(DataGridEventReason.OTHER); removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); removeEventListener(MouseEvent.MOUSE_DOWN, mouseFocusChangeHandler); }; } protected function positionColumnStretchCursor(_arg1:MouseEvent):void{ columnStretchCursor.x = _arg1.stageX; columnStretchCursor.y = _arg1.stageY; } override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ if (itemEditorInstance){ endEdit(DataGridEventReason.OTHER); }; invalidate(InvalidationType.SCROLL); super.setVerticalScrollPosition(_arg1, true); } public function get sortDescending():Boolean{ return (_sortDescending); } protected function editorKeyDownHandler(_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.ESCAPE){ endEdit(DataGridEventReason.CANCELLED); } else { if (((_arg1.ctrlKey) && ((_arg1.charCode == 46)))){ endEdit(DataGridEventReason.CANCELLED); } else { if ((((_arg1.charCode == Keyboard.ENTER)) && (!((_arg1.keyCode == 229))))){ if (endEdit(DataGridEventReason.NEW_ROW)){ findNextEnterItemRenderer(_arg1); }; }; }; }; } override protected function calculateContentWidth():void{ var _local1:int; var _local2:int; var _local3:DataGridColumn; if (_columns.length == 0){ contentWidth = 0; return; }; if (minColumnWidthInvalid){ _local1 = _columns.length; _local2 = 0; while (_local2 < _local1) { _local3 = (_columns[_local2] as DataGridColumn); _local3.minWidth = minColumnWidth; _local2++; }; minColumnWidthInvalid = false; }; if (horizontalScrollPolicy == ScrollPolicy.OFF){ contentWidth = availableWidth; } else { contentWidth = 0; _local1 = _columns.length; _local2 = 0; while (_local2 < _local1) { _local3 = (_columns[_local2] as DataGridColumn); if (_local3.visible){ contentWidth = (contentWidth + _local3.width); }; _local2++; }; if (((!(isNaN(_horizontalScrollPosition))) && (((_horizontalScrollPosition + availableWidth) > contentWidth)))){ setHorizontalScrollPosition((contentWidth - availableWidth)); }; }; } override public function get rowCount():uint{ return (Math.ceil((calculateAvailableHeight() / rowHeight))); } public function addColumn(_arg1):DataGridColumn{ return (addColumnAt(_arg1, _columns.length)); } protected function removeCellRenderersByColumn(_arg1:DataGridColumn):void{ var _local2:Array; if (_arg1 == null){ return; }; _local2 = activeCellRenderersMap[_arg1]; if (_local2 != null){ while (_local2.length > 0) { list.removeChild((_local2.pop() as DisplayObject)); }; }; } override protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{ var _local2:ICellRenderer; var _local3:int; var _local4:String; var _local5:uint; var _local6:DataGridColumn; var _local7:ICellRenderer; _local2 = (_arg1.target as ICellRenderer); if (_local2){ _local3 = _local2.listData.row; if (_arg1.type == MouseEvent.ROLL_OVER){ _local4 = "over"; } else { if (_arg1.type == MouseEvent.ROLL_OUT){ _local4 = "up"; }; }; if (_local4){ _local5 = 0; while (_local5 < visibleColumns.length) { _local6 = (visibleColumns[_local5] as DataGridColumn); _local7 = getCellRendererAt(_local3, _local6.colNum); if (_local7){ _local7.setMouseState(_local4); }; if (_local3 != currentHoveredRow){ _local7 = getCellRendererAt(currentHoveredRow, _local6.colNum); if (_local7){ _local7.setMouseState("up"); }; }; _local5++; }; }; }; super.handleCellRendererMouseEvent(_arg1); } protected function handleHeaderResizeMove(_arg1:MouseEvent):void{ var _local2:Number; var _local3:Number; _local2 = (_arg1.stageX - columnStretchStartX); _local3 = (columnStretchStartWidth + _local2); resizeColumn(columnStretchIndex, _local3); } public function set rowHeight(_arg1:Number):void{ _rowHeight = Math.max(0, _arg1); invalidate(InvalidationType.SIZE); } protected function scrollToPosition(_arg1:int, _arg2:int):void{ var _local3:Number; var _local4:Number; var _local5:uint; var _local6:Number; var _local7:DataGridColumn; var _local8:DataGridColumn; _local3 = verticalScrollPosition; _local4 = horizontalScrollPosition; scrollToIndex(_arg1); _local6 = 0; _local7 = (_columns[_arg2] as DataGridColumn); _local5 = 0; while (_local5 < displayableColumns.length) { _local8 = (displayableColumns[_local5] as DataGridColumn); if (_local8 != _local7){ _local6 = (_local6 + _local8.width); } else { break; }; _local5++; }; if (horizontalScrollPosition > _local6){ horizontalScrollPosition = _local6; } else { if ((horizontalScrollPosition + availableWidth) < (_local6 + _local7.width)){ horizontalScrollPosition = -((availableWidth - (_local6 + _local7.width))); }; }; if (((!((_local3 == verticalScrollPosition))) || (!((_local4 == horizontalScrollPosition))))){ drawNow(); }; } protected function findNextItemRenderer(_arg1:Boolean):Boolean{ var _local2:int; var _local3:int; var _local4:Boolean; var _local5:int; var _local6:int; var _local7:String; var _local8:DataGridEvent; if (!_editedItemPosition){ return (false); }; if (proposedEditedItemPosition !== undefined){ return (false); }; _local2 = _editedItemPosition.rowIndex; _local3 = _editedItemPosition.columnIndex; _local4 = false; _local5 = (_arg1) ? -1 : 1; _local6 = (length - 1); while (!(_local4)) { _local3 = (_local3 + _local5); if ((((_local3 < 0)) || ((_local3 >= _columns.length)))){ _local3 = ((_local3)<0) ? (_columns.length - 1) : 0; _local2 = (_local2 + _local5); if ((((_local2 < 0)) || ((_local2 > _local6)))){ setEditedItemPosition(null); losingFocus = true; setFocus(); return (false); }; }; if (((_columns[_local3].editable) && (_columns[_local3].visible))){ _local4 = true; if (_local2 == _editedItemPosition.rowIndex){ _local7 = DataGridEventReason.NEW_COLUMN; } else { _local7 = DataGridEventReason.NEW_ROW; }; if (((!(itemEditorInstance)) || (endEdit(_local7)))){ _local8 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, true, _local3, _local2); _local8.dataField = _columns[_local3].dataField; dispatchEvent(_local8); }; }; }; return (_local4); } override public function set dataProvider(_arg1:DataProvider):void{ super.dataProvider = _arg1; if (_columns == null){ _columns = []; }; if (_columns.length == 0){ createColumnsFromDataProvider(); }; removeCellRenderers(); } override public function setSize(_arg1:Number, _arg2:Number):void{ super.setSize(_arg1, _arg2); columnsInvalid = true; } override public function scrollToIndex(_arg1:int):void{ var _local2:int; var _local3:int; var _local4:Number; drawNow(); _local2 = (Math.floor(((_verticalScrollPosition + availableHeight) / rowHeight)) - 1); _local3 = Math.ceil((_verticalScrollPosition / rowHeight)); if (_arg1 < _local3){ verticalScrollPosition = (_arg1 * rowHeight); } else { if (_arg1 >= _local2){ _local4 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && (hScrollBar))))) ? 15 : 0; verticalScrollPosition = (((((_arg1 + 1) * rowHeight) - availableHeight) + _local4) + (showHeaders) ? headerHeight : 0); }; }; } protected function calculateColumnSizes():void{ var _local1:Number; var _local2:int; var _local3:int; var _local4:Number; var _local5:DataGridColumn; var _local6:DataGridColumn; var _local7:Number; var _local8:int; var _local9:Number; var _local10:int; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; _local4 = 0; if (_columns.length == 0){ visibleColumns = []; displayableColumns = []; return; }; if (columnsInvalid){ columnsInvalid = false; visibleColumns = []; if (minColumnWidthInvalid){ _local2 = _columns.length; _local3 = 0; while (_local3 < _local2) { _columns[_local3].minWidth = minColumnWidth; _local3++; }; minColumnWidthInvalid = false; }; displayableColumns = null; _local2 = _columns.length; _local3 = 0; while (_local3 < _local2) { if (((displayableColumns) && (_columns[_local3].visible))){ displayableColumns.push(_columns[_local3]); } else { if (((!(displayableColumns)) && (!(_columns[_local3].visible)))){ displayableColumns = new Array(_local3); _local8 = 0; while (_local8 < _local3) { displayableColumns[_local8] = _columns[_local8]; _local8++; }; }; }; _local3++; }; if (!displayableColumns){ displayableColumns = _columns; }; if (horizontalScrollPolicy == ScrollPolicy.OFF){ _local2 = displayableColumns.length; _local3 = 0; while (_local3 < _local2) { visibleColumns.push(displayableColumns[_local3]); _local3++; }; } else { _local2 = displayableColumns.length; _local9 = 0; _local3 = 0; while (_local3 < _local2) { _local5 = (displayableColumns[_local3] as DataGridColumn); if (((((_local9 + _local5.width) > _horizontalScrollPosition)) && ((_local9 < (_horizontalScrollPosition + availableWidth))))){ visibleColumns.push(_local5); }; _local9 = (_local9 + _local5.width); _local3++; }; }; }; if (horizontalScrollPolicy == ScrollPolicy.OFF){ _local10 = 0; _local11 = 0; _local2 = visibleColumns.length; _local3 = 0; while (_local3 < _local2) { _local5 = (visibleColumns[_local3] as DataGridColumn); if (_local5.resizable){ if (!isNaN(_local5.explicitWidth)){ _local11 = (_local11 + _local5.width); } else { _local10++; _local11 = (_local11 + _local5.minWidth); }; } else { _local11 = (_local11 + _local5.width); }; _local4 = (_local4 + _local5.width); _local3++; }; _local13 = availableWidth; if ((((availableWidth > _local11)) && (_local10))){ _local2 = visibleColumns.length; _local3 = 0; while (_local3 < _local2) { _local5 = (visibleColumns[_local3] as DataGridColumn); if (((_local5.resizable) && (isNaN(_local5.explicitWidth)))){ _local6 = _local5; if (_local4 > availableWidth){ _local12 = ((_local6.width - _local6.minWidth) / (_local4 - _local11)); } else { _local12 = (_local6.width / _local4); }; _local7 = (_local6.width - ((_local4 - availableWidth) * _local12)); _local14 = _local5.minWidth; _local5.setWidth(Math.max(_local7, _local14)); }; _local13 = (_local13 - _local5.width); _local3++; }; if (((_local13) && (_local6))){ _local6.setWidth((_local6.width + _local13)); }; } else { _local2 = visibleColumns.length; _local3 = 0; while (_local3 < _local2) { _local6 = (visibleColumns[_local3] as DataGridColumn); _local12 = (_local6.width / _local4); _local7 = (availableWidth * _local12); _local6.setWidth(_local7); _local6.explicitWidth = NaN; _local13 = (_local13 - _local7); _local3++; }; if (((_local13) && (_local6))){ _local6.setWidth((_local6.width + _local13)); }; }; }; } public function set showHeaders(_arg1:Boolean):void{ _showHeaders = _arg1; invalidate(InvalidationType.SIZE); } override protected function initializeAccessibility():void{ if (DataGrid.createAccessibilityImplementation != null){ DataGrid.createAccessibilityImplementation(this); }; } public function getColumnAt(_arg1:uint):DataGridColumn{ return ((_columns[_arg1] as DataGridColumn)); } public function get rowHeight():Number{ return (_rowHeight); } public function set columns(_arg1:Array):void{ var _local2:uint; removeCellRenderers(); _columns = []; _local2 = 0; while (_local2 < _arg1.length) { addColumn(_arg1[_local2]); _local2++; }; } public function get editedItemRenderer():ICellRenderer{ if (!itemEditorInstance){ return (null); }; return (getCellRendererAt(actualRowIndex, actualColIndex)); } public function get columns():Array{ return (_columns.slice(0)); } public function spaceColumnsEqually():void{ var _local1:Number; var _local2:int; var _local3:DataGridColumn; drawNow(); if (displayableColumns.length > 0){ _local1 = (availableWidth / displayableColumns.length); _local2 = 0; while (_local2 < displayableColumns.length) { _local3 = (displayableColumns[_local2] as DataGridColumn); _local3.width = _local1; _local2++; }; invalidate(InvalidationType.SIZE); columnsInvalid = true; }; } public static function getStyleDefinition():Object{ return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition(), ScrollBar.getStyleDefinition())); } } }//package fl.controls
Section 24
//Label (fl.controls.Label) package fl.controls { import fl.core.*; import fl.events.*; import flash.text.*; public class Label extends UIComponent { protected var actualHeight:Number; protected var _html:Boolean;// = false protected var actualWidth:Number; protected var defaultLabel:String;// = "Label" protected var _savedHTML:String; public var textField:TextField; private static var defaultStyles:Object = {textFormat:null, embedFonts:false}; public function Label(){ defaultLabel = "Label"; _html = false; super(); text = defaultLabel; actualWidth = _width; actualHeight = _height; } public function get autoSize():String{ return (textField.autoSize); } public function get selectable():Boolean{ return (textField.selectable); } public function set text(_arg1:String):void{ if (_arg1 == text){ return; }; if (((componentInspectorSetting) && ((_arg1 == defaultLabel)))){ return; }; _html = false; textField.text = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } public function get wordWrap():Boolean{ return (textField.wordWrap); } public function set condenseWhite(_arg1:Boolean):void{ textField.condenseWhite = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } public function set selectable(_arg1:Boolean):void{ textField.selectable = _arg1; } public function set autoSize(_arg1:String):void{ textField.autoSize = _arg1; invalidate(InvalidationType.SIZE); } public function set wordWrap(_arg1:Boolean):void{ textField.wordWrap = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } override public function get height():Number{ if (((!((textField.autoSize == TextFieldAutoSize.NONE))) && (wordWrap))){ return (_height); }; return (actualHeight); } public function set htmlText(_arg1:String):void{ if (_arg1 == htmlText){ return; }; if (((componentInspectorSetting) && ((_arg1 == "")))){ return; }; _html = true; _savedHTML = _arg1; textField.htmlText = _arg1; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE); }; } public function get text():String{ return (textField.text); } public function get condenseWhite():Boolean{ return (textField.condenseWhite); } override protected function draw():void{ var _local1:Object; if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ drawTextFormat(); _local1 = getStyleValue("embedFonts"); if (_local1 != null){ textField.embedFonts = _local1; }; if (textField.autoSize != TextFieldAutoSize.NONE){ invalidate(InvalidationType.SIZE, false); }; }; if (isInvalid(InvalidationType.SIZE)){ drawLayout(); }; super.draw(); } override protected function configUI():void{ super.configUI(); textField = new TextField(); addChild(textField); textField.type = TextFieldType.DYNAMIC; textField.selectable = false; textField.wordWrap = false; } public function get htmlText():String{ return (textField.htmlText); } override public function setSize(_arg1:Number, _arg2:Number):void{ actualWidth = _arg1; actualHeight = _arg2; super.setSize(_arg1, _arg2); } override public function set width(_arg1:Number):void{ actualWidth = _arg1; super.width = _arg1; } protected function drawLayout():void{ var _local1:Boolean; var _local2:Number; var _local3:Number; _local1 = false; textField.width = width; textField.height = height; if (textField.autoSize != TextFieldAutoSize.NONE){ _local2 = textField.width; _local3 = textField.height; _local1 = ((!((_width == _local2))) || (!((_height == _local3)))); _width = _local2; _height = _local3; switch (textField.autoSize){ case TextFieldAutoSize.CENTER: textField.x = ((actualWidth / 2) - (textField.width / 2)); break; case TextFieldAutoSize.LEFT: textField.x = 0; break; case TextFieldAutoSize.RIGHT: textField.x = -((textField.width - actualWidth)); break; }; } else { textField.width = actualWidth; textField.height = actualHeight; textField.x = 0; }; if (_local1){ dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, true)); }; } override public function get width():Number{ if (((!((textField.autoSize == TextFieldAutoSize.NONE))) && (!(wordWrap)))){ return (_width); }; return (actualWidth); } protected function drawTextFormat():void{ var _local1:TextFormat; var _local2:Object; _local1 = (getStyleValue("textFormat") as TextFormat); if (_local1 == null){ _local2 = UIComponent.getStyleDefinition(); _local1 = (enabled) ? (_local2.defaultTextFormat as TextFormat) : (_local2.defaultDisabledTextFormat as TextFormat); }; textField.defaultTextFormat = _local1; textField.setTextFormat(_local1); if (((_html) && (!((_savedHTML == null))))){ htmlText = _savedHTML; }; } public static function getStyleDefinition():Object{ return (defaultStyles); } } }//package fl.controls
Section 25
//LabelButton (fl.controls.LabelButton) package fl.controls { import fl.core.*; import flash.display.*; import flash.events.*; 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 26
//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 27
//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 28
//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 29
//SelectableList (fl.controls.SelectableList) package fl.controls { import fl.controls.listClasses.*; import fl.core.*; import flash.display.*; import flash.events.*; 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 30
//TextInput (fl.controls.TextInput) package fl.controls { import fl.core.*; import flash.display.*; import flash.events.*; 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 31
//ComponentShim (fl.core.ComponentShim) package fl.core { import flash.display.*; public dynamic class ComponentShim extends MovieClip { } }//package fl.core
Section 32
//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 33
//UIComponent (fl.core.UIComponent) package fl.core { import flash.display.*; import flash.events.*; import fl.managers.*; import fl.events.*; import flash.text.*; import flash.utils.*; import flash.system.*; public class UIComponent extends Sprite { protected var _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 34
//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 35
//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 36
//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 37
//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 38
//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 39
//DataGridEvent (fl.events.DataGridEvent) package fl.events { import flash.events.*; public class DataGridEvent extends ListEvent { protected var _itemRenderer:Object; protected var _reason:String; protected var _dataField:String; public static const ITEM_EDIT_BEGIN:String = "itemEditBegin"; public static const ITEM_EDIT_END:String = "itemEditEnd"; public static const ITEM_EDIT_BEGINNING:String = "itemEditBeginning"; public static const HEADER_RELEASE:String = "headerRelease"; public static const ITEM_FOCUS_IN:String = "itemFocusIn"; public static const ITEM_FOCUS_OUT:String = "itemFocusOut"; public static const COLUMN_STRETCH:String = "columnStretch"; public function DataGridEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:Object=null, _arg7:String=null, _arg8:String=null){ super(_arg1, _arg2, _arg3, _arg4, _arg5); _itemRenderer = _arg6; _dataField = _arg7; _reason = _arg8; } public function get reason():String{ return (_reason); } public function set dataField(_arg1:String):void{ _dataField = _arg1; } override public function toString():String{ return (formatToString("DataGridEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "itemRenderer", "dataField", "reason")); } public function get dataField():String{ return (_dataField); } override public function clone():Event{ return (new DataGridEvent(type, bubbles, cancelable, columnIndex, int(rowIndex), _itemRenderer, _dataField, _reason)); } public function get itemRenderer():Object{ return (_itemRenderer); } } }//package fl.events
Section 40
//DataGridEventReason (fl.events.DataGridEventReason) package fl.events { public final class DataGridEventReason { public static const OTHER:String = "other"; public static const CANCELLED:String = "cancelled"; public static const NEW_COLUMN:String = "newColumn"; public static const NEW_ROW:String = "newRow"; } }//package fl.events
Section 41
//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 42
//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 43
//FocusManager (fl.managers.FocusManager) package fl.managers { import fl.core.*; import fl.controls.*; import flash.display.*; import flash.events.*; import flash.text.*; import flash.utils.*; import flash.ui.*; public class FocusManager implements IFocusManager { private var focusableObjects:Dictionary; private var _showFocusIndicator:Boolean;// = true private var defButton:Button; private var focusableCandidates:Array; private var _form:DisplayObjectContainer; private var _defaultButtonEnabled:Boolean;// = true private var activated:Boolean;// = false private var _defaultButton:Button; private var calculateCandidates:Boolean;// = true private var lastFocus:InteractiveObject; private var lastAction:String; public function FocusManager(_arg1:DisplayObjectContainer){ 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 44
//IFocusManager (fl.managers.IFocusManager) package fl.managers { import fl.controls.*; import flash.display.*; public interface IFocusManager { function getFocus():InteractiveObject; function deactivate():void; function set defaultButton(_arg1:Button):void; function set showFocusIndicator(_arg1:Boolean):void; function get defaultButtonEnabled():Boolean; function 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 45
//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 46
//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 47
//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 48
//armorgames (armorgames) package { import flash.display.*; import flash.events.*; public dynamic class armorgames extends MovieClip { public function armorgames(){ addFrameScript(112, frame113); } function frame113(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 49
//autoFiller (autoFiller) package { import flash.display.*; public dynamic class autoFiller extends SimpleButton { } }//package
Section 50
//blacksheepBoth (blacksheepBoth) package { import flash.display.*; import flash.events.*; public dynamic class blacksheepBoth extends MovieClip { public function blacksheepBoth(){ addFrameScript(39, frame40); } function frame40(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 51
//blacksheepLR (blacksheepLR) package { import flash.display.*; import flash.events.*; public dynamic class blacksheepLR extends MovieClip { public function blacksheepLR(){ addFrameScript(39, frame40); } function frame40(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 52
//blacksheepRL (blacksheepRL) package { import flash.display.*; import flash.events.*; public dynamic class blacksheepRL extends MovieClip { public function blacksheepRL(){ addFrameScript(39, frame40); } function frame40(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 53
//Buzz (Buzz) package { import flash.media.*; public dynamic class Buzz extends Sound { } }//package
Section 54
//CellRenderer_disabledSkin (CellRenderer_disabledSkin) package { import flash.display.*; public dynamic class CellRenderer_disabledSkin extends MovieClip { } }//package
Section 55
//CellRenderer_downSkin (CellRenderer_downSkin) package { import flash.display.*; public dynamic class CellRenderer_downSkin extends MovieClip { } }//package
Section 56
//CellRenderer_overSkin (CellRenderer_overSkin) package { import flash.display.*; public dynamic class CellRenderer_overSkin extends MovieClip { } }//package
Section 57
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip { } }//package
Section 58
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedDownSkin extends MovieClip { } }//package
Section 59
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedOverSkin extends MovieClip { } }//package
Section 60
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin) package { import flash.display.*; public dynamic class CellRenderer_selectedUpSkin extends MovieClip { } }//package
Section 61
//CellRenderer_upSkin (CellRenderer_upSkin) package { import flash.display.*; public dynamic class CellRenderer_upSkin extends MovieClip { } }//package
Section 62
//ColumnStretch_cursor (ColumnStretch_cursor) package { import flash.display.*; public dynamic class ColumnStretch_cursor extends MovieClip { } }//package
Section 63
//DataGrid_skin (DataGrid_skin) package { import flash.display.*; public dynamic class DataGrid_skin extends MovieClip { } }//package
Section 64
//DataGridCellEditor_skin (DataGridCellEditor_skin) package { import flash.display.*; public dynamic class DataGridCellEditor_skin extends MovieClip { } }//package
Section 65
//EasyButton (EasyButton) package { import flash.display.*; public dynamic class EasyButton extends SimpleButton { } }//package
Section 66
//FlyingSound (FlyingSound) package { import flash.media.*; public dynamic class FlyingSound extends Sound { } }//package
Section 67
//focusRectSkin (focusRectSkin) package { import flash.display.*; public dynamic class focusRectSkin extends MovieClip { } }//package
Section 68
//FuturaEmbed (FuturaEmbed) package { import flash.text.*; public dynamic class FuturaEmbed extends Font { } }//package
Section 69
//GoodBuzz (GoodBuzz) package { import flash.media.*; public dynamic class GoodBuzz extends Sound { } }//package
Section 70
//Grass (Grass) package { import flash.media.*; public dynamic class Grass extends Sound { } }//package
Section 71
//HardButton (HardButton) package { import flash.display.*; public dynamic class HardButton extends SimpleButton { } }//package
Section 72
//HeaderRenderer_disabledSkin (HeaderRenderer_disabledSkin) package { import flash.display.*; public dynamic class HeaderRenderer_disabledSkin extends MovieClip { } }//package
Section 73
//HeaderRenderer_downSkin (HeaderRenderer_downSkin) package { import flash.display.*; public dynamic class HeaderRenderer_downSkin extends MovieClip { } }//package
Section 74
//HeaderRenderer_overSkin (HeaderRenderer_overSkin) package { import flash.display.*; public dynamic class HeaderRenderer_overSkin extends MovieClip { } }//package
Section 75
//HeaderRenderer_selectedDisabledSkin (HeaderRenderer_selectedDisabledSkin) package { import flash.display.*; public dynamic class HeaderRenderer_selectedDisabledSkin extends MovieClip { } }//package
Section 76
//HeaderRenderer_selectedDownSkin (HeaderRenderer_selectedDownSkin) package { import flash.display.*; public dynamic class HeaderRenderer_selectedDownSkin extends MovieClip { } }//package
Section 77
//HeaderRenderer_selectedOverSkin (HeaderRenderer_selectedOverSkin) package { import flash.display.*; public dynamic class HeaderRenderer_selectedOverSkin extends MovieClip { } }//package
Section 78
//HeaderRenderer_selectedUpSkin (HeaderRenderer_selectedUpSkin) package { import flash.display.*; public dynamic class HeaderRenderer_selectedUpSkin extends MovieClip { } }//package
Section 79
//HeaderRenderer_upSkin (HeaderRenderer_upSkin) package { import flash.display.*; public dynamic class HeaderRenderer_upSkin extends MovieClip { } }//package
Section 80
//HeaderSortArrow_ascIcon (HeaderSortArrow_ascIcon) package { import flash.display.*; public dynamic class HeaderSortArrow_ascIcon extends MovieClip { } }//package
Section 81
//HeaderSortArrow_descIcon (HeaderSortArrow_descIcon) package { import flash.display.*; public dynamic class HeaderSortArrow_descIcon extends MovieClip { } }//package
Section 82
//HighScore (HighScore) package { import flash.display.*; public dynamic class HighScore extends SimpleButton { } }//package
Section 83
//jumpSound (jumpSound) package { import flash.media.*; public dynamic class jumpSound extends Sound { } }//package
Section 84
//MedButton (MedButton) package { import flash.display.*; public dynamic class MedButton extends SimpleButton { } }//package
Section 85
//MochiBot (MochiBot) package { import flash.display.*; import flash.net.*; import flash.system.*; public dynamic class MochiBot extends Sprite { public static function track(_arg1:Sprite, _arg2:String):MochiBot{ var _local3:MochiBot; var _local4:String; var _local5:URLVariables; var _local6:String; var _local7:URLRequest; var _local8:Loader; if (Security.sandboxType == "localWithFile"){ return (null); }; _local3 = new (MochiBot); _arg1.addChild(_local3); Security.allowDomain("*"); Security.allowInsecureDomain("*"); _local4 = "http://core.mochibot.com/my/core.swf"; _local5 = new URLVariables(); _local5["sb"] = Security.sandboxType; _local5["v"] = Capabilities.version; _local5["swfid"] = _arg2; _local5["mv"] = "8"; _local5["fv"] = "9"; _local6 = _local3.root.loaderInfo.loaderURL; if (_local6.indexOf("http") == 0){ _local5["url"] = _local6; } else { _local5["url"] = "local"; }; _local7 = new URLRequest(_local4); _local7.contentType = "application/x-www-form-urlencoded"; _local7.method = URLRequestMethod.POST; _local7.data = _local5; _local8 = new Loader(); _local3.addChild(_local8); _local8.load(_local7); return (_local3); } } }//package
Section 86
//MoreGames (MoreGames) package { import flash.display.*; public dynamic class MoreGames extends SimpleButton { } }//package
Section 87
//NextS (NextS) package { import flash.media.*; public dynamic class NextS extends Sound { } }//package
Section 88
//Point3D (Point3D) package { public class Point3D { public var fl:Number;// = 250 private var cX:Number;// = 0 private var cY:Number;// = 0 private var vpX:Number;// = 0 private var vpY:Number;// = 0 private var cZ:Number;// = 0 public var x:Number;// = 0 public var y:Number;// = 0 public var z:Number;// = 0 public function Point3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){ fl = 250; vpX = 0; vpY = 0; cX = 0; cY = 0; cZ = 0; x = 0; y = 0; z = 0; super(); this.x = _arg1; this.y = _arg2; this.z = _arg3; } public function setVanishingPoint(_arg1:Number, _arg2:Number):void{ this.vpX = _arg1; this.vpY = _arg2; } public function setCenter(_arg1:Number, _arg2:Number, _arg3:Number=0):void{ this.cX = _arg1; this.cY = _arg2; this.cZ = _arg3; } public function rotateX(_arg1:Number):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = Math.cos(_arg1); _local3 = Math.sin(_arg1); _local4 = ((y * _local2) - (z * _local3)); _local5 = ((z * _local2) + (y * _local3)); y = _local4; z = _local5; } public function rotateY(_arg1:Number):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = Math.cos(_arg1); _local3 = Math.sin(_arg1); _local4 = ((x * _local2) - (z * _local3)); _local5 = ((z * _local2) + (x * _local3)); x = _local4; z = _local5; } public function get screenY():Number{ var _local1:Number; _local1 = (fl / ((fl + z) + cZ)); return ((vpY + ((cY + y) * _local1))); } public function rotateZ(_arg1:Number):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = Math.cos(_arg1); _local3 = Math.sin(_arg1); _local4 = ((x * _local2) - (y * _local3)); _local5 = ((y * _local2) + (x * _local3)); x = _local4; y = _local5; } public function get screenX():Number{ var _local1:Number; _local1 = (fl / ((fl + z) + cZ)); return ((vpX + ((cX + x) * _local1))); } } }//package
Section 89
//PreloadBar (PreloadBar) package { import flash.display.*; public class PreloadBar { private var color:uint; private var pointA:Point3D; private var pointB:Point3D; private var pointC:Point3D; public function PreloadBar(_arg1:uint){ this.color = _arg1; } public function draw(_arg1:Graphics, _arg2, _arg3:int, _arg4:Number):void{ var _local5:int; _local5 = (Math.round(((_arg3 / 100) * 140)) - 70); trace(("Drawing to: " + _local5)); _arg1.lineStyle(0, 0, (0.7 * _arg4)); _arg1.moveTo(((_arg2 / 2) - 70), 320); _arg1.lineTo(((_arg2 / 2) + 70), 320); _arg1.curveTo(((_arg2 / 2) + 75), 326, ((_arg2 / 2) + 70), 330); _arg1.lineTo(((_arg2 / 2) - 70), 330); _arg1.curveTo(((_arg2 / 2) - 75), 326, ((_arg2 / 2) - 70), 320); _arg1.lineStyle(); _arg1.beginFill(0, (0.6 * _arg4)); _arg1.moveTo(((_arg2 / 2) - 70), 320); _arg1.lineTo(((_arg2 / 2) + _local5), 320); _arg1.curveTo((((_arg2 / 2) + _local5) + 5), 326, ((_arg2 / 2) + _local5), 330); _arg1.lineTo(((_arg2 / 2) - 70), 330); _arg1.curveTo(((_arg2 / 2) - 75), 326, ((_arg2 / 2) - 70), 320); _arg1.endFill(); } } }//package
Section 90
//Ready (Ready) package { import flash.display.*; public dynamic class Ready extends SimpleButton { } }//package
Section 91
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_disabledSkin extends MovieClip { } }//package
Section 92
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_downSkin extends MovieClip { } }//package
Section 93
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_overSkin extends MovieClip { } }//package
Section 94
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin) package { import flash.display.*; public dynamic class ScrollArrowDown_upSkin extends MovieClip { } }//package
Section 95
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_disabledSkin extends MovieClip { } }//package
Section 96
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_downSkin extends MovieClip { } }//package
Section 97
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_overSkin extends MovieClip { } }//package
Section 98
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin) package { import flash.display.*; public dynamic class ScrollArrowUp_upSkin extends MovieClip { } }//package
Section 99
//ScrollBar_thumbIcon (ScrollBar_thumbIcon) package { import flash.display.*; public dynamic class ScrollBar_thumbIcon extends MovieClip { } }//package
Section 100
//ScrollThumb_downSkin (ScrollThumb_downSkin) package { import flash.display.*; public dynamic class ScrollThumb_downSkin extends MovieClip { } }//package
Section 101
//ScrollThumb_overSkin (ScrollThumb_overSkin) package { import flash.display.*; public dynamic class ScrollThumb_overSkin extends MovieClip { } }//package
Section 102
//ScrollThumb_upSkin (ScrollThumb_upSkin) package { import flash.display.*; public dynamic class ScrollThumb_upSkin extends MovieClip { } }//package
Section 103
//ScrollTrack_skin (ScrollTrack_skin) package { import flash.display.*; public dynamic class ScrollTrack_skin extends MovieClip { } }//package
Section 104
//sheepBoth_1 (sheepBoth_1) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepBoth_1 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepBoth_1(){ addFrameScript(13, frame14, 19, frame20, 58, frame59, 59, frame60, 79, frame80); } function frame80(){ dispatchEvent(new Event(Event.COMPLETE)); } function frame14(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame20(){ sheepGrassChan = sheepGrass.play(); } function frame59(){ sheepGrassChan = sheepGrass.play(); } function frame60(){ sheepGrassChan = sheepGrass.play(); } } }//package
Section 105
//sheepBoth_2 (sheepBoth_2) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepBoth_2 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepBoth_2(){ addFrameScript(9, frame10, 13, frame14, 39, frame40, 54, frame55); } function frame10(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame14(){ sheepGrassChan = sheepGrass.play(); } function frame40(){ sheepGrassChan = sheepGrass.play(); } function frame55(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 106
//sheepBoth_3 (sheepBoth_3) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepBoth_3 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepBoth_3(){ addFrameScript(4, frame5, 8, frame9, 25, frame26, 39, frame40); } function frame26(){ sheepGrassChan = sheepGrass.play(); } function frame5(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame9(){ sheepGrassChan = sheepGrass.play(); } function frame40(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 107
//sheepBoth_4 (sheepBoth_4) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepBoth_4 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepBoth_4(){ addFrameScript(4, frame5, 7, frame8, 19, frame20, 21, frame22, 30, frame31); } function frame8(){ sheepGrassChan = sheepGrass.play(); } function frame22(){ sheepGrassChan = sheepGrass.play(); } function frame5(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame20(){ sheepGrassChan = sheepGrass.play(); } function frame31(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 108
//sheepBoth_5 (sheepBoth_5) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepBoth_5 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepBoth_5(){ addFrameScript(2, frame3, 4, frame5, 12, frame13, 14, frame15, 19, frame20); } function frame3(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame15(){ sheepGrassChan = sheepGrass.play(); } function frame20(){ dispatchEvent(new Event(Event.COMPLETE)); } function frame13(){ sheepGrassChan = sheepGrass.play(); } function frame5(){ sheepGrassChan = sheepGrass.play(); } } }//package
Section 109
//sheepCredits (sheepCredits) package { import flash.display.*; import flash.events.*; public dynamic class sheepCredits extends MovieClip { public function sheepCredits(){ addFrameScript(17, frame18, 27, frame28); } function frame18(){ stop(); } function frame28(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 110
//sheepDiff (sheepDiff) package { import flash.display.*; import flash.events.*; public dynamic class sheepDiff extends MovieClip { public function sheepDiff(){ addFrameScript(14, frame15, 29, frame30); } function frame15(){ stop(); } function frame30(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 111
//sheepFlyingFast (sheepFlyingFast) package { import flash.display.*; import flash.events.*; public dynamic class sheepFlyingFast extends MovieClip { public function sheepFlyingFast(){ addFrameScript(39, frame40); } function frame40(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 112
//sheepFlyingMedium (sheepFlyingMedium) package { import flash.display.*; import flash.events.*; public dynamic class sheepFlyingMedium extends MovieClip { public function sheepFlyingMedium(){ addFrameScript(54, frame55); } function frame55(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 113
//sheepFlyingSlow (sheepFlyingSlow) package { import flash.display.*; import flash.events.*; public dynamic class sheepFlyingSlow extends MovieClip { public function sheepFlyingSlow(){ addFrameScript(120, frame121); } function frame121(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 114
//sheepInstruc (sheepInstruc) package { import flash.display.*; import flash.events.*; public dynamic class sheepInstruc extends MovieClip { public var sheeps:Skip; public function sheepInstruc(){ addFrameScript(10, frame11, 26, frame27, 41, frame42, 54, frame55, 55, frame56); } function frame27(){ stop(); } function frame11(){ stop(); } function frame42(){ stop(); } function frame55(){ stop(); } function frame56(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 115
//sheepInstructions (sheepInstructions) package { import flash.display.*; public dynamic class sheepInstructions extends MovieClip { } }//package
Section 116
//sheepInstructions2 (sheepInstructions2) package { import flash.display.*; public dynamic class sheepInstructions2 extends MovieClip { } }//package
Section 117
//sheepInstructions3 (sheepInstructions3) package { import flash.display.*; public dynamic class sheepInstructions3 extends MovieClip { } }//package
Section 118
//sheepJump (sheepJump) package { import flash.display.*; import flash.events.*; public dynamic class sheepJump extends MovieClip { public function sheepJump(){ addFrameScript(34, frame35); } function frame35(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 119
//sheepLoader (sheepLoader) package { import flash.display.*; public dynamic class sheepLoader extends MovieClip { public function sheepLoader(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package
Section 120
//sheepLR_1 (sheepLR_1) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepLR_1 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepLR_1(){ addFrameScript(23, frame24, 79, frame80); } function frame80(){ dispatchEvent(new Event(Event.COMPLETE)); } function frame24(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } } }//package
Section 121
//sheepLR_2 (sheepLR_2) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepLR_2 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepLR_2(){ addFrameScript(14, frame15, 38, frame39, 54, frame55); } function frame15(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame39(){ sheepGrassChan = sheepGrass.play(); } function frame55(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 122
//sheepLR_3 (sheepLR_3) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepLR_3 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepLR_3(){ addFrameScript(9, frame10, 29, frame30, 39, frame40); } function frame10(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame30(){ sheepGrassChan = sheepGrass.play(); } function frame40(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 123
//sheepLR_4 (sheepLR_4) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepLR_4 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepLR_4(){ addFrameScript(7, frame8, 22, frame23, 29, frame30); } function frame8(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame23(){ sheepGrassChan = sheepGrass.play(); } function frame30(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 124
//sheepLR_5 (sheepLR_5) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepLR_5 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepLR_5(){ addFrameScript(14, frame15, 19, frame20); } function frame15(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame20(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 125
//sheepMenu (sheepMenu) package { import flash.display.*; import flash.events.*; public dynamic class sheepMenu extends MovieClip { public var SheepPlay:sheepMenuPlay; public var MoreGames:sheepMenuMoreGames; public var Credits:SimpleButton; public var Sheepy:sheepMenuSheepy; public var WeFiends:sheepMenuWeFiends; public var HighScore:sheepMenuHighScore; public function sheepMenu(){ addFrameScript(14, frame15, 29, frame30); } function frame15(){ stop(); } function frame30(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 126
//sheepMenuHighScore (sheepMenuHighScore) package { import flash.display.*; public dynamic class sheepMenuHighScore extends SimpleButton { } }//package
Section 127
//sheepMenuMoreGames (sheepMenuMoreGames) package { import flash.display.*; public dynamic class sheepMenuMoreGames extends SimpleButton { } }//package
Section 128
//sheepMenuPlay (sheepMenuPlay) package { import flash.display.*; public dynamic class sheepMenuPlay extends SimpleButton { } }//package
Section 129
//sheepMenuSheepy (sheepMenuSheepy) package { import flash.display.*; public dynamic class sheepMenuSheepy extends SimpleButton { } }//package
Section 130
//sheepMenuWeFiends (sheepMenuWeFiends) package { import flash.display.*; public dynamic class sheepMenuWeFiends extends SimpleButton { } }//package
Section 131
//sheepMusic (sheepMusic) package { import flash.media.*; public dynamic class sheepMusic extends Sound { } }//package
Section 132
//sheepmusicOff (sheepmusicOff) package { import flash.display.*; public dynamic class sheepmusicOff extends SimpleButton { } }//package
Section 133
//sheepName (sheepName) package { import fl.controls.*; import flash.display.*; public dynamic class sheepName extends MovieClip { public var Name:TextInput; public function sheepName(){ addFrameScript(24, frame25); __setProp_Name_sheepName_Layer2_1(); } function __setProp_Name_sheepName_Layer2_1(){ try { Name["componentInspectorSetting"] = true; } catch(e:Error) { }; Name.displayAsPassword = false; Name.editable = true; Name.enabled = true; Name.maxChars = 14; Name.restrict = "1234567890qwertyuiopasdfghjklzxcvbnm-QWERTYUIOPASDFGHJKLZXCVBNM "; Name.text = ""; Name.visible = true; try { Name["componentInspectorSetting"] = false; } catch(e:Error) { }; } function frame25(){ stop(); } } }//package
Section 134
//sheepPlay (sheepPlay) package { import flash.display.*; public dynamic class sheepPlay extends SimpleButton { } }//package
Section 135
//sheepRL_1 (sheepRL_1) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepRL_1 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepRL_1(){ addFrameScript(9, frame10, 54, frame55, 79, frame80); } function frame80(){ dispatchEvent(new Event(Event.COMPLETE)); } function frame10(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame55(){ sheepGrassChan = sheepGrass.play(); } } }//package
Section 136
//sheepRL_2 (sheepRL_2) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepRL_2 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepRL_2(){ addFrameScript(9, frame10, 39, frame40, 54, frame55); } function frame10(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame40(){ sheepGrassChan = sheepGrass.play(); } function frame55(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 137
//sheepRL_3 (sheepRL_3) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepRL_3 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepRL_3(){ addFrameScript(4, frame5, 24, frame25, 39, frame40); } function frame25(){ sheepGrassChan = sheepGrass.play(); } function frame5(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame40(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 138
//sheepRL_4 (sheepRL_4) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepRL_4 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepRL_4(){ addFrameScript(3, frame4, 18, frame19, 29, frame30); } function frame19(){ sheepGrassChan = sheepGrass.play(); } function frame4(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame30(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 139
//sheepRL_5 (sheepRL_5) package { import flash.display.*; import flash.events.*; import flash.media.*; public dynamic class sheepRL_5 extends MovieClip { public var sheepGrassChan:SoundChannel; public var sheepGrass:Grass; public function sheepRL_5(){ addFrameScript(2, frame3, 13, frame14, 19, frame20); } function frame14(){ sheepGrassChan = sheepGrass.play(); } function frame3(){ sheepGrass = new Grass(); sheepGrassChan = sheepGrass.play(); } function frame20(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 140
//sheepTop (sheepTop) package { import flash.display.*; import flash.events.*; public dynamic class sheepTop extends MovieClip { public function sheepTop(){ addFrameScript(49, frame50); } function frame50(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package
Section 141
//Skip (Skip) package { import flash.display.*; public dynamic class Skip extends SimpleButton { } }//package
Section 142
//TextInput_disabledSkin (TextInput_disabledSkin) package { import flash.display.*; public dynamic class TextInput_disabledSkin extends MovieClip { } }//package
Section 143
//TextInput_upSkin (TextInput_upSkin) package { import flash.display.*; public dynamic class TextInput_upSkin extends MovieClip { } }//package
Section 144
//Triangle (Triangle) package { import flash.display.*; public class Triangle { private var color:uint; private var pointA:Point3D; private var pointB:Point3D; private var pointC:Point3D; public function Triangle(_arg1:Point3D, _arg2:Point3D, _arg3:Point3D, _arg4:uint){ pointA = _arg1; pointB = _arg2; pointC = _arg3; this.color = _arg4; } public function draw(_arg1:Graphics, _arg2:Number):void{ _arg1.beginFill(color, _arg2); _arg1.moveTo(pointA.screenX, pointA.screenY); _arg1.lineTo(pointB.screenX, pointB.screenY); _arg1.lineTo(pointC.screenX, pointC.screenY); _arg1.lineTo(pointA.screenX, pointA.screenY); _arg1.endFill(); } } }//package
Section 145
//Triangles (Triangles) package { import fl.controls.*; import flash.display.*; import flash.events.*; import fl.events.*; import com.nickspeaks.sheepclass.*; import flash.text.*; import flash.utils.*; import flash.media.*; import flash.net.*; public class Triangles extends MovieClip { public var sheepBlackDual:blacksheepBoth; public var sheepLeftMedium:sheepLR_3; public var sheeptrans:SoundTransform; public var sheepDualExtreme:sheepBoth_5; public var overlay:MovieClip; public var sheepLeftExtreme:sheepLR_5; public var sheepRightMedium:sheepRL_3; public var sheepLeftExtraSlow:sheepLR_1; public var container:MovieClip; private var linkFormat:TextFormat; public var sheepPrompt; public var soundState:Boolean; public var onSheep:int; public var sbonusindex:int; public var sheepDualMedium:sheepBoth_3; private var fl:Number;// = 250 public var sheepDisplayLevel:levelBox; private var vpX:Number; var letterAlpha:Number;// = 1 private var vpY:Number; private var points:Array; public var sheepGrassChan:SoundChannel; public var musicOff:sheepmusicOff; public var sheepGrass:Grass; public var sheepJumping:jumpingSheep; public var sheepRightSlow:sheepRL_2; public var sheepLeftSlow:sheepLR_2; public var onSheepNumber:int; private var ptLoaded:int;// = 0 private var preloadDone:Boolean;// = false public var sheepchan:SoundChannel; public var sheepInput; public var sheepDualSlow:sheepBoth_2; public var sheepBlackRight:blacksheepRL; public var Player1:Player; public var sheepoMultiplier:Multiplier; private var triangles:Array; private var loadbar:PreloadBar; public var sheepDualFast:sheepBoth_4; public var sheepoMeter:Meter; public var sheepDualExtraSlow:sheepBoth_1; public var sheepRightFast:sheepRL_4; public var sheepLeftFast:sheepLR_4; public var sheepBlackLeft:blacksheepLR; public var aFill:autoFiller; public var sheepData:Data; public var sheepRightExtraSlow:sheepRL_1; public var sheepFlying:flyingSheep; public var sheepIntro:Intro; private var linktoWeFiends:TextField; public var sheepDisplayScore:scoreBox; public var sheepRightExtreme:sheepRL_5; public var sheepScore:scoreKeeper; public function Triangles(){ fl = 250; vpX = (stage.stageWidth / 2); vpY = ((stage.stageHeight / 2) - 25); loadbar = new PreloadBar(0); ptLoaded = 0; linktoWeFiends = new TextField(); linkFormat = new TextFormat(); preloadDone = false; letterAlpha = 1; super(); addFrameScript(2, frame3); stop(); init(); } function frame3(){ stop(); MochiBot.track(this, "cebe7c69"); onSheep = 0; sheepData = new Data(); Player1 = new Player("default", "blue"); sheepScore = new scoreKeeper(0); sheepoMeter = new Meter(sheepScore.onframe); sheepoMultiplier = new Multiplier(1); musicOff = new sheepmusicOff(); musicOff.addEventListener(MouseEvent.CLICK, soundToggle); soundState = true; sheepoMeter.x = 10; sheepoMeter.y = 248; sheepoMultiplier.x = 135; sheepoMultiplier.y = 308; musicOff.x = 680; musicOff.y = 26; sheepDisplayScore = new scoreBox(); sheepDisplayLevel = new levelBox(); sheepFlying = new flyingSheep(); sheepJumping = new jumpingSheep(); sheepIntro = new Intro(); sheepGrass = new Grass(); sheepLeftExtraSlow = new sheepLR_1(); sheepLeftExtraSlow.stop(); sheepLeftSlow = new sheepLR_2(); sheepLeftSlow.stop(); sheepLeftMedium = new sheepLR_3(); sheepLeftMedium.stop(); sheepLeftFast = new sheepLR_4(); sheepLeftFast.stop(); sheepLeftExtreme = new sheepLR_5(); sheepLeftExtreme.stop(); sheepLeftExtraSlow.x = 541.7; sheepLeftExtraSlow.y = 54.1; sheepLeftSlow.x = 541.7; sheepLeftSlow.y = 54.1; sheepLeftMedium.x = 541.7; sheepLeftMedium.y = 54.1; sheepLeftFast.x = 541.7; sheepLeftFast.y = 54.1; sheepLeftExtreme.x = 541.7; sheepLeftExtreme.y = 54.1; sheepRightExtraSlow = new sheepRL_1(); sheepRightExtraSlow.stop(); sheepRightSlow = new sheepRL_2(); sheepRightSlow.stop(); sheepRightMedium = new sheepRL_3(); sheepRightMedium.stop(); sheepRightFast = new sheepRL_4(); sheepRightFast.stop(); sheepRightExtreme = new sheepRL_5(); sheepRightExtreme.stop(); sheepRightExtraSlow.x = 541.7; sheepRightExtraSlow.y = 54.1; sheepRightSlow.x = 541.7; sheepRightSlow.y = 54.1; sheepRightMedium.x = 541.7; sheepRightMedium.y = 54.1; sheepRightFast.x = 541.7; sheepRightFast.y = 54.1; sheepRightExtreme.x = 541.7; sheepRightExtreme.y = 54.1; sheepDualExtraSlow = new sheepBoth_1(); sheepDualExtraSlow.stop(); sheepDualSlow = new sheepBoth_2(); sheepDualSlow.stop(); sheepDualMedium = new sheepBoth_3(); sheepDualMedium.stop(); sheepDualFast = new sheepBoth_4(); sheepDualFast.stop(); sheepDualExtreme = new sheepBoth_5(); sheepDualExtreme.stop(); sheepDualExtraSlow.x = 541.7; sheepDualExtraSlow.y = 54.1; sheepDualSlow.x = 541.7; sheepDualSlow.y = 54.1; sheepDualMedium.x = 541.7; sheepDualMedium.y = 54.1; sheepDualFast.x = 541.7; sheepDualFast.y = 54.1; sheepDualExtreme.x = 541.7; sheepDualExtreme.y = 54.1; sheepBlackDual = new blacksheepBoth(); sheepBlackLeft = new blacksheepLR(); sheepBlackRight = new blacksheepRL(); sheepBlackDual.x = 541.7; sheepBlackDual.y = 54.1; sheepBlackLeft.x = 541.7; sheepBlackLeft.y = 54.1; sheepBlackRight.x = 541.7; sheepBlackRight.y = 54.1; overlay = new MovieClip(); addChild(overlay); container = new MovieClip(); overlay.addChild(sheepIntro); main(); sheepchan = new SoundChannel(); sheeptrans = new SoundTransform(); sheepPrompt = new Label(); aFill = new autoFiller(); aFill.x = 308; aFill.y = 230; sheepInput = new TextInput(); sheepScore.addEventListener(scoreKeeper.UPDATE, sheepoMeter.updateMeter); sheepScore.addEventListener(scoreKeeper.UPDATE, sheepDisplayScore.setScore); sheepScore.addEventListener(scoreKeeper.UPDATE, sheepoMultiplier.updateMultiplier); sheepScore.addEventListener(scoreKeeper.UPDATE, sheepDisplayLevel.setLevel); } public function startNewLevel(_arg1:TimerEvent){ var _local2:sheepBonus; var _local3:Timer; if (sheepScore.meter == 0){ container.removeChildAt(0); Player1.level = 1; sheepData.resetActualCount(); sheepData.resetProb(); onSheep = 0; sheepScore.scoreReset(); } else { if ((Player1.level % 3) == 0){ container.removeChildAt(0); overlay.removeChild(sheepoMeter); overlay.removeChild(sheepDisplayScore); overlay.removeChild(sheepoMultiplier); overlay.removeChild(sheepDisplayLevel); overlay.removeChild(musicOff); Player1.level++; sheepData.resetActualCount(); onSheep = 0; _local2 = new sheepBonus(sheepScore); _local2.x = 237; _local2.y = 94; overlay.addChild(_local2); sbonusindex = overlay.getChildIndex(_local2); trace(("sbonus: " + overlay.getChildIndex(_local2))); _local3 = new Timer(1000, 5); _local3.addEventListener(TimerEvent.TIMER_COMPLETE, restoreFromBonus); _local3.start(); } else { container.removeChildAt(0); Player1.level++; sheepData.resetActualCount(); onSheep = 0; sheepLoop(Player1.level); }; }; } private function determinePercent(_arg1, _arg2){ ptLoaded = Math.round(((_arg1 / _arg2) * 100)); } public function checkUserInput(_arg1:ComponentEvent){ var _local2:Boolean; var _local3:Number; var _local4:GameOver; var _local5:int; var _local6:Timer; sheepInput.removeEventListener(ComponentEvent.ENTER, checkUserInput); trace(_arg1.currentTarget.text); sheepScore.setScore(sheepData.actualCount, _arg1.currentTarget.text); container.removeChildAt(1); _local2 = false; if (_arg1.currentTarget.text == sheepData.actualCount){ container.removeChildAt(0); sheepPrompt.text = sheepData.whichWinPhrase(); sheepPrompt.validateNow(); _local3 = (350 - (sheepPrompt.width / 2)); sheepPrompt.move(_local3, 40); container.addChildAt(sheepPrompt, 0); } else { if (sheepScore.meter == 0){ _local2 = true; overlay.removeChild(sheepDisplayLevel); overlay.removeChild(sheepoMeter); overlay.removeChild(sheepDisplayScore); overlay.removeChild(sheepoMultiplier); sheepchan.stop(); container.removeChildAt(0); Player1.level = 1; sheepData.resetActualCount(); sheepData.resetProb(); onSheep = 0; sheepScore.scoreReset(); sheepScore.submitScore(Player1.Pname); _local4 = new GameOver(sheepScore, Player1.Pname); _local4.addEventListener(GameOver.DONE, gotoMenu); overlay.addChild(_local4); } else { container.removeChildAt(0); _local5 = Math.abs((sheepData.actualCount - _arg1.currentTarget.text)); sheepPrompt.text = (("Wrong... (Off by " + _local5) + ")"); sheepPrompt.validateNow(); _local3 = (350 - (sheepPrompt.width / 2)); sheepPrompt.move(_local3, 40); container.addChildAt(sheepPrompt, 0); }; }; if (!_local2){ _local6 = new Timer(1000, 1); _local6.addEventListener(TimerEvent.TIMER_COMPLETE, startNewLevel); _local6.start(); }; } public function sheepLoop(_arg1:int){ var _local2:sheepMusic; if (_arg1 == 1){ _local2 = new sheepMusic(); sheeptrans.volume = 0.22; sheepchan = _local2.play(0, 100); sheepchan.soundTransform = sheeptrans; }; sheepData.howMany(_arg1); sheepData.createSheepProb(); sheepDraw(sheepData.whichSpeed()); } private function onEnterFrame(_arg1:Event):void{ var _local2:Number; var _local3:Number; var _local4:uint; var _local5:Point3D; determinePercent(this.loaderInfo.bytesLoaded, this.loaderInfo.bytesTotal); if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){ preloadDone = true; }; if (preloadDone){ if (letterAlpha > 0){ letterAlpha = (letterAlpha - 0.025); } else { initGame(); }; }; _local2 = ((mouseY - vpY) * 0.0005); _local3 = ((mouseX - vpX) * 0.0005); _local4 = 0; while (_local4 < points.length) { _local5 = points[_local4]; _local5.rotateX(_local2); _local5.rotateY(_local3); _local4++; }; graphics.clear(); _local4 = 0; while (_local4 < triangles.length) { triangles[_local4].draw(graphics, (0.9 * letterAlpha)); _local4++; }; loadbar.draw(graphics, stage.stageWidth, ptLoaded, letterAlpha); } private function urltoWeFiends(_arg1:MouseEvent){ var _local2:URLRequest; _local2 = new URLRequest("http://www.wefiends.com/"); navigateToURL(_local2); } public function sheepInit(_arg1:Event){ overlay.removeChild(sheepIntro); trace("Start"); Player1.setDifficulty(sheepIntro.getDifficulty()); Player1.setName(sheepIntro.getName()); sheepScore.setDiff(Player1.difficulty()); sheepFlying.setDiff(Player1.difficulty()); sheepJumping.setDiff(Player1.difficulty()); Player1.level = 1; sheepLoop(Player1.level); overlay.addChild(sheepFlying); overlay.addChild(container); overlay.addChild(sheepJumping); overlay.addChild(sheepoMeter); overlay.addChild(sheepDisplayScore); overlay.addChild(sheepoMultiplier); overlay.addChild(sheepDisplayLevel); overlay.addChild(musicOff); } private function init():void{ var _local1:int; var _local2:int; var _local3:int; var _local4:uint; stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; linkFormat.size = 10; linkFormat.font = "Verdana"; linktoWeFiends.defaultTextFormat = linkFormat; linktoWeFiends.text = "wefiends.com"; linktoWeFiends.width = 78; linktoWeFiends.x = ((stage.stageWidth / 2) - 35); linktoWeFiends.y = 333; linktoWeFiends.selectable = false; addChild(linktoWeFiends); linktoWeFiends.addEventListener(MouseEvent.CLICK, urltoWeFiends); points = new Array(); _local1 = 100; points[0] = new Point3D(-85, -120, 100); points[1] = new Point3D(-65, -120, 100); points[2] = new Point3D(-55, -60, 100); points[3] = new Point3D(-45, -80, 100); points[4] = new Point3D(-35, -60, 100); points[5] = new Point3D(-25, -120, 100); points[6] = new Point3D(-5, -120, 100); points[7] = new Point3D(-15, -20, 100); points[8] = new Point3D(-25, -20, 100); points[9] = new Point3D(-45, -50, 100); points[10] = new Point3D(-65, -20, 100); points[11] = new Point3D(-75, -20, 100); points[12] = new Point3D(5, -120, 100); points[13] = new Point3D(75, -120, 100); points[14] = new Point3D(75, -100, 100); points[15] = new Point3D(25, -100, 100); points[16] = new Point3D(25, -80, 100); points[17] = new Point3D(65, -80, 100); points[18] = new Point3D(65, -60, 100); points[19] = new Point3D(25, -60, 100); points[20] = new Point3D(25, -40, 100); points[21] = new Point3D(75, -40, 100); points[22] = new Point3D(75, -20, 100); points[23] = new Point3D(5, -20, 100); _local1 = 65; points[24] = new Point3D(-215, 20, _local1); points[25] = new Point3D(-145, 20, _local1); points[26] = new Point3D(-145, 40, _local1); points[27] = new Point3D(-195, 40, _local1); points[28] = new Point3D(-195, 50, _local1); points[29] = new Point3D(-155, 50, _local1); points[30] = new Point3D(-155, 70, _local1); points[31] = new Point3D(-195, 70, _local1); points[32] = new Point3D(-195, 120, _local1); points[33] = new Point3D(-215, 120, _local1); _local1 = 85; points[34] = new Point3D(-135, 20, _local1); points[35] = new Point3D(-115, 20, _local1); points[36] = new Point3D(-115, 120, _local1); points[37] = new Point3D(-135, 120, _local1); _local2 = -100; _local3 = 140; _local1 = 95; points[38] = new Point3D((5 + _local2), (-120 + _local3), _local1); points[39] = new Point3D((75 + _local2), (-120 + _local3), _local1); points[40] = new Point3D((75 + _local2), (-100 + _local3), _local1); points[41] = new Point3D((25 + _local2), (-100 + _local3), _local1); points[42] = new Point3D((25 + _local2), (-80 + _local3), _local1); points[43] = new Point3D((65 + _local2), (-80 + _local3), _local1); points[44] = new Point3D((65 + _local2), (-60 + _local3), _local1); points[45] = new Point3D((25 + _local2), (-60 + _local3), _local1); points[46] = new Point3D((25 + _local2), (-40 + _local3), _local1); points[47] = new Point3D((75 + _local2), (-40 + _local3), _local1); points[48] = new Point3D((75 + _local2), (-20 + _local3), _local1); points[49] = new Point3D((5 + _local2), (-20 + _local3), _local1); _local2 = 0; _local3 = 0; _local1 = 95; points[50] = new Point3D((-15 + _local2), (20 + _local3), _local1); points[51] = new Point3D((5 + _local2), (20 + _local3), _local1); points[52] = new Point3D((45 + _local2), (80 + _local3), _local1); points[53] = new Point3D((45 + _local2), (20 + _local3), _local1); points[54] = new Point3D((65 + _local2), (20 + _local3), _local1); points[55] = new Point3D((65 + _local2), (120 + _local3), _local1); points[56] = new Point3D((45 + _local2), (120 + _local3), _local1); points[57] = new Point3D((5 + _local2), (60 + _local3), _local1); points[58] = new Point3D((5 + _local2), (120 + _local3), _local1); points[59] = new Point3D((-15 + _local2), (120 + _local3), _local1); _local1 = 85; points[60] = new Point3D(75, 20, _local1); points[61] = new Point3D(125, 20, _local1); points[62] = new Point3D(135, 25, _local1); points[63] = new Point3D(140, 30, _local1); points[64] = new Point3D(145, 40, _local1); points[65] = new Point3D(145, 70, _local1); points[66] = new Point3D(145, 100, _local1); points[67] = new Point3D(140, 110, _local1); points[68] = new Point3D(135, 115, _local1); points[69] = new Point3D(125, 120, _local1); points[70] = new Point3D(75, 120, _local1); points[71] = new Point3D(95, 40, _local1); points[72] = new Point3D(105, 40, _local1); points[73] = new Point3D(115, 45, _local1); points[74] = new Point3D(122, 50, _local1); points[75] = new Point3D(125, 70, _local1); points[76] = new Point3D(122, 90, _local1); points[77] = new Point3D(115, 95, _local1); points[78] = new Point3D(105, 100, _local1); points[79] = new Point3D(95, 100, _local1); _local1 = 65; points[80] = new Point3D(155, 40, _local1); points[81] = new Point3D(165, 30, _local1); points[82] = new Point3D(175, 25, _local1); points[83] = new Point3D(185, 20, _local1); points[84] = new Point3D(225, 20, _local1); points[85] = new Point3D(225, 40, _local1); points[86] = new Point3D(185, 40, _local1); points[87] = new Point3D(180, 45, _local1); points[88] = new Point3D(180, 55, _local1); points[89] = new Point3D(190, 60, _local1); points[90] = new Point3D(205, 65, _local1); points[91] = new Point3D(215, 70, _local1); points[92] = new Point3D(225, 80, _local1); points[93] = new Point3D(225, 110, _local1); points[94] = new Point3D(220, 115, _local1); points[95] = new Point3D(215, 120, _local1); points[96] = new Point3D(195, 120, _local1); points[97] = new Point3D(155, 120, _local1); points[98] = new Point3D(155, 100, _local1); points[99] = new Point3D(195, 100, _local1); points[100] = new Point3D(205, 95, _local1); points[101] = new Point3D(205, 85, _local1); points[102] = new Point3D(190, 80, _local1); points[103] = new Point3D(175, 75, _local1); points[104] = new Point3D(165, 70, _local1); points[105] = new Point3D(155, 60, _local1); points[106] = new Point3D(155, 50, _local1); _local2 = -240; _local3 = -125; _local1 = 150; points[107] = new Point3D((92 + _local2), (62 + _local3), _local1); points[108] = new Point3D((101 + _local2), (89 + _local3), _local1); points[109] = new Point3D((83 + _local2), (89 + _local3), _local1); points[110] = new Point3D((70 + _local2), (79 + _local3), _local1); points[111] = new Point3D((87 + _local2), (79 + _local3), _local1); points[112] = new Point3D((97 + _local2), (79 + _local3), _local1); points[113] = new Point3D((114 + _local2), (79 + _local3), _local1); points[114] = new Point3D((92 + _local2), (95 + _local3), _local1); points[115] = new Point3D((79 + _local2), (105 + _local3), _local1); points[116] = new Point3D((106 + _local2), (105 + _local3), _local1); _local2 = 70; _local3 = -125; _local1 = 0; points[117] = new Point3D((92 + _local2), (62 + _local3), _local1); points[118] = new Point3D((101 + _local2), (89 + _local3), _local1); points[119] = new Point3D((83 + _local2), (89 + _local3), _local1); points[120] = new Point3D((70 + _local2), (79 + _local3), _local1); points[121] = new Point3D((87 + _local2), (79 + _local3), _local1); points[122] = new Point3D((97 + _local2), (79 + _local3), _local1); points[123] = new Point3D((114 + _local2), (79 + _local3), _local1); points[124] = new Point3D((92 + _local2), (95 + _local3), _local1); points[125] = new Point3D((79 + _local2), (105 + _local3), _local1); points[126] = new Point3D((106 + _local2), (105 + _local3), _local1); _local4 = 0; while (_local4 < points.length) { points[_local4].setVanishingPoint(vpX, vpY); points[_local4].setCenter(0, 0, 200); _local4++; }; triangles = new Array(); triangles[0] = new Triangle(points[0], points[1], points[11], 0); triangles[1] = new Triangle(points[1], points[2], points[11], 0); triangles[2] = new Triangle(points[2], points[10], points[11], 0); triangles[3] = new Triangle(points[3], points[4], points[2], 0); triangles[4] = new Triangle(points[2], points[9], points[10], 0); triangles[5] = new Triangle(points[2], points[4], points[9], 0); triangles[6] = new Triangle(points[4], points[8], points[9], 0); triangles[7] = new Triangle(points[5], points[7], points[4], 0); triangles[8] = new Triangle(points[5], points[6], points[7], 0); triangles[9] = new Triangle(points[4], points[7], points[8], 0); triangles[10] = new Triangle(points[12], points[15], points[23], 0); triangles[11] = new Triangle(points[12], points[14], points[15], 0); triangles[12] = new Triangle(points[12], points[13], points[14], 0); triangles[13] = new Triangle(points[15], points[20], points[23], 0); triangles[14] = new Triangle(points[16], points[17], points[19], 0); triangles[15] = new Triangle(points[17], points[18], points[19], 0); triangles[16] = new Triangle(points[20], points[21], points[23], 0); triangles[17] = new Triangle(points[21], points[22], points[23], 0); triangles[18] = new Triangle(points[24], points[32], points[33], 0); triangles[19] = new Triangle(points[24], points[27], points[32], 0); triangles[20] = new Triangle(points[24], points[25], points[26], 0); triangles[21] = new Triangle(points[24], points[26], points[27], 0); triangles[22] = new Triangle(points[28], points[29], points[31], 0); triangles[23] = new Triangle(points[29], points[30], points[31], 0); triangles[24] = new Triangle(points[34], points[35], points[37], 0); triangles[25] = new Triangle(points[35], points[36], points[37], 0); triangles[26] = new Triangle(points[38], points[41], points[49], 0); triangles[27] = new Triangle(points[38], points[40], points[41], 0); triangles[28] = new Triangle(points[38], points[39], points[40], 0); triangles[29] = new Triangle(points[41], points[46], points[49], 0); triangles[30] = new Triangle(points[42], points[43], points[45], 0); triangles[31] = new Triangle(points[43], points[44], points[45], 0); triangles[32] = new Triangle(points[46], points[47], points[49], 0); triangles[33] = new Triangle(points[47], points[48], points[49], 0); triangles[34] = new Triangle(points[50], points[58], points[59], 0); triangles[35] = new Triangle(points[50], points[51], points[58], 0); triangles[36] = new Triangle(points[51], points[52], points[56], 0); triangles[37] = new Triangle(points[51], points[56], points[57], 0); triangles[38] = new Triangle(points[53], points[54], points[56], 0); triangles[39] = new Triangle(points[54], points[55], points[56], 0); triangles[40] = new Triangle(points[60], points[71], points[70], 0); triangles[41] = new Triangle(points[60], points[72], points[71], 0); triangles[42] = new Triangle(points[60], points[61], points[72], 0); triangles[43] = new Triangle(points[71], points[79], points[70], 0); triangles[44] = new Triangle(points[79], points[69], points[70], 0); triangles[45] = new Triangle(points[61], points[73], points[72], 0); triangles[46] = new Triangle(points[61], points[62], points[73], 0); triangles[47] = new Triangle(points[62], points[74], points[73], 0); triangles[48] = new Triangle(points[62], points[63], points[74], 0); triangles[49] = new Triangle(points[63], points[64], points[74], 0); triangles[50] = new Triangle(points[64], points[75], points[74], 0); triangles[51] = new Triangle(points[64], points[65], points[75], 0); triangles[52] = new Triangle(points[75], points[65], points[66], 0); triangles[53] = new Triangle(points[75], points[66], points[76], 0); triangles[54] = new Triangle(points[76], points[66], points[67], 0); triangles[55] = new Triangle(points[76], points[67], points[77], 0); triangles[56] = new Triangle(points[77], points[67], points[68], 0); triangles[57] = new Triangle(points[77], points[68], points[69], 0); triangles[58] = new Triangle(points[78], points[77], points[69], 0); triangles[59] = new Triangle(points[79], points[78], points[69], 0); triangles[60] = new Triangle(points[80], points[87], points[81], 0); triangles[61] = new Triangle(points[81], points[86], points[87], 0); triangles[62] = new Triangle(points[81], points[82], points[86], 0); triangles[63] = new Triangle(points[82], points[83], points[86], 0); triangles[64] = new Triangle(points[83], points[84], points[86], 0); triangles[65] = new Triangle(points[86], points[84], points[85], 0); triangles[66] = new Triangle(points[80], points[87], points[106], 0); triangles[67] = new Triangle(points[106], points[87], points[88], 0); triangles[68] = new Triangle(points[106], points[88], points[105], 0); triangles[69] = new Triangle(points[105], points[88], points[104], 0); triangles[70] = new Triangle(points[104], points[88], points[103], 0); triangles[71] = new Triangle(points[88], points[89], points[103], 0); triangles[72] = new Triangle(points[89], points[102], points[103], 0); triangles[73] = new Triangle(points[89], points[90], points[102], 0); triangles[74] = new Triangle(points[90], points[101], points[102], 0); triangles[75] = new Triangle(points[90], points[91], points[101], 0); triangles[76] = new Triangle(points[91], points[92], points[101], 0); triangles[77] = new Triangle(points[92], points[93], points[101], 0); triangles[78] = new Triangle(points[101], points[93], points[100], 0); triangles[79] = new Triangle(points[100], points[93], points[94], 0); triangles[80] = new Triangle(points[100], points[94], points[95], 0); triangles[81] = new Triangle(points[99], points[100], points[95], 0); triangles[82] = new Triangle(points[98], points[99], points[96], 0); triangles[83] = new Triangle(points[98], points[96], points[97], 0); triangles[84] = new Triangle(points[99], points[95], points[96], 0); triangles[85] = new Triangle(points[107], points[108], points[109], 0); triangles[86] = new Triangle(points[110], points[111], points[109], 0); triangles[87] = new Triangle(points[112], points[113], points[108], 0); triangles[88] = new Triangle(points[109], points[108], points[114], 0); triangles[89] = new Triangle(points[109], points[114], points[115], 0); triangles[90] = new Triangle(points[114], points[108], points[116], 0); triangles[91] = new Triangle(points[117], points[118], points[119], 0); triangles[92] = new Triangle(points[120], points[121], points[119], 0); triangles[93] = new Triangle(points[122], points[123], points[118], 0); triangles[94] = new Triangle(points[119], points[118], points[124], 0); triangles[95] = new Triangle(points[119], points[124], points[125], 0); triangles[96] = new Triangle(points[124], points[118], points[126], 0); addEventListener(Event.ENTER_FRAME, onEnterFrame); } public function removeMe(_arg1:Event){ _arg1.currentTarget.stop(); container.removeChildAt(0); sheepDraw(sheepData.whichSpeed()); } public function sheepDraw(_arg1:int){ var _local2:int; trace(("Actual Sheep Count: " + sheepData.actualCount)); if (onSheep < sheepData.getSheepAmount()){ if (sheepScore.extrahard){ if (sheepFlying.init(50)){ sheepData.actualCount++; }; } else { if (sheepFlying.init(Player1.level)){ sheepData.actualCount++; }; }; if (sheepScore.extrahard){ if (sheepJumping.init(50)){ sheepData.actualCount++; }; } else { if (sheepJumping.init(Player1.level)){ sheepData.actualCount++; }; }; _local2 = (Math.round((Math.random() * 2)) + 1); if ((((((((Math.random() > 0.75)) && ((onSheep > 1)))) && ((Player1.level > 11)))) && (!(sheepScore.nosubtract)))){ if (_local2 == 1){ sheepBlackLeft.addEventListener(Event.COMPLETE, removeMe); sheepBlackLeft.gotoAndPlay(1); container.addChild(sheepBlackLeft); sheepData.actualCount--; } else { if (_local2 == 2){ sheepBlackRight.addEventListener(Event.COMPLETE, removeMe); sheepBlackRight.gotoAndPlay(1); container.addChild(sheepBlackRight); sheepData.actualCount--; } else { if (_local2 == 3){ sheepBlackDual.addEventListener(Event.COMPLETE, removeMe); sheepBlackDual.gotoAndPlay(1); container.addChild(sheepBlackDual); sheepData.actualCount = (sheepData.actualCount - 2); }; }; }; } else { if (_local2 == 1){ if (_arg1 == 1){ sheepLeftExtraSlow.addEventListener(Event.COMPLETE, removeMe); sheepLeftExtraSlow.gotoAndPlay(1); container.addChild(sheepLeftExtraSlow); } else { if (_arg1 == 2){ sheepLeftSlow.addEventListener(Event.COMPLETE, removeMe); sheepLeftSlow.gotoAndPlay(1); container.addChild(sheepLeftSlow); } else { if (_arg1 == 3){ sheepLeftMedium.addEventListener(Event.COMPLETE, removeMe); sheepLeftMedium.gotoAndPlay(1); container.addChild(sheepLeftMedium); } else { if (_arg1 == 4){ sheepLeftFast.addEventListener(Event.COMPLETE, removeMe); sheepLeftFast.gotoAndPlay(1); container.addChild(sheepLeftFast); } else { if (_arg1 == 5){ sheepLeftFast.addEventListener(Event.COMPLETE, removeMe); sheepLeftFast.gotoAndPlay(1); container.addChild(sheepLeftFast); }; }; }; }; }; onSheepNumber = _local2; sheepData.actualCount++; onSheep++; } else { if (_local2 == 2){ if (_arg1 == 1){ sheepRightExtraSlow.addEventListener(Event.COMPLETE, removeMe); sheepRightExtraSlow.gotoAndPlay(1); container.addChild(sheepRightExtraSlow); } else { if (_arg1 == 2){ sheepRightSlow.addEventListener(Event.COMPLETE, removeMe); sheepRightSlow.gotoAndPlay(1); container.addChild(sheepRightSlow); } else { if (_arg1 == 3){ sheepRightMedium.addEventListener(Event.COMPLETE, removeMe); sheepRightMedium.gotoAndPlay(1); container.addChild(sheepRightMedium); } else { if (_arg1 == 4){ sheepRightFast.addEventListener(Event.COMPLETE, removeMe); sheepRightFast.gotoAndPlay(1); container.addChild(sheepRightFast); } else { if (_arg1 == 5){ sheepRightFast.addEventListener(Event.COMPLETE, removeMe); sheepRightFast.gotoAndPlay(1); container.addChild(sheepRightFast); }; }; }; }; }; onSheepNumber = _local2; sheepData.actualCount++; onSheep++; } else { if ((((_local2 == 3)) && ((Player1.level > 2)))){ if (_arg1 == 1){ sheepDualExtraSlow.addEventListener(Event.COMPLETE, removeMe); sheepDualExtraSlow.gotoAndPlay(1); container.addChild(sheepDualSlow); } else { if (_arg1 == 2){ sheepDualSlow.addEventListener(Event.COMPLETE, removeMe); sheepDualSlow.gotoAndPlay(1); container.addChild(sheepDualSlow); } else { if (_arg1 == 3){ sheepDualMedium.addEventListener(Event.COMPLETE, removeMe); sheepDualMedium.gotoAndPlay(1); container.addChild(sheepDualMedium); } else { if (_arg1 == 4){ sheepDualFast.addEventListener(Event.COMPLETE, removeMe); sheepDualFast.gotoAndPlay(1); container.addChild(sheepDualFast); } else { if (_arg1 == 5){ sheepDualFast.addEventListener(Event.COMPLETE, removeMe); sheepDualFast.gotoAndPlay(1); container.addChild(sheepDualFast); }; }; }; }; }; onSheepNumber = _local2; sheepData.actualCount = (sheepData.actualCount + 2); onSheep++; } else { sheepDraw(sheepData.whichSpeed()); }; }; }; }; } else { askUser(); }; } public function soundToggle(_arg1:MouseEvent):void{ if (soundState == true){ soundState = false; SoundMixer.soundTransform = new SoundTransform(0); } else { if (soundState == false){ soundState = true; SoundMixer.soundTransform = new SoundTransform(1); }; }; } private function initGame(){ linktoWeFiends.removeEventListener(MouseEvent.CLICK, urltoWeFiends); removeEventListener(Event.ENTER_FRAME, onEnterFrame); graphics.clear(); gotoAndPlay(3); } public function gotoMenu(_arg1:Event){ overlay.addChild(sheepIntro); trace(overlay.toString()); sheepIntro.init(3); } public function insertText(_arg1:MouseEvent){ sheepScore.autofill--; trace(("Autofills: " + sheepScore.autofill)); sheepInput.text = sheepData.actualCount; container.removeChild(aFill); } public function restoreFromBonus(_arg1:TimerEvent){ overlay.removeChildAt(sbonusindex); overlay.addChild(sheepoMeter); overlay.addChild(sheepDisplayScore); overlay.addChild(sheepoMultiplier); overlay.addChild(sheepDisplayLevel); overlay.addChild(musicOff); sheepLoop(Player1.level); } public function main(){ sheepIntro.addEventListener(Intro.DONE, sheepInit); sheepIntro.init(); } public function askUser(){ var _local1:TextFormat; var _local2:TextFormat; var _local3:Number; _local1 = new TextFormat(); _local1.color = 0xFFFFFF; _local1.font = "Futura"; _local1.size = 44; _local2 = new TextFormat(); _local2.size = 46; _local2.font = "Futura"; _local2.align = TextFormatAlign.RIGHT; sheepPrompt.setStyle("embedFonts", true); sheepPrompt.setStyle("textFormat", _local1); sheepPrompt.text = "How many sheep?"; sheepPrompt.autoSize = TextFieldAutoSize.LEFT; sheepPrompt.validateNow(); _local3 = (350 - (sheepPrompt.width / 2)); sheepPrompt.move(_local3, 40); container.addChildAt(sheepPrompt, 0); sheepInput.text = ""; sheepInput.x = 310; sheepInput.y = 145; sheepInput.height = 60; sheepInput.width = 90; sheepInput.maxChars = 3; sheepInput.restrict = "0-9"; sheepInput.setStyle("embedFonts", true); sheepInput.setStyle("textFormat", _local2); sheepInput.addEventListener(ComponentEvent.ENTER, checkUserInput); container.addChildAt(sheepInput, 1); sheepInput.setFocus(); if (sheepScore.autofill > 0){ container.addChild(aFill); }; aFill.addEventListener(MouseEvent.CLICK, insertText); } } }//package
Section 146
//WeFiends (WeFiends) package { import flash.display.*; public dynamic class WeFiends extends SimpleButton { } }//package
Section 147
//WeFiendsIntro (WeFiendsIntro) package { import flash.display.*; import flash.events.*; public dynamic class WeFiendsIntro extends MovieClip { public function WeFiendsIntro(){ addFrameScript(96, frame97); } function frame97(){ dispatchEvent(new Event(Event.COMPLETE)); } } }//package

Library Items

Symbol 1 Font {FuturaEmbed}Used by:24 25 43 45 47 49 51 52 53 55 74 75 178 179 180 181 182 183 260 262 264 267 270 274
Symbol 2 GraphicUsed by:3
Symbol 3 MovieClipUses:2Used by:11 168 298
Symbol 4 MovieClip {fl.core.ComponentShim}Used by:11 113 134 166 168 298
Symbol 5 GraphicUsed by:6
Symbol 6 MovieClip {TextInput_disabledSkin}Uses:5Used by:11
Symbol 7 GraphicUsed by:8 167
Symbol 8 MovieClip {TextInput_upSkin}Uses:7Used by:11
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClip {focusRectSkin}Uses:9Used by:11 166 168
Symbol 11 MovieClip {fl.controls.TextInput}Uses:3 4 6 8 10Used by:279  Timeline
Symbol 12 GraphicUsed by:23
Symbol 13 GraphicUsed by:14
Symbol 14 MovieClipUses:13Used by:23
Symbol 15 GraphicUsed by:16 279
Symbol 16 ButtonUses:15Used by:23
Symbol 17 GraphicUsed by:18
Symbol 18 MovieClipUses:17Used by:23
Symbol 19 GraphicUsed by:20
Symbol 20 MovieClipUses:19Used by:23
Symbol 21 GraphicUsed by:22
Symbol 22 MovieClipUses:21Used by:23
Symbol 23 MovieClip {armorgames}Uses:12 14 16 18 20 22 SS1Used by:Timeline
Symbol 24 TextUses:1Used by:26
Symbol 25 TextUses:1Used by:26
Symbol 26 Button {autoFiller}Uses:24 25Used by:Timeline
Symbol 27 GraphicUsed by:39 40 41 172 173 174 175 176 252 253 254 255 256 280 281 282 283 284
Symbol 28 GraphicUsed by:39 40 41 85 172 173 174 175 176 188 194 197 198 204 213 216 219 252 253 254 255 256 280 281 282 283 284
Symbol 29 GraphicUsed by:39 40 41 85 172 173 174 175 176 188 194 197 198 204 213 216 219 247 252 253 254 255 256 280 281 282 283 284 285
Symbol 30 GraphicUsed by:39 40 41 85 172 173 174 175 176 188 194 197 198 204 213 216 219 247 252 253 254 255 256 280 281 282 283 284 285
Symbol 31 GraphicUsed by:39 40 41 85 172 173 174 175 176 188 194 197 198 204 213 216 219 247 251 252 253 254 255 256 280 281 282 283 284 285
Symbol 32 GraphicUsed by:39 40 41 85 172 173 174 175 176 188 194 197 198 204 213 216 219 247 252 253 254 255 256 280 281 282 283 284 285
Symbol 33 GraphicUsed by:34 188 191 194 197 246
Symbol 34 MovieClipUses:33Used by:39 41 85 172 173 174 175 176 188 197 198 213 216 219 280 281 282 283 284
Symbol 35 GraphicUsed by:39 40 41 172 173 174 175 176 252 253 254 255 256 280 281 282 283 284
Symbol 36 GraphicUsed by:39 40 41 172 173 174 175 176 252 253 254 255 256 280 281 282 283 284
Symbol 37 GraphicUsed by:39 40 41 172 173 174 175 176 252 253 254 255 256 280 281 282 283 284
Symbol 38 GraphicUsed by:39 40 41 172 173 174 175 176 252 253 254 255 256 280 281 282 283 284
Symbol 39 MovieClip {blacksheepBoth}Uses:27 28 29 30 31 32 34 35 36 37 38Used by:Timeline
Symbol 40 MovieClip {blacksheepLR}Uses:27 28 29 30 31 32 35 36 37 38Used by:Timeline
Symbol 41 MovieClip {blacksheepRL}Uses:27 32 31 28 30 29 34 35 36 37 38Used by:Timeline
Symbol 42 GraphicUsed by:56
Symbol 43 TextUses:1Used by:44 56
Symbol 44 Button {sheepPlay}Uses:43Used by:56
Symbol 45 TextUses:1Used by:46 56
Symbol 46 Button {MoreGames}Uses:45Used by:56
Symbol 47 TextUses:1Used by:48 56
Symbol 48 Button {WeFiends}Uses:47Used by:56
Symbol 49 TextUses:1Used by:50
Symbol 50 Button {HighScore}Uses:49Used by:56
Symbol 51 TextUses:1Used by:56
Symbol 52 TextUses:1Used by:56
Symbol 53 TextUses:1Used by:56
Symbol 54 GraphicUsed by:56
Symbol 55 TextUses:1Used by:56
Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver}Uses:42 44 46 48 50 51 52 53 54 43 45 47 55 SS2Used by:Timeline
Symbol 57 GraphicUsed by:58
Symbol 58 MovieClipUses:57Used by:63 70 218
Symbol 59 GraphicUsed by:60
Symbol 60 MovieClipUses:59Used by:63 70 218
Symbol 61 GraphicUsed by:62
Symbol 62 MovieClipUses:61Used by:63 70 218
Symbol 63 MovieClipUses:58 60 62Used by:70
Symbol 64 GraphicUsed by:65
Symbol 65 MovieClipUses:64Used by:70 218
Symbol 66 GraphicUsed by:67
Symbol 67 MovieClipUses:66Used by:70 218
Symbol 68 GraphicUsed by:69
Symbol 69 MovieClipUses:68Used by:70
Symbol 70 MovieClip {com.nickspeaks.sheepclass.Meter}Uses:63 65 67 58 60 62 69Used by:Timeline
Symbol 71 FontUsed by:72 73 169 170 210 211 212 214 215 217 220 221 223 225 226 227 228 229 230 232 233 235 236 238 239 278
Symbol 72 TextUses:71Used by:77
Symbol 73 TextUses:71Used by:77
Symbol 74 TextUses:1Used by:76
Symbol 75 TextUses:1Used by:76
Symbol 76 MovieClipUses:74 75Used by:77
Symbol 77 MovieClip {com.nickspeaks.sheepclass.Multiplier}Uses:72 73 76Used by:Timeline
Symbol 78 GraphicUsed by:79
Symbol 79 MovieClipUses:78Used by:97
Symbol 80 GraphicUsed by:97 224
Symbol 81 GraphicUsed by:97 224
Symbol 82 GraphicUsed by:97 224
Symbol 83 GraphicUsed by:94
Symbol 84 GraphicUsed by:85
Symbol 85 MovieClipUses:32 31 28 30 29 34 84Used by:94 231
Symbol 86 GraphicUsed by:87
Symbol 87 MovieClipUses:86Used by:94 231
Symbol 88 GraphicUsed by:89
Symbol 89 MovieClipUses:88Used by:94 231
Symbol 90 GraphicUsed by:91
Symbol 91 MovieClipUses:90Used by:94 231
Symbol 92 GraphicUsed by:93
Symbol 93 MovieClipUses:92Used by:94 231
Symbol 94 MovieClipUses:83 85 87 89 91 93Used by:97 224
Symbol 95 GraphicUsed by:97 224
Symbol 96 GraphicUsed by:97 224
Symbol 97 MovieClip {com.nickspeaks.sheepclass.sheepBonus}Uses:79 80 81 82 94 95 96 SS3Used by:Timeline
Symbol 98 GraphicUsed by:99
Symbol 99 MovieClip {HeaderRenderer_upSkin}Uses:98Used by:113
Symbol 100 GraphicUsed by:101
Symbol 101 MovieClip {HeaderRenderer_disabledSkin}Uses:100Used by:113
Symbol 102 GraphicUsed by:103 108
Symbol 103 MovieClip {HeaderRenderer_downSkin}Uses:102Used by:113
Symbol 104 GraphicUsed by:105
Symbol 105 MovieClip {HeaderRenderer_overSkin}Uses:104Used by:113
Symbol 106 GraphicUsed by:107
Symbol 107 MovieClip {HeaderRenderer_selectedDisabledSkin}Uses:106Used by:113
Symbol 108 MovieClip {HeaderRenderer_selectedDownSkin}Uses:102Used by:113
Symbol 109 GraphicUsed by:110
Symbol 110 MovieClip {HeaderRenderer_selectedOverSkin}Uses:109Used by:113
Symbol 111 GraphicUsed by:112
Symbol 112 MovieClip {HeaderRenderer_selectedUpSkin}Uses:111Used by:113
Symbol 113 MovieClip {fl.controls.dataGridClasses.HeaderRenderer}Uses:99 4 101 103 105 107 108 110 112Used by:168
Symbol 114 GraphicUsed by:115 142 145 149 159
Symbol 115 MovieClip {HeaderSortArrow_ascIcon}Uses:114Used by:168
Symbol 116 GraphicUsed by:117
Symbol 117 MovieClip {HeaderSortArrow_descIcon}Uses:116Used by:168
Symbol 118 GraphicUsed by:119
Symbol 119 MovieClip {CellRenderer_upSkin}Uses:118Used by:134
Symbol 120 GraphicUsed by:121
Symbol 121 MovieClip {CellRenderer_disabledSkin}Uses:120Used by:134
Symbol 122 GraphicUsed by:123
Symbol 123 MovieClip {CellRenderer_downSkin}Uses:122Used by:134
Symbol 124 GraphicUsed by:125
Symbol 125 MovieClip {CellRenderer_overSkin}Uses:124Used by:134
Symbol 126 GraphicUsed by:127
Symbol 127 MovieClip {CellRenderer_selectedDisabledSkin}Uses:126Used by:134
Symbol 128 GraphicUsed by:129
Symbol 129 MovieClip {CellRenderer_selectedDownSkin}Uses:128Used by:134
Symbol 130 GraphicUsed by:131
Symbol 131 MovieClip {CellRenderer_selectedOverSkin}Uses:130Used by:134
Symbol 132 GraphicUsed by:133
Symbol 133 MovieClip {CellRenderer_selectedUpSkin}Uses:132Used by:134
Symbol 134 MovieClip {fl.controls.listClasses.CellRenderer}Uses:119 4 121 123 125 127 129 131 133Used by:168
Symbol 135 GraphicUsed by:136
Symbol 136 MovieClip {ColumnStretch_cursor}Uses:135Used by:168
Symbol 137 GraphicUsed by:138
Symbol 138 MovieClip {DataGrid_skin}Uses:137Used by:168
Symbol 139 GraphicUsed by:140
Symbol 140 MovieClip {ScrollTrack_skin}Uses:139Used by:166
Symbol 141 GraphicUsed by:143
Symbol 142 MovieClipUses:114Used by:143 153 155
Symbol 143 MovieClip {ScrollArrowUp_downSkin}Uses:141 142Used by:166
Symbol 144 GraphicUsed by:145
Symbol 145 MovieClip {ScrollArrowDown_downSkin}Uses:144 114Used by:166
Symbol 146 GraphicUsed by:147
Symbol 147 MovieClip {ScrollThumb_downSkin}Uses:146Used by:166
Symbol 148 GraphicUsed by:149
Symbol 149 MovieClip {ScrollArrowDown_overSkin}Uses:148 114Used by:166
Symbol 150 GraphicUsed by:151
Symbol 151 MovieClip {ScrollThumb_overSkin}Uses:150Used by:166
Symbol 152 GraphicUsed by:153
Symbol 153 MovieClip {ScrollArrowUp_overSkin}Uses:152 142Used by:166
Symbol 154 GraphicUsed by:155
Symbol 155 MovieClip {ScrollArrowUp_upSkin}Uses:154 142Used by:166
Symbol 156 GraphicUsed by:157
Symbol 157 MovieClip {ScrollThumb_upSkin}Uses:156Used by:166
Symbol 158 GraphicUsed by:159
Symbol 159 MovieClip {ScrollArrowDown_upSkin}Uses:158 114Used by:166
Symbol 160 GraphicUsed by:161
Symbol 161 MovieClip {ScrollArrowDown_disabledSkin}Uses:160Used by:166
Symbol 162 GraphicUsed by:163
Symbol 163 MovieClip {ScrollArrowUp_disabledSkin}Uses:162Used by:166
Symbol 164 GraphicUsed by:165
Symbol 165 MovieClip {ScrollBar_thumbIcon}Uses:164Used by:166
Symbol 166 MovieClip {fl.controls.ScrollBar}Uses:140 4 10 143 145 147 149 151 153 155 157 159 161 163 165Used by:168
Symbol 167 MovieClip {DataGridCellEditor_skin}Uses:7Used by:168
Symbol 168 MovieClip {fl.controls.DataGrid}Uses:3 4 113 115 117 134 10 136 138 166 167Used by:Timeline
Symbol 169 TextUses:71Used by:171
Symbol 170 TextUses:71Used by:171
Symbol 171 Button {Ready}Uses:169 170Used by:234  Timeline
Symbol 172 MovieClip {sheepBoth_1}Uses:27 28 29 30 31 32 34 35 36 37 38Used by:Timeline
Symbol 173 MovieClip {sheepBoth_2}Uses:27 28 29 30 31 32 34 35 36 37 38Used by:Timeline
Symbol 174 MovieClip {sheepBoth_3}Uses:27 28 29 30 31 32 34 35 36 37 38Used by:Timeline
Symbol 175 MovieClip {sheepBoth_4}Uses:27 28 29 30 31 32 34 35 36 37 38Used by:Timeline
Symbol 176 MovieClip {sheepBoth_5}Uses:27 28 29 30 31 32 34 35 36 37 38Used by:Timeline
Symbol 177 GraphicUsed by:184
Symbol 178 TextUses:1Used by:184
Symbol 179 TextUses:1Used by:184
Symbol 180 TextUses:1Used by:184
Symbol 181 TextUses:1Used by:184
Symbol 182 TextUses:1Used by:184
Symbol 183 TextUses:1Used by:184
Symbol 184 MovieClipUses:177 178 179 180 181 182 183Used by:185
Symbol 185 MovieClip {sheepCredits}Uses:184Used by:Timeline
Symbol 186 GraphicUsed by:198 279
Symbol 187 GraphicUsed by:188
Symbol 188 Button {EasyButton}Uses:32 31 28 30 29 34 187 33Used by:198  Timeline
Symbol 189 GraphicUsed by:190 194 204
Symbol 190 MovieClipUses:189Used by:194 216
Symbol 191 MovieClipUses:33Used by:194 204 216
Symbol 192 FontUsed by:193 196
Symbol 193 TextUses:192Used by:194
Symbol 194 Button {MedButton}Uses:28 32 31 30 190 29 191 193 189 33Used by:198  Timeline
Symbol 195 GraphicUsed by:197 216
Symbol 196 TextUses:192Used by:197
Symbol 197 Button {HardButton}Uses:195 32 31 28 30 29 34 196 33Used by:198  Timeline
Symbol 198 MovieClip {sheepDiff}Uses:186 32 31 28 30 29 34 188 194 197Used by:Timeline
Symbol 199 GraphicUsed by:204
Symbol 200 GraphicUsed by:204
Symbol 201 GraphicUsed by:204
Symbol 202 GraphicUsed by:204
Symbol 203 GraphicUsed by:204
Symbol 204 MovieClipUses:28 32 31 30 189 29 191 199 200 201 202 203Used by:205 206 207
Symbol 205 MovieClip {sheepFlyingFast}Uses:204Used by:Timeline
Symbol 206 MovieClip {sheepFlyingMedium}Uses:204Used by:Timeline
Symbol 207 MovieClip {sheepFlyingSlow}Uses:204Used by:Timeline
Symbol 208 GraphicUsed by:216 222 231 234
Symbol 209 GraphicUsed by:216 222 231 234
Symbol 210 TextUses:71Used by:216
Symbol 211 TextUses:71Used by:216
Symbol 212 TextUses:71Used by:213
Symbol 213 MovieClipUses:32 31 28 30 29 34 212Used by:216
Symbol 214 TextUses:71Used by:216
Symbol 215 TextUses:71Used by:216
Symbol 216 MovieClip {sheepInstructions}Uses:208 209 210 211 213 195 32 31 28 30 29 34 214 190 191 215Used by:241  Timeline
Symbol 217 TextUses:71Used by:222
Symbol 218 MovieClipUses:58 60 62 65 67Used by:222
Symbol 219 MovieClipUses:32 31 28 30 29 34Used by:222
Symbol 220 TextUses:71Used by:222
Symbol 221 TextUses:71Used by:222
Symbol 222 MovieClip {sheepInstructions2}Uses:209 217 208 218 219 220 221Used by:241  Timeline
Symbol 223 TextUses:71Used by:231
Symbol 224 MovieClipUses:80 81 82 94 95 96Used by:231
Symbol 225 TextUses:71Used by:231
Symbol 226 TextUses:71Used by:231
Symbol 227 TextUses:71Used by:231
Symbol 228 TextUses:71Used by:231
Symbol 229 TextUses:71Used by:231
Symbol 230 TextUses:71Used by:231
Symbol 231 MovieClipUses:209 208 223 224 91 225 93 226 85 227 87 228 89 229 230Used by:241
Symbol 232 TextUses:71Used by:234
Symbol 233 TextUses:71Used by:234
Symbol 234 MovieClip {sheepInstructions3}Uses:209 208 232 233 171Used by:241  Timeline
Symbol 235 TextUses:71Used by:237
Symbol 236 TextUses:71Used by:237
Symbol 237 ButtonUses:235 236Used by:241
Symbol 238 TextUses:71Used by:240
Symbol 239 TextUses:71Used by:240
Symbol 240 Button {Skip}Uses:238 239Used by:241  Timeline
Symbol 241 MovieClip {sheepInstruc}Uses:216 222 231 234 237 240Used by:Timeline
Symbol 242 GraphicUsed by:243
Symbol 243 MovieClipUses:242Used by:247 285
Symbol 244 GraphicUsed by:245
Symbol 245 MovieClipUses:244Used by:247 285
Symbol 246 MovieClipUses:33Used by:247 285
Symbol 247 MovieClip {sheepJump}Uses:32 243 31 245 30 29 246Used by:Timeline
Symbol 248 GraphicUsed by:251
Symbol 249 GraphicUsed by:251
Symbol 250 GraphicUsed by:251
Symbol 251 MovieClip {sheepLoader}Uses:248 31 249 250Used by:Timeline
Symbol 252 MovieClip {sheepLR_1}Uses:27 28 29 30 31 32 35 36 37 38Used by:Timeline
Symbol 253 MovieClip {sheepLR_2}Uses:27 28 29 30 31 32 35 36 37 38Used by:Timeline
Symbol 254 MovieClip {sheepLR_3}Uses:27 28 29 30 31 32 35 36 37 38Used by:Timeline
Symbol 255 MovieClip {sheepLR_4}Uses:27 28 29 30 31 32 35 36 37 38Used by:Timeline
Symbol 256 MovieClip {sheepLR_5}Uses:27 28 29 30 31 32 35 36 37 38Used by:Timeline
Symbol 257 GraphicUsed by:258
Symbol 258 Button {sheepmusicOff}Uses:257Used by:Timeline
Symbol 259 GraphicUsed by:261 263 265
Symbol 260 TextUses:1Used by:261
Symbol 261 Button {sheepMenuPlay}Uses:259 260Used by:276
Symbol 262 TextUses:1Used by:263
Symbol 263 Button {sheepMenuHighScore}Uses:259 262Used by:276
Symbol 264 TextUses:1Used by:265
Symbol 265 Button {sheepMenuMoreGames}Uses:259 264Used by:276
Symbol 266 GraphicUsed by:268 275
Symbol 267 TextUses:1Used by:268
Symbol 268 Button {sheepMenuWeFiends}Uses:266 267Used by:276
Symbol 269 GraphicUsed by:273
Symbol 270 TextUses:1Used by:273
Symbol 271 GraphicUsed by:272 273
Symbol 272 MovieClipUses:271Used by:273
Symbol 273 Button {sheepMenuSheepy}Uses:269 270 272 271Used by:276
Symbol 274 TextUses:1Used by:275
Symbol 275 ButtonUses:266 274Used by:276
Symbol 276 MovieClip {sheepMenu}Uses:261 263 265 268 273 275Used by:Timeline
Symbol 277 GraphicUsed by:279
Symbol 278 TextUses:71Used by:279
Symbol 279 MovieClip {sheepName}Uses:15 186 11 277 278Used by:Timeline
Symbol 280 MovieClip {sheepRL_1}Uses:27 32 31 28 30 29 34 35 36 37 38Used by:Timeline
Symbol 281 MovieClip {sheepRL_2}Uses:27 32 31 28 30 29 34 35 36 37 38Used by:Timeline
Symbol 282 MovieClip {sheepRL_3}Uses:27 32 31 28 30 29 34 35 36 37 38Used by:Timeline
Symbol 283 MovieClip {sheepRL_4}Uses:27 32 31 28 30 29 34 35 36 37 38Used by:Timeline
Symbol 284 MovieClip {sheepRL_5}Uses:27 32 31 28 30 29 34 35 36 37 38Used by:Timeline
Symbol 285 MovieClip {sheepTop}Uses:32 243 31 245 30 29 246Used by:Timeline
Symbol 286 GraphicUsed by:287
Symbol 287 MovieClipUses:286Used by:293
Symbol 288 GraphicUsed by:289
Symbol 289 MovieClipUses:288Used by:293
Symbol 290 BitmapUsed by:291
Symbol 291 GraphicUses:290Used by:292
Symbol 292 MovieClipUses:291Used by:293
Symbol 293 MovieClip {WeFiendsIntro}Uses:287 289 292 SS4Used by:Timeline
Symbol 294 Sound {sheepMusic}Used by:295
Symbol 295 MovieClipUses:294Used by:Timeline
Symbol 296 Sound {Grass}Used by:297
Symbol 297 MovieClipUses:296Used by:Timeline
Symbol 298 MovieClip {fl.controls.Label}Uses:3 4Used by:Timeline
Symbol 299 Sound {GoodBuzz}Used by:300
Symbol 300 MovieClipUses:299Used by:309
Symbol 301 Sound {NextS}Used by:302
Symbol 302 MovieClipUses:301Used by:309
Symbol 303 Sound {Buzz}Used by:304
Symbol 304 MovieClipUses:303Used by:309
Symbol 305 Sound {jumpSound}Used by:306 307
Symbol 306 MovieClipUses:305Used by:309
Symbol 307 MovieClipUses:305Used by:309
Symbol 308 Sound {FlyingSound}Used by:309
Symbol 309 MovieClipUses:300 302 304 306 307 308Used by:Timeline
Symbol 310 GraphicUsed by:315
Symbol 311 GraphicUsed by:315
Symbol 312 GraphicUsed by:313
Symbol 313 MovieClipUses:312Used by:315
Symbol 314 GraphicUsed by:315
Symbol 315 MovieClipUses:310 311 313 314Used by:Timeline
Symbol 316 GraphicUsed by:Timeline
Streaming Sound 1Used by:Symbol 23 MovieClip {armorgames}
Streaming Sound 2Used by:Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver}
Streaming Sound 3Used by:Symbol 97 MovieClip {com.nickspeaks.sheepclass.sheepBonus}
Streaming Sound 4Used by:Symbol 293 MovieClip {WeFiendsIntro}

Instance Names

"pAgain"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 1Symbol 44 Button {sheepPlay}
"mGames"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 1Symbol 46 Button {MoreGames}
"wFiends"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 1Symbol 48 Button {WeFiends}
"hScores"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 1Symbol 50 Button {HighScore}
"pAgain"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 111Symbol 44 Button {sheepPlay}
"mGames"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 111Symbol 46 Button {MoreGames}
"wFiends"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 111Symbol 48 Button {WeFiends}
"hScores"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 111Symbol 50 Button {HighScore}
"pAgain"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 137Symbol 44 Button {sheepPlay}
"mGames"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 137Symbol 46 Button {MoreGames}
"wFiends"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 137Symbol 48 Button {WeFiends}
"hScores"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 137Symbol 50 Button {HighScore}
"pAgain"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 139Symbol 44 Button {sheepPlay}
"mGames"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 139Symbol 46 Button {MoreGames}
"wFiends"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 139Symbol 48 Button {WeFiends}
"hScores"Symbol 56 MovieClip {com.nickspeaks.sheepclass.GameOver} Frame 139Symbol 50 Button {HighScore}
"sheeps"Symbol 241 MovieClip {sheepInstruc} Frame 11Symbol 240 Button {Skip}
"SheepPlay"Symbol 276 MovieClip {sheepMenu} Frame 1Symbol 261 Button {sheepMenuPlay}
"HighScore"Symbol 276 MovieClip {sheepMenu} Frame 1Symbol 263 Button {sheepMenuHighScore}
"MoreGames"Symbol 276 MovieClip {sheepMenu} Frame 1Symbol 265 Button {sheepMenuMoreGames}
"WeFiends"Symbol 276 MovieClip {sheepMenu} Frame 1Symbol 268 Button {sheepMenuWeFiends}
"Sheepy"Symbol 276 MovieClip {sheepMenu} Frame 1Symbol 273 Button {sheepMenuSheepy}
"Credits"Symbol 276 MovieClip {sheepMenu} Frame 1Symbol 275 Button
"Name"Symbol 279 MovieClip {sheepName} Frame 1Symbol 11 MovieClip {fl.controls.TextInput}

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata not present, AS3.
Protect (24)Timeline Frame 10 bytes ""




http://swfchan.com/12/59931/info.shtml
Created: 16/4 -2019 13:44:37 Last modified: 16/4 -2019 13:44:37 Server time: 23/12 -2024 00:33:09