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

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

jupiterjyohti_grovyle_growthsplosion.swf

This is the info page for
Flash #128832

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


ActionScript [AS3]
Section 1
//ProjectAsset (com.picklish.app.model.ProjectAsset) package com.picklish.app.model { import flash.display.*; import flash.geom.*; public class ProjectAsset { public var photoHeight:uint; public var photoData:BitmapData; public var bytesLoaded:int;// = 0 public var bytesTotal:int;// = 1 public var thumbRect:Rectangle; public var id:String; public var thumbData:BitmapData; public var caption:String; public var videoURL:String; public var audioURL:String; public var type:uint;// = 1 public var photoWidth:uint; public var rotation:uint; public static const TYPE_PHOTO:uint = 1; public static const TYPE_VIDEO:uint = 2; public function ProjectAsset(_arg1:uint=1, _arg2:String="", _arg3:BitmapData=null, _arg4:BitmapData=null, _arg5:int=0, _arg6:String="", _arg7:String="", _arg8:String=""){ this.type = _arg1; this.id = _arg2; this.thumbData = _arg3; this.photoData = _arg4; photoWidth = ((_arg4)!=null) ? _arg4.width : 0; photoWidth = ((_arg4)!=null) ? _arg4.height : 0; this.rotation = _arg5; this.videoURL = _arg6; this.audioURL = _arg7; this.caption = _arg8; } public function fromString(_arg1:String):void{ var _local3:Array; var _local2:XML = new XML(_arg1); id = (("@src" in _local2)) ? String(_local2.@src) : (("@id" in _local2)) ? String(_local2.@id) : ""; photoWidth = (("@width" in _local2)) ? parseInt(_local2.@width) : 0; photoHeight = (("@height" in _local2)) ? parseInt(_local2.@height) : 0; rotation = (("@class" in _local2)) ? parseInt(String(_local2.attribute("class")).split("rotate").join("")) : 0; videoURL = (("@vidsrc" in _local2)) ? String(_local2.@vidsrc) : ""; audioURL = (("@audsrc" in _local2)) ? String(_local2.@audsrc) : ""; caption = (("@alt" in _local2)) ? unescape(String(_local2.@alt)) : ""; if (("@usemap" in _local2)){ _local3 = String(_local2.@usemap).split(","); if (_local3.length == 4){ thumbRect = new Rectangle(_local3[0], _local3[1], _local3[2], _local3[3]); }; } else { thumbRect = null; }; type = ((videoURL.length)==0) ? TYPE_PHOTO : TYPE_VIDEO; } public function toString():String{ var _local1 = ""; if (thumbRect != null){ _local1 = ((((((((" usemap=\"" + thumbRect.x) + ",") + thumbRect.y) + ",") + thumbRect.width) + ",") + thumbRect.height) + "\""); }; return ((((((((((((((((("<img src=\"" + id) + "\" width=\"") + photoWidth) + "\" height=\"") + photoHeight) + "\" class=\"rotate") + rotation) + "\" alt=\"") + escape(caption)) + "\" vidsrc=\"") + videoURL) + "\" audsrc=\"") + audioURL) + "\"") + _local1) + " />")); } } }//package com.picklish.app.model
Section 2
//Gallery (com.picklish.player.Gallery) package com.picklish.player { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import com.slideroll.ui.*; import flash.text.*; import com.picklish.app.model.*; import flash.utils.*; import flash.geom.*; public class Gallery extends EventDispatcher { protected var _container:Cell; public var nextButton:SimpleButton; public var autostep:Sprite; public var pageNav:Container; public var linkColor:Number;// = 0xFFEC00 protected var _mediaContainer:Cell; protected var _navmc:Sprite; protected var _navFadedIn:Boolean;// = false protected var _mediaView:GalleryMedia; protected var _galleryContainer:Cell; protected var _style:Style; protected var _visible:Boolean;// = false public var prevPageButton:SimpleButton; public var textColor:Number;// = 0xFFFFFF public var autostep_pause:SimpleButton; protected var absPosition:Position; protected var _collection:Collection; protected var _navTimer:Timer; public var captionField:TextField; public var prevButton:SimpleButton; protected var _autoStepPaused:Boolean;// = false protected var _layout:GalleryLayout; public var buttonColor:Number;// = 0xFFFFFF public var baseURL:String;// = "" protected var _thumbsContainer:Cell; protected var _autoStepTimer:Timer; protected var _autoStepping:Boolean;// = false public var nextPageButton:SimpleButton; public var autostep_play:SimpleButton; public static const ASSET_UPDATE:String = "asset_update"; protected static var LibrarySWF:Class = Gallery_LibrarySWF; public static var tweenManager:TweenManager; protected static var _initialized:Boolean = false; public static var library:Library; public function Gallery(_arg1:Cell, _arg2:Style=null, _arg3:GalleryLayout=null, _arg4:TweenManager=null){ init(_arg1, _arg2, _arg3, _arg4); } public function get container():Cell{ return (_container); } public function create():void{ build(); } public function autoStepStart(_arg1:MouseEvent=null):void{ if (((((!((autostep == null))) && (!((_autoStepTimer == null))))) && (!(_autoStepping)))){ autostep_play.visible = false; autostep_pause.visible = true; _autoStepTimer.reset(); _autoStepTimer.start(); onAutoStep(); _autoStepping = true; _autoStepPaused = false; }; } protected function onUpdate(_arg1:ObjectEvent):void{ setInitialMedia(); dispatchEvent(new ObjectEvent(_arg1.type, false, false, _arg1.object)); } protected function initNav():void{ var _local1:Rectangle; if (_layout.thumbsHasNavButtons){ _navmc = (library.getDisplayObject(_layout.thumbsNavSymbol) as Sprite); pageNav = new Container(null, _navmc, "", absPosition); _galleryContainer.addChild(pageNav); prevPageButton = _navmc["prevButton"]; nextPageButton = _navmc["nextButton"]; _local1 = _layout.thumbsArea; prevPageButton.scaleX = (prevPageButton.scaleY = (nextPageButton.scaleX = (nextPageButton.scaleY = _layout.thumbsNavButtonScale))); prevPageButton.x = (_local1.x - _layout.thumbsNavButtonPadding); nextPageButton.x = ((_local1.x + _local1.width) + _layout.thumbsNavButtonPadding); prevPageButton.y = (nextPageButton.y = (_local1.y + (_local1.height / 2))); prevPageButton.addEventListener(MouseEvent.CLICK, prevPage); nextPageButton.addEventListener(MouseEvent.CLICK, nextPage); if (_navmc != null){ pageNav.mc.mouseEnabled = false; pageNav.mc.mouseChildren = true; _navmc.mouseEnabled = false; _navmc.mouseChildren = true; if (_navmc["prevShade"] != null){ _navmc["prevShade"].x = 0; _navmc["prevShade"].height = _local1.height; _navmc["prevShade"].y = (_local1.height / 2); _navmc["prevShade"].mouseEnabled = false; _navmc["prevShade"].mouseChildren = false; }; if (_navmc["nextShade"] != null){ _navmc["nextShade"].x = _local1.width; _navmc["nextShade"].height = _local1.height; _navmc["nextShade"].y = (_local1.height / 2); _navmc["nextShade"].mouseEnabled = false; _navmc["nextShade"].mouseChildren = false; }; if (_navmc["autostep"] != null){ autostep = _navmc["autostep"]; autostep.x = 0; autostep.y = 0; autostep_play = autostep["btn_play"]; autostep_pause = autostep["btn_pause"]; autostep_pause.visible = false; autostep_play.addEventListener(MouseEvent.CLICK, autoStepStart); autostep_pause.addEventListener(MouseEvent.CLICK, autoStepStop); _autoStepTimer = new Timer(5000, 0); _autoStepTimer.addEventListener(TimerEvent.TIMER, onAutoStep); }; }; setPageButtons(); }; if (_layout.thumbsNavButtonsOnRollOver){ _navmc.mouseEnabled = false; _navmc.alpha = 0; _navTimer = new Timer(100, 0); _navTimer.addEventListener(TimerEvent.TIMER, checkNavVisibility); _navTimer.start(); }; } public function prevAsset(_arg1:MouseEvent=null):void{ var _local2:CollectionItem; var _local3:uint; if (((((!((_mediaView == null))) && (_mediaView.useNav))) && (!((_mediaView.asset == null))))){ _local2 = _collection.getItem(_mediaView.asset); _local3 = _collection.members.indexOf(_local2); if (_local2 != null){ _collection.selectObject(_collection.members[(_local3 - 1)]); }; autoStepStop(); if (_mediaView != null){ _mediaView.autoStepStop(); }; _collection.gotoItemPage(_collection.selectedMembers[0]); setPageButtons(); }; } public function show():void{ setInitialMedia(); if (_collection != null){ _collection.gotoPage(1); }; setPageButtons(); } protected function init(_arg1:Cell, _arg2:Style=null, _arg3:GalleryLayout=null, _arg4:TweenManager=null):void{ _container = _arg1; _style = _arg2; _layout = _arg3; if (_style == null){ _style = new Style(); }; if (_layout == null){ _layout = new GalleryLayout(); }; if (_arg4 != null){ Gallery.tweenManager = _arg4; } else { Gallery.tweenManager = new TweenManager(true); }; absPosition = new Position(null, Position.ALIGN_LEFT, Position.PLACEMENT_ABSOLUTE, Position.CLEAR_NONE, 0); initializeLibrary(); } public function setInitialMedia():void{ if (((((_layout.mediaIsPersistent) && (!((_collection == null))))) && ((_collection.members.length > 0)))){ if ((CollectionItem(_collection.members[0]).reference is ProjectAsset)){ _collection.selectObject(_collection.members[0]); if (_collection.usePagingDisplay){ _collection.gotoPage(1); }; if (_mediaView != null){ _mediaView.asset = (CollectionItem(_collection.members[0]).reference as ProjectAsset); }; onThumbSelect(); if (((_layout.autoplay) && (!(_autoStepPaused)))){ autoStepStart(); }; }; }; } public function get collection():Collection{ return (_collection); } protected function onAutoStep(_arg1:TimerEvent=null):void{ nextPage(null, true); } protected function onThumbSelect(_arg1:Event=null):void{ var _local2:CollectionItem; var _local3:uint; if (((((!((_mediaView == null))) && (_mediaView.useNav))) && (!((_mediaView.asset == null))))){ _local2 = _collection.getItem(_mediaView.asset); _local3 = _collection.members.indexOf(_local2); if (_local2 != null){ prevButton.mouseEnabled = (_local3 > 0); prevButton.alpha = (prevButton.mouseEnabled) ? 1 : 0.3; nextButton.mouseEnabled = (_local3 < (_collection.members.length - 1)); nextButton.alpha = (nextButton.mouseEnabled) ? 1 : 0.3; } else { prevButton.alpha = (nextButton.alpha = 0.3); prevButton.mouseEnabled = (nextButton.mouseEnabled = false); }; }; } public function get mediaView():GalleryMedia{ return (_mediaView); } public function get layout():GalleryLayout{ return (_layout); } public function setStyleSheet(_arg1:TextField):void{ var _local2 = (((("p { color: " + ColorTools.numberToHTMLColor(textColor)) + "; } a { color: ") + ColorTools.numberToHTMLColor(linkColor)) + "; text-decoration: underline; }"); var _local3:StyleSheet = new StyleSheet(); _local3.parseCSS(_local2); _arg1.styleSheet = _local3; } public function get style():Style{ return (_style); } public function destroy():void{ autoStepStop(); if (_collection != null){ _collection.removeEventListener(Collection.EVENT_ADD_MEMBER, onMediaAdded); _collection.removeEventListener(Collection.EVENT_SELECT, onThumbSelect); _collection.masterCollection = null; _collection.clear(); _collection.destroy(); }; if (_thumbsContainer != null){ _thumbsContainer.clear(); }; if (_mediaView != null){ _mediaView.asset = null; _mediaView.destroy(); }; if (_mediaContainer != null){ _mediaContainer.clear(); }; if (_galleryContainer != null){ _galleryContainer.clear(); _galleryContainer.destroy(); }; _galleryContainer = (_thumbsContainer = (_mediaContainer = (_collection = null))); _mediaView = null; prevButton = (nextButton = (prevPageButton = (nextPageButton = null))); } protected function onMediaAdded(_arg1:ObjectEvent):void{ var _local2:ProjectAsset = (_arg1.object as ProjectAsset); var _local3:CollectionItem = _collection.getItem(_local2); _local3.idx = _collection.members.indexOf(_local3); attachClipToCollection(_local2, _local3); setPageButtons(); if (((!(_layout.autoplay)) || (_autoStepPaused))){ autoStepStop(); if (_mediaView != null){ _mediaView.autoStepStop(); }; }; } public function nextAsset(_arg1:MouseEvent=null, _arg2:Boolean=false):void{ var _local3:CollectionItem; var _local4:uint; var _local5:ProjectAsset; if (((((!((_mediaView == null))) && (_mediaView.useNav))) && (!((_mediaView.asset == null))))){ _local3 = _collection.getItem(_mediaView.asset); _local4 = _collection.members.indexOf(_local3); if (((((!((_local3 == null))) && (!((_local4 == -1))))) && (!((_local4 == (_collection.members.length - 1)))))){ _local5 = (CollectionItem(_collection.members[(_local4 + 1)]).reference as ProjectAsset); if ((((_local5 == null)) || ((_local5.photoData == null)))){ return; }; _collection.selectObject(_collection.members[(_local4 + 1)]); }; if (((_arg2) && ((_local4 == (_collection.members.length - 1))))){ _collection.selectObject(_collection.members[0]); }; if (_arg1 != null){ autoStepStop(); if (_mediaView != null){ _mediaView.autoStepStop(); }; }; _collection.gotoItemPage(_collection.selectedMembers[0]); setPageButtons(); }; } protected function applyLayout(_arg1:int=1, _arg2:int=-1, _arg3:int=-1):void{ if ((((_arg1 > 0)) && (!((GalleryLayout[("OPTIONS" + _arg1)] == undefined))))){ _layout.applyLayout(GalleryLayout[("OPTIONS" + _arg1)]); if ((((_arg2 > 0)) && ((_arg3 > 0)))){ _layout.width = _arg2; _layout.height = _arg3; }; }; } public function autoStepStop(_arg1:MouseEvent=null):void{ if (((((!((autostep == null))) && (!((_autoStepTimer == null))))) && (_autoStepping))){ autostep_play.visible = true; autostep_pause.visible = false; _autoStepTimer.stop(); _autoStepping = false; _autoStepPaused = true; }; } protected function attachClipToCollection(_arg1:ProjectAsset, _arg2:CollectionItem):void{ var _local3:GalleryAsset = new _layout.thumbClass(this, _arg2, _style, _layout, _arg1); _arg2.selectCallback = _local3.select; _arg2.activateCallback = _local3.activate; } protected function nextPage(_arg1:MouseEvent=null, _arg2:Boolean=false):void{ if (((_arg2) && ((_collection.currentPage == _collection.totalPages)))){ _collection.gotoPage(1); } else { _collection.nextPage(_arg1); }; setPageButtons(); if (_arg1 != null){ autoStepStop(); }; } public function update(_arg1:ProjectAsset=null):void{ if (_arg1 == null){ setColors(); setInitialMedia(); if (_collection != null){ _collection.gotoPage(1); _collection.updateView(); setPageButtons(); }; }; dispatchEvent(new ObjectEvent(ASSET_UPDATE, false, false, _arg1)); } public function set layout(_arg1:GalleryLayout):void{ if (_layout != _arg1){ _layout = _arg1; build(); }; } protected function setPageButtons():void{ if (((!((prevPageButton == null))) && (!((nextPageButton == null))))){ prevPageButton.alpha = ((_collection.currentPage)<=1) ? 0.5 : 1; prevPageButton.mouseEnabled = (_collection.currentPage > 1); nextPageButton.alpha = ((_collection.currentPage)==_collection.totalPages) ? 0.5 : 1; nextPageButton.mouseEnabled = (_collection.currentPage < _collection.totalPages); }; } public function set style(_arg1:Style):void{ _style = _arg1; } protected function prevPage(_arg1:MouseEvent):void{ _collection.prevPage(_arg1); setPageButtons(); autoStepStop(); } protected function checkNavVisibility(_arg1:TimerEvent):void{ if ((((((((_galleryContainer.mc.mouseX > 0)) && ((_galleryContainer.mc.mouseX < _galleryContainer.width)))) && ((_galleryContainer.mc.mouseY > 0)))) && ((_galleryContainer.mc.mouseY < _galleryContainer.height)))){ if (!_navFadedIn){ _navmc.mouseEnabled = true; Gallery.tweenManager.fadeInObject(_navmc, 250); _navFadedIn = true; }; } else { if (_navFadedIn){ _navmc.mouseEnabled = false; Gallery.tweenManager.fadeOutObject(_navmc, 250); _navFadedIn = false; }; }; } protected function build():void{ var _local1:Rectangle; var _local5:int; var _local6:int; if (!_initialized){ return; }; if (_galleryContainer != null){ destroy(); }; _galleryContainer = new Cell(null, _layout.width, _layout.height, true, false, 0, absPosition, _style); _container.addChild(_galleryContainer); var _local2:Number = (_layout.width / _layout.height); var _local3:Number = (_container.width / _container.height); var _local4:Number = 1; if (_local2 >= _local3){ _local4 = (_container.width / _galleryContainer.width); } else { _local4 = (_container.height / _galleryContainer.height); }; _local4 = Math.min(1, _local4); _galleryContainer.x = ((_container.width - (_galleryContainer.width * _local4)) / 2); _galleryContainer.y = ((_container.height - (_galleryContainer.height * _local4)) / 2); _galleryContainer.mc.scaleX = (_galleryContainer.mc.scaleY = _local4); if (_layout.thumbs){ _local1 = _layout.thumbsArea; _thumbsContainer = new Cell(null, _local1.width, _local1.height, false, false, 0, absPosition.clone({top:_local1.y, left:_local1.x})); _galleryContainer.addChild(_thumbsContainer); _thumbsContainer.x = _local1.x; _thumbsContainer.y = _local1.y; _thumbsContainer.name = "THUMBSY"; if (_layout.thumbSize == 1){ _local5 = _local1.width; _local6 = _local1.height; } else { _local6 = _layout.thumbSizeInterpreted; _local5 = _local6; }; _collection = new Collection(null, _local1.width, _local1.height, _local5, _local6, _layout.thumbSpacing, absPosition.clone({top:0, left:0}), _style); _collection.allowDrag = false; _collection.allowMultiSelect = false; _collection.allowRearrange = false; _collection.autoResize = _layout.thumbsAutoResize; _collection.usePagingDisplay = _layout.thumbsUsePaging; _collection.useBorderWidthInBlanks = _layout.thumbsUseBorderWidthInBlanks; _collection.background = false; _collection.resizeScale = _layout.thumbsScale; _collection.useSnap = _layout.thumbsSnap; _collection.showHighlight = false; _collection.itemScale = (_layout.thumbSize / 80); _collection.useCircularBlanks = _layout.thumbsUseCircularBlanks; _collection.background = _layout.thumbsBackground; _thumbsContainer.addChild(_collection); _collection.maskContent = true; _collection.addEventListener(Collection.EVENT_ADD_MEMBER, onMediaAdded); _collection.addEventListener(Collection.EVENT_SELECT, onThumbSelect); }; if (_layout.media){ _local1 = _layout.mediaArea; _mediaContainer = new Cell(null, _local1.width, _local1.height, false, false, 0, absPosition.clone({top:_local1.y, left:_local1.x})); _galleryContainer.addChild(_mediaContainer); _mediaContainer.x = _local1.x; _mediaContainer.y = _local1.y; _mediaContainer.name = "MEDIABOY"; _mediaView = new GalleryMedia(this, _mediaContainer, _style, _layout); if (_layout.mediaHasNavButtons){ prevButton = _mediaView.prevButton; nextButton = _mediaView.nextButton; prevButton.addEventListener(MouseEvent.CLICK, prevAsset); nextButton.addEventListener(MouseEvent.CLICK, nextAsset); }; captionField = _mediaView.captionField; if (((!((_collection == null))) && ((_collection.members.length > 0)))){ setInitialMedia(); }; }; if (((((_layout.thumbs) && (_layout.media))) && (_layout.thumbsOnTop))){ _mediaContainer.mc.parent.swapChildren(_mediaContainer.mc, _thumbsContainer.mc); }; initNav(); setColors(); } public function get visible():Boolean{ return (_visible); } protected function setColors():void{ var _local2:Number; if (_galleryContainer == null){ return; }; var _local1:Number = ColorTools.getValue(_style.backgroundColor); _galleryContainer.background = true; if (_local1 > 50){ _local2 = ColorTools.setColorValue(_style.backgroundColor, Math.max(0, (_local1 - 50))); } else { _local2 = ColorTools.setColorValue(_style.backgroundColor, Math.max(100, (_local1 + 50))); }; textColor = ((_style.textColor)==-1) ? _local2 : _style.textColor; linkColor = ((_style.linkColor)==-1) ? ColorTools.getInverseColor(_style.backgroundColor) : _style.linkColor; buttonColor = _local2; if (prevButton != null){ ColorTools.applyColor(prevButton, buttonColor); }; if (nextButton != null){ ColorTools.applyColor(nextButton, buttonColor); }; if (prevPageButton != null){ ColorTools.applyColor(prevPageButton, buttonColor); }; if (nextPageButton != null){ ColorTools.applyColor(nextPageButton, buttonColor); }; if (captionField != null){ setStyleSheet(captionField); }; if (_navmc != null){ if (_navmc["prevShade"] != null){ ColorTools.applyColor(_navmc["prevShade"], _style.backgroundColor); }; if (_navmc["nextShade"] != null){ ColorTools.applyColor(_navmc["nextShade"], _style.backgroundColor); }; }; } public function set visible(_arg1:Boolean):void{ _visible = _arg1; } public static function initializeLibrary():void{ if (library == null){ library = new Library(LibrarySWF, true); library.addEventListener(Event.INIT, onLibraryInitialized); } else { _initialized = true; }; } protected static function onLibraryInitialized(_arg1:Event):void{ _initialized = true; } } }//package com.picklish.player
Section 3
//Gallery_LibrarySWF (com.picklish.player.Gallery_LibrarySWF) package com.picklish.player { import mx.core.*; public class Gallery_LibrarySWF extends ByteArrayAsset { } }//package com.picklish.player
Section 4
//GalleryAsset (com.picklish.player.GalleryAsset) package com.picklish.player { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import com.slideroll.ui.*; import com.picklish.app.model.*; import flash.geom.*; import flash.filters.*; public class GalleryAsset extends LibraryObject { protected var _style:Style; protected var _view:Gallery; protected var _frameFilters:Array; protected var _height:int; protected var _width:int; protected var _layout:GalleryLayout; public var photo:Sprite; protected var _scale:Number;// = 1 protected var _bitmap:Bitmap; protected var _photoScale:Number;// = 1 protected var _regpt:Point; protected var _parentCell:Cell; public var btn:SimpleButton; public var frame:Sprite; protected var _asset:ProjectAsset; protected var _item:CollectionItem; public var progress:MovieClip; protected var _bitmapMask:Sprite; public static var debugmode:Boolean = true; public function GalleryAsset(_arg1:Gallery, _arg2:Cell, _arg3:Style, _arg4:GalleryLayout, _arg5:String, _arg6:ProjectAsset=null, _arg7:int=0, _arg8:int=0){ _view = _arg1; _parentCell = _arg2; _style = _arg3; _layout = _arg4; _asset = _arg6; _regpt = new Point(_arg7, _arg8); if ((_parentCell is CollectionItem)){ _item = (_parentCell as CollectionItem); }; super(null, Gallery.library, _arg5); if ((_parentCell is CollectionItem)){ _item.clip = _mc; }; _mc.x = _regpt.x; _mc.y = _regpt.y; _frameFilters = _mc.filters; } protected function debug(... _args):void{ if (debugmode){ trace(_args.join(", ")); }; } public function activate():void{ } public function select():void{ } protected function onUpdate(_arg1:ObjectEvent):void{ } protected function drawFrame():void{ var _local2:int; _mc.scaleX = (_mc.scaleY = _scale); _mc.x = _regpt.x; _mc.y = _regpt.y; var _local1:Graphics = frame.graphics; _local1.clear(); if (_style.borderWidth > 0){ if (!_layout.mediaSquarify){ if (!_layout.ignoreBorderWidth){ _local1.beginFill(_style.borderColor, 1); _local1.drawRect(((0 - (_width / 2)) - _style.borderWidth), ((0 - (_height / 2)) - _style.borderWidth), (_width + (_style.borderWidth * 2)), (_height + (_style.borderWidth * 2))); if (ColorTools.getValue(_style.borderColor) > ColorTools.getValue(_style.backgroundColor)){ frame.filters = [new DropShadowFilter(3, 45, 0, 1, 5, 5, 0.3, 2)]; } else { frame.filters = []; }; }; } else { _local2 = ((_layout.thumbSizeInterpreted - (_layout.mediaPadding * 2)) - (_style.borderWidth * 2)); _local1.beginFill(_style.borderColor, 1); _local1.drawRect(((0 - (_local2 / 2)) - _style.borderWidth), ((0 - (_local2 / 2)) - _style.borderWidth), (_local2 + (_style.borderWidth * 2)), (_local2 + (_style.borderWidth * 2))); frame.filters = []; }; _local1.endFill(); }; } protected function onPhotoLoadComplete(_arg1:Event=null):void{ } public function set asset(_arg1:ProjectAsset):void{ _asset = _arg1; setAsset(); } protected function onPhotoLoadProgress(_arg1:ProgressEvent=null):void{ if (((!((_arg1 == null))) && (!((_asset == null))))){ _asset.bytesLoaded = _arg1.bytesLoaded; _asset.bytesTotal = _arg1.bytesTotal; }; } public function destroy():void{ _asset = null; if (_item != null){ _item.clip = null; }; if (_mc.parent != null){ _mc.parent.removeChild(_mc); }; } public function get asset():ProjectAsset{ return (_asset); } protected function setAsset():void{ } } }//package com.picklish.player
Section 5
//GalleryLayout (com.picklish.player.GalleryLayout) package com.picklish.player { import flash.geom.*; public dynamic class GalleryLayout { public var thumbsUseBorderWidthInBlanks:Boolean;// = true public var thumbSymbol:String;// = "playerthumb" public var thumbsUsePaging:Boolean;// = false public var mediaNavSymbol:String;// = "playernav" public var mediaNavButtonScale:Number;// = 1 public var mediaNavButtonPadding:int;// = 20 public var mediaHasMask:Boolean;// = true public var height:int;// = 520 public var mediaHeight:Number;// = 1 public var thumbsUseScrolling:Boolean;// = false public var autoplayable:Boolean;// = false public var mediaWidth:Number;// = 1 public var thumbClass:Class; public var autoplay:Boolean;// = false public var thumbs:Boolean;// = true public var mediaIsPersistent:Boolean;// = false public var thumbsWidth:Number;// = 1 public var thumbsNavButtonsOnRollOver:Boolean;// = false public var toggleCaptionsOnRollover:Boolean;// = true public var mediaNavButtonsOnRollOver:Boolean;// = false public var thumbsAutoResize:Boolean;// = true public var mediaAutoPlay:Boolean;// = true public var mediaPadding:int;// = 30 public var thumbSpacing:int;// = 40 public var thumbsOnTop:Boolean;// = false public var mediaHasNavButtons:Boolean;// = true public var mediaFit:uint;// = 1 public var thumbsNavButtonPadding:int;// = 20 public var mediaFillBehind:Boolean;// = false public var thumbsX:int;// = 0 public var thumbsY:int;// = 0 public var thumbsUseProxy:Boolean;// = false public var thumbsUseCircularBlanks:Boolean;// = false public var resizable:Boolean;// = true public var mediaSymbol:String;// = "playermedia" public var mediaSquarify:Boolean;// = false public var thumbsHasNavButtons:Boolean;// = false public var overlayCaptions:Boolean;// = true public var thumbsNavSymbol:String;// = "playernav" public var fullscreenButtonSymbol:String;// = "fullscreen" public var width:int;// = 660 public var thumbsSnap:Boolean;// = false public var ignoreBorderWidth:Boolean;// = false public var thumbsNavButtonScale:Number;// = 1 public var media:Boolean;// = true public var thumbsHeight:Number;// = 1 public var thumbsScale:Number;// = 0.85 public var logoPosition:uint;// = 3 public var mediaY:int;// = 0 public var mediaX:int;// = 0 public var thumbSize:int;// = 80 public static const FIT_EQUAL:uint = 1; public static const FIT_FILL:uint = 2; public static const TOP_LEFT:uint = 4; public static const BOTTOM_LEFT:uint = 4; public static const BOTTOM_RIGHT:uint = 3; public static const TOP_RIGHT:uint = 3; public static const OPTIONS1:Object = {width:660, height:520, resizable:true, ignoreBorderWidth:false, thumbsOnTop:false, logoPosition:BOTTOM_RIGHT, media:true, mediaX:0, mediaY:0, mediaWidth:1, mediaHeight:1, mediaPadding:30, mediaFit:FIT_EQUAL, mediaFillBehind:false, mediaHasMask:true, mediaHasNavButtons:true, mediaIsPersistent:false, mediaAutoPlay:true, mediaSquarify:false, thumbs:true, thumbsX:0, thumbsY:0, thumbsWidth:1, thumbsHeight:1, thumbSize:80, thumbSpacing:40, thumbsSnap:false, thumbsHasNavButtons:false, thumbsAutoResize:true, thumbsUsePaging:false, thumbsUseScrolling:false, thumbsScale:1, thumbsUseProxy:false, thumbsUseBorderWidthInBlanks:true, thumbsNavButtonsOnRollOver:false, overlayCaptions:true, toggleCaptionsOnRollover:true, mediaNavButtonsOnRollOver:false, mediaNavSymbol:"playernav", thumbsNavSymbol:"playernav", mediaNavButtonScale:0.8, mediaNavButtonPadding:-55, thumbsNavButtonScale:1, thumbsNavButtonPadding:10, thumbClass:GalleryThumb, thumbSymbol:"playerthumb", mediaSymbol:"playermedia", thumbsUseCircularBlanks:false, fullscreenButtonSymbol:"fullscreen", autoplay:false, autoplayable:false}; public static const OPTIONS2:Object = {width:520, height:520, resizable:true, ignoreBorderWidth:false, thumbsOnTop:false, logoPosition:BOTTOM_RIGHT, media:true, mediaX:0, mediaY:0, mediaWidth:1, mediaHeight:-70, mediaPadding:20, mediaFit:FIT_FILL, mediaFillBehind:false, mediaHasMask:false, mediaHasNavButtons:false, mediaIsPersistent:true, mediaAutoPlay:false, mediaSquarify:false, thumbs:true, thumbsX:36, thumbsY:-70, thumbsWidth:-72, thumbsHeight:60, thumbSize:40, thumbSpacing:16, thumbsSnap:true, thumbsHasNavButtons:true, thumbsAutoResize:false, thumbsUsePaging:true, thumbsUseScrolling:false, thumbsScale:1, thumbsUseProxy:false, thumbsUseBorderWidthInBlanks:true, thumbsNavButtonsOnRollOver:false, overlayCaptions:true, toggleCaptionsOnRollover:true, mediaNavButtonsOnRollOver:false, mediaNavButtonScale:1, mediaNavButtonPadding:20, thumbsNavButtonScale:0.35, thumbsNavButtonPadding:10, thumbClass:GalleryThumb, thumbSymbol:"playerthumb", mediaSymbol:"playermedia", thumbsUseCircularBlanks:false, fullscreenButtonSymbol:"fullscreen", autoplay:false, autoplayable:false}; public static const OPTIONS3:Object = {width:880, height:480, resizable:false, ignoreBorderWidth:false, thumbsOnTop:false, logoPosition:BOTTOM_RIGHT, media:true, mediaX:400, mediaY:10, mediaWidth:460, mediaHeight:460, mediaPadding:20, mediaFit:FIT_EQUAL, mediaFillBehind:false, mediaHasMask:false, mediaHasNavButtons:false, mediaIsPersistent:true, mediaAutoPlay:false, mediaSquarify:false, thumbs:true, thumbsX:35, thumbsY:20, thumbsWidth:330, thumbsHeight:440, thumbSize:80, thumbSpacing:30, thumbsSnap:true, thumbsHasNavButtons:true, thumbsAutoResize:false, thumbsUsePaging:true, thumbsUseScrolling:false, thumbsScale:1, thumbsUseProxy:false, thumbsUseBorderWidthInBlanks:true, thumbsNavButtonsOnRollOver:false, overlayCaptions:true, toggleCaptionsOnRollover:true, mediaNavButtonsOnRollOver:false, mediaNavSymbol:"playernav", thumbsNavSymbol:"playernav", mediaNavButtonScale:1, mediaNavButtonPadding:20, thumbsNavButtonScale:0.5, thumbsNavButtonPadding:10, thumbClass:GalleryThumb, thumbSymbol:"playerthumb", mediaSymbol:"playermedia", thumbsUseCircularBlanks:false, fullscreenButtonSymbol:"fullscreen", autoplay:false, autoplayable:false}; public static const OPTIONS5:Object = {width:700, height:240, resizable:true, ignoreBorderWidth:true, thumbsOnTop:false, logoPosition:BOTTOM_RIGHT, media:false, mediaX:0, mediaY:0, mediaWidth:0, mediaHeight:0, mediaPadding:0, mediaFit:FIT_EQUAL, mediaFillBehind:false, mediaHasMask:false, mediaHasNavButtons:false, mediaIsPersistent:true, mediaAutoPlay:false, mediaSquarify:true, thumbs:true, thumbsX:35, thumbsY:15, thumbsWidth:-70, thumbsHeight:-30, thumbSize:-40, thumbSpacing:10, thumbsSnap:true, thumbsHasNavButtons:true, thumbsAutoResize:false, thumbsUsePaging:true, thumbsUseScrolling:false, thumbsScale:1, thumbsUseProxy:true, thumbsUseBorderWidthInBlanks:false, thumbsNavButtonsOnRollOver:false, overlayCaptions:true, toggleCaptionsOnRollover:true, mediaNavButtonsOnRollOver:false, mediaNavSymbol:"playernav", thumbsNavSymbol:"playernav", mediaNavButtonScale:1, mediaNavButtonPadding:20, thumbsNavButtonScale:0.5, thumbsNavButtonPadding:10, thumbClass:GalleryMedia, thumbSymbol:"playermedia", mediaSymbol:"playermedia", thumbsUseCircularBlanks:false, fullscreenButtonSymbol:"fullscreen", autoplay:false, autoplayable:false}; public static const OPTIONS6:Object = {width:400, height:324, resizable:true, ignoreBorderWidth:true, thumbsOnTop:true, logoPosition:TOP_RIGHT, media:true, mediaX:0, mediaY:0, mediaWidth:1, mediaHeight:-24, mediaPadding:0, mediaFit:FIT_FILL, mediaFillBehind:true, mediaHasMask:false, mediaHasNavButtons:true, mediaIsPersistent:true, mediaAutoPlay:false, mediaSquarify:true, thumbs:true, thumbsX:20, thumbsY:-21, thumbsWidth:-40, thumbsHeight:18, thumbSize:18, thumbSpacing:0, thumbsSnap:true, thumbsHasNavButtons:true, thumbsAutoResize:false, thumbsUsePaging:true, thumbsUseScrolling:false, thumbsScale:1, thumbsUseProxy:true, thumbsUseBorderWidthInBlanks:false, thumbsNavButtonsOnRollOver:false, overlayCaptions:true, toggleCaptionsOnRollover:true, mediaNavButtonsOnRollOver:true, mediaNavSymbol:"playernav2", thumbsNavSymbol:"playernav3", mediaNavButtonScale:1, mediaNavButtonPadding:0, thumbsNavButtonScale:1, thumbsNavButtonPadding:3, thumbClass:GalleryNumeral, thumbSymbol:"playerthumbnumeral", mediaSymbol:"playermedia", thumbsUseCircularBlanks:true, fullscreenButtonSymbol:"fullscreen2", autoplay:false, autoplayable:true}; public static const OPTIONS7:Object = {width:760, height:300, resizable:true, ignoreBorderWidth:true, thumbsOnTop:false, logoPosition:BOTTOM_RIGHT, media:false, mediaX:0, mediaY:0, mediaWidth:0, mediaHeight:0, mediaPadding:0, mediaFit:FIT_FILL, mediaFillBehind:false, mediaHasMask:false, mediaHasNavButtons:false, mediaIsPersistent:true, mediaAutoPlay:false, mediaSquarify:false, thumbs:true, thumbsX:0, thumbsY:0, thumbsWidth:1, thumbsHeight:1, thumbSize:1, thumbSpacing:0, thumbsSnap:true, thumbsHasNavButtons:true, thumbsAutoResize:false, thumbsUsePaging:true, thumbsUseScrolling:false, thumbsScale:1, thumbsUseProxy:true, thumbsUseBorderWidthInBlanks:false, thumbsNavButtonsOnRollOver:true, overlayCaptions:true, toggleCaptionsOnRollover:true, mediaNavButtonsOnRollOver:false, mediaNavSymbol:"playernav", thumbsNavSymbol:"playernav4", mediaNavButtonScale:1, mediaNavButtonPadding:20, thumbsNavButtonScale:1, thumbsNavButtonPadding:-45, thumbClass:GalleryMedia, thumbSymbol:"playermedia", mediaSymbol:"playermedia", thumbsUseCircularBlanks:false, fullscreenButtonSymbol:"fullscreen2", autoplay:false, autoplayable:true}; public static const OPTIONS4:Object = {width:660, height:520, resizable:true, ignoreBorderWidth:false, thumbsOnTop:false, logoPosition:TOP_RIGHT, media:true, mediaX:0, mediaY:0, mediaWidth:1, mediaHeight:-30, mediaPadding:20, mediaFit:FIT_FILL, mediaFillBehind:false, mediaHasMask:false, mediaHasNavButtons:false, mediaIsPersistent:true, mediaAutoPlay:false, mediaSquarify:false, thumbs:true, thumbsX:30, thumbsY:-34, thumbsWidth:-60, thumbsHeight:24, thumbSize:18, thumbSpacing:6, thumbsSnap:true, thumbsHasNavButtons:true, thumbsAutoResize:false, thumbsUsePaging:true, thumbsUseScrolling:false, thumbsScale:1, thumbsUseProxy:true, thumbsUseBorderWidthInBlanks:false, thumbsNavButtonsOnRollOver:false, overlayCaptions:true, toggleCaptionsOnRollover:true, mediaNavButtonsOnRollOver:false, mediaNavSymbol:"playernav", thumbsNavSymbol:"playernav", mediaNavButtonScale:1, mediaNavButtonPadding:20, thumbsNavButtonScale:0.25, thumbsNavButtonPadding:10, thumbClass:GalleryProxy, thumbSymbol:"playerthumbproxy", mediaSymbol:"playermedia", thumbsUseCircularBlanks:false, fullscreenButtonSymbol:"fullscreen", autoplay:false, autoplayable:false}; public function GalleryLayout(_arg1:Object=null):void{ thumbClass = GalleryThumb; super(); if (_arg1 != null){ applyLayout(_arg1); }; } protected function getArea(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Rectangle{ var _local5:Rectangle = new Rectangle(); _local5.x = ((_arg1)>1) ? _arg1 : ((_arg1)<0) ? (width + _arg1) : Math.round((width * _arg1)); _local5.y = ((_arg2)>1) ? _arg2 : ((_arg2)<0) ? (height + _arg2) : Math.round((height * _arg2)); _local5.width = ((_arg3)>1) ? _arg3 : ((_arg3)<0) ? (width + _arg3) : Math.round((width * _arg3)); _local5.height = ((_arg4)>1) ? _arg4 : ((_arg4)<0) ? (height + _arg4) : Math.round((height * _arg4)); return (_local5); } public function applyLayout(_arg1:Object):void{ var _local2:String; for (_local2 in _arg1) { if (this[_local2] != undefined){ this[_local2] = _arg1[_local2]; }; }; } public function get thumbsArea():Rectangle{ return (getArea(thumbsX, thumbsY, thumbsWidth, thumbsHeight)); } public function get mediaArea():Rectangle{ return (getArea(mediaX, mediaY, ((mediaWidth)!=0) ? mediaWidth : thumbSize, ((mediaHeight)!=0) ? mediaHeight : thumbSize)); } public function get thumbSizeInterpreted():int{ var _local1:Rectangle = thumbsArea; return (((thumbSize)>1) ? thumbSize : ((thumbSize)>0) ? (_local1.height * thumbSize) : (height + thumbSize)); } } }//package com.picklish.player
Section 6
//GalleryMedia (com.picklish.player.GalleryMedia) package com.picklish.player { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import com.slideroll.ui.*; import flash.text.*; import com.picklish.app.model.*; import flash.utils.*; import flash.geom.*; import flash.media.*; import flash.net.*; public class GalleryMedia extends GalleryAsset { public var nextButton:SimpleButton; public var media:Container; protected var _videoPlayButton:SimpleButton; protected var _audioChannel:SoundChannel; public var videocontrols:MovieClip; protected var _useNav:Boolean; public var loading:Sprite; protected var _navTimer:Timer; public var captionContainer:Sprite; protected var _netc:NetConnection; protected var _autoStepPaused:Boolean;// = false public var prevButton:SimpleButton; protected var _nets:NetStream; public var loadingbar:Sprite; protected var _nav:Container; protected var _video:Video; protected var _captionFormat:TextFormat; protected var _showing:Boolean;// = false public var audiobutton:SimpleButton; protected var _audioIsPlaying:Boolean;// = false protected var _autoPlayTimer:Timer; public var videoObject:Video; public var backing:Sprite; protected var _navFadedIn:Boolean;// = false protected var _videoPauseButton:SimpleButton; public var autostep_pause:SimpleButton; public var captionField:TextField; public var loadingtf:TextField; protected var _videoLoadingIcon:Sprite; protected var _mask:Cell; protected var _photoSize:int;// = 400 protected var _audio:Sound; protected var _useMask:Boolean; protected var _captionTimer:Timer; protected var _autoPlay:Boolean;// = true protected var _client:Object; protected var _autoStepTimer:Timer; protected var _autoStepping:Boolean;// = false public var captionMask:Sprite; protected var _navmc:Sprite; public var autostep:Sprite; public var autostep_play:SimpleButton; public static var selectedInstance:GalleryMedia; public static var mainInstance:GalleryMedia; public function GalleryMedia(_arg1:Gallery, _arg2:Cell, _arg3:Style, _arg4:GalleryLayout, _arg5:ProjectAsset=null){ super(_arg1, _arg2, _arg3, _arg4, _arg4.mediaSymbol, _arg5, (_arg2.width / 2), (_arg2.height / 2)); } override public function destroy():void{ super.destroy(); if (_navTimer != null){ _navTimer.stop(); _navTimer = null; }; autoStepStop(); if (media != null){ media.destroy(); }; if (((_useMask) && (!((_mask == null))))){ _mask.destroy(); }; } protected function metaDataHandler(_arg1:Object):void{ if (((!((_arg1.width == undefined))) && (!((_arg1.height == undefined))))){ debug("Metadata received", _arg1.width, _arg1.height); }; } protected function stopAudio(_arg1:Event=null):void{ var e = _arg1; if (_asset.audioURL.indexOf(".mp3") != -1){ if (_audioChannel != null){ _audioChannel.stop(); _audioChannel.removeEventListener(Event.SOUND_COMPLETE, onAudioComplete); }; if (_audio != null){ try { _audio.close(); } catch(e:Error) { }; }; } else { _nets = null; if (_netc != null){ _netc.close(); }; }; _audioIsPlaying = false; } public function set autoPlay(_arg1:Boolean):void{ _autoPlay = _arg1; } public function autoStepStart(_arg1:MouseEvent=null):void{ if (((((!((autostep == null))) && (!((_autoStepTimer == null))))) && (!(_autoStepping)))){ trace("AUTO STEP START"); autostep_play.visible = false; autostep_pause.visible = true; _autoStepTimer.reset(); _autoStepTimer.start(); onAutoStep(); _autoStepping = true; _autoStepPaused = false; }; } protected function playAudio(_arg1:Event=null):void{ var req:URLRequest; var e = _arg1; stopAudio(); autoStepStop(); _view.autoStepStop(); if (_asset == null){ return; }; if (_asset.audioURL.indexOf(".mp3") != -1){ _audio = new Sound(); debug(("Loading " + _asset.audioURL)); req = new URLRequest((_view.baseURL + _asset.audioURL)); _audio.addEventListener(IOErrorEvent.IO_ERROR, onAudioError); _audio.load(req); _audioChannel = _audio.play(); _audioChannel.addEventListener(Event.SOUND_COMPLETE, onAudioComplete); } else { _netc = new NetConnection(); _netc.connect(null); if (_nets != null){ _nets.close(); }; _nets = new NetStream(_netc); _nets.bufferTime = 8; _client = new Object(); _client.onMetaData = metaDataHandler; _nets.client = _client; _nets.addEventListener(NetStatusEvent.NET_STATUS, onAudioStatus); _nets.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onAudioSecurityError); try { _nets.play((_view.baseURL + _asset.audioURL)); } catch(e:Error) { if ((e is SecurityError)){ onAudioSecurityError(); }; }; }; _audioIsPlaying = true; } override public function select():void{ super.select(); activate(); } protected function addPhoto():void{ var _local1:BitmapData; if (_asset != null){ _local1 = _asset.photoData; if (_asset.photoData != null){ if (loading != null){ loading.visible = false; }; _bitmap.bitmapData = _local1; _bitmap.smoothing = true; _bitmapMask.graphics.clear(); _bitmapMask.graphics.beginFill(0xFF0000, 1); if (((!((_asset.rotation == 90))) && (!((_asset.rotation == 270))))){ _bitmapMask.graphics.drawRect(0, 0, _width, _height); } else { _bitmapMask.graphics.drawRect(0, 0, _height, _width); }; photo.visible = true; }; }; } protected function setCaptionTextSize():void{ var _local1:Number = 1; var _local2:DisplayObject = _mc; while (_local2 != null) { _local1 = (_local1 * _local2.scaleX); _local2 = _local2.parent; }; _captionFormat.size = (12 / _local1); } public function get useMask():Boolean{ return (_useMask); } public function get autoStepping():Boolean{ return (_autoStepping); } override public function activate():void{ super.activate(); setCaptionTimer(); checkAutoPlay(); } override protected function init(_arg1:Sprite, _arg2:Library, _arg3:String):void{ super.init(null, _arg2, _arg3); var _local4:int = _parentCell.width; if (_layout.mediaHasNavButtons){ _local4 = (_local4 - 80); }; _photoSize = (Math.min(_local4, _parentCell.height) - (_layout.mediaPadding * 2)); var _local5:int = (_layout.ignoreBorderWidth) ? 0 : _style.borderWidth; _photoSize = (_photoSize - (_local5 * 2)); _useMask = _layout.mediaHasMask; _useNav = _layout.mediaHasNavButtons; initMask(); media = new Container(null, _mc); _parentCell.addChild(media); initNav(_arg2); if (!(_parentCell is CollectionItem)){ mainInstance = this; }; btn.useHandCursor = false; if (_item == null){ btn.addEventListener(MouseEvent.CLICK, hide); } else { btn.addEventListener(MouseEvent.CLICK, onClick); }; btn.addEventListener(MouseEvent.ROLL_OVER, onRollOver); btn.addEventListener(MouseEvent.ROLL_OUT, onRollOut); _videoPlayButton = videocontrols.playbutton; _videoPauseButton = videocontrols.pausebutton; _videoLoadingIcon = videocontrols.loadingicon; _videoPlayButton.addEventListener(MouseEvent.CLICK, playVideo); _videoPauseButton.addEventListener(MouseEvent.CLICK, pauseVideo); _video = videoObject; videocontrols.visible = false; if (audiobutton != null){ audiobutton.addEventListener(MouseEvent.CLICK, playAudio); }; setupUIElements(); if (!_layout.mediaIsPersistent){ _mc.visible = false; }; _autoPlayTimer = new Timer(250, 1); _autoPlayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onAutoPlay); _captionTimer = new Timer(3000, 1); _captionTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onCaptionTimeOut); _view.addEventListener(Gallery.ASSET_UPDATE, onUpdate); _mc.alpha = 0; if (_asset != null){ setAsset(); }; } protected function setPhotoSize(_arg1:int=-1, _arg2:int=-1):void{ var _local6:Rectangle; var _local7:int; var _local8:int; var _local9:int; if (_asset == null){ return; }; var _local3:Number = Math.min((photoSize / _asset.photoWidth), (photoSize / _asset.photoHeight)); if (_layout.mediaFit == GalleryLayout.FIT_FILL){ _local6 = _layout.mediaArea; _local7 = (_layout.ignoreBorderWidth) ? 0 : _style.borderWidth; _local8 = ((_local6.width - (_layout.mediaPadding * 2)) - (_local7 * 2)); _local9 = ((_local6.height - (_layout.mediaPadding * 2)) - (_local7 * 2)); if ((((_asset.rotation == 0)) || ((_asset.rotation == 180)))){ _local3 = Math.min((_local8 / _asset.photoWidth), (_local9 / _asset.photoHeight)); } else { _local3 = Math.min((_local8 / _asset.photoHeight), (_local9 / _asset.photoWidth)); }; }; _photoScale = ((_asset.type)==ProjectAsset.TYPE_PHOTO) ? Math.min(2, _local3) : Math.min(1.25, _local3); var _local4:int = ((_arg1)>0) ? _arg1 : _asset.photoWidth; var _local5:int = ((_arg2)>0) ? _arg2 : _asset.photoHeight; _width = (_local4 * _photoScale); _height = (_local5 * _photoScale); } public function get useNav():Boolean{ return (_useNav); } protected function onAudioError(_arg1:Event):void{ } protected function onAutoStep(_arg1:TimerEvent=null):void{ _view.nextAsset(null, true); } protected function initMask():void{ if (_useMask){ _mask = new Cell(null, _parentCell.width, _parentCell.height, true, false, 0, new Position(null, -1, Position.PLACEMENT_ABSOLUTE, -1, null, 0, 0), _style); _parentCell.addChild(_mask); _mask.bkgd.alpha = 0.85; if (!_layout.mediaIsPersistent){ _mask.hide(); }; }; if (_layout.mediaFillBehind){ _mc.graphics.beginFill(0, 1); _mc.graphics.drawRect((0 - (_parentCell.width / 2)), (0 - (_parentCell.height / 2)), _parentCell.width, _parentCell.height); }; } protected function setCaption():void{ var _local1:int; var _local2:int; var _local3:Graphics; if (captionField == null){ _captionFormat = new TextFormat(); _captionFormat.align = TextFormatAlign.CENTER; _captionFormat.font = "Verdana, _sans"; setCaptionTextSize(); captionContainer = new Sprite(); _mc.addChild(captionContainer); captionMask = new Sprite(); _mc.addChild(captionMask); captionContainer.mask = captionMask; captionField = new TextField(); captionContainer.addChild(captionField); captionField.selectable = false; captionField.wordWrap = true; captionField.autoSize = TextFieldAutoSize.CENTER; captionField.htmlText = ""; captionField.defaultTextFormat = _captionFormat; captionField.width = photoSize; } else { captionField.autoSize = TextFieldAutoSize.CENTER; if (((!(_layout.overlayCaptions)) || ((captionField.htmlText.length == 0)))){ captionContainer.graphics.clear(); captionField.width = photoSize; captionField.x = (captionField.y = 0); captionContainer.x = (0 - (captionField.width / 2)); captionContainer.y = ((frame.height / 2) + 10); } else { if ((((_asset.audioURL.length > 0)) || ((_asset.videoURL.length > 0)))){ captionField.width = (backing.width - 52); } else { captionField.width = (backing.width - 12); }; _local1 = ColorTools.getValue(_view.textColor); _local2 = ((_local1)>50) ? 0 : 0xFFFFFF; _local3 = captionContainer.graphics; _local3.clear(); _local3.beginFill(_local2, 0.9); _local3.drawRect(0, 0, backing.width, (captionField.height + 12)); _local3 = captionMask.graphics; _local3.clear(); _local3.beginFill(0xFF0000, 1); _local3.drawRect(0, 0, backing.width, (captionField.height + 12)); captionField.x = 6; captionField.y = 5; captionContainer.x = (captionMask.x = backing.x); captionContainer.y = (captionMask.y = ((backing.y + backing.height) - captionContainer.height)); }; }; if (_asset != null){ _view.setStyleSheet(captionField); if (_asset.caption == "#"){ captionField.htmlText = (("<p>" + (_view.collection.getItem(_asset).idx + 1)) + "</p>"); } else { if (_asset.caption.length > 0){ captionField.htmlText = (("<p>" + _asset.caption) + "</p>"); } else { captionField.htmlText = ""; }; }; }; captionField.autoSize = TextFieldAutoSize.NONE; captionField.height = (captionField.height + 10); if (_item != null){ captionContainer.y = (captionMask.y + captionMask.height); }; } protected function pauseVideo(_arg1:Event=null):void{ if (_nets != null){ _nets.pause(); }; _videoPlayButton.visible = true; _videoPauseButton.visible = false; } protected function showCaption():void{ if (((((_layout.overlayCaptions) && (_layout.toggleCaptionsOnRollover))) && ((captionField.text.length > 0)))){ Gallery.tweenManager.createTween(captionContainer, "y", captionContainer.y, captionMask.y, 0.3, false, false, 0, 0, Tween.EASE_OUT, Tween.STYLE_CIRC); }; } protected function onAudioStatus(_arg1:NetStatusEvent):void{ if (_arg1.info.code == "NetStream.Play.Stop"){ onAudioComplete(_arg1); _nets.removeEventListener(NetStatusEvent.NET_STATUS, onAudioStatus); _nets.close(); _nets = null; } else { if (_arg1.info.code == "NetStream.Play.StreamNotFound"){ if (((!((loading == null))) && (!((loadingtf == null))))){ loading.visible = true; loadingtf.text = "Audio Stream not found!"; }; _nets.removeEventListener(NetStatusEvent.NET_STATUS, onAudioStatus); _nets.close(); _nets = null; onAudioComplete(_arg1); }; }; } protected function onCaptionTimeOut(_arg1:TimerEvent):void{ hideCaption(); } protected function stopMediaPlayback():void{ closeVideo(); if (_audioIsPlaying){ stopAudio(); }; _autoPlayTimer.reset(); } public function hide(_arg1:MouseEvent=null):void{ stopMediaPlayback(); if (!_layout.mediaIsPersistent){ _showing = false; Gallery.tweenManager.fadeOutObject(_mc, 250); if (_useMask){ Gallery.tweenManager.fadeOutObject(_mask.mc, 250); }; _mc.mouseEnabled = (_mc.mouseChildren = false); }; } protected function hideCaption(_arg1:TimerEvent=null):void{ if (((((_layout.overlayCaptions) && (_layout.toggleCaptionsOnRollover))) && ((captionField.text.length > 0)))){ Gallery.tweenManager.createTween(captionContainer, "y", captionContainer.y, (captionMask.y + captionMask.height), 0.3, false, false, 0, 0, Tween.EASE_OUT, Tween.STYLE_CIRC); }; } protected function onVideoSecurityError(_arg1:SecurityErrorEvent=null):void{ if (((!((loading == null))) && (!((loadingtf == null))))){ loading.visible = true; loadingtf.text = "Video Streams cannot be played locally."; }; } public function get photoSize():int{ return (_photoSize); } protected function closeVideo():void{ pauseVideo(); _nets = null; if (_netc != null){ _netc.close(); }; } override protected function onPhotoLoadProgress(_arg1:ProgressEvent=null):void{ if (_asset == null){ return; }; super.onPhotoLoadProgress(_arg1); if (((!((loading == null))) && ((_asset.bytesLoaded < _asset.bytesTotal)))){ loading.visible = true; }; if (loadingtf != null){ loadingtf.text = (("Loaded " + Math.floor(((_asset.bytesLoaded / _asset.bytesTotal) * 100))) + "%"); }; if (loadingbar != null){ loadingbar.scaleX = (((_asset.bytesLoaded / _asset.bytesTotal) * (backing.width - 20)) / 100); }; } protected function checkNavVisibility(_arg1:TimerEvent):void{ if ((((Math.abs(_mc.mouseX) < (_parentCell.width / 2))) && ((Math.abs(_mc.mouseY) < (_parentCell.height / 2))))){ if (!_navFadedIn){ _navmc.mouseEnabled = true; Gallery.tweenManager.fadeInObject(_navmc, 250); _navFadedIn = true; }; } else { if (_navFadedIn){ _navmc.mouseEnabled = false; Gallery.tweenManager.fadeOutObject(_navmc, 250); _navFadedIn = false; }; }; } override protected function onPhotoLoadComplete(_arg1:Event=null):void{ if (loading != null){ loading.visible = false; }; setAsset(); } protected function setCaptionTimer():void{ var _local1:int; if (_item == null){ _local1 = (2500 + (captionField.text.length * 50)); _captionTimer.delay = _local1; _captionTimer.reset(); _captionTimer.start(); } else { captionContainer.y = (captionMask.y + captionMask.height); }; } public function get autoPlay():Boolean{ return (_autoPlay); } protected function checkMouse(_arg1:Event):void{ if ((((Math.abs(_mc.mouseX) > (backing.width / 2))) || ((Math.abs(_mc.mouseY) > (backing.height / 2))))){ _mc.stage.removeEventListener(Event.ENTER_FRAME, checkMouse); hideCaption(); }; } protected function showVideo(_arg1:Event):void{ _video.visible = true; _mc.stage.removeEventListener(Event.ENTER_FRAME, showVideo); } override protected function drawFrame():void{ super.drawFrame(); if (_navmc != null){ if (_navmc["prevShade"] != null){ ColorTools.applyColor(_navmc["prevShade"], _style.backgroundColor); }; if (_navmc["nextShade"] != null){ ColorTools.applyColor(_navmc["nextShade"], _style.backgroundColor); }; }; } override protected function onUpdate(_arg1:ObjectEvent):void{ super.onUpdate(_arg1); if (((!((_asset == null))) && ((_arg1.object == _asset)))){ if (_asset.photoData != null){ onPhotoLoadComplete(); if (((_useNav) && (_layout.autoplay))){ autoStepStart(); }; } else { onPhotoLoadProgress(); }; } else { if (_arg1.object == null){ if (_useMask){ _mask.background = true; }; setupUIElements(); }; }; } protected function onAudioComplete(_arg1:Event):void{ _audioIsPlaying = false; } protected function onAutoPlay(_arg1:TimerEvent):void{ _autoPlayTimer.reset(); if (((!((_asset == null))) && ((_asset.audioURL.length > 0)))){ playAudio(); } else { if (((!((_asset == null))) && ((_asset.videoURL.length > 0)))){ playVideo(); }; }; } public function set photoSize(_arg1:int):void{ _photoSize = _arg1; setupUIElements(); } protected function playVideo(_arg1:MouseEvent=null):void{ var e = _arg1; if (_asset == null){ return; }; autoStepStop(); _view.autoStepStop(); if (((!((_nets == null))) && ((_nets.time > 0)))){ _nets.resume(); } else { if (((!((selectedInstance == null))) && (!((selectedInstance == this))))){ selectedInstance.stopMediaPlayback(); }; selectedInstance = this; _netc = new NetConnection(); _netc.connect(null); if (_nets != null){ _nets.close(); }; _nets = new NetStream(_netc); _nets.bufferTime = 8; _client = new Object(); _client.onMetaData = metaDataHandler; _nets.client = _client; _video.attachNetStream(_nets); _nets.addEventListener(NetStatusEvent.NET_STATUS, onVideoStatus); _nets.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onVideoSecurityError); try { _nets.play((_view.baseURL + _asset.videoURL)); } catch(e:Error) { if ((e is SecurityError)){ onVideoSecurityError(); }; }; }; _videoPlayButton.visible = false; _videoPauseButton.visible = false; _videoLoadingIcon.visible = true; } protected function checkAutoPlay():void{ if (((((((_autoPlay) && (_layout.mediaAutoPlay))) && (!((_asset == null))))) && (!((_asset.photoData == null))))){ _autoPlayTimer.reset(); _autoPlayTimer.start(); }; } protected function onAudioSecurityError(_arg1:SecurityErrorEvent=null):void{ if (((!((loading == null))) && (!((loadingtf == null))))){ loading.visible = true; loadingtf.text = "FLV Audio Streams cannot be played locally."; }; } protected function onRollOut(_arg1:MouseEvent):void{ } public function get showing():Boolean{ return (_showing); } override protected function setAsset():void{ if (_layout.mediaIsPersistent){ _mc.alpha = 1; }; _video.visible = false; videocontrols.visible = ((((!((_asset == null))) && (!((_asset.photoData == null))))) && ((_asset.videoURL.length > 0))); photo.visible = ((!((_asset == null))) && (!((_asset.photoData == null)))); _videoPlayButton.visible = true; _videoPauseButton.visible = false; _videoLoadingIcon.visible = false; if (_asset != null){ setupUIElements(); }; if (_asset == null){ hide(); return; }; if (_asset.photoData != null){ addPhoto(); setCaption(); setCaptionTimer(); Gallery.tweenManager.removeTweensOnObject(captionContainer); stopMediaPlayback(); checkAutoPlay(); } else { if (_bitmapMask != null){ _bitmapMask.graphics.clear(); }; }; } public function autoStepStop(_arg1:MouseEvent=null):void{ if (((((!((autostep == null))) && (!((_autoStepTimer == null))))) && (_autoStepping))){ autostep_play.visible = true; autostep_pause.visible = false; _autoStepTimer.stop(); _autoStepping = false; _autoStepPaused = true; }; } protected function setNavButtons():void{ if (_useNav){ _navmc.x = (_parentCell.width / 2); _navmc.y = (_parentCell.height / 2); prevButton.x = ((0 - (_parentCell.width / 2)) - _layout.mediaNavButtonPadding); nextButton.x = (0 - prevButton.x); if (_navmc != null){ _navmc.mouseEnabled = false; _navmc.mouseChildren = true; if (_navmc["prevShade"] != null){ _navmc["prevShade"].x = (0 - (_parentCell.width / 2)); _navmc["prevShade"].height = _parentCell.height; _navmc["prevShade"].y = 0; _navmc["prevShade"].mouseEnabled = false; _navmc["prevShade"].mouseChildren = false; }; if (_navmc["nextShade"] != null){ _navmc["nextShade"].x = (_parentCell.width / 2); _navmc["nextShade"].height = _parentCell.height; _navmc["nextShade"].y = 0; _navmc["nextShade"].mouseEnabled = false; _navmc["nextShade"].mouseChildren = false; }; if (_navmc["autostep"] != null){ autostep.x = (0 - (_parentCell.width / 2)); autostep.y = (0 - (_parentCell.height / 2)); }; }; }; } protected function setupUIElements():void{ var _local2:int; if (asset == null){ return; }; if (_bitmap == null){ _bitmap = new Bitmap(null, PixelSnapping.NEVER, true); photo.addChild(_bitmap); _bitmapMask = new Sprite(); photo.addChild(_bitmapMask); _bitmap.mask = _bitmapMask; }; setPhotoSize(); photo.rotation = _asset.rotation; _bitmap.x = (0 - (_width / 2)); _bitmap.y = (0 - (_height / 2)); _bitmap.scaleX = (_bitmap.scaleY = _photoScale); _bitmapMask.x = _bitmap.x; _bitmapMask.y = _bitmap.y; _video.x = (0 - (_width / 2)); _video.y = (0 - (_height / 2)); _video.width = _width; _video.height = _height; if ((((_asset.rotation == 90)) || ((_asset.rotation == 270)))){ _local2 = _width; _width = _height; _height = _local2; }; if (audiobutton != null){ audiobutton.visible = (((_asset.audioURL.length > 0)) && (!(_layout.mediaAutoPlay))); }; btn.x = (backing.x = (0 - (_width / 2))); btn.y = (backing.y = (0 - (_height / 2))); (backing.x - 10); (backing.y - 10); btn.width = (backing.width = _width); btn.height = (backing.height = _height); videocontrols.x = ((backing.x + backing.width) - 17); videocontrols.y = ((backing.y + backing.height) - 15); audiobutton.x = ((backing.x + backing.width) - 15); audiobutton.y = ((backing.y + backing.height) - 15); drawFrame(); setCaption(); setNavButtons(); if (loading == null){ loading = new Sprite(); _mc.addChild(loading); loadingtf = new TextField(); loading.addChild(loadingtf); loadingtf.defaultTextFormat = new TextFormat("Verdana", 11, 0x999999, false, null, null, null, null, TextFormatAlign.CENTER); loadingbar = new Sprite(); loading.addChild(loadingbar); }; loading.x = backing.x; loading.y = backing.y; var _local1:Graphics = loading.graphics; _local1.clear(); _local1.beginFill(0, 1); _local1.drawRect(0, 0, backing.width, backing.height); loadingtf.x = 10; loadingtf.y = ((backing.height / 2) - 10); loadingtf.width = (backing.width - 20); loadingtf.height = 20; loadingtf.autoSize = TextFieldAutoSize.CENTER; loadingtf.wordWrap = true; loadingtf.text = "Loading"; loadingbar.x = (backing.width / 2); loadingbar.y = ((backing.height / 2) + 15); _local1 = loadingbar.graphics; _local1.clear(); _local1.beginFill(0xFFFFFF, 0.5); _local1.drawRect(-50, -1, 100, 2); loadingbar.scaleX = 1; onPhotoLoadProgress(); loading.visible = (_asset.photoData == null); photo.visible = !(loading.visible); if (_useMask){ _mask.background = true; }; _mc.setChildIndex(audiobutton, (_mc.numChildren - 1)); _mc.setChildIndex(videocontrols, (_mc.numChildren - 1)); } protected function onClick(_arg1:MouseEvent):void{ if (((!((selectedInstance == null))) && (!((selectedInstance == this))))){ selectedInstance.stopMediaPlayback(); }; selectedInstance = this; if (((!((_asset == null))) && ((_asset.audioURL.length > 0)))){ playAudio(); } else { if (((!((_asset == null))) && ((_asset.videoURL.length > 0)))){ playVideo(); }; }; } protected function onVideoStatus(_arg1:NetStatusEvent):void{ if (_arg1.info.code == "NetStream.Play.Stop"){ _videoPlayButton.visible = true; _videoPauseButton.visible = false; _videoLoadingIcon.visible = false; _nets.removeEventListener(NetStatusEvent.NET_STATUS, onVideoStatus); _nets.close(); _nets = null; } else { if (_arg1.info.code == "NetStream.Play.Start"){ if (_mc.stage != null){ _mc.stage.addEventListener(Event.ENTER_FRAME, showVideo); }; } else { if (_arg1.info.code == "NetStream.Play.StreamNotFound"){ if (((!((loading == null))) && (!((loadingtf == null))))){ loading.visible = true; loadingtf.text = "Video Stream not found!"; }; _nets.removeEventListener(NetStatusEvent.NET_STATUS, onVideoStatus); _nets.close(); _nets = null; _videoPlayButton.visible = false; _videoPauseButton.visible = false; _videoLoadingIcon.visible = false; } else { if (_arg1.info.code == "NetStream.Buffer.Empty"){ _nets.bufferTime = (_nets.bufferTime + 2); _videoPlayButton.visible = false; _videoPauseButton.visible = false; _videoLoadingIcon.visible = true; } else { if (_arg1.info.code == "NetStream.Buffer.Full"){ _video.visible = true; _videoPlayButton.visible = false; _videoPauseButton.visible = true; _videoLoadingIcon.visible = false; } else { if (_arg1.info.code == "NetStream.Play.Stop"){ _videoPlayButton.visible = true; _videoPauseButton.visible = false; _videoLoadingIcon.visible = false; _nets.close(); _nets = null; }; }; }; }; }; }; } protected function initNav(_arg1:Library):void{ var _local2:Cell; if (_useNav){ _local2 = (_useMask) ? _mask : _parentCell; _navmc = (_arg1.getDisplayObject(_layout.mediaNavSymbol) as Sprite); assign(_navmc); _nav = new Container(null, _navmc, "", new Position(null, -1, Position.PLACEMENT_ABSOLUTE, -1, null, 0, 0)); _local2.addChild(_nav); _nav.mc.mouseEnabled = false; _nav.mc.mouseChildren = true; setNavButtons(); if (_layout.mediaNavButtonsOnRollOver){ _navmc.mouseEnabled = false; _navmc.alpha = 0; _navTimer = new Timer(100, 0); _navTimer.addEventListener(TimerEvent.TIMER, checkNavVisibility); _navTimer.start(); }; if (_navmc != null){ if (_navmc["autostep"] != null){ autostep = _navmc["autostep"]; autostep_play = autostep["btn_play"]; autostep_pause = autostep["btn_pause"]; autostep_pause.visible = false; autostep_play.addEventListener(MouseEvent.CLICK, autoStepStart); autostep_pause.addEventListener(MouseEvent.CLICK, autoStepStop); _autoStepTimer = new Timer(3000, 0); _autoStepTimer.addEventListener(TimerEvent.TIMER, onAutoStep); autoStepStop(); }; }; }; } protected function onRollOver(_arg1:MouseEvent):void{ if (!_captionTimer.running){ showCaption(); _mc.stage.removeEventListener(Event.ENTER_FRAME, checkMouse); _mc.stage.addEventListener(Event.ENTER_FRAME, checkMouse); }; } public function show(_arg1:Boolean=true):void{ if (_asset == null){ return; }; if (!_layout.mediaIsPersistent){ _mc.visible = true; _mc.alpha = 1; _showing = true; Gallery.tweenManager.removeTweensOnObject(_mc); if (_useMask){ Gallery.tweenManager.removeTweensOnObject(_mask); }; _mc.mouseEnabled = (_mc.mouseChildren = true); Gallery.tweenManager.fadeInObject(_mc, 250); if (_useMask){ Gallery.tweenManager.fadeInObject(_mask.mc, 250); }; }; if (_arg1){ checkAutoPlay(); }; } } }//package com.picklish.player
Section 7
//GalleryNumeral (com.picklish.player.GalleryNumeral) package com.picklish.player { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import com.slideroll.ui.*; import flash.text.*; import com.picklish.app.model.*; public class GalleryNumeral extends GalleryThumb { protected var _out_of_range:String;// = "º" public var indexField:TextField; protected var _tens_digits:Array; protected var _numerals_1_to_19:Array; protected var _ones_digits:Array; public static var selectedNumeral:GalleryNumeral; public function GalleryNumeral(_arg1:Gallery, _arg2:Cell, _arg3:Style, _arg4:GalleryLayout, _arg5:ProjectAsset=null){ _numerals_1_to_19 = ["", "q", "w", "e", "r", "t", "y", "u", "i", "o", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";"]; _tens_digits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]; _ones_digits = [")", "!", "@", "#", "$", "%", "^", "&", "*", "("]; super(_arg1, _arg2, _arg3, _arg4, _arg5); _scale = 1; _mc.scaleX = (_mc.scaleY = _scale); _mc.x = _regpt.x; _mc.y = _regpt.y; indexField.alpha = 0.85; } override protected function onRollOut(_arg1:MouseEvent):void{ Tagtip.hideTag(); } override public function activate():void{ super.activate(); if (selectedNumeral != null){ selectedNumeral.indexField.alpha = 0.85; }; indexField.alpha = 1; selectedNumeral = this; } override protected function drawFrame():void{ ColorTools.applyColor(indexField, _style.borderColor); ColorTools.applyColor(btn, _style.borderColor); var _local1:int = (_item.idx + 1); if (_local1 < 20){ indexField.text = _numerals_1_to_19[_local1]; } else { if (_local1 < 100){ indexField.text = (_tens_digits[Math.floor((_local1 / 10))] + _ones_digits[(_local1 % 10)]); } else { indexField.text = _out_of_range; }; }; } override protected function onUpdate(_arg1:ObjectEvent):void{ if (_arg1.object == _asset){ if (_asset.photoData != null){ onPhotoLoadComplete(); } else { onPhotoLoadProgress(); }; drawFrame(); } else { if (_arg1.object == null){ drawFrame(); }; }; } override protected function init(_arg1:Sprite, _arg2:Library, _arg3:String):void{ super.init(_arg1, _arg2, _arg3); indexField.mouseEnabled = false; } override public function select():void{ super.select(); activate(); } override protected function onRollOver(_arg1:MouseEvent):void{ showCaption(); } } }//package com.picklish.player
Section 8
//GalleryProxy (com.picklish.player.GalleryProxy) package com.picklish.player { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import com.slideroll.ui.*; import flash.text.*; import com.picklish.app.model.*; public class GalleryProxy extends GalleryThumb { public var indexField:TextField; public static var selectedProxy:GalleryProxy; public function GalleryProxy(_arg1:Gallery, _arg2:Cell, _arg3:Style, _arg4:GalleryLayout, _arg5:ProjectAsset=null){ super(_arg1, _arg2, _arg3, _arg4, _arg5); _scale = 1; _mc.scaleX = (_mc.scaleY = _scale); _mc.x = _regpt.x; _mc.y = _regpt.y; } override protected function init(_arg1:Sprite, _arg2:Library, _arg3:String):void{ super.init(_arg1, _arg2, _arg3); frame.mouseEnabled = (indexField.mouseEnabled = false); indexField.autoSize = TextFieldAutoSize.LEFT; indexField.x = Math.floor((0 - (indexField.width / 2))); } override protected function onRollOut(_arg1:MouseEvent):void{ Tagtip.hideTag(); } override protected function onRollOver(_arg1:MouseEvent):void{ showCaption(); } override protected function drawFrame():void{ ColorTools.applyColor(frame, _style.borderColor); ColorTools.applyColor(indexField, _style.borderColor); frame.alpha = (indexField.alpha = 0.5); indexField.autoSize = TextFieldAutoSize.LEFT; var _local1:int = (_item.idx + 1); indexField.text = (_local1 + ""); indexField.x = Math.floor((0 - (indexField.width / 2))); } override public function activate():void{ super.activate(); if (selectedProxy != null){ selectedProxy.frame.alpha = (selectedProxy.indexField.alpha = 0.5); }; frame.alpha = (indexField.alpha = 1); selectedProxy = this; } override public function select():void{ super.select(); activate(); } override protected function onUpdate(_arg1:ObjectEvent):void{ if (_arg1.object == _asset){ if (_asset.photoData != null){ onPhotoLoadComplete(); } else { onPhotoLoadProgress(); }; drawFrame(); } else { if (_arg1.object == null){ drawFrame(); }; }; } } }//package com.picklish.player
Section 9
//GalleryThumb (com.picklish.player.GalleryThumb) package com.picklish.player { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import com.slideroll.ui.*; import com.picklish.app.model.*; public class GalleryThumb extends GalleryAsset { public var videoicon:Sprite; public var audioicon:Sprite; public var highlight:Sprite; public function GalleryThumb(_arg1:Gallery, _arg2:Cell, _arg3:Style, _arg4:GalleryLayout, _arg5:ProjectAsset=null){ super(_arg1, _arg2, _arg3, _arg4, _arg4.thumbSymbol, _arg5, (_arg4.thumbSize / 2), (_arg4.thumbSize / 2)); } override protected function onPhotoLoadProgress(_arg1:ProgressEvent=null):void{ super.onPhotoLoadProgress(_arg1); progress.gotoAndStop(Math.ceil(((_asset.bytesLoaded / _asset.bytesTotal) * 100))); if (_asset.bytesLoaded >= _asset.bytesTotal){ progress.visible = false; }; } protected function onClick(_arg1:MouseEvent):void{ activate(); if (((!((GalleryMedia.mainInstance == null))) && (GalleryMedia.mainInstance.autoStepping))){ GalleryMedia.mainInstance.autoStepStop(); }; } protected function onListChange(_arg1:Event):void{ } override protected function setAsset():void{ var _local1:BitmapData; if (_asset.thumbData != null){ _local1 = _asset.thumbData; if (_bitmap == null){ _bitmap = new Bitmap(_local1, PixelSnapping.NEVER, true); photo.addChild(_bitmap); _bitmapMask = new Sprite(); _bitmapMask.graphics.beginFill(0xFF0000, 1); _bitmapMask.graphics.drawRect(0, 0, 80, 80); _bitmapMask.x = -40; _bitmapMask.y = -40; photo.addChild(_bitmapMask); _bitmap.mask = _bitmapMask; } else { _bitmap.bitmapData = _asset.thumbData; }; _bitmap.x = (0 - (_local1.width / 2)); _bitmap.y = (0 - (_local1.height / 2)); photo.rotation = _asset.rotation; }; } override protected function init(_arg1:Sprite, _arg2:Library, _arg3:String):void{ super.init(_arg1, _arg2, _arg3); _scale = (_layout.thumbSize / 80); _mc.scaleX = (_mc.scaleY = _scale); _width = (_height = 80); if (videoicon != null){ videoicon.visible = (_asset.videoURL.length > 0); }; if (audioicon != null){ audioicon.visible = (_asset.audioURL.length > 0); }; if (photo != null){ setAsset(); }; _item.collection.addEventListener(Collection.EVENT_LIST_CHANGE, onListChange); btn.addEventListener(MouseEvent.MOUSE_UP, onClick); btn.addEventListener(MouseEvent.MOUSE_OVER, onRollOver); btn.addEventListener(MouseEvent.ROLL_OUT, onRollOut); btn.addEventListener(MouseEvent.MOUSE_OUT, onRollOut); _view.addEventListener(Gallery.ASSET_UPDATE, onUpdate); if (_asset.photoData != null){ onPhotoLoadComplete(); }; drawFrame(); } override protected function onPhotoLoadComplete(_arg1:Event=null):void{ super.onPhotoLoadComplete(); progress.gotoAndStop(100); progress.visible = false; } override protected function onUpdate(_arg1:ObjectEvent):void{ super.onUpdate(_arg1); if (_arg1.object == _asset){ photo.rotation = _asset.rotation; if (_bitmap == null){ setAsset(); }; if (((!((_bitmap == null))) && ((_bitmap.bitmapData == null)))){ _bitmap.bitmapData = _asset.thumbData; _bitmap.smoothing = true; }; if (_asset.photoData != null){ onPhotoLoadComplete(); } else { onPhotoLoadProgress(); }; videoicon.visible = (_asset.videoURL.length > 0); audioicon.visible = (_asset.audioURL.length > 0); if (((((!((_bitmap == null))) && (!((_asset == null))))) && (!((_bitmap.bitmapData == _asset.thumbData))))){ _bitmap.bitmapData = _asset.thumbData; _bitmap.x = (0 - (_asset.thumbData.width / 2)); _bitmap.y = (0 - (_asset.thumbData.height / 2)); _bitmap.smoothing = true; }; drawFrame(); } else { if (_arg1.object == null){ drawFrame(); }; }; } protected function showCaption():void{ if (_asset.caption.length > 0){ if (_asset.caption == "#"){ Tagtip.showTag(((_view.collection.getItem(_asset).idx + 1) + "")); } else { Tagtip.showTag(StringUtils.removeHTML(_asset.caption)); }; }; } protected function onRollOut(_arg1:MouseEvent):void{ Tagtip.hideTag(); } override public function activate():void{ super.activate(); if (((GalleryMedia.mainInstance.showing) && ((GalleryMedia.mainInstance.asset == _asset)))){ GalleryMedia.mainInstance.hide(); } else { GalleryMedia.mainInstance.asset = _asset; GalleryMedia.mainInstance.show(); }; } override public function select():void{ super.select(); GalleryMedia.mainInstance.asset = _asset; } protected function onRollOver(_arg1:MouseEvent):void{ showCaption(); } } }//package com.picklish.player
Section 10
//PlayerMain (com.picklish.player.PlayerMain) package com.picklish.player { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import com.slideroll.ui.*; import com.picklish.app.model.*; import flash.utils.*; import flash.xml.*; import flash.net.*; public class PlayerMain extends Sprite { protected var _match:String; protected var _width:uint; protected var _logo:Sprite; protected var _scale:Number;// = 1 protected var _height:uint; protected var _manifest:XMLDocument; protected var _gallery:Gallery; protected var _photoClassMap:Dictionary; protected var _galleryLayout:GalleryLayout; protected var _galleryStyle:Style; protected var _assets:Dictionary; protected var _galleryContainer:Cell; protected var _imageNodes:Array; protected var _swfLoader:SWFLoader; protected var _thumbClassMap:Dictionary; protected var _fsButton:SimpleButton; public static const INITIALIZED:String = "initialized"; public static var mainStage:Stage; public static var preloader:SWFPreloader; public function PlayerMain(_arg1:Stage, _arg2:SWFPreloader):void{ init(_arg1, _arg2); } protected function onStageResize(_arg1:Event=null):void{ setScale(); var _local2:Number = ((Math.max(0, (stage.stageWidth - (loaderInfo.width * _scale))) / 2) / _scale); var _local3:Number = ((Math.max(0, (stage.stageHeight - (loaderInfo.height * _scale))) / 2) / _scale); if (_fsButton != null){ _fsButton.scaleX = (_fsButton.scaleY = (1 / _scale)); _fsButton.x = (loaderInfo.width + _local2); _fsButton.y = (0 - _local3); }; if (_logo != null){ _logo.scaleX = (_logo.scaleY = (1 / _scale)); switch (_galleryLayout.logoPosition){ case GalleryLayout.TOP_LEFT: _logo.x = (0 - _local2); _logo.y = ((0 - _local3) + (5 / _scale)); break; case GalleryLayout.TOP_RIGHT: if (_galleryLayout.fullscreenButtonSymbol == "fullscreen"){ _logo.x = ((loaderInfo.width + _local2) - _logo.width); if (_fsButton != null){ _logo.x = (_logo.x - (14 / _scale)); }; _logo.y = ((0 - _local3) + (2 / _scale)); } else { _logo.x = ((loaderInfo.width + _local2) - _logo.width); if (_fsButton != null){ _logo.x = (_logo.x - (_fsButton.width + (4 / _scale))); }; _logo.y = ((0 - _local3) + (4 / _scale)); }; break; case GalleryLayout.BOTTOM_LEFT: _logo.x = (0 - _local2); _logo.y = ((loaderInfo.height + _local3) - _logo.height); break; case GalleryLayout.BOTTOM_RIGHT: _logo.x = ((loaderInfo.width + _local2) - _logo.width); _logo.y = ((loaderInfo.height + _local3) - _logo.height); break; }; }; } protected function onLoadComplete(_arg1:SWFLoaderEvent):void{ _swfLoader.removeEventListener(SWFLoaderEvent.MANIFEST_LOADED, onManifestLoad); _swfLoader.removeEventListener(ProgressEvent.PROGRESS, onAssetProgress); _swfLoader.removeEventListener(SWFLoaderEvent.CLASS_LOADED, onAssetLoad); _swfLoader.removeEventListener(SWFLoaderEvent.LOAD_COMPLETE, onLoadComplete); MochiBot.track(this, "7edee561"); } protected function setScale():void{ _scale = Math.min((stage.stageWidth / preloader.loaderInfo.width), (stage.stageHeight / preloader.loaderInfo.height)); if ((((_scale == 0)) || (isNaN(_scale)))){ _scale = 1; }; } protected function addLogo():void{ _logo = (Gallery.library.getDisplayObject("logobug") as Sprite); _logo.buttonMode = (_logo.mouseEnabled = true); _logo.addEventListener(MouseEvent.CLICK, onLogoClick); stage.addChild(_logo); } private function init(_arg1:Stage, _arg2:SWFPreloader):void{ mainStage = _arg1; _slot1.preloader = _arg2; _arg1.quality = StageQuality.BEST; _arg1.addEventListener(Event.ENTER_FRAME, onStageResize); _assets = new Dictionary(); _thumbClassMap = new Dictionary(); _photoClassMap = new Dictionary(); Gallery.initializeLibrary(); _swfLoader = new SWFLoader(_arg1, _arg2); _swfLoader.addEventListener(SWFLoaderEvent.MANIFEST_LOADED, onManifestLoad); _swfLoader.addEventListener(ProgressEvent.PROGRESS, onAssetProgress); _swfLoader.addEventListener(SWFLoaderEvent.CLASS_LOADED, onAssetLoad); _swfLoader.addEventListener(SWFLoaderEvent.LOAD_COMPLETE, onLoadComplete); } protected function onLogoClick(_arg1:MouseEvent):void{ navigateToURL(new URLRequest("http://www.slideroll.com")); } protected function onAssetProgress(_arg1:SWFLoaderEvent):void{ var _local2:ProjectAsset; if (_photoClassMap[_arg1.className] != null){ _local2 = (_photoClassMap[_arg1.className] as ProjectAsset); _local2.bytesLoaded = _arg1.bytesLoaded; _local2.bytesTotal = _arg1.bytesTotal; _gallery.update(_local2); }; } protected function build():void{ _width = parseInt(_manifest.idMap["gallery"].attributes.width); _height = parseInt(_manifest.idMap["gallery"].attributes.height); _galleryStyle = new Style(); _galleryStyle.backgroundColor = ColorTools.HTMLColorToNumber(_manifest.idMap["gallery"].attributes.bgcolor); _galleryStyle.borderColor = ColorTools.HTMLColorToNumber(_manifest.idMap["gallery"].attributes.alink); _galleryStyle.textColor = (((!((_manifest.idMap["gallery"].attributes.color == undefined))) && ((_manifest.idMap["gallery"].attributes.color.length > 0)))) ? ColorTools.HTMLColorToNumber(_manifest.idMap["gallery"].attributes.color) : -1; _galleryStyle.linkColor = (((!((_manifest.idMap["gallery"].attributes.link == undefined))) && ((_manifest.idMap["gallery"].attributes.link.length > 0)))) ? ColorTools.HTMLColorToNumber(_manifest.idMap["gallery"].attributes.link) : -1; _galleryStyle.borderWidth = parseInt(_manifest.idMap["gallery"].attributes.border); var _local1:int = (((!((_manifest.idMap["gallery"].attributes.width == undefined))) && ((_manifest.idMap["gallery"].attributes.width.length > 0)))) ? parseInt(_manifest.idMap["gallery"].attributes.width) : -1; var _local2:int = (((!((_manifest.idMap["gallery"].attributes.height == undefined))) && ((_manifest.idMap["gallery"].attributes.height.length > 0)))) ? parseInt(_manifest.idMap["gallery"].attributes.height) : -1; _galleryLayout = new GalleryLayout(); _galleryLayout.applyLayout(GalleryLayout[("OPTIONS" + _manifest.idMap["gallery"].attributes.style)]); if (_manifest.idMap["gallery"].attributes.autoplay == "1"){ _galleryLayout.autoplay = true; }; if ((((_local1 > 0)) && ((_local2 > 0)))){ _galleryLayout.width = _local1; _galleryLayout.height = _local2; }; var _local3:Sprite = new Sprite(); stage.addChild(_local3); _galleryContainer = new Cell(_local3, _width, _height, true, false, 0, null, _galleryStyle); _gallery = new Gallery(_galleryContainer, _galleryStyle, _galleryLayout); _gallery.create(); var _local4:String = _manifest.idMap["head"].attributes.match; if (_match != _local4){ addLogo(); }; addFullScreen(); setScale(); } protected function addFullScreen():void{ _fsButton = (Gallery.library.getDisplayObject(_galleryLayout.fullscreenButtonSymbol) as SimpleButton); _fsButton.addEventListener(MouseEvent.CLICK, onFullScreenClick); stage.addChild(_fsButton); } protected function onAssetLoad(_arg1:SWFLoaderEvent):void{ var _local2:BitmapData; var _local3:ProjectAsset; if (_arg1.objectType == SWFLoaderEvent.TYPE_BITMAPDATA){ _local2 = (_swfLoader.assets[_arg1.className] as BitmapData); if (_local2){ if (_thumbClassMap[_arg1.className] != null){ _local3 = (_thumbClassMap[_arg1.className] as ProjectAsset); _local3.thumbData = _local2; _gallery.update(_local3); }; if (_photoClassMap[_arg1.className] != null){ _local3 = (_photoClassMap[_arg1.className] as ProjectAsset); _local3.photoData = _local2; _local3.photoWidth = _local2.width; _local3.photoHeight = _local2.height; _gallery.update(_local3); }; }; }; } protected function onFullScreenClick(_arg1:MouseEvent):void{ if (stage.displayState == StageDisplayState.NORMAL){ stage.displayState = StageDisplayState.FULL_SCREEN; } else { stage.displayState = StageDisplayState.NORMAL; }; } protected function populate():void{ var _local1:XMLNode; var _local2:ProjectAsset; var _local3:Array = []; var _local4:int; while (_local4 < _imageNodes.length) { _local1 = _imageNodes[_local4]; _local2 = new ProjectAsset(); _local2.fromString(_local1.toString()); _assets[_local2.id] = _local2; _thumbClassMap[_local1.attributes.thumbClass] = _local2; _photoClassMap[_local1.attributes.photoClass] = _local2; _local3.push(new CollectionItem(_gallery.collection, _local2, _galleryLayout.thumbSize, _galleryLayout.thumbSize, null, _galleryStyle)); _local4++; }; _gallery.collection.addMembers(_local3); _gallery.setInitialMedia(); } protected function onManifestLoad(_arg1:SWFLoaderEvent):void{ var _local2:ByteArray = (_swfLoader.assets[_arg1.className] as ByteArray); var _local3:String = _local2.readUTFBytes(_local2.length); _manifest = new XMLDocument(); _manifest.ignoreWhite = true; _manifest.parseXML(_local3); var _local4 = (("<body" + _local3.toLowerCase().split("<body")[1].split("</body>")[0]) + "</body>"); _match = SignString.sign(_local4); _imageNodes = _manifest.firstChild.firstChild.firstChild.nextSibling.childNodes; build(); populate(); } } }//package com.picklish.player
Section 11
//PlayerPreloader (com.picklish.player.PlayerPreloader) package com.picklish.player { import flash.events.*; import com.slideroll.util.*; import flash.display.*; import flash.text.*; import flash.filters.*; public class PlayerPreloader extends SWFPreloader { protected var _corePlayerSize:uint;// = 60000 protected var _loadingBar:Sprite; protected var _loadingBarMaxWidth:uint;// = 200 public function PlayerPreloader(){ _mainClassName = "com.picklish.player.PlayerMain"; } override public function onAdded(_arg1:Event=null):void{ super.onAdded(_arg1); statusText.defaultTextFormat = new TextFormat("Verdana", 12, 0xFFFFFF, null, null, null, null, null, TextFormatAlign.CENTER); statusText.filters = [new DropShadowFilter(1, 90, 0, 0.25, 0, 0, 1)]; _loadingBar = new Sprite(); stage.addChild(_loadingBar); var _local2:Graphics = _loadingBar.graphics; _local2.clear(); _local2.beginFill(0, 0.25); _local2.drawRect(-50, 0, 100, 2); _local2.beginFill(0xFFFFFF, 0.5); _local2.drawRect(-50, -1, 100, 2); _loadingBar.scaleX = 0.1; _loadingBar.visible = (statusText.visible = false); stage.addEventListener(Event.ENTER_FRAME, align); } override public function startup():void{ _loadingBar.visible = (statusText.visible = false); super.startup(); } protected function align(_arg1:Event):void{ var e = _arg1; if (_started){ stage.removeEventListener(Event.ENTER_FRAME, align); return; }; try { statusText.width = loaderInfo.width; statusText.height = 20; statusText.x = 0; statusText.y = ((loaderInfo.height / 2) - 20); _loadingBar.x = (loaderInfo.width / 2); _loadingBar.y = ((loaderInfo.height / 2) + 5); _loadingBarMaxWidth = (loaderInfo.width - 20); _loadingBar.visible = (statusText.visible = true); stage.removeEventListener(Event.ENTER_FRAME, align); } catch(e:Error) { }; } override protected function progress(_arg1:ProgressEvent):void{ status = (("Loading " + Math.min(100, Math.ceil(((root.loaderInfo.bytesLoaded / _corePlayerSize) * 100)))) + "%"); _loadingBar.scaleX = (((root.loaderInfo.bytesLoaded / _corePlayerSize) * _loadingBarMaxWidth) / 100); } } }//package com.picklish.player
Section 12
//Back (com.robertpenner.easing.Back) package com.robertpenner.easing { public class Back { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):Number{ if (_arg5 == 0){ _arg5 = 1.70158; }; _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):Number{ if (_arg5 == 0){ _arg5 = 1.70158; }; _arg1 = (_arg1 / _arg4); return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):Number{ if (_arg5 == 0){ _arg5 = 1.70158; }; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ _arg5 = (_arg5 * 1.525); return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2)); }; _arg1 = (_arg1 - 2); _arg5 = (_arg5 * 1.525); return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2)); } } }//package com.robertpenner.easing
Section 13
//Bounce (com.robertpenner.easing.Bounce) package com.robertpenner.easing { public class Bounce { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); if (_arg1 < (1 / 2.75)){ return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2)); }; if (_arg1 < (2 / 2.75)){ _arg1 = (_arg1 - (1.5 / 2.75)); return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2)); }; if (_arg1 < (2.5 / 2.75)){ _arg1 = (_arg1 - (2.25 / 2.75)); return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2)); }; _arg1 = (_arg1 - (2.625 / 2.75)); return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (((_arg3 - Bounce.easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ if (_arg1 < (_arg4 / 2)){ return (((Bounce.easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2)); }; return ((((Bounce.easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2)); } } }//package com.robertpenner.easing
Section 14
//Circ (com.robertpenner.easing.Circ) package com.robertpenner.easing { public class Circ { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2)); } } }//package com.robertpenner.easing
Section 15
//Cubic (com.robertpenner.easing.Cubic) package com.robertpenner.easing { public class Cubic { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2)); } } }//package com.robertpenner.easing
Section 16
//Elastic (com.robertpenner.easing.Elastic) package com.robertpenner.easing { public class Elastic { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{ var _local7:Number; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; if (isNaN(_arg6)){ _arg6 = (_arg4 * 0.3); }; if (((isNaN(_arg5)) || ((_arg5 < Math.abs(_arg3))))){ _arg5 = _arg3; _local7 = (_arg6 / 4); } else { _local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5))); }; return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) + _arg3) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{ var _local7:Number; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; if (isNaN(_arg6)){ _arg6 = (_arg4 * 0.3); }; if (((isNaN(_arg5)) || ((_arg5 < Math.abs(_arg3))))){ _arg5 = _arg3; _local7 = (_arg6 / 4); } else { _local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5))); }; --_arg1; return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=NaN):Number{ var _local7:Number; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 == 2){ return ((_arg2 + _arg3)); }; if (isNaN(_arg6)){ _arg6 = (_arg4 * (0.3 * 1.5)); }; if (((isNaN(_arg5)) || ((_arg5 < Math.abs(_arg3))))){ _arg5 = _arg3; _local7 = (_arg6 / 4); } else { _local7 = ((_arg6 / (2 * Math.PI)) * Math.asin((_arg3 / _arg5))); }; if (_arg1 < 1){ --_arg1; return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6)))) + _arg2)); }; --_arg1; return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _arg6))) * 0.5) + _arg3) + _arg2)); } } }//package com.robertpenner.easing
Section 17
//Expo (com.robertpenner.easing.Expo) package com.robertpenner.easing { public class Expo { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (((_arg1)==0) ? _arg2 : ((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ if (_arg1 == 0){ return (_arg2); }; if (_arg1 == _arg4){ return ((_arg2 + _arg3)); }; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return ((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2)); }; --_arg1; return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2)); } } }//package com.robertpenner.easing
Section 18
//Linear (com.robertpenner.easing.Linear) package com.robertpenner.easing { public class Linear { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((_arg3 * _arg1) / _arg4) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((_arg3 * _arg1) / _arg4) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((_arg3 * _arg1) / _arg4) + _arg2)); } public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((_arg3 * _arg1) / _arg4) + _arg2)); } } }//package com.robertpenner.easing
Section 19
//Quad (com.robertpenner.easing.Quad) package com.robertpenner.easing { public class Quad { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((_arg3 * _arg1) * _arg1) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2)); }; --_arg1; return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2)); } } }//package com.robertpenner.easing
Section 20
//Quart (com.robertpenner.easing.Quart) package com.robertpenner.easing { public class Quart { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2)); } } }//package com.robertpenner.easing
Section 21
//Quint (com.robertpenner.easing.Quint) package com.robertpenner.easing { public class Quint { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); }; _arg1 = (_arg1 - 2); return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2)); } } }//package com.robertpenner.easing
Section 22
//Sine (com.robertpenner.easing.Sine) package com.robertpenner.easing { public class Sine { public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2)); } public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2)); } } }//package com.robertpenner.easing
Section 23
//Cell (com.slideroll.ui.Cell) package com.slideroll.ui { import flash.display.*; import flash.events.*; import flash.text.*; public class Cell extends Component { public var lastArrangedChildY:Number;// = 0 protected var _collapse:Boolean;// = false protected var _round:Number;// = 0 protected var _childNodes:Array; public var lastArrangedChildIndex:Number;// = -1 protected var _wrap:Boolean;// = true protected var _title_tf:TextField; protected var _maskContent:Boolean;// = false protected var _childrenContainer:Sprite; protected var _bkgd:Sprite; protected var _border:Boolean;// = true public var lastArrangedChildX:Number;// = 0 protected var _mask:Sprite; protected var _background:Boolean;// = true protected var _scrollable:Boolean;// = false protected var _sortChildNodes:Boolean;// = false public function Cell(_arg1:Sprite=null, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:Number=0, _arg7:Position=null, _arg8:Style=null){ init_Cell(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); if (_container != null){ create(); }; } public function get contentHeight():Number{ return (Position.getCellContentHeight(this)); } public function get contentY():Number{ return (_childrenContainer.y); } private function createMask():void{ if (_mask == null){ _mask = Sprite(_mc.addChild(new Sprite())); }; _mask.graphics.clear(); if (_border){ DrawingMethods.rect(_mask, false, _style.borderWidth, _style.borderWidth, (_width - (_style.borderWidth * 2)), (_height - (_style.borderWidth * 2)), _style.backgroundColor); } else { DrawingMethods.rect(_mask, false, 0, 0, _width, _height); }; _mask.visible = false; _childrenContainer.mask = _mask; } public function onChildChange(_arg1:Event):void{ dispatchEvent(new Event(EVENT_CHANGE)); } public function removeChild(_arg1:Component, _arg2:Boolean=true):Boolean{ var _local3:int = (_childNodes.length - 1); while (_local3 >= 0) { if (_childNodes[_local3] == _arg1){ _childNodes.splice(_local3, 1); Position.arrangeContent(this); dispatchEvent(new Event(EVENT_CHANGE)); if (_arg2){ return (_arg1.destroy()); }; if (_arg1.mc.parent == _childrenContainer){ _childrenContainer.removeChild(_arg1.mc); } else { if ((((_arg1.parentCell == this)) && (!((_arg1.mc.parent == null))))){ _arg1.mc.parent.removeChild(_arg1.mc); }; }; return (true); }; _local3--; }; return (false); } protected function drawBackground():void{ _bkgd.graphics.clear(); if (((_background) && ((_round > 0)))){ Create.background(_bkgd, _width, _height, _style, _border, _round); } else { if (((_border) && (!(_background)))){ DrawingMethods.emptyRect(_bkgd, false, 0, 0, _width, _height, _style.borderWidth, _style.borderColor, _style.borderAlpha); } else { if (_background){ Create.background(_bkgd, _width, _height, _style, _border, _round); }; }; }; } public function set wrap(_arg1:Boolean):void{ _wrap = _arg1; Position.arrangeContent(this, true); } public function set contentY(_arg1:Number):void{ if (!isNaN(_arg1)){ _childrenContainer.y = Math.min(0, Math.max(_arg1, ((0 - Position.getCellContentHeight(this)) + _height))); }; } public function get contents():Sprite{ return (_childrenContainer); } override public function get height():uint{ if (_height == 0){ return (_mc.height); }; return (_height); } public function onBlur(_arg1:Event=null):void{ dispatchEvent(new Event(EVENT_BLUR)); } public function get collapse():Boolean{ return (_collapse); } public function get background():Boolean{ return (_background); } public function get sortChildNodes():Boolean{ return (_sortChildNodes); } public function get scrollable():Boolean{ return (_scrollable); } override public function enable(_arg1:Event=null):void{ super.enable(); var _local2:int = (_childNodes.length - 1); while (_local2 >= 0) { Component(_childNodes[_local2]).enable(); _local2--; }; } override public function hide(_arg1:Event=null):void{ if (_mc != null){ _mc.visible = false; }; dispatchEvent(new Event(EVENT_BLUR)); var _local2:int = (_childNodes.length - 1); while (_local2 >= 0) { Component(_childNodes[_local2]).dispatchEvent(new Event(EVENT_BLUR)); _local2--; }; } override public function get width():uint{ if (_width == 0){ return (_mc.width); }; return (_width); } public function update():void{ _height = Position.getCellContentHeight(this); redraw(); } public function get wrap():Boolean{ return (_wrap); } public function set bkgd(_arg1:Sprite):void{ if (((!((_bkgd == null))) && ((_bkgd.parent == _mc)))){ _mc.removeChild(_bkgd); }; _bkgd = _arg1; if (_bkgd != null){ _mc.addChildAt(_bkgd, 0); }; } public function get contentWidth():Number{ return (Position.getCellContentWidth(this)); } public function set scrollable(_arg1:Boolean):void{ _scrollable = _arg1; } protected function init_Cell(_arg1:Sprite, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:Number=0, _arg7:Position=null, _arg8:Style=null):void{ super.init(_arg1, _arg7, _arg8); _type = "cell"; _width = (isNaN(_arg2)) ? _width : _arg2; _height = (isNaN(_arg3)) ? _height : _arg3; _background = _arg4; _border = _arg5; _round = ((_arg6)>0) ? _arg6 : 0; _childNodes = []; } public function set maskContent(_arg1:Boolean):void{ _maskContent = _arg1; if (_maskContent){ createMask(); } else { _childrenContainer.mask = null; }; } public function onChildFocus(_arg1:Event):void{ var _local2:int; while (_local2 < _childNodes.length) { if (_childNodes[_local2] != _arg1.target){ if ((_childNodes[_local2] is Cell)){ Cell(_childNodes[_local2]).onBlur(); }; }; _local2++; }; } public function set background(_arg1:Boolean):void{ _background = _arg1; redraw(true); } public function clear():void{ var _local1:int = (_childNodes.length - 1); while (_local1 >= 0) { removeChild(Component(_childNodes[_local1]), true); _local1--; }; lastArrangedChildIndex = -1; lastArrangedChildX = (lastArrangedChildY = 0); dispatchEvent(new Event(EVENT_CHANGE)); } public function get bkgd():Sprite{ return (_bkgd); } override public function disable(_arg1:Event=null):void{ super.disable(); var _local2:int = (_childNodes.length - 1); while (_local2 >= 0) { Component(_childNodes[_local2]).disable(); _local2--; }; } public function set collapse(_arg1:Boolean):void{ _collapse = _arg1; } public function get maskContent():Boolean{ return (_maskContent); } public function set trapMouse(_arg1:Boolean):void{ if (_arg1){ if (_background == false){ DrawingMethods.rect(_bkgd, true, 0, 0, _width, _height, 0, 0); }; _bkgd.useHandCursor = false; _bkgd.mouseEnabled = true; } else { _bkgd.mouseEnabled = false; _bkgd.useHandCursor = true; }; } public function get childNodes():Array{ return (_childNodes); } private function redraw(_arg1:Boolean=false):void{ if (((!((_container == null))) && (((((_arg1) || (_collapse))) || (_position.collapse))))){ if (((_collapse) || (_position.collapse))){ if (isNaN(_width)){ _width = 0; }; _width = Math.max(_width, (Position.getCellContentWidth(this) + (_style.borderWidth * 2))); _height = ((Position.getCellContentHeight(this) + (_style.borderWidth * 2)) + _style.padding); if (_maskContent){ createMask(); }; }; drawBackground(); }; } public function get trapMouse():Boolean{ return (_bkgd.mouseEnabled); } public function addChild(_arg1:Component):Component{ if (_arg1.created){ if (_arg1.mc.parent == null){ _childrenContainer.addChild(_arg1.mc); return (_arg1); }; return (null); }; var _local2:int; while (_local2 < _childNodes.length) { if (_childNodes[_local2] == _arg1){ return (_arg1); }; _local2++; }; _childNodes.push(_arg1); _arg1.parentCell = this; _arg1.addEventListener(EVENT_FOCUS, onChildFocus); _arg1.addEventListener(EVENT_CHANGE, onChildChange); if (_arg1.position.zindex != 1){ _sortChildNodes = true; }; Position.arrangeContent(this); redraw(); dispatchEvent(new Event(EVENT_CHANGE)); return (_arg1); } override public function create():void{ super.create(); if (_parentCell != null){ if (_width == 0){ _width = ((_parentCell.width - _position.margin_left) - _position.margin_right); }; if ((((_height == 0)) && (!(_position.collapse)))){ _height = ((_parentCell.height - _position.margin_top) - _position.margin_bottom); }; _parentCell.addEventListener(EVENT_BLUR, onBlur); }; _bkgd = Sprite(_mc.addChild(new Sprite())); drawBackground(); _childrenContainer = Sprite(_mc.addChild(new Sprite())); _childrenContainer.name = (_mc.name + "_childContainer"); if (_maskContent){ createMask(); }; _mc.x = _position.margin_top; _mc.y = _position.margin_left; var _local1:int; while (_local1 < _childNodes.length) { Component(childNodes[_local1]).parentCell = this; _local1++; }; } public function set contentX(_arg1:Number):void{ if (!isNaN(_arg1)){ _childrenContainer.x = Math.min(0, Math.max(_arg1, ((0 - Position.getCellContentWidth(this)) + _width))); }; } public function get contentX():Number{ return (_childrenContainer.x); } } }//package com.slideroll.ui
Section 24
//Collection (com.slideroll.ui.Collection) package com.slideroll.ui { import flash.display.*; import com.slideroll.util.*; import flash.events.*; import flash.utils.*; import flash.geom.*; import flash.ui.*; public class Collection extends Cell { protected var _newScale:Number; protected var _memberPosition:Position; protected var _spacing:int;// = 20 public var allowDrag:Boolean;// = false protected var _startWidth:Number; public var useBorderWidthInBlanks:Boolean;// = true protected var _isDragging:Boolean;// = false public var showHighlight:Boolean;// = true public var allowRemoveOnDrag:Boolean;// = false public var autoResize:Boolean;// = false protected var _itemsPerPage:int;// = 0 public var usePagingDisplay:Boolean;// = false public var allowDelete:Boolean;// = true protected var _memberHeight:int;// = 100 protected var _newItems:Array; protected var _backgroundButton:Sprite; protected var markerContainer:Sprite; protected var _startHeight:Number; protected var _tweenRate:Number;// = 3 protected var _rescaling:Boolean;// = false protected var _totalWidth:Number; public var ignoreVisibility:Boolean;// = false public var useCircularBlanks:Boolean;// = false public var useRotateEffectOnDrag:Boolean;// = false protected var _isTweening:Boolean;// = false public var allowKeyboardEvents:Boolean;// = true public var allowMultiSelect:Boolean;// = false protected var _memberWidth:int;// = 100 protected var _mouseXold:Number;// = 0 protected var _memberRefs:Dictionary; protected var _isSelecting:Boolean;// = false protected var _itemsPerRow:int;// = 0 protected var _pageX:int;// = 0 protected var clipboard:Array; protected var _selectedMembers:Array; protected var _selectionIndex:int;// = -1 protected var _populating:Boolean;// = false protected var _totalHeight:Number; public var allowRearrange:Boolean;// = false protected var _members:Array; protected var _rowLength:int;// = 5 protected var _mouseYold:Number;// = 0 public var useBorderColorOnHighlight:Boolean;// = false public var itemListener:Function; protected var _currentPage:int;// = 1 protected var _selectDrag:Boolean;// = false public var useSnap:Boolean;// = false public var resizeScale:Number;// = 1 public var itemScale:Number;// = 1 protected var _pageWidth:int; protected var _masterCollection:Collection; public static const EVENT_DELETE:String = "delete"; public static const EVENT_ADD_COMPLETE:String = "add_complete"; public static const EVENT_SELECT:String = "select"; public static const EVENT_CLEAR:String = "list_clear"; public static const EVENT_RESTORE:String = "restore"; public static const EVENT_LIST_CHANGE:String = "list_change"; public static const EVENT_ADD_MEMBER:String = "add_member"; public static const EVENT_ADD_START:String = "add_complete"; public static var destIndex:int; public static var sourceCollection:Collection; protected static var dragGhostSnapshot:Bitmap; protected static var dragContainer:Sprite; public static var destCollection:Collection; public static var selectedCollection:Collection; protected static var selectBox:Sprite; protected static var dragGhost:Sprite; public function Collection(_arg1:Sprite=null, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=100, _arg5:Number=100, _arg6:int=10, _arg7:Position=null, _arg8:Style=null){ init_Collection(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); if (_container != null){ create(); }; } public function updateView():void{ arrange(); } public function selectPrevious(_arg1:MouseEvent=null):void{ var _local2:CollectionItem; if (_selectedMembers.length > 0){ _local2 = _members[Math.max(0, (_members.indexOf(_selectedMembers[0]) - 1))]; }; if (_local2 != null){ selectObject(_local2); if (_local2.selectCallback != null){ _local2.selectCallback(); }; }; } protected function concat(_arg1:Object):Array{ return (_members.concat(_arg1)); } public function selectNext(_arg1:MouseEvent=null):void{ var _local2:CollectionItem; if (_selectedMembers.length > 0){ _local2 = _members[Math.min((_members.length - 1), (_members.indexOf(_selectedMembers[0]) + 1))]; }; if (_local2 != null){ selectObject(_local2); if (_local2.selectCallback != null){ _local2.selectCallback(); }; }; } protected function populate(_arg1:Event):void{ if (_newItems.length > 0){ addMember(_newItems.shift()); } else { _populating = false; mainStage.removeEventListener(Event.ENTER_FRAME, populate); dispatchEvent(new Event(EVENT_ADD_COMPLETE)); }; } public function get members():Array{ return (_members); } protected function checkHover(_arg1:Event):void{ if ((Math.abs((_mouseXold - _mc.mouseX)) + Math.abs((_mouseYold - _mc.mouseY))) < 4){ if (_wrap){ if ((((((((_mc.mouseY > -20)) && ((_mc.mouseY < 20)))) && ((_mc.mouseX >= 0)))) && ((_mc.mouseX <= _width)))){ dispatchEvent(new Event(EVENT_HOVER_START)); }; if ((((((((_mc.mouseY < (_height + 20))) && ((_mc.mouseY > (_height - 20))))) && ((_mc.mouseX >= 0)))) && ((_mc.mouseX <= _width)))){ dispatchEvent(new Event(EVENT_HOVER_END)); }; } else { if ((((((((_mc.mouseX > -20)) && ((_mc.mouseX < 20)))) && ((_mc.mouseY >= 0)))) && ((_mc.mouseY <= _height)))){ dispatchEvent(new Event(EVENT_HOVER_START)); }; if ((((((((_mc.mouseX < (_width + 20))) && ((_mc.mouseX > (_width - 20))))) && ((_mc.mouseY >= 0)))) && ((_mc.mouseY <= _height)))){ dispatchEvent(new Event(EVENT_HOVER_END)); }; }; }; _mouseXold = _mc.mouseX; _mouseYold = _mc.mouseY; } override public function destroy():Boolean{ return (super.destroy()); } protected function push(_arg1:CollectionItem):uint{ var _local2:uint = _members.push(_arg1); addChild(_arg1); arrange(); return (_local2); } protected function selectionOrder(_arg1:CollectionItem, _arg2:CollectionItem):Number{ var _local3:int = _members.indexOf(_arg1); var _local4:int = _members.indexOf(_arg2); if (_local3 < _local4){ return (-1); }; if (_local3 > _local4){ return (1); }; return (0); } protected function sortOn(_arg1:Object, _arg2:Number):Array{ var _local3:Array = _members.sortOn(_arg1, _arg2); arrange(); return (_local3); } override public function get height():uint{ if (_height == 0){ return (_mc.height); }; return (Math.max(_startHeight, (_height + _spacing))); } public function gotoItemPage(_arg1:CollectionItem):void{ var _local2:int; var _local3:int; if (((usePagingDisplay) && (!((_arg1 == null))))){ _local2 = _members.indexOf(_arg1); if (_local2 >= 0){ _local3 = ((_local2 / _itemsPerPage) + 1); gotoPage(_local3); }; }; } public function nextPage(_arg1:Event):void{ if (usePagingDisplay){ if (_currentPage < totalPages){ _currentPage++; _pageX = (0 - (_pageWidth * (_currentPage - 1))); startTween(); }; }; } public function set membersMouseEnabled(_arg1:Boolean):void{ var _local2:Component; for each (_local2 in childNodes) { _local2.mouseEnabled = _arg1; }; } protected function onSelectWindowStop(_arg1:MouseEvent):void{ var _local2:Component; for each (_local2 in childNodes) { _local2.mouseEnabled = true; }; Component.mainStage.removeEventListener(MouseEvent.MOUSE_MOVE, onSelectWindow); Component.mainStage.removeEventListener(MouseEvent.MOUSE_UP, onSelectWindowStop); selectBox.width = (selectBox.height = 100); selectBox.visible = false; _isSelecting = true; _selectDrag = false; setSelectionStartIndex(); dispatchEvent(new Event(EVENT_SELECT)); } protected function getIndexFromPosition(_arg1:Number, _arg2:Number):int{ var _local3:int; var _local4:Number; var _local5:Number; if (autoResize){ _local4 = ((_memberWidth + _spacing) * (_rowLength - 1)); _local5 = 0; if (_rowLength > 0){ _local5 = ((_memberHeight + _spacing) * (Math.ceil((_members.length / _rowLength)) - 1)); }; _local3 = (Math.round(((_arg2 + (_local5 / 2)) / (_memberHeight + _spacing))) * _rowLength); _local3 = (_local3 + Math.min(_rowLength, Math.max(0, Math.ceil(((_arg1 + (_local4 / 2)) / (_memberWidth + _spacing)))))); } else { _arg1 = (_arg1 - (_memberWidth / 2)); if (_rowLength > 1){ _arg2 = (_arg2 - (_memberHeight / 2)); }; _arg1 = (_arg1 / (_memberWidth + (_spacing * 2))); _arg2 = (_arg2 / (_memberHeight + (_spacing * 2))); if (_rowLength == 1){ _local3 = (Math.floor(_arg2) * _rowLength); } else { _local3 = (Math.round(_arg2) * _rowLength); }; if (!_wrap){ _local3 = 0; }; _local3 = (_local3 + Math.min(_rowLength, Math.ceil(_arg1))); }; _local3 = Math.min(_members.length, Math.max(0, _local3)); return (_local3); } protected function startTween():void{ if (!_isTweening){ mainStage.addEventListener(Event.ENTER_FRAME, tween); _isTweening = true; }; } protected function join(_arg1:String):String{ return (_members.join(_arg1)); } protected function onMasterRestore(_arg1:ObjectEvent):void{ restoreMembers(); } protected function setItemReference(_arg1:Object, _arg2:CollectionItem):void{ var _local3:Array; if (_memberRefs[_arg1] == null){ _memberRefs[_arg1] = _arg2; } else { if ((_memberRefs[_arg1] is CollectionItem)){ _memberRefs[_arg1] = [_memberRefs[_arg1], _arg2]; } else { _local3 = (_memberRefs[_arg1] as Array); _local3.push(_arg2); }; }; } protected function onMasterDelete(_arg1:ObjectEvent):void{ var _local3:Object; var _local4:CollectionItem; var _local2:Array = []; for each (_local3 in _arg1.object) { _local4 = getItem(_local3); if (_local4 != null){ _local2.push(_local4); }; }; if (_local2.length > 0){ removeMembers(_local2); }; } public function addMembers(_arg1:Array, _arg2:int=-1, _arg3:Boolean=false, _arg4:Boolean=false):Array{ var _local6:int; var _local7:int; var _local5:Array = []; if (useSnap){ _arg4 = true; }; if (_arg3){ this.clear(); _newItems = []; }; deselectObjects(); if ((_arg1[0] is CollectionItem)){ _local6 = 0; while (_local6 < _arg1.length) { _arg1[_local6] = CollectionItem(_arg1[_local6]).reference; _local6++; }; }; _newItems = _newItems.concat(_arg1); if ((((_arg2 == -1)) && ((_arg1.length > 500)))){ if (!_populating){ dispatchEvent(new Event(EVENT_ADD_START)); _populating = true; mainStage.addEventListener(Event.ENTER_FRAME, populate); }; } else { _local7 = _arg2; while (_newItems.length > 0) { _local5.push(addMember(_newItems.shift(), _local7, _arg4)); if (_local7 != -1){ _local7++; }; }; deselectObjects(); if (_arg2 != -1){ selectObjects(_arg2, ((_arg2 + _arg1.length) - 1)); }; dispatchEvent(new Event(EVENT_ADD_COMPLETE)); }; return (_local5); } public function set masterCollection(_arg1:Collection):void{ if (_masterCollection != null){ _masterCollection.removeEventListener(EVENT_ADD_MEMBER, onMasterAdd); _masterCollection.removeEventListener(EVENT_LIST_CHANGE, onMasterChange); _masterCollection.removeEventListener(EVENT_DELETE, onMasterDelete); _masterCollection.removeEventListener(EVENT_RESTORE, onMasterRestore); _masterCollection.removeEventListener(EVENT_CLEAR, onMasterClear); }; _masterCollection = _arg1; if (_masterCollection != null){ _masterCollection.addEventListener(EVENT_ADD_MEMBER, onMasterAdd); _masterCollection.addEventListener(EVENT_LIST_CHANGE, onMasterChange); _masterCollection.addEventListener(EVENT_DELETE, onMasterDelete); _masterCollection.addEventListener(EVENT_RESTORE, onMasterRestore); _masterCollection.addEventListener(EVENT_CLEAR, onMasterClear); onMasterChange(); } else { clear(); }; } protected function onMasterChange(_arg1:Event=null):void{ var _local3:Object; var _local4:CollectionItem; var _local2:int; while (_local2 < _masterCollection.members.length) { _local3 = CollectionItem(_masterCollection.members[_local2]).reference; if (_local3 != null){ _local4 = getItem(_local3); if (_local4 != null){ _local4.idx = _local2; } else { _local4 = addMember(_local3); _local4.idx = _local2; }; }; _local2++; }; _members.sortOn("idx", Array.NUMERIC); arrange(); } public function get memberWidth():int{ return (_memberWidth); } protected function init_Collection(_arg1:Sprite, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=100, _arg5:Number=100, _arg6:int=10, _arg7:Position=null, _arg8:Style=null):void{ super.init_Cell(_arg1, _arg2, _arg3, false, false, 0, _arg7, _arg8); _type = "collection"; if (isNaN(_arg3)){ _collapse = true; }; _memberWidth = _arg4; _memberHeight = _arg5; _spacing = _arg6; _memberPosition = new Position(null, Position.ALIGN_LEFT, Position.PLACEMENT_FLOAT, Position.CLEAR_NONE, (_spacing / 2)); _rowLength = Math.floor((_width / (_memberWidth + (_spacing * 2)))); _pageWidth = _width; _itemsPerPage = (Math.floor((_width / (_memberWidth + _spacing))) * Math.floor((_height / (_memberHeight + _spacing)))); _itemsPerRow = Math.floor((_pageWidth / (_memberWidth + _spacing))); _members = []; _selectedMembers = []; _memberRefs = new Dictionary(true); _newItems = []; clipboard = []; Key.initialize(mainStage); mainStage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true); mainStage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp, false, 0, true); } protected function pop(_arg1:Boolean):CollectionItem{ var _local2:CollectionItem = _members.pop(); if (_arg1 != true){ removeChild(_local2); }; arrange(); return (_local2); } protected function stopDrag(_arg1:Event):void{ var _local2:CollectionItem; var _local3:Number; if (sourceCollection == this){ dispatchEvent(new Event(EVENT_DROP)); }; mainStage.removeEventListener(MouseEvent.MOUSE_MOVE, dragFollow); mainStage.removeEventListener(Event.ENTER_FRAME, checkHover); if (((allowRemoveOnDrag) || (useRotateEffectOnDrag))){ for each (_local2 in _selectedMembers) { _childrenContainer.addChild(_local2.mc); _local2.isDragging = false; }; } else { if (((!((dragGhostSnapshot == null))) && (!((dragGhostSnapshot.bitmapData == null))))){ dragGhostSnapshot.bitmapData.dispose(); }; dragGhost.visible = false; }; membersMouseEnabled = true; if (_isDragging){ _isDragging = false; if (((((((((allowRearrange) && ((_mc.mouseX > -10)))) && ((_mc.mouseY > -10)))) && (((_mc.mouseX - 10) < width)))) && (((_mc.mouseY - 10) < height)))){ _local3 = getIndexFromPosition(_childrenContainer.mouseX, _childrenContainer.mouseY); placeSelectionAt(_local3); } else { arrange(); }; }; markerContainer.graphics.clear(); } protected function dragFollow(_arg1:MouseEvent):void{ var _local2:Number; if (_selectedMembers.length > 0){ if (((allowRemoveOnDrag) || (useRotateEffectOnDrag))){ _local2 = 0; while (_local2 < _selectedMembers.length) { if (useRotateEffectOnDrag){ CollectionItem(_selectedMembers[_local2]).x = ((dragContainer.mouseX + (Math.sin(_local2) * ((_selectedMembers.length - _local2) * 5))) - (_memberWidth / 2)); CollectionItem(_selectedMembers[_local2]).y = ((dragContainer.mouseY + (Math.cos(_local2) * ((_selectedMembers.length - _local2) * 5))) - (_memberHeight / 2)); } else { CollectionItem(_selectedMembers[_local2]).x = ((dragContainer.mouseX + (_local2 * 10)) - (_memberWidth / 2)); CollectionItem(_selectedMembers[_local2]).y = ((dragContainer.mouseY + (_local2 * 10)) - (_memberHeight / 2)); }; _local2++; }; } else { dragGhost.x = dragContainer.mouseX; dragGhost.y = dragContainer.mouseY; }; }; if (allowRearrange){ drawPlacementMarker(); }; } override public function clear():void{ super.clear(); _members = []; _selectedMembers = []; clipboard = []; dispatchEvent(new Event(EVENT_CLEAR)); dispatchEvent(new Event(EVENT_LIST_CHANGE)); } public function get memberHeight():int{ return (_memberHeight); } public function selectObject(_arg1:CollectionItem):void{ var _local2:int; var _local3:int; var _local4:int; if ((((_arg1 == null)) && (CollectionItem(_members[0].multiselect)))){ selectObjects(); } else { if (((Key.shiftKey) && (allowMultiSelect))){ if (_selectedMembers.length > 0){ _local2 = _members.indexOf(_selectedMembers[0]); } else { _local2 = _members.indexOf(_arg1); }; _local3 = _members.indexOf(_arg1); if (_local2 < _local3){ selectObjects(_local2, _local3); } else { selectObjects(_local3, _local2); }; _arg1.select(); } else { if (((((Key.ctrlKey) || (_selectDrag))) && (allowMultiSelect))){ if (_arg1.selected){ _local4 = 0; while (_local4 < _selectedMembers.length) { if (_selectedMembers[_local4] == _arg1){ _selectedMembers.splice(_local4, 1); }; _local4++; }; _arg1.deselect(); } else { _selectedMembers.push(_arg1); _arg1.select(); }; } else { if (_arg1.selected){ deselectObjects(); } else { selectObjects(_members.indexOf(_arg1)); }; }; }; }; _selectedMembers.sort(selectionOrder); if (((!((selectedCollection == null))) && (!((selectedCollection == this))))){ selectedCollection.deselectObjects(); }; selectedCollection = this; setSelectionStartIndex(); if (!_isSelecting){ dispatchEvent(new Event(EVENT_SELECT)); }; } public function prevPage(_arg1:Event):void{ if (usePagingDisplay){ if (_currentPage > 1){ _currentPage--; _pageX = (0 - (_pageWidth * (_currentPage - 1))); startTween(); }; }; } protected function tween(_arg1:Event):void{ if (_deleted){ stopTween(); return; }; _childrenContainer.x = (_childrenContainer.x + ((_pageX - _childrenContainer.x) / _tweenRate)); if (Math.abs((_pageX - _childrenContainer.x)) < 1){ _childrenContainer.x = _pageX; stopTween(); }; } override public function toString():String{ var _local1:Array = []; var _local2:int; while (_local2 < _members.length) { if (CollectionItem(_members[_local2]).reference != null){ if ((CollectionItem(_members[_local2]).reference is String)){ _local1.push(CollectionItem(_members[_local2]).reference); } else { if ((CollectionItem(_members[_local2]).reference["toString"] is Function)){ _local1.push(CollectionItem(_members[_local2]).reference.toString()); }; }; }; _local2++; }; return (_local1.toString()); } public function selectObjects(_arg1:int=-1, _arg2:int=-1):void{ var _local3:Number; deselectObjects(); if (_members.length > 0){ if (_arg1 == -1){ _arg1 = 0; if (_arg2 == -1){ _arg2 = (_members.length - 1); }; }; if (_arg2 == -1){ _arg2 = _arg1; }; _local3 = _arg1; while (_local3 <= _arg2) { _selectedMembers.push(_members[_local3]); if ((_members[_local3] is CollectionItem)){ CollectionItem(_members[_local3]).select(); }; _local3++; }; }; if (((!((selectedCollection == null))) && (!((selectedCollection == this))))){ selectedCollection.deselectObjects(); }; selectedCollection = this; setSelectionStartIndex(); dispatchEvent(new Event(EVENT_SELECT)); } public function trackDraggedItem(_arg1:Event):void{ startDrag(_arg1); } public function selectMembers(_arg1:Array):void{ var _local2:Number; deselectObjects(); if (_arg1.length > 0){ _local2 = 0; while (_local2 < _arg1.length) { if (_members.indexOf(_arg1[_local2]) != -1){ _selectedMembers.push(_arg1[_local2]); CollectionItem(_arg1[_local2]).selected = true; }; _local2++; }; }; if (((!((selectedCollection == null))) && (!((selectedCollection == this))))){ selectedCollection.deselectObjects(); }; selectedCollection = this; } protected function shift(_arg1:Boolean):CollectionItem{ var _local2:CollectionItem = _members.shift(); if (_arg1 != true){ removeChild(_local2); }; arrange(); return (_local2); } protected function splice(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Boolean):Array{ var _local5:Array; var _local6:int; if (_arg1 == -1){ return (null); }; if (_arg3 == null){ _local5 = _members.splice(_arg1, _arg2); } else { _local5 = _members.splice(_arg1, _arg2, _arg3[0]); _local6 = 0; while (_local6 < _members.length) { _local6++; }; }; if (((!((_arg4 == true))) && ((_arg2 > 0)))){ _local6 = 0; while (_local6 < _local5.length) { removeChild(_local5[_local6], false); _local6++; }; }; arrange(); return (_local5); } protected function onSelectWindow(_arg1:MouseEvent):void{ selectBox.scaleX = ((mainStage.mouseX - selectBox.x) / 100); selectBox.scaleY = ((mainStage.mouseY - selectBox.y) / 100); selectBox.visible = true; selectBox.alpha = ((selectBox.alpha)==1) ? 0.75 : 1; _selectDrag = true; deselectObjects(); var _local2:Number = 0; while (_local2 < _members.length) { if (CollectionItem(_members[_local2]).clip != null){ if (selectBox.hitTestObject(CollectionItem(_members[_local2]).clip)){ selectObject(_members[_local2]); }; } else { if (selectBox.hitTestObject(CollectionItem(_members[_local2]).mc)){ selectObject(_members[_local2]); }; }; _local2++; }; } public function getItem(_arg1:Object):CollectionItem{ if ((_memberRefs[_arg1] is CollectionItem)){ return ((_memberRefs[_arg1] as CollectionItem)); }; if ((_memberRefs[_arg1] is Array)){ return (_memberRefs[_arg1][0]); }; return (null); } public function placeSelectionAt(_arg1:Number, _arg2:Boolean=false):void{ var _local3:int; var _local5:int; if (_selectedMembers.length == _members.length){ _selectedMembers.reverse(); }; var _local4:Array = []; _local3 = 0; while (_local3 < _selectedMembers.length) { _local5 = _members.indexOf(_selectedMembers[_local3]); if (_local5 < _arg1){ _arg1--; }; _local4.push(splice(_local5, 1, null, true)); _local3++; }; if (_arg1 > _members.length){ _arg1 = _members.length; }; _arg1 = Math.max(_arg1, 0); _local3 = 0; while (_local3 < _local4.length) { splice(_arg1, 0, _local4[_local3], true); _arg1++; _local3++; }; arrange(_arg2); } protected function slice(_arg1:Number, _arg2:Number):Array{ return (_members.slice(_arg1, _arg2)); } protected function addMember(_arg1:Object, _arg2:int=-1, _arg3:Boolean=false):CollectionItem{ var _local4:CollectionItem; _local4 = new CollectionItem(this, _arg1, _memberWidth, _memberHeight, _memberPosition, _style); if (itemListener != null){ _local4.addEventListener(EVENT_CREATE, itemListener); }; if (itemListener != null){ _local4.addEventListener(EVENT_CHANGE, itemListener); }; if (itemListener != null){ _local4.addEventListener(EVENT_REMOVE, itemListener); }; addChild(_local4); _local4.addEventListener(Component.EVENT_CLICK, onMemberClick); _local4.addEventListener(Component.EVENT_DRAG, startDrag); _local4.addEventListener(Component.EVENT_DROP, stopDrag); setItemReference(_arg1, _local4); _members.push(_local4); selectObject(_local4); if (_arg2 >= 0){ placeSelectionAt(_arg2, true); }; arrange(_arg3); if (usePagingDisplay){ }; dispatchEvent(new ObjectEvent(EVENT_ADD_MEMBER, false, false, _local4.reference)); return (_local4); } protected function setSelectionStartIndex():void{ _selectionIndex = ((_selectedMembers.length)>0) ? _members.indexOf(_selectedMembers[0]) : -1; } public function get masterCollection():Collection{ return (_masterCollection); } protected function unshift(_arg1:CollectionItem):uint{ var _local2:uint = _members.unshift(_arg1); addChild(_arg1); arrange(); return (_local2); } public function endTrackDraggedItem(_arg1:Event):void{ stopDrag(_arg1); } public function get selectionIndex():int{ return (_selectionIndex); } protected function restoreMembers():void{ var _local1:Object; var _local2:CollectionItem; var _local3:Array = []; var _local4:Array = []; while (clipboard.length > 0) { _local1 = clipboard.shift(); _local2 = _local1.member; _local2.deleted = false; _local4.push(_local2.reference); addChild(_local2); setItemReference(_local2.reference, _local2); _members.splice(_local1.index, 0, _local1.member); _local3.push(_local2); }; dispatchEvent(new ObjectEvent(EVENT_RESTORE, false, false, _local4)); selectMembers(_local3); arrange(); } protected function arrange(_arg1:Boolean=false):void{ var _local2:CollectionItem; var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:Graphics; var _local8:int; var _local9:int; if (useSnap){ _arg1 = true; }; _childNodes = _members.concat(); if (autoResize){ resize(); dispatchEvent(new Event(EVENT_CHANGE)); } else { if (usePagingDisplay){ _width = ((totalPages * _pageWidth) + 10); _local6 = 0; while (_local6 < _members.length) { _local2 = members[_local6]; _local3 = Math.floor((_local6 / _itemsPerPage)); _local5 = (_local6 % _itemsPerRow); _local4 = Math.floor(((_local6 % _itemsPerPage) / _itemsPerRow)); _local2.x = (((_spacing / 2) + (_pageWidth * _local3)) + ((_memberWidth + _spacing) * _local5)); _local2.y = ((_spacing / 2) + ((_memberHeight + _spacing) * _local4)); _local6++; }; _width = Position.getCellContentWidth(this); _local7 = _childrenContainer.graphics; _local7.clear(); if ((_members.length % _itemsPerPage) != 0){ _local8 = (_itemsPerPage - (_members.length % _itemsPerPage)); _local6 = _members.length; while (_local6 < (_members.length + _local8)) { _local2 = members[_local6]; _local3 = Math.floor((_local6 / _itemsPerPage)); _local5 = (_local6 % _itemsPerRow); _local4 = Math.floor(((_local6 % _itemsPerPage) / _itemsPerRow)); _local7.beginFill(_style.borderColor, 0.1); _local9 = (useBorderWidthInBlanks) ? _style.borderWidth : 0; if (!useCircularBlanks){ _local7.drawRect(((((_spacing / 2) + (_pageWidth * _local3)) + ((_memberWidth + _spacing) * _local5)) - (_local9 * itemScale)), (((_spacing / 2) + ((_memberHeight + _spacing) * _local4)) - (_local9 * itemScale)), (_memberWidth + ((_local9 * 2) * itemScale)), (_memberHeight + ((_local9 * 2) * itemScale))); } else { _local7.drawCircle((((((_memberWidth / 2) + (_spacing / 2)) + (_pageWidth * _local3)) + ((_memberWidth + _spacing) * _local5)) - (_local9 * itemScale)), ((((_memberHeight / 2) + (_spacing / 2)) + ((_memberHeight + _spacing) * _local4)) - (_local9 * itemScale)), (((_memberWidth - 4) + ((_local9 * 2) * itemScale)) / 2)); }; _local6++; }; } else { _local7.clear(); }; if (resizeScale != 1){ _mc.scaleX = (_mc.scaleY = resizeScale); }; } else { Position.arrangeContent(this, true); }; for each (_local2 in _members) { if (useRotateEffectOnDrag){ _local2.rotation = 0; }; if (_arg1){ _local2.snapToPosition(); }; }; if (!_wrap){ _rowLength = _members.length; _width = Position.getCellContentWidth(this); }; if (_collapse){ _height = Position.getCellContentHeight(this); }; if (_selectedMembers.length > 0){ checkSelectionVisibility(_selectedMembers[0]); } else { dispatchEvent(new Event(EVENT_CHANGE)); }; }; dispatchEvent(new Event(EVENT_LIST_CHANGE)); } protected function sort(_arg1:Object, _arg2:Number):Array{ var _local3:Array = _members.sort(_arg1, _arg2); arrange(); return (_local3); } public function get currentPage():int{ return (_currentPage); } protected function drawPlacementMarker():void{ var _local1:Graphics; var _local2:int; var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:Point; var _local8:Point; if ((((((((_mc.mouseX > -10)) && ((_mc.mouseX < (width - 10))))) && ((_mc.mouseY > -10)))) && (((_mc.mouseY - 10) < height)))){ destCollection = this; markerContainer.x = _childrenContainer.x; markerContainer.y = _childrenContainer.y; _local1 = markerContainer.graphics; _local1.clear(); if (_members.length <= 1){ return; }; _local1.beginFill(_style.linkColor, 1); _local2 = getIndexFromPosition(_childrenContainer.mouseX, _childrenContainer.mouseY); _local3 = 0; _local4 = 0; if (autoResize){ _local3 = (((_memberWidth + _spacing) * (_local2 % _rowLength)) - (((_totalWidth / 2) + (_memberWidth / 2)) + (_spacing / 2))); _local4 = (((_memberHeight + _spacing) * Math.floor((_local2 / _rowLength))) - (((_totalHeight / 2) + (_memberHeight / 2)) + _spacing)); } else { if (_wrap){ _local3 = (((_local2 % _rowLength) * (_memberWidth + (_spacing * 2))) - 1); _local4 = (Math.floor((_local2 / _rowLength)) * (_memberHeight + (_spacing * 2))); } else { _local3 = ((_local2 * (_memberWidth + (_spacing * 2))) - 1); }; }; if (((autoResize) || (_wrap))){ if (_local4 > ((_local2 % _rowLength) * (_memberWidth + (_spacing * 2)))){ _local3 = (_local3 + (_rowLength * (_memberWidth + _spacing))); _local4 = (_local4 - (_memberHeight + _spacing)); } else { if (((((_local2 % _rowLength) == 0)) && ((_local2 > 0)))){ _local5 = (_local3 + (_rowLength * (_memberWidth + _spacing))); _local6 = ((_local4 - _memberHeight) - _spacing); _local7 = new Point((_local3 - _childrenContainer.mouseX), (_local4 - _childrenContainer.mouseY)); _local8 = new Point((_local5 - _childrenContainer.mouseX), (_local6 - _childrenContainer.mouseY)); if (Math.abs(_local7.length) > Math.abs(_local8.length)){ _local3 = _local5; _local4 = _local6; }; }; }; }; if ((((_rowLength == 1)) && (_wrap))){ _local1.drawRect((_local3 + _spacing), _local4, _memberWidth, 2); } else { _local1.drawRect(_local3, (_local4 + _spacing), 2, _memberHeight); }; destIndex = _local2; } else { if (destCollection == this){ destCollection = null; _childrenContainer.graphics.clear(); }; }; } protected function onMemberClick(_arg1:Event):void{ var _local2:CollectionItem = CollectionItem(_arg1.target); selectObject(_local2); } public function checkSelectionVisibility(_arg1:CollectionItem):void{ var _local2:int; var _local3:Number; var _local4:Number; if (ignoreVisibility){ return; }; if (_members.indexOf(_arg1) >= 0){ if (usePagingDisplay){ _local2 = Math.floor((_members.indexOf(_arg1) / _itemsPerPage)); gotoPage(_local2); } else { if (_wrap){ _local3 = Position.getCellContentHeight(this); _parentCell.contentY = (((0 - _arg1.y) + (_height / 2)) - (_memberHeight / 2)); } else { _local4 = Position.getCellContentWidth(this); if (_arg1.x > (((0 - _parentCell.contentX) + _startWidth) - _memberWidth)){ _parentCell.contentX = ((((0 - _arg1.x) + _startWidth) - _memberWidth) - _spacing); } else { if (_arg1.x < (0 - _parentCell.contentX)){ _parentCell.contentX = ((0 - _arg1.x) + _spacing); }; }; }; }; }; dispatchEvent(new Event(EVENT_CHANGE)); } protected function onSelectWindowStart(_arg1:MouseEvent):void{ if (!allowMultiSelect){ return; }; membersMouseEnabled = false; Component.mainStage.addEventListener(MouseEvent.MOUSE_UP, onSelectWindowStop); Component.mainStage.addEventListener(MouseEvent.MOUSE_MOVE, onSelectWindow); selectBox.x = mainStage.mouseX; selectBox.y = mainStage.mouseY; selectBox.visible = true; _isSelecting = true; _selectDrag = false; onSelectWindow(_arg1); } protected function resize():void{ var _local1:int; var _local2:Number; var _local3:CollectionItem; if (_members.length == 0){ return; }; _rowLength = _members.length; if (_members.length > 3){ _local2 = Math.round(((Math.sqrt(_members.length) * _width) / _height)); if (((((((_width / _height) > 0.7)) && (((_width / _height) < 1.3)))) && (((Math.sqrt(_members.length) % 1) == 0)))){ _local2 = Math.sqrt(_members.length); }; _rowLength = _local2; }; _totalWidth = ((_memberWidth + _spacing) * (_rowLength - 1)); _totalHeight = 0; if (_rowLength > 0){ _totalHeight = ((_memberHeight + _spacing) * (Math.ceil((_members.length / _rowLength)) - 1)); }; _local1 = 0; while (_local1 < _members.length) { _local3 = _members[_local1]; if (!_local3.deleted){ _local3.x = ((((_memberWidth + _spacing) * (_local1 % _rowLength)) - (_totalWidth / 2)) - (_memberWidth / 2)); _local3.y = ((((_memberHeight + _spacing) * Math.floor((_local1 / _rowLength))) - (_totalHeight / 2)) - (_memberHeight / 2)); _local3.rotation = 0; if (((!((_local3.mc == null))) && (!((_local3.mc.parent == null))))){ _local3.mc.parent.setChildIndex(_local3.mc, Math.min(_local1, (_local3.mc.parent.numChildren - 1))); }; }; _local1++; }; _childrenContainer.x = (_startWidth / 2); _childrenContainer.y = (_startHeight / 2); _newScale = Math.min(1, Math.min((((_width - _memberWidth) - (_spacing * 2)) / _totalWidth), (((_height - _memberHeight) - (_spacing * 2)) / _totalHeight))); _newScale = (_newScale * resizeScale); if (!_rescaling){ Component.mainStage.addEventListener(Event.ENTER_FRAME, zoom); }; } protected function startDrag(_arg1:Event):void{ var _local2:Point; var _local3:CollectionItem; var _local4:int; var _local5:Matrix; var _local6:Rectangle; if (_isDragging){ return; }; if (sourceCollection == this){ dispatchEvent(new Event(EVENT_DRAG)); } else { deselectObjects(); }; destCollection = null; mainStage.addEventListener(MouseEvent.MOUSE_MOVE, dragFollow, false, 0, true); if (allowRearrange){ mainStage.addEventListener(Event.ENTER_FRAME, checkHover, false, 0, true); }; _isDragging = true; _mouseXold = _mc.mouseX; _mouseYold = _mc.mouseY; membersMouseEnabled = false; if (sourceCollection == this){ if (((allowRemoveOnDrag) || (useRotateEffectOnDrag))){ if (mainStage.getChildIndex(dragContainer) < (mainStage.numChildren - 1)){ mainStage.setChildIndex(dragContainer, (mainStage.numChildren - 1)); }; _local2 = new Point(0, 0); _local2 = _childrenContainer.localToGlobal(_local2); dragContainer.x = _local2.x; dragContainer.y = _local2.y; dragContainer.scaleX = _childrenContainer.scaleX; dragContainer.scaleY = _childrenContainer.scaleY; _local4 = (_selectedMembers.length - 1); while (_local4 >= 0) { _local3 = _selectedMembers[_local4]; if (useRotateEffectOnDrag){ _local3.rotation = (10 - (Math.random() * 20)); }; dragContainer.addChild(_local3.mc); _local3.isDragging = true; _local4--; }; } else { for each (_local3 in _members) { _local3.hide(); }; for each (_local3 in _selectedMembers) { _local3.show(); }; if (((!((dragGhostSnapshot == null))) && (!((dragGhostSnapshot.bitmapData == null))))){ dragGhostSnapshot.bitmapData.dispose(); }; dragGhostSnapshot.bitmapData = new BitmapData(Math.min(mainStage.stageWidth, _width), Math.min(mainStage.stageHeight, _height), true, 0); _local2 = new Point(0, 0); _local2 = _mc.globalToLocal(_local2); _local2.x = Math.max(0, _local2.x); _local2.y = Math.max(0, _local2.y); _local5 = new Matrix(1, 0, 0, 1, (0 - _local2.x), (0 - _local2.y)); _local6 = new Rectangle(0, 0, Math.min(mainStage.stageWidth, _width), Math.min(mainStage.stageHeight, _height)); dragGhostSnapshot.bitmapData.draw(_mc, _local5, new ColorTransform(), null, _local6); dragGhost.visible = true; dragGhost.alpha = 0.5; dragGhost.x = dragContainer.mouseX; dragGhost.y = dragContainer.mouseY; dragGhostSnapshot.x = ((0 - _mc.mouseX) + _local2.x); dragGhostSnapshot.y = ((0 - _mc.mouseY) + _local2.y); for each (_local3 in _members) { _local3.show(); }; }; }; } protected function onMasterAdd(_arg1:ObjectEvent):void{ if (getItem(_arg1.object) == null){ addMembers([_arg1.object]); }; } public function deselectObjects(_arg1:int=-1, _arg2:int=-1):void{ var _local3:Number; if (!allowDelete){ return; }; if (_selectedMembers.length > 0){ if (_arg1 == -1){ _arg1 = 0; if (_arg2 == -1){ _arg2 = (_selectedMembers.length - 1); }; }; if (_arg2 == -1){ _arg2 = _arg1; }; _local3 = _arg1; while (_local3 <= _arg2) { if ((_selectedMembers[_local3] is CollectionItem)){ CollectionItem(_selectedMembers[_local3]).deselect(); }; _local3++; }; _selectedMembers.splice(_arg1, ((_arg2 + 1) - _arg1)); }; setSelectionStartIndex(); dispatchEvent(new Event(EVENT_SELECT)); } protected function onKeyDown(_arg1:KeyboardEvent):void{ var _local2:CollectionItem; if (!allowKeyboardEvents){ return; }; if ((((((_arg1.charCode == 97)) && (_arg1.ctrlKey))) && (allowMultiSelect))){ selectObjects(); }; if ((((_arg1.charCode == 100)) && (_arg1.ctrlKey))){ deselectObjects(); }; if (_selectedMembers.length > 0){ if (_arg1.keyCode == Keyboard.SPACE){ if (CollectionItem(_selectedMembers[0]).activateCallback != null){ CollectionItem(_selectedMembers[0]).activateCallback(); }; }; if (allowRearrange){ if (_arg1.keyCode == Keyboard.RIGHT){ if (_arg1.shiftKey){ placeSelectionAt(_members.length); } else { placeSelectionAt((_members.indexOf(_selectedMembers[(_selectedMembers.length - 1)]) + 2)); }; }; if (_arg1.keyCode == Keyboard.LEFT){ if (_arg1.shiftKey){ placeSelectionAt(0); } else { placeSelectionAt((_members.indexOf(_selectedMembers[0]) - 1)); }; }; if (_arg1.keyCode == Keyboard.UP){ if (_arg1.shiftKey){ placeSelectionAt(0); } else { placeSelectionAt((_members.indexOf(_selectedMembers[0]) - _rowLength)); }; }; if (_arg1.keyCode == Keyboard.DOWN){ if (_arg1.shiftKey){ placeSelectionAt(_members.length); } else { placeSelectionAt(((_members.indexOf(_selectedMembers[(_selectedMembers.length - 1)]) + _rowLength) + 1)); }; }; } else { if (_arg1.keyCode == Keyboard.RIGHT){ if (_members.indexOf(_selectedMembers[0]) < (_members.length - 1)){ _local2 = _members[Math.min((_members.length - 1), (_members.indexOf(_selectedMembers[0]) + 1))]; }; }; if (_arg1.keyCode == Keyboard.LEFT){ if (_members.indexOf(_selectedMembers[0]) > 0){ _local2 = _members[Math.max(0, (_members.indexOf(_selectedMembers[0]) - 1))]; }; }; if (_arg1.keyCode == Keyboard.UP){ _local2 = _members[Math.max(0, (_members.indexOf(_selectedMembers[0]) - _rowLength))]; }; if (_arg1.keyCode == Keyboard.DOWN){ _local2 = _members[Math.min((_members.length - 1), (_members.indexOf(_selectedMembers[0]) + _rowLength))]; }; if (((!((_local2 == null))) && (!((_local2 == _selectedMembers[0]))))){ selectObject(_local2); if (_local2.selectCallback != null){ _local2.selectCallback(); }; }; }; }; } public function gotoPage(_arg1:int):void{ if (usePagingDisplay){ if ((((_arg1 > 0)) && ((_arg1 <= totalPages)))){ _currentPage = _arg1; _pageX = (0 - (_pageWidth * (_arg1 - 1))); startTween(); }; }; } protected function stopTween():void{ mainStage.removeEventListener(Event.ENTER_FRAME, tween); _isTweening = false; } protected function zoom(_arg1:Event):void{ var _local2:Sprite = _childrenContainer; _local2.scaleX = (_local2.scaleX + ((_newScale - _local2.scaleX) / 3)); _local2.scaleY = (_local2.scaleY + ((_newScale - _local2.scaleY) / 3)); if (Math.abs((_newScale - _local2.scaleX)) < 1){ _local2.scaleX = (_local2.scaleY = _newScale); Component.mainStage.removeEventListener(Event.ENTER_FRAME, zoom); _rescaling = false; }; dragContainer.scaleX = (markerContainer.scaleX = _local2.scaleX); dragContainer.scaleY = (markerContainer.scaleY = _local2.scaleY); } override public function get contentWidth():Number{ return ((super.contentWidth + _spacing)); } override public function get width():uint{ if (_width == 0){ return (_mc.width); }; return (Math.max(_startWidth, (_width + _spacing))); } protected function saveMembers(_arg1:Array):void{ var _local2:CollectionItem; clipboard = []; for each (_local2 in _arg1) { if (_members.indexOf(_local2) >= 0){ clipboard.unshift({member:_local2, index:_members.indexOf(_local2)}); }; }; clipboard.sortOn("index"); } public function get totalPages():int{ return (Math.ceil((_members.length / _itemsPerPage))); } public function deleteSelectedObjects():void{ var _local1:Array = []; var _local2:int; while (_local2 < _selectedMembers.length) { _local1.push(CollectionItem(_selectedMembers[_local2]).reference); _local2++; }; removeMembers(_selectedMembers.concat()); _selectedMembers = []; dispatchEvent(new ObjectEvent(EVENT_DELETE, false, false, _local1)); dispatchEvent(new Event(EVENT_LIST_CHANGE)); setSelectionStartIndex(); dispatchEvent(new Event(EVENT_SELECT)); } protected function onKeyUp(_arg1:KeyboardEvent):void{ if (((!(allowRearrange)) || (!(allowKeyboardEvents)))){ return; }; if (_selectedMembers.length > 0){ if (_arg1.keyCode == Keyboard.BACKSPACE){ _selectedMembers.reverse(); placeSelectionAt((_members.indexOf(_selectedMembers[(_selectedMembers.length - 1)]) + 1)); }; if (_arg1.keyCode == Keyboard.DELETE){ deleteSelectedObjects(); mainStage.focus = this.mc; }; }; if (((!((clipboard == null))) && ((clipboard.length > 0)))){ if ((((_arg1.charCode == 122)) && (_arg1.ctrlKey))){ restoreMembers(); }; }; } protected function onMasterClear(_arg1:Event):void{ clear(); } public function removeMembers(_arg1:Array):void{ var _local2:int; var _local3:CollectionItem; var _local4:Array; deselectObjects(); saveMembers(_arg1); _local2 = (_arg1.length - 1); while (_local2 >= 0) { if ((_arg1[_local2] is CollectionItem)){ CollectionItem(_arg1[_local2]).deleted = true; }; removeChild(CollectionItem(_arg1[_local2]), false); if ((_memberRefs[CollectionItem(_arg1[_local2]).reference] is CollectionItem)){ _memberRefs[CollectionItem(_arg1[_local2]).reference] = null; } else { if ((_memberRefs[CollectionItem(_arg1[_local2]).reference] is Array)){ _local4 = (_memberRefs[CollectionItem(_arg1[_local2]).reference] as Array); if (_local4.indexOf(_arg1[_local2]) != -1){ _local4.splice(_local4.indexOf(_arg1[_local2]), 1); }; if (_local4.length == 0){ _memberRefs[CollectionItem(_arg1[_local2]).reference] = null; } else { if (_local4.length == 1){ _memberRefs[CollectionItem(_arg1[_local2]).reference] = _local4[0]; }; }; }; }; _local2--; }; _local2 = (_arg1.length - 1); while (_local2 >= 0) { _local3 = _arg1[_local2]; splice(_members.indexOf(_local3), 1, null, false); _local3.deleted = true; _local2--; }; } protected function reverse():void{ _members.reverse(); arrange(); } override public function create():void{ var _local1:Graphics; super.create(); _startWidth = _width; _startHeight = _height; if (selectBox == null){ selectBox = new Sprite(); selectBox.visible = false; _local1 = selectBox.graphics; _local1.lineStyle(1, _style.highlightTextColor, 1, true, LineScaleMode.NONE); _local1.beginFill(_style.highlightTextColor, 0.25); _local1.drawRect(0, 0, 100, 100); Component.mainStage.addChild(selectBox); }; if (dragContainer == null){ dragContainer = new Sprite(); dragContainer.name = "_collection_dragcontainer"; Component.mainStage.addChild(dragContainer); dragGhost = new Sprite(); dragContainer.addChild(dragGhost); dragGhostSnapshot = new Bitmap(); dragGhost.addChild(dragGhostSnapshot); }; _backgroundButton = new Sprite(); _backgroundButton.graphics.beginFill(0, 0); _backgroundButton.graphics.drawRect(0, 0, _width, _height); _backgroundButton.addEventListener(MouseEvent.MOUSE_DOWN, onSelectWindowStart); _mc.addChild(_backgroundButton); _mc.setChildIndex(_backgroundButton, 0); markerContainer = new Sprite(); _mc.addChild(markerContainer); _bkgd.mouseEnabled = false; } public function get selectedMembers():Array{ return (_selectedMembers); } } }//package com.slideroll.ui
Section 25
//CollectionItem (com.slideroll.ui.CollectionItem) package com.slideroll.ui { import flash.display.*; import flash.events.*; public class CollectionItem extends Cell { protected var _isTweening:Boolean;// = false protected var _justSelected:Boolean;// = false protected var _oldr:Number;// = 0 protected var _oldx:Number;// = 0 protected var _oldz:Number;// = 0 protected var _pressY:Number;// = 0 protected var _oldy:Number;// = 0 protected var _pressX:Number;// = 0 protected var _clipContainer:Container; protected var _newr:Number;// = 0 protected var _highlight:Sprite; protected var _newx:Number;// = 0 protected var _newz:Number;// = 0 protected var _collection:Collection; protected var _isDragging:Boolean;// = false public var idx:int;// = 0 protected var _dragx:Number;// = 0 protected var _dragy:Number;// = 0 protected var _newy:Number;// = 0 protected var _reference:Object; protected var _backing:Sprite; public var activateCallback:Function; public var selectCallback:Function; protected var _tweenRate:Number;// = 3 private var _alt:String;// = "" protected var _selected:Boolean;// = false protected var _altTimes:int;// = 0 public function CollectionItem(_arg1:Collection, _arg2:Object, _arg3:Number, _arg4:Number, _arg5:Position=null, _arg6:Style=null){ init_CollectionItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6); if (_container != null){ create(); }; } override public function set y(_arg1:Number):void{ if (!_deleted){ _oldy = _mc.y; _newy = _arg1; startTween(); }; } override public function set rotation(_arg1:Number):void{ if (!_deleted){ _oldr = _mc.rotation; _newr = _arg1; startTween(); }; } override public function get x():Number{ return ((((_isDragging) && (_collection.allowRemoveOnDrag))) ? _dragx : _newx); } override protected function onRollOver(_arg1:MouseEvent=null):void{ super.onRollOver(_arg1); _altTimes++; if (((!(selected)) && (!((_highlight == null))))){ _highlight.alpha = 0.4; }; if ((((_alt.length > 0)) && ((_altTimes <= 7)))){ Tagtip.showTag(_alt); }; } override public function create():void{ super.create(); _clipContainer = new Container(null); addChild(_clipContainer); var _local1:Style = _style.clone(); _local1.border = false; _local1.background = false; _local1.round = 0; _backing = new Sprite(); DrawingMethods.rect(_backing, true, 0, 0, _width, _height, 0xFFFFFF, 0.2); connectButton(_backing, true); _mc.addChild(_backing); if (_collection.showHighlight){ _highlight = new Sprite(); DrawingMethods.emptyRect(_highlight, true, 0, 0, _width, _height, Math.max(2, Math.floor((_style.borderWidth / 2))), (_collection.useBorderColorOnHighlight) ? _style.borderColor : _style.highlightTextColor, 0.5); _highlight.alpha = 0; _highlight.mouseEnabled = false; _mc.addChild(_highlight); }; dispatchEvent(new Event(EVENT_CREATE)); } public function set reference(_arg1:Object):void{ _reference = _arg1; } public function get isDragging():Boolean{ return (_isDragging); } protected function onItemClick(_arg1:Event):void{ dispatchEvent(new Event(EVENT_CLICK)); } public function get collection():Collection{ return (_collection); } public function select():void{ selected = true; if (_highlight != null){ _highlight.alpha = 1; }; active = true; if (selectCallback != null){ selectCallback.call(); }; _tweenRate = 1.5; } public function set clip(_arg1:DisplayObject):void{ var obj = _arg1; _clipContainer.clip = obj; if (_clipContainer.clip != null){ try { if ((_clipContainer.clip["btn"] is SimpleButton)){ connectSimpleButton(_clipContainer.clip["btn"], true, true); if (_backing != null){ _backing.parent.removeChild(_backing); _backing = null; }; }; if (_clipContainer.clip["highlight"] != null){ if (((!((_highlight == null))) && (!((_highlight.parent == null))))){ _highlight.parent.removeChild(_highlight); }; _highlight = _clipContainer.clip["highlight"]; _highlight.alpha = 0; }; } catch(e:Error) { if ((_clipContainer.clip is Sprite)){ Sprite(_clipContainer.clip).mouseEnabled = false; Sprite(_clipContainer.clip).mouseChildren = false; }; }; }; if (_clipContainer.clip.width < _width){ _clipContainer.clip.x = Math.floor(((_width - _clipContainer.clip.width) / 2)); }; if (_clipContainer.clip.height < _height){ _clipContainer.clip.y = Math.floor(((_height - _clipContainer.clip.height) / 2)); }; } public function get alt():String{ return (_alt); } public function moveTo(_arg1:Number, _arg2:Number):void{ x = _arg1; y = _arg2; } protected function init_CollectionItem(_arg1:Collection, _arg2:Object, _arg3:Number, _arg4:Number, _arg5:Position=null, _arg6:Style=null):void{ super.init_Cell(null, _arg3, _arg4, false, false, 0, _arg5, _arg6); _collection = _arg1; _reference = _arg2; _width = (isNaN(_arg3)) ? clip.width : _arg3; _height = (isNaN(_arg4)) ? clip.height : _arg4; _type = "collectionitem"; } public function snapToPosition():void{ _mc.x = _newx; _mc.y = _newy; _mc.rotation = _newr; } override protected function onRelease(_arg1:MouseEvent=null):void{ mainStage.removeEventListener(MouseEvent.MOUSE_MOVE, onDrag); mainStage.removeEventListener(MouseEvent.MOUSE_UP, onRelease); if (!deleted){ if (((!(_isDragging)) && (!(_justSelected)))){ _collection.selectObject(this); }; _justSelected = false; }; if (_isDragging){ if (_collection.allowRemoveOnDrag){ _mc.stopDrag(); }; _isDragging = false; dispatchEvent(new Event(EVENT_DROP)); dispatchEvent(new Event(EVENT_CHANGE)); }; dispatchEvent(new Event(EVENT_RELEASE)); } public function set isDragging(_arg1:Boolean):void{ _isDragging = _arg1; if (_isDragging){ _dragx = _mc.x; _dragy = _mc.y; }; } public function get selected():Boolean{ return (_selected); } public function set selected(_arg1:Boolean):void{ _selected = _arg1; updateClip(); } override protected function onPress(_arg1:MouseEvent=null):void{ _pressX = _mc.mouseX; _pressY = _mc.mouseY; if (((!(deleted)) && (!(selected)))){ _collection.selectObject(this); _justSelected = true; }; _mc.focusRect = false; mainStage.focus = _mc; mainStage.addEventListener(MouseEvent.MOUSE_MOVE, onDrag, false, 0, true); mainStage.addEventListener(MouseEvent.MOUSE_UP, onRelease, false, 0, true); } protected function updateClip():void{ if (_highlight != null){ _highlight.alpha = (selected) ? 1 : 0; }; } protected function startTween():void{ if (!_isTweening){ mainStage.addEventListener(Event.ENTER_FRAME, tween); _isTweening = true; }; } override protected function onRollOut(_arg1:MouseEvent=null):void{ super.onRollOut(_arg1); if (((!(selected)) && (!((_highlight == null))))){ _highlight.alpha = 0; }; Tagtip.hideTag(); } public function get reference():Object{ return (_reference); } protected function stopTween():void{ mainStage.removeEventListener(Event.ENTER_FRAME, tween); _isTweening = false; } public function get clip():DisplayObject{ return (_clipContainer.clip); } public function set alt(_arg1:String):void{ _alt = _arg1; } public function deselect():void{ selected = false; if (_highlight != null){ _highlight.alpha = 0; }; active = false; _tweenRate = 3; } protected function onDrag(_arg1:Event):void{ if (_collection.allowDrag){ if ((((Math.abs((_mc.mouseX - _pressX)) > 10)) || ((Math.abs((_mc.mouseY - _pressY)) > 10)))){ mainStage.removeEventListener(MouseEvent.MOUSE_MOVE, onDrag); Collection.sourceCollection = _collection; dispatchEvent(new Event(EVENT_DRAG)); _isDragging = true; if (_collection.allowRemoveOnDrag){ _mc.startDrag(); }; }; }; } protected function tween(_arg1:Event):void{ if (_deleted){ stopTween(); return; }; _mc.x = (_mc.x + ((_newx - _mc.x) / _tweenRate)); _mc.y = (_mc.y + ((_newy - _mc.y) / _tweenRate)); _mc.rotation = (_mc.rotation + ((_newr - _mc.rotation) / _tweenRate)); if ((((Math.abs((_newx - _mc.x)) < 1)) && ((Math.abs((_newy - _mc.y)) < 1)))){ _mc.x = _newx; _mc.y = _newy; _mc.rotation = _newr; stopTween(); }; } override public function get y():Number{ return ((((_isDragging) && (_collection.allowRemoveOnDrag))) ? _dragy : _newy); } override public function get rotation():Number{ return (_newr); } override public function set x(_arg1:Number):void{ if (!_deleted){ _oldx = _mc.x; _newx = _arg1; startTween(); }; } } }//package com.slideroll.ui
Section 26
//ColorTools (com.slideroll.ui.ColorTools) package com.slideroll.ui { import flash.display.*; import flash.geom.*; public class ColorTools { public static function getGreenOffset(_arg1:Number, _arg2:Number):Number{ var _local3:Number = getGreenComponent(_arg1); return ((_local3 * _arg2)); } private static function interpolate(_arg1:Number, _arg2:Number, _arg3:Number):Number{ return (Math.min(1, Math.max(0, (_arg1 + ((_arg2 - _arg1) * _arg3))))); } public static function getHue(_arg1:Number):Number{ var _local2:Number = getRedComponent(_arg1); var _local3:Number = getGreenComponent(_arg1); var _local4:Number = getBlueComponent(_arg1); return (rgb2hsv(_local2, _local3, _local4).h); } public static function getBlueOffset(_arg1:Number, _arg2:Number):Number{ var _local3:Number = getBlueComponent(_arg1); return ((_local3 * _arg2)); } public static function getSaturatedColor(_arg1:Number, _arg2:Number):Number{ _arg2 = (_arg2 / 100); var _local3:Number = (getRedComponent(_arg1) / 0xFF); var _local4:Number = (getGreenComponent(_arg1) / 0xFF); var _local5:Number = (getBlueComponent(_arg1) / 0xFF); var _local6:Number = (interpolate(0.5, _local3, _arg2) * 0xFF); var _local7:Number = (interpolate(0.5, _local4, _arg2) * 0xFF); var _local8:Number = (interpolate(0.5, _local5, _arg2) * 0xFF); return ((((_local6 << 16) | (_local7 << 8)) | _local8)); } public static function getDesaturatedColor(_arg1:Number):Number{ var _local2:Number = (getRedComponent(_arg1) / 0xFF); var _local3:Number = (getGreenComponent(_arg1) / 0xFF); var _local4:Number = (getBlueComponent(_arg1) / 0xFF); var _local5:Number = (((_local2 + _local3) + (_local4 / 3)) * 0xFF); return ((((_local5 << 16) | (_local5 << 8)) | _local5)); } public static function getBrightness(_arg1:Number):Number{ var _local2:Number = getRedComponent(_arg1); var _local3:Number = getGreenComponent(_arg1); var _local4:Number = getBlueComponent(_arg1); return (Math.floor((((_local2 + _local3) + _local4) / 3))); } public static function getSaturation(_arg1:Number):Number{ var _local2:Number = getRedComponent(_arg1); var _local3:Number = getGreenComponent(_arg1); var _local4:Number = getBlueComponent(_arg1); return (rgb2hsv(_local2, _local3, _local4).s); } public static function getInverseColor(_arg1:Number):Number{ var _local2:Number = getRedComponent(_arg1); var _local3:Number = getGreenComponent(_arg1); var _local4:Number = getBlueComponent(_arg1); return (((((0xFF - _local2) << 16) | ((0xFF - _local3) << 8)) | (0xFF - _local4))); } public static function hex2hsv(_arg1:Number):Object{ var _local2:Object = hex2rgb(_arg1); return (rgb2hsv(_local2.r, _local2.g, _local2.b)); } public static function getBlueComponent(_arg1:Number):Number{ return ((_arg1 & 0xFF)); } public static function getRedOffset(_arg1:Number, _arg2:Number):Number{ var _local3:Number = getRedComponent(_arg1); return ((_local3 * _arg2)); } public static function setColorValue(_arg1:Number, _arg2:int=50):Number{ var _local3:Number = getRedComponent(_arg1); var _local4:Number = getGreenComponent(_arg1); var _local5:Number = getBlueComponent(_arg1); var _local6:Object = rgb2hsv(_local3, _local4, _local5); var _local7:Object = hsv2rgb(_local6.h, _local6.s, _arg2); return ((((_local7.r << 16) | (_local7.g << 8)) | _local7.b)); } public static function numberToHTMLColor(_arg1:Number):String{ var _local2:String = _arg1.toString(16); while (_local2.length < 6) { _local2 = ("0" + _local2); }; return (("#" + _local2)); } public static function applyColor(_arg1:DisplayObject, _arg2:Number):void{ var _local3:ColorTransform; if (_arg1 != null){ _local3 = new ColorTransform(); _local3.color = _arg2; _arg1.transform.colorTransform = _local3; }; } public static function getRedComponent(_arg1:Number):Number{ return ((_arg1 >> 16)); } public static function hsv2rgb(_arg1:Number, _arg2:Number, _arg3:Number):Object{ var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; _arg1 = (_arg1 % 360); if (_arg3 == 0){ return ({r:0, g:0, b:0}); }; _arg2 = (_arg2 / 100); _arg3 = (_arg3 / 100); _arg1 = (_arg1 / 60); _local7 = Math.floor(_arg1); _local8 = (_arg1 - _local7); _local9 = (_arg3 * (1 - _arg2)); _local10 = (_arg3 * (1 - (_arg2 * _local8))); _local11 = (_arg3 * (1 - (_arg2 * (1 - _local8)))); if (_local7 == 0){ _local4 = _arg3; _local5 = _local11; _local6 = _local9; } else { if (_local7 == 1){ _local4 = _local10; _local5 = _arg3; _local6 = _local9; } else { if (_local7 == 2){ _local4 = _local9; _local5 = _arg3; _local6 = _local11; } else { if (_local7 == 3){ _local4 = _local9; _local5 = _local10; _local6 = _arg3; } else { if (_local7 == 4){ _local4 = _local11; _local5 = _local9; _local6 = _arg3; } else { if (_local7 == 5){ _local4 = _arg3; _local5 = _local9; _local6 = _local10; }; }; }; }; }; }; _local4 = Math.floor((_local4 * 0xFF)); _local5 = Math.floor((_local5 * 0xFF)); _local6 = Math.floor((_local6 * 0xFF)); return ({r:_local4, g:_local5, b:_local6}); } public static function rgb2hsv(_arg1:Number, _arg2:Number, _arg3:Number):Object{ var _local4:Number; var _local5:Number; var _local6:int; var _local7:Number; var _local8:Number; var _local9:Number; _arg1 = (_arg1 / 0xFF); _arg2 = (_arg2 / 0xFF); _arg3 = (_arg3 / 0xFF); _local4 = Math.min(Math.min(_arg1, _arg2), _arg3); _local9 = Math.max(Math.max(_arg1, _arg2), _arg3); if (_local4 == _local9){ return ({h:0, s:0, v:(_local9 * 100)}); }; _local5 = ((_arg1)==_local4) ? (_arg2 - _arg3) : ((_arg2)==_local4) ? (_arg3 - _arg1) : (_arg1 - _arg2); _local6 = ((_arg1)==_local4) ? 3 : ((_arg2)==_local4) ? 5 : 1; _local7 = (Math.floor(((_local6 - (_local5 / (_local9 - _local4))) * 60)) % 360); _local8 = Math.floor((((_local9 - _local4) / _local9) * 100)); _local9 = Math.floor((_local9 * 100)); return ({h:_local7, s:_local8, v:_local9}); } public static function getGreenComponent(_arg1:Number):Number{ return (((_arg1 >> 8) & 0xFF)); } public static function getTintedColor(_arg1:Number, _arg2:Number, _arg3:Number):Number{ var _local4:Number = getRedComponent(_arg1); var _local5:Number = getGreenComponent(_arg1); var _local6:Number = getBlueComponent(_arg1); var _local7:Number = getRedComponent(_arg2); var _local8:Number = getGreenComponent(_arg2); var _local9:Number = getBlueComponent(_arg2); return (((((_local4 + ((_local7 - _local4) * _arg3)) << 16) | ((_local5 + ((_local8 - _local5) * _arg3)) << 8)) | (_local6 + ((_local9 - _local6) * _arg3)))); } public static function hsv2hex(_arg1:Number, _arg2:Number, _arg3:Number):Number{ var _local4:Object = hsv2rgb(_arg1, _arg2, _arg3); return (rgb2hex(_local4.r, _local4.g, _local4.b)); } public static function rgb2hex(_arg1:Number, _arg2:Number, _arg3:Number):Number{ return ((((_arg1 << 16) | (_arg2 << 8)) | _arg3)); } public static function getValue(_arg1:Number):Number{ var _local2:Number = getRedComponent(_arg1); var _local3:Number = getGreenComponent(_arg1); var _local4:Number = getBlueComponent(_arg1); return (rgb2hsv(_local2, _local3, _local4).v); } public static function HTMLColorToNumber(_arg1:String):Number{ return (parseInt(("0x" + _arg1.split("#").join("").split("0x").join("")), 16)); } public static function hex2rgb(_arg1:Number):Object{ var _local2 = (_arg1 >> 16); var _local3:int = (_arg1 - (_local2 << 16)); var _local4 = (_local3 >> 8); var _local5:int = (_local3 - (_local4 << 8)); return ({r:_local2, g:_local4, b:_local5}); } } }//package com.slideroll.ui
Section 27
//Component (com.slideroll.ui.Component) package com.slideroll.ui { import flash.display.*; import flash.events.*; import flash.text.*; public class Component extends EventDispatcher implements IComponent { protected var _container:Sprite; protected var _draggable:Boolean; protected var _enabled:Boolean;// = true protected var _type:String;// = "comp" protected var _active:Boolean;// = true protected var _mc:Sprite; public var arranged:Boolean;// = false protected var _height:Number;// = 0 protected var _value:String; public var name:String;// = "" protected var _position:Position; protected var _form:Object; protected var _targetProperty:String; protected var _created:Boolean;// = false protected var _target:Component; protected var _style:Style; protected var _id:int;// = 0 protected var _width:Number;// = 0 protected var _targetEvent:String; protected var _parentCell:Cell; protected var _deleted:Boolean;// = false public static const EVENT_ROLLOUT:String = "event_rollout"; public static const EVENT_HOVER_END:String = "event_hover_end"; public static const EVENT_DROP:String = "event_drop"; public static const EVENT_CHANGE:String = "event_change"; public static const EVENT_DRAG:String = "event_drag"; public static const EVENT_HOVER_START:String = "event_hover_start"; public static const EVENT_BLUR:String = "event_blur"; public static const EVENT_DESTROY:String = "event_destroy"; public static const EVENT_PRESS:String = "event_press"; public static const EVENT_CLICK:String = "event_click"; public static const EVENT_RELEASE:String = "event_release"; public static const EVENT_CREATE:String = "event_create"; public static const EVENT_FOCUS:String = "event_focus"; public static const EVENT_REMOVE:String = "event_remove"; public static const EVENT_ROLLOVER:String = "event_rollover"; public static var mainStage:Stage; public static var globalStyle:Style; protected static var _nextID:int = 0; public static var library:Library; protected function connectTextField(_arg1:TextField):void{ _arg1.addEventListener(Event.CHANGE, onTextChange); _arg1.addEventListener(FocusEvent.FOCUS_IN, onFocusIn); _arg1.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut); } public function get active():Boolean{ return (_active); } public function set container(_arg1:Sprite):void{ _container = _arg1; } public function set active(_arg1:Boolean):void{ _active = _arg1; } public function show(_arg1:Event=null):void{ _mc.visible = true; dispatchEvent(new Event(EVENT_FOCUS)); } protected function init(_arg1:Sprite, _arg2:Position=null, _arg3:Style=null):void{ _id = nextID; _container = ((_arg1)!=null) ? _arg1 : null; if (mainStage == null){ if (((!((_container == null))) && ((_container.stage is Stage)))){ mainStage = _container.stage; } else { throw (new Error("ASUILIB ERROR: Please register stage with Component.mainStage")); }; }; var _local4:Object = {}; if ((((((((((_type == "formfield")) || ((_type == "htmlfield")))) || ((_type == "combobox")))) || ((_type == "slider")))) || ((_type == "hrule")))){ _local4.margins = [0, 0, 15, 0]; }; _position = ((_arg2)!=null) ? _arg2 : new Position(_local4); _style = ((_arg3)!=null) ? _arg3 : ((globalStyle)!=null) ? globalStyle : new Style(); } public function get id():int{ return (_id); } public function set rotation(_arg1:Number):void{ if (((!(isNaN(_arg1))) && (!((_mc == null))))){ _mc.rotation = _arg1; }; } public function get deleted():Boolean{ return (_deleted); } public function get height():uint{ return (Math.ceil(_height)); } protected function onRelease(_arg1:MouseEvent=null):void{ dispatchEvent(new Event(EVENT_RELEASE, true)); if (((_draggable) && (!((Component.mainStage == null))))){ mainStage.removeEventListener(MouseEvent.MOUSE_UP, onRelease); }; } public function get position():Position{ return (_position); } public function onTargetEvent(_arg1:Event=null):void{ if (typeof(_target[_targetProperty]) == "function"){ if (_target[_targetProperty]() != false){ enable(); } else { disable(); }; } else { if (_target[_targetProperty] != false){ enable(); } else { disable(); }; }; } public function get parentCell():Cell{ return (_parentCell); } public function set id(_arg1:int):void{ _id = _arg1; } public function set deleted(_arg1:Boolean):void{ _deleted = _arg1; if (_deleted){ dispatchEvent(new Event(EVENT_REMOVE)); }; } protected function onFocusIn(_arg1:FocusEvent):void{ dispatchEvent(new Event(Component.EVENT_FOCUS)); } public function get enabled():Boolean{ return (_enabled); } public function hide(_arg1:Event=null):void{ _mc.visible = false; dispatchEvent(new Event(EVENT_BLUR)); } public function toggle(_arg1:Event=null):void{ if (_mc.visible){ hide(); } else { show(); }; } protected function onFocusOut(_arg1:FocusEvent):void{ dispatchEvent(new Event(Component.EVENT_BLUR)); } public function set parentCell(_arg1:Cell):void{ _parentCell = _arg1; if (_parentCell != null){ _container = _parentCell.contents; create(); }; } public function get scale():Number{ return (((_mc)!=null) ? _mc.scaleX : 1); } public function set position(_arg1:Position):void{ _position = _arg1; } public function get value():String{ return (_value); } public function get visible():Boolean{ return (_mc.visible); } public function get x():Number{ return (((_mc)!=null) ? _mc.x : 0); } protected function onTextChange(_arg1:Event):void{ dispatchEvent(new Event(Component.EVENT_CHANGE)); } public function get rotation():Number{ return (((_mc)!=null) ? _mc.rotation : 0); } public function get y():Number{ return (((_mc)!=null) ? _mc.y : 0); } public function get container():Sprite{ return (_container); } public function set enabled(_arg1:Boolean):void{ if (_arg1){ enable(); } else { disable(); }; } public function enable(_arg1:Event=null):void{ _enabled = true; } public function set form(_arg1:Object):void{ _form = _arg1; } public function get draggable():Boolean{ return (_draggable); } protected function connectSimpleButton(_arg1:SimpleButton, _arg2:Boolean=false, _arg3:Boolean=false):void{ if (_arg2 != true){ _arg1.addEventListener(MouseEvent.ROLL_OVER, onRollOver); _arg1.addEventListener(MouseEvent.ROLL_OUT, onRollOut); _arg1.addEventListener(MouseEvent.CLICK, onClick); } else { _arg1.addEventListener(MouseEvent.MOUSE_DOWN, onPress); _arg1.addEventListener(MouseEvent.MOUSE_UP, onRelease); if (_arg3){ _arg1.addEventListener(MouseEvent.ROLL_OVER, onRollOver); _arg1.addEventListener(MouseEvent.ROLL_OUT, onRollOut); }; }; } public function get zindex():Number{ return (_position.zindex); } public function set scale(_arg1:Number):void{ if (_mc != null){ _mc.scaleX = (_mc.scaleY = _arg1); }; } public function get mc():Sprite{ return (_mc); } protected function onPress(_arg1:MouseEvent=null):void{ dispatchEvent(new Event(EVENT_PRESS, true)); if (((_draggable) && (!((Component.mainStage == null))))){ mainStage.addEventListener(MouseEvent.MOUSE_UP, onRelease, false, 0, true); }; } public function get style():Style{ return (_style); } public function set mouseEnabled(_arg1:Boolean):void{ _mc.mouseEnabled = (_mc.mouseChildren = _arg1); } protected function onRollOut(_arg1:MouseEvent=null):void{ dispatchEvent(new Event(EVENT_ROLLOUT, true)); } protected function connectButton(_arg1:Sprite, _arg2:Boolean=false):void{ _arg1.addEventListener(MouseEvent.ROLL_OVER, onRollOver); _arg1.addEventListener(MouseEvent.ROLL_OUT, onRollOut); if (_arg2 != true){ _arg1.addEventListener(MouseEvent.CLICK, onClick); _arg1.addEventListener(MouseEvent.MOUSE_OUT, onRollOut); } else { _arg1.addEventListener(MouseEvent.MOUSE_DOWN, onPress); _arg1.addEventListener(MouseEvent.MOUSE_UP, onRelease); }; _arg1.buttonMode = true; } public function get form():Object{ return (_form); } public function get width():uint{ return (Math.ceil(_width)); } public function set tabEnabled(_arg1:Boolean):void{ _mc.tabChildren = _arg1; } public function get mouseEnabled():Boolean{ return (_mc.mouseEnabled); } public function set value(_arg1:String):void{ _value = _arg1; } protected function onClick(_arg1:MouseEvent=null):void{ dispatchEvent(new Event(EVENT_CLICK, true)); } public function connect(_arg1:String, _arg2:Component, _arg3:String):void{ if (((!((_target == null))) && (!((_targetEvent == null))))){ _target.removeEventListener(_targetEvent, onTargetEvent); }; _target = _arg2; _targetEvent = _arg1; _targetProperty = _arg3; if (_target != null){ _target.addEventListener(_targetEvent, onTargetEvent); onTargetEvent(); }; } public function get tabEnabled():Boolean{ return (_mc.tabChildren); } public function get created():Boolean{ return (_created); } public function set x(_arg1:Number):void{ if (((!(isNaN(_arg1))) && (!((_mc == null))))){ _mc.x = _arg1; }; } public function set y(_arg1:Number):void{ if (((!(isNaN(_arg1))) && (!((_mc == null))))){ _mc.y = _arg1; }; } public function disable(_arg1:Event=null):void{ _enabled = false; } public function destroy():Boolean{ if (_mc == null){ return (false); }; if (((!((_mc.parent == null))) && (!((_mc.parent.getChildIndex(mc) == -1))))){ _mc.parent.removeChild(_mc); }; _mc = null; _deleted = true; dispatchEvent(new Event(EVENT_DESTROY)); return (true); } public function create():void{ if (created){ return; }; var _local1:Sprite = new Sprite(); _mc = Sprite(_container.addChild(_local1)); _mc.name = ((_type + "_") + id); _mc.focusRect = false; _created = true; } protected function onRollOver(_arg1:MouseEvent=null):void{ dispatchEvent(new Event(EVENT_ROLLOVER, true)); } public static function get nextID():int{ _nextID++; return (_nextID); } } }//package com.slideroll.ui
Section 28
//Container (com.slideroll.ui.Container) package com.slideroll.ui { import flash.display.*; import flash.events.*; public class Container extends Component { private var _alt:String;// = "" protected var _clip:DisplayObject; protected var _altTimes:int;// = 0 public function Container(_arg1:Sprite, _arg2:DisplayObject=null, _arg3:String="", _arg4:Position=null, _arg5:Style=null){ init_Container(_arg1, _arg2, _arg3, _arg4, _arg5); if (_container != null){ create(); }; } public function set clip(_arg1:DisplayObject):void{ if (((!((_clip == null))) && ((_clip.parent == _mc)))){ _mc.removeChild(_clip); }; _clip = _arg1; if ((_clip is DisplayObject)){ _mc.addChild(_clip); }; } override protected function onRollOut(_arg1:MouseEvent=null):void{ super.onRollOut(_arg1); Tagtip.hideTag(); } override public function create():void{ super.create(); if (_clip != null){ _mc.addChild(_clip); }; if (((!((_clip == null))) && (!((_clip["btn"] == undefined))))){ if ((_clip["btn"] is SimpleButton)){ connectSimpleButton(_clip["btn"]); }; if ((_clip["btn"] is Sprite)){ connectButton(_clip["btn"]); }; }; } public function get alt():String{ return (_alt); } public function get clip():DisplayObject{ return (_clip); } private function init_Container(_arg1:Sprite, _arg2:DisplayObject=null, _arg3:String="", _arg4:Position=null, _arg5:Style=null):void{ super.init(_arg1, _arg4, _arg5); _type = "container"; _clip = _arg2; if (_clip != null){ _width = _clip.width; _height = _clip.height; }; if (_arg3.length > 0){ _alt = _arg3; }; } override protected function onRollOver(_arg1:MouseEvent=null):void{ super.onRollOver(_arg1); _altTimes++; if ((((_alt.length > 0)) && ((_altTimes <= 7)))){ Tagtip.showTag(_alt); }; } public function set alt(_arg1:String):void{ _alt = _arg1; } } }//package com.slideroll.ui
Section 29
//Create (com.slideroll.ui.Create) package com.slideroll.ui { import flash.display.*; import flash.text.*; import flash.geom.*; import flash.filters.*; public class Create { public static const ICON_REWIND:Array = [0.5, -0.48, 0.5, 0.47, 0.02, 0.04, 0.02, 0.47, -0.5, 0, 0.02, -0.48, 0.02, -0.05, 0.5, -0.48]; public static const ICON_DOUBLE_ARROW_LEFT:Array = [-0.5, 0.48, -0.02, 0, -0.5, -0.49, -0.5, 0.48, 0.01, 0.48, 0.5, 0, 0.01, -0.49, 0.01, 0.48]; public static const ICON_PAUSE:Array = [-0.1, -0.5, -0.1, 0.5, -0.5, 0.5, -0.5, -0.5, -0.1, -0.5, 0.5, -0.5, 0.5, 0.5, 0.1, 0.5, 0.1, -0.5, 0.5, -0.5]; public static const ICON_MINUS:Array = [-0.5, -0.12, 0.5, -0.12, 0.5, 0.12, -0.5, 0.12]; public static const ICON_OUT_ARROW:Array = [0.49, -0.5, 0.33, -0.5, 0.33, -0.5, -0.27, -0.5, -0.27, -0.27, 0.1, -0.27, -0.5, 0.33, -0.34, 0.5, 0.26, -0.1, 0.26, 0.27, 0.49, 0.26, 0.49, -0.5]; public static const ICON_IN_ARROW:Array = [0.26, -0.28, 0.49, -0.28, 0.49, 0.5, 0.33, 0.5, 0.33, 0.5, -0.27, 0.5, -0.27, 0.26, 0.1, 0.26, -0.5, -0.34, -0.34, -0.5, 0.26, 0.09, 0.26, -0.28]; public static const ICON_ARROW_DOWN:Array = [-0.5, -0.3, 0, 0.3, 0.5, -0.3]; public static const ICON_BACK_ARROW:Array = [-0.42, -0.09, -0.42, -0.09, -0.09, -0.42, 0.04, -0.3, -0.16, -0.09, 0.49, -0.09, 0.49, 0.09, -0.16, 0.09, 0.04, 0.29, -0.09, 0.41, -0.51, -0.01, -0.42, -0.09]; public static const ICON_CLOSE:Array = [0.5, -0.5, 0.5, -0.31, 0.18, 0, 0.345, 0.165, 0.35, 0.165, 0.5, 0.315, 0.5, 0.5, 0.31, 0.5, 0, 0.18, -0.095, 0.28, -0.095, 0.28, -0.315, 0.5, -0.5, 0.5, -0.5, 0.315, -0.18, 0, -0.28, -0.095, -0.28, -0.095, -0.5, -0.31, -0.5, -0.5, -0.315, -0.5, -0.145, -0.325, -0.145, -0.325, 0, -0.18, 0.31, -0.5, 0.5, -0.5]; public static const ICON_FASTFORWARD:Array = [-0.5, 0.47, -0.03, 0.04, -0.03, 0.47, 0.5, 0, -0.03, -0.48, -0.03, -0.05, -0.5, -0.48, -0.5, 0.47]; public static const ICON_ARROW_RIGHT:Array = [0.2, -0.5, -0.4, 0, 0.2, 0.5]; public static const ICON_NEXTTRACK:Array = [0.5, 0.45, 0.5, -0.46, 0.4, -0.46, 0.4, -0.04, -0.05, -0.46, -0.05, -0.04, -0.5, -0.46, -0.5, 0.45, -0.05, 0.04, -0.05, 0.45, 0.4, 0.04, 0.4, 0.45, 0.5, 0.45]; public static const ICON_ARROW_LEFT:Array = [-0.2, -0.5, 0.4, 0, -0.2, 0.5]; public static const ICON_PLUS:Array = [0.12, -0.5, 0.12, -0.12, 0.5, -0.12, 0.5, 0.12, 0.12, 0.12, 0.12, 0.5, -0.12, 0.5, -0.12, -0.12, -0.5, -0.12, -0.5, 0.12, -0.12, 0.12, -0.12, -0.5]; public static const ICON_CHECK:Array = [0.5, -0.2, -0.1, 0.4, -0.5, 0, -0.3, -0.2, -0.1, 0, 0.3, -0.4, 0.5, -0.2]; public static const ICON_NEXT_ARROW:Array = [0.15, -0.09, -0.5, -0.09, -0.5, 0.09, 0.15, 0.09, -0.05, 0.29, 0.08, 0.41, 0.5, -0.01, 0.41, -0.09, 0.41, -0.09, 0.08, -0.42, -0.05, -0.3, 0.15, -0.09]; public static const ICON_ARROW_UP:Array = [-0.5, 0.3, 0, -0.3, 0.5, 0.3]; public static const ICON_PLAY:Array = [-0.3, -0.5, 0.5, 0, -0.3, 0.5]; public static const ICON_DOUBLE_ARROW_RIGHT:Array = [0.01, 0, 0.5, 0.48, 0.5, -0.49, 0.01, 0, -0.5, 0, -0.02, 0.48, -0.02, -0.49, -0.5, 0]; public static const ICON_PREVTRACK:Array = [0.5, -0.46, 0.5, 0.45, 0.04, 0.04, 0.04, 0.45, -0.41, 0.04, -0.41, 0.45, -0.5, 0.45, -0.5, -0.46, -0.41, -0.46, -0.41, -0.04, 0.04, -0.46, 0.04, -0.04, 0.5, -0.46]; public static function newIcon(_arg1:Array, _arg2:Sprite, _arg3:Number, _arg4:Number=1, _arg5:Style=null, _arg6:Number=1):Sprite{ var _local11:int; var _local7:Sprite = new Sprite(); _local7.name = "icon"; _arg2.addChild(_local7); _local7.mouseEnabled = false; _local7.x = (_arg2.width * 0.5); _local7.y = (_arg2.height * 0.5); var _local8:Graphics = _local7.graphics; if (_arg5 == null){ _arg5 = new Style(); }; var _local9:Number = ((_arg2.width - (_arg5.borderWidth * 2)) * _arg6); var _local10:Number = ((_arg2.height - (_arg5.borderWidth * 2)) * _arg6); if (_local9 <= 1){ _local9 = 10; }; if (_local10 <= 1){ _local10 = 10; }; if (_arg1.length > 2){ _local8.beginFill(_arg3, _arg4); _local8.moveTo(((_arg1[0] * _local9) * 0.5), ((_arg1[1] * _local10) * 0.5)); _local11 = 2; while (_local11 < _arg1.length) { _local8.lineTo(((_arg1[_local11] * _local9) * 0.5), ((_arg1[(_local11 + 1)] * _local10) * 0.5)); _local11 = (_local11 + 2); }; _local8.endFill(); }; return (_local7); } public static function hitArea(_arg1:Sprite, _arg2:Array, _arg3:Number, _arg4:Number, _arg5:Boolean=false, _arg6:Array=null, _arg7:Style=null):Sprite{ var _local13:Sprite; if (_arg7 == null){ _arg7 = new Style(); }; var _local8:Sprite = new Sprite(); _local8.name = "btn"; var _local9:Sprite = new Sprite(); _local9.name = "button_btn"; _local9.buttonMode = true; var _local10:Sprite = new Sprite(); _local10.name = "button_inactive"; var _local11:Sprite = new Sprite(); _local11.name = "button_selected"; var _local12:Sprite = _arg1; _arg1.addChild(_local8); _local12 = _local8; if (_arg7.border){ DrawingMethods.roundedRect(_local12, false, 0, 0, _arg3, _arg4, "0", [_arg7.buttonBorderColor], [_arg7.backgroundAlpha], [1]); }; if (_arg7.background){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [_arg7.unselectedColor], [_arg7.backgroundAlpha], [1]); } else { DrawingMethods.rect(_local12, false, 0, 0, _arg3, _arg4, 0, 0); }; if (_arg7.gradient){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [0xFFFFFF, 0xFFFFFF, 0, 0], [0.4, 0.15, 0, 0.1], [0, 128, 128, 0xFF]); }; if (_arg2 != null){ _local13 = newIcon(_arg2, _local8, _arg7.buttonTextColor, 1, _arg7); _local13.name = "icon"; }; _local8.addChild(_local9); _local12 = _local9; if (((((((_arg7.background) || (_arg7.border))) || (_arg7.gradient))) || ((_arg2 == null)))){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [0xFFFFFF], [20], [1]); } else { DrawingMethods.roundedRect(_local12, false, 0, 0, _arg3, _arg4, "0", [0xFFFFFF], [0], [1]); _local13 = newIcon(_arg2, _local12, 0xFFFFFF, 1, _arg7); _local13.mouseEnabled = false; _local13.alpha = 1.5; }; _local9.alpha = 0; _local8.addChild(_local11); _local12 = _local11; if (!_arg5){ if (_arg7.border){ DrawingMethods.roundedRect(_local12, false, 0, 0, _arg3, _arg4, "0", [_arg7.buttonBorderColor], [_arg7.backgroundAlpha], [1]); }; if (_arg7.background){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [_arg7.buttonColor], [_arg7.backgroundAlpha], [1]); } else { DrawingMethods.rect(_local12, false, 0, 0, _arg3, _arg4, 0, 0); }; if (_arg7.gradient){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [0xFFFFFF, 0xFFFFFF, 0, 0], [0.4, 0.15, 0, 0.1], [0, 128, 128, 0xFF]); }; if (_arg2 != null){ _local13 = newIcon(_arg2, _local12, _arg7.inverseTextColor, 1, _arg7); _local13.name = "icon_selected"; }; } else { if (_arg7.border){ DrawingMethods.roundedRect(_local12, false, 0, 0, _arg3, _arg4, "0", [_arg7.buttonBorderColor], [_arg7.backgroundAlpha], [1]); }; if (_arg7.background){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [_arg7.buttonColor], [_arg7.backgroundAlpha], [1]); } else { DrawingMethods.rect(_local12, false, 0, 0, _arg3, _arg4, 0, 0); }; if (_arg7.gradient){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [0, 0, 0xFFFFFF, 0xFFFFFF], [0.2, 0, 0.1, 0.2], [0, 128, 128, 0xFF]); }; if (_arg2 != null){ _local13 = newIcon(((_arg6)!=null) ? _arg6 : _arg2, _local12, _arg7.inverseTextColor, 1, _arg7); _local13.name = "icon_selected"; }; }; _local11.visible = false; _local8.addChild(_local10); _local12 = _local10; DrawingMethods.rect(_local12, false, 0, 0, _arg3, _arg4, 0, 0); if (_arg7.border){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [_arg7.inactiveColor], [_arg7.backgroundAlpha], [1]); }; if (_arg7.gradient){ DrawingMethods.roundedRect(_local12, false, _arg7.borderWidth, _arg7.borderWidth, (_arg3 - (_arg7.borderWidth * 2)), (_arg4 - (_arg7.borderWidth * 2)), "0", [0xFFFFFF, 0xFFFFFF, 0, 0], [0.4, 0.15, 0, 0.1], [0, 128, 128, 0xFF]); }; if (_arg2 != null){ _local13 = newIcon(_arg2, _local12, _arg7.inactiveTextColor, 1, _arg7); _local13.name = "icon_inactive"; }; _local10.visible = false; if (_arg5){ _local8.setChildIndex(_local9, 2); }; if (_arg7.buttonDropShadow){ _arg1.filters = [new DropShadowFilter(4, 45, 0, 0.2, 4, 4, 1, 2)]; }; _local8.setChildIndex(_local9, (_local8.numChildren - 1)); return (_local8); } public static function inputText(_arg1:String, _arg2:String, _arg3:Sprite, _arg4:Number, _arg5:Number, _arg6:Style):TextField{ var _local7:TextField = newText(_arg1, _arg2, _arg3, _arg6); _local7.selectable = true; _local7.multiline = false; _local7.wordWrap = false; _local7.type = "input"; _local7.autoSize = TextFieldAutoSize.LEFT; _local7.setTextFormat(new TextFormat("_sans", _arg6.fontSize, _arg6.textColor, false, false, false, "", "", "left")); _local7.defaultTextFormat = new TextFormat("_sans", _arg6.fontSize, _arg6.textColor, false, false, false, "", "", "left"); _local7.text = "TEMPj'|"; var _local8:int = Math.ceil(_local7.height); _local7.autoSize = TextFieldAutoSize.NONE; _local7.text = ""; if (((!(isNaN(_arg4))) && ((_arg4 > 0)))){ _local7.width = _arg4; }; if (((!(isNaN(_arg5))) && ((_arg5 > 0)))){ _local7.height = _arg5; } else { _local7.height = ((_local8 + 2) + (_arg6.borderWidth * 2)); }; return (_local7); } public static function newText(_arg1:String, _arg2:String, _arg3:Sprite, _arg4:Style, _arg5:Number=NaN, _arg6:Number=NaN, _arg7:Boolean=false, _arg8:Boolean=false):TextField{ if (isNaN(_arg5)){ _arg5 = _arg4.textColor; }; if (isNaN(_arg6)){ _arg6 = (_arg8) ? _arg4.buttonFontSize : _arg4.fontSize; }; var _local9:TextField = new TextField(); _local9.width = 200; _local9.height = 10; _local9.name = _arg2; _arg3.addChild(_local9); _local9.autoSize = TextFieldAutoSize.LEFT; _local9.embedFonts = _arg4.embedFonts; if (_arg7){ _local9.htmlText = _arg1; } else { _local9.text = _arg1; }; _local9.selectable = false; _local9.setTextFormat(new TextFormat((_arg8) ? _arg4.buttonFont : _arg4.font, _arg6, _arg5, true)); _local9.defaultTextFormat = new TextFormat((_arg8) ? _arg4.buttonFont : _arg4.font, _arg6, _arg5, true); if (_arg4.embedFonts){ _local9.antiAliasType = AntiAliasType.ADVANCED; }; _local9.textColor = _arg5; return (_local9); } public static function button(_arg1:Sprite, _arg2:Object, _arg3:Number=-1, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Boolean=false, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:String="", _arg10:Style=null):Sprite{ var _local11:String; var _local12:Object; var _local13:Boolean; var _local16:TextField; var _local19:TextField; var _local21:TextField; var _local28:TextField; var _local29:Sprite; var _local30:Number; var _local31:Sprite; var _local32:Sprite; if (_arg10 == null){ _arg10 = new Style(); }; if (typeof(_arg2) == "string"){ _local11 = (_arg2 as String); } else { _local11 = ((_arg2.text)!=null) ? _arg2.text : ""; _local12 = ((_arg2.icon)!=null) ? _arg2.icon : null; _local13 = ((_arg2.first)!=null) ? !((_arg2.first == "false")) : true; }; var _local14:String = String(_arg10.round); if (_arg3 == -1){ _arg3 = Position.ALIGN_CENTER; }; if (_arg6){ _local14 = (((_local14 + " ") + _local14) + " 0 0"); }; var _local15:Sprite = new Sprite(); _local15.name = "btn"; var _local17:Sprite = new Sprite(); _local17.name = "button_btn"; _local17.buttonMode = true; var _local18:Sprite = new Sprite(); _local18.name = "button_inactive"; var _local20:Sprite = new Sprite(); _local20.name = "button_selected"; var _local22:Sprite = _arg1; var _local23:Array = _local14.split(" "); var _local24:int; while (_local24 < _local23.length) { _local23[_local24] = ((parseInt(_local23[_local24]))>0) ? (parseInt(_local23[_local24]) - _arg10.borderWidth) : 0; _local24++; }; var _local25:String = _local23.join(" "); _arg1.addChild(_local15); _local16 = newText(_local11, "_buttontext", _local15, _arg10, (_arg7) ? _arg10.unselectedTextColor : _arg10.buttonTextColor, _arg10.buttonFontSize, false, true); var _local26:Number = _local16.width; if (_arg9 != null){ _local16.text = _arg9; _local26 = Math.max(_local26, _local16.width); _local16.text = _local11; }; if (isNaN(_arg4)){ _arg4 = ((_local26 + (_arg10.padding * 3)) + Math.max(8, (_arg10.borderWidth * 2))); } else { _arg4 = Math.max(_arg4, (((_local26 + (_arg10.padding * 3)) + Math.max(8, (_arg10.borderWidth * 2))) - 2)); }; if (isNaN(_arg5)){ _arg5 = ((_local16.height + _arg10.padding) + (_arg10.borderWidth * 2)); } else { _arg5 = Math.max(_arg5, (((_local16.height + _arg10.padding) + (_arg10.borderWidth * 2)) - 2)); }; if (_arg3 == Position.ALIGN_LEFT){ _local16.x = _arg10.padding; } else { if (_arg3 == Position.ALIGN_RIGHT){ _local16.x = ((_arg4 - _local16.width) - _arg10.padding); } else { _local16.x = Math.floor(((_arg4 - _local16.width) * 0.5)); }; }; _local16.y = Math.floor(((_arg5 - _local16.height) * 0.5)); _local22 = _local15; var _local27:Number = 0; if (_arg6){ _local27 = _arg10.borderWidth; }; if (_arg10.border){ DrawingMethods.roundedRect(_local22, false, 0, 0, _arg4, (_arg5 - _local27), _local14, [_arg10.buttonBorderColor], [_arg10.backgroundAlpha], [1]); }; if (_arg10.background){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [(_arg7) ? _arg10.unselectedColor : _arg10.buttonColor], [_arg10.backgroundAlpha], [1]); }; if (_arg10.gradient){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [0xFFFFFF, 0xFFFFFF, 0, 0], [0.4, 0.15, 0, 0.1], [0, 128, 128, 0xFF]); }; _local15.addChild(_local17); _local22 = _local17; if (((((((_arg10.background) || (_arg10.border))) || (_arg10.gradient))) || (!(_arg10.embedFonts)))){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [0xFFFFFF], [20], [1]); } else { DrawingMethods.roundedRect(_local22, false, 0, 0, _arg4, _arg5, _local25, [0xFFFFFF], [0], [1]); _local28 = newText(_local11, "_buttontext", _local17, _arg10, 0xFFFFFF, _arg10.buttonFontSize, false, true); _local28.mouseEnabled = false; _local28.x = _local16.x; _local28.y = _local16.y; _local28.alpha = 1.5; }; _local17.alpha = 0; _local15.addChild(_local20); _local22 = _local20; if (!_arg8){ if (_arg10.border){ DrawingMethods.roundedRect(_local22, false, 0, 0, _arg4, (_arg5 - _local27), _local14, [_arg10.selectedButtonBorderColor], [_arg10.backgroundAlpha], [1]); }; if (_arg10.background){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [_arg10.buttonColor], [_arg10.backgroundAlpha], [1]); }; if (_arg10.gradient){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [0xFFFFFF, 0xFFFFFF, 0, 0], [0.4, 0.15, 0, 0.1], [0, 128, 128, 0xFF]); }; _local21 = newText(_local11, "_buttontext", _local20, _arg10, _arg10.inverseTextColor, _arg10.buttonFontSize, false, true); _local21.x = _local16.x; _local21.y = _local16.y; _local20.visible = false; } else { if (_arg10.border){ DrawingMethods.roundedRect(_local22, false, 0, 0, _arg4, (_arg5 - _local27), _local14, [_arg10.buttonBorderColor], [_arg10.backgroundAlpha], [1]); }; if (_arg10.background){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [ColorTools.getTintedColor(_arg10.buttonColor, 0, 0.2)], [_arg10.backgroundAlpha], [1]); }; if (_arg10.gradient){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [0, 0, 0xFFFFFF, 0xFFFFFF], [0.2, 0, 0.1, 0.2], [0, 128, 128, 0xFF]); }; _local21 = newText(((_arg9.length)>0) ? _arg9 : _local11, "_buttontext", _local20, _arg10, _arg10.inverseTextColor, _arg10.buttonFontSize, false, true); if (_arg3 == Position.ALIGN_LEFT){ _local21.x = _arg10.padding; } else { if (_arg3 == Position.ALIGN_RIGHT){ _local21.x = ((_arg4 - _local21.width) - _arg10.padding); } else { _local21.x = Math.floor(((_arg4 - _local21.width) * 0.5)); }; }; _local21.y = _local16.y; _local20.visible = false; }; _local15.addChild(_local18); _local22 = _local18; if (_arg10.border){ DrawingMethods.roundedRect(_local22, false, 0, 0, _arg4, (_arg5 - _local27), _local14, [ColorTools.getTintedColor(_arg10.inactiveColor, 0, 0.25)], [_arg10.backgroundAlpha], [1]); }; if (_arg10.background){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [_arg10.inactiveColor], [_arg10.backgroundAlpha], [1]); }; if (_arg10.gradient){ DrawingMethods.roundedRect(_local22, false, _arg10.borderWidth, _arg10.borderWidth, (_arg4 - (_arg10.borderWidth * 2)), (_arg5 - (_arg10.borderWidth * 2)), _local25, [0xFFFFFF, 0xFFFFFF, 0, 0], [0.4, 0.15, 0, 0.1], [0, 128, 128, 0xFF]); }; _local19 = newText(_local11, "_buttontext", _local18, _arg10, _arg10.inactiveTextColor, _arg10.buttonFontSize, false, true); _local19.x = _local16.x; _local19.y = _local16.y; _local18.visible = false; if (_arg8){ _local15.setChildIndex(_local17, 3); }; if (_arg10.buttonDropShadow){ _arg1.filters = [new DropShadowFilter(4, 45, 0, 0.2, 4, 4, 1, 2)]; }; if (((!((_local12 == null))) && ((_local12 is Array)))){ _local29 = new Sprite(); _local29.mouseEnabled = false; _local29.name = "icon"; newIcon((_local12 as Array), _local29, _arg10.buttonTextColor, 1, _arg10); _local30 = (_local29.width / _local29.height); if (_local30 <= 1){ _local29.height = (_local16.height * 0.5); _local29.width = (_local29.height * _local30); } else { _local29.width = (_local16.height * 0.5); _local29.height = (_local29.width / _local30); }; if (_local13){ _local29.x = (_local16.x - (_local16.height / 4)); _local16.x = (_local16.x + (_local16.height / 4)); } else { _local29.x = ((_local16.x + _local16.width) + (_local16.height / 4)); _local16.x = (_local16.x - (_local16.height / 4)); }; _local29.y = (_local16.y + (_local16.height / 2)); _local15.addChild(_local29); _local31 = new Sprite(); _local31.mouseEnabled = false; _local31.name = "icon_inactive"; newIcon((_local12 as Array), _local31, _arg10.inactiveTextColor, 1, _arg10); _local31.height = (_local19.height * 0.65); if (_local30 <= 1){ _local31.height = (_local16.height * 0.5); _local31.width = (_local31.height * _local30); } else { _local31.width = (_local16.height * 0.5); _local31.height = (_local31.width / _local30); }; if (_local13){ _local31.x = (_local19.x - (_local19.height / 4)); _local19.x = (_local19.x + (_local19.height / 4)); } else { _local31.x = ((_local19.x + _local19.width) + (_local19.height / 4)); _local19.x = (_local19.x - (_local19.height / 4)); }; _local31.y = (_local19.y + (_local19.height / 2)); _local31.visible = false; _arg1.addChild(_local31); if (_local28 != null){ _local32 = new Sprite(); _local32.mouseEnabled = false; _local32.name = "icon_button"; newIcon((_local12 as Array), _local32, 0xFFFFFF, 1, _arg10); _local32.x = _local31.x; _local32.y = _local31.y; _local32.width = _local31.width; _local32.height = _local31.height; _local28.x = _local16.x; _local28.y = _local16.y; _local32.alpha = 1.5; _local17.addChild(_local32); }; _local15.setChildIndex(_local17, (_local15.numChildren - 1)); }; return (_local15); } public static function background(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Style=null, _arg5:Boolean=false, _arg6:Number=-1):void{ var _local9:Matrix; if (_arg4 == null){ _arg4 = Component.globalStyle; }; var _local7:Number = (_arg5) ? _arg4.borderWidth : 0; var _local8:Number = ((_arg6)==-1) ? _arg4.round : _arg6; if (_arg5){ DrawingMethods.roundedRect(_arg1, false, 0, 0, _arg2, _arg3, _local8.toString(), [_arg4.borderColor], [_arg4.borderAlpha], [1]); }; if (((_arg4.background) && (!(_arg4.bgGradient)))){ DrawingMethods.roundedRect(_arg1, false, _local7, _local7, (_arg2 - (_local7 * 2)), (_arg3 - (_local7 * 2)), Math.max(0, (_local8 - _local7)).toString(), [_arg4.backgroundColor], [_arg4.backgroundAlpha], [1]); } else { if (((_arg4.background) && (_arg4.bgGradient))){ _local9 = null; if (_arg4.bgGradientHeight > 0){ _local9 = new Matrix(); _local9.createGradientBox((_arg2 - (_local7 * 2)), _arg4.bgGradientHeight, (90 * (Math.PI / 180)), _local7, _local7); }; DrawingMethods.roundedRect(_arg1, false, _local7, _local7, (_arg2 - (_local7 * 2)), (_arg3 - (_local7 * 2)), Math.max(0, (_local8 - _local7)).toString(), _arg4.bgGradientColors, [_arg4.backgroundAlpha], _arg4.bgGradientRatios, _local9); }; }; } } }//package com.slideroll.ui
Section 30
//DrawingMethods (com.slideroll.ui.DrawingMethods) package com.slideroll.ui { import flash.display.*; import flash.geom.*; public class DrawingMethods { public static function emptyRect(_arg1:Sprite, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0, _arg5:Number=100, _arg6:Number=100, _arg7:Number=0, _arg8:Number=0, _arg9:Number=1):void{ var _local10:Graphics = _arg1.graphics; if (_arg2 != false){ _local10.clear(); }; _arg3 = (isNaN(_arg3)) ? 0 : _arg3; _arg4 = (isNaN(_arg4)) ? 0 : _arg4; if (isNaN(_arg5)){ _arg5 = _arg1.width; }; if (isNaN(_arg6)){ _arg6 = _arg1.height; }; if (isNaN(_arg8)){ _arg8 = 0; }; if (isNaN(_arg9)){ _arg9 = 1; }; if (isNaN(_arg7)){ _arg7 = 1; }; _local10.beginFill(_arg8, _arg9); _local10.moveTo(_arg3, _arg4); _local10.lineTo((_arg3 + _arg5), _arg4); _local10.lineTo((_arg3 + _arg5), (_arg4 + _arg6)); _local10.lineTo(_arg3, (_arg4 + _arg6)); _local10.lineTo(_arg3, _arg4); _local10.lineTo((_arg3 + _arg7), (_arg4 + _arg7)); _local10.lineTo(((_arg3 + _arg5) - _arg7), (_arg4 + _arg7)); _local10.lineTo(((_arg3 + _arg5) - _arg7), ((_arg4 + _arg6) - _arg7)); _local10.lineTo((_arg3 + _arg7), ((_arg4 + _arg6) - _arg7)); _local10.lineTo((_arg3 + _arg7), (_arg4 + _arg7)); _local10.endFill(); } public static function roundedRect(_arg1:Sprite, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0, _arg5:Number=100, _arg6:Number=100, _arg7:String="0", _arg8:Array=null, _arg9:Array=null, _arg10:Array=null, _arg11:Matrix=null, _arg12:Number=0, _arg13:Number=0, _arg14:Number=1):void{ var _local21:Number; var _local15:Graphics = _arg1.graphics; var _local16:Array = new Array(); var _local17:Number = 0; var _local18:Number = 0; var _local19:Number = 0; var _local20:Number = 0; if (_arg2 != false){ _local15.clear(); }; if (_arg8.length < 1){ _arg8 = [0]; }; if (_arg9 == null){ _arg9 = []; }; if (_arg9.length != _arg8.length){ _arg9 = []; _local21 = 0; while (_local21 < _arg8.length) { _arg9.push(1); _local21++; }; }; if (_arg10 == null){ _arg10 = []; }; if (_arg10.length != _arg8.length){ _arg10 = []; _local21 = 0; while (_local21 < _arg8.length) { _arg10.push(((_local21 / (_arg8.length - 1)) * 0xFF)); _local21++; }; }; if ((((_arg7 == null)) || ((_arg7 == "")))){ _arg7 = "0"; }; _local16 = _arg7.split(" "); _local17 = parseInt(_local16[0]); _local18 = ((_local16[1])==undefined) ? _local17 : parseInt(_local16[1]); _local19 = ((_local16[2])==undefined) ? _local17 : parseInt(_local16[2]); _local20 = ((_local16[3])==undefined) ? _local18 : parseInt(_local16[3]); _arg3 = (isNaN(_arg3)) ? 0 : _arg3; _arg4 = (isNaN(_arg4)) ? 0 : _arg4; if (isNaN(_arg5)){ _arg5 = _arg1.width; }; if (isNaN(_arg6)){ _arg6 = _arg1.height; }; if (((!(isNaN(_arg12))) && ((_arg12 > 0)))){ if (((!(isNaN(_arg13))) || ((_arg13 == 0)))){ _arg13 = 0; }; if (((!(isNaN(_arg14))) || ((_arg14 == 0)))){ _arg14 = 1; }; _local15.lineStyle(_arg12, _arg13, _arg14); }; if (_arg8.length == 1){ _local15.beginFill(_arg8[0], _arg9[0]); } else { if (_arg11 == null){ _arg11 = new Matrix(); _arg11.createGradientBox(_arg5, _arg6, (90 * (Math.PI / 180)), _arg3, _arg4); }; _local15.beginGradientFill("linear", _arg8, _arg9, _arg10, _arg11); }; if (_local17 > 0){ _local15.moveTo((_arg3 + _local17), _arg4); } else { _local15.moveTo(_arg3, _arg4); }; if (_local18 > 0){ _local15.lineTo(((_arg3 + _arg5) - _local18), _arg4); _local15.curveTo((_arg3 + _arg5), _arg4, (_arg3 + _arg5), (_arg4 + _local18)); _local15.lineTo((_arg3 + _arg5), (_arg4 + _local18)); } else { _local15.lineTo((_arg3 + _arg5), _arg4); }; if (_local19 > 0){ _local15.lineTo((_arg3 + _arg5), ((_arg4 + _arg6) - _local19)); _local15.curveTo((_arg3 + _arg5), (_arg4 + _arg6), ((_arg3 + _arg5) - _local19), (_arg4 + _arg6)); _local15.lineTo(((_arg3 + _arg5) - _local19), (_arg4 + _arg6)); } else { _local15.lineTo((_arg3 + _arg5), (_arg4 + _arg6)); }; if (_local20 > 0){ _local15.lineTo((_arg3 + _local20), (_arg4 + _arg6)); _local15.curveTo(_arg3, (_arg4 + _arg6), _arg3, ((_arg4 + _arg6) - _local20)); _local15.lineTo(_arg3, ((_arg4 + _arg6) - _local20)); } else { _local15.lineTo(_arg3, (_arg4 + _arg6)); }; if (_local17 > 0){ _local15.lineTo(_arg3, (_arg4 + _local17)); _local15.curveTo(_arg3, _arg4, (_arg3 + _local17), _arg4); _local15.lineTo((_arg3 + _local17), _arg4); } else { _local15.lineTo(_arg3, _arg4); }; _local15.endFill(); } public static function rect(_arg1:Sprite, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0, _arg5:Number=100, _arg6:Number=100, _arg7:Number=0, _arg8:Number=1):void{ var _local9:Graphics = _arg1.graphics; if (_arg2 != false){ _local9.clear(); }; _arg3 = (isNaN(_arg3)) ? 0 : _arg3; _arg4 = (isNaN(_arg4)) ? 0 : _arg4; if (isNaN(_arg5)){ _arg5 = _arg1.width; }; if (isNaN(_arg6)){ _arg6 = _arg1.height; }; if (isNaN(_arg7)){ _arg7 = 0; }; if (isNaN(_arg8)){ _arg8 = 100; }; _local9.beginFill(_arg7, _arg8); _local9.moveTo(_arg3, _arg4); _local9.lineTo((_arg3 + _arg5), _arg4); _local9.lineTo((_arg3 + _arg5), (_arg4 + _arg6)); _local9.lineTo(_arg3, (_arg4 + _arg6)); _local9.lineTo(_arg3, _arg4); _local9.endFill(); } public static function circle(_arg1:Sprite, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0, _arg5:Number=10, _arg6:Number=1, _arg7:Number=0, _arg8:Number=1, _arg9:Number=0, _arg10:Number=0, _arg11:Number=1):void{ var _local12:Graphics = _arg1.graphics; if (_arg2 != false){ _local12.clear(); }; if ((((_arg5 == 0)) || (isNaN(_arg5)))){ return; }; if (isNaN(_arg7)){ _arg7 = 0; }; if (isNaN(_arg8)){ _arg8 = 100; }; if (isNaN(_arg10)){ _arg10 = 0; }; if (isNaN(_arg9)){ _arg9 = 0; }; if (_arg9 > 0){ _local12.lineStyle(_arg9, _arg10, 100); } else { _local12.lineStyle(); }; _local12.beginFill(_arg7, _arg8); _local12.drawCircle(_arg3, _arg4, _arg5); _local12.endFill(); } } }//package com.slideroll.ui
Section 31
//IComponent (com.slideroll.ui.IComponent) package com.slideroll.ui { import flash.events.*; public interface IComponent { function hide(_arg1:Event=null):void; function enable(_arg1:Event=null):void; function disable(_arg1:Event=null):void; function destroy():Boolean; function create():void; function show(_arg1:Event=null):void; } }//package com.slideroll.ui
Section 32
//Key (com.slideroll.ui.Key) package com.slideroll.ui { import flash.display.*; import flash.events.*; import flash.ui.*; public class Key extends EventDispatcher { public static const KEY_UP:String = "keyUp"; public static const KEY_DOWN:String = "keyDown"; private static var _shiftDown:Boolean = false; private static var _ctrlDown:Boolean = false; private static var initialized:Boolean = false; private static var keysDown:Object = {}; public static var stage:Stage; private static function keyPressed(_arg1:KeyboardEvent):void{ if (_arg1.shiftKey){ _shiftDown = true; }; if (_arg1.ctrlKey){ _ctrlDown = true; }; keysDown[_arg1.keyCode] = true; } private static function keyReleased(_arg1:KeyboardEvent):void{ if ((_arg1.keyCode in keysDown)){ delete keysDown[_arg1.keyCode]; }; if (_arg1.keyCode == Keyboard.SHIFT){ _shiftDown = false; } else { if (_arg1.keyCode == Keyboard.CONTROL){ _ctrlDown = false; }; }; } public static function match(_arg1:int, _arg2:String, _arg3:Boolean=false):Boolean{ var _local4:int; if (_arg3){ return ((_arg1 == _arg2.charCodeAt[0])); }; _local4 = ((((_arg1 >= 97)) && ((_arg1 <= 122)))) ? (_arg1 - 32) : _arg1; return ((_local4 == _arg2.toUpperCase().charCodeAt(0))); } public static function initialize(_arg1:Stage):void{ stage = _arg1; if (!initialized){ stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed, false, 0, true); stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased, false, 0, true); stage.addEventListener(Event.DEACTIVATE, clearKeys, false, 0, true); initialized = true; }; } public static function get shiftKey():Boolean{ return (_shiftDown); } private static function clearKeys(_arg1:Event):void{ keysDown = {}; } public static function get SPACE():uint{ return (Keyboard.SPACE); } public static function get DELETE():uint{ return (Keyboard.DELETE); } public static function charIsDown(_arg1:String):Boolean{ if (!initialized){ throw (new Error("Key class has yet been initialized.")); }; return (Boolean((((_arg1.charCodeAt(0) in keysDown)) || ((_arg1.toUpperCase().charCodeAt(0) in keysDown))))); } public static function isDown(_arg1:uint, _arg2:Boolean=false):Boolean{ if (!initialized){ throw (new Error("Key class has yet been initialized.")); }; if (!_arg2){ if ((((_arg1 >= 97)) && ((_arg1 <= 122)))){ _arg1 = (_arg1 - 32); }; }; return (Boolean((_arg1 in keysDown))); } public static function get ctrlKey():Boolean{ return (_ctrlDown); } public static function get TAB():uint{ return (Keyboard.TAB); } } }//package com.slideroll.ui
Section 33
//Library (com.slideroll.ui.Library) package com.slideroll.ui { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.geom.*; import flash.media.*; public class Library extends EventDispatcher { protected var _eventSent:Boolean;// = false protected var _timer:Timer; protected var bitmapDataCache:Object; protected var embeddedLibrary:Class; protected var loader:Loader; protected var _smoothing:Boolean;// = false protected var debugmode:Boolean; public static const INITIALIZED:String = "embeddedlibrary_initialized"; public static var scale:Number = 1; public function Library(_arg1:Class, _arg2:Boolean=false){ embeddedLibrary = _arg1; debugmode = _arg2; init(); } private function getSymbolDefinition(_arg1:String):Class{ if (initialized){ if (loader.contentLoaderInfo.applicationDomain.hasDefinition(_arg1)){ return ((loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1) as Class)); }; trace((("Symbol '" + _arg1) + "' not found.")); }; return (null); } private function getSymbolInstance(_arg1:String):Object{ var _local2:Class = getSymbolDefinition(_arg1); return ((_local2) ? new (_local2) : null); } public function getFont(_arg1:String):Class{ var obj:Object; var fontClassName = _arg1; try { return (getSymbolDefinition(fontClassName)); } catch(e:Error) { trace((("Font '" + fontClassName) + "' not found in Library")); }; return (null); } protected function onInitialize(_arg1:Event):void{ loader.contentLoaderInfo.removeEventListener(Event.INIT, onInitialize); dispatchEvent(new Event(Event.INIT)); _eventSent = true; } protected function init():void{ loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, onInitialize, false, 0, true); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete, false, 0, true); loader.loadBytes(new embeddedLibrary()); bitmapDataCache = {}; _timer = new Timer(250, 0); _timer.addEventListener(TimerEvent.TIMER, checkEvent); _timer.start(); } public function getDisplayObjectAsBitmap(_arg1:String, _arg2:Array=null):Bitmap{ var _local4:BitmapData; var _local5:Matrix; var _local6:int; if (!initialized){ throw (new Error("ERROR: Component Library not initialized.")); }; if (((!((bitmapDataCache[_arg1] == null))) && ((bitmapDataCache[_arg1] is BitmapData)))){ return (new Bitmap(bitmapDataCache[_arg1], PixelSnapping.NEVER, smoothing)); }; var _local3:DisplayObject = getDisplayObject(_arg1); if (_local3 != null){ _local4 = new BitmapData(Math.floor((_local3.width * scale)), Math.floor((_local3.height * scale)), true, 0); _local5 = new Matrix(); _local5.createBox(scale, scale, 0, Math.floor(((_local3.width * 0.5) * scale)), Math.floor(((_local3.height * 0.5) * scale))); _local4.draw(_local3, _local5); if (_arg2 != null){ _local6 = 0; while (_local6 < _arg2.length) { _local4.applyFilter(_local4, new Rectangle(0, 0, _local4.width, _local4.height), new Point(0, 0), _arg2[_local6]); _local6++; }; }; bitmapDataCache[_arg1] = _local4; return (new Bitmap(_local4)); }; return (null); } protected function get initialized():Boolean{ return (!((loader.content == null))); } public function getSound(_arg1:String):Sound{ var obj:Object; var symbolName = _arg1; if (!initialized){ throw (new Error("ERROR: Component Library not initialized.")); }; try { obj = getSymbolInstance(symbolName); if ((obj is Sound)){ return ((obj as Sound)); } else { throw (new Error()); }; } catch(e:Error) { trace((("Library Symbol '" + symbolName) + "' is not a Sound")); }; return (null); } public function set smoothing(_arg1:Boolean):void{ _smoothing = _arg1; } public function getDisplayObject(_arg1:String):DisplayObject{ var obj:Object; var symbolName = _arg1; if (!initialized){ throw (new Error("ERROR: Component Library not initialized.")); }; try { obj = getSymbolInstance(symbolName); if ((obj is DisplayObject)){ return ((obj as DisplayObject)); } else { throw (new Error()); }; } catch(e:Error) { trace((("Library Symbol '" + symbolName) + "' is not a Display Object")); }; return (null); } protected function checkEvent(_arg1:TimerEvent):void{ if (initialized){ if (!_eventSent){ dispatchEvent(new Event(Event.INIT)); }; _timer.stop(); }; } public function get smoothing():Boolean{ return (_smoothing); } protected function onComplete(_arg1:Event):void{ loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onComplete); } } }//package com.slideroll.ui
Section 34
//LibraryObject (com.slideroll.ui.LibraryObject) package com.slideroll.ui { import flash.display.*; import flash.events.*; public class LibraryObject { protected var _container:Sprite; protected var _mc:Sprite; protected var _library:Library; public function LibraryObject(_arg1:Sprite, _arg2:Library, _arg3:String){ init(_arg1, _arg2, _arg3); } protected function onAdded(_arg1:Event):void{ _mc.removeEventListener(Event.ADDED_TO_STAGE, onAdded); _container = (_mc.parent as Sprite); } protected function getInstances(_arg1:Object=null, _arg2:Sprite=null, _arg3:String=""):Object{ var _local4:DisplayObject; if (_arg2 == null){ _arg2 = _mc; }; if (_arg1 == null){ _arg1 = {}; }; var _local5:int; while (_local5 < _arg2.numChildren) { _local4 = _arg2.getChildAt(_local5); if (_arg3.length > 0){ if (_local4.name.indexOf(_arg3) != -1){ _arg1[_local4.name] = _local4; }; } else { _arg1[_local4.name] = _local4; }; if ((_local4 is Sprite)){ getInstances(_arg1, (_local4 as Sprite), _arg3); }; _local5++; }; return (_arg1); } public function connect(_arg1:Function, _arg2:Sprite=null):void{ var _local3:DisplayObject; if (_arg2 == null){ _arg2 = _mc; }; var _local4:int; while (_local4 < _arg2.numChildren) { _local3 = _arg2.getChildAt(_local4); if ((_local3 is Sprite)){ connect(_arg1, (_local3 as Sprite)); } else { if ((_local3 is SimpleButton)){ SimpleButton(_local3).addEventListener(MouseEvent.CLICK, _arg1); }; }; _local4++; }; } protected function getInstance(_arg1:Sprite=null, _arg2:String=""):DisplayObject{ var _local3:DisplayObject; var _local5:DisplayObject; if (_arg1 == null){ _arg1 = _mc; }; var _local4:int; while (_local4 < _arg1.numChildren) { _local3 = _arg1.getChildAt(_local4); if (_local3.name == _arg2){ return (_local3); }; if ((_local3 is Sprite)){ _local5 = getInstance((_local3 as Sprite), _arg2); if (_local5 != null){ return (_local5); }; }; _local4++; }; return (null); } protected function assign(_arg1:Sprite=null):void{ var child:DisplayObject; var rootmc = _arg1; if (rootmc == null){ rootmc = _mc; }; var i:int; while (i < rootmc.numChildren) { child = rootmc.getChildAt(i); try { if ((((((child.name.length > 0)) && (!((child.name.indexOf("instance") == 0))))) && ((this[child.name] == null)))){ this[child.name] = child; }; } catch(e:Error) { trace((("Warning: LibraryObject does not contain property '" + child.name) + "'")); if (!(e is ReferenceError)){ trace(e.getStackTrace()); }; }; i = (i + 1); }; } protected function init(_arg1:Sprite, _arg2:Library, _arg3:String):void{ _container = _arg1; _library = _arg2; _mc = (_arg2.getDisplayObject(_arg3) as Sprite); assign(); if (((!((_mc == null))) && (!((_container == null))))){ _container.addChild(_mc); } else { if (_mc != null){ _mc.addEventListener(Event.ADDED_TO_STAGE, onAdded); }; }; } protected function getButtons(_arg1:Object=null, _arg2:Sprite=null, _arg3:String=""):Object{ var _local4:DisplayObject; if (_arg2 == null){ _arg2 = _mc; }; if (_arg1 == null){ _arg1 = {}; }; var _local5:int; while (_local5 < _arg2.numChildren) { _local4 = _arg2.getChildAt(_local5); if ((_local4 is Sprite)){ getButtons(_arg1, (_local4 as Sprite), _arg3); } else { if ((_local4 is SimpleButton)){ if (_arg3.length > 0){ if (_local4.name.indexOf(_arg3) != -1){ _arg1[_local4.name] = _local4; }; } else { _arg1[_local4.name] = _local4; }; }; }; _local5++; }; return (_arg1); } public function get mc():Sprite{ return (_mc); } protected function getTopLevelInstances(_arg1:String=""):Object{ var _local2:DisplayObject; var _local3:Object = {}; var _local4:int; while (_local4 < _mc.numChildren) { _local2 = _mc.getChildAt(_local4); if (_arg1.length > 0){ if (_local2.name.indexOf(_arg1) != -1){ _local3[_local2.name] = _local2; }; } else { _local3[_local2.name] = _local2; }; _local4++; }; return (_local3); } public function connectInstance(_arg1:Function, _arg2:Sprite=null, _arg3:String="", _arg4:String=null):DisplayObject{ var _local5:DisplayObject; if (_arg2 == null){ _arg2 = _mc; }; var _local6:int; while (_local6 < _arg2.numChildren) { _local5 = _arg2.getChildAt(_local6); if (_local5.name == _arg3){ if (_arg4 != null){ DisplayObject(_local5).addEventListener(_arg4, _arg1); } else { DisplayObject(_local5).addEventListener(MouseEvent.CLICK, _arg1); }; if ((_local5 is Sprite)){ Sprite(_local5).mouseEnabled = (Sprite(_local5).buttonMode = true); }; return (_local5); } else { if ((_local5 is Sprite)){ connectInstance(_arg1, (_local5 as Sprite), _arg3, _arg4); }; }; _local6++; }; return (null); } } }//package com.slideroll.ui
Section 35
//Position (com.slideroll.ui.Position) package com.slideroll.ui { import flash.display.*; public class Position { private var _collapse:Boolean;// = false private var _align:int; private var _top:int;// = 0 public var defaultPlacement:int;// = 4 private var _margin_right:int; private var _zindex:int;// = 1 private var _margin_left:int; private var cloneParams:Array; private var _margin:int; private var _clear:int; private var _margin_bottom:int; private var _options:Object; private var _overflow:String; private var _margin_top:int; private var _placement:int; private var _left:int;// = 0 public static const PLACEMENT_FLOAT:int = 5; public static const CLEAR_NONE:int = 8; public static const CLEAR_BOTH:int = 11; public static const CLEAR_LEFT:int = 9; public static const ORIENTATION_HORIZONTAL:int = 12; public static const POSITION_LEFT:int = 17; public static const ALIGN_LEFT:int = 1; public static const ORIENTATION_VERTICAL:int = 13; public static const POSITION_ABOVE:int = 14; public static const PLACEMENT_NORMAL:int = 4; public static const ALIGN_RIGHT:int = 3; public static const CLEAR_RIGHT:int = 10; public static const ALIGN_CENTER:int = 2; public static const PLACEMENT_ABSOLUTE:int = 7; public static const POSITION_RIGHT:int = 16; public static const POSITION_BELOW:int = 15; public static const PLACEMENT_FLOAT_RIGHT:int = 6; public static var defaultMarginTop:int = 0; public static var defaultMarginBottom:int = 0; public static var defaultMarginRight:int = 0; public static var defaultMarginLeft:int = 0; public function Position(_arg1:Object=null, _arg2:int=-1, _arg3:int=-1, _arg4:int=-1, _arg5:Object=null, _arg6:Number=NaN, _arg7:Number=NaN, _arg8:Number=NaN, _arg9:Boolean=false){ var _local10:Array; cloneParams = ["_align", "_placement", "_clear", "margin", "_margin_top", "_margin_right", "_margin_bottom", "_margin_left", "_top", "_left", "_zindex", "_collapse", "_overflow"]; super(); _options = _arg1; _align = (((((!((_arg1 == null))) && (!(isNaN(_arg1.align))))) && ((_arg1.align > 0)))) ? _arg1.align : ((_arg2)>0) ? _arg2 : ALIGN_LEFT; _placement = (((((!((_arg1 == null))) && (!(isNaN(_arg1.placement))))) && ((_arg1.placement > 0)))) ? _arg1.placement : ((_arg3)>0) ? _arg3 : defaultPlacement; _clear = (((((!((_arg1 == null))) && (!(isNaN(_arg1.clear))))) && ((_arg1.clear > 0)))) ? _arg1.clear : ((_arg4)>0) ? _arg4 : ((((_placement == PLACEMENT_FLOAT)) || ((_placement == PLACEMENT_FLOAT_RIGHT)))) ? CLEAR_NONE : CLEAR_BOTH; _top = (((!((_arg1 == null))) && (!(isNaN(_arg1.top))))) ? _arg1.top : (isNaN(_arg6)) ? _top : _arg6; _left = (((!((_arg1 == null))) && (!(isNaN(_arg1.left))))) ? _arg1.left : (isNaN(_arg7)) ? _left : _arg7; _zindex = (((!((_arg1 == null))) && (!(isNaN(_arg1.zindex))))) ? _arg1.zindex : (isNaN(_arg8)) ? _zindex : _arg8; _collapse = ((((!((_arg1 == null))) && ((_arg1.collapse == true)))) || ((_arg9 == true))); _overflow = (((!((_arg1 == null))) && (!((_arg1.overflow == undefined))))) ? _arg1.overflow : ""; if (((!((_arg1 == null))) && (!((_arg1.margins == undefined))))){ _arg5 = _arg1.margins; }; if (_arg5 != null){ if (typeof(_arg5) == "number"){ _margin = (_margin_top = (_margin_right = (_margin_bottom = (_margin_left = Number(_arg5))))); } else { if (typeof(_arg5) == "string"){ _local10 = String(_arg5).split(" "); } else { _local10 = (_arg5 as Array); }; _margin_top = (isNaN(_local10[0])) ? 0 : parseInt(_local10[0]); _margin_right = (isNaN(_local10[1])) ? 0 : parseInt(_local10[1]); _margin_bottom = (isNaN(_local10[2])) ? 0 : parseInt(_local10[2]); _margin_left = (isNaN(_local10[3])) ? 0 : parseInt(_local10[3]); }; } else { _margin_top = defaultMarginTop; _margin_right = defaultMarginRight; _margin_bottom = defaultMarginBottom; _margin_left = defaultMarginLeft; }; if (((!((_arg1 == null))) && (!((_arg1.margin_top == undefined))))){ _margin_top = _arg1.margin_top; }; if (((!((_arg1 == null))) && (!((_arg1.margin_right == undefined))))){ _margin_right = _arg1.margin_right; }; if (((!((_arg1 == null))) && (!((_arg1.margin_bottom == undefined))))){ _margin_bottom = _arg1.margin_bottom; }; if (((!((_arg1 == null))) && (!((_arg1.margin_left == undefined))))){ _margin_left = _arg1.margin_left; }; } public function get overflow():String{ return (_overflow); } public function set overflow(_arg1:String):void{ _overflow = _arg1; } public function get align():int{ return (_align); } public function get left():int{ return (_left); } public function set defaultMargins(_arg1:int):void{ if (!isNaN(_arg1)){ defaultMarginTop = (defaultMarginRight = (defaultMarginBottom = (defaultMarginLeft = _arg1))); }; } public function set align(_arg1:int):void{ _align = _arg1; } public function set left(_arg1:int):void{ _left = _arg1; } public function get zindex():int{ return (_zindex); } public function get collapse():Boolean{ return (_collapse); } public function get margin():int{ return (_margin); } public function set zindex(_arg1:int):void{ _zindex = _arg1; } public function set top(_arg1:int):void{ _top = _arg1; } public function get margin_top():int{ return (_margin_top); } public function get margin_right():int{ return (_margin_right); } public function get top():int{ return (_top); } public function get margin_bottom():int{ return (_margin_bottom); } public function clone(_arg1:Object):Position{ var _local3:String; var _local4:int; var _local2:Object = {}; for (_local3 in _options) { _local2[_local3] = _options[_local3]; }; _local4 = 0; while (_local4 < cloneParams.length) { _local3 = cloneParams[_local4]; if (_local3.indexOf("_") == 0){ if ((this[_local3] is Array)){ _local2[_local3] = this[_local3].concat(); } else { _local2[_local3] = this[_local3]; }; }; _local4++; }; for (_local3 in _arg1) { _local2[_local3] = _arg1[_local3]; }; return (new Position(_local2)); } public function get placement():int{ return (_placement); } public function get clear():int{ return (_clear); } public function get margin_left():int{ return (_margin_left); } public static function arrangeContent(_arg1:Cell, _arg2:Boolean=false):void{ var _local3:Component; var _local4:Component; if (((_arg1.collapse) && ((_arg1.lastArrangedChildIndex == -1)))){ _arg1.lastArrangedChildY = _arg1.style.padding; }; if (_arg2){ _arg1.lastArrangedChildIndex = -1; _arg1.lastArrangedChildX = 0; _arg1.lastArrangedChildY = 0; }; var _local5:Number = _arg1.lastArrangedChildY; var _local6:Array = []; var _local7:int = (_arg1.lastArrangedChildIndex + 1); while (_local7 < _arg1.childNodes.length) { _local4 = _arg1.childNodes[_local7]; if ((((((((((((_local3 == null)) || (!((_local4.position.placement == _local3.position.placement))))) || ((_local4.position.clear == CLEAR_LEFT)))) || ((_local4.position.clear == CLEAR_BOTH)))) || ((_local3.position.clear == CLEAR_RIGHT)))) || ((_local3.position.clear == CLEAR_BOTH)))){ if (_local6.length > 0){ if ((((((_local4.position.clear == CLEAR_NONE)) || ((_local4.position.clear == CLEAR_RIGHT)))) && ((((_local3.position.clear == CLEAR_NONE)) || ((_local3.position.clear == CLEAR_LEFT)))))){ alignRow(_arg1, _local6, _arg1.position.align); } else { _local5 = (_local5 + alignRow(_arg1, _local6, _arg1.position.align)); _arg1.lastArrangedChildY = _local5; _arg1.lastArrangedChildIndex = (_local7 - 1); }; _local6 = []; }; }; switch (_local4.position.placement){ case PLACEMENT_FLOAT: _local4.x = _local4.position.margin_left; _local4.y = (_local4.position.margin_top + _local5); _local6.push(_local4); break; case PLACEMENT_FLOAT_RIGHT: _local4.x = ((_arg1.width - _local4.width) - _arg1.position.margin_right); _local4.y = (_local4.position.margin_top + _local5); _local6.push(_local4); break; case PLACEMENT_ABSOLUTE: _local4.x = _local4.position.left; _local4.y = _local4.position.top; break; case PLACEMENT_NORMAL: switch (_arg1.position.align){ case Position.ALIGN_LEFT: _local4.x = _local4.position.margin_left; break; case Position.ALIGN_CENTER: _local4.x = Math.floor(((_arg1.width * 0.5) - (_local4.width * 0.5))); break; case Position.ALIGN_RIGHT: _local4.x = (_arg1.width - _local4.width); break; }; _local4.y = (_local4.position.margin_top + _local5); _local5 = (_local5 + ((_local4.position.margin_top + _local4.height) + _local4.position.margin_bottom)); _arg1.lastArrangedChildY = _local5; _arg1.lastArrangedChildIndex = _local7; break; }; _local3 = _local4; _local7++; }; if (_local6.length > 0){ alignRow(_arg1, _local6, _arg1.position.align); }; if (_arg1.sortChildNodes){ zSort(_arg1); }; } public static function getCellContentHeight(_arg1:Cell):Number{ if (_arg1.childNodes.length == 0){ return (0); }; var _local2:Number = 0; var _local3:Number = (_arg1.childNodes.length - 1); var _local4:Component = _arg1.childNodes[_local3]; while ((((_local4.position.placement == Position.PLACEMENT_ABSOLUTE)) && ((_local3 > 0)))) { _local3--; _local4 = _arg1.childNodes[_local3]; }; if (_local4 != null){ _local2 = Math.floor(((_local4.y + _local4.height) + _local4.position.margin_bottom)); if (_arg1.collapse){ _local2 = (_local2 + _local4.style.padding); }; }; if (isNaN(_local2)){ _local2 = 0; }; return (_local2); } private static function alignRow(_arg1:Cell, _arg2:Array, _arg3:Number):Number{ var _local4:Component; var _local9:int; var _local10:Number; var _local5:Number = _arg1.lastArrangedChildX; var _local6:Number = 0; var _local7:Number = -20; var _local8:Number = 0; if (_arg2[0].position.placement == PLACEMENT_FLOAT_RIGHT){ _arg3 = ALIGN_RIGHT; }; switch (_arg3){ case ALIGN_CENTER: _local10 = 0; _local9 = (_arg2.length - 1); while (_local9 >= 0) { _local4 = _arg2[_local9]; _local10 = (_local10 + (_local4.width + Math.max(_local4.position.margin_right, _local4.position.margin_left))); _local9--; }; _local10 = (_local10 - Math.max(_local4.position.margin_right, _local4.position.margin_left)); _local5 = Math.floor(((_arg1.width * 0.5) - (_local10 * 0.5))); case ALIGN_LEFT: default: _local9 = 0; while (_local9 < _arg2.length) { _local4 = _arg2[_local9]; _arg2[_local9].x = (_local4.position.margin_left + _local5); _local4.y = (_local4.y + _local8); _local5 = (_local5 + ((_local4.position.margin_left + _local4.width) + _local4.position.margin_right)); if (((_arg1.wrap) && (((_local4.x + _local4.width) > _local4.parentCell.width)))){ _local4.x = _local4.position.margin_left; _local5 = ((_local4.position.margin_left + _local4.width) + _local4.position.margin_right); _local4.y = (_local4.y + ((_local4.height + _local4.position.margin_bottom) + _local4.position.margin_top)); _local8 = (_local8 + ((_local4.height + _local4.position.margin_bottom) + _local4.position.margin_top)); }; _local6 = Math.max((_local8 + _local4.height), _local6); _local7 = Math.max(_local4.position.margin_bottom, _local7); _local9++; }; break; case ALIGN_RIGHT: _local5 = _arg1.width; _local9 = (_arg2.length - 1); while (_local9 >= 0) { _local4 = _arg2[_local9]; _local4.x = ((_local5 - _local4.width) - _local4.position.margin_right); _local5 = (_local5 - ((_local4.position.margin_left + _local4.width) + _local4.position.margin_right)); _local6 = Math.max(_local4.height, _local6); _local7 = Math.max(_local4.position.margin_bottom, _local7); _local9--; }; break; }; return ((_local6 + _local7)); } public static function getCellContentWidth(_arg1:Cell):Number{ var _local2:Number = 0; var _local3:int = (_arg1.childNodes.length - 1); while (_local3 >= 0) { _local2 = Math.floor(Math.max(_local2, (Component(_arg1.childNodes[_local3]).x + Component(_arg1.childNodes[_local3]).width))); _local3--; }; return (_local2); } private static function zSort(_arg1:Cell):void{ var cclip:Sprite; var pclip:Sprite; var cell = _arg1; var zChildren:Array = cell.childNodes.concat(); zChildren.sort(function (_arg1:Component, _arg2:Component):Number{ if (_arg1.zindex < _arg2.zindex){ return (-1); }; if (_arg1.zindex > _arg2.zindex){ return (1); }; return (0); }); var i:int = (zChildren.length - 1); while (i > 0) { cclip = Sprite(zChildren[i].mc); pclip = Sprite(zChildren[(i - 1)].mc); cclip.parent.setChildIndex(cclip, i); i = (i - 1); }; } } }//package com.slideroll.ui
Section 36
//Style (com.slideroll.ui.Style) package com.slideroll.ui { import flash.text.*; import flash.system.*; public class Style { private var css:String; private var _fonts:Array; private var _haloColor:Number;// = 0xFF9900 private var _linkColor:Number;// = 3381708 private var _bgGradientRatios:Array; private var _buttonDropShadow:Boolean;// = false private var _hoverColor:Number;// = 6737151 private var _selectedButtonBorderColor:Number;// = -1 private var _font:String;// = "Verdana" private var _bgGradient:Boolean;// = false private var _borderWidth:Number;// = 4 private var cloneParams:Array; private var _inverseTextColor:Number;// = 26265 private var _buttonFont:String;// = "" private var _titleFont:String;// = "" private var _embedFonts:Boolean;// = false private var _border:Boolean;// = true private var _fontSize:Number;// = 12 private var _unselectedColor:Number; private var _maskAlpha:Number;// = 0.5 private var _maskColor:Number;// = 0 private var _buttonFontSize:Number;// = 12 private var _options:Object; private var _titleFontSize:Number;// = 15 private var _bgGradientHeight:int;// = 0 private var _highlightTextColor:Number;// = 0xFFCC00 private var _titleColor:Number;// = 26265 private var _inactiveTextColor:Number;// = 0xCCCCCC private var _buttonBorderColor:Number;// = -1 private var _gradient:Boolean;// = true private var _backgroundAlpha:Number;// = 1 private var _buttonColor:Number;// = 0xCCCCCC private var _backgroundColor:Number;// = 0xFFFFFF private var _round:Number;// = 8 private var _unselectedTextColor:Number; private var _textColor:Number;// = 0x666666 private var _inactiveColor:Number;// = 0xCCCCCC private var _bgGradientColors:Array; private var _styleSheet:StyleSheet; private var _borderAlpha:Number;// = 1 private var _borderColor:Number;// = 0x333333 private var _padding:Number;// = 6 private var _background:Boolean;// = true private var _buttonTextColor:Number;// = -1 private var _inputColorA:Number;// = 0xDDDDDD private var _inputColorB:Number;// = 0xFFFFFF private var _htmlFont:String;// = "Verdana, Helvetica, Arial" public static const DEFAULT_HTML_FONT:String = "Verdana, Helvetica, Arial"; public function Style(_arg1:Object=null){ cloneParams = ["_textColor", "_titleColor", "_linkColor", "_hoverColor", "_inverseTextColor", "_buttonTextColor", "_backgroundColor", "_inputColorA", "_inputColorB", "_borderColor", "_backgroundAlpha", "_buttonColor", "_buttonBorderColor", "_selectedButtonBorderColor", "_borderAlpha", "_maskColor", "_maskAlpha", "_unselectedColor", "_unselectedTextColor", "_inactiveColor", "_inactiveTextColor", "_haloColor", "_highlightTextColor", "_gradient", "_background", "_border", " _bgGradient", "_bgGradientColors", " _bgGradientRatios", "_bgGradientHeight", "_padding", "_round", "_borderWidth", "_buttonDropShadow", "_fontSize", "_titleFontSize", "_buttonFontSize", "_embedFonts", "_font", "_fonts", "_buttonFont", "_titleFont", "_htmlFont"]; _bgGradientColors = [0xFFFFFF, 0xEEEEEE]; _bgGradientRatios = [0, 0xFF]; _fonts = ["Verdana", "Tahoma", "Arial"]; super(); init(_arg1); } public function get inactiveTextColor():Number{ return (_inactiveTextColor); } public function set hoverColor(_arg1:Number):void{ _hoverColor = _arg1; updateCSS(); } public function set linkColor(_arg1:Number):void{ _linkColor = _arg1; updateColors(); updateCSS(); } public function set haloColor(_arg1:Number):void{ _haloColor = _arg1; } public function set inactiveTextColor(_arg1:Number):void{ _inactiveTextColor = _arg1; } private function init(_arg1:Object=null):void{ var _local2:String; _options = ((_arg1)!=null) ? _arg1 : {}; for (_local2 in _arg1) { if (this[_local2] != undefined){ this[_local2] = _arg1[_local2]; } else { debug((("WARNING: " + _local2) + " does not exist in ui.Style")); }; }; if (_options.haloColor == undefined){ _haloColor = ColorTools.getTintedColor(ColorTools.getInverseColor(_buttonColor), _backgroundColor, 0.2); }; if (_options.inactiveTextColor == undefined){ _inactiveTextColor = ColorTools.getDesaturatedColor(ColorTools.getTintedColor(_inactiveColor, _inverseTextColor, 0.3)); }; if (_options.unselectedTextColor == undefined){ _unselectedTextColor = ColorTools.getTintedColor(_inverseTextColor, _buttonColor, 0.3); }; if (_options.unselectedColor == undefined){ _unselectedColor = ColorTools.getTintedColor(_buttonColor, _borderColor, 0.25); }; if (_styleSheet == null){ _styleSheet = new StyleSheet(); }; updateCSS(); if (Capabilities.os.indexOf("Mac") == -1){ _fonts = ["Verdana", "Arial", "Tahoma"]; } else { _fonts = ["Verdana", "Monaco", "Geneva"]; }; } public function set buttonBorderColor(_arg1:Number):void{ _buttonBorderColor = _arg1; } public function get buttonBorderColor():Number{ return (((_buttonBorderColor)!=-1) ? _buttonBorderColor : ColorTools.getTintedColor(_buttonColor, 0, 0.2)); } public function set round(_arg1:Number):void{ _round = _arg1; } public function get padding():Number{ return (_padding); } public function set bgGradient(_arg1:Boolean):void{ _bgGradient = _arg1; } public function set unselectedColor(_arg1:Number):void{ _unselectedColor = _arg1; } public function get gradient():Boolean{ return (_gradient); } public function set padding(_arg1:Number):void{ _padding = _arg1; } public function set borderAlpha(_arg1:Number):void{ _borderAlpha = _arg1; } public function set borderColor(_arg1:Number):void{ _borderColor = _arg1; updateColors(); } public function get textColor():Number{ return (_textColor); } public function get buttonTextColor():Number{ return (((_buttonTextColor)!=-1) ? _buttonTextColor : _inverseTextColor); } public function get background():Boolean{ return (_background); } public function get bgGradientHeight():int{ return (_bgGradientHeight); } public function set bgGradientHeight(_arg1:int):void{ _bgGradientHeight = _arg1; } public function get buttonFontSize():Number{ return (_buttonFontSize); } public function get border():Boolean{ return (_border); } public function set buttonFont(_arg1:String):void{ _buttonFont = _arg1; } public function get buttonColor():Number{ return (_buttonColor); } public function set inputColorB(_arg1:Number):void{ _inputColorB = _arg1; } public function set selectedButtonBorderColor(_arg1:Number):void{ _selectedButtonBorderColor = _arg1; } public function set inputColorA(_arg1:Number):void{ _inputColorA = _arg1; } private function debug(_arg1:String):void{ } public function get styleSheet():StyleSheet{ return (_styleSheet); } public function set embedFonts(_arg1:Boolean):void{ _embedFonts = _arg1; } public function get font():String{ return (_font); } public function set border(_arg1:Boolean):void{ _border = _arg1; if (!_border){ _borderWidth = 0; }; } public function set gradient(_arg1:Boolean):void{ _gradient = _arg1; } public function get unselectedTextColor():Number{ return (_unselectedTextColor); } public function set background(_arg1:Boolean):void{ _background = _arg1; } public function clone(_arg1:Object=null):Style{ var _local3:String; var _local4:int; var _local2:Object = {}; for (_local3 in _options) { _local2[_local3] = _options[_local3]; }; _local4 = 0; while (_local4 < cloneParams.length) { _local3 = cloneParams[_local4]; if (_local3.indexOf("_") == 0){ if ((this[_local3] is Array)){ _local2[_local3] = this[_local3].concat(); } else { _local2[_local3] = this[_local3]; }; }; _local4++; }; if (_arg1 != null){ for (_local3 in _arg1) { _local2[_local3] = _arg1[_local3]; }; for (_local3 in _arg1) { _local2[("_" + _local3)] = _arg1[_local3]; }; }; return (new Style(_local2)); } public function get bgGradientColors():Array{ return (_bgGradientColors); } public function set buttonTextColor(_arg1:Number):void{ _buttonTextColor = _arg1; } public function set styleSheet(_arg1:StyleSheet):void{ _styleSheet = _arg1; } public function set textColor(_arg1:Number):void{ _textColor = _arg1; _inverseTextColor = ColorTools.getInverseColor(_textColor); updateColors(); updateCSS(); } public function set htmlFont(_arg1:String):void{ _htmlFont = _arg1; updateCSS(); } public function get titleFontSize():Number{ return (_titleFontSize); } public function set inactiveColor(_arg1:Number):void{ _inactiveColor = _arg1; } public function getFontsAsString():String{ return (((_font + ", ") + _fonts.join(", "))); } public function set bgGradientRatios(_arg1:Array):void{ _bgGradientRatios = _arg1; } public function set buttonDropShadow(_arg1:Boolean):void{ _buttonDropShadow = _arg1; } public function set buttonFontSize(_arg1:Number):void{ _buttonFontSize = _arg1; } public function get hoverColor():Number{ return (_hoverColor); } public function get linkColor():Number{ return (_linkColor); } public function get round():Number{ return (_round); } public function set titleFont(_arg1:String):void{ _titleFont = _arg1; } public function get borderColor():Number{ return ((isNaN(_borderColor)) ? _textColor : _borderColor); } public function get bgGradient():Boolean{ return (_bgGradient); } public function get haloColor():Number{ return (_haloColor); } public function set buttonColor(_arg1:Number):void{ _buttonColor = _arg1; updateColors(); } public function set backgroundAlpha(_arg1:Number):void{ _backgroundAlpha = _arg1; } public function get inputColorA():Number{ return (_inputColorA); } public function get inputColorB():Number{ return (_inputColorB); } public function set backgroundColor(_arg1:Number):void{ _backgroundColor = _arg1; updateColors(); updateCSS(); } public function set maskAlpha(_arg1:Number):void{ _maskAlpha = _arg1; } public function set maskColor(_arg1:Number):void{ _maskColor = _arg1; } public function get selectedButtonBorderColor():Number{ return (((_selectedButtonBorderColor)!=-1) ? _selectedButtonBorderColor : _inverseTextColor); } public function get embedFonts():Boolean{ return (_embedFonts); } private function updateCSS():void{ if (_styleSheet == null){ _styleSheet = new StyleSheet(); }; var _local1:String = ColorTools.numberToHTMLColor(_titleColor); var _local2:String = ColorTools.numberToHTMLColor(_textColor); var _local3:String = ColorTools.numberToHTMLColor(_linkColor); var _local4:String = ColorTools.numberToHTMLColor(_hoverColor); var _local5:String = ColorTools.numberToHTMLColor(ColorTools.getTintedColor(textColor, backgroundColor, 0.5)); var _local6:String = ColorTools.numberToHTMLColor(ColorTools.getTintedColor(_titleColor, backgroundColor, 0.2)); css = ""; css = (css + (((((((("h1 { font-family: " + _htmlFont) + "; font-weight: bold; font-size: ") + Math.min(18, (titleFontSize * 2))) + "px; color: ") + _local1) + "; leading: ") + Math.ceil((Math.min(18, (titleFontSize * 2)) / 3))) + "px; } ")); css = (css + (((((((("h2 { font-family: " + _htmlFont) + "; font-weight: bold; font-size: ") + (titleFontSize + 6)) + "px; color: ") + _local1) + "; leading: ") + Math.ceil(((titleFontSize + 6) / 3))) + "px; } ")); css = (css + (((((((("h3 { font-family: " + _htmlFont) + "; font-weight: bold; font-size: ") + titleFontSize) + "px; color: ") + _local1) + "; leading: ") + Math.ceil((titleFontSize / 3))) + "px; } ")); css = (css + (((((((("h4 { font-family: " + _htmlFont) + "; font-weight: bold; font-size: ") + Math.ceil(((fontSize + titleFontSize) / 2))) + "px; color: ") + _local1) + "; leading: ") + Math.ceil(((fontSize + titleFontSize) / 6))) + "px; } ")); css = (css + (("h5 { font-weight: bold; font-size: 11px; leading: 0; color: " + _local6) + "; } ")); css = (css + (((((("p { font-family: " + _htmlFont) + "; font-weight: normal; font-size: ") + fontSize) + "px; color: ") + _local2) + "; leading: 2px; } ")); css = (css + (("a { font-weight: bold; color: " + _local3) + "; text-decoration: underline; } ")); css = (css + (("a:hover { font-weight: bold; color: " + _local4) + "; textDecoration: underline; } ")); css = (css + ((".litelink { font-weight: bold; color: " + _local3) + "; text-decoration: none; } ")); css = (css + ((".litelink:hover { font-weight: bold; color: " + _local4) + "; textDecoration: none; } ")); css = (css + ((((((".note { font-family: Monaco, " + _htmlFont) + "; font-weight: normal; font-size: ") + Math.max(12, (_fontSize - 2))) + "px; color: ") + _local5) + "; leading: 0px; } ")); css = (css + ((((((".numeric { font-family: Monaco, Lucida Sans Unicode," + _htmlFont) + "; font-weight: normal; font-size: ") + Math.max(12, (_fontSize - 2))) + "px; color: ") + _local2) + "; leading: 2px; } ")); if (!_styleSheet.parseCSS(css)){ debug("CSS error!"); }; } public function get borderAlpha():Number{ return (_borderAlpha); } public function set font(_arg1:String):void{ _font = _arg1; } public function get inactiveColor():Number{ return (_inactiveColor); } private function updateColors():void{ if (_options.haloColor == undefined){ _haloColor = ColorTools.getTintedColor(ColorTools.getInverseColor(_buttonColor), _backgroundColor, 0.2); }; if (_options.inactiveTextColor == undefined){ inactiveTextColor = ColorTools.getTintedColor(_inactiveColor, 0, 0.3); }; if (_options.unselectedTextColor == undefined){ _unselectedTextColor = ColorTools.getTintedColor(_inverseTextColor, _buttonColor, 0.3); }; if (_options.unselectedColor == undefined){ _unselectedColor = ColorTools.getTintedColor(_buttonColor, _borderColor, 0.25); }; if (_options.highlightTextColor == undefined){ _highlightTextColor = ColorTools.getTintedColor(ColorTools.getInverseColor(_linkColor), ColorTools.getInverseColor(_backgroundColor), 0.2); }; if (_options.hoverColor == undefined){ _hoverColor = ColorTools.getTintedColor(_linkColor, 0xFFFFFF, 0.3); }; } public function get unselectedColor():Number{ return (_unselectedColor); } public function get bgGradientRatios():Array{ return (_bgGradientRatios); } public function get buttonDropShadow():Boolean{ return (_buttonDropShadow); } public function get buttonFont():String{ return (((_buttonFont.length)>0) ? _buttonFont : _font); } public function get titleFont():String{ return (((_titleFont.length)>0) ? _titleFont : _font); } public function set unselectedTextColor(_arg1:Number):void{ _unselectedTextColor = _arg1; } public function set inverseTextColor(_arg1:Number):void{ _inverseTextColor = _arg1; } public function get backgroundAlpha():Number{ return (_backgroundAlpha); } public function setFont(_arg1:Number):void{ if (_fonts[_arg1] != null){ _font = _fonts[_arg1]; }; } public function get backgroundColor():Number{ return (_backgroundColor); } public function set titleColor(_arg1:Number):void{ _titleColor = _arg1; updateColors(); updateCSS(); } public function get maskColor():Number{ return (_maskColor); } public function set titleFontSize(_arg1:Number):void{ _titleFontSize = _arg1; } public function set fontSize(_arg1:Number):void{ _fontSize = _arg1; updateCSS(); } public function get highlightTextColor():Number{ return (_highlightTextColor); } public function get inverseTextColor():Number{ return (_inverseTextColor); } public function get titleColor():Number{ return (_titleColor); } public function set bgGradientColors(_arg1:Array):void{ _bgGradientColors = _arg1; } public function get htmlFont():String{ return (_htmlFont); } public function get fontSize():Number{ return (_fontSize); } public function set highlightTextColor(_arg1:Number):void{ _highlightTextColor = _arg1; } public function get maskAlpha():Number{ return (_maskAlpha); } public function get borderWidth():Number{ return (_borderWidth); } public function set borderWidth(_arg1:Number):void{ _borderWidth = _arg1; } } }//package com.slideroll.ui
Section 37
//Tagtip (com.slideroll.ui.Tagtip) package com.slideroll.ui { import flash.display.*; import flash.events.*; import flash.text.*; import flash.utils.*; public class Tagtip { private static var _container:Sprite; private static var padding:Number; private static var showMaxTime:Number = 2500; private static var _initialized:Boolean; private static var borderColor:Number; private static var _mcBgShadow:Sprite; private static var heightOffset:Number; private static var bkgdColor:Number; private static var borderThickness:Number; private static var border:Boolean = false; private static var _tipText:TextField; private static var _mc:Sprite; private static var textColor:Number; public static var showing:Boolean = false; private static var _width:Number = 150; private static var cornerRadius:Number; private static var embed:Boolean = false; private static var _mcBg:Sprite; private static var fontSize:Number = 10; private static var showTime:Number = 0; private static var _tipFormat:TextFormat; private static var fontName:String = "Verdana"; private static var arrowRadius:Number; private static var _stage:Stage; public static function destroy():void{ if (((((!((_mc == null))) && (!((_container == null))))) && (!((_container.getChildIndex(_mc) == -1))))){ _container.removeChild(_mc); }; } public static function followMouse(_arg1:Event):void{ if (!_mc){ return; }; _mc.x = (_container.mouseX >> 0); _mc.y = ((_container.mouseY + heightOffset) >> 0); drawTag(); if ((getTimer() - showTime) > showMaxTime){ _mc.alpha = (Math.max(0, (100 - (((getTimer() - showTime) - showMaxTime) / 5))) / 100); if (_mc.alpha <= 0){ hideTag(); }; }; } private static function makeTextField():void{ _tipFormat = new TextFormat(); _tipFormat.align = "center"; _tipFormat.font = fontName; _tipFormat.size = fontSize; _tipFormat.color = textColor; _tipText = new TextField(); _tipText.width = _width; _tipText.height = parseInt((_tipFormat.size as String)); _mc.addChild(_tipText); _tipText.embedFonts = embed; _tipText.selectable = false; _tipText.multiline = true; _tipText.wordWrap = true; _tipText.autoSize = "center"; _tipText.mouseEnabled = false; _tipText.text = ""; _tipText.setTextFormat(_tipFormat); } public static function initialize(_arg1:Stage):void{ if (_initialized){ return; }; _stage = _arg1; _container = new Sprite(); _container.mouseEnabled = (_container.mouseChildren = false); _stage.addChild(_container); cornerRadius = 4; arrowRadius = 10; padding = 4; heightOffset = -4; bkgdColor = 0x333333; border = true; borderColor = 0x666666; textColor = 0xFFFFFF; borderThickness = 2; _mc = new Sprite(); _mc.mouseEnabled = (_mc.mouseChildren = false); _container.addChild(_mc); makeTextField(); _mc.visible = false; _initialized = true; } private static function drawTag():void{ var _local7:Graphics; if (!_mc){ return; }; var _local1:Number = (_tipText.y - 2); var _local2:Number = ((_tipText.width + padding) + 10); var _local3:Number = (_tipText.height + padding); var _local4:Number = arrowRadius; var _local5:Number = arrowRadius; var _local6:Number = Math.max(((0 - (_container.mouseX - 20)) + (_tipText.width / 2)), Math.min(0, ((_stage.stageWidth - (_container.mouseX + 20)) - (_tipText.width / 2)))); _tipText.x = (_local6 - (_tipText.width / 2)); if (_mcBg == null){ _mcBgShadow = new Sprite(); _mcBgShadow.mouseEnabled = false; _mc.addChild(_mcBgShadow); _mcBg = new Sprite(); _mcBg.mouseEnabled = false; _mc.addChild(_mcBg); } else { _mcBg.graphics.clear(); _mcBgShadow.graphics.clear(); }; _local7 = _mcBg.graphics; _local7.beginFill(bkgdColor, 1); if (border == true){ _local7.lineStyle(borderThickness, borderColor, 1, true); }; _local7.moveTo((((_local6 + 0) - (_local2 / 2)) + cornerRadius), _local1); _local7.lineTo(((_local6 + (_local2 / 2)) - cornerRadius), _local1); _local7.curveTo((_local6 + (_local2 / 2)), _local1, (_local6 + (_local2 / 2)), (_local1 + cornerRadius)); _local7.lineTo((_local6 + (_local2 / 2)), (_local1 + cornerRadius)); _local7.lineTo((_local6 + (_local2 / 2)), ((_local1 + _local3) - cornerRadius)); _local7.curveTo((_local6 + (_local2 / 2)), (_local1 + _local3), ((_local6 + (_local2 / 2)) - cornerRadius), (_local1 + _local3)); _local7.lineTo(((_local6 + (_local2 / 2)) - cornerRadius), (_local1 + _local3)); _local7.lineTo((_local4 / 2), (_local1 + _local3)); _local7.lineTo(0, 0); _local7.lineTo((0 - (_local4 / 2)), (_local1 + _local3)); _local7.lineTo((((_local6 + 0) - (_local2 / 2)) + cornerRadius), (_local1 + _local3)); _local7.curveTo(((_local6 + 0) - (_local2 / 2)), (_local1 + _local3), ((_local6 + 0) - (_local2 / 2)), ((_local1 + _local3) - cornerRadius)); _local7.lineTo(((_local6 + 0) - (_local2 / 2)), ((_local1 + _local3) - cornerRadius)); _local7.lineTo(((_local6 + 0) - (_local2 / 2)), (_local1 + cornerRadius)); _local7.curveTo(((_local6 + 0) - (_local2 / 2)), _local1, (((_local6 + 0) - (_local2 / 2)) + cornerRadius), _local1); _local7.lineTo((((_local6 + 0) - (_local2 / 2)) + cornerRadius), _local1); _local7.endFill(); _mcBgShadow.x = (_mcBgShadow.y = 4); _local7 = _mcBgShadow.graphics; _local7.beginFill(0, 0.1); _local7.moveTo((((_local6 + 0) - (_local2 / 2)) + cornerRadius), _local1); _local7.lineTo(((_local6 + (_local2 / 2)) - cornerRadius), _local1); _local7.curveTo((_local6 + (_local2 / 2)), _local1, (_local6 + (_local2 / 2)), (_local1 + cornerRadius)); _local7.lineTo((_local6 + (_local2 / 2)), (_local1 + cornerRadius)); _local7.lineTo((_local6 + (_local2 / 2)), ((_local1 + _local3) - cornerRadius)); _local7.curveTo((_local6 + (_local2 / 2)), (_local1 + _local3), ((_local6 + (_local2 / 2)) - cornerRadius), (_local1 + _local3)); _local7.lineTo(((_local6 + (_local2 / 2)) - cornerRadius), (_local1 + _local3)); _local7.lineTo((_local4 / 2), (_local1 + _local3)); _local7.lineTo(0, 0); _local7.lineTo((0 - (_local4 / 2)), (_local1 + _local3)); _local7.lineTo((((_local6 + 0) - (_local2 / 2)) + cornerRadius), (_local1 + _local3)); _local7.curveTo(((_local6 + 0) - (_local2 / 2)), (_local1 + _local3), ((_local6 + 0) - (_local2 / 2)), ((_local1 + _local3) - cornerRadius)); _local7.lineTo(((_local6 + 0) - (_local2 / 2)), ((_local1 + _local3) - cornerRadius)); _local7.lineTo(((_local6 + 0) - (_local2 / 2)), (_local1 + cornerRadius)); _local7.curveTo(((_local6 + 0) - (_local2 / 2)), _local1, (((_local6 + 0) - (_local2 / 2)) + cornerRadius), _local1); _local7.lineTo((((_local6 + 0) - (_local2 / 2)) + cornerRadius), _local1); _local7.endFill(); _mc.setChildIndex(_tipText, 2); } public static function showTag(_arg1:String):void{ if (!_mc){ return; }; _container.parent.setChildIndex(_container, (_container.parent.numChildren - 1)); if (((((!(showing)) && ((_arg1.length > 0)))) && (!((_arg1 == "undefined"))))){ showing = true; _tipText.text = _arg1; _tipText.setTextFormat(_tipFormat); _tipText.y = (0 - (_tipText.height + 10)); _mc.x = _container.mouseX; _mc.y = _container.mouseY; drawTag(); _mc.visible = true; _mc.alpha = 1; showTime = getTimer(); _mc.addEventListener(Event.ENTER_FRAME, followMouse, false, 0, true); } else { hideTag(); }; } public static function hideTag():void{ if (showing){ if (!_mc){ return; }; showing = false; _mc.visible = false; _mc.alpha = 1; _mc.removeEventListener(Event.ENTER_FRAME, followMouse); }; } } }//package com.slideroll.ui
Section 38
//Tween (com.slideroll.ui.Tween) package com.slideroll.ui { import com.robertpenner.easing.*; public class Tween { private var _loop:Boolean;// = false private var _delay:Number; private var tweenClassRef:Object; private var _yoyo:Boolean;// = false private var _groupID:int; private var _attribute:String; public var priority:int;// = 1 private var _easeType:uint;// = 0 private var _doneHandler:Function; private var _time:Number; private var _parentClass:TweenManager; private var _delta:Number; private var _id:int; private var _startVal:Number; private var _started:Boolean;// = false private var _tweenObject:Object; private var _startTime:Number; private var _loops:int;// = 0 private var _loopsCompleted:int;// = 0 private var _done:Boolean;// = false private var _easeStyle:uint;// = 0 private var _endVal:Number; private var _startHandler:Function; private var easeMethod:String;// = "easeIn" private var _duration:Number; public static var STYLE_CIRC:uint = 7; public static var STYLE_ELASTIC:uint = 8; public static var STYLE_LINEAR:uint = 0; public static var STYLE_BACK:uint = 9; public static var EASE_IN:uint = 0; public static var EASE_INOUT:uint = 2; public static var EASE_OUT:uint = 1; public static var STYLE_EXPO:uint = 6; public static var STYLE_BOUNCE:uint = 10; public static var STYLE_QUART:uint = 3; public static var STYLE_QUAD:uint = 2; public static var STYLE_SINE:uint = 5; public static var STYLE_CUBIC:uint = 1; public static var STYLE_QUINT:uint = 4; public function Tween(_arg1:TweenManager, _arg2:Object, _arg3:String, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=1, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:int=0, _arg10:Number=0, _arg11:uint=0, _arg12:uint=0, _arg13:Function=null, _arg14:Function=null){ init(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14); } private function onDone():void{ if (_doneHandler != null){ _doneHandler(this); }; clear(); } public function get tweenObject():Object{ return (_tweenObject); } private function init(_arg1:TweenManager, _arg2:Object, _arg3:String, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=1, _arg7:Boolean=false, _arg8:Boolean=false, _arg9:int=0, _arg10:Number=0, _arg11:uint=0, _arg12:uint=0, _arg13:Function=null, _arg14:Function=null):void{ _parentClass = _arg1; _id = _parentClass.newTweenID; _groupID = _parentClass.currentGroupID; _tweenObject = _arg2; _attribute = _arg3; _startVal = (isNaN(_arg4)) ? _arg2[_arg3] : _arg4; if (isNaN(_startVal)){ _parentClass.removeTween(this); return; }; _endVal = _arg5; _delta = (_endVal - _startVal); _duration = _arg6; _loop = _arg7; _yoyo = _arg8; _loops = _arg9; _delay = _arg10; if (_duration < 100){ _duration = (_duration * 1000); }; if (_delay < 100){ _delay = (_delay * 1000); }; _easeType = _arg11; _easeStyle = _arg12; _startHandler = _arg13; _doneHandler = _arg14; tweenClassRef = getTweenClass(_easeStyle); getEaseMethod(); } public function get attribute():String{ return (_attribute); } public function get id():int{ return (_id); } private function onStart():void{ if (_startHandler != null){ _startHandler(this); }; } public function clear():void{ _parentClass.removeTween(this); } public function get groupID():int{ return (_groupID); } private function getEaseMethod():void{ switch (_easeType){ case Tween.EASE_IN: easeMethod = "easeIn"; break; case Tween.EASE_OUT: easeMethod = "easeOut"; break; case Tween.EASE_INOUT: easeMethod = "easeInOut"; break; }; } public function ease():void{ var _local1:Number; var _local3:Number; if (isNaN(_startTime)){ _startTime = (_parentClass.time + _delay); }; _time = (_parentClass.time - _startTime); if (_time < 0){ return; }; if (!_started){ onStart(); }; _started = true; var _local2:Number = 0; if (((_done) || ((_tweenObject == null)))){ clear(); return; }; if (_time <= _duration){ _local2 = _time; } else { _local2 = _duration; _done = true; }; if (tweenClassRef == null){ return; }; _local1 = tweenClassRef[easeMethod](_local2, _startVal, _delta, _duration); if (_tweenObject != null){ _tweenObject[attribute] = _local1; }; if (_done){ if (_loop){ _loopsCompleted++; if ((((_loops == 0)) || ((_loopsCompleted < _loops)))){ _done = false; _startTime = _parentClass.time; if (_yoyo){ _local3 = _endVal; _endVal = _startVal; _startVal = _local3; _delta = (_endVal - _startVal); if (_easeType == EASE_IN){ _easeType = EASE_OUT; } else { if (_easeType == EASE_OUT){ _easeType = EASE_IN; }; }; }; }; }; }; if (_done){ onDone(); }; } public static function getTweenClass(_arg1:int):Class{ switch (_arg1){ case Tween.STYLE_LINEAR: return (Linear); case Tween.STYLE_CUBIC: return (Cubic); case Tween.STYLE_QUAD: return (Quad); case Tween.STYLE_QUART: return (Quart); case Tween.STYLE_QUINT: return (Quint); case Tween.STYLE_SINE: return (Sine); case Tween.STYLE_EXPO: return (Expo); case Tween.STYLE_CIRC: return (Circ); case Tween.STYLE_ELASTIC: return (Elastic); case Tween.STYLE_BACK: return (Back); case Tween.STYLE_BOUNCE: return (Bounce); }; return (Linear); } } }//package com.slideroll.ui
Section 39
//TweenManager (com.slideroll.ui.TweenManager) package com.slideroll.ui { import flash.display.*; import flash.events.*; import flash.utils.*; public class TweenManager { private var _lastTweenGroupID:int;// = 0 private var _tweens:Array; private var _lastTweenID:int;// = 0 private var _currentTime:int;// = 0 public function TweenManager(_arg1:Boolean=false){ init(_arg1); } public function stop():void{ Component.mainStage.removeEventListener(Event.ENTER_FRAME, update); } public function align(_arg1:Array, _arg2:String, _arg3:Number):void{ var _local4:Object; for (_local4 in _arg1) { _local4[_arg2] = _arg3; }; } public function get newTweenID():int{ _lastTweenID++; return (_lastTweenID); } public function update(_arg1:Event):void{ var _local2:Tween; _currentTime = getTimer(); for each (_local2 in _tweens) { _local2.ease(); }; } public function createTweens(_arg1:Array, _arg2:Object, _arg3:Object, _arg4:Number=1, _arg5:Boolean=false, _arg6:Boolean=false, _arg7:int=0, _arg8:Number=0, _arg9:uint=0, _arg10:uint=0, _arg11:Function=null, _arg12:Function=null):int{ var _local13:Number; var _local14:int; var _local15:String; var _local16:Object; advanceGroupID(); for each (_local16 in _arg1) { if (_local16 != null){ if ((_arg3 is Array)){ _local14 = _arg1.indexOf(_local16); if (_arg3[_local14] != null){ for (_local15 in _arg3[_local14]) { _local13 = (((!((_arg2[_local14] == null))) && (!(isNaN(_arg2[_local14][_local15]))))) ? _arg2[_local14][_local15] : (isNaN(_local16[_local15])) ? NaN : _local16[_local15]; createTween(_local16, _local15, _local13, _arg3[_local14][_local15], _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _lastTweenGroupID); }; }; } else { for (_local15 in _arg3) { _local13 = (isNaN(_arg2[_local15])) ? (isNaN(_local16[_local15])) ? NaN : _local16[_local15] : _arg2[_local15]; createTween(_local16, _local15, _local13, _arg3[_local15], _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _lastTweenGroupID); }; }; }; }; return (_lastTweenGroupID); } public function get time():int{ return (_currentTime); } public function createTween(_arg1:Object, _arg2:String, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=1, _arg6:Boolean=false, _arg7:Boolean=false, _arg8:int=0, _arg9:Number=0, _arg10:uint=0, _arg11:uint=0, _arg12:Function=null, _arg13:Function=null, _arg14:int=0):int{ if (_arg14 == 0){ advanceGroupID(); }; if (_arg9 == 0){ removeTweenOnObjectWithAttribute(_arg1, _arg2); }; _tweens.push(new Tween(this, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13)); return (_lastTweenGroupID); } private function init(_arg1:Boolean=false):void{ _tweens = []; if (_arg1){ start(); }; } public function removeTweenOnObjectWithAttribute(_arg1:Object, _arg2:String):void{ var _local3:Tween; for each (_local3 in _tweens) { if ((((_local3.tweenObject == _arg1)) && ((_local3.attribute == _arg2)))){ _tweens.splice(_tweens.indexOf(_local3), 1); break; }; }; } public function removeTween(_arg1:Tween):void{ var _local2:Tween; for each (_local2 in _tweens) { if (_local2.id == _arg1.id){ _tweens.splice(_tweens.indexOf(_local2), 1); break; }; }; } public function end():void{ stop(); clearAllTweens(); } public function clearAllTweens():void{ _tweens = []; } public function fadeOutObject(_arg1:DisplayObject, _arg2:Number=1):void{ var obj = _arg1; var time = _arg2; createTween(obj, "alpha", obj.alpha, 0, time, false, false, 0, 0, 0, 0, null, function ():void{ obj.visible = false; }); } public function get currentGroupID():int{ return (_lastTweenGroupID); } public function start():void{ Component.mainStage.addEventListener(Event.ENTER_FRAME, update, false, 2); } public function removeTweensOnObject(_arg1:Object):void{ var _local2:Tween; for each (_local2 in _tweens) { if (_local2.tweenObject == _arg1){ _tweens.splice(_tweens.indexOf(_local2), 1); }; }; } public function fadeInObject(_arg1:DisplayObject, _arg2:Number=1):void{ var obj = _arg1; var time = _arg2; createTween(obj, "alpha", obj.alpha, 1, time, false, false, 0, 0, 0, 0, function ():void{ obj.visible = true; }); } private function advanceGroupID():void{ _lastTweenGroupID++; } public function removeTweenGroup(_arg1:int):void{ var _local2:Tween; for each (_local2 in _tweens) { if (_local2.groupID == _arg1){ _tweens.splice(_tweens.indexOf(_local2), 1); }; }; } } }//package com.slideroll.ui
Section 40
//ObjectEvent (com.slideroll.util.ObjectEvent) package com.slideroll.util { import flash.events.*; public dynamic class ObjectEvent extends Event { public var object:Object; public function ObjectEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Object=null){ super(_arg1, _arg2, _arg3); this.object = _arg4; } override public function toString():String{ return (formatToString("ObjectEvent", "type", "bubbles", "cancelable", object)); } override public function clone():Event{ return (new ObjectEvent(type, bubbles, cancelable, object)); } } }//package com.slideroll.util
Section 41
//SignString (com.slideroll.util.SignString) package com.slideroll.util { public class SignString { private static var radix:Number = 8; private static var sA:String = "dc49359cd64413cd97e6d7c45df69dc6"; private static var sB:String = "0781fef3e698f76976bf45e4f896f87c"; private static var cap:Boolean = false; private static function f10(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{ return (f9(f11(f9(f9(_arg2, _arg1), f9(_arg4, _arg6)), _arg5), _arg3)); } private static function f11(_arg1:Number, _arg2:Number):Number{ return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2)))); } private static function f14():void{ sA = f1(sB); } private static function f15(_arg1:String):String{ return (f1((_arg1 + sA))); } private static function f1(_arg1:String):String{ return (f4(f3(f2(_arg1), (_arg1.length * radix)))); } private static function f2(_arg1:String):Array{ var _local2:Array = []; var _local3:Number = ((1 << radix) - 1); var _local4:int; while (_local4 < (_arg1.length * radix)) { _local2[(_local4 >> 5)] = (_local2[(_local4 >> 5)] | ((_arg1.charCodeAt((_local4 / radix)) & _local3) << (_local4 % 32))); _local4 = (_local4 + radix); }; return (_local2); } private static function f3(_arg1:Array, _arg2:Number):Array{ var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; _arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32))); _arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2; var _local3:Number = 1732584193; var _local4:Number = -271733879; var _local5:Number = -1732584194; var _local6:Number = 271733878; var _local7:Number = 0; while (_local7 < _arg1.length) { _local8 = _local3; _local9 = _local4; _local10 = _local5; _local11 = _local6; _local3 = f5(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936); _local6 = f5(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586); _local5 = f5(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819); _local4 = f5(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330); _local3 = f5(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897); _local6 = f5(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426); _local5 = f5(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341); _local4 = f5(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983); _local3 = f5(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416); _local6 = f5(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417); _local5 = f5(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063); _local4 = f5(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162); _local3 = f5(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682); _local6 = f5(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101); _local5 = f5(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290); _local4 = f5(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329); _local3 = f6(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510); _local6 = f6(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632); _local5 = f6(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713); _local4 = f6(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302); _local3 = f6(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691); _local6 = f6(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083); _local5 = f6(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335); _local4 = f6(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848); _local3 = f6(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438); _local6 = f6(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690); _local5 = f6(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961); _local4 = f6(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501); _local3 = f6(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467); _local6 = f6(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784); _local5 = f6(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473); _local4 = f6(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734); _local3 = f7(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558); _local6 = f7(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463); _local5 = f7(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562); _local4 = f7(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556); _local3 = f7(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060); _local6 = f7(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353); _local5 = f7(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632); _local4 = f7(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640); _local3 = f7(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174); _local6 = f7(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222); _local5 = f7(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979); _local4 = f7(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189); _local3 = f7(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487); _local6 = f7(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835); _local5 = f7(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520); _local4 = f7(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651); _local3 = f8(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844); _local6 = f8(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415); _local5 = f8(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905); _local4 = f8(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055); _local3 = f8(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571); _local6 = f8(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606); _local5 = f8(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523); _local4 = f8(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799); _local3 = f8(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359); _local6 = f8(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744); _local5 = f8(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380); _local4 = f8(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649); _local3 = f8(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070); _local6 = f8(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379); _local5 = f8(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259); _local4 = f8(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551); _local3 = f9(_local3, _local8); _local4 = f9(_local4, _local9); _local5 = f9(_local5, _local10); _local6 = f9(_local6, _local11); _local7 = (_local7 + 16); }; return (new Array(_local3, _local4, _local5, _local6)); } private static function f6(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{ return (f10(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7)); } private static function f7(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{ return (f10(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7)); } private static function f4(_arg1:Array):String{ var _local2:String = (cap) ? "0123456789ABCDEF" : "0123456789abcdef"; var _local3 = ""; var _local4:Number = 0; while (_local4 < (_arg1.length * 4)) { _local3 = (_local3 + (_local2.charAt(((_arg1[(_local4 >> 2)] >> (((_local4 % 4) * 8) + 4)) & 15)) + _local2.charAt(((_arg1[(_local4 >> 2)] >> ((_local4 % 4) * 8)) & 15)))); _local4++; }; return (_local3); } private static function f5(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{ return (f10(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7)); } private static function f8(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{ return (f10((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7)); } private static function f9(_arg1:Number, _arg2:Number):Number{ var _local3:Number = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF)); var _local4:Number = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16)); return (((_local4 << 16) | (_local3 & 0xFFFF))); } public static function sign(_arg1:String):String{ return (f15(_arg1)); } } }//package com.slideroll.util
Section 42
//StringUtils (com.slideroll.util.StringUtils) package com.slideroll.util { import flash.utils.*; public class StringUtils { public static const HTML_ENTITIES:uint = 1; public static const HTML_SPECIALCHARS:uint = 0; public static const ENT_QUOTES:uint = 4; public static const ENT_NOQUOTES:uint = 2; public static const ENT_COMPAT:uint = 3; private static var patternReplace:Array = ["S", "Oe", "Z", "s", "oe", "z", "A", "Ae", "C", "E", "I", "D", "N", "O", "U", "Y", "Th", "ss", "a", "ae", "c", "e", "i", "d", "n", "o", "u", "y", "th"]; public static var dayNames:Array = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; private static var pattern:Array = new Array(29); public static var monthShortNames:Array = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; public static var monthNames:Array = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; public static function cgidatestring(_arg1:Date):String{ var _local2:String = ("" + _arg1.getDate()); if (_arg1.getDate() < 10){ _local2 = ("0" + _local2); }; var _local3:String = (("" + _arg1.getMonth()) + 1); if ((_arg1.getMonth() + 1) < 10){ _local3 = ("0" + _local3); }; var _local4:String = ("" + _arg1.getFullYear()); return (((((_local3 + ".") + _local2) + ".") + _local4)); } public static function htmlspecialchars_decode(_arg1:String, _arg2:uint=3):String{ var _local3:Dictionary; var _local4 = ""; var _local5 = ""; var _local6 = ""; _local5 = _arg1.toString(); _local3 = get_html_translation_table(HTML_SPECIALCHARS, _arg2); if (_local3 == null){ return (""); }; for (_local4 in _local3) { _local6 = _local3[_local4]; _local5 = _local5.split(_local6).join(_local4); }; _local5 = _local5.split("&#039;").join("'"); return (_local5); } public static function clean(_arg1:String):String{ _arg1 = decomposeUnicode(_arg1); _arg1 = _arg1.toLowerCase().split(" ").join("_"); var _local2:RegExp = /[^a-z0-9_]/g; return (_arg1.replace(_local2, "").split("__").join("_")); } public static function htmlentities(_arg1:String, _arg2:uint=3):String{ var _local3:Dictionary; var _local4 = ""; var _local5 = ""; var _local6 = ""; _local5 = _arg1.toString(); _local5 = _local5.split("&").join("&amp;"); _local3 = get_html_translation_table(HTML_ENTITIES, _arg2); if (_local3 == null){ return (""); }; _local3["'"] = "&#039;"; for (_local4 in _local3) { _local6 = _local3[_local4]; _local5 = _local5.split(_local4).join(_local6); }; return (_local5); } public static function removeHTML(_arg1:String):String{ var _local2:RegExp = /<[^>]*>/g; return (_arg1.replace(_local2, "")); } public static function prettydatestring(_arg1:Date):String{ return (((((((dayNames[_arg1.getDay()] + ", ") + monthNames[_arg1.getMonth()]) + " ") + _arg1.getDate()) + ", ") + _arg1.getFullYear())); } public static function decomposeUnicode(_arg1:String):String{ var _local2:int; while (_local2 < pattern.length) { _arg1 = _arg1.replace(pattern[_local2], patternReplace[_local2]); _local2++; }; return (_arg1); } private static function get_html_translation_table(_arg1:uint=0, _arg2:uint=3):Dictionary{ var _local9:String; var _local3:Object = {}; var _local4:Dictionary = new Dictionary(); var _local5:int; var _local6 = ""; var _local7:uint = _arg1; var _local8:uint = _arg2; if (((!((_local7 === HTML_SPECIALCHARS))) && (!((_local7 === HTML_ENTITIES))))){ throw (new Error((("Table: " + _local7) + " not supported"))); }; if (_local7 == HTML_ENTITIES){ _local3["160"] = "&nbsp;"; _local3["161"] = "&iexcl;"; _local3["162"] = "&cent;"; _local3["163"] = "&pound;"; _local3["164"] = "&curren;"; _local3["165"] = "&yen;"; _local3["166"] = "&brvbar;"; _local3["167"] = "&sect;"; _local3["168"] = "&uml;"; _local3["169"] = "&copy;"; _local3["170"] = "&ordf;"; _local3["171"] = "&laquo;"; _local3["172"] = "&not;"; _local3["173"] = "&shy;"; _local3["174"] = "&reg;"; _local3["175"] = "&macr;"; _local3["176"] = "&deg;"; _local3["177"] = "&plusmn;"; _local3["178"] = "&sup2;"; _local3["179"] = "&sup3;"; _local3["180"] = "&acute;"; _local3["181"] = "&micro;"; _local3["182"] = "&para;"; _local3["183"] = "&middot;"; _local3["184"] = "&cedil;"; _local3["185"] = "&sup1;"; _local3["186"] = "&ordm;"; _local3["187"] = "&raquo;"; _local3["188"] = "&frac14;"; _local3["189"] = "&frac12;"; _local3["190"] = "&frac34;"; _local3["191"] = "&iquest;"; _local3["192"] = "&Agrave;"; _local3["193"] = "&Aacute;"; _local3["194"] = "&Acirc;"; _local3["195"] = "&Atilde;"; _local3["196"] = "&Auml;"; _local3["197"] = "&Aring;"; _local3["198"] = "&AElig;"; _local3["199"] = "&Ccedil;"; _local3["200"] = "&Egrave;"; _local3["201"] = "&Eacute;"; _local3["202"] = "&Ecirc;"; _local3["203"] = "&Euml;"; _local3["204"] = "&Igrave;"; _local3["205"] = "&Iacute;"; _local3["206"] = "&Icirc;"; _local3["207"] = "&Iuml;"; _local3["208"] = "&ETH;"; _local3["209"] = "&Ntilde;"; _local3["210"] = "&Ograve;"; _local3["211"] = "&Oacute;"; _local3["212"] = "&Ocirc;"; _local3["213"] = "&Otilde;"; _local3["214"] = "&Ouml;"; _local3["215"] = "&times;"; _local3["216"] = "&Oslash;"; _local3["217"] = "&Ugrave;"; _local3["218"] = "&Uacute;"; _local3["219"] = "&Ucirc;"; _local3["220"] = "&Uuml;"; _local3["221"] = "&Yacute;"; _local3["222"] = "&THORN;"; _local3["223"] = "&szlig;"; _local3["224"] = "&agrave;"; _local3["225"] = "&aacute;"; _local3["226"] = "&acirc;"; _local3["227"] = "&atilde;"; _local3["228"] = "&auml;"; _local3["229"] = "&aring;"; _local3["230"] = "&aelig;"; _local3["231"] = "&ccedil;"; _local3["232"] = "&egrave;"; _local3["233"] = "&eacute;"; _local3["234"] = "&ecirc;"; _local3["235"] = "&euml;"; _local3["236"] = "&igrave;"; _local3["237"] = "&iacute;"; _local3["238"] = "&icirc;"; _local3["239"] = "&iuml;"; _local3["240"] = "&eth;"; _local3["241"] = "&ntilde;"; _local3["242"] = "&ograve;"; _local3["243"] = "&oacute;"; _local3["244"] = "&ocirc;"; _local3["245"] = "&otilde;"; _local3["246"] = "&ouml;"; _local3["247"] = "&divide;"; _local3["248"] = "&oslash;"; _local3["249"] = "&ugrave;"; _local3["250"] = "&uacute;"; _local3["251"] = "&ucirc;"; _local3["252"] = "&uuml;"; _local3["253"] = "&yacute;"; _local3["254"] = "&thorn;"; _local3["255"] = "&yuml;"; }; if (_local8 !== ENT_NOQUOTES){ _local3["34"] = "&quot;"; }; if (_local8 == ENT_QUOTES){ _local3["39"] = "&#39;"; }; _local3["60"] = "&lt;"; _local3["62"] = "&gt;"; for (_local9 in _local3) { _local6 = String.fromCharCode(parseInt(_local9)); _local4[_local6] = _local3[_local9]; }; return (_local4); } public static function html_entity_decode(_arg1:String, _arg2:uint=3):String{ var _local3:Dictionary; var _local4 = ""; var _local5 = ""; var _local6 = ""; _local5 = _arg1.toString(); _local3 = get_html_translation_table(HTML_ENTITIES, _arg2); if (_local3 == null){ return (""); }; for (_local4 in _local3) { _local6 = _local3[_local4]; _local5 = _local5.split(_local6).join(_local4); }; _local5 = _local5.split("&#039;").join("'"); return (_local5); } public static function htmlspecialchars(_arg1:String, _arg2:uint=3):String{ var _local3:Dictionary; var _local4 = ""; var _local5 = ""; var _local6 = ""; _local5 = _arg1.toString(); _local5 = _local5.split("&").join("&amp;"); _local3 = get_html_translation_table(HTML_SPECIALCHARS, _arg2); if (_local3 == null){ return (""); }; _local3["'"] = "&#039;"; for (_local4 in _local3) { _local6 = _local3[_local4]; _local5 = _local5.split(_local4).join(_local6); }; return (_local5); } pattern[0] = new RegExp("Š", "g"); pattern[1] = new RegExp("Œ", "g"); pattern[2] = new RegExp("Ž", "g"); pattern[3] = new RegExp("š", "g"); pattern[4] = new RegExp("œ", "g"); pattern[5] = new RegExp("ž", "g"); pattern[6] = new RegExp("[ÀÁÂÃÄÅ]", "g"); pattern[7] = new RegExp("Æ", "g"); pattern[8] = new RegExp("Ç", "g"); pattern[9] = new RegExp("[ÈÉÊË]", "g"); pattern[10] = new RegExp("[ÌÍÎÏ]", "g"); pattern[11] = new RegExp("Ð", "g"); pattern[12] = new RegExp("Ñ", "g"); pattern[13] = new RegExp("[ÒÓÔÕÖØ]", "g"); pattern[14] = new RegExp("[ÙÚÛÜ]", "g"); pattern[15] = new RegExp("[ŸÝ]", "g"); pattern[16] = new RegExp("Þ", "g"); pattern[17] = new RegExp("ß", "g"); pattern[18] = new RegExp("[àáâãäå]", "g"); pattern[19] = new RegExp("æ", "g"); pattern[20] = new RegExp("ç", "g"); pattern[21] = new RegExp("[èéêë]", "g"); pattern[22] = new RegExp("[ìíîï]", "g"); pattern[23] = new RegExp("ð", "g"); pattern[24] = new RegExp("ñ", "g"); pattern[25] = new RegExp("[òóôõöø]", "g"); pattern[26] = new RegExp("[ùúûü]", "g"); pattern[27] = new RegExp("[ýÿ]", "g"); pattern[28] = new RegExp("þ", "g"); } }//package com.slideroll.util
Section 43
//SWFLibrary (com.slideroll.util.SWFLibrary) package com.slideroll.util { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.geom.*; import flash.media.*; public class SWFLibrary extends EventDispatcher { protected var _timer:Timer; protected var bitmapDataCache:Object; public var assetType:String; protected var loader:Loader; protected var MyLibrary:Class; protected var _eventSent:Boolean;// = false public var className:String; protected var _smoothing:Boolean;// = false protected var debugmode:Boolean; public static const INITIALIZED:String = "SWFLibrary_initialized"; public static var scale:Number = 1; public function SWFLibrary(_arg1:Class, _arg2:Boolean=false){ MyLibrary = _arg1; debugmode = _arg2; init(); } private function getSymbolDefinition(_arg1:String):Class{ if (initialized){ if (loader.contentLoaderInfo.applicationDomain.hasDefinition(_arg1)){ return ((loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1) as Class)); }; trace((("Symbol '" + _arg1) + "' not found.")); }; return (null); } private function getSymbolInstance(_arg1:String):Object{ var _local2:Class = getSymbolDefinition(_arg1); return ((_local2) ? new (_local2) : null); } public function getFont(_arg1:String):Class{ var obj:Object; var fontClassName = _arg1; try { return (getSymbolDefinition(fontClassName)); } catch(e:Error) { trace((("Font '" + fontClassName) + "' not found in Library")); }; return (null); } protected function onInitialize(_arg1:Event):void{ loader.contentLoaderInfo.removeEventListener(Event.INIT, onInitialize); dispatchEvent(new Event(Event.INIT)); _eventSent = true; } protected function init():void{ loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, onInitialize, false, 0, true); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete, false, 0, true); loader.loadBytes(new MyLibrary()); bitmapDataCache = {}; _timer = new Timer(250, 0); _timer.addEventListener(TimerEvent.TIMER, checkEvent); _timer.start(); } public function getSound(_arg1:String):Sound{ var obj:Object; var symbolName = _arg1; if (!initialized){ throw (new Error("ERROR: Component Library not initialized.")); }; try { obj = getSymbolInstance(symbolName); if ((obj is Sound)){ return ((obj as Sound)); } else { throw (new Error()); }; } catch(e:Error) { trace((("Library Symbol '" + symbolName) + "' is not a Sound")); }; return (null); } protected function get initialized():Boolean{ return (!((loader.content == null))); } public function getDisplayObjectAsBitmap(_arg1:String, _arg2:Array=null):Bitmap{ var _local4:BitmapData; var _local5:Matrix; var _local6:int; if (!initialized){ throw (new Error("ERROR: Component Library not initialized.")); }; if (((!((bitmapDataCache[_arg1] == null))) && ((bitmapDataCache[_arg1] is BitmapData)))){ return (new Bitmap(bitmapDataCache[_arg1], PixelSnapping.NEVER, smoothing)); }; var _local3:DisplayObject = getDisplayObject(_arg1); if (_local3 != null){ _local4 = new BitmapData(Math.floor((_local3.width * scale)), Math.floor((_local3.height * scale)), true, 0); _local5 = new Matrix(); _local5.createBox(scale, scale, 0, Math.floor(((_local3.width * 0.5) * scale)), Math.floor(((_local3.height * 0.5) * scale))); _local4.draw(_local3, _local5); if (_arg2 != null){ _local6 = 0; while (_local6 < _arg2.length) { _local4.applyFilter(_local4, new Rectangle(0, 0, _local4.width, _local4.height), new Point(0, 0), _arg2[_local6]); _local6++; }; }; bitmapDataCache[_arg1] = _local4; return (new Bitmap(_local4)); }; return (null); } public function set smoothing(_arg1:Boolean):void{ _smoothing = _arg1; } public function getDisplayObject(_arg1:String):DisplayObject{ var obj:Object; var symbolName = _arg1; if (!initialized){ throw (new Error("ERROR: Component Library not initialized.")); }; try { obj = getSymbolInstance(symbolName); if ((obj is DisplayObject)){ return ((obj as DisplayObject)); } else { throw (new Error()); }; } catch(e:Error) { trace((("Library Symbol '" + symbolName) + "' is not a Display Object")); }; return (null); } protected function checkEvent(_arg1:TimerEvent):void{ if (initialized){ if (!_eventSent){ dispatchEvent(new Event(Event.INIT)); }; _timer.stop(); }; } public function get smoothing():Boolean{ return (_smoothing); } protected function onComplete(_arg1:Event):void{ loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onComplete); } } }//package com.slideroll.util
Section 44
//SWFLoader (com.slideroll.util.SWFLoader) package com.slideroll.util { import flash.display.*; import flash.events.*; import flash.text.*; import flash.utils.*; public class SWFLoader extends EventDispatcher { protected var _currentFrameBytesTotal:uint;// = 0 protected var _manifest:XML; protected var _currentFrame:uint;// = 0 protected var _bytesLoaded:uint;// = 0 protected var _assets:Dictionary; protected var _preloader:SWFPreloader; protected var _bytesTotal:uint;// = 0 protected var _debugmode:Boolean;// = true protected var _stage:Stage; public static const ASSET_MANIFEST:String = "M"; public static const ASSET_BYTEARRAY:String = "B"; public static const ASSET_IMAGE:String = "I"; public static const ASSET_SWF_LIBRARY:String = "L"; public static const ASSET_SWF:String = "S"; protected static const BYTEARRAY_CLASSNAME:String = "com.slideroll.SRBA"; public static const ASSET_FONT_LIBRARY:String = "F"; protected static const IMAGE_CLASSNAME:String = "SRImage"; public function SWFLoader(_arg1:Stage, _arg2:SWFPreloader){ init(_arg1, _arg2); } public function get assets():Dictionary{ return (_assets); } protected function loadComplete():void{ _preloader.stop(); _preloader.removeEventListener(Event.ENTER_FRAME, onEnterFrame); _preloader.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError); dispatchEvent(new SWFLoaderEvent(SWFLoaderEvent.LOAD_COMPLETE)); } public function initializeLibrary(_arg1:Class, _arg2:String, _arg3:String):void{ var _local4:SWFLibrary = new SWFLibrary(_arg1, true); _local4.className = _arg2; _local4.assetType = _arg3; _local4.addEventListener(Event.INIT, onLibraryInitialized); } private function init(_arg1:Stage, _arg2:SWFPreloader):void{ _stage = _arg1; _preloader = _arg2; _assets = new Dictionary(); _bytesLoaded = _preloader.loaderInfo.bytesLoaded; _bytesTotal = _preloader.loaderInfo.bytesTotal; _preloader.addEventListener(Event.ENTER_FRAME, onEnterFrame); _preloader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); _preloader.play(); } protected function setFont(_arg1:SWFLibrary):void{ var font1:Class; var f:Font; var library = _arg1; try { font1 = library.getFont("standard"); Font.registerFont(font1); for each (f in Font.enumerateFonts()) { debug(((f.fontName + ", ") + f.fontStyle)); }; } catch(e:Error) { debug(e.getStackTrace()); }; } protected function onLibraryInitialized(_arg1:Event):void{ var _local2:SWFLibrary; if ((_arg1.target is SWFLibrary)){ _local2 = (_arg1.target as SWFLibrary); _local2.removeEventListener(SWFLibrary.INITIALIZED, onLibraryInitialized); if (_local2.assetType == ASSET_FONT_LIBRARY){ setFont(_local2); } else { _assets[_local2.className] = _local2; }; }; } protected function debug(... _args):void{ if (_debugmode){ trace(_args); }; } protected function onLoadError(_arg1:IOErrorEvent):void{ } protected function handleProgressEvent():void{ var _local1:String; var _local2:Array; var _local3:String; var _local4:String; var _local5:String; var _local6:uint; var _local7:uint; if (_bytesLoaded == _preloader.loaderInfo.bytesLoaded){ return; }; _bytesLoaded = _preloader.loaderInfo.bytesLoaded; if ((((_preloader.currentFrame < _preloader.totalFrames)) && (!((_preloader.currentLabels[_currentFrame] == undefined))))){ _local1 = FrameLabel(_preloader.currentLabels[_currentFrame]).name; _local2 = _local1.split("_"); _local3 = _local2[0]; _local4 = _local2[2]; if (_local4 == null){ return; }; switch (_local3){ case ASSET_IMAGE: _local5 = (IMAGE_CLASSNAME + _local4); break; default: _local5 = (BYTEARRAY_CLASSNAME + _local4); break; }; _local6 = ((_bytesTotal - _currentFrameBytesTotal) / (_preloader.totalFrames - _preloader.currentFrame)); _local7 = Math.max(0, Math.min(_local6, (_bytesLoaded - _currentFrameBytesTotal))); trace("SWFLOADER Progress", _local7, _local6); dispatchEvent(new SWFLoaderEvent(ProgressEvent.PROGRESS, false, false, _local7, _local6, 1, _local5)); }; } public function get manifest():XML{ return (_manifest); } private function onEnterFrame(_arg1:Event):void{ var _local2:Array; var _local3:String; var _local4:uint; var _local5:String; var _local6:String; var _local7:Class; var _local8:BitmapData; var _local9:ByteArray; if ((((_currentFrame >= _preloader.currentFrame)) && (!((_preloader.currentLabel == "end"))))){ handleProgressEvent(); return; }; _currentFrame = _preloader.currentFrame; _currentFrameBytesTotal = _preloader.loaderInfo.bytesLoaded; debug(_preloader.currentLabel); if (_preloader.currentLabel.indexOf("Preloader") != -1){ return; }; switch (_preloader.currentLabel){ case "start": break; case "end": loadComplete(); break; default: _local2 = _preloader.currentLabel.split("_"); _local3 = _local2[0]; _local4 = parseInt(_local2[1]); _local5 = _local2[2]; if (_local5 == null){ return; }; switch (_local3){ case ASSET_IMAGE: _local6 = (IMAGE_CLASSNAME + _local5); _local7 = (getDefinitionByName(_local6) as Class); _local8 = (new (_local7) as BitmapData); _local9 = null; break; default: _local6 = (BYTEARRAY_CLASSNAME + _local5); _local7 = (getDefinitionByName(_local6) as Class); _local8 = null; _local9 = (new (_local7) as ByteArray); break; }; switch (_local3){ case ASSET_MANIFEST: _local9.position = 0; _manifest = new XML(_local9.readUTFBytes(_local9.length)); _local9.position = 0; _assets[_local6] = _local9; dispatchEvent(new SWFLoaderEvent(SWFLoaderEvent.MANIFEST_LOADED, false, false, _bytesLoaded, _bytesLoaded, SWFLoaderEvent.TYPE_MANIFEST, _local6)); break; case ASSET_IMAGE: _assets[_local6] = _local8; dispatchEvent(new SWFLoaderEvent(SWFLoaderEvent.CLASS_LOADED, false, false, _bytesLoaded, _bytesLoaded, SWFLoaderEvent.TYPE_BITMAPDATA, _local6)); break; case ASSET_SWF: _assets[_local6] = _local9; dispatchEvent(new SWFLoaderEvent(SWFLoaderEvent.CLASS_LOADED, false, false, _bytesLoaded, _bytesLoaded, SWFLoaderEvent.TYPE_SWF, _local6)); break; case ASSET_SWF_LIBRARY: initializeLibrary(_local7, _local6, _local3); dispatchEvent(new SWFLoaderEvent(SWFLoaderEvent.CLASS_LOADED, false, false, _bytesLoaded, _bytesLoaded, SWFLoaderEvent.TYPE_SWF_LIBRARY, _local6)); break; case ASSET_FONT_LIBRARY: initializeLibrary(_local7, _local6, _local3); dispatchEvent(new SWFLoaderEvent(SWFLoaderEvent.CLASS_LOADED, false, false, _bytesLoaded, _bytesLoaded, SWFLoaderEvent.TYPE_FONT_LIBRARY, _local6)); break; case ASSET_BYTEARRAY: _assets[_local6] = _local9; dispatchEvent(new SWFLoaderEvent(SWFLoaderEvent.CLASS_LOADED, false, false, _bytesLoaded, _bytesLoaded, SWFLoaderEvent.TYPE_BYTEARRAY, _local6)); break; }; }; if (_preloader.currentFrame == _preloader.totalFrames){ loadComplete(); }; } } }//package com.slideroll.util
Section 45
//SWFLoaderEvent (com.slideroll.util.SWFLoaderEvent) package com.slideroll.util { import flash.events.*; public class SWFLoaderEvent extends ProgressEvent { public var className:String; public var objectType:uint; public static const CLASS_LOADED:String = "class_loaded"; public static const TYPE_FONT_LIBRARY:uint = 5; public static const LOAD_COMPLETE:String = "load_complete"; public static const TYPE_BYTEARRAY:uint = 6; public static const TYPE_MANIFEST:uint = 1; public static const MANIFEST_LOADED:String = "manifest_loaded"; public static const TYPE_SWF_LIBRARY:uint = 4; public static const TYPE_SWF:uint = 3; public static const TYPE_BITMAPDATA:uint = 2; public function SWFLoaderEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:uint=1, _arg7:String=""){ super(_arg1, _arg2, _arg3, _arg4, _arg5); this.objectType = _arg6; this.className = _arg7; } override public function toString():String{ return (formatToString("SWFLoaderEvent", "type", "bubbles", "cancelable", "bytesLoaded", "bytesTotal", "objectType", "className")); } override public function clone():Event{ return (new SWFLoaderEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, objectType, className)); } } }//package com.slideroll.util
Section 46
//SWFPreloader (com.slideroll.util.SWFPreloader) package com.slideroll.util { import flash.events.*; import flash.display.*; import flash.text.*; import flash.utils.*; public class SWFPreloader extends MovieClip { protected var _started:Boolean;// = false protected var _mainClassName:String;// = "" protected var _placed:Boolean;// = false protected var statusText:TextField; public static var testing:Boolean = false; public static var instance:SWFPreloader; public static var mainInstance:DisplayObject; public static var url:String = ""; public function SWFPreloader(){ instance = this; init(); } public function onAdded(_arg1:Event=null):void{ removeEventListener(Event.ADDED_TO_STAGE, onAdded); if (((!((stage.loaderInfo == null))) && (!((stage.loaderInfo.url == null))))){ url = stage.loaderInfo.url; }; addEventListener(Event.ENTER_FRAME, checkFrame); loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress); statusText = new TextField(); statusText.text = "Loading.."; stage.addChild(statusText); } protected function checkFrame(_arg1:Event):void{ if ((((((framesLoaded > 1)) && ((currentLabel == "start")))) || ((totalFrames == 2)))){ removeEventListener(Event.ENTER_FRAME, checkFrame); startup(); }; } public function set status(_arg1:String):void{ statusText.text = _arg1; } protected function progress(_arg1:ProgressEvent):void{ status = (("Loading " + Math.ceil(((root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal) * 100))) + "%"); } protected function init():void{ addEventListener(Event.ADDED_TO_STAGE, onAdded); } public function startup():void{ var _local1:Class; stop(); stage.quality = StageQuality.HIGH; loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress); if (loaderInfo.url.indexOf("testing") != -1){ testing = true; }; if (_mainClassName.length > 0){ _local1 = (getDefinitionByName(_mainClassName) as Class); mainInstance = (new _local1(stage, this) as DisplayObject); addChild(mainInstance); statusText.visible = false; } else { status = "no main class"; }; _started = true; } public static function restart():void{ if (((!((mainInstance == null))) && (!((instance.getChildIndex(mainInstance) == -1))))){ instance.removeChild(mainInstance); instance.startup(); }; } } }//package com.slideroll.util
Section 47
//SRBA0001 (com.slideroll.SRBA0001) package com.slideroll { import flash.utils.*; public class SRBA0001 extends ByteArray { } }//package com.slideroll
Section 48
//ByteArrayAsset (mx.core.ByteArrayAsset) package mx.core { import flash.utils.*; public class ByteArrayAsset extends ByteArray implements IFlexAsset { mx_internal static const VERSION:String = "3.4.1.10084"; } }//package mx.core
Section 49
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 50
//mx_internal (mx.core.mx_internal) package mx.core { public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal"; }//package mx.core
Section 51
//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{ if (Security.sandboxType == "localWithFile"){ return (null); }; var _local3:MochiBot = new (MochiBot); _arg1.addChild(_local3); Security.allowDomain("*"); Security.allowInsecureDomain("*"); var _local4 = "http://core.mochibot.com/my/core.swf"; var _local5:URLVariables = new URLVariables(); _local5["sb"] = Security.sandboxType; _local5["v"] = Capabilities.version; _local5["swfid"] = _arg2; _local5["mv"] = "8"; _local5["fv"] = "9"; var _local6:String = _local3.root.loaderInfo.loaderURL; if (_local6.indexOf("http") == 0){ _local5["url"] = _local6; } else { _local5["url"] = "local"; }; var _local7:URLRequest = new URLRequest(_local4); _local7.contentType = "application/x-www-form-urlencoded"; _local7.method = URLRequestMethod.POST; _local7.data = _local5; var _local8:Loader = new Loader(); _local3.addChild(_local8); _local8.load(_local7); return (_local3); } } }//package
Section 52
//SRImage0001 (SRImage0001) package { import flash.display.*; public dynamic class SRImage0001 extends BitmapData { public function SRImage0001(){ super(0, 0); } } }//package
Section 53
//SRImage0002 (SRImage0002) package { import flash.display.*; public dynamic class SRImage0002 extends BitmapData { public function SRImage0002(){ super(0, 0); } } }//package
Section 54
//SRImage0003 (SRImage0003) package { import flash.display.*; public dynamic class SRImage0003 extends BitmapData { public function SRImage0003(){ super(0, 0); } } }//package
Section 55
//SRImage0004 (SRImage0004) package { import flash.display.*; public dynamic class SRImage0004 extends BitmapData { public function SRImage0004(){ super(0, 0); } } }//package
Section 56
//SRImage0005 (SRImage0005) package { import flash.display.*; public dynamic class SRImage0005 extends BitmapData { public function SRImage0005(){ super(0, 0); } } }//package
Section 57
//SRImage0006 (SRImage0006) package { import flash.display.*; public dynamic class SRImage0006 extends BitmapData { public function SRImage0006(){ super(0, 0); } } }//package
Section 58
//SRImage0007 (SRImage0007) package { import flash.display.*; public dynamic class SRImage0007 extends BitmapData { public function SRImage0007(){ super(0, 0); } } }//package
Section 59
//SRImage0008 (SRImage0008) package { import flash.display.*; public dynamic class SRImage0008 extends BitmapData { public function SRImage0008(){ super(0, 0); } } }//package
Section 60
//SRImage0009 (SRImage0009) package { import flash.display.*; public dynamic class SRImage0009 extends BitmapData { public function SRImage0009(){ super(0, 0); } } }//package
Section 61
//SRImage0010 (SRImage0010) package { import flash.display.*; public dynamic class SRImage0010 extends BitmapData { public function SRImage0010(){ super(0, 0); } } }//package
Section 62
//SRImage0011 (SRImage0011) package { import flash.display.*; public dynamic class SRImage0011 extends BitmapData { public function SRImage0011(){ super(0, 0); } } }//package
Section 63
//SRImage0012 (SRImage0012) package { import flash.display.*; public dynamic class SRImage0012 extends BitmapData { public function SRImage0012(){ super(0, 0); } } }//package
Section 64
//SRImage0013 (SRImage0013) package { import flash.display.*; public dynamic class SRImage0013 extends BitmapData { public function SRImage0013(){ super(0, 0); } } }//package
Section 65
//SRImage0014 (SRImage0014) package { import flash.display.*; public dynamic class SRImage0014 extends BitmapData { public function SRImage0014(){ super(0, 0); } } }//package
Section 66
//SRImage0015 (SRImage0015) package { import flash.display.*; public dynamic class SRImage0015 extends BitmapData { public function SRImage0015(){ super(0, 0); } } }//package
Section 67
//SRImage0016 (SRImage0016) package { import flash.display.*; public dynamic class SRImage0016 extends BitmapData { public function SRImage0016(){ super(0, 0); } } }//package
Section 68
//SRImage0017 (SRImage0017) package { import flash.display.*; public dynamic class SRImage0017 extends BitmapData { public function SRImage0017(){ super(0, 0); } } }//package
Section 69
//SRImage0018 (SRImage0018) package { import flash.display.*; public dynamic class SRImage0018 extends BitmapData { public function SRImage0018(){ super(0, 0); } } }//package
Section 70
//SRImage0019 (SRImage0019) package { import flash.display.*; public dynamic class SRImage0019 extends BitmapData { public function SRImage0019(){ super(0, 0); } } }//package
Section 71
//SRImage0020 (SRImage0020) package { import flash.display.*; public dynamic class SRImage0020 extends BitmapData { public function SRImage0020(){ super(0, 0); } } }//package
Section 72
//SRImage0021 (SRImage0021) package { import flash.display.*; public dynamic class SRImage0021 extends BitmapData { public function SRImage0021(){ super(0, 0); } } }//package
Section 73
//SRImage0022 (SRImage0022) package { import flash.display.*; public dynamic class SRImage0022 extends BitmapData { public function SRImage0022(){ super(0, 0); } } }//package
Section 74
//SRImage0023 (SRImage0023) package { import flash.display.*; public dynamic class SRImage0023 extends BitmapData { public function SRImage0023(){ super(0, 0); } } }//package
Section 75
//SRImage0024 (SRImage0024) package { import flash.display.*; public dynamic class SRImage0024 extends BitmapData { public function SRImage0024(){ super(0, 0); } } }//package
Section 76
//SRImage0025 (SRImage0025) package { import flash.display.*; public dynamic class SRImage0025 extends BitmapData { public function SRImage0025(){ super(0, 0); } } }//package
Section 77
//SRImage0026 (SRImage0026) package { import flash.display.*; public dynamic class SRImage0026 extends BitmapData { public function SRImage0026(){ super(0, 0); } } }//package
Section 78
//SRImage0027 (SRImage0027) package { import flash.display.*; public dynamic class SRImage0027 extends BitmapData { public function SRImage0027(){ super(0, 0); } } }//package
Section 79
//SRImage0028 (SRImage0028) package { import flash.display.*; public dynamic class SRImage0028 extends BitmapData { public function SRImage0028(){ super(0, 0); } } }//package
Section 80
//SRImage0029 (SRImage0029) package { import flash.display.*; public dynamic class SRImage0029 extends BitmapData { public function SRImage0029(){ super(0, 0); } } }//package
Section 81
//SRImage0030 (SRImage0030) package { import flash.display.*; public dynamic class SRImage0030 extends BitmapData { public function SRImage0030(){ super(0, 0); } } }//package
Section 82
//SRImage0031 (SRImage0031) package { import flash.display.*; public dynamic class SRImage0031 extends BitmapData { public function SRImage0031(){ super(0, 0); } } }//package
Section 83
//SRImage0032 (SRImage0032) package { import flash.display.*; public dynamic class SRImage0032 extends BitmapData { public function SRImage0032(){ super(0, 0); } } }//package

Library Items

Symbol 1 BinaryData {com.picklish.player.Gallery_LibrarySWF}
Symbol 899 BinaryData {com.slideroll.SRBA0001}
Symbol 900 Bitmap {SRImage0001}
Symbol 901 Bitmap {SRImage0002}
Symbol 902 Bitmap {SRImage0003}
Symbol 903 Bitmap {SRImage0004}
Symbol 904 Bitmap {SRImage0005}
Symbol 905 Bitmap {SRImage0006}
Symbol 906 Bitmap {SRImage0007}
Symbol 907 Bitmap {SRImage0008}
Symbol 908 Bitmap {SRImage0009}
Symbol 909 Bitmap {SRImage0010}
Symbol 910 Bitmap {SRImage0011}
Symbol 911 Bitmap {SRImage0012}
Symbol 912 Bitmap {SRImage0013}
Symbol 913 Bitmap {SRImage0014}
Symbol 914 Bitmap {SRImage0015}
Symbol 915 Bitmap {SRImage0016}
Symbol 916 Bitmap {SRImage0017}
Symbol 917 Bitmap {SRImage0018}
Symbol 918 Bitmap {SRImage0019}
Symbol 919 Bitmap {SRImage0020}
Symbol 920 Bitmap {SRImage0021}
Symbol 921 Bitmap {SRImage0022}
Symbol 922 Bitmap {SRImage0023}
Symbol 923 Bitmap {SRImage0024}
Symbol 924 Bitmap {SRImage0025}
Symbol 925 Bitmap {SRImage0026}
Symbol 926 Bitmap {SRImage0027}
Symbol 927 Bitmap {SRImage0028}
Symbol 928 Bitmap {SRImage0029}
Symbol 929 Bitmap {SRImage0030}
Symbol 930 Bitmap {SRImage0031}
Symbol 931 Bitmap {SRImage0032}

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1458 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
SerialNumber (41)Timeline Frame 1

Labels

"com_picklish_player_PlayerPreloader"Frame 1
"start"Frame 2
"init"Frame 3
"M_01_0001"Frame 4
"databuffer"Frame 5
"databuffer2"Frame 6
"I_01_0001"Frame 7
"I_01_0002"Frame 8
"I_01_0003"Frame 9
"I_01_0004"Frame 10
"I_01_0005"Frame 11
"I_01_0006"Frame 12
"I_01_0007"Frame 13
"I_01_0008"Frame 14
"I_01_0009"Frame 15
"I_01_0010"Frame 16
"I_01_0011"Frame 17
"I_01_0012"Frame 18
"I_01_0013"Frame 19
"I_01_0014"Frame 20
"I_01_0015"Frame 21
"I_01_0016"Frame 22
"I_01_0017"Frame 23
"I_01_0018"Frame 24
"I_01_0019"Frame 25
"I_01_0020"Frame 26
"I_01_0021"Frame 27
"I_01_0022"Frame 28
"I_01_0023"Frame 29
"I_01_0024"Frame 30
"I_01_0025"Frame 31
"I_01_0026"Frame 32
"I_01_0027"Frame 33
"I_01_0028"Frame 34
"I_01_0029"Frame 35
"I_01_0030"Frame 36
"I_01_0031"Frame 37
"I_01_0032"Frame 38
"end"Frame 39




http://swfchan.com/26/128832/info.shtml
Created: 30/11 -2018 19:30:44 Last modified: 30/11 -2018 19:30:44 Server time: 15/11 -2024 01:35:59