Created
October 13, 2016 17:58
-
-
Save zhang-ning/5e981061b854012a48f6f2abc4453446 to your computer and use it in GitHub Desktop.
dd
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
public class InstanceFactory { | |
private static var _photoEditor:IPhotoEditor; | |
private static var _mainApplication:IMainApplication; | |
public static function get photoEditor():IPhotoEditor{ | |
return (_photoEditor); | |
} | |
public static function set photoEditor(_arg1:IPhotoEditor):void{ | |
_photoEditor = _arg1; | |
} | |
public static function get mainApplication():IMainApplication{ | |
return (_mainApplication); | |
} | |
public static function set mainApplication(_arg1:IMainApplication):void{ | |
_mainApplication = _arg1; | |
} | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class focusRectSkin extends MovieClip { | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class TrackUpSkin extends MovieClip { | |
} | |
}//package | |
package border { | |
public class BorderUrl { | |
public static const BFXQ:String = "mtsc200444"; | |
public static const XY:String = "mtsc200445"; | |
public static const LMXG:String = "mtsc200648"; | |
public static const TMGY:String = "mtsc203455"; | |
public static const HEART:String = "mtsc203456"; | |
public static const LSXY:String = "mtsc203754"; | |
public static const RAINBOW:String = "mtsc203755"; | |
public static const HDCS:String = "mtsc203756"; | |
} | |
}//package border | |
package border { | |
public class MasterUrl { | |
public static const BFXQ:String = "mtsc200444"; | |
public static const XY:String = "mtsc200445"; | |
public static const LMXG:String = "mtsc200648"; | |
public static const TMGY:String = "mtsc203455"; | |
public static const HEART:String = "mtsc203456"; | |
public static const LSXY:String = "mtsc203754"; | |
public static const RAINBOW:String = "mtsc203755"; | |
public static const HDCS:String = "mtsc203756"; | |
} | |
}//package border | |
package { | |
import flash.display.*; | |
public dynamic class AlertUninstallTip_zh_CN extends BitmapData { | |
public function AlertUninstallTip_zh_CN(_arg1:int=400, _arg2:int=85){ | |
super(_arg1, _arg2); | |
} | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public class ImageModel { | |
private var _contentChange:Boolean; | |
private var _transparent:Boolean; | |
private var _net:Boolean; | |
private var _numOperate:int = 0; | |
private var _url:String = ""; | |
private var _primalBitmapData:BitmapData; | |
private var _bitmapData:BitmapData; | |
private var _observerData:Array; | |
public function ImageModel(){ | |
this._observerData = []; | |
super(); | |
} | |
public function get contentChange():Boolean{ | |
return (this._contentChange); | |
} | |
public function set contentChange(_arg1:Boolean):void{ | |
this._contentChange = _arg1; | |
if (_arg1){ | |
this.notify(ObserveType.CONTENT_UPDATE); | |
}; | |
} | |
public function get primalBitmapData():BitmapData{ | |
return (this._primalBitmapData); | |
} | |
public function set primalBitmapData(_arg1:BitmapData):void{ | |
if (_arg1){ | |
this._primalBitmapData = _arg1; | |
this._bitmapData = _arg1.clone(); | |
this.contentChange = false; | |
this.notify(ObserveType.RESET); | |
}; | |
} | |
public function get bitmapData():BitmapData{ | |
return (this._bitmapData); | |
} | |
public function set bitmapData(_arg1:BitmapData):void{ | |
if (_arg1){ | |
this._bitmapData = _arg1; | |
this.contentChange = true; | |
}; | |
} | |
public function get net():Boolean{ | |
return (this._net); | |
} | |
public function set net(_arg1:Boolean):void{ | |
this._net = _arg1; | |
if (!this._net){ | |
this.url = ""; | |
}; | |
} | |
public function get url():String{ | |
return (this._url); | |
} | |
public function set url(_arg1:String):void{ | |
this._url = _arg1; | |
} | |
public function get transparent():Boolean{ | |
return (this._transparent); | |
} | |
public function set transparent(_arg1:Boolean):void{ | |
this._transparent = _arg1; | |
} | |
public function get numOperate():int{ | |
return (this._numOperate); | |
} | |
public function set numOperate(_arg1:int):void{ | |
this._numOperate = _arg1; | |
} | |
public function subscribe(_arg1:IContentObserver, _arg2:String="all"):void{ | |
this._observerData.push(_arg1); | |
} | |
public function unsubscribe(_arg1:IContentObserver, _arg2:String="all"):void{ | |
var _local3:int = this._observerData.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
if (_arg1 === this._observerData[_local4]){ | |
this._observerData.splice(_local4, 1); | |
break; | |
}; | |
_local4++; | |
}; | |
} | |
public function reset():void{ | |
if (this.primalBitmapData){ | |
this.bitmapData = this.primalBitmapData.clone(); | |
}; | |
this.contentChange = false; | |
this.notify(ObserveType.RESET); | |
} | |
private function notify(_arg1:String, ... _args):void{ | |
var _local3:int = this._observerData.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
this._observerData[_local4][_arg1].apply(null, _args); | |
_local4++; | |
}; | |
} | |
} | |
}//package | |
class ObserveType { | |
public static const CONTENT_UPDATE:String = "contentUpdate"; | |
public static const RESET:String = "reset"; | |
public function ObserveType(){ | |
} | |
} | |
package { | |
import mx.core.*; | |
public class PBJFacory_LightColorSweetFilterByteCode extends ByteArrayAsset { | |
} | |
}//package | |
package render { | |
import flash.display.*; | |
public interface IList { | |
function set list(_arg1:Array):void; | |
function set verticalGap(_arg1:int):void; | |
function set horizontalGap(_arg1:int):void; | |
function set columnCount(_arg1:int):void; | |
function set bitmapData(_arg1:BitmapData):void; | |
function reset():void; | |
} | |
}//package render | |
package render { | |
public class BorderItem extends ListItemBase implements IListItem { | |
public function BorderItem(){ | |
super.init(); | |
} | |
} | |
}//package render | |
package render { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
public class ListItemBase extends Sprite implements IListItem { | |
public static const THUMB_WIDTH:int = 64; | |
public static const THUMB_HEIGHT:int = 64; | |
public var selectedSkin:MovieClip; | |
public var bg:MovieClip; | |
public var labelTxt:TextField; | |
public var overSkin:MovieClip; | |
private var _index:int; | |
private var _selected:Boolean; | |
private var _data:Object; | |
private var _overSkin:DisplayObject; | |
private var _selectedSkin:DisplayObject; | |
private var _bg:Sprite; | |
protected var _thumbBitmap:Bitmap; | |
private var _labelTxt:TextField; | |
protected function init():void{ | |
this.buttonMode = true; | |
this._thumbBitmap = new Bitmap(); | |
this._bg = (this.getChildByName("bg") as Sprite); | |
this._bg.addChild(this._thumbBitmap); | |
this._overSkin = this.getChildByName("overSkin"); | |
this._overSkin.visible = false; | |
this._selectedSkin = this.getChildByName("selectedSkin"); | |
this._selectedSkin.visible = false; | |
this._labelTxt = (this.getChildByName("labelTxt") as TextField); | |
this._labelTxt.mouseEnabled = false; | |
this.addEventListener(MouseEvent.ROLL_OVER, this.rollOverHandler); | |
this.addEventListener(MouseEvent.ROLL_OUT, this.rollOutHandler); | |
} | |
public function set status(_arg1:String):void{ | |
} | |
public function get data():Object{ | |
return (this._data); | |
} | |
public function set data(_arg1:Object):void{ | |
this._data = _arg1; | |
} | |
public function get index():int{ | |
return (this._index); | |
} | |
public function set index(_arg1:int):void{ | |
this._index = _arg1; | |
} | |
public function set label(_arg1:String):void{ | |
this._labelTxt.text = ((_arg1) || ("")); | |
} | |
public function get label():String{ | |
return (this._labelTxt.text); | |
} | |
public function get outerWidth():int{ | |
return (this.width); | |
} | |
public function get outerHeight():int{ | |
return (this.height); | |
} | |
public function set selected(_arg1:Boolean):void{ | |
this._selected = _arg1; | |
this._selectedSkin.visible = _arg1; | |
} | |
public function get selected():Boolean{ | |
return (this._selected); | |
} | |
public function set bitmapData(_arg1:BitmapData):void{ | |
this._thumbBitmap.bitmapData = _arg1; | |
this._thumbBitmap.smoothing = true; | |
} | |
public function get bitmapData():BitmapData{ | |
return (this._thumbBitmap.bitmapData); | |
} | |
private function rollOverHandler(_arg1:MouseEvent):void{ | |
if (!this._selected){ | |
this._overSkin.visible = true; | |
}; | |
} | |
private function rollOutHandler(_arg1:MouseEvent):void{ | |
this._overSkin.visible = false; | |
} | |
} | |
}//package render | |
package render { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.net.*; | |
import flash.events.*; | |
import flash.system.*; | |
import com.meitu.util.*; | |
import com.meitu.controls.*; | |
public class BoderList extends ListBase { | |
private var _selectItem:BorderItem; | |
private var _index:int = 0; | |
override public function set list(_arg1:Array):void{ | |
super.list = _arg1; | |
_itemList = []; | |
this.createItem(this._index); | |
} | |
private function createItem(_arg1:int):void{ | |
var _local2:BorderItem = new BorderItem(); | |
_local2.data = _list[_arg1]; | |
_local2.label = _list[_arg1]["label"]; | |
_local2.index = _arg1; | |
_local2.addEventListener(MouseEvent.CLICK, this.itemClickHandler); | |
_itemList.push(_local2); | |
addChild(_local2); | |
var _local3:Object = _list[_arg1].data; | |
var _local4 = (("xuancai/thumb/" + _local3["thumbUrl"]) + ".JPG"); | |
this.loadThumbImage(_local4); | |
} | |
private function itemClickHandler(_arg1:MouseEvent):void{ | |
var _local2:BorderItem; | |
if (this.selectItem){ | |
_local2 = this.selectItem; | |
_local2.selected = false; | |
}; | |
this.selectItem = (_arg1.currentTarget as BorderItem); | |
} | |
private function realign():void{ | |
var _local2:BorderItem; | |
var _local1:int = _list.length; | |
var _local3:int; | |
while (_local3 < _local1) { | |
_local2 = (_itemList[_local3] as BorderItem); | |
if (_direction == TabBarDirection.HORIZONTAL){ | |
_local2.x = (((_local2.outerWidth + horizontalGap) * _local3) >> 0); | |
} else { | |
if (_direction == TabBarDirection.VERTICAL){ | |
_local2.y = (((_local2.outerHeight + verticalGap) * _local3) >> 0); | |
} else { | |
if (_direction == TabBarDirection.ALTERNATE){ | |
_local2.x = (((_local2.outerWidth + horizontalGap) * (_local3 % columnCount)) >> 0); | |
_local2.y = (((_local2.outerHeight + verticalGap) * Math.floor((_local3 / columnCount))) >> 0); | |
}; | |
}; | |
}; | |
_local3++; | |
}; | |
} | |
private function loadThumbImage(_arg1:String):void{ | |
var _local2:Loader = new Loader(); | |
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, this.loadImageCompleteHandler); | |
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, FunctionUtil.eventDelegate(this.loadImageFailHandler, _arg1)); | |
_local2.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, FunctionUtil.eventDelegate(this.loadImageFailHandler, _arg1)); | |
_local2.load(new URLRequest(_arg1), new LoaderContext(true)); | |
} | |
private function loadImageFailHandler(_arg1:Event, _arg2:String):void{ | |
_arg1.currentTarget.removeEventListener(Event.COMPLETE, this.loadImageCompleteHandler); | |
_arg1.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR, this.loadImageFailHandler); | |
_arg1.currentTarget.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.loadImageFailHandler); | |
InstanceFactory.mainApplication.statistic.trackEvent("app", "error", _arg2); | |
this._index++; | |
if (this._index < _list.length){ | |
this.createItem(this._index); | |
} else { | |
this.realign(); | |
this.reset(); | |
}; | |
} | |
private function loadImageCompleteHandler(_arg1:Event):void{ | |
_arg1.currentTarget.removeEventListener(Event.COMPLETE, this.loadImageCompleteHandler); | |
_arg1.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR, this.loadImageFailHandler); | |
_arg1.currentTarget.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.loadImageFailHandler); | |
var _local2:LoaderInfo = (_arg1.target as LoaderInfo); | |
var _local3:Bitmap = (_local2.content as Bitmap); | |
var _local4:BorderItem = (_itemList[this._index] as BorderItem); | |
var _local5:Number = (ListItemBase.THUMB_WIDTH / _local3.bitmapData.width); | |
var _local6:Number = (ListItemBase.THUMB_HEIGHT / _local3.bitmapData.height); | |
var _local7:Matrix = new Matrix(); | |
_local7.scale(_local5, _local6); | |
var _local8:BitmapData = new BitmapData(ListItemBase.THUMB_WIDTH, ListItemBase.THUMB_HEIGHT, true, 0); | |
_local8.draw(_local3.bitmapData, _local7, null, null, null, true); | |
_local4.bitmapData = _local8; | |
this._index++; | |
if (this._index < _list.length){ | |
this.createItem(this._index); | |
} else { | |
this.realign(); | |
this.reset(); | |
}; | |
} | |
override public function reset():void{ | |
if (this._selectItem){ | |
this._selectItem.selected = false; | |
this._selectItem = null; | |
}; | |
} | |
public function get selectItem():BorderItem{ | |
return (this._selectItem); | |
} | |
public function set selectItem(_arg1:BorderItem):void{ | |
var _local2:Object; | |
if (_arg1){ | |
this._selectItem = _arg1; | |
this._selectItem.selected = true; | |
_local2 = _list[this.selectItem.index].data; | |
InstanceFactory.photoEditor.listItemClickHandler("border", _local2); | |
}; | |
} | |
} | |
}//package render | |
package render { | |
import flash.display.*; | |
public interface IListItem { | |
function set bitmapData(_arg1:BitmapData):void; | |
function get data():Object; | |
function set data(_arg1:Object):void; | |
function get index():int; | |
function set index(_arg1:int):void; | |
function set label(_arg1:String):void; | |
function get label():String; | |
function get outerWidth():int; | |
function get outerHeight():int; | |
function set selected(_arg1:Boolean):void; | |
function get selected():Boolean; | |
} | |
}//package render | |
package render { | |
import flash.events.*; | |
import component.*; | |
import util.*; | |
import com.meitu.controls.*; | |
public class EffectList extends ListBase { | |
private var _selectItem:EffectItem; | |
override public function set list(_arg1:Array):void{ | |
super.list = _arg1; | |
this.createItem(); | |
this.realign(); | |
if (!this.selectItem){ | |
}; | |
} | |
private function createItem():void{ | |
var _local1:EffectItem; | |
_itemList = []; | |
var _local2:int; | |
while (_local2 < _list.length) { | |
_local1 = new EffectItem(); | |
_local1.data = _list[_local2]; | |
_local1.label = _list[_local2]["label"]; | |
_local1.index = _local2; | |
_local1.addEventListener(MouseEvent.CLICK, this.itemClickHandler); | |
_itemList.push(_local1); | |
addChild(_local1); | |
_local2++; | |
}; | |
} | |
private function itemClickHandler(_arg1:MouseEvent):void{ | |
var _local4:EffectItem; | |
if (this.selectItem){ | |
_local4 = this.selectItem; | |
_local4.selected = false; | |
}; | |
this.selectItem = (_arg1.currentTarget as EffectItem); | |
var _local2:IComponent = (_arg1.currentTarget.parent.parent.parent.parent as IComponent); | |
var _local3:Object = _list[this.selectItem.index].data; | |
InstanceFactory.photoEditor.listItemClickHandler(_local2.type, _local3); | |
} | |
public function get selectItem():EffectItem{ | |
return (this._selectItem); | |
} | |
public function set selectItem(_arg1:EffectItem):void{ | |
if (_arg1){ | |
this._selectItem = _arg1; | |
this._selectItem.selected = true; | |
}; | |
} | |
private function realign():void{ | |
var _local2:EffectItem; | |
var _local1:int = _list.length; | |
var _local3:int; | |
while (_local3 < _local1) { | |
_local2 = (_itemList[_local3] as EffectItem); | |
if (_direction == TabBarDirection.HORIZONTAL){ | |
_local2.x = (((_local2.outerWidth + horizontalGap) * _local3) >> 0); | |
} else { | |
if (_direction == TabBarDirection.VERTICAL){ | |
_local2.y = (((_local2.outerHeight + verticalGap) * _local3) >> 0); | |
} else { | |
if (_direction == TabBarDirection.ALTERNATE){ | |
_local2.x = (((_local2.outerWidth + horizontalGap) * (_local3 % columnCount)) >> 0); | |
_local2.y = (((_local2.outerHeight + verticalGap) * Math.floor((_local3 / columnCount))) >> 0); | |
}; | |
}; | |
}; | |
_local3++; | |
}; | |
} | |
override public function update(_arg1:int):void{ | |
var _local2:Object = _list[_arg1].data; | |
var _local3:EffectItem = (_itemList[_arg1] as EffectItem); | |
_local3.bitmapData = EffectUtil.doEffect(bitmapData, _local2.type, _local2.filterFun); | |
_arg1++; | |
if (_arg1 < _list.length){ | |
this.update(_arg1); | |
}; | |
} | |
override public function reset():void{ | |
if (this.selectItem){ | |
this._selectItem.selected = false; | |
this._selectItem = null; | |
}; | |
} | |
} | |
}//package render | |
package render { | |
public class EffectItem extends ListItemBase implements IListItem { | |
public function EffectItem(){ | |
super.init(); | |
} | |
} | |
}//package render | |
package render { | |
import flash.display.*; | |
public class ListBase extends Sprite implements IList { | |
protected var _direction:String = "alternate"; | |
private var _columnCount:int = 2; | |
private var _horizontalGap:int = 4; | |
private var _verticalGap:int = 4; | |
private var _index:int; | |
private var _bitmapData:BitmapData; | |
protected var _list:Array; | |
protected var _itemList:Array; | |
public function update(_arg1:int):void{ | |
} | |
public function reset():void{ | |
} | |
public function set columnCount(_arg1:int):void{ | |
this._columnCount = _arg1; | |
} | |
public function get columnCount():int{ | |
return (this._columnCount); | |
} | |
public function set horizontalGap(_arg1:int):void{ | |
this._horizontalGap = _arg1; | |
} | |
public function get horizontalGap():int{ | |
return (this._horizontalGap); | |
} | |
public function set verticalGap(_arg1:int):void{ | |
this._verticalGap = _arg1; | |
} | |
public function get verticalGap():int{ | |
return (this._verticalGap); | |
} | |
public function set list(_arg1:Array):void{ | |
this._list = _arg1; | |
} | |
public function get bitmapData():BitmapData{ | |
return (this._bitmapData); | |
} | |
public function set bitmapData(_arg1:BitmapData):void{ | |
this._bitmapData = _arg1; | |
this._index = 0; | |
this.update(this._index); | |
} | |
} | |
}//package render | |
package { | |
import flash.display.*; | |
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip { | |
} | |
}//package | |
package { | |
import mx.core.*; | |
public class PBJFacory_EnhanceFilterByteCode extends ByteArrayAsset { | |
} | |
}//package | |
package { | |
import mx.core.*; | |
public class PBJFacory_XProIIFilterByteCode extends ByteArrayAsset { | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class DownArrowUpSkin extends MovieClip { | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class LastUp extends BitmapData { | |
public function LastUp(_arg1:int=60, _arg2:int=26){ | |
super(_arg1, _arg2); | |
} | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class ScrollThumb_overSkin extends MovieClip { | |
} | |
}//package | |
package fl.containers { | |
import flash.display.*; | |
import fl.controls.*; | |
import flash.geom.*; | |
import fl.core.*; | |
import flash.events.*; | |
import fl.events.*; | |
public class BaseScrollPane extends UIComponent { | |
protected static const SCROLL_BAR_STYLES:Object = { | |
upArrowDisabledSkin:"upArrowDisabledSkin", | |
upArrowDownSkin:"upArrowDownSkin", | |
upArrowOverSkin:"upArrowOverSkin", | |
upArrowUpSkin:"upArrowUpSkin", | |
downArrowDisabledSkin:"downArrowDisabledSkin", | |
downArrowDownSkin:"downArrowDownSkin", | |
downArrowOverSkin:"downArrowOverSkin", | |
downArrowUpSkin:"downArrowUpSkin", | |
thumbDisabledSkin:"thumbDisabledSkin", | |
thumbDownSkin:"thumbDownSkin", | |
thumbOverSkin:"thumbOverSkin", | |
thumbUpSkin:"thumbUpSkin", | |
thumbIcon:"thumbIcon", | |
trackDisabledSkin:"trackDisabledSkin", | |
trackDownSkin:"trackDownSkin", | |
trackOverSkin:"trackOverSkin", | |
trackUpSkin:"trackUpSkin", | |
repeatDelay:"repeatDelay", | |
repeatInterval:"repeatInterval" | |
}; | |
private static var defaultStyles:Object = { | |
repeatDelay:500, | |
repeatInterval:35, | |
skin:"ScrollPane_upSkin", | |
contentPadding:0, | |
disabledAlpha:0.5 | |
}; | |
protected var contentHeight:Number = 0; | |
protected var _horizontalScrollBar:ScrollBar; | |
protected var _horizontalPageScrollSize:Number = 0; | |
protected var _verticalPageScrollSize:Number = 0; | |
protected var _maxHorizontalScrollPosition:Number = 0; | |
protected var defaultLineScrollSize:Number = 4; | |
protected var vOffset:Number = 0; | |
protected var contentScrollRect:Rectangle; | |
protected var background:DisplayObject; | |
protected var _verticalScrollBar:ScrollBar; | |
protected var disabledOverlay:Shape; | |
protected var vScrollBar:Boolean; | |
protected var _horizontalScrollPolicy:String; | |
protected var useFixedHorizontalScrolling:Boolean = false; | |
protected var contentWidth:Number = 0; | |
protected var availableHeight:Number; | |
protected var _verticalScrollPolicy:String; | |
protected var contentPadding:Number = 0; | |
protected var _useBitmpScrolling:Boolean = false; | |
protected var availableWidth:Number; | |
protected var hScrollBar:Boolean; | |
public static function getStyleDefinition():Object{ | |
return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition())); | |
} | |
override public function set enabled(_arg1:Boolean):void{ | |
if (enabled == _arg1){ | |
return; | |
}; | |
_verticalScrollBar.enabled = _arg1; | |
_horizontalScrollBar.enabled = _arg1; | |
super.enabled = _arg1; | |
} | |
public function set useBitmapScrolling(_arg1:Boolean):void{ | |
_useBitmpScrolling = _arg1; | |
invalidate(InvalidationType.STATE); | |
} | |
public function set horizontalLineScrollSize(_arg1:Number):void{ | |
_horizontalScrollBar.lineScrollSize = _arg1; | |
} | |
protected function drawLayout():void{ | |
calculateAvailableSize(); | |
calculateContentWidth(); | |
background.width = width; | |
background.height = height; | |
if (vScrollBar){ | |
_verticalScrollBar.visible = true; | |
_verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding); | |
_verticalScrollBar.y = contentPadding; | |
_verticalScrollBar.height = availableHeight; | |
} else { | |
_verticalScrollBar.visible = false; | |
}; | |
_verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize); | |
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false); | |
if (hScrollBar){ | |
_horizontalScrollBar.visible = true; | |
_horizontalScrollBar.x = contentPadding; | |
_horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding); | |
_horizontalScrollBar.width = availableWidth; | |
} else { | |
_horizontalScrollBar.visible = false; | |
}; | |
_horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize); | |
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false); | |
drawDisabledOverlay(); | |
} | |
protected function handleWheel(_arg1:MouseEvent):void{ | |
if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){ | |
return; | |
}; | |
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize)); | |
setVerticalScrollPosition(_verticalScrollBar.scrollPosition); | |
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition)); | |
} | |
protected function handleScroll(_arg1:ScrollEvent):void{ | |
if (_arg1.target == _verticalScrollBar){ | |
setVerticalScrollPosition(_arg1.position); | |
} else { | |
setHorizontalScrollPosition(_arg1.position); | |
}; | |
} | |
public function get verticalLineScrollSize():Number{ | |
return (_verticalScrollBar.lineScrollSize); | |
} | |
protected function drawBackground():void{ | |
var _local1:DisplayObject = background; | |
background = getDisplayObjectInstance(getStyleValue("skin")); | |
background.width = width; | |
background.height = height; | |
addChildAt(background, 0); | |
if (((!((_local1 == null))) && (!((_local1 == background))))){ | |
removeChild(_local1); | |
}; | |
} | |
protected function calculateAvailableSize():void{ | |
var _local1:Number = ScrollBar.WIDTH; | |
var _local2:Number = (contentPadding = Number(getStyleValue("contentPadding"))); | |
var _local3:Number = ((height - (2 * _local2)) - vOffset); | |
vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3))))); | |
var _local4:Number = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2)); | |
var _local5:Number = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4); | |
hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0))))); | |
if (hScrollBar){ | |
_local3 = (_local3 - _local1); | |
}; | |
if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){ | |
vScrollBar = true; | |
_local4 = (_local4 - _local1); | |
}; | |
availableHeight = (_local3 + vOffset); | |
availableWidth = _local4; | |
} | |
public function get verticalScrollPosition():Number{ | |
return (_verticalScrollBar.scrollPosition); | |
} | |
public function get horizontalScrollPolicy():String{ | |
return (_horizontalScrollPolicy); | |
} | |
protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ | |
} | |
public function get horizontalPageScrollSize():Number{ | |
if (isNaN(availableWidth)){ | |
drawNow(); | |
}; | |
return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize); | |
} | |
public function set horizontalScrollPosition(_arg1:Number):void{ | |
drawNow(); | |
_horizontalScrollBar.scrollPosition = _arg1; | |
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false); | |
} | |
public function set verticalLineScrollSize(_arg1:Number):void{ | |
_verticalScrollBar.lineScrollSize = _arg1; | |
} | |
public function get maxVerticalScrollPosition():Number{ | |
drawNow(); | |
return (Math.max(0, (contentHeight - availableHeight))); | |
} | |
public function set horizontalPageScrollSize(_arg1:Number):void{ | |
_horizontalPageScrollSize = _arg1; | |
invalidate(InvalidationType.SIZE); | |
} | |
override protected function draw():void{ | |
if (isInvalid(InvalidationType.STYLES)){ | |
setStyles(); | |
drawBackground(); | |
if (contentPadding != getStyleValue("contentPadding")){ | |
invalidate(InvalidationType.SIZE, false); | |
}; | |
}; | |
if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){ | |
drawLayout(); | |
}; | |
updateChildren(); | |
super.draw(); | |
} | |
public function get horizontalScrollBar():ScrollBar{ | |
return (_horizontalScrollBar); | |
} | |
protected function calculateContentWidth():void{ | |
} | |
public function set horizontalScrollPolicy(_arg1:String):void{ | |
_horizontalScrollPolicy = _arg1; | |
invalidate(InvalidationType.SIZE); | |
} | |
override protected function configUI():void{ | |
super.configUI(); | |
contentScrollRect = new Rectangle(0, 0, 85, 85); | |
_verticalScrollBar = new ScrollBar(); | |
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true); | |
_verticalScrollBar.visible = false; | |
_verticalScrollBar.lineScrollSize = defaultLineScrollSize; | |
addChild(_verticalScrollBar); | |
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES); | |
_horizontalScrollBar = new ScrollBar(); | |
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL; | |
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true); | |
_horizontalScrollBar.visible = false; | |
_horizontalScrollBar.lineScrollSize = defaultLineScrollSize; | |
addChild(_horizontalScrollBar); | |
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES); | |
disabledOverlay = new Shape(); | |
var _local1:Graphics = disabledOverlay.graphics; | |
_local1.beginFill(0xFFFFFF); | |
_local1.drawRect(0, 0, width, height); | |
_local1.endFill(); | |
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true); | |
} | |
protected function drawDisabledOverlay():void{ | |
if (enabled){ | |
if (contains(disabledOverlay)){ | |
removeChild(disabledOverlay); | |
}; | |
} else { | |
disabledOverlay.x = (disabledOverlay.y = contentPadding); | |
disabledOverlay.width = availableWidth; | |
disabledOverlay.height = availableHeight; | |
disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number); | |
addChild(disabledOverlay); | |
}; | |
} | |
public function get horizontalScrollPosition():Number{ | |
return (_horizontalScrollBar.scrollPosition); | |
} | |
public function get verticalScrollBar():ScrollBar{ | |
return (_verticalScrollBar); | |
} | |
public function get horizontalLineScrollSize():Number{ | |
return (_horizontalScrollBar.lineScrollSize); | |
} | |
public function set verticalScrollPosition(_arg1:Number):void{ | |
drawNow(); | |
_verticalScrollBar.scrollPosition = _arg1; | |
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false); | |
} | |
protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ | |
} | |
protected function setStyles():void{ | |
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES); | |
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES); | |
} | |
public function set verticalPageScrollSize(_arg1:Number):void{ | |
_verticalPageScrollSize = _arg1; | |
invalidate(InvalidationType.SIZE); | |
} | |
protected function setContentSize(_arg1:Number, _arg2:Number):void{ | |
if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){ | |
return; | |
}; | |
contentWidth = _arg1; | |
contentHeight = _arg2; | |
invalidate(InvalidationType.SIZE); | |
} | |
public function set verticalScrollPolicy(_arg1:String):void{ | |
_verticalScrollPolicy = _arg1; | |
invalidate(InvalidationType.SIZE); | |
} | |
public function get maxHorizontalScrollPosition():Number{ | |
drawNow(); | |
return (Math.max(0, (contentWidth - availableWidth))); | |
} | |
protected function updateChildren():void{ | |
_verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled); | |
_verticalScrollBar.drawNow(); | |
_horizontalScrollBar.drawNow(); | |
} | |
public function get verticalPageScrollSize():Number{ | |
if (isNaN(availableHeight)){ | |
drawNow(); | |
}; | |
return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize); | |
} | |
public function get verticalScrollPolicy():String{ | |
return (_verticalScrollPolicy); | |
} | |
public function get useBitmapScrolling():Boolean{ | |
return (_useBitmpScrolling); | |
} | |
} | |
}//package fl.containers | |
package fl.containers { | |
import flash.display.*; | |
import fl.controls.*; | |
import fl.core.*; | |
import flash.ui.*; | |
import flash.net.*; | |
import flash.events.*; | |
import flash.system.*; | |
import fl.managers.*; | |
import fl.events.*; | |
public class ScrollPane extends BaseScrollPane implements IFocusManagerComponent { | |
private static var defaultStyles:Object = { | |
upSkin:"ScrollPane_upSkin", | |
disabledSkin:"ScrollPane_disabledSkin", | |
focusRectSkin:null, | |
focusRectPadding:null, | |
contentPadding:0 | |
}; | |
protected var scrollDragHPos:Number; | |
protected var loader:Loader; | |
protected var xOffset:Number; | |
protected var _source:Object = ""; | |
protected var scrollDragVPos:Number; | |
protected var _scrollDrag:Boolean = false; | |
protected var currentContent:Object; | |
protected var contentClip:Sprite; | |
protected var yOffset:Number; | |
public static function getStyleDefinition():Object{ | |
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition())); | |
} | |
protected function clearContent():void{ | |
if (contentClip.numChildren == 0){ | |
return; | |
}; | |
contentClip.removeChildAt(0); | |
currentContent = null; | |
if (loader != null){ | |
try { | |
loader.close(); | |
} catch(e) { | |
}; | |
try { | |
loader.unload(); | |
} catch(e) { | |
}; | |
loader = null; | |
}; | |
} | |
protected function passEvent(_arg1:Event):void{ | |
dispatchEvent(_arg1); | |
} | |
protected function calculateAvailableHeight():Number{ | |
var _local1:Number = Number(getStyleValue("contentPadding")); | |
return (((height - (_local1 * 2)) - ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0)); | |
} | |
override protected function drawLayout():void{ | |
super.drawLayout(); | |
contentScrollRect = contentClip.scrollRect; | |
contentScrollRect.width = availableWidth; | |
contentScrollRect.height = availableHeight; | |
contentClip.cacheAsBitmap = useBitmapScrolling; | |
contentClip.scrollRect = contentScrollRect; | |
contentClip.x = (contentClip.y = contentPadding); | |
} | |
public function get bytesTotal():Number{ | |
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesTotal); | |
} | |
public function get source():Object{ | |
return (_source); | |
} | |
override protected function handleScroll(_arg1:ScrollEvent):void{ | |
passEvent(_arg1); | |
super.handleScroll(_arg1); | |
} | |
protected function onContentLoad(_arg1:Event):void{ | |
update(); | |
var _local2:* = calculateAvailableHeight(); | |
calculateAvailableSize(); | |
horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), availableWidth); | |
verticalScrollBar.setScrollProperties(_local2, 0, (contentHeight - _local2), _local2); | |
passEvent(_arg1); | |
} | |
public function get scrollDrag():Boolean{ | |
return (_scrollDrag); | |
} | |
protected function setScrollDrag():void{ | |
if (_scrollDrag){ | |
contentClip.addEventListener(MouseEvent.MOUSE_DOWN, doStartDrag, false, 0, true); | |
stage.addEventListener(MouseEvent.MOUSE_UP, endDrag, false, 0, true); | |
} else { | |
contentClip.removeEventListener(MouseEvent.MOUSE_DOWN, doStartDrag); | |
stage.removeEventListener(MouseEvent.MOUSE_UP, endDrag); | |
removeEventListener(MouseEvent.MOUSE_MOVE, doDrag); | |
}; | |
contentClip.buttonMode = _scrollDrag; | |
} | |
public function get percentLoaded():Number{ | |
if (loader != null){ | |
return (Math.round(((bytesLoaded / bytesTotal) * 100))); | |
}; | |
return (0); | |
} | |
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ | |
var _local3:* = contentClip.scrollRect; | |
_local3.y = _arg1; | |
contentClip.scrollRect = _local3; | |
} | |
protected function endDrag(_arg1:MouseEvent):void{ | |
stage.removeEventListener(MouseEvent.MOUSE_MOVE, doDrag); | |
} | |
override protected function drawBackground():void{ | |
var _local1:DisplayObject = background; | |
background = getDisplayObjectInstance(getStyleValue((enabled) ? "upSkin" : "disabledSkin")); | |
background.width = width; | |
background.height = height; | |
addChildAt(background, 0); | |
if (((!((_local1 == null))) && (!((_local1 == background))))){ | |
removeChild(_local1); | |
}; | |
} | |
public function set source(_arg1:Object):void{ | |
var _local2:*; | |
clearContent(); | |
if (isLivePreview){ | |
return; | |
}; | |
_source = _arg1; | |
if ((((_source == "")) || ((_source == null)))){ | |
return; | |
}; | |
currentContent = getDisplayObjectInstance(_arg1); | |
if (currentContent != null){ | |
_local2 = contentClip.addChild((currentContent as DisplayObject)); | |
dispatchEvent(new Event(Event.INIT)); | |
update(); | |
} else { | |
load(new URLRequest(_source.toString())); | |
}; | |
} | |
public function set scrollDrag(_arg1:Boolean):void{ | |
_scrollDrag = _arg1; | |
invalidate(InvalidationType.STATE); | |
} | |
protected function initLoader():void{ | |
loader = new Loader(); | |
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleError, false, 0, true); | |
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError, false, 0, true); | |
loader.contentLoaderInfo.addEventListener(Event.OPEN, passEvent, false, 0, true); | |
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, passEvent, false, 0, true); | |
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onContentLoad, false, 0, true); | |
loader.contentLoaderInfo.addEventListener(Event.INIT, passEvent, false, 0, true); | |
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, passEvent, false, 0, true); | |
contentClip.addChild(loader); | |
} | |
override protected function draw():void{ | |
if (isInvalid(InvalidationType.STYLES)){ | |
drawBackground(); | |
}; | |
if (isInvalid(InvalidationType.STATE)){ | |
setScrollDrag(); | |
}; | |
super.draw(); | |
} | |
protected function clearLoadEvents():void{ | |
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleError); | |
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, handleError); | |
loader.contentLoaderInfo.removeEventListener(Event.OPEN, passEvent); | |
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, passEvent); | |
loader.contentLoaderInfo.removeEventListener(HTTPStatusEvent.HTTP_STATUS, passEvent); | |
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onContentLoad); | |
} | |
protected function handleError(_arg1:Event):void{ | |
passEvent(_arg1); | |
clearLoadEvents(); | |
loader.contentLoaderInfo.removeEventListener(Event.INIT, handleInit); | |
} | |
public function get bytesLoaded():Number{ | |
return (((((loader == null)) || ((loader.contentLoaderInfo == null)))) ? 0 : loader.contentLoaderInfo.bytesLoaded); | |
} | |
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{ | |
var _local3:* = contentClip.scrollRect; | |
_local3.x = _arg1; | |
contentClip.scrollRect = _local3; | |
} | |
override protected function configUI():void{ | |
super.configUI(); | |
contentClip = new Sprite(); | |
addChild(contentClip); | |
contentClip.scrollRect = contentScrollRect; | |
_horizontalScrollPolicy = ScrollPolicy.AUTO; | |
_verticalScrollPolicy = ScrollPolicy.AUTO; | |
} | |
protected function handleInit(_arg1:Event):void{ | |
loader.contentLoaderInfo.removeEventListener(Event.INIT, handleInit); | |
passEvent(_arg1); | |
invalidate(InvalidationType.SIZE); | |
} | |
public function update():void{ | |
var _local1:DisplayObject = contentClip.getChildAt(0); | |
setContentSize(_local1.width, _local1.height); | |
} | |
public function refreshPane():void{ | |
if ((_source is URLRequest)){ | |
_source = _source.url; | |
}; | |
source = _source; | |
} | |
public function load(_arg1:URLRequest, _arg2:LoaderContext=null):void{ | |
if (_arg2 == null){ | |
_arg2 = new LoaderContext(false, ApplicationDomain.currentDomain); | |
}; | |
clearContent(); | |
initLoader(); | |
currentContent = (_source = _arg1); | |
loader.load(_arg1, _arg2); | |
} | |
protected function doStartDrag(_arg1:MouseEvent):void{ | |
if (!enabled){ | |
return; | |
}; | |
xOffset = mouseX; | |
yOffset = mouseY; | |
scrollDragHPos = horizontalScrollPosition; | |
scrollDragVPos = verticalScrollPosition; | |
stage.addEventListener(MouseEvent.MOUSE_MOVE, doDrag, false, 0, true); | |
} | |
protected function doDrag(_arg1:MouseEvent):void{ | |
var _local2:* = (scrollDragVPos - (mouseY - yOffset)); | |
_verticalScrollBar.setScrollPosition(_local2); | |
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, true); | |
var _local3:* = (scrollDragHPos - (mouseX - xOffset)); | |
_horizontalScrollBar.setScrollPosition(_local3); | |
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, true); | |
} | |
override protected function keyDownHandler(_arg1:KeyboardEvent):void{ | |
var _local2:int = calculateAvailableHeight(); | |
switch (_arg1.keyCode){ | |
case Keyboard.DOWN: | |
verticalScrollPosition++; | |
break; | |
case Keyboard.UP: | |
verticalScrollPosition--; | |
break; | |
case Keyboard.RIGHT: | |
horizontalScrollPosition++; | |
break; | |
case Keyboard.LEFT: | |
horizontalScrollPosition--; | |
break; | |
case Keyboard.END: | |
verticalScrollPosition = maxVerticalScrollPosition; | |
break; | |
case Keyboard.HOME: | |
verticalScrollPosition = 0; | |
break; | |
case Keyboard.PAGE_UP: | |
verticalScrollPosition = (verticalScrollPosition - _local2); | |
break; | |
case Keyboard.PAGE_DOWN: | |
verticalScrollPosition = (verticalScrollPosition + _local2); | |
break; | |
}; | |
} | |
public function get content():DisplayObject{ | |
var _local1:Object = currentContent; | |
if ((_local1 is URLRequest)){ | |
_local1 = loader.content; | |
}; | |
return ((_local1 as DisplayObject)); | |
} | |
} | |
}//package fl.containers | |
package fl.controls { | |
import flash.display.*; | |
import fl.core.*; | |
import flash.ui.*; | |
import flash.events.*; | |
import flash.text.*; | |
import fl.managers.*; | |
import fl.events.*; | |
public class LabelButton extends BaseButton implements IFocusManagerComponent { | |
private static var defaultStyles:Object = { | |
icon:null, | |
upIcon:null, | |
downIcon:null, | |
overIcon:null, | |
disabledIcon:null, | |
selectedDisabledIcon:null, | |
selectedUpIcon:null, | |
selectedDownIcon:null, | |
selectedOverIcon:null, | |
textFormat:null, | |
disabledTextFormat:null, | |
textPadding:5, | |
embedFonts:false | |
}; | |
public static var createAccessibilityImplementation:Function; | |
protected var _toggle:Boolean = false; | |
public var textField:TextField; | |
protected var mode:String = "center"; | |
protected var _labelPlacement:String = "right"; | |
protected var oldMouseState:String; | |
protected var _label:String = "Label"; | |
protected var icon:DisplayObject; | |
public static function getStyleDefinition():Object{ | |
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition())); | |
} | |
override protected function draw():void{ | |
if (textField.text != _label){ | |
label = _label; | |
}; | |
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ | |
drawBackground(); | |
drawIcon(); | |
drawTextFormat(); | |
invalidate(InvalidationType.SIZE, false); | |
}; | |
if (isInvalid(InvalidationType.SIZE)){ | |
drawLayout(); | |
}; | |
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ | |
if (((isFocused) && (focusManager.showFocusIndicator))){ | |
drawFocus(true); | |
}; | |
}; | |
validate(); | |
} | |
override protected function drawLayout():void{ | |
var _local7:Number; | |
var _local8:Number; | |
var _local1:Number = Number(getStyleValue("textPadding")); | |
var _local2:String = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement; | |
textField.height = (textField.textHeight + 4); | |
var _local3:Number = (textField.textWidth + 4); | |
var _local4:Number = (textField.textHeight + 4); | |
var _local5:Number = ((icon)==null) ? 0 : (icon.width + _local1); | |
var _local6:Number = ((icon)==null) ? 0 : (icon.height + _local1); | |
textField.visible = (label.length > 0); | |
if (icon != null){ | |
icon.x = Math.round(((width - icon.width) / 2)); | |
icon.y = Math.round(((height - icon.height) / 2)); | |
}; | |
if (textField.visible == false){ | |
textField.width = 0; | |
textField.height = 0; | |
} else { | |
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){ | |
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1)))); | |
if ((height - 2) > _local4){ | |
_local8 = _local4; | |
} else { | |
_local8 = (height - 2); | |
}; | |
_local3 = _local7; | |
textField.width = _local3; | |
_local4 = _local8; | |
textField.height = _local4; | |
textField.x = Math.round(((width - _local3) / 2)); | |
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0)); | |
if (icon != null){ | |
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1)); | |
}; | |
} else { | |
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1)))); | |
_local3 = _local7; | |
textField.width = _local3; | |
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0)); | |
textField.y = Math.round(((height - textField.height) / 2)); | |
if (icon != null){ | |
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1)); | |
}; | |
}; | |
}; | |
super.drawLayout(); | |
} | |
protected function toggleSelected(_arg1:MouseEvent):void{ | |
selected = !(selected); | |
dispatchEvent(new Event(Event.CHANGE, true)); | |
} | |
override protected function keyUpHandler(_arg1:KeyboardEvent):void{ | |
if (!enabled){ | |
return; | |
}; | |
if (_arg1.keyCode == Keyboard.SPACE){ | |
setMouseState(oldMouseState); | |
oldMouseState = null; | |
endPress(); | |
dispatchEvent(new MouseEvent(MouseEvent.CLICK)); | |
}; | |
} | |
public function get labelPlacement():String{ | |
return (_labelPlacement); | |
} | |
public function get toggle():Boolean{ | |
return (_toggle); | |
} | |
protected function setEmbedFont(){ | |
var _local1:Object = getStyleValue("embedFonts"); | |
if (_local1 != null){ | |
textField.embedFonts = _local1; | |
}; | |
} | |
override public function get selected():Boolean{ | |
return ((_toggle) ? _selected : false); | |
} | |
override protected function configUI():void{ | |
super.configUI(); | |
textField = new TextField(); | |
textField.type = TextFieldType.DYNAMIC; | |
textField.selectable = false; | |
addChild(textField); | |
} | |
override protected function initializeAccessibility():void{ | |
if (LabelButton.createAccessibilityImplementation != null){ | |
LabelButton.createAccessibilityImplementation(this); | |
}; | |
} | |
public function set labelPlacement(_arg1:String):void{ | |
_labelPlacement = _arg1; | |
invalidate(InvalidationType.SIZE); | |
} | |
protected function drawIcon():void{ | |
var _local1:DisplayObject = icon; | |
var _local2:String = (enabled) ? mouseState : "disabled"; | |
if (selected){ | |
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1)); | |
}; | |
_local2 = (_local2 + "Icon"); | |
var _local3:Object = getStyleValue(_local2); | |
if (_local3 == null){ | |
_local3 = getStyleValue("icon"); | |
}; | |
if (_local3 != null){ | |
icon = getDisplayObjectInstance(_local3); | |
}; | |
if (icon != null){ | |
addChildAt(icon, 1); | |
}; | |
if (((!((_local1 == null))) && (!((_local1 == icon))))){ | |
removeChild(_local1); | |
}; | |
} | |
public function set label(_arg1:String):void{ | |
_label = _arg1; | |
if (textField.text != _label){ | |
textField.text = _label; | |
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE)); | |
}; | |
invalidate(InvalidationType.SIZE); | |
invalidate(InvalidationType.STYLES); | |
} | |
override protected function keyDownHandler(_arg1:KeyboardEvent):void{ | |
if (!enabled){ | |
return; | |
}; | |
if (_arg1.keyCode == Keyboard.SPACE){ | |
if (oldMouseState == null){ | |
oldMouseState = mouseState; | |
}; | |
setMouseState("down"); | |
startPress(); | |
}; | |
} | |
public function set toggle(_arg1:Boolean):void{ | |
if (((!(_arg1)) && (super.selected))){ | |
selected = false; | |
}; | |
_toggle = _arg1; | |
if (_toggle){ | |
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true); | |
} else { | |
removeEventListener(MouseEvent.CLICK, toggleSelected); | |
}; | |
invalidate(InvalidationType.STATE); | |
} | |
override public function set selected(_arg1:Boolean):void{ | |
_selected = _arg1; | |
if (_toggle){ | |
invalidate(InvalidationType.STATE); | |
}; | |
} | |
protected function drawTextFormat():void{ | |
var _local1:Object = UIComponent.getStyleDefinition(); | |
var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat); | |
textField.setTextFormat(_local2); | |
var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat); | |
if (_local3 != null){ | |
textField.setTextFormat(_local3); | |
} else { | |
_local3 = _local2; | |
}; | |
textField.defaultTextFormat = _local3; | |
setEmbedFont(); | |
} | |
public function get label():String{ | |
return (_label); | |
} | |
} | |
}//package fl.controls | |
package fl.controls { | |
public class ScrollPolicy { | |
public static const OFF:String = "off"; | |
public static const ON:String = "on"; | |
public static const AUTO:String = "auto"; | |
} | |
}//package fl.controls | |
package fl.controls { | |
import flash.display.*; | |
import fl.core.*; | |
import fl.managers.*; | |
public class Button extends LabelButton implements IFocusManagerComponent { | |
private static var defaultStyles:Object = { | |
emphasizedSkin:"Button_emphasizedSkin", | |
emphasizedPadding:2 | |
}; | |
public static var createAccessibilityImplementation:Function; | |
protected var _emphasized:Boolean = false; | |
protected var emphasizedBorder:DisplayObject; | |
public static function getStyleDefinition():Object{ | |
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles)); | |
} | |
public function set emphasized(_arg1:Boolean):void{ | |
_emphasized = _arg1; | |
invalidate(InvalidationType.STYLES); | |
} | |
override protected function initializeAccessibility():void{ | |
if (Button.createAccessibilityImplementation != null){ | |
Button.createAccessibilityImplementation(this); | |
}; | |
} | |
protected function drawEmphasized():void{ | |
var _local2:Number; | |
if (emphasizedBorder != null){ | |
removeChild(emphasizedBorder); | |
}; | |
emphasizedBorder = null; | |
if (!_emphasized){ | |
return; | |
}; | |
var _local1:Object = getStyleValue("emphasizedSkin"); | |
if (_local1 != null){ | |
emphasizedBorder = getDisplayObjectInstance(_local1); | |
}; | |
if (emphasizedBorder != null){ | |
addChildAt(emphasizedBorder, 0); | |
_local2 = Number(getStyleValue("emphasizedPadding")); | |
emphasizedBorder.x = (emphasizedBorder.y = -(_local2)); | |
emphasizedBorder.width = (width + (_local2 * 2)); | |
emphasizedBorder.height = (height + (_local2 * 2)); | |
}; | |
} | |
public function get emphasized():Boolean{ | |
return (_emphasized); | |
} | |
override protected function draw():void{ | |
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){ | |
drawEmphasized(); | |
}; | |
super.draw(); | |
if (emphasizedBorder != null){ | |
setChildIndex(emphasizedBorder, (numChildren - 1)); | |
}; | |
} | |
override public function drawFocus(_arg1:Boolean):void{ | |
var _local2:Number; | |
var _local3:*; | |
super.drawFocus(_arg1); | |
if (_arg1){ | |
_local2 = Number(getStyleValue("emphasizedPadding")); | |
if ((((_local2 < 0)) || (!(_emphasized)))){ | |
_local2 = 0; | |
}; | |
_local3 = getStyleValue("focusRectPadding"); | |
_local3 = ((_local3)==null) ? 2 : _local3; | |
_local3 = (_local3 + _local2); | |
uiFocusRect.x = -(_local3); | |
uiFocusRect.y = -(_local3); | |
uiFocusRect.width = (width + (_local3 * 2)); | |
uiFocusRect.height = (height + (_local3 * 2)); | |
}; | |
} | |
} | |
}//package fl.controls | |
package fl.controls { | |
public class ScrollBarDirection { | |
public static const HORIZONTAL:String = "horizontal"; | |
public static const VERTICAL:String = "vertical"; | |
} | |
}//package fl.controls | |
package fl.controls { | |
import flash.display.*; | |
import fl.core.*; | |
import flash.utils.*; | |
import flash.events.*; | |
import fl.events.*; | |
public class BaseButton extends UIComponent { | |
private static var defaultStyles:Object = { | |
upSkin:"Button_upSkin", | |
downSkin:"Button_downSkin", | |
overSkin:"Button_overSkin", | |
disabledSkin:"Button_disabledSkin", | |
selectedDisabledSkin:"Button_selectedDisabledSkin", | |
selectedUpSkin:"Button_selectedUpSkin", | |
selectedDownSkin:"Button_selectedDownSkin", | |
selectedOverSkin:"Button_selectedOverSkin", | |
focusRectSkin:null, | |
focusRectPadding:null, | |
repeatDelay:500, | |
repeatInterval:35 | |
}; | |
protected var pressTimer:Timer; | |
protected var _autoRepeat:Boolean = false; | |
protected var _selected:Boolean = false; | |
protected var background:DisplayObject; | |
private var unlockedMouseState:String; | |
protected var mouseState:String; | |
private var _mouseStateLocked:Boolean = false; | |
public function BaseButton(){ | |
buttonMode = true; | |
mouseChildren = false; | |
useHandCursor = false; | |
setupMouseEvents(); | |
setMouseState("up"); | |
pressTimer = new Timer(1, 0); | |
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true); | |
} | |
public static function getStyleDefinition():Object{ | |
return (defaultStyles); | |
} | |
override public function get enabled():Boolean{ | |
return (super.enabled); | |
} | |
protected function startPress():void{ | |
if (_autoRepeat){ | |
pressTimer.delay = Number(getStyleValue("repeatDelay")); | |
pressTimer.start(); | |
}; | |
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); | |
} | |
override protected function draw():void{ | |
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ | |
drawBackground(); | |
invalidate(InvalidationType.SIZE, false); | |
}; | |
if (isInvalid(InvalidationType.SIZE)){ | |
drawLayout(); | |
}; | |
super.draw(); | |
} | |
protected function drawLayout():void{ | |
background.width = width; | |
background.height = height; | |
} | |
override public function set enabled(_arg1:Boolean):void{ | |
super.enabled = _arg1; | |
mouseEnabled = _arg1; | |
} | |
public function set autoRepeat(_arg1:Boolean):void{ | |
_autoRepeat = _arg1; | |
} | |
protected function mouseEventHandler(_arg1:MouseEvent):void{ | |
if (_arg1.type == MouseEvent.MOUSE_DOWN){ | |
setMouseState("down"); | |
startPress(); | |
} else { | |
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){ | |
setMouseState("over"); | |
endPress(); | |
} else { | |
if (_arg1.type == MouseEvent.ROLL_OUT){ | |
setMouseState("up"); | |
endPress(); | |
}; | |
}; | |
}; | |
} | |
protected function drawBackground():void{ | |
var _local1:String = (enabled) ? mouseState : "disabled"; | |
if (selected){ | |
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1)); | |
}; | |
_local1 = (_local1 + "Skin"); | |
var _local2:DisplayObject = background; | |
background = getDisplayObjectInstance(getStyleValue(_local1)); | |
addChildAt(background, 0); | |
if (((!((_local2 == null))) && (!((_local2 == background))))){ | |
removeChild(_local2); | |
}; | |
} | |
public function get selected():Boolean{ | |
return (_selected); | |
} | |
protected function setupMouseEvents():void{ | |
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true); | |
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true); | |
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true); | |
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true); | |
} | |
protected function endPress():void{ | |
pressTimer.reset(); | |
} | |
public function set mouseStateLocked(_arg1:Boolean):void{ | |
_mouseStateLocked = _arg1; | |
if (_arg1 == false){ | |
setMouseState(unlockedMouseState); | |
} else { | |
unlockedMouseState = mouseState; | |
}; | |
} | |
public function get autoRepeat():Boolean{ | |
return (_autoRepeat); | |
} | |
public function set selected(_arg1:Boolean):void{ | |
if (_selected == _arg1){ | |
return; | |
}; | |
_selected = _arg1; | |
invalidate(InvalidationType.STATE); | |
} | |
protected function buttonDown(_arg1:TimerEvent):void{ | |
if (!_autoRepeat){ | |
endPress(); | |
return; | |
}; | |
if (pressTimer.currentCount == 1){ | |
pressTimer.delay = Number(getStyleValue("repeatInterval")); | |
}; | |
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true)); | |
} | |
public function setMouseState(_arg1:String):void{ | |
if (_mouseStateLocked){ | |
unlockedMouseState = _arg1; | |
return; | |
}; | |
if (mouseState == _arg1){ | |
return; | |
}; | |
mouseState = _arg1; | |
invalidate(InvalidationType.STATE); | |
} | |
} | |
}//package fl.controls | |
package fl.controls { | |
import fl.core.*; | |
import flash.events.*; | |
import fl.events.*; | |
public class ScrollBar extends UIComponent { | |
protected static const THUMB_STYLES:Object = { | |
disabledSkin:"thumbDisabledSkin", | |
downSkin:"thumbDownSkin", | |
overSkin:"thumbOverSkin", | |
upSkin:"thumbUpSkin", | |
icon:"thumbIcon", | |
textPadding:0 | |
}; | |
public static const WIDTH:Number = 15; | |
protected static const DOWN_ARROW_STYLES:Object = { | |
disabledSkin:"downArrowDisabledSkin", | |
downSkin:"downArrowDownSkin", | |
overSkin:"downArrowOverSkin", | |
upSkin:"downArrowUpSkin", | |
repeatDelay:"repeatDelay", | |
repeatInterval:"repeatInterval" | |
}; | |
protected static const UP_ARROW_STYLES:Object = { | |
disabledSkin:"upArrowDisabledSkin", | |
downSkin:"upArrowDownSkin", | |
overSkin:"upArrowOverSkin", | |
upSkin:"upArrowUpSkin", | |
repeatDelay:"repeatDelay", | |
repeatInterval:"repeatInterval" | |
}; | |
protected static const TRACK_STYLES:Object = { | |
disabledSkin:"trackDisabledSkin", | |
downSkin:"trackDownSkin", | |
overSkin:"trackOverSkin", | |
upSkin:"trackUpSkin", | |
repeatDelay:"repeatDelay", | |
repeatInterval:"repeatInterval" | |
}; | |
private static var defaultStyles:Object = { | |
downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", | |
downArrowDownSkin:"ScrollArrowDown_downSkin", | |
downArrowOverSkin:"ScrollArrowDown_overSkin", | |
downArrowUpSkin:"ScrollArrowDown_upSkin", | |
thumbDisabledSkin:"ScrollThumb_upSkin", | |
thumbDownSkin:"ScrollThumb_downSkin", | |
thumbOverSkin:"ScrollThumb_overSkin", | |
thumbUpSkin:"ScrollThumb_upSkin", | |
trackDisabledSkin:"ScrollTrack_skin", | |
trackDownSkin:"ScrollTrack_skin", | |
trackOverSkin:"ScrollTrack_skin", | |
trackUpSkin:"ScrollTrack_skin", | |
upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", | |
upArrowDownSkin:"ScrollArrowUp_downSkin", | |
upArrowOverSkin:"ScrollArrowUp_overSkin", | |
upArrowUpSkin:"ScrollArrowUp_upSkin", | |
thumbIcon:"ScrollBar_thumbIcon", | |
repeatDelay:500, | |
repeatInterval:35 | |
}; | |
private var _direction:String = "vertical"; | |
private var _minScrollPosition:Number = 0; | |
private var _pageSize:Number = 10; | |
private var _maxScrollPosition:Number = 0; | |
protected var downArrow:BaseButton; | |
private var _lineScrollSize:Number = 1; | |
protected var upArrow:BaseButton; | |
private var _scrollPosition:Number = 0; | |
private var thumbScrollOffset:Number; | |
protected var track:BaseButton; | |
protected var thumb:LabelButton; | |
protected var inDrag:Boolean = false; | |
private var _pageScrollSize:Number = 0; | |
public function ScrollBar(){ | |
setStyles(); | |
focusEnabled = false; | |
} | |
public static function getStyleDefinition():Object{ | |
return (defaultStyles); | |
} | |
override public function set enabled(_arg1:Boolean):void{ | |
super.enabled = _arg1; | |
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition)))))); | |
updateThumb(); | |
} | |
override public function setSize(_arg1:Number, _arg2:Number):void{ | |
if (_direction == ScrollBarDirection.HORIZONTAL){ | |
super.setSize(_arg2, _arg1); | |
} else { | |
super.setSize(_arg1, _arg2); | |
}; | |
} | |
public function set lineScrollSize(_arg1:Number):void{ | |
if (_arg1 > 0){ | |
_lineScrollSize = _arg1; | |
}; | |
} | |
public function get minScrollPosition():Number{ | |
return (_minScrollPosition); | |
} | |
protected function updateThumb():void{ | |
var _local1:Number = ((_maxScrollPosition - _minScrollPosition) + _pageSize); | |
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){ | |
thumb.height = 12; | |
thumb.visible = false; | |
} else { | |
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height)); | |
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition)))); | |
thumb.visible = enabled; | |
}; | |
} | |
public function set minScrollPosition(_arg1:Number):void{ | |
setScrollProperties(_pageSize, _arg1, _maxScrollPosition); | |
} | |
public function get lineScrollSize():Number{ | |
return (_lineScrollSize); | |
} | |
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{ | |
var _local3:Number = scrollPosition; | |
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1)); | |
if (_local3 == _scrollPosition){ | |
return; | |
}; | |
if (_arg2){ | |
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition)); | |
}; | |
updateThumb(); | |
} | |
public function get maxScrollPosition():Number{ | |
return (_maxScrollPosition); | |
} | |
public function get scrollPosition():Number{ | |
return (_scrollPosition); | |
} | |
override public function get height():Number{ | |
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height); | |
} | |
public function get pageSize():Number{ | |
return (_pageSize); | |
} | |
public function set maxScrollPosition(_arg1:Number):void{ | |
setScrollProperties(_pageSize, _minScrollPosition, _arg1); | |
} | |
protected function thumbReleaseHandler(_arg1:MouseEvent):void{ | |
inDrag = false; | |
mouseChildren = true; | |
thumb.mouseStateLocked = false; | |
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag); | |
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler); | |
} | |
public function set pageScrollSize(_arg1:Number):void{ | |
if (_arg1 >= 0){ | |
_pageScrollSize = _arg1; | |
}; | |
} | |
public function set scrollPosition(_arg1:Number):void{ | |
setScrollPosition(_arg1, true); | |
} | |
override public function get enabled():Boolean{ | |
return (super.enabled); | |
} | |
override protected function draw():void{ | |
var _local1:Number; | |
if (isInvalid(InvalidationType.SIZE)){ | |
_local1 = super.height; | |
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height))); | |
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height)))); | |
updateThumb(); | |
}; | |
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){ | |
setStyles(); | |
}; | |
downArrow.drawNow(); | |
upArrow.drawNow(); | |
track.drawNow(); | |
thumb.drawNow(); | |
validate(); | |
} | |
override public function get width():Number{ | |
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width); | |
} | |
override protected function configUI():void{ | |
super.configUI(); | |
track = new BaseButton(); | |
track.move(0, 14); | |
track.useHandCursor = false; | |
track.autoRepeat = true; | |
track.focusEnabled = false; | |
addChild(track); | |
thumb = new LabelButton(); | |
thumb.label = ""; | |
thumb.setSize(WIDTH, 15); | |
thumb.move(0, 15); | |
thumb.focusEnabled = false; | |
addChild(thumb); | |
downArrow = new BaseButton(); | |
downArrow.setSize(WIDTH, 14); | |
downArrow.autoRepeat = true; | |
downArrow.focusEnabled = false; | |
addChild(downArrow); | |
upArrow = new BaseButton(); | |
upArrow.setSize(WIDTH, 14); | |
upArrow.move(0, 0); | |
upArrow.autoRepeat = true; | |
upArrow.focusEnabled = false; | |
addChild(upArrow); | |
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true); | |
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true); | |
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true); | |
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true); | |
enabled = false; | |
} | |
public function set pageSize(_arg1:Number):void{ | |
if (_arg1 > 0){ | |
_pageSize = _arg1; | |
}; | |
} | |
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{ | |
this.pageSize = _arg1; | |
_minScrollPosition = _arg2; | |
_maxScrollPosition = _arg3; | |
if (_arg4 >= 0){ | |
_pageScrollSize = _arg4; | |
}; | |
enabled = (_maxScrollPosition > _minScrollPosition); | |
setScrollPosition(_scrollPosition, false); | |
updateThumb(); | |
} | |
public function get pageScrollSize():Number{ | |
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize); | |
} | |
protected function handleThumbDrag(_arg1:MouseEvent):void{ | |
var _local2:Number = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset))); | |
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition)); | |
} | |
protected function setStyles():void{ | |
copyStylesToChild(downArrow, DOWN_ARROW_STYLES); | |
copyStylesToChild(thumb, THUMB_STYLES); | |
copyStylesToChild(track, TRACK_STYLES); | |
copyStylesToChild(upArrow, UP_ARROW_STYLES); | |
} | |
protected function scrollPressHandler(_arg1:ComponentEvent):void{ | |
var _local2:Number; | |
var _local3:Number; | |
_arg1.stopImmediatePropagation(); | |
if (_arg1.currentTarget == upArrow){ | |
setScrollPosition((_scrollPosition - _lineScrollSize)); | |
} else { | |
if (_arg1.currentTarget == downArrow){ | |
setScrollPosition((_scrollPosition + _lineScrollSize)); | |
} else { | |
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition); | |
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize; | |
if (_scrollPosition < _local2){ | |
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3))); | |
} else { | |
if (_scrollPosition > _local2){ | |
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3))); | |
}; | |
}; | |
}; | |
}; | |
} | |
protected function thumbPressHandler(_arg1:MouseEvent):void{ | |
inDrag = true; | |
thumbScrollOffset = (mouseY - thumb.y); | |
thumb.mouseStateLocked = true; | |
mouseChildren = false; | |
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true); | |
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true); | |
} | |
public function set direction(_arg1:String):void{ | |
if (_direction == _arg1){ | |
return; | |
}; | |
_direction = _arg1; | |
if (isLivePreview){ | |
return; | |
}; | |
setScaleY(1); | |
var _local2 = (_direction == ScrollBarDirection.HORIZONTAL); | |
if (((_local2) && (componentInspectorSetting))){ | |
if (rotation == 90){ | |
return; | |
}; | |
setScaleX(-1); | |
rotation = -90; | |
}; | |
if (!componentInspectorSetting){ | |
if (((_local2) && ((rotation == 0)))){ | |
rotation = -90; | |
setScaleX(-1); | |
} else { | |
if (((!(_local2)) && ((rotation == -90)))){ | |
rotation = 0; | |
setScaleX(1); | |
}; | |
}; | |
}; | |
invalidate(InvalidationType.SIZE); | |
} | |
public function get direction():String{ | |
return (_direction); | |
} | |
} | |
}//package fl.controls | |
package fl.controls { | |
public class ButtonLabelPlacement { | |
public static const TOP:String = "top"; | |
public static const LEFT:String = "left"; | |
public static const BOTTOM:String = "bottom"; | |
public static const RIGHT:String = "right"; | |
} | |
}//package fl.controls | |
package fl.events { | |
import flash.events.*; | |
public class ComponentEvent extends Event { | |
public static const HIDE:String = "hide"; | |
public static const BUTTON_DOWN:String = "buttonDown"; | |
public static const MOVE:String = "move"; | |
public static const RESIZE:String = "resize"; | |
public static const ENTER:String = "enter"; | |
public static const LABEL_CHANGE:String = "labelChange"; | |
public static const SHOW:String = "show"; | |
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ | |
super(_arg1, _arg2, _arg3); | |
} | |
override public function toString():String{ | |
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable")); | |
} | |
override public function clone():Event{ | |
return (new ComponentEvent(type, bubbles, cancelable)); | |
} | |
} | |
}//package fl.events | |
package fl.events { | |
import flash.events.*; | |
public class DataChangeEvent extends Event { | |
public static const PRE_DATA_CHANGE:String = "preDataChange"; | |
public static const DATA_CHANGE:String = "dataChange"; | |
protected var _items:Array; | |
protected var _changeType:String; | |
protected var _startIndex:uint; | |
protected var _endIndex:uint; | |
public function DataChangeEvent(_arg1:String, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{ | |
super(_arg1); | |
_changeType = _arg2; | |
_startIndex = _arg4; | |
_items = _arg3; | |
_endIndex = ((_arg5)==-1) ? _startIndex : _arg5; | |
} | |
public function get items():Array{ | |
return (_items); | |
} | |
public function get changeType():String{ | |
return (_changeType); | |
} | |
public function get startIndex():uint{ | |
return (_startIndex); | |
} | |
public function get endIndex():uint{ | |
return (_endIndex); | |
} | |
override public function toString():String{ | |
return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable")); | |
} | |
override public function clone():Event{ | |
return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex)); | |
} | |
} | |
}//package fl.events | |
package fl.events { | |
import flash.events.*; | |
public class ScrollEvent extends Event { | |
public static const SCROLL:String = "scroll"; | |
private var _direction:String; | |
private var _position:Number; | |
private var _delta:Number; | |
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){ | |
super(ScrollEvent.SCROLL, false, false); | |
_direction = _arg1; | |
_delta = _arg2; | |
_position = _arg3; | |
} | |
public function get position():Number{ | |
return (_position); | |
} | |
public function get direction():String{ | |
return (_direction); | |
} | |
public function get delta():Number{ | |
return (_delta); | |
} | |
override public function toString():String{ | |
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position")); | |
} | |
override public function clone():Event{ | |
return (new ScrollEvent(_direction, _delta, _position)); | |
} | |
} | |
}//package fl.events | |
package fl.events { | |
public class DataChangeType { | |
public static const ADD:String = "add"; | |
public static const REMOVE:String = "remove"; | |
public static const REMOVE_ALL:String = "removeAll"; | |
public static const CHANGE:String = "change"; | |
public static const REPLACE:String = "replace"; | |
public static const INVALIDATE:String = "invalidate"; | |
public static const INVALIDATE_ALL:String = "invalidateAll"; | |
public static const SORT:String = "sort"; | |
} | |
}//package fl.events | |
package fl.managers { | |
public interface IFocusManagerGroup { | |
function get groupName():String; | |
function get selected():Boolean; | |
function set groupName(_arg1:String):void; | |
function set selected(_arg1:Boolean):void; | |
} | |
}//package fl.managers | |
package fl.managers { | |
import flash.display.*; | |
import fl.controls.*; | |
import fl.core.*; | |
import flash.ui.*; | |
import flash.utils.*; | |
import flash.events.*; | |
import flash.text.*; | |
public class FocusManager implements IFocusManager { | |
private var focusableObjects:Dictionary; | |
private var _showFocusIndicator:Boolean = true; | |
private var defButton:Button; | |
private var focusableCandidates:Array; | |
private var _form:DisplayObjectContainer; | |
private var _defaultButtonEnabled:Boolean = true; | |
private var activated:Boolean = false; | |
private var _defaultButton:Button; | |
private var calculateCandidates:Boolean = true; | |
private var lastFocus:InteractiveObject; | |
private var lastAction:String; | |
public function FocusManager(_arg1:DisplayObjectContainer){ | |
focusableObjects = new Dictionary(true); | |
if (_arg1 != null){ | |
_form = _arg1; | |
addFocusables(DisplayObject(_arg1)); | |
_arg1.addEventListener(Event.ADDED, addedHandler); | |
_arg1.addEventListener(Event.REMOVED, removedHandler); | |
activate(); | |
}; | |
} | |
public function get showFocusIndicator():Boolean{ | |
return (_showFocusIndicator); | |
} | |
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{ | |
var _local7:DisplayObject; | |
var _local8:IFocusManagerGroup; | |
var _local9:int; | |
var _local10:DisplayObject; | |
var _local11:IFocusManagerGroup; | |
var _local5:int = focusableCandidates.length; | |
var _local6:int = _arg1; | |
while (true) { | |
if (_arg2){ | |
_arg1--; | |
} else { | |
_arg1++; | |
}; | |
if (_arg3){ | |
if (((_arg2) && ((_arg1 < 0)))){ | |
break; | |
}; | |
if (((!(_arg2)) && ((_arg1 == _local5)))){ | |
break; | |
}; | |
} else { | |
_arg1 = ((_arg1 + _local5) % _local5); | |
if (_local6 == _arg1){ | |
break; | |
}; | |
}; | |
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){ | |
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1])); | |
if ((_local7 is IFocusManagerGroup)){ | |
_local8 = IFocusManagerGroup(_local7); | |
_local9 = 0; | |
while (_local9 < focusableCandidates.length) { | |
_local10 = focusableCandidates[_local9]; | |
if ((_local10 is IFocusManagerGroup)){ | |
_local11 = IFocusManagerGroup(_local10); | |
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){ | |
_arg1 = _local9; | |
break; | |
}; | |
}; | |
_local9++; | |
}; | |
}; | |
return (_arg1); | |
}; | |
}; | |
return (_arg1); | |
} | |
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{ | |
if ((_arg1.relatedObject is TextField)){ | |
return; | |
}; | |
_arg1.preventDefault(); | |
} | |
public function set form(_arg1:DisplayObjectContainer):void{ | |
_form = _arg1; | |
} | |
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{ | |
var focusable:* = null; | |
var io:* = null; | |
var doc:* = null; | |
var i:* = 0; | |
var child:* = null; | |
var o:* = _arg1; | |
var skipTopLevel:Boolean = _arg2; | |
if (!skipTopLevel){ | |
if ((o is IFocusManagerComponent)){ | |
focusable = IFocusManagerComponent(o); | |
if (focusable.focusEnabled){ | |
if (((focusable.tabEnabled) && (isTabVisible(o)))){ | |
focusableObjects[o] = true; | |
calculateCandidates = true; | |
}; | |
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); | |
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); | |
}; | |
} else { | |
if ((o is InteractiveObject)){ | |
io = (o as InteractiveObject); | |
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){ | |
focusableObjects[io] = true; | |
calculateCandidates = true; | |
}; | |
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); | |
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); | |
}; | |
}; | |
}; | |
if ((o is DisplayObjectContainer)){ | |
doc = DisplayObjectContainer(o); | |
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); | |
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){ | |
i = 0; | |
while (i < doc.numChildren) { | |
try { | |
child = doc.getChildAt(i); | |
if (child != null){ | |
addFocusables(doc.getChildAt(i)); | |
}; | |
} catch(error:SecurityError) { | |
}; | |
i = (i + 1); | |
}; | |
}; | |
}; | |
} | |
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{ | |
return (_arg1.getChildIndex(_arg2)); | |
} | |
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{ | |
var _local2:InteractiveObject = _arg1; | |
while (_arg1) { | |
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){ | |
return (_arg1); | |
}; | |
_arg1 = _arg1.parent; | |
}; | |
return (_local2); | |
} | |
private function focusOutHandler(_arg1:FocusEvent):void{ | |
var _local2:InteractiveObject = (_arg1.target as InteractiveObject); | |
} | |
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{ | |
var _local3:IFocusManagerGroup; | |
if (!isEnabledAndVisible(_arg1)){ | |
return (false); | |
}; | |
if ((_arg1 is IFocusManagerGroup)){ | |
_local3 = IFocusManagerGroup(_arg1); | |
if (_arg2 == _local3.groupName){ | |
return (false); | |
}; | |
}; | |
return (true); | |
} | |
private function setFocusToNextObject(_arg1:FocusEvent):void{ | |
if (!hasFocusableObjects()){ | |
return; | |
}; | |
var _local2:InteractiveObject = getNextFocusManagerComponent(_arg1.shiftKey); | |
if (_local2){ | |
setFocus(_local2); | |
}; | |
} | |
private function sortFocusableObjectsTabIndex():void{ | |
var _local1:Object; | |
var _local2:InteractiveObject; | |
focusableCandidates = []; | |
for (_local1 in focusableObjects) { | |
_local2 = InteractiveObject(_local1); | |
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){ | |
focusableCandidates.push(_local2); | |
}; | |
}; | |
focusableCandidates.sort(sortByTabIndex); | |
} | |
private function removeFocusables(_arg1:DisplayObject):void{ | |
var _local2:Object; | |
var _local3:DisplayObject; | |
if ((_arg1 is DisplayObjectContainer)){ | |
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler); | |
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler); | |
for (_local2 in focusableObjects) { | |
_local3 = DisplayObject(_local2); | |
if (DisplayObjectContainer(_arg1).contains(_local3)){ | |
if (_local3 == lastFocus){ | |
lastFocus = null; | |
}; | |
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); | |
delete focusableObjects[_local2]; | |
calculateCandidates = true; | |
}; | |
}; | |
}; | |
} | |
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{ | |
while (_arg1 != InteractiveObject(form)) { | |
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){ | |
return (_arg1); | |
}; | |
_arg1 = _arg1.parent; | |
if (_arg1 == null){ | |
break; | |
}; | |
}; | |
return (null); | |
} | |
public function sendDefaultButtonEvent():void{ | |
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); | |
} | |
private function addedHandler(_arg1:Event):void{ | |
var _local2:DisplayObject = DisplayObject(_arg1.target); | |
if (_local2.stage){ | |
addFocusables(DisplayObject(_arg1.target)); | |
}; | |
} | |
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{ | |
var _local3:TextField; | |
var _local4:SimpleButton; | |
var _local2:DisplayObjectContainer = DisplayObject(form).parent; | |
while (_arg1 != _local2) { | |
if ((_arg1 is UIComponent)){ | |
if (!UIComponent(_arg1).enabled){ | |
return (false); | |
}; | |
} else { | |
if ((_arg1 is TextField)){ | |
_local3 = TextField(_arg1); | |
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){ | |
return (false); | |
}; | |
} else { | |
if ((_arg1 is SimpleButton)){ | |
_local4 = SimpleButton(_arg1); | |
if (!_local4.enabled){ | |
return (false); | |
}; | |
}; | |
}; | |
}; | |
if (!_arg1.visible){ | |
return (false); | |
}; | |
_arg1 = _arg1.parent; | |
}; | |
return (true); | |
} | |
private function tabChildrenChangeHandler(_arg1:Event):void{ | |
if (_arg1.target != _arg1.currentTarget){ | |
return; | |
}; | |
calculateCandidates = true; | |
var _local2:DisplayObjectContainer = DisplayObjectContainer(_arg1.target); | |
if (_local2.tabChildren){ | |
addFocusables(_local2, true); | |
} else { | |
removeFocusables(_local2); | |
}; | |
} | |
private function deactivateHandler(_arg1:Event):void{ | |
var _local2:InteractiveObject = InteractiveObject(_arg1.target); | |
} | |
public function setFocus(_arg1:InteractiveObject):void{ | |
if ((_arg1 is IFocusManagerComponent)){ | |
IFocusManagerComponent(_arg1).setFocus(); | |
} else { | |
form.stage.focus = _arg1; | |
}; | |
} | |
public function getFocus():InteractiveObject{ | |
var _local1:InteractiveObject = form.stage.focus; | |
return (findFocusManagerComponent(_local1)); | |
} | |
private function hasFocusableObjects():Boolean{ | |
var _local1:Object; | |
for (_local1 in focusableObjects) { | |
return (true); | |
}; | |
return (false); | |
} | |
private function tabIndexChangeHandler(_arg1:Event):void{ | |
calculateCandidates = true; | |
} | |
public function set defaultButton(_arg1:Button):void{ | |
var _local2:Button = (_arg1) ? Button(_arg1) : null; | |
if (_local2 != _defaultButton){ | |
if (_defaultButton){ | |
_defaultButton.emphasized = false; | |
}; | |
if (defButton){ | |
defButton.emphasized = false; | |
}; | |
_defaultButton = _local2; | |
defButton = _local2; | |
if (_local2){ | |
_local2.emphasized = true; | |
}; | |
}; | |
} | |
private function sortFocusableObjects():void{ | |
var _local1:Object; | |
var _local2:InteractiveObject; | |
focusableCandidates = []; | |
for (_local1 in focusableObjects) { | |
_local2 = InteractiveObject(_local1); | |
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){ | |
sortFocusableObjectsTabIndex(); | |
return; | |
}; | |
focusableCandidates.push(_local2); | |
}; | |
focusableCandidates.sort(sortByDepth); | |
} | |
private function keyFocusChangeHandler(_arg1:FocusEvent):void{ | |
showFocusIndicator = true; | |
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){ | |
setFocusToNextObject(_arg1); | |
_arg1.preventDefault(); | |
}; | |
} | |
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{ | |
var _local2:int = focusableCandidates.length; | |
var _local3:int; | |
_local3 = 0; | |
while (_local3 < _local2) { | |
if (focusableCandidates[_local3] == _arg1){ | |
return (_local3); | |
}; | |
_local3++; | |
}; | |
return (-1); | |
} | |
public function hideFocus():void{ | |
} | |
private function removedHandler(_arg1:Event):void{ | |
var _local2:int; | |
var _local4:InteractiveObject; | |
var _local3:DisplayObject = DisplayObject(_arg1.target); | |
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){ | |
if (_local3 == lastFocus){ | |
IFocusManagerComponent(lastFocus).drawFocus(false); | |
lastFocus = null; | |
}; | |
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); | |
delete focusableObjects[_local3]; | |
calculateCandidates = true; | |
} else { | |
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){ | |
_local4 = (_local3 as InteractiveObject); | |
if (_local4){ | |
if (_local4 == lastFocus){ | |
lastFocus = null; | |
}; | |
delete focusableObjects[_local4]; | |
calculateCandidates = true; | |
}; | |
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler); | |
}; | |
}; | |
removeFocusables(_local3); | |
} | |
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{ | |
var _local5:int; | |
var _local6:String; | |
var _local7:String; | |
var _local3 = ""; | |
var _local4 = ""; | |
var _local8 = "0000"; | |
var _local9:DisplayObject = DisplayObject(_arg1); | |
var _local10:DisplayObject = DisplayObject(_arg2); | |
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) { | |
_local5 = getChildIndex(_local9.parent, _local9); | |
_local6 = _local5.toString(16); | |
if (_local6.length < 4){ | |
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); | |
}; | |
_local3 = (_local7 + _local3); | |
_local9 = _local9.parent; | |
}; | |
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) { | |
_local5 = getChildIndex(_local10.parent, _local10); | |
_local6 = _local5.toString(16); | |
if (_local6.length < 4){ | |
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6); | |
}; | |
_local4 = (_local7 + _local4); | |
_local10 = _local10.parent; | |
}; | |
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0); | |
} | |
public function get defaultButton():Button{ | |
return (_defaultButton); | |
} | |
private function activateHandler(_arg1:Event):void{ | |
var _local2:InteractiveObject = InteractiveObject(_arg1.target); | |
if (lastFocus){ | |
if ((lastFocus is IFocusManagerComponent)){ | |
IFocusManagerComponent(lastFocus).setFocus(); | |
} else { | |
form.stage.focus = lastFocus; | |
}; | |
}; | |
lastAction = "ACTIVATE"; | |
} | |
public function showFocus():void{ | |
} | |
public function set defaultButtonEnabled(_arg1:Boolean):void{ | |
_defaultButtonEnabled = _arg1; | |
} | |
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{ | |
var _local8:IFocusManagerGroup; | |
if (!hasFocusableObjects()){ | |
return (null); | |
}; | |
if (calculateCandidates){ | |
sortFocusableObjects(); | |
calculateCandidates = false; | |
}; | |
var _local2:DisplayObject = form.stage.focus; | |
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2))); | |
var _local3 = ""; | |
if ((_local2 is IFocusManagerGroup)){ | |
_local8 = IFocusManagerGroup(_local2); | |
_local3 = _local8.groupName; | |
}; | |
var _local4:int = getIndexOfFocusedObject(_local2); | |
var _local5:Boolean; | |
var _local6:int = _local4; | |
if (_local4 == -1){ | |
if (_arg1){ | |
_local4 = focusableCandidates.length; | |
}; | |
_local5 = true; | |
}; | |
var _local7:int = getIndexOfNextObject(_local4, _arg1, _local5, _local3); | |
return (findFocusManagerComponent(focusableCandidates[_local7])); | |
} | |
private function mouseDownHandler(_arg1:MouseEvent):void{ | |
if (_arg1.isDefaultPrevented()){ | |
return; | |
}; | |
var _local2:InteractiveObject = getTopLevelFocusTarget(InteractiveObject(_arg1.target)); | |
if (!_local2){ | |
return; | |
}; | |
showFocusIndicator = false; | |
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){ | |
setFocus(_local2); | |
}; | |
lastAction = "MOUSEDOWN"; | |
} | |
private function isTabVisible(_arg1:DisplayObject):Boolean{ | |
var _local2:DisplayObjectContainer = _arg1.parent; | |
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) { | |
if (!_local2.tabChildren){ | |
return (false); | |
}; | |
_local2 = _local2.parent; | |
}; | |
return (true); | |
} | |
public function get nextTabIndex():int{ | |
return (0); | |
} | |
private function keyDownHandler(_arg1:KeyboardEvent):void{ | |
if (_arg1.keyCode == Keyboard.TAB){ | |
lastAction = "KEY"; | |
if (calculateCandidates){ | |
sortFocusableObjects(); | |
calculateCandidates = false; | |
}; | |
}; | |
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){ | |
sendDefaultButtonEvent(); | |
}; | |
} | |
private function focusInHandler(_arg1:FocusEvent):void{ | |
var _local3:Button; | |
var _local2:InteractiveObject = InteractiveObject(_arg1.target); | |
if (form.contains(_local2)){ | |
lastFocus = findFocusManagerComponent(InteractiveObject(_local2)); | |
if ((lastFocus is Button)){ | |
_local3 = Button(lastFocus); | |
if (defButton){ | |
defButton.emphasized = false; | |
defButton = _local3; | |
_local3.emphasized = true; | |
}; | |
} else { | |
if (((defButton) && (!((defButton == _defaultButton))))){ | |
defButton.emphasized = false; | |
defButton = _defaultButton; | |
_defaultButton.emphasized = true; | |
}; | |
}; | |
}; | |
} | |
private function tabEnabledChangeHandler(_arg1:Event):void{ | |
calculateCandidates = true; | |
var _local2:InteractiveObject = InteractiveObject(_arg1.target); | |
var _local3 = (focusableObjects[_local2] == true); | |
if (_local2.tabEnabled){ | |
if (((!(_local3)) && (isTabVisible(_local2)))){ | |
if (!(_local2 is IFocusManagerComponent)){ | |
_local2.focusRect = false; | |
}; | |
focusableObjects[_local2] = true; | |
}; | |
} else { | |
if (_local3){ | |
delete focusableObjects[_local2]; | |
}; | |
}; | |
} | |
public function set showFocusIndicator(_arg1:Boolean):void{ | |
_showFocusIndicator = _arg1; | |
} | |
public function get form():DisplayObjectContainer{ | |
return (_form); | |
} | |
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{ | |
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2)); | |
} | |
public function get defaultButtonEnabled():Boolean{ | |
return (_defaultButtonEnabled); | |
} | |
public function activate():void{ | |
if (activated){ | |
return; | |
}; | |
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true); | |
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true); | |
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); | |
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); | |
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true); | |
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true); | |
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); | |
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); | |
activated = true; | |
if (lastFocus){ | |
setFocus(lastFocus); | |
}; | |
} | |
public function deactivate():void{ | |
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler); | |
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); | |
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true); | |
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true); | |
form.stage.removeEventListener(Event.ACTIVATE, activateHandler); | |
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler); | |
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); | |
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true); | |
activated = false; | |
} | |
} | |
}//package fl.managers | |
package fl.managers { | |
public interface IFocusManagerComponent { | |
function set focusEnabled(_arg1:Boolean):void; | |
function drawFocus(_arg1:Boolean):void; | |
function setFocus():void; | |
function get focusEnabled():Boolean; | |
function get tabEnabled():Boolean; | |
function get tabIndex():int; | |
function get mouseFocusEnabled():Boolean; | |
} | |
}//package fl.managers | |
package fl.managers { | |
import fl.core.*; | |
import flash.utils.*; | |
import flash.text.*; | |
public class StyleManager { | |
private static var _instance:StyleManager; | |
private var classToInstancesDict:Dictionary; | |
private var globalStyles:Object; | |
private var styleToClassesHash:Object; | |
private var classToStylesDict:Dictionary; | |
private var classToDefaultStylesDict:Dictionary; | |
public function StyleManager(){ | |
styleToClassesHash = {}; | |
classToInstancesDict = new Dictionary(true); | |
classToStylesDict = new Dictionary(true); | |
classToDefaultStylesDict = new Dictionary(true); | |
globalStyles = UIComponent.getStyleDefinition(); | |
} | |
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{ | |
var _local3:Class = getClassDef(_arg1); | |
var _local4:Object = getInstance().classToStylesDict[_local3]; | |
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){ | |
delete _local4[_arg2]; | |
invalidateComponentStyle(_local3, _arg2); | |
}; | |
} | |
private static function getClassDef(_arg1:Object):Class{ | |
var component:* = _arg1; | |
if ((component is Class)){ | |
return ((component as Class)); | |
}; | |
try { | |
return ((getDefinitionByName(getQualifiedClassName(component)) as Class)); | |
} catch(e:Error) { | |
if ((component is UIComponent)){ | |
try { | |
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class)); | |
} catch(e:Error) { | |
}; | |
}; | |
}; | |
return (null); | |
} | |
public static function clearStyle(_arg1:String):void{ | |
setStyle(_arg1, null); | |
} | |
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{ | |
var _local4:Class = getClassDef(_arg1); | |
var _local5:Object = getInstance().classToStylesDict[_local4]; | |
if (_local5 == null){ | |
_local5 = (getInstance().classToStylesDict[_local4] = {}); | |
}; | |
if (_local5 == _arg3){ | |
return; | |
}; | |
_local5[_arg2] = _arg3; | |
invalidateComponentStyle(_local4, _arg2); | |
} | |
private static function setSharedStyles(_arg1:UIComponent):void{ | |
var _local5:String; | |
var _local2:StyleManager = getInstance(); | |
var _local3:Class = getClassDef(_arg1); | |
var _local4:Object = _local2.classToDefaultStylesDict[_local3]; | |
for (_local5 in _local4) { | |
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5)); | |
}; | |
} | |
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{ | |
var _local3:Class = getClassDef(_arg1); | |
var _local4:Object = getInstance().classToStylesDict[_local3]; | |
return (((_local4)==null) ? null : _local4[_arg2]); | |
} | |
private static function getInstance(){ | |
if (_instance == null){ | |
_instance = new (StyleManager); | |
}; | |
return (_instance); | |
} | |
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{ | |
var _local4:Object; | |
var _local5:UIComponent; | |
var _local3:Dictionary = getInstance().classToInstancesDict[_arg1]; | |
if (_local3 == null){ | |
return; | |
}; | |
for (_local4 in _local3) { | |
_local5 = (_local4 as UIComponent); | |
if (_local5 == null){ | |
} else { | |
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2)); | |
}; | |
}; | |
} | |
private static function invalidateStyle(_arg1:String):void{ | |
var _local3:Object; | |
var _local2:Dictionary = getInstance().styleToClassesHash[_arg1]; | |
if (_local2 == null){ | |
return; | |
}; | |
for (_local3 in _local2) { | |
invalidateComponentStyle(Class(_local3), _arg1); | |
}; | |
} | |
public static function registerInstance(_arg1:UIComponent):void{ | |
var target:* = null; | |
var defaultStyles:* = null; | |
var styleToClasses:* = null; | |
var n:* = null; | |
var instance:* = _arg1; | |
var inst:* = getInstance(); | |
var classDef:* = getClassDef(instance); | |
if (classDef == null){ | |
return; | |
}; | |
if (inst.classToInstancesDict[classDef] == null){ | |
inst.classToInstancesDict[classDef] = new Dictionary(true); | |
target = classDef; | |
while (defaultStyles == null) { | |
if (target["getStyleDefinition"] != null){ | |
defaultStyles = target["getStyleDefinition"](); | |
break; | |
}; | |
try { | |
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class); | |
} catch(err:Error) { | |
try { | |
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class); | |
} catch(e:Error) { | |
defaultStyles = UIComponent.getStyleDefinition(); | |
break; | |
}; | |
}; | |
}; | |
styleToClasses = inst.styleToClassesHash; | |
for (n in defaultStyles) { | |
if (styleToClasses[n] == null){ | |
styleToClasses[n] = new Dictionary(true); | |
}; | |
styleToClasses[n][classDef] = true; | |
}; | |
inst.classToDefaultStylesDict[classDef] = defaultStyles; | |
if (inst.classToStylesDict[classDef] == null){ | |
inst.classToStylesDict[classDef] = {}; | |
}; | |
}; | |
inst.classToInstancesDict[classDef][instance] = true; | |
setSharedStyles(instance); | |
} | |
public static function getStyle(_arg1:String):Object{ | |
return (getInstance().globalStyles[_arg1]); | |
} | |
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{ | |
var _local3:Class = getClassDef(_arg1); | |
var _local4:StyleManager = getInstance(); | |
var _local5:Object = _local4.classToStylesDict[_local3][_arg2]; | |
if (_local5 != null){ | |
return (_local5); | |
}; | |
_local5 = _local4.globalStyles[_arg2]; | |
if (_local5 != null){ | |
return (_local5); | |
}; | |
return (_local4.classToDefaultStylesDict[_local3][_arg2]); | |
} | |
public static function setStyle(_arg1:String, _arg2:Object):void{ | |
var _local3:Object = getInstance().globalStyles; | |
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ | |
return; | |
}; | |
_local3[_arg1] = _arg2; | |
invalidateStyle(_arg1); | |
} | |
} | |
}//package fl.managers | |
package fl.managers { | |
import flash.display.*; | |
import fl.controls.*; | |
public interface IFocusManager { | |
function getFocus():InteractiveObject; | |
function deactivate():void; | |
function set defaultButton(_arg1:Button):void; | |
function set showFocusIndicator(_arg1:Boolean):void; | |
function get defaultButtonEnabled():Boolean; | |
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject; | |
function get nextTabIndex():int; | |
function get defaultButton():Button; | |
function get showFocusIndicator():Boolean; | |
function hideFocus():void; | |
function activate():void; | |
function showFocus():void; | |
function set defaultButtonEnabled(_arg1:Boolean):void; | |
function setFocus(_arg1:InteractiveObject):void; | |
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject; | |
} | |
}//package fl.managers | |
package fl.core { | |
import flash.display.*; | |
public dynamic class ComponentShim extends MovieClip { | |
} | |
}//package fl.core | |
package fl.core { | |
import flash.display.*; | |
import flash.utils.*; | |
import flash.events.*; | |
import flash.text.*; | |
import flash.system.*; | |
import fl.managers.*; | |
import fl.events.*; | |
public class UIComponent extends Sprite { | |
public static var inCallLaterPhase:Boolean = false; | |
private static var defaultStyles:Object = { | |
focusRectSkin:"focusRectSkin", | |
focusRectPadding:2, | |
textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), | |
disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), | |
defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), | |
defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0) | |
}; | |
public static var createAccessibilityImplementation:Function; | |
private static var focusManagers:Dictionary = new Dictionary(false); | |
protected var _x:Number; | |
protected var _enabled:Boolean = true; | |
protected var callLaterMethods:Dictionary; | |
private var _mouseFocusEnabled:Boolean = true; | |
private var tempText:TextField; | |
private var _focusEnabled:Boolean = true; | |
protected var startHeight:Number; | |
protected var _height:Number; | |
protected var invalidateFlag:Boolean = false; | |
protected var _oldIMEMode:String = null; | |
protected var _inspector:Boolean = false; | |
protected var startWidth:Number; | |
public var focusTarget:IFocusManagerComponent; | |
protected var errorCaught:Boolean = false; | |
protected var invalidHash:Object; | |
protected var sharedStyles:Object; | |
protected var uiFocusRect:DisplayObject; | |
protected var isLivePreview:Boolean = false; | |
protected var _imeMode:String = null; | |
protected var _width:Number; | |
protected var instanceStyles:Object; | |
public var version:String = "3.0.0.16"; | |
protected var isFocused:Boolean = false; | |
protected var _y:Number; | |
public function UIComponent(){ | |
instanceStyles = {}; | |
sharedStyles = {}; | |
invalidHash = {}; | |
callLaterMethods = new Dictionary(); | |
StyleManager.registerInstance(this); | |
configUI(); | |
invalidate(InvalidationType.ALL); | |
tabEnabled = (this is IFocusManagerComponent); | |
focusRect = false; | |
if (tabEnabled){ | |
addEventListener(FocusEvent.FOCUS_IN, focusInHandler); | |
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler); | |
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); | |
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler); | |
}; | |
initializeFocusManager(); | |
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true); | |
} | |
public static function getStyleDefinition():Object{ | |
return (defaultStyles); | |
} | |
public static function mergeStyles(... _args):Object{ | |
var _local5:Object; | |
var _local6:String; | |
var _local2:Object = {}; | |
var _local3:uint = _args.length; | |
var _local4:uint; | |
while (_local4 < _local3) { | |
_local5 = _args[_local4]; | |
for (_local6 in _local5) { | |
if (_local2[_local6] != null){ | |
} else { | |
_local2[_local6] = _args[_local4][_local6]; | |
}; | |
}; | |
_local4++; | |
}; | |
return (_local2); | |
} | |
public function getStyle(_arg1:String):Object{ | |
return (instanceStyles[_arg1]); | |
} | |
protected function checkLivePreview():Boolean{ | |
var className:* = null; | |
if (parent == null){ | |
return (false); | |
}; | |
try { | |
className = getQualifiedClassName(parent); | |
} catch(e:Error) { | |
}; | |
return ((className == "fl.livepreview::LivePreviewParent")); | |
} | |
private function callLaterDispatcher(_arg1:Event):void{ | |
var _local3:Object; | |
if (_arg1.type == Event.ADDED_TO_STAGE){ | |
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher); | |
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); | |
stage.invalidate(); | |
return; | |
}; | |
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher); | |
if (stage == null){ | |
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); | |
return; | |
}; | |
inCallLaterPhase = true; | |
var _local2:Dictionary = callLaterMethods; | |
for (_local3 in _local2) { | |
_local3(); | |
delete _local2[_local3]; | |
}; | |
inCallLaterPhase = false; | |
} | |
protected function validate():void{ | |
invalidHash = {}; | |
} | |
protected function focusOutHandler(_arg1:FocusEvent):void{ | |
if (isOurFocus((_arg1.target as DisplayObject))){ | |
drawFocus(false); | |
isFocused = false; | |
}; | |
} | |
public function set mouseFocusEnabled(_arg1:Boolean):void{ | |
_mouseFocusEnabled = _arg1; | |
} | |
public function getFocus():InteractiveObject{ | |
if (stage){ | |
return (stage.focus); | |
}; | |
return (null); | |
} | |
override public function get height():Number{ | |
return (_height); | |
} | |
private function addedHandler(_arg1:Event):void{ | |
removeEventListener("addedToStage", addedHandler); | |
initializeFocusManager(); | |
} | |
protected function getStyleValue(_arg1:String):Object{ | |
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]); | |
} | |
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{ | |
invalidHash[_arg1] = true; | |
if (_arg2){ | |
this.callLater(draw); | |
}; | |
} | |
protected function isOurFocus(_arg1:DisplayObject):Boolean{ | |
return ((_arg1 == this)); | |
} | |
public function get enabled():Boolean{ | |
return (_enabled); | |
} | |
protected function getScaleX():Number{ | |
return (super.scaleX); | |
} | |
protected function getScaleY():Number{ | |
return (super.scaleY); | |
} | |
public function get focusEnabled():Boolean{ | |
return (_focusEnabled); | |
} | |
protected function afterComponentParameters():void{ | |
} | |
override public function get scaleY():Number{ | |
return ((height / startHeight)); | |
} | |
protected function setIMEMode(_arg1:Boolean){ | |
var enabled:* = _arg1; | |
if (_imeMode != null){ | |
if (enabled){ | |
IME.enabled = true; | |
_oldIMEMode = IME.conversionMode; | |
try { | |
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){ | |
IME.conversionMode = _imeMode; | |
}; | |
errorCaught = false; | |
} catch(e:Error) { | |
errorCaught = true; | |
throw (new Error(("IME mode not supported: " + _imeMode))); | |
}; | |
} else { | |
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){ | |
IME.conversionMode = _oldIMEMode; | |
}; | |
IME.enabled = false; | |
}; | |
}; | |
} | |
protected function draw():void{ | |
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){ | |
if (((isFocused) && (focusManager.showFocusIndicator))){ | |
drawFocus(true); | |
}; | |
}; | |
validate(); | |
} | |
override public function set height(_arg1:Number):void{ | |
if (_height == _arg1){ | |
return; | |
}; | |
setSize(width, _arg1); | |
} | |
protected function configUI():void{ | |
isLivePreview = checkLivePreview(); | |
var _local1:Number = rotation; | |
rotation = 0; | |
var _local2:Number = super.width; | |
var _local3:Number = super.height; | |
var _local4 = 1; | |
super.scaleY = _local4; | |
super.scaleX = _local4; | |
setSize(_local2, _local3); | |
move(super.x, super.y); | |
rotation = _local1; | |
startWidth = _local2; | |
startHeight = _local3; | |
if (numChildren > 0){ | |
removeChildAt(0); | |
}; | |
} | |
protected function setScaleY(_arg1:Number):void{ | |
super.scaleY = _arg1; | |
} | |
override public function get scaleX():Number{ | |
return ((width / startWidth)); | |
} | |
protected function setScaleX(_arg1:Number):void{ | |
super.scaleX = _arg1; | |
} | |
private function initializeFocusManager():void{ | |
if (stage == null){ | |
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true); | |
} else { | |
createFocusManager(); | |
}; | |
} | |
protected function keyDownHandler(_arg1:KeyboardEvent):void{ | |
} | |
public function set focusManager(_arg1:IFocusManager):void{ | |
UIComponent.focusManagers[this] = _arg1; | |
} | |
public function clearStyle(_arg1:String):void{ | |
setStyle(_arg1, null); | |
} | |
protected function isInvalid(_arg1:String, ... _args):Boolean{ | |
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){ | |
return (true); | |
}; | |
while (_args.length > 0) { | |
if (invalidHash[_args.pop()]){ | |
return (true); | |
}; | |
}; | |
return (false); | |
} | |
public function setStyle(_arg1:String, _arg2:Object):void{ | |
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ | |
return; | |
}; | |
instanceStyles[_arg1] = _arg2; | |
invalidate(InvalidationType.STYLES); | |
} | |
override public function get visible():Boolean{ | |
return (super.visible); | |
} | |
protected function focusInHandler(_arg1:FocusEvent):void{ | |
var _local2:IFocusManager; | |
if (isOurFocus((_arg1.target as DisplayObject))){ | |
_local2 = focusManager; | |
if (((_local2) && (_local2.showFocusIndicator))){ | |
drawFocus(true); | |
isFocused = true; | |
}; | |
}; | |
} | |
public function get componentInspectorSetting():Boolean{ | |
return (_inspector); | |
} | |
override public function get x():Number{ | |
return ((isNaN(_x)) ? super.x : _x); | |
} | |
override public function get y():Number{ | |
return ((isNaN(_y)) ? super.y : _y); | |
} | |
public function set enabled(_arg1:Boolean):void{ | |
if (_arg1 == _enabled){ | |
return; | |
}; | |
_enabled = _arg1; | |
invalidate(InvalidationType.STATE); | |
} | |
public function setSize(_arg1:Number, _arg2:Number):void{ | |
_width = _arg1; | |
_height = _arg2; | |
invalidate(InvalidationType.SIZE); | |
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false)); | |
} | |
protected function keyUpHandler(_arg1:KeyboardEvent):void{ | |
} | |
public function setSharedStyle(_arg1:String, _arg2:Object):void{ | |
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){ | |
return; | |
}; | |
sharedStyles[_arg1] = _arg2; | |
if (instanceStyles[_arg1] == null){ | |
invalidate(InvalidationType.STYLES); | |
}; | |
} | |
public function set focusEnabled(_arg1:Boolean):void{ | |
_focusEnabled = _arg1; | |
} | |
override public function set width(_arg1:Number):void{ | |
if (_width == _arg1){ | |
return; | |
}; | |
setSize(_arg1, height); | |
} | |
public function setFocus():void{ | |
if (stage){ | |
stage.focus = this; | |
}; | |
} | |
override public function set scaleX(_arg1:Number):void{ | |
setSize((startWidth * _arg1), height); | |
} | |
public function get mouseFocusEnabled():Boolean{ | |
return (_mouseFocusEnabled); | |
} | |
override public function set scaleY(_arg1:Number):void{ | |
setSize(width, (startHeight * _arg1)); | |
} | |
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{ | |
var skin:* = _arg1; | |
var classDef:* = null; | |
if ((skin is Class)){ | |
return ((new (skin) as DisplayObject)); | |
}; | |
if ((skin is DisplayObject)){ | |
(skin as DisplayObject).x = 0; | |
(skin as DisplayObject).y = 0; | |
return ((skin as DisplayObject)); | |
}; | |
try { | |
classDef = getDefinitionByName(skin.toString()); | |
} catch(e:Error) { | |
try { | |
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object); | |
} catch(e:Error) { | |
}; | |
}; | |
if (classDef == null){ | |
return (null); | |
}; | |
return ((new (classDef) as DisplayObject)); | |
} | |
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{ | |
var _local3:String; | |
for (_local3 in _arg2) { | |
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3])); | |
}; | |
} | |
protected function initializeAccessibility():void{ | |
if (UIComponent.createAccessibilityImplementation != null){ | |
UIComponent.createAccessibilityImplementation(this); | |
}; | |
} | |
public function get focusManager():IFocusManager{ | |
var _local1:DisplayObject = this; | |
while (_local1) { | |
if (UIComponent.focusManagers[_local1] != null){ | |
return (IFocusManager(UIComponent.focusManagers[_local1])); | |
}; | |
_local1 = _local1.parent; | |
}; | |
return (null); | |
} | |
override public function get width():Number{ | |
return (_width); | |
} | |
protected function beforeComponentParameters():void{ | |
} | |
protected function callLater(_arg1:Function):void{ | |
if (inCallLaterPhase){ | |
return; | |
}; | |
callLaterMethods[_arg1] = true; | |
if (stage != null){ | |
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true); | |
stage.invalidate(); | |
} else { | |
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true); | |
}; | |
} | |
public function move(_arg1:Number, _arg2:Number):void{ | |
_x = _arg1; | |
_y = _arg2; | |
super.x = Math.round(_arg1); | |
super.y = Math.round(_arg2); | |
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE)); | |
} | |
public function validateNow():void{ | |
invalidate(InvalidationType.ALL, false); | |
draw(); | |
} | |
override public function set visible(_arg1:Boolean):void{ | |
if (super.visible == _arg1){ | |
return; | |
}; | |
super.visible = _arg1; | |
var _local2:String = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE; | |
dispatchEvent(new ComponentEvent(_local2, true)); | |
} | |
protected function createFocusManager():void{ | |
if (focusManagers[stage] == null){ | |
focusManagers[stage] = new FocusManager(stage); | |
}; | |
} | |
protected function hookAccessibility(_arg1:Event):void{ | |
removeEventListener(Event.ENTER_FRAME, hookAccessibility); | |
initializeAccessibility(); | |
} | |
public function set componentInspectorSetting(_arg1:Boolean):void{ | |
_inspector = _arg1; | |
if (_inspector){ | |
beforeComponentParameters(); | |
} else { | |
afterComponentParameters(); | |
}; | |
} | |
override public function set y(_arg1:Number):void{ | |
move(_x, _arg1); | |
} | |
public function drawFocus(_arg1:Boolean):void{ | |
var _local2:Number; | |
isFocused = _arg1; | |
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){ | |
removeChild(uiFocusRect); | |
uiFocusRect = null; | |
}; | |
if (_arg1){ | |
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite); | |
if (uiFocusRect == null){ | |
return; | |
}; | |
_local2 = Number(getStyleValue("focusRectPadding")); | |
uiFocusRect.x = -(_local2); | |
uiFocusRect.y = -(_local2); | |
uiFocusRect.width = (width + (_local2 * 2)); | |
uiFocusRect.height = (height + (_local2 * 2)); | |
addChildAt(uiFocusRect, 0); | |
}; | |
} | |
override public function set x(_arg1:Number):void{ | |
move(_arg1, _y); | |
} | |
public function drawNow():void{ | |
draw(); | |
} | |
} | |
}//package fl.core | |
package fl.core { | |
public class InvalidationType { | |
public static const SIZE:String = "size"; | |
public static const ALL:String = "all"; | |
public static const DATA:String = "data"; | |
public static const SCROLL:String = "scroll"; | |
public static const STATE:String = "state"; | |
public static const STYLES:String = "styles"; | |
public static const SELECTED:String = "selected"; | |
public static const RENDERER_STYLES:String = "rendererStyles"; | |
} | |
}//package fl.core | |
package fl.data { | |
import flash.events.*; | |
import fl.events.*; | |
public class DataProvider extends EventDispatcher { | |
protected var data:Array; | |
public function DataProvider(_arg1:Object=null){ | |
if (_arg1 == null){ | |
data = []; | |
} else { | |
data = getDataFromObject(_arg1); | |
}; | |
} | |
public function invalidateItemAt(_arg1:int):void{ | |
checkIndex(_arg1, (data.length - 1)); | |
dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _arg1); | |
} | |
protected function dispatchPreChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{ | |
dispatchEvent(new DataChangeEvent(DataChangeEvent.PRE_DATA_CHANGE, _arg1, _arg2, _arg3, _arg4)); | |
} | |
public function getItemIndex(_arg1:Object):int{ | |
return (data.indexOf(_arg1)); | |
} | |
public function removeItemAt(_arg1:uint):Object{ | |
checkIndex(_arg1, (data.length - 1)); | |
dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1); | |
var _local2:Array = data.splice(_arg1, 1); | |
dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1); | |
return (_local2[0]); | |
} | |
protected function getDataFromObject(_arg1:Object):Array{ | |
var _local2:Array; | |
var _local3:Array; | |
var _local4:uint; | |
var _local5:Object; | |
var _local6:XML; | |
var _local7:XMLList; | |
var _local8:XML; | |
var _local9:XMLList; | |
var _local10:XML; | |
var _local11:XMLList; | |
var _local12:XML; | |
if ((_arg1 is Array)){ | |
_local3 = (_arg1 as Array); | |
if (_local3.length > 0){ | |
if ((((_local3[0] is String)) || ((_local3[0] is Number)))){ | |
_local2 = []; | |
_local4 = 0; | |
while (_local4 < _local3.length) { | |
_local5 = { | |
label:String(_local3[_local4]), | |
data:_local3[_local4] | |
}; | |
_local2.push(_local5); | |
_local4++; | |
}; | |
return (_local2); | |
}; | |
}; | |
return (_arg1.concat()); | |
}; | |
if ((_arg1 is DataProvider)){ | |
return (_arg1.toArray()); | |
}; | |
if ((_arg1 is XML)){ | |
_local6 = (_arg1 as XML); | |
_local2 = []; | |
_local7 = _local6.*; | |
for each (_local8 in _local7) { | |
_arg1 = {}; | |
_local9 = _local8.attributes(); | |
for each (_local10 in _local9) { | |
_arg1[_local10.localName()] = _local10.toString(); | |
}; | |
_local11 = _local8.*; | |
for each (_local12 in _local11) { | |
if (_local12.hasSimpleContent()){ | |
_arg1[_local12.localName()] = _local12.toString(); | |
}; | |
}; | |
_local2.push(_arg1); | |
}; | |
return (_local2); | |
}; | |
throw (new TypeError((("Error: Type Coercion failed: cannot convert " + _arg1) + " to Array or DataProvider."))); | |
} | |
public function addItem(_arg1:Object):void{ | |
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1)); | |
data.push(_arg1); | |
dispatchChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1)); | |
} | |
public function concat(_arg1:Object):void{ | |
addItems(_arg1); | |
} | |
public function getItemAt(_arg1:uint):Object{ | |
checkIndex(_arg1, (data.length - 1)); | |
return (data[_arg1]); | |
} | |
public function sortOn(_arg1:Object, _arg2:Object=null){ | |
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); | |
var _local3:Array = data.sortOn(_arg1, _arg2); | |
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); | |
return (_local3); | |
} | |
public function toArray():Array{ | |
return (data.concat()); | |
} | |
public function addItems(_arg1:Object):void{ | |
addItemsAt(_arg1, data.length); | |
} | |
public function clone():DataProvider{ | |
return (new DataProvider(data)); | |
} | |
public function sort(... _args){ | |
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); | |
var _local2:Array = data.sort.apply(data, _args); | |
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1)); | |
return (_local2); | |
} | |
public function get length():uint{ | |
return (data.length); | |
} | |
public function addItemAt(_arg1:Object, _arg2:uint):void{ | |
checkIndex(_arg2, data.length); | |
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2); | |
data.splice(_arg2, 0, _arg1); | |
dispatchChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2); | |
} | |
override public function toString():String{ | |
return ((("DataProvider [" + data.join(" , ")) + "]")); | |
} | |
public function invalidateItem(_arg1:Object):void{ | |
var _local2:uint = getItemIndex(_arg1); | |
if (_local2 == -1){ | |
return; | |
}; | |
invalidateItemAt(_local2); | |
} | |
protected function dispatchChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{ | |
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, _arg1, _arg2, _arg3, _arg4)); | |
} | |
protected function checkIndex(_arg1:int, _arg2:int):void{ | |
if ((((_arg1 > _arg2)) || ((_arg1 < 0)))){ | |
throw (new RangeError((((("DataProvider index (" + _arg1) + ") is not in acceptable range (0 - ") + _arg2) + ")"))); | |
}; | |
} | |
public function addItemsAt(_arg1:Object, _arg2:uint):void{ | |
checkIndex(_arg2, data.length); | |
var _local3:Array = getDataFromObject(_arg1); | |
dispatchPreChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1)); | |
data.splice.apply(data, [_arg2, 0].concat(_local3)); | |
dispatchChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1)); | |
} | |
public function replaceItem(_arg1:Object, _arg2:Object):Object{ | |
var _local3:int = getItemIndex(_arg2); | |
if (_local3 != -1){ | |
return (replaceItemAt(_arg1, _local3)); | |
}; | |
return (null); | |
} | |
public function removeItem(_arg1:Object):Object{ | |
var _local2:int = getItemIndex(_arg1); | |
if (_local2 != -1){ | |
return (removeItemAt(_local2)); | |
}; | |
return (null); | |
} | |
public function merge(_arg1:Object):void{ | |
var _local6:Object; | |
var _local2:Array = getDataFromObject(_arg1); | |
var _local3:uint = _local2.length; | |
var _local4:uint = data.length; | |
dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1)); | |
var _local5:uint; | |
while (_local5 < _local3) { | |
_local6 = _local2[_local5]; | |
if (getItemIndex(_local6) == -1){ | |
data.push(_local6); | |
}; | |
_local5++; | |
}; | |
if (data.length > _local4){ | |
dispatchChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1)); | |
} else { | |
dispatchChangeEvent(DataChangeType.ADD, [], -1, -1); | |
}; | |
} | |
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{ | |
checkIndex(_arg2, (data.length - 1)); | |
var _local3:Array = [data[_arg2]]; | |
dispatchPreChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2); | |
data[_arg2] = _arg1; | |
dispatchChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2); | |
return (_local3[0]); | |
} | |
public function invalidate():void{ | |
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, DataChangeType.INVALIDATE_ALL, data.concat(), 0, data.length)); | |
} | |
public function removeAll():void{ | |
var _local1:Array = data.concat(); | |
dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length); | |
data = []; | |
dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length); | |
} | |
} | |
}//package fl.data | |
package { | |
import flash.display.*; | |
public dynamic class UpArrowUpSkin extends MovieClip { | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class FirstDown extends BitmapData { | |
public function FirstDown(_arg1:int=60, _arg2:int=26){ | |
super(_arg1, _arg2); | |
} | |
} | |
}//package | |
package { | |
import flash.display.*; | |
import flash.utils.*; | |
import com.adobe.serialization.json.*; | |
import effect.*; | |
import flash.events.*; | |
import com.meitu.net.*; | |
import jac.image.*; | |
import com.meitu.util.*; | |
import util.*; | |
public class PhotoEditor extends Sprite implements IPhotoEditor { | |
private var _originBitmapData:BitmapData; | |
private var _bitmapData:BitmapData; | |
private var _materialBitmapData:BitmapData; | |
private var _effect:Object; | |
private var _border:Object; | |
private var _materialData:Object; | |
private var _transparent:Boolean; | |
private var _inited:Boolean = false; | |
private var _cropPanel:CropPanel; | |
private var _ctrlPanel:CtrlPanel; | |
private var _previewPanel:PreviewPanel; | |
private var _cameraPanel:CameraPanel; | |
private var _editorWidth:int; | |
private var _editorHeight:int; | |
private var _bg:Sprite; | |
public function PhotoEditor(){ | |
if (this.stage){ | |
this.init(); | |
} else { | |
this.addEventListener(Event.ADDED_TO_STAGE, this.init); | |
}; | |
} | |
private function init(_arg1:Event=null):void{ | |
this.removeEventListener(Event.ADDED_TO_STAGE, this.init); | |
InstanceFactory.photoEditor = this; | |
this.initElements(); | |
this.addEventListeners(); | |
} | |
private function initElements():void{ | |
this._cropPanel = new CropPanel(); | |
this.addChild(this._cropPanel); | |
this._cropPanel.visible = false; | |
var _local1:Object = InstanceFactory.mainApplication.externalManager.getParamByName("previewStyle"); | |
if (!((((_local1) && ((typeof(_local1) == "object")))) && (!(_local1.visible)))){ | |
this._previewPanel = new PreviewPanel(); | |
this.addChild(this._previewPanel); | |
}; | |
this._bg = new Sprite(); | |
this.addChildAt(this._bg, 0); | |
this._ctrlPanel = new CtrlPanel(); | |
this._ctrlPanel.initedCallback = this.ctrlPanelInitedCallback; | |
this.addChildAt(this._ctrlPanel, 1); | |
} | |
private function ctrlPanelInitedCallback():void{ | |
this.resize(this._editorWidth, this._editorHeight); | |
} | |
private function addEventListeners():void{ | |
} | |
private function update():void{ | |
this.updateCropPanel(); | |
this.updateCtrlPanel(); | |
this.updatePreviewPanel(); | |
} | |
private function remove():void{ | |
this.removeCameraPanel(); | |
} | |
public function resize(_arg1:int, _arg2:int):void{ | |
this._editorWidth = _arg1; | |
this._editorHeight = _arg2; | |
this._bg.graphics.clear(); | |
this._bg.graphics.beginFill(0xFFFFFF, 1); | |
this._bg.graphics.drawRect(0, 0, _arg1, _arg2); | |
this._bg.graphics.endFill(); | |
this._ctrlPanel.resize(this._editorHeight); | |
var _local3:int; | |
if (this._previewPanel){ | |
this._previewPanel.resize(this._editorHeight); | |
this._previewPanel.x = (this._editorWidth - this._previewPanel.outterWidth); | |
_local3 = this._previewPanel.outterWidth; | |
}; | |
this._cropPanel.resize(((this._editorWidth - this._ctrlPanel.outterWidth) - _local3), this._editorHeight); | |
this._cropPanel.x = (this._ctrlPanel.x + this._ctrlPanel.outterWidth); | |
if (this._cameraPanel){ | |
this._cameraPanel.resize(this._editorWidth, this._editorHeight, this._cameraPanel.y); | |
}; | |
} | |
public function updatePreviewPanel():void{ | |
if (((this._previewPanel) && (this.getCropBitmapData()))){ | |
this._previewPanel.update(); | |
}; | |
} | |
public function updateCtrlPanel():void{ | |
this._ctrlPanel.update(); | |
} | |
public function updateCropPanel():void{ | |
this._cropPanel.bitmapData = this._bitmapData.clone(); | |
} | |
public function reset():void{ | |
this._ctrlPanel.reset(); | |
this._cropPanel.effectBitmapData = null; | |
this._effect = null; | |
this._border = null; | |
this._materialBitmapData = null; | |
this._materialData = null; | |
} | |
public function openCamera():void{ | |
this.displayOtherPanel(false); | |
this._cameraPanel = new CameraPanel(); | |
this.addChild(this._cameraPanel); | |
this._cameraPanel.resize(this._editorWidth, this._cropPanel.outterHeight, this._cameraPanel.y); | |
if (this._inited){ | |
this._cameraPanel.reset(); | |
}; | |
this._cameraPanel.check(); | |
InstanceFactory.mainApplication.displayBottom(false); | |
InstanceFactory.mainApplication.showActive("camera"); | |
this._inited = true; | |
} | |
public function closeCamera():void{ | |
this.removeCameraPanel(); | |
this.displayOtherPanel(true); | |
InstanceFactory.mainApplication.displayBottom(true); | |
InstanceFactory.mainApplication.showActive("local"); | |
this._cropPanel.visible = (this._bitmapData) ? true : false; | |
} | |
public function removeCameraPanel():void{ | |
if (this._cameraPanel){ | |
this._cameraPanel.release(); | |
this.removeChild(this._cameraPanel); | |
this._cameraPanel = null; | |
}; | |
} | |
private function displayOtherPanel(_arg1:Boolean):void{ | |
var _local2:int; | |
while (_local2 < this.numChildren) { | |
(this.getChildAt(_local2) as DisplayObject).visible = _arg1; | |
_local2++; | |
}; | |
} | |
public function avaterClipHandler():void{ | |
} | |
public function avaterClipStartCropHandler():void{ | |
this._cropPanel.effectBitmapData = null; | |
} | |
public function avaterClipFinishCropHandler():void{ | |
this.updateCtrlPanel(); | |
this._cropPanel.effectBitmapData = this.cropEffectBitmapData; | |
this.updatePreviewPanel(); | |
} | |
public function listItemClickHandler(_arg1:String, _arg2:Object):void{ | |
this._ctrlPanel.reset(_arg1); | |
if (((this.cropThumbBitmapData) && (this.getCropBitmapData()))){ | |
switch (_arg1){ | |
case "beauty": | |
case "effect": | |
this._effect = _arg2; | |
this._border = null; | |
this._cropPanel.effectBitmapData = this.cropEffectBitmapData; | |
this.updatePreviewPanel(); | |
break; | |
case "border": | |
this._border = _arg2; | |
this._effect = null; | |
this.loadBorderMater((("xuancai/master/" + this._border["masterUrl"]) + ".swf")); | |
break; | |
}; | |
InstanceFactory.mainApplication.statistic.trackEvent("app", "click", _arg2["statistic"]); | |
}; | |
} | |
public function loadBorderMater(_arg1:String):void{ | |
var _local2:SWFLibrary = new SWFLibrary(1); | |
_local2.addEventListener(Event.COMPLETE, FunctionUtil.eventDelegate(this.imageLoadedCompleteHandler, _arg1)); | |
_local2.addEventListener(IOErrorEvent.IO_ERROR, FunctionUtil.eventDelegate(this.loadFailedHandler, _arg1)); | |
_local2.load(_arg1); | |
} | |
private function imageLoadedCompleteHandler(_arg1:Event, _arg2:String):void{ | |
var _local9:String; | |
_arg1.currentTarget.removeEventListener(Event.COMPLETE, this.imageLoadedCompleteHandler); | |
_arg1.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR, this.loadFailedHandler); | |
this._materialBitmapData = null; | |
var _local3:URL = new URL(_arg2); | |
var _local4:String = _local3.pathname.filename; | |
var _local5 = (_local4 + "_fla.MainTimeline_JsonData"); | |
var _local6:Class = ((_arg1.currentTarget.getAsset(_local5)) || ((_arg1.currentTarget.content.JsonData as Class))); | |
if (!_local6){ | |
return; | |
}; | |
var _local7:ByteArray = (new (_local6) as ByteArray); | |
_local7.position = 0; | |
var _local8:Object = JSON.decode(_local7.readUTFBytes(_local7.length)); | |
for (_local9 in _local8) { | |
this._materialData = _local8[_local9]; | |
break; | |
}; | |
this._materialBitmapData = _arg1.currentTarget.getBitmapData("ImageBitmapData"); | |
if (this.cropThumbBitmapData){ | |
this._cropPanel.effectBitmapData = this.cropEffectBitmapData; | |
this.updatePreviewPanel(); | |
}; | |
} | |
private function loadFailedHandler(_arg1:IOErrorEvent, _arg2:String):void{ | |
_arg1.currentTarget.removeEventListener(Event.COMPLETE, this.imageLoadedCompleteHandler); | |
_arg1.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR, this.loadFailedHandler); | |
InstanceFactory.mainApplication.statistic.trackEvent("app", "error", _arg2); | |
} | |
public function set bitmapData(_arg1:BitmapData):void{ | |
this._bitmapData = _arg1; | |
this.remove(); | |
this.displayOtherPanel(true); | |
this.reset(); | |
this.update(); | |
InstanceFactory.mainApplication.displayBottom(true); | |
InstanceFactory.mainApplication.btnEnable = true; | |
InstanceFactory.mainApplication.showActive("local"); | |
InstanceFactory.mainApplication.imageModel.reset(); | |
} | |
public function get cropEffectBitmapData():BitmapData{ | |
var _local1:BitmapData; | |
if (this._effect){ | |
_local1 = EffectUtil.doEffect(this.cropThumbBitmapData.clone(), this._effect.type, this._effect.filterFun); | |
}; | |
if (this._border){ | |
_local1 = BorderUtil.getXuancaiCompose(this.cropThumbBitmapData.clone(), this._materialBitmapData, this._materialData); | |
}; | |
return (((_local1) || (null))); | |
} | |
public function get cropThumbBitmapData():BitmapData{ | |
return (this._cropPanel.cropThumbBitmapData); | |
} | |
public function set originBitmapData(_arg1:BitmapData):void{ | |
this._originBitmapData = _arg1; | |
} | |
public function get originBitmapData():BitmapData{ | |
return (this._originBitmapData); | |
} | |
public function get transparent():Boolean{ | |
return (this._transparent); | |
} | |
public function set transparent(_arg1:Boolean):void{ | |
this._transparent = _arg1; | |
} | |
public function getCropBitmapData(_arg1:int=150, _arg2:int=150):BitmapData{ | |
var _local3:BitmapData; | |
if (this._cropPanel.cropBitmapData){ | |
if (((_arg1) && (_arg2))){ | |
_local3 = ImageUtils.resizeImage(this._cropPanel.cropBitmapData, _arg1, _arg2); | |
} else { | |
_local3 = this._cropPanel.cropBitmapData.clone(); | |
}; | |
}; | |
return (_local3); | |
} | |
public function getFinalBitmapData(_arg1:int=150, _arg2:int=150):BitmapData{ | |
var _local3:BitmapData; | |
var _local4:BitmapData = this.getCropBitmapData(_arg1, _arg2); | |
if (this._effect){ | |
_local3 = EffectUtil.doEffect(_local4, this._effect.type, this._effect.filterFun); | |
}; | |
if (this._border){ | |
_local3 = BorderUtil.getXuancaiCompose(_local4, this._materialBitmapData, this._materialData); | |
}; | |
return (((_local3) || (_local4))); | |
} | |
FilterFacory.getInstance().key = "1ac7c963-423d-4141-9697-5fe14f3cb930"; | |
} | |
}//package | |
package controls { | |
import mx.core.*; | |
public class CropTool_SCALE_CURSOR extends BitmapAsset { | |
} | |
}//package controls | |
package controls { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.filters.*; | |
import com.greensock.transform.*; | |
import com.greensock.events.*; | |
import com.meitu.display.*; | |
import jac.image.*; | |
public class CropTool extends Sprite { | |
private static const MOVE_CUROSR:Class = CropTool_MOVE_CUROSR; | |
private static const SCALE_CURSOR:Class = CropTool_SCALE_CURSOR; | |
private var _transformManager:TransformManager; | |
private var _transformItem:TransformItem; | |
private var _dragLayer:Sprite; | |
private var _width:int; | |
private var _height:int; | |
private var _bitmapData:BitmapData; | |
private var _effectBitmap:Bitmap; | |
private var _maskLayer:Sprite; | |
private var _thumbBitmap:Bitmap; | |
private var _alphaLayer:Sprite; | |
private var _bitmap:Bitmap; | |
private var _cropBitmapData:BitmapData; | |
private var _scale:Number; | |
private var _maskWidth:Number = 150; | |
private var _maskHeight:Number = 150; | |
private var _localCropRect:Rectangle; | |
public function CropTool(){ | |
this.init(); | |
} | |
private function init():void{ | |
this._bitmap = new Bitmap(); | |
addChild(this._bitmap); | |
this._alphaLayer = new Sprite(); | |
addChild(this._alphaLayer); | |
this._thumbBitmap = new Bitmap(); | |
addChild(this._thumbBitmap); | |
this._dragLayer = new Sprite(); | |
addChild(this._dragLayer); | |
this._maskLayer = new Sprite(); | |
this._thumbBitmap.mask = this._maskLayer; | |
addChild(this._maskLayer); | |
this._effectBitmap = new Bitmap(); | |
addChild(this._effectBitmap); | |
this.transformToolSetting(); | |
} | |
private function transformToolSetting():void{ | |
this._transformManager = new TransformManager(); | |
this._transformManager.addItem(this._dragLayer); | |
this._transformManager.constrainScale = true; | |
this._transformManager.allowDelete = false; | |
this._transformManager.autoDeselect = false; | |
this._transformManager.hideCenterHandle = true; | |
this._transformManager.lockRotation = true; | |
this._transformManager.handleSize = 6; | |
this._transformManager.handleFillColor = 26367; | |
this._transformManager.allowMultiSelect = false; | |
this._transformManager.arrowKeysMove = true; | |
var _local1:BitmapData = Bitmap(new MOVE_CUROSR()).bitmapData; | |
var _local2:Matrix = new Matrix(); | |
_local2.tx = (-(_local1.width) >> 1); | |
_local2.ty = (-(_local1.height) >> 1); | |
var _local3:Shape = new Shape(); | |
_local3.graphics.beginBitmapFill(_local1, _local2, false, true); | |
_local3.graphics.drawRect((-(_local1.width) >> 1), (-(_local1.height) >> 1), _local1.width, _local1.height); | |
_local3.graphics.endFill(); | |
_local3.filters = [new DropShadowFilter(1, 90, 0, 0.2, 0, 0, 3, 3)]; | |
var _local4:BitmapData = Bitmap(new SCALE_CURSOR()).bitmapData; | |
_local2 = new Matrix(); | |
_local2.tx = (-(_local4.width) >> 1); | |
_local2.ty = (-(_local4.height) >> 1); | |
var _local5:Shape = new Shape(); | |
_local5.graphics.beginBitmapFill(_local4, _local2, false, true); | |
_local5.graphics.drawRect((-(_local4.width) >> 1), (-(_local4.height) >> 1), _local4.width, _local4.height); | |
_local5.graphics.endFill(); | |
_local5.filters = [new DropShadowFilter(1, 90, 0, 0.2, 0, 0, 3, 3)]; | |
TransformManager.customizeMoveCursor(_local3, true); | |
TransformManager.customizeScaleCursor(_local5, true); | |
this._transformItem = this._transformManager.selectItem(this._dragLayer); | |
this._transformItem.selected = true; | |
this._transformManager.addEventListener(TransformEvent.MOVE, this.transformManagerHandler); | |
this._transformManager.addEventListener(TransformEvent.START_INTERACTIVE_MOVE, this.transformManagerStartInteractiveHandler); | |
this._transformManager.addEventListener(TransformEvent.FINISH_INTERACTIVE_MOVE, this.transformManagerFinishInteractiveHandler); | |
this._transformManager.addEventListener(TransformEvent.SCALE, this.transformManagerHandler); | |
this._transformManager.addEventListener(TransformEvent.START_INTERACTIVE_SCALE, this.transformManagerStartInteractiveHandler); | |
this._transformManager.addEventListener(TransformEvent.FINISH_INTERACTIVE_SCALE, this.transformManagerFinishInteractiveHandler); | |
} | |
private function transformManagerHandler(_arg1:TransformEvent):void{ | |
this.updateBounds(); | |
} | |
private function transformManagerStartInteractiveHandler(_arg1:TransformEvent):void{ | |
this.updateBounds(); | |
this.updateCropBitmapData(); | |
InstanceFactory.photoEditor.avaterClipStartCropHandler(); | |
} | |
private function transformManagerFinishInteractiveHandler(_arg1:TransformEvent):void{ | |
this._dragLayer.width = int(this._dragLayer.width); | |
this._dragLayer.height = int(this._dragLayer.height); | |
this._dragLayer.x = int(this._dragLayer.x); | |
this._dragLayer.y = int(this._dragLayer.y); | |
this._transformManager.updateSelection(); | |
this.updateBounds(); | |
this.updateCropBitmapData(); | |
this.finishCrop(); | |
InstanceFactory.photoEditor.avaterClipFinishCropHandler(); | |
} | |
public function resize(_arg1:int, _arg2:int):void{ | |
this._width = _arg1; | |
this._height = _arg2; | |
this.updateAlphaLayer(); | |
this.relocate(); | |
this.updateDragArea(); | |
this.finishCrop(); | |
} | |
public function update():void{ | |
var _local2:Number; | |
this._maskWidth = InstanceFactory.mainApplication.externalManager.lockSize.width; | |
this._maskHeight = InstanceFactory.mainApplication.externalManager.lockSize.height; | |
var _local1:Number = InstanceFactory.mainApplication.externalManager.lockScale; | |
if (_local1){ | |
_local2 = Math.min((this.bitmapData.width / _local1), this.bitmapData.height); | |
this._maskWidth = ((_local1 * _local2) >> 1); | |
this._maskHeight = (_local2 >> 1); | |
}; | |
this.updateThumbBitmap(); | |
this.updateBitmap(); | |
this.updateAlphaLayer(); | |
this.updateDragLayer(); | |
this.updateMaskLayer(); | |
this.updateDragArea(); | |
this.updateCropBitmapData(); | |
this.finishCrop(); | |
this.updateBounds(); | |
} | |
private function updateCropBitmapData():void{ | |
this._cropBitmapData = this.cropBitmapData; | |
} | |
private function updateDragArea():void{ | |
var _local1:Rectangle = new Rectangle(this._bitmap.x, this._bitmap.y, this._bitmap.width, this._bitmap.height); | |
this._transformManager.bounds = _local1; | |
} | |
private function updateDragLayer():void{ | |
var _local2 = this._dragLayer; | |
with (_local2) { | |
graphics.clear(); | |
graphics.beginFill(0xFFF000, 0); | |
graphics.drawRect(0, 0, _maskWidth, _maskHeight); | |
graphics.endFill(); | |
rotation = 0; | |
scaleX = (scaleY = 1); | |
x = ((outterWidth - _maskWidth) >> 1); | |
y = ((outterHeight - _maskHeight) >> 1); | |
}; | |
} | |
private function updateMaskLayer():void{ | |
var _local2 = this._maskLayer; | |
with (_local2) { | |
graphics.clear(); | |
graphics.beginFill(0, 0.5); | |
graphics.drawRect(0, 0, _maskWidth, _maskHeight); | |
graphics.endFill(); | |
scaleX = (scaleY = 1); | |
x = ((outterWidth - _maskWidth) >> 1); | |
y = ((outterHeight - _maskHeight) >> 1); | |
}; | |
} | |
private function updateAlphaLayer():void{ | |
var _local2 = this._alphaLayer; | |
with (_local2) { | |
graphics.clear(); | |
graphics.beginFill(0x333333, 0.5); | |
graphics.drawRect(0, 0, outterWidth, outterHeight); | |
graphics.endFill(); | |
scaleX = (scaleY = 1); | |
}; | |
} | |
private function updateBitmap():void{ | |
if (this.bitmapData){ | |
this._bitmap.bitmapData = this.bitmapData.clone(); | |
this._bitmap.smoothing = true; | |
this._bitmap.scaleX = 1; | |
this._bitmap.scaleX = (this._bitmap.scaleY = this._scale); | |
this._bitmap.x = this._thumbBitmap.x; | |
this._bitmap.y = this._thumbBitmap.y; | |
}; | |
} | |
private function updateThumbBitmap():void{ | |
var _local1:BitmapData; | |
var _local2:Number; | |
var _local3:BitmapData; | |
if (this.bitmapData){ | |
_local1 = this.bitmapData.clone(); | |
_local2 = DisplayObjectUtil.getAdaptiveScale(_local1.width, _local1.height, this._width, this._height); | |
_local3 = ImageUtils.resizeImage(_local1, int((_local1.width * _local2)), int((_local1.height * _local2))); | |
this._thumbBitmap.bitmapData = _local3; | |
this._thumbBitmap.smoothing = true; | |
this._thumbBitmap.x = ((this.outterWidth - this._thumbBitmap.width) >> 1); | |
this._thumbBitmap.y = ((this.outterHeight - this._thumbBitmap.height) >> 1); | |
this._scale = Math.min((_local3.width / _local1.width), (_local3.height / _local1.height), 1); | |
}; | |
} | |
private function updateBounds():void{ | |
this._localCropRect = this._dragLayer.getBounds(this); | |
this._maskLayer.scaleX = this._dragLayer.scaleX; | |
this._maskLayer.scaleY = this._dragLayer.scaleY; | |
this._effectBitmap.x = (this._maskLayer.x = this._localCropRect.x); | |
this._effectBitmap.y = (this._maskLayer.y = this._localCropRect.y); | |
} | |
private function finishCrop():void{ | |
this._transformManager.updateSelection(); | |
} | |
private function relocate():void{ | |
var _local1:Number = (((this.outterWidth - this._thumbBitmap.width) / 2) - this._thumbBitmap.x); | |
var _local2:Number = (((this.outterHeight - this._thumbBitmap.height) / 2) - this._thumbBitmap.y); | |
this._bitmap.x = (this._thumbBitmap.x = (_local1 + this._thumbBitmap.x)); | |
this._bitmap.y = (this._thumbBitmap.y = (_local2 + this._thumbBitmap.y)); | |
this._maskLayer.x = (this._dragLayer.x = (_local1 + this._dragLayer.x)); | |
this._maskLayer.y = (this._dragLayer.y = (_local2 + this._dragLayer.y)); | |
} | |
public function get outterWidth():Number{ | |
return (this._width); | |
} | |
public function get outterHeight():Number{ | |
return (this._height); | |
} | |
public function get localCropRect():Rectangle{ | |
return (this._localCropRect); | |
} | |
public function set bitmapData(_arg1:BitmapData):void{ | |
this._bitmapData = _arg1; | |
this.update(); | |
} | |
public function get bitmapData():BitmapData{ | |
return (this._bitmapData); | |
} | |
public function set effectBitmapData(_arg1:BitmapData):void{ | |
this._effectBitmap.bitmapData = _arg1; | |
this._effectBitmap.smoothing = true; | |
} | |
public function get cropThumbBitmapData():BitmapData{ | |
var _local1:BitmapData; | |
var _local2:Rectangle; | |
var _local3:Number; | |
var _local4:Number; | |
if (this._thumbBitmap.bitmapData){ | |
_local2 = this._dragLayer.getBounds(this._thumbBitmap); | |
_local3 = ((this._dragLayer.width <= 1)) ? 1 : this._dragLayer.width; | |
_local4 = ((this._dragLayer.height <= 1)) ? 1 : this._dragLayer.height; | |
_local1 = new BitmapData(_local3, _local4); | |
_local1.copyPixels(this._thumbBitmap.bitmapData, _local2, new Point()); | |
}; | |
return (_local1); | |
} | |
public function get cropBitmapData():BitmapData{ | |
var _local1:Rectangle; | |
if (this.bitmapData){ | |
_local1 = this._dragLayer.getBounds(this._bitmap); | |
_local1.width = ((_local1.width < 1)) ? 1 : _local1.width; | |
_local1.height = ((_local1.height < 1)) ? 1 : _local1.height; | |
this._cropBitmapData = new BitmapData(_local1.width, _local1.height); | |
this._cropBitmapData.copyPixels(this.bitmapData, _local1, new Point()); | |
}; | |
return (this._cropBitmapData); | |
} | |
} | |
}//package controls | |
package controls { | |
import mx.core.*; | |
public class CropTool_MOVE_CUROSR extends BitmapAsset { | |
} | |
}//package controls | |
package { | |
import flash.display.*; | |
public dynamic class ScrollPane_disabledSkin extends MovieClip { | |
} | |
}//package | |
package { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.meitu.display.*; | |
import jac.image.*; | |
import preview.*; | |
public class PreviewPanel extends Sprite { | |
public var __text:TextField; | |
public var __bgPreview:MovieClip; | |
private var _bg:Sprite; | |
private var _itemList:Array; | |
private var _text:TextField; | |
private var _smallPreviewItem:PreviewItem; | |
private var _mediumPreviewItem:PreviewItem; | |
private var _largePreviewItem:PreviewItem; | |
private var _lastPreviewItem:PreviewItem; | |
public function PreviewPanel(){ | |
this._itemList = []; | |
super(); | |
if (this.stage){ | |
this.init(); | |
} else { | |
this.addEventListener(Event.ADDED_TO_STAGE, this.init); | |
}; | |
} | |
private function init(_arg1:Event=null):void{ | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
var _local8:int; | |
var _local9:int; | |
var _local10:int; | |
var _local11:int; | |
var _local12:PreviewItem; | |
removeEventListener(Event.ADDED_TO_STAGE, this.init); | |
var _local2:int = InstanceFactory.mainApplication.externalManager.lockSize.width; | |
var _local3:int = InstanceFactory.mainApplication.externalManager.lockSize.height; | |
this._bg = (this.getChildByName("__bgPreview") as Sprite); | |
this._text = (this.getChildByName("__text") as TextField); | |
this._text.text = Language.AVATAR_PREVIEW; | |
var _local4:Object = InstanceFactory.mainApplication.externalManager.getParamByName("previewStyle"); | |
if (((_local4) && ((typeof(_local4) == "object")))){ | |
this._text.text = ((_local4.label) || ("")); | |
if (_local4.small){ | |
_local5 = Math.min(((_local4.small.width) || (30)), 170); | |
_local6 = Math.min(((_local4.small.height) || (30)), 170); | |
this._smallPreviewItem = new PreviewItem(); | |
this._smallPreviewItem.label = ((_local4.small.label) || ("")); | |
this._smallPreviewItem.resize(_local5, _local6); | |
}; | |
if (_local4.medium){ | |
_local7 = Math.min(((_local4.medium.width) || (60)), 170); | |
_local8 = Math.min(((_local4.medium.height) || (60)), 170); | |
this._mediumPreviewItem = new PreviewItem(); | |
this._mediumPreviewItem.label = ((_local4.medium.label) || ("")); | |
this._mediumPreviewItem.resize(_local7, _local8); | |
}; | |
if (_local4.large){ | |
_local9 = Math.min(((_local4.large.width) || (140)), 170); | |
_local10 = Math.min(((_local4.large.height) || (140)), 170); | |
this._largePreviewItem = new PreviewItem(); | |
this._largePreviewItem.label = ((_local4.large.label) || ("")); | |
this._largePreviewItem.resize(_local9, _local10); | |
}; | |
} else { | |
if ((((_local2 <= 30)) && ((_local3 <= 30)))){ | |
this._smallPreviewItem = new PreviewItem(); | |
this._smallPreviewItem.label = "头像"; | |
this._smallPreviewItem.resize(30, 30); | |
} else { | |
if ((((_local2 <= 60)) && ((_local3 <= 60)))){ | |
this._smallPreviewItem = new PreviewItem(); | |
this._smallPreviewItem.label = "小头像"; | |
this._smallPreviewItem.resize(30, 30); | |
this._mediumPreviewItem = new PreviewItem(); | |
this._mediumPreviewItem.label = "大头像"; | |
this._mediumPreviewItem.resize(60, 60); | |
} else { | |
this._smallPreviewItem = new PreviewItem(); | |
this._smallPreviewItem.label = Language.MIN_AVATAR; | |
this._smallPreviewItem.resize(30, 30); | |
this._mediumPreviewItem = new PreviewItem(); | |
this._mediumPreviewItem.label = Language.MID_AVATAR; | |
this._mediumPreviewItem.resize(60, 60); | |
this._largePreviewItem = new PreviewItem(); | |
this._largePreviewItem.label = Language.MAX_AVATAR; | |
this._largePreviewItem.resize(140, 140); | |
}; | |
}; | |
}; | |
if (this._smallPreviewItem){ | |
this._itemList.push(this._smallPreviewItem); | |
this.addChild(this._smallPreviewItem); | |
}; | |
if (this._mediumPreviewItem){ | |
this._itemList.push(this._mediumPreviewItem); | |
this.addChild(this._mediumPreviewItem); | |
}; | |
if (this._largePreviewItem){ | |
this._itemList.push(this._largePreviewItem); | |
this.addChild(this._largePreviewItem); | |
}; | |
if (((((this._smallPreviewItem) && (this._mediumPreviewItem))) && (this._largePreviewItem))){ | |
this._smallPreviewItem.x = 20; | |
this._smallPreviewItem.y = 72; | |
this._mediumPreviewItem.x = 100; | |
this._mediumPreviewItem.y = 45; | |
this._largePreviewItem.x = 20; | |
this._largePreviewItem.y = 140; | |
} else { | |
_local11 = 0; | |
while (_local11 < this._itemList.length) { | |
_local12 = (this._itemList[_local11] as PreviewItem); | |
_local12.x = ((this.outterWidth - _local12.outterWidth) >> 1); | |
if (_local11 > 0){ | |
_local12.y = ((this._lastPreviewItem.y + this._lastPreviewItem.height) + 70); | |
} else { | |
_local12.y = 48; | |
}; | |
this._lastPreviewItem = _local12; | |
_local11++; | |
}; | |
}; | |
this.update(); | |
} | |
public function resize(_arg1:int):void{ | |
this._bg.height = _arg1; | |
} | |
public function update():void{ | |
var _local3:PreviewItem; | |
var _local4:BitmapData; | |
var _local1:int = this._itemList.length; | |
var _local2:int; | |
while (_local2 < _local1) { | |
_local3 = (this._itemList[_local2] as PreviewItem); | |
_local4 = ((InstanceFactory.photoEditor.getFinalBitmapData(_local3.outterWidth, _local3.outterHeight)) || (this.getExampleBitmapData(_local3.outterWidth, _local3.outterHeight))); | |
_local3.bitmapData = _local4; | |
_local2++; | |
}; | |
} | |
public function get outterWidth():int{ | |
return (this._bg.width); | |
} | |
public function get outterHeight():int{ | |
return (this._bg.height); | |
} | |
public function set bitmapData(_arg1:BitmapData):void{ | |
var _local2:int = this._itemList.length; | |
var _local3:int; | |
while (_local3 < _local2) { | |
(this._itemList[_local3] as PreviewItem).bitmapData = _arg1.clone(); | |
_local3++; | |
}; | |
} | |
private function getExampleBitmapData(_arg1:int, _arg2:int):BitmapData{ | |
var _local3:BitmapData = (new PreviewExample(1, 1) as BitmapData); | |
var _local4:Number = DisplayObjectUtil.getAdaptiveScale(_local3.width, _local3.height, _arg1, _arg2); | |
var _local5:BitmapData = ImageUtils.resizeImage(_local3, int((_local3.width * _local4)), int((_local3.height * _local4))); | |
return (_local5); | |
} | |
} | |
}//package | |
package { | |
public interface IUploadManager { | |
function get uploading():Boolean; | |
function encodeAndUpload():void; | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class UpArrowOverSkin extends MovieClip { | |
} | |
}//package | |
package { | |
import flash.display.*; | |
public dynamic class ScrollBar_thumbIcon extends MovieClip { | |
} | |
}//package | |
package com.dynamicflash.util { | |
import flash.utils.*; | |
public class Base64 { | |
private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
public static const version:String = "1.0.0"; | |
public function Base64(){ | |
throw (new Error("Base64 class is static container only")); | |
} | |
public static function encode(_arg1:String):String{ | |
var _local2:ByteArray = new ByteArray(); | |
var _local3:int = _arg1.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
_local2.writeByte(_arg1.charCodeAt(_local4)); | |
_local4++; | |
}; | |
return (encodeByteArray(_local2)); | |
} | |
public static function encodeByteArray(_arg1:ByteArray):String{ | |
var _local3:Array; | |
var _local5:uint; | |
var _local6:uint; | |
var _local7:uint; | |
var _local2 = ""; | |
var _local4:Array = new Array(4); | |
_arg1.position = 0; | |
while (_arg1.bytesAvailable > 0) { | |
_local3 = new Array(); | |
_local5 = 0; | |
while ((((_local5 < 3)) && ((_arg1.bytesAvailable > 0)))) { | |
_local3[_local5] = _arg1.readUnsignedByte(); | |
_local5++; | |
}; | |
_local4[0] = ((_local3[0] & 252) >> 2); | |
_local4[1] = (((_local3[0] & 3) << 4) | (_local3[1] >> 4)); | |
_local4[2] = (((_local3[1] & 15) << 2) | (_local3[2] >> 6)); | |
_local4[3] = (_local3[2] & 63); | |
_local6 = _local3.length; | |
while (_local6 < 3) { | |
_local4[(_local6 + 1)] = 64; | |
_local6++; | |
}; | |
_local7 = 0; | |
while (_local7 < _local4.length) { | |
_local2 = (_local2 + BASE64_CHARS.charAt(_local4[_local7])); | |
_local7++; | |
}; | |
}; | |
return (_local2); | |
} | |
public static function decode(_arg1:String):String{ | |
var _local2:ByteArray = decodeToByteArray(_arg1); | |
return (_local2.readUTFBytes(_local2.length)); | |
} | |
public static function decodeToByteArray(_arg1:String):ByteArray{ | |
var _local6:uint; | |
var _local7:uint; | |
var _local2:ByteArray = new ByteArray(); | |
var _local3:Array = new Array(4); | |
var _local4:Array = new Array(3); | |
var _local5:uint; | |
while (_local5 < _arg1.length) { | |
_local6 = 0; | |
while ((((_local6 < 4)) && (((_local5 + _local6) < _arg1.length)))) { | |
_local3[_local6] = BASE64_CHARS.indexOf(_arg1.charAt((_local5 + _local6))); | |
_local6++; | |
}; | |
_local4[0] = ((_local3[0] << 2) + ((_local3[1] & 48) >> 4)); | |
_local4[1] = (((_local3[1] & 15) << 4) + ((_local3[2] & 60) >> 2)); | |
_local4[2] = (((_local3[2] & 3) << 6) + _local3[3]); | |
_local7 = 0; | |
while (_local7 < _local4.length) { | |
if (_local3[(_local7 + 1)] == 64){ | |
break; | |
}; | |
_local2.writeByte(_local4[_local7]); | |
_local7++; | |
}; | |
_local5 = (_local5 + 4); | |
}; | |
_local2.position = 0; | |
return (_local2); | |
} | |
} | |
}//package com.dynamicflash.util | |
package com.greensock.events { | |
import flash.events.*; | |
public class TransformEvent extends Event { | |
public static const MOVE:String = "tmMove"; | |
public static const SCALE:String = "tmScale"; | |
public static const ROTATE:String = "tmRotate"; | |
public static const SELECT:String = "tmSelect"; | |
public static const DESELECT:String = "tmDeselect"; | |
public static const MOUSE_DOWN:String = "tmMouseDown"; | |
public static const SELECT_MOUSE_DOWN:String = "tmSelectMouseDown"; | |
public static const SELECT_MOUSE_UP:String = "tmSelectMouseUp"; | |
public static const ROLL_OVER_SELECTED:String = "tmRollOverSelected"; | |
public static const ROLL_OUT_SELECTED:String = "tmRollOutSelected"; | |
public static const DELETE:String = "tmDelete"; | |
public static const SELECTION_CHANGE:String = "tmSelectionChange"; | |
public static const CLICK_OFF:String = "tmClickOff"; | |
public static const UPDATE:String = "tmUpdate"; | |
public static const DEPTH_CHANGE:String = "tmDepthChange"; | |
public static const DESTROY:String = "tmDestroy"; | |
public static const START_INTERACTIVE_MOVE:String = "tmStartInteractiveMove"; | |
public static const START_INTERACTIVE_SCALE:String = "tmStartInteractiveScale"; | |
public static const START_INTERACTIVE_ROTATE:String = "tmStartInteractiveRotate"; | |
public static const FINISH_INTERACTIVE_MOVE:String = "tmFinishInteractiveMove"; | |
public static const FINISH_INTERACTIVE_SCALE:String = "tmFinishInteractiveScale"; | |
public static const FINISH_INTERACTIVE_ROTATE:String = "tmFinishInteractiveRotate"; | |
public static const DOUBLE_CLICK:String = "tmDoubleClick"; | |
public static const SEIZE_CURSOR:String = "tmSeizeCursor"; | |
public static const RELEASE_CURSOR:String = "tmReleaseCursor"; | |
public var items:Array; | |
public var mouseEvent:MouseEvent; | |
public function TransformEvent(_arg1:String, _arg2:Array, _arg3:MouseEvent=null, _arg4:Boolean=false, _arg5:Boolean=false){ | |
super(_arg1, _arg4, _arg5); | |
this.items = _arg2; | |
this.mouseEvent = _arg3; | |
} | |
override public function clone():Event{ | |
return (new TransformEvent(this.type, this.items, this.mouseEvent, this.bubbles, this.cancelable)); | |
} | |
} | |
}//package com.greensock.events | |
package com.greensock.easing { | |
public class Expo { | |
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) - (_arg3 * 0.001))); | |
} | |
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 easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ | |
if (_arg1 == 0){ | |
return (_arg2); | |
}; | |
if (_arg1 == _arg4){ | |
return ((_arg2 + _arg3)); | |
}; | |
_arg1 = (_arg1 / (_arg4 * 0.5)); | |
if (_arg1 < 1){ | |
return ((((_arg3 * 0.5) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2)); | |
}; | |
--_arg1; | |
return ((((_arg3 * 0.5) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2)); | |
} | |
} | |
}//package com.greensock.easing | |
package com.greensock.core { | |
public class PropTween { | |
public var target:Object; | |
public var property:String; | |
public var start:Number; | |
public var change:Number; | |
public var name:String; | |
public var priority:int; | |
public var isPlugin:Boolean; | |
public var nextNode:PropTween; | |
public var prevNode:PropTween; | |
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){ | |
this.target = _arg1; | |
this.property = _arg2; | |
this.start = _arg3; | |
this.change = _arg4; | |
this.name = _arg5; | |
this.isPlugin = _arg6; | |
if (_arg7){ | |
_arg7.prevNode = this; | |
this.nextNode = _arg7; | |
}; | |
this.priority = _arg8; | |
} | |
} | |
}//package com.greensock.core | |
package com.greensock.core { | |
import com.greensock.*; | |
public class TweenCore { | |
public static const version:Number = 1.382; | |
protected static var _classInitted:Boolean; | |
protected var _delay:Number; | |
protected var _hasUpdate:Boolean; | |
protected var _rawPrevTime:Number = -1; | |
protected var _pauseTime:Number; | |
public var vars:Object; | |
public var active:Boolean; | |
public var gc:Boolean; | |
public var initted:Boolean; | |
public var timeline:SimpleTimeline; | |
public var cachedStartTime:Number; | |
public var cachedTime:Number; | |
public var cachedTotalTime:Number; | |
public var cachedDuration:Number; | |
public var cachedTotalDuration:Number; | |
public var cachedTimeScale:Number; | |
public var cachedReversed:Boolean; | |
public var nextNode:TweenCore; | |
public var prevNode:TweenCore; | |
public var cachedOrphan:Boolean; | |
public var cacheIsDirty:Boolean; | |
public var cachedPaused:Boolean; | |
public var data; | |
public function TweenCore(_arg1:Number=0, _arg2:Object=null){ | |
this.vars = ((_arg2)!=null) ? _arg2 : {}; | |
this.cachedDuration = (this.cachedTotalDuration = _arg1); | |
this._delay = (this.vars.delay) ? Number(this.vars.delay) : 0; | |
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1; | |
this.active = Boolean((((((_arg1 == 0)) && ((this._delay == 0)))) && (!((this.vars.immediateRender == false))))); | |
this.cachedTotalTime = (this.cachedTime = 0); | |
this.data = this.vars.data; | |
if (!_classInitted){ | |
if (isNaN(TweenLite.rootFrame)){ | |
TweenLite.initClass(); | |
_classInitted = true; | |
} else { | |
return; | |
}; | |
}; | |
var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline; | |
this.cachedStartTime = (_local3.cachedTotalTime + this._delay); | |
_local3.addChild(this); | |
if (this.vars.reversed){ | |
this.cachedReversed = true; | |
}; | |
if (this.vars.paused){ | |
this.paused = true; | |
}; | |
} | |
public function play():void{ | |
this.reversed = false; | |
this.paused = false; | |
} | |
public function pause():void{ | |
this.paused = true; | |
} | |
public function resume():void{ | |
this.paused = false; | |
} | |
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{ | |
this.reversed = false; | |
this.paused = false; | |
this.setTotalTime((_arg1) ? -(this._delay) : 0, _arg2); | |
} | |
public function reverse(_arg1:Boolean=true):void{ | |
this.reversed = true; | |
if (_arg1){ | |
this.paused = false; | |
} else { | |
if (this.gc){ | |
this.setEnabled(true, false); | |
}; | |
}; | |
} | |
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ | |
} | |
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{ | |
if (!_arg1){ | |
this.renderTime(this.totalDuration, _arg2, false); | |
return; | |
}; | |
if (this.timeline.autoRemoveChildren){ | |
this.setEnabled(false, false); | |
} else { | |
this.active = false; | |
}; | |
if (!_arg2){ | |
if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){ | |
this.vars.onComplete.apply(null, this.vars.onCompleteParams); | |
} else { | |
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){ | |
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams); | |
}; | |
}; | |
}; | |
} | |
public function invalidate():void{ | |
} | |
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ | |
this.gc = !(_arg1); | |
if (_arg1){ | |
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); | |
if (((!(_arg2)) && (this.cachedOrphan))){ | |
this.timeline.addChild(this); | |
}; | |
} else { | |
this.active = false; | |
if (((!(_arg2)) && (!(this.cachedOrphan)))){ | |
this.timeline.remove(this, true); | |
}; | |
}; | |
return (false); | |
} | |
public function kill():void{ | |
this.setEnabled(false, false); | |
} | |
protected function setDirtyCache(_arg1:Boolean=true):void{ | |
var _local2:TweenCore = (_arg1) ? this : this.timeline; | |
while (_local2) { | |
_local2.cacheIsDirty = true; | |
_local2 = _local2.timeline; | |
}; | |
} | |
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{ | |
var _local3:Number; | |
var _local4:Number; | |
if (this.timeline){ | |
_local3 = (((this._pauseTime) || ((this._pauseTime == 0)))) ? this._pauseTime : this.timeline.cachedTotalTime; | |
if (this.cachedReversed){ | |
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; | |
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale)); | |
} else { | |
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale)); | |
}; | |
if (!this.timeline.cacheIsDirty){ | |
this.setDirtyCache(false); | |
}; | |
if (this.cachedTotalTime != _arg1){ | |
this.renderTime(_arg1, _arg2, false); | |
}; | |
}; | |
} | |
public function get delay():Number{ | |
return (this._delay); | |
} | |
public function set delay(_arg1:Number):void{ | |
this.startTime = (this.startTime + (_arg1 - this._delay)); | |
this._delay = _arg1; | |
} | |
public function get duration():Number{ | |
return (this.cachedDuration); | |
} | |
public function set duration(_arg1:Number):void{ | |
this.cachedDuration = (this.cachedTotalDuration = _arg1); | |
this.setDirtyCache(false); | |
} | |
public function get totalDuration():Number{ | |
return (this.cachedTotalDuration); | |
} | |
public function set totalDuration(_arg1:Number):void{ | |
this.duration = _arg1; | |
} | |
public function get currentTime():Number{ | |
return (this.cachedTime); | |
} | |
public function set currentTime(_arg1:Number):void{ | |
this.setTotalTime(_arg1, false); | |
} | |
public function get totalTime():Number{ | |
return (this.cachedTotalTime); | |
} | |
public function set totalTime(_arg1:Number):void{ | |
this.setTotalTime(_arg1, false); | |
} | |
public function get startTime():Number{ | |
return (this.cachedStartTime); | |
} | |
public function set startTime(_arg1:Number):void{ | |
var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc))))); | |
this.cachedStartTime = _arg1; | |
if (_local2){ | |
this.timeline.addChild(this); | |
}; | |
} | |
public function get reversed():Boolean{ | |
return (this.cachedReversed); | |
} | |
public function set reversed(_arg1:Boolean):void{ | |
if (_arg1 != this.cachedReversed){ | |
this.cachedReversed = _arg1; | |
this.setTotalTime(this.cachedTotalTime, true); | |
}; | |
} | |
public function get paused():Boolean{ | |
return (this.cachedPaused); | |
} | |
public function set paused(_arg1:Boolean):void{ | |
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){ | |
if (_arg1){ | |
this._pauseTime = this.timeline.rawTime; | |
} else { | |
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - this._pauseTime)); | |
this._pauseTime = NaN; | |
this.setDirtyCache(false); | |
}; | |
this.cachedPaused = _arg1; | |
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); | |
}; | |
if (((!(_arg1)) && (this.gc))){ | |
this.setTotalTime(this.cachedTotalTime, false); | |
this.setEnabled(true, false); | |
}; | |
} | |
} | |
}//package com.greensock.core | |
package com.greensock.core { | |
public class SimpleTimeline extends TweenCore { | |
protected var _firstChild:TweenCore; | |
protected var _lastChild:TweenCore; | |
public var autoRemoveChildren:Boolean; | |
public function SimpleTimeline(_arg1:Object=null){ | |
super(0, _arg1); | |
} | |
public function addChild(_arg1:TweenCore):void{ | |
if (((!(_arg1.cachedOrphan)) && (_arg1.timeline))){ | |
_arg1.timeline.remove(_arg1, true); | |
}; | |
_arg1.timeline = this; | |
if (_arg1.gc){ | |
_arg1.setEnabled(true, true); | |
}; | |
if (this._firstChild){ | |
this._firstChild.prevNode = _arg1; | |
}; | |
_arg1.nextNode = this._firstChild; | |
this._firstChild = _arg1; | |
_arg1.prevNode = null; | |
_arg1.cachedOrphan = false; | |
} | |
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{ | |
if (_arg1.cachedOrphan){ | |
return; | |
}; | |
if (!_arg2){ | |
_arg1.setEnabled(false, true); | |
}; | |
if (_arg1.nextNode){ | |
_arg1.nextNode.prevNode = _arg1.prevNode; | |
} else { | |
if (this._lastChild == _arg1){ | |
this._lastChild = _arg1.prevNode; | |
}; | |
}; | |
if (_arg1.prevNode){ | |
_arg1.prevNode.nextNode = _arg1.nextNode; | |
} else { | |
if (this._firstChild == _arg1){ | |
this._firstChild = _arg1.nextNode; | |
}; | |
}; | |
_arg1.cachedOrphan = true; | |
} | |
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ | |
var _local5:Number; | |
var _local6:TweenCore; | |
var _local4:TweenCore = this._firstChild; | |
this.cachedTotalTime = _arg1; | |
this.cachedTime = _arg1; | |
while (_local4) { | |
_local6 = _local4.nextNode; | |
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){ | |
if (!_local4.cachedReversed){ | |
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false); | |
} else { | |
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration; | |
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false); | |
}; | |
}; | |
_local4 = _local6; | |
}; | |
} | |
public function get rawTime():Number{ | |
return (this.cachedTotalTime); | |
} | |
} | |
}//package com.greensock.core | |
package com.greensock { | |
import flash.display.*; | |
import flash.utils.*; | |
import com.greensock.core.*; | |
import flash.events.*; | |
import com.greensock.plugins.*; | |
public class TweenLite extends TweenCore { | |
public static const version:Number = 11.36; | |
public static var plugins:Object = {}; | |
public static var fastEaseLookup:Dictionary = new Dictionary(false); | |
public static var onPluginEvent:Function; | |
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; | |
public static var defaultEase:Function = TweenLite.easeOut; | |
public static var overwriteManager:Object; | |
public static var rootFrame:Number; | |
public static var rootTimeline:SimpleTimeline; | |
public static var rootFramesTimeline:SimpleTimeline; | |
public static var masterList:Dictionary = new Dictionary(false); | |
private static var _shape:Shape = new Shape(); | |
protected static var _reservedProps:Object = { | |
ease:1, | |
delay:1, | |
overwrite:1, | |
onComplete:1, | |
onCompleteParams:1, | |
useFrames:1, | |
runBackwards:1, | |
startAt:1, | |
onUpdate:1, | |
onUpdateParams:1, | |
roundProps:1, | |
onStart:1, | |
onStartParams:1, | |
onInit:1, | |
onInitParams:1, | |
onReverseComplete:1, | |
onReverseCompleteParams:1, | |
onRepeat:1, | |
onRepeatParams:1, | |
proxiedEase:1, | |
easeParams:1, | |
yoyo:1, | |
onCompleteListener:1, | |
onUpdateListener:1, | |
onStartListener:1, | |
onReverseCompleteListener:1, | |
onRepeatListener:1, | |
orientToBezier:1, | |
timeScale:1, | |
immediateRender:1, | |
repeat:1, | |
repeatDelay:1, | |
timeline:1, | |
data:1, | |
paused:1 | |
}; | |
public var target:Object; | |
public var propTweenLookup:Object; | |
public var ratio:Number = 0; | |
public var cachedPT1:PropTween; | |
protected var _ease:Function; | |
protected var _overwrite:uint; | |
protected var _overwrittenProps:Object; | |
protected var _hasPlugins:Boolean; | |
protected var _notifyPluginsOfEnabled:Boolean; | |
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){ | |
var _local5:TweenLite; | |
super(_arg2, _arg3); | |
this.target = _arg1; | |
if ((((this.target is TweenCore)) && (this.vars.timeScale))){ | |
this.cachedTimeScale = 1; | |
}; | |
this.propTweenLookup = {}; | |
this._ease = defaultEase; | |
this._overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite); | |
var _local4:Array = masterList[_arg1]; | |
if (!_local4){ | |
masterList[_arg1] = [this]; | |
} else { | |
if (this._overwrite == 1){ | |
for each (_local5 in _local4) { | |
if (!_local5.gc){ | |
_local5.setEnabled(false, false); | |
}; | |
}; | |
masterList[_arg1] = [this]; | |
} else { | |
_local4[_local4.length] = this; | |
}; | |
}; | |
if (((this.active) || (this.vars.immediateRender))){ | |
this.renderTime(0, false, true); | |
}; | |
} | |
public static function initClass():void{ | |
rootFrame = 0; | |
rootTimeline = new SimpleTimeline(null); | |
rootFramesTimeline = new SimpleTimeline(null); | |
rootTimeline.cachedStartTime = (getTimer() * 0.001); | |
rootFramesTimeline.cachedStartTime = rootFrame; | |
rootTimeline.autoRemoveChildren = true; | |
rootFramesTimeline.autoRemoveChildren = true; | |
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); | |
if (overwriteManager == null){ | |
overwriteManager = { | |
mode:1, | |
enabled:false | |
}; | |
}; | |
} | |
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ | |
return (new TweenLite(_arg1, _arg2, _arg3)); | |
} | |
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ | |
_arg3.runBackwards = true; | |
if (!("immediateRender" in _arg3)){ | |
_arg3.immediateRender = true; | |
}; | |
return (new TweenLite(_arg1, _arg2, _arg3)); | |
} | |
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{ | |
return (new TweenLite(_arg2, 0, { | |
delay:_arg1, | |
onComplete:_arg2, | |
onCompleteParams:_arg3, | |
immediateRender:false, | |
useFrames:_arg4, | |
overwrite:0 | |
})); | |
} | |
protected static function updateAll(_arg1:Event=null):void{ | |
var _local2:Dictionary; | |
var _local3:Object; | |
var _local4:Array; | |
var _local5:int; | |
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false); | |
rootFrame++; | |
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false); | |
if (!(rootFrame % 60)){ | |
_local2 = masterList; | |
for (_local3 in _local2) { | |
_local4 = _local2[_local3]; | |
_local5 = _local4.length; | |
while (--_local5 > -1) { | |
if (TweenLite(_local4[_local5]).gc){ | |
_local4.splice(_local5, 1); | |
}; | |
}; | |
if (_local4.length == 0){ | |
delete _local2[_local3]; | |
}; | |
}; | |
}; | |
} | |
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{ | |
var _local4:Array; | |
var _local5:int; | |
var _local6:TweenLite; | |
if ((_arg1 in masterList)){ | |
_local4 = masterList[_arg1]; | |
_local5 = _local4.length; | |
while (--_local5 > -1) { | |
_local6 = _local4[_local5]; | |
if (!_local6.gc){ | |
if (_arg2){ | |
_local6.complete(false, false); | |
}; | |
if (_arg3 != null){ | |
_local6.killVars(_arg3); | |
}; | |
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){ | |
_local6.setEnabled(false, false); | |
}; | |
}; | |
}; | |
if (_arg3 == null){ | |
delete masterList[_arg1]; | |
}; | |
}; | |
} | |
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ | |
_arg1 = (1 - (_arg1 / _arg4)); | |
return ((1 - (_arg1 * _arg1))); | |
} | |
protected function init():void{ | |
var _local1:String; | |
var _local2:int; | |
var _local3:*; | |
var _local4:Boolean; | |
var _local5:Array; | |
var _local6:PropTween; | |
if (this.vars.onInit){ | |
this.vars.onInit.apply(null, this.vars.onInitParams); | |
}; | |
if (typeof(this.vars.ease) == "function"){ | |
this._ease = this.vars.ease; | |
}; | |
if (this.vars.easeParams){ | |
this.vars.proxiedEase = this._ease; | |
this._ease = this.easeProxy; | |
}; | |
this.cachedPT1 = null; | |
this.propTweenLookup = {}; | |
for (_local1 in this.vars) { | |
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){ | |
} else { | |
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){ | |
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1); | |
if (this.cachedPT1.name == "_MULTIPLE_"){ | |
_local2 = _local3.overwriteProps.length; | |
while (--_local2 > -1) { | |
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1; | |
}; | |
} else { | |
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1; | |
}; | |
if (_local3.priority){ | |
this.cachedPT1.priority = _local3.priority; | |
_local4 = true; | |
}; | |
if (((_local3.onDisable) || (_local3.onEnable))){ | |
this._notifyPluginsOfEnabled = true; | |
}; | |
this._hasPlugins = true; | |
} else { | |
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1); | |
this.propTweenLookup[_local1] = this.cachedPT1; | |
}; | |
}; | |
}; | |
if (_local4){ | |
onPluginEvent("onInit", this); | |
}; | |
if (this.vars.runBackwards){ | |
_local6 = this.cachedPT1; | |
while (_local6) { | |
_local6.start = (_local6.start + _local6.change); | |
_local6.change = -(_local6.change); | |
_local6 = _local6.nextNode; | |
}; | |
}; | |
_hasUpdate = Boolean(!((this.vars.onUpdate == null))); | |
if (this._overwrittenProps){ | |
this.killVars(this._overwrittenProps); | |
if (this.cachedPT1 == null){ | |
this.setEnabled(false, false); | |
}; | |
}; | |
if ((((((((this._overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){ | |
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, this._overwrite)){ | |
this.init(); | |
}; | |
}; | |
this.initted = true; | |
} | |
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ | |
var _local4:Boolean; | |
var _local5:Number = this.cachedTime; | |
if (_arg1 >= this.cachedDuration){ | |
this.cachedTotalTime = (this.cachedTime = this.cachedDuration); | |
this.ratio = 1; | |
_local4 = true; | |
if (this.cachedDuration == 0){ | |
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){ | |
_arg3 = true; | |
}; | |
_rawPrevTime = _arg1; | |
}; | |
} else { | |
if (_arg1 <= 0){ | |
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); | |
if (_arg1 < 0){ | |
this.active = false; | |
if (this.cachedDuration == 0){ | |
if (_rawPrevTime > 0){ | |
_arg3 = true; | |
_local4 = true; | |
}; | |
_rawPrevTime = _arg1; | |
}; | |
}; | |
if (((this.cachedReversed) && (!((_local5 == 0))))){ | |
_local4 = true; | |
}; | |
} else { | |
this.cachedTotalTime = (this.cachedTime = _arg1); | |
this.ratio = this._ease(_arg1, 0, 1, this.cachedDuration); | |
}; | |
}; | |
if ((((this.cachedTime == _local5)) && (!(_arg3)))){ | |
return; | |
}; | |
if (!this.initted){ | |
this.init(); | |
if (((!(_local4)) && (this.cachedTime))){ | |
this.ratio = this._ease(this.cachedTime, 0, 1, this.cachedDuration); | |
}; | |
}; | |
if (((!(this.active)) && (!(this.cachedPaused)))){ | |
this.active = true; | |
}; | |
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){ | |
this.vars.onStart.apply(null, this.vars.onStartParams); | |
}; | |
var _local6:PropTween = this.cachedPT1; | |
while (_local6) { | |
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change)); | |
_local6 = _local6.nextNode; | |
}; | |
if (((_hasUpdate) && (!(_arg2)))){ | |
this.vars.onUpdate.apply(null, this.vars.onUpdateParams); | |
}; | |
if (_local4){ | |
if (((this._hasPlugins) && (this.cachedPT1))){ | |
onPluginEvent("onComplete", this); | |
}; | |
complete(true, _arg2); | |
}; | |
} | |
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{ | |
var _local3:String; | |
var _local4:PropTween; | |
var _local5:Boolean; | |
if (this._overwrittenProps == null){ | |
this._overwrittenProps = {}; | |
}; | |
for (_local3 in _arg1) { | |
if ((_local3 in this.propTweenLookup)){ | |
_local4 = this.propTweenLookup[_local3]; | |
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){ | |
_local4.target.killProps(_arg1); | |
if (_local4.target.overwriteProps.length == 0){ | |
_local4.name = ""; | |
}; | |
}; | |
if (_local4.name != "_MULTIPLE_"){ | |
if (_local4.nextNode){ | |
_local4.nextNode.prevNode = _local4.prevNode; | |
}; | |
if (_local4.prevNode){ | |
_local4.prevNode.nextNode = _local4.nextNode; | |
} else { | |
if (this.cachedPT1 == _local4){ | |
this.cachedPT1 = _local4.nextNode; | |
}; | |
}; | |
if (((_local4.isPlugin) && (_local4.target.onDisable))){ | |
_local4.target.onDisable(); | |
if (_local4.target.activeDisable){ | |
_local5 = true; | |
}; | |
}; | |
delete this.propTweenLookup[_local3]; | |
}; | |
}; | |
if (((_arg2) && (!((_arg1 == this._overwrittenProps))))){ | |
this._overwrittenProps[_local3] = 1; | |
}; | |
}; | |
return (_local5); | |
} | |
override public function invalidate():void{ | |
if (((this._notifyPluginsOfEnabled) && (this.cachedPT1))){ | |
onPluginEvent("onDisable", this); | |
}; | |
this.cachedPT1 = null; | |
this._overwrittenProps = null; | |
_hasUpdate = (this.initted = (this.active = (this._notifyPluginsOfEnabled = false))); | |
this.propTweenLookup = {}; | |
} | |
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ | |
var _local3:Array; | |
if (_arg1){ | |
_local3 = TweenLite.masterList[this.target]; | |
if (!_local3){ | |
TweenLite.masterList[this.target] = [this]; | |
} else { | |
_local3[_local3.length] = this; | |
}; | |
}; | |
super.setEnabled(_arg1, _arg2); | |
if (((this._notifyPluginsOfEnabled) && (this.cachedPT1))){ | |
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this)); | |
}; | |
return (false); | |
} | |
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ | |
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); | |
} | |
} | |
}//package com.greensock | |
package com.greensock.transform { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.utils.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.greensock.events.*; | |
import com.greensock.transform.utils.*; | |
public class TransformItem extends EventDispatcher { | |
public static const VERSION:Number = 1.9667; | |
protected static const _DEG2RAD:Number = 0.0174532925199433; | |
protected static const _RAD2DEG:Number = 57.2957795130823; | |
protected static var _proxyCount:uint = 0; | |
protected static var _normalMatrix:Matrix = new Matrix(); | |
protected var _hasSelectableText:Boolean; | |
protected var _stage:Stage; | |
protected var _scaleMode:String; | |
protected var _target:DisplayObject; | |
protected var _proxy:InteractiveObject; | |
protected var _offset:Point; | |
protected var _origin:Point; | |
protected var _localOrigin:Point; | |
protected var _baseRect:Rectangle; | |
protected var _bounds:Rectangle; | |
protected var _targetObject:DisplayObject; | |
protected var _allowDelete:Boolean; | |
protected var _constrainScale:Boolean; | |
protected var _constrainRatio:Number; | |
protected var _lockScale:Boolean; | |
protected var _lockRotation:Boolean; | |
protected var _lockPosition:Boolean; | |
protected var _enabled:Boolean; | |
protected var _selected:Boolean; | |
protected var _minScaleX:Number; | |
protected var _minScaleY:Number; | |
protected var _maxScaleX:Number; | |
protected var _maxScaleY:Number; | |
protected var _minWidth:Number; | |
protected var _minHeight:Number; | |
protected var _maxWidth:Number; | |
protected var _maxHeight:Number; | |
protected var _cornerAngleTL:Number; | |
protected var _cornerAngleTR:Number; | |
protected var _cornerAngleBR:Number; | |
protected var _cornerAngleBL:Number; | |
protected var _createdManager:TransformManager; | |
protected var _isFlex:Boolean; | |
protected var _frameCount:uint = 0; | |
protected var _dispatchScaleEvents:Boolean; | |
protected var _dispatchMoveEvents:Boolean; | |
protected var _dispatchRotateEvents:Boolean; | |
protected var _flipX:Boolean; | |
protected var _unselectedOrigin:Point; | |
protected var _manager:TransformManager; | |
public var manualBoundsOffset:Rectangle; | |
protected var _vars:Object; | |
public function TransformItem(_arg1:DisplayObject, _arg2:Object){ | |
if (TransformManager.VERSION < 1.96){ | |
}; | |
this.init(_arg1, _arg2); | |
} | |
protected static function setDefault(_arg1, _arg2){ | |
if (_arg1 == undefined){ | |
return (_arg2); | |
}; | |
return (_arg1); | |
} | |
protected function init(_arg1:DisplayObject, _arg2:Object):void{ | |
this._vars = ((_arg2) || ({})); | |
this._targetObject = (this._target = _arg1); | |
this._determineFlexMode(); | |
this._flipX = Boolean((this._targetObject.scaleX < 0)); | |
if ((this._vars.manualBoundsOffset is Rectangle)){ | |
this.manualBoundsOffset = this._vars.manualBoundsOffset; | |
}; | |
this._baseRect = this.getBounds(this._targetObject, this._targetObject); | |
this._allowDelete = setDefault(this._vars.allowDelete, false); | |
this.constrainScale = setDefault(this._vars.constrainScale, false); | |
this._lockScale = setDefault(this._vars.lockScale, false); | |
this._lockRotation = setDefault(this._vars.lockRotation, false); | |
this._lockPosition = setDefault(this._vars.lockPosition, false); | |
this._hasSelectableText = setDefault(this._vars.hasSelectableText, ((this._targetObject is TextField)) ? true : false); | |
this.scaleMode = setDefault(this._vars.scaleMode, (this._hasSelectableText) ? TransformManager.SCALE_WIDTH_AND_HEIGHT : TransformManager.SCALE_NORMAL); | |
this.minScaleX = setDefault(this._vars.minScaleX, -(Infinity)); | |
this.minScaleY = setDefault(this._vars.minScaleY, -(Infinity)); | |
this.maxScaleX = setDefault(this._vars.maxScaleX, Infinity); | |
this.maxScaleY = setDefault(this._vars.maxScaleY, Infinity); | |
this.minWidth = setDefault(this._vars.minWidth, 1); | |
this.minHeight = setDefault(this._vars.minHeight, 1); | |
this.maxWidth = setDefault(this._vars.maxWidth, Infinity); | |
this.maxHeight = setDefault(this._vars.maxScaleY, Infinity); | |
this.origin = (this._unselectedOrigin = new Point(this._targetObject.x, this._targetObject.y)); | |
if (this._vars.manager == undefined){ | |
this._vars.items = [this]; | |
this._manager = (this._createdManager = new TransformManager(this._vars)); | |
} else { | |
this._manager = this._vars.manager; | |
}; | |
if (this._targetObject.stage != null){ | |
this._stage = this._targetObject.stage; | |
} else { | |
this._targetObject.addEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage, false, 0, true); | |
}; | |
this._selected = false; | |
this.bounds = this._vars.bounds; | |
this._enabled = !(Boolean(this._vars.enabled)); | |
this.enabled = !(this._enabled); | |
} | |
protected function onAddedToStage(_arg1:Event):void{ | |
this._stage = this.targetObject.stage; | |
this._determineFlexMode(); | |
if (this._proxy != null){ | |
if (((((this._isFlex) && (this._targetObject.parent.hasOwnProperty("addElement")))) && (this._proxy.hasOwnProperty("postLayoutTransformOffsets")))){ | |
(this._targetObject.parent as Object).addElement(this._proxy); | |
} else { | |
this._targetObject.parent.addChild(this._proxy); | |
}; | |
}; | |
this._targetObject.removeEventListener(Event.ADDED_TO_STAGE, this.onAddedToStage); | |
} | |
protected function _determineFlexMode():void{ | |
if (("flexMode" in this._vars)){ | |
this._isFlex = Boolean(this._vars.flexMode); | |
} else { | |
try { | |
this._isFlex = Boolean(getDefinitionByName("mx.managers.SystemManager")); | |
} catch($e:Error) { | |
_isFlex = false; | |
}; | |
if (((this._isFlex) && (!((this._targetObject.parent is (getDefinitionByName("mx.core.UIComponent") as Class)))))){ | |
this._isFlex = false; | |
}; | |
}; | |
} | |
protected function onMouseDown(_arg1:MouseEvent):void{ | |
if (this._hasSelectableText){ | |
dispatchEvent(new TransformEvent(TransformEvent.MOUSE_DOWN, [this])); | |
} else { | |
this._stage = this._targetObject.stage; | |
this._stage.addEventListener(MouseEvent.MOUSE_UP, this.onMouseUp); | |
dispatchEvent(new TransformEvent(TransformEvent.MOUSE_DOWN, [this], _arg1)); | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.SELECT_MOUSE_DOWN, [this], _arg1)); | |
}; | |
}; | |
} | |
protected function onMouseUp(_arg1:MouseEvent):void{ | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onMouseUp); | |
if (((!(this._hasSelectableText)) && (this._selected))){ | |
dispatchEvent(new TransformEvent(TransformEvent.SELECT_MOUSE_UP, [this], _arg1)); | |
}; | |
} | |
protected function onRollOverItem(_arg1:MouseEvent):void{ | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.ROLL_OVER_SELECTED, [this], _arg1)); | |
}; | |
} | |
protected function onRollOutItem(_arg1:MouseEvent):void{ | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.ROLL_OUT_SELECTED, [this], _arg1)); | |
}; | |
} | |
public function update(_arg1:Event=null):void{ | |
this._baseRect = this.getBounds(this._targetObject, this._targetObject); | |
if (this._targetObject.scaleX < 0){ | |
this._flipX = true; | |
}; | |
this.setCornerAngles(); | |
if (this._proxy != null){ | |
this.calibrateProxy(); | |
}; | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
} | |
protected function getBounds(_arg1:DisplayObject, _arg2:DisplayObject):Rectangle{ | |
var _local3:Matrix; | |
var _local4:Rectangle; | |
var _local5:Shape; | |
var _local6:Sprite; | |
if (this.manualBoundsOffset != null){ | |
_local3 = this._target.transform.matrix; | |
if ((((_arg1 == this._target)) || ((_arg1 == this._targetObject)))){ | |
if (_arg2 == _arg1){ | |
_arg1.transform.matrix = _normalMatrix; | |
_local4 = new Rectangle(this.manualBoundsOffset.x, this.manualBoundsOffset.y, (_arg1.width + this.manualBoundsOffset.width), (_arg1.height + this.manualBoundsOffset.height)); | |
_arg1.transform.matrix = _local3; | |
return (_local4); | |
}; | |
if (_arg2 == this._targetObject.parent){ | |
this._baseRect = this.getBounds(_arg1, _arg1); | |
_local5 = new Shape(); | |
_local5.graphics.beginFill(0, 1); | |
_local5.graphics.drawRect(this._baseRect.x, this._baseRect.y, this._baseRect.width, this._baseRect.height); | |
_local5.graphics.endFill(); | |
_local5.transform.matrix = _local3; | |
_local6 = new Sprite(); | |
_local6.addChild(_local5); | |
return (_local5.getBounds(_local6)); | |
}; | |
}; | |
}; | |
return (_arg1.getBounds(_arg2)); | |
} | |
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ | |
if (_arg1 == TransformEvent.MOVE){ | |
this._dispatchMoveEvents = true; | |
} else { | |
if (_arg1 == TransformEvent.SCALE){ | |
this._dispatchScaleEvents = true; | |
} else { | |
if (_arg1 == TransformEvent.ROTATE){ | |
this._dispatchRotateEvents = true; | |
}; | |
}; | |
}; | |
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); | |
} | |
protected function autoCalibrateProxy(_arg1:Event=null):void{ | |
if (this._frameCount >= 3){ | |
this._targetObject.removeEventListener(Event.ENTER_FRAME, this.autoCalibrateProxy); | |
if (this._targetObject.parent){ | |
if (((((this._isFlex) && (this._targetObject.parent.hasOwnProperty("addElement")))) && (this._proxy.hasOwnProperty("postLayoutTransformOffsets")))){ | |
(this._targetObject.parent as Object).addElement(this._proxy); | |
} else { | |
this._targetObject.parent.addChild(this._proxy); | |
}; | |
}; | |
this._target = this._proxy; | |
this.calibrateProxy(); | |
this._frameCount = 0; | |
} else { | |
this._frameCount++; | |
}; | |
} | |
protected function createProxy():void{ | |
var tf:* = null; | |
var isEmpty:* = false; | |
var format:* = null; | |
var altFormat:* = null; | |
var metrics:* = null; | |
this.removeProxy(); | |
this._proxy = (this._isFlex) ? new (getDefinitionByName("mx.core.UIComponent")) : new Sprite(); | |
_proxyCount++; | |
this._proxy.name = ("__tmProxy" + _proxyCount); | |
this._proxy.visible = false; | |
try { | |
this._target = this._proxy; | |
if (((this._targetObject.parent.hasOwnProperty("addElement")) && (this._proxy.hasOwnProperty("postLayoutTransformOffsets")))){ | |
(this._targetObject.parent as Object).addElement(this._proxy); | |
} else { | |
this._targetObject.parent.addChild(this._proxy); | |
}; | |
} catch($e:Error) { | |
_target = _targetObject; | |
_targetObject.addEventListener(Event.ENTER_FRAME, autoCalibrateProxy); | |
}; | |
this._offset = new Point(0, 0); | |
if ((this._targetObject is TextField)){ | |
tf = (this._targetObject as TextField); | |
isEmpty = false; | |
if (tf.text == ""){ | |
tf.text = "Y"; | |
isEmpty = true; | |
}; | |
format = tf.getTextFormat(0, 1); | |
altFormat = tf.getTextFormat(0, 1); | |
altFormat.align = "left"; | |
tf.setTextFormat(altFormat, 0, 1); | |
metrics = tf.getLineMetrics(0); | |
if (metrics.x == 0){ | |
this._offset = new Point(-2, -2); | |
}; | |
tf.setTextFormat(format, 0, 1); | |
if (isEmpty){ | |
tf.text = ""; | |
}; | |
}; | |
this.calibrateProxy(); | |
} | |
protected function removeProxy():void{ | |
if (this._proxy != null){ | |
if (this._proxy.parent != null){ | |
if (((((this._isFlex) && (this._proxy.parent.hasOwnProperty("removeElement")))) && (this._proxy.hasOwnProperty("postLayoutTransformOffsets")))){ | |
(this._proxy.parent as Object).removeElement(this._proxy); | |
} else { | |
this._proxy.parent.removeChild(this._proxy); | |
}; | |
}; | |
this._proxy = null; | |
}; | |
this._target = this._targetObject; | |
} | |
protected function calibrateProxy():void{ | |
var _local1:Matrix = this._targetObject.transform.matrix; | |
this._targetObject.transform.matrix = _normalMatrix; | |
var _local2:Rectangle = this.getBounds(this._targetObject, this._targetObject); | |
var _local3:Graphics = (this._proxy as Sprite).graphics; | |
_local3.clear(); | |
if (((!((this._targetObject.width == 0))) && (!((this._targetObject.height == 0))))){ | |
_local3.beginFill(0xFF0000, 0); | |
_local3.drawRect(_local2.x, _local2.y, this._targetObject.width, this._targetObject.height); | |
_local3.endFill(); | |
}; | |
this._proxy.scaleX = this._targetObject.scaleX; | |
this._proxy.scaleY = this._targetObject.scaleY; | |
this._proxy.width = (this._baseRect.width = this._targetObject.width); | |
this._proxy.height = (this._baseRect.height = this._targetObject.height); | |
this._proxy.transform.matrix = (this._targetObject.transform.matrix = _local1); | |
} | |
protected function setCornerAngles():void{ | |
if (this._bounds != null){ | |
this._cornerAngleTL = TransformManager.positiveAngle(Math.atan2((this._bounds.y - this._origin.y), (this._bounds.x - this._origin.x))); | |
this._cornerAngleTR = TransformManager.positiveAngle(Math.atan2((this._bounds.y - this._origin.y), (this._bounds.right - this._origin.x))); | |
this._cornerAngleBR = TransformManager.positiveAngle(Math.atan2((this._bounds.bottom - this._origin.y), (this._bounds.right - this._origin.x))); | |
this._cornerAngleBL = TransformManager.positiveAngle(Math.atan2((this._bounds.bottom - this._origin.y), (this._bounds.x - this._origin.x))); | |
}; | |
} | |
protected function reposition(_arg1:Boolean=false):void{ | |
var _local2:Point = this._target.parent.globalToLocal(this._target.localToGlobal(this._localOrigin)); | |
this._target.x = (this._target.x + (this._origin.x - _local2.x)); | |
this._target.y = (this._target.y + (this._origin.y - _local2.y)); | |
if (((!(_arg1)) && ((this._target == this._proxy)))){ | |
_local2 = this._proxy.parent.globalToLocal(this._proxy.localToGlobal(this._offset)); | |
this._targetObject.x = _local2.x; | |
this._targetObject.y = _local2.y; | |
}; | |
} | |
public function onPressDelete(_arg1:Event=null, _arg2:Boolean=false):Boolean{ | |
if (((((this._enabled) && (this._allowDelete))) && ((((this._hasSelectableText == false)) || (_arg2))))){ | |
this.deleteObject(); | |
return (true); | |
}; | |
return (false); | |
} | |
public function deleteObject():void{ | |
this.selected = false; | |
if (this._targetObject.parent){ | |
if (((this._isFlex) && (this._targetObject.parent.hasOwnProperty("removeElement")))){ | |
(this._targetObject.parent as Object).removeElement(this._targetObject); | |
} else { | |
this._targetObject.parent.removeChild(this._targetObject); | |
}; | |
}; | |
this.removeProxy(); | |
dispatchEvent(new TransformEvent(TransformEvent.DELETE, [this])); | |
} | |
public function destroy():void{ | |
this.enabled = false; | |
this.selected = false; | |
dispatchEvent(new TransformEvent(TransformEvent.DESTROY, [this])); | |
} | |
public function move(_arg1:Number, _arg2:Number, _arg3:Boolean=true, _arg4:Boolean=true):void{ | |
var _local5:Object; | |
if (!this._lockPosition){ | |
if (((_arg3) && (!((this._bounds == null))))){ | |
_local5 = { | |
x:_arg1, | |
y:_arg2 | |
}; | |
this.moveCheck(_arg1, _arg2, _local5); | |
_arg1 = _local5.x; | |
_arg2 = _local5.y; | |
}; | |
this._target.x = (this._target.x + _arg1); | |
this._target.y = (this._target.y + _arg2); | |
this._origin.x = (this._origin.x + _arg1); | |
this._origin.y = (this._origin.y + _arg2); | |
if (this._target != this._targetObject){ | |
this._targetObject.x = (this._targetObject.x + _arg1); | |
this._targetObject.y = (this._targetObject.y + _arg2); | |
}; | |
if (((((_arg4) && (this._dispatchMoveEvents))) && (((!((_arg1 == 0))) || (!((_arg2 == 0))))))){ | |
dispatchEvent(new TransformEvent(TransformEvent.MOVE, [this])); | |
}; | |
}; | |
} | |
public function moveCheck(_arg1:Number, _arg2:Number, _arg3:Object):void{ | |
var _local4:Rectangle; | |
if (this._lockPosition){ | |
_arg3.x = (_arg3.y = 0); | |
} else { | |
if (this._bounds != null){ | |
_local4 = this.getBounds(this._target, this._targetObject.parent); | |
_local4.offset(_arg1, _arg2); | |
if (!this._bounds.containsRect(_local4)){ | |
if (this._bounds.right < _local4.right){ | |
_arg1 = (_arg1 + (this._bounds.right - _local4.right)); | |
_arg3.x = int(Math.min(_arg3.x, _arg1)); | |
} else { | |
if (this._bounds.left > _local4.left){ | |
_arg1 = (_arg1 + (this._bounds.left - _local4.left)); | |
_arg3.x = int((Math.max(_arg3.x, _arg1) + 0.5)); | |
}; | |
}; | |
if (this._bounds.top > _local4.top){ | |
_arg2 = (_arg2 + (this._bounds.top - _local4.top)); | |
_arg3.y = int((Math.max(_arg3.y, _arg2) + 0.5)); | |
} else { | |
if (this._bounds.bottom < _local4.bottom){ | |
_arg2 = (_arg2 + (this._bounds.bottom - _local4.bottom)); | |
_arg3.y = int(Math.min(_arg3.y, _arg2)); | |
}; | |
}; | |
}; | |
}; | |
}; | |
} | |
public function scale(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Boolean=true, _arg5:Boolean=true):void{ | |
if (!this._lockScale){ | |
this.scaleRotated(_arg1, _arg2, _arg3, -(_arg3), _arg4, _arg5); | |
}; | |
} | |
public function scaleRotated(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean=true, _arg6:Boolean=true):void{ | |
var _local7:Matrix; | |
var _local8:Object; | |
var _local9:Number; | |
var _local10:Number; | |
var _local11:Point; | |
if (!this._lockScale){ | |
_local7 = this._target.transform.matrix; | |
if (((!((_arg3 == -(_arg4)))) && ((Math.abs(((_arg3 + _arg4) % (Math.PI - 0.01))) < 0.01)))){ | |
_arg4 = -(_arg3); | |
}; | |
if (((_arg5) && (!((this._bounds == null))))){ | |
_local8 = { | |
sx:_arg1, | |
sy:_arg2 | |
}; | |
this.scaleCheck(_local8, _arg3, _arg4, this._constrainScale); | |
_arg1 = _local8.sx; | |
_arg2 = _local8.sy; | |
}; | |
MatrixTools.scaleMatrix(_local7, _arg1, _arg2, _arg3, _arg4); | |
if (_arg1 < 0){ | |
this._flipX = !(this._flipX); | |
}; | |
this._target.transform.matrix = _local7; | |
this.reposition(false); | |
if (this._scaleMode != "scaleNormal"){ | |
_local9 = (Math.sqrt(((_local7.a * _local7.a) + (_local7.b * _local7.b))) * this._baseRect.width); | |
_local10 = (Math.sqrt(((_local7.d * _local7.d) + (_local7.c * _local7.c))) * this._baseRect.height); | |
if ((this._targetObject is TextField)){ | |
_local9 = (_local9 / this._targetObject.scaleX); | |
_local10 = (_local10 / this._targetObject.scaleY); | |
}; | |
_local11 = this._targetObject.parent.globalToLocal(this._proxy.localToGlobal(this._offset)); | |
this._targetObject.width = _local9; | |
this._targetObject.height = _local10; | |
this._targetObject.rotation = this._proxy.rotation; | |
this._targetObject.x = _local11.x; | |
this._targetObject.y = _local11.y; | |
}; | |
if (((((_arg6) && (this._dispatchScaleEvents))) && (((!((_arg1 == 1))) || (!((_arg2 == 1))))))){ | |
dispatchEvent(new TransformEvent(TransformEvent.SCALE, [this])); | |
}; | |
}; | |
} | |
public function scaleCheck(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{ | |
var _local5:Number; | |
var _local6:Number; | |
var _local7:Matrix; | |
var _local8:Number; | |
var _local9:Number; | |
var _local10:Number; | |
var _local11:Matrix; | |
var _local12:Number; | |
var _local13:Number; | |
var _local14:Boolean; | |
var _local15:Rectangle; | |
var _local16:Number; | |
var _local17:Boolean; | |
var _local18:Number; | |
var _local19:Number; | |
var _local20:Number; | |
var _local21:Number; | |
var _local22:Number; | |
var _local23:Number; | |
var _local24:Number; | |
var _local25:Number; | |
var _local26:Boolean; | |
var _local27:int; | |
var _local28:Point; | |
var _local29:Number; | |
var _local30:Number; | |
var _local31:Number; | |
var _local32:Number; | |
var _local33:Number; | |
var _local34:Number; | |
var _local35:Rectangle; | |
var _local36:Array; | |
if (this._lockScale){ | |
_arg1.sx = (_arg1.sy = 1); | |
} else { | |
_local7 = this._target.transform.matrix; | |
_local8 = MatrixTools.getScaleX(_local7, this._flipX); | |
_local9 = MatrixTools.getScaleY(_local7, this._flipX); | |
_local10 = MatrixTools.getAngle(_local7, this._flipX); | |
_local11 = _local7.clone(); | |
_local12 = 0; | |
_local13 = 0; | |
_local14 = Boolean(!((this._flipX == (_arg1.sx < 0)))); | |
MatrixTools.scaleMatrix(_local11, _arg1.sx, _arg1.sy, _arg2, _arg3); | |
if (this.hasSizeLimits){ | |
_local5 = MatrixTools.getScaleX(_local11, _local14); | |
_local6 = MatrixTools.getScaleY(_local11, _local14); | |
_local15 = this.getBounds(this._target, this._target); | |
_local16 = (_arg3 - MatrixTools.getSkew(_local7)); | |
_local17 = Boolean((((_local16 < -0.0001)) || ((_local16 > 0.0001)))); | |
_local18 = (this._maxWidth / _local15.width); | |
_local19 = -(_local18); | |
if (this._minScaleX > _local19){ | |
_local19 = this._minScaleX; | |
}; | |
if (this._maxScaleX < _local18){ | |
_local18 = this._maxScaleX; | |
}; | |
_local20 = (this._minWidth / _local15.width); | |
_local21 = -(_local20); | |
if ((((_local19 > _local21)) && ((_local19 < _local20)))){ | |
_local19 = _local20; | |
}; | |
if ((((_local18 < _local20)) && ((_local18 > _local21)))){ | |
_local18 = _local21; | |
}; | |
_local22 = (this._maxHeight / _local15.height); | |
_local23 = -(_local22); | |
if (this._minScaleY > _local23){ | |
_local23 = this._minScaleY; | |
}; | |
if (this._maxScaleY < _local22){ | |
_local22 = this._maxScaleY; | |
}; | |
_local24 = (this._minHeight / _local15.height); | |
_local25 = -(_local24); | |
if ((((_local23 > _local25)) && ((_local23 < _local24)))){ | |
_local23 = _local24; | |
}; | |
if ((((_local22 < _local24)) && ((_local22 > _local25)))){ | |
_local22 = _local25; | |
}; | |
_local12 = (Math.max(Math.abs(_local21), Math.abs(_local20)) / _local8); | |
_local13 = (Math.max(Math.abs(_local25), Math.abs(_local24)) / _local9); | |
_local26 = false; | |
if (_local5 < _local19){ | |
_arg1.sx = (_local19 / _local8); | |
_local26 = true; | |
} else { | |
if (_local5 > _local18){ | |
_arg1.sx = (_local18 / _local8); | |
_local26 = true; | |
} else { | |
if ((((_local5 < _local20)) && ((_local5 > _local21)))){ | |
_arg1.sx = ((_local8)>_local20) ? Math.abs((_local20 / _local8)) : Math.abs((_local21 / _local8)); | |
_local26 = true; | |
}; | |
}; | |
}; | |
if (_local6 < _local23){ | |
_arg1.sy = (_local23 / _local9); | |
_local26 = true; | |
} else { | |
if (_local6 > _local22){ | |
_arg1.sy = (_local22 / _local9); | |
_local26 = true; | |
} else { | |
if ((((_local6 < _local24)) && ((_local6 > _local25)))){ | |
_arg1.sy = ((_local9)>_local24) ? Math.abs((_local24 / _local9)) : Math.abs((_local25 / _local9)); | |
_local26 = true; | |
}; | |
}; | |
}; | |
if (((_local26) && (((_local17) || (_arg4))))){ | |
_arg1.sx = (_arg1.sy = 1); | |
} else { | |
if (this._constrainScale){ | |
if (Math.abs((_arg1.sx - 1)) < Math.abs((_arg1.sy - 1))){ | |
_arg1.sy = _arg1.sx; | |
} else { | |
_arg1.sx = _arg1.sy; | |
}; | |
}; | |
}; | |
_local11 = _local7.clone(); | |
MatrixTools.scaleMatrix(_local11, _arg1.sx, _arg1.sy, _arg2, _arg3); | |
_local14 = Boolean(!((this._flipX == (_arg1.sx < 0)))); | |
}; | |
this._target.transform.matrix = _local11; | |
this.reposition(true); | |
if (this._bounds != null){ | |
if (!this._bounds.containsRect(this.getBounds(this._target, this._targetObject.parent))){ | |
if (_arg1.sy == 1){ | |
this._target.transform.matrix = _local7; | |
this.iterateStretchX(_arg1, _arg2, _arg3, _local12); | |
} else { | |
if (_arg1.sx == 1){ | |
this._target.transform.matrix = _local7; | |
this.iterateStretchY(_arg1, _arg2, _arg3, _local13); | |
} else { | |
_local34 = 1; | |
_local35 = this.getBounds(this._target, this._target); | |
_local36 = [new Point(_local35.x, _local35.y), new Point(_local35.right, _local35.y), new Point(_local35.right, _local35.bottom), new Point(_local35.x, _local35.bottom)]; | |
_local27 = (_local36.length - 1); | |
while (_local27 > -1) { | |
_local28 = this._target.parent.globalToLocal(this._target.localToGlobal(_local36[_local27])); | |
if (!(((Math.abs((_local28.x - this._origin.x)) < 1)) && ((Math.abs((_local28.y - this._origin.y)) < 1)))){ | |
_local29 = TransformManager.positiveAngle(Math.atan2((_local28.y - this._origin.y), (_local28.x - this._origin.x))); | |
_local32 = (this._origin.x - _local28.x); | |
_local33 = (this._origin.y - _local28.y); | |
_local30 = Math.sqrt(((_local32 * _local32) + (_local33 * _local33))); | |
if ((((_local29 < this._cornerAngleBR)) || ((((_local29 > this._cornerAngleTR)) && (!((this._cornerAngleTR == 0))))))){ | |
_local32 = (this._bounds.right - this._origin.x); | |
_local31 = ((((_local32 < 1)) && (((((this._cornerAngleBR - _local29) < 0.01)) || (((_local29 - this._cornerAngleTR) < 0.01)))))) ? 0 : (_local32 / Math.cos(_local29)); | |
} else { | |
if (_local29 <= this._cornerAngleBL){ | |
_local33 = (this._bounds.bottom - this._origin.y); | |
_local31 = (((this._cornerAngleBL - _local29))<0.01) ? 0 : (_local33 / Math.sin(_local29)); | |
} else { | |
if (_local29 < this._cornerAngleTL){ | |
_local32 = (this._origin.x - this._bounds.x); | |
_local31 = (_local32 / Math.cos(_local29)); | |
} else { | |
_local33 = (this._origin.y - this._bounds.y); | |
_local31 = (_local33 / Math.sin(_local29)); | |
}; | |
}; | |
}; | |
if (_local31 != 0){ | |
_local34 = Math.min(_local34, (Math.abs(_local31) / _local30)); | |
}; | |
}; | |
_local27--; | |
}; | |
_local11 = this._target.transform.matrix; | |
if ((((((_local34 == 1)) || ((((_arg1.sx < 0)) && ((((this._origin.x == this._bounds.x)) || ((this._origin.x == this._bounds.right)))))))) || ((((_arg1.sy < 0)) && ((((this._origin.y == this._bounds.y)) || ((this._origin.y == this._bounds.bottom)))))))){ | |
_arg1.sx = 1; | |
_arg1.sy = 1; | |
} else { | |
_arg1.sx = ((MatrixTools.getScaleX(_local11, _local14) * _local34) / MatrixTools.getScaleX(_local7, this._flipX)); | |
_arg1.sy = ((MatrixTools.getScaleY(_local11, _local14) * _local34) / MatrixTools.getScaleY(_local7, this._flipX)); | |
if ((((((int(_arg1.sx) == 0)) && ((Math.abs(_arg1.sx) < _local12)))) || ((((int(_arg1.sy) == 0)) && ((Math.abs(_arg1.sy) < _local13)))))){ | |
_arg1.sx = (_arg1.sy = 1); | |
}; | |
}; | |
}; | |
}; | |
}; | |
}; | |
this._target.transform.matrix = _local7; | |
}; | |
} | |
protected function iterateStretchX(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Number):void{ | |
var _local5:Matrix; | |
var _local6:uint; | |
var _local7:uint; | |
var _local8:Number; | |
var _local9:Matrix; | |
var _local10:Number; | |
if (this._lockScale){ | |
_arg1.sx = (_arg1.sy = 1); | |
} else { | |
if (((!((this._bounds == null))) && (!((_arg1.sx == 1))))){ | |
if ((((_arg1.sx < 1)) && ((_arg1.sx > 0)))){ | |
return; | |
}; | |
_local5 = this._target.transform.matrix; | |
_local9 = _local5.clone(); | |
_local10 = ((_arg1.sx)<1) ? -0.01 : 0.01; | |
if (_arg1.sx > 0){ | |
_local8 = 1; | |
_local7 = (Math.abs(((_arg1.sx - _local8) / _local10)) + 1); | |
} else { | |
_local8 = -(_arg4); | |
_local7 = (((_arg1.sx - _local8) / _local10) + 1); | |
if (_local8 != 0){ | |
MatrixTools.scaleMatrix(_local9, _local8, 1, _arg2, _arg3); | |
this._target.transform.matrix = _local9; | |
this.reposition(true); | |
if (!this._bounds.containsRect(this.getBounds(this._target, this._targetObject.parent))){ | |
_arg1.sx = 1; | |
return; | |
}; | |
}; | |
}; | |
_local6 = 1; | |
while (_local6 <= _local7) { | |
_local9.a = _local5.a; | |
_local9.b = _local5.b; | |
_local9.c = _local5.c; | |
_local9.d = _local5.d; | |
MatrixTools.scaleMatrix(_local9, (_local8 + (_local6 * _local10)), 1, _arg2, _arg3); | |
this._target.transform.matrix = _local9; | |
this.reposition(true); | |
if (!this._bounds.containsRect(this.getBounds(this._target, this._targetObject.parent))){ | |
_arg1.sx = (_local8 + ((_local6 - 1) * _local10)); | |
break; | |
}; | |
_local6++; | |
}; | |
}; | |
}; | |
} | |
protected function iterateStretchY(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Number):void{ | |
var _local5:Matrix; | |
var _local6:uint; | |
var _local7:uint; | |
var _local8:Number; | |
var _local9:Matrix; | |
var _local10:Number; | |
if (this._lockScale){ | |
_arg1.sx = (_arg1.sy = 1); | |
} else { | |
if (((!((this._bounds == null))) && (!((_arg1.sy == 1))))){ | |
if ((((_arg1.sy < 1)) && ((_arg1.sy > 0)))){ | |
return; | |
}; | |
_local5 = this._target.transform.matrix; | |
_local9 = _local5.clone(); | |
_local10 = ((_arg1.sy)<1) ? -0.01 : 0.01; | |
if (_arg1.sy > 0){ | |
_local8 = 1; | |
_local7 = (Math.abs(((_arg1.sy - _local8) / _local10)) + 1); | |
} else { | |
_local8 = -(_arg4); | |
_local7 = (((_arg1.sy - _local8) / _local10) + 1); | |
if (_local8 != 0){ | |
MatrixTools.scaleMatrix(_local9, 1, _local8, _arg2, _arg3); | |
this._target.transform.matrix = _local9; | |
this.reposition(true); | |
if (!this._bounds.containsRect(this.getBounds(this._target, this._targetObject.parent))){ | |
_arg1.sy = 1; | |
return; | |
}; | |
}; | |
}; | |
_local6 = 1; | |
while (_local6 <= _local7) { | |
_local9.a = _local5.a; | |
_local9.b = _local5.b; | |
_local9.c = _local5.c; | |
_local9.d = _local5.d; | |
MatrixTools.scaleMatrix(_local9, 1, (_local8 + (_local6 * _local10)), _arg2, _arg3); | |
this._target.transform.matrix = _local9; | |
this.reposition(true); | |
if (!this._bounds.containsRect(this.getBounds(this._target, this._targetObject.parent))){ | |
_arg1.sy = (_local8 + ((_local6 - 1) * _local10)); | |
break; | |
}; | |
_local6++; | |
}; | |
}; | |
}; | |
} | |
public function fitInsideBounds(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Rectangle=null):void{ | |
var _local5:Rectangle; | |
var _local6:Number; | |
var _local7:Number; | |
var _local8:Number; | |
var _local9:Number; | |
var _local10:Number; | |
var _local11:Point; | |
var _local12:Number; | |
var _local13:Number; | |
var _local14:Number; | |
var _local15:Number; | |
if (_arg2){ | |
this.update(null); | |
}; | |
var _local4:Rectangle = ((_arg3)!=null) ? _arg3 : this._bounds; | |
if (((this._target.parent) && (!((_local4 == null))))){ | |
_local5 = this.getBounds(this._target, this._targetObject.parent); | |
if (((!(_local4.containsRect(_local5))) && (!((_local5.width == 0))))){ | |
_local6 = (_arg1) ? _local4.x : _local5.x; | |
_local7 = (_arg1) ? _local4.y : _local5.y; | |
_local8 = Math.min(_local5.width, (_local4.width - Math.abs((_local6 - _local4.x)))); | |
_local9 = Math.min(_local5.height, (_local4.height - Math.abs((_local7 - _local4.y)))); | |
_local10 = Math.min((_local8 / _local5.width), (_local9 / _local5.height)); | |
if (_local10 < 0){ | |
_local10 = 0; | |
}; | |
if (_local10 < 1){ | |
_local11 = this._origin; | |
this.origin = new Point(_local5.x, _local5.y); | |
this.scale(_local10, _local10, 0, false, true); | |
this.origin = _local11; | |
} else { | |
_local10 = 1; | |
}; | |
if (_arg1){ | |
_local12 = 0; | |
_local13 = 0; | |
_local14 = (_local4.x + (_local4.width - (_local5.width * _local10))); | |
if (_local5.x > _local14){ | |
_local12 = (_local14 - _local5.x); | |
} else { | |
if (_local5.x < _local4.x){ | |
_local12 = (_local4.x - _local5.x); | |
}; | |
}; | |
_local15 = (_local4.y + (_local4.height - (_local5.height * _local10))); | |
if (_local5.y > _local15){ | |
_local13 = (_local15 - _local5.y); | |
} else { | |
if (_local5.y < _local4.y){ | |
_local13 = (_local4.y - _local5.y); | |
}; | |
}; | |
this.move(_local12, _local13, false, true); | |
}; | |
}; | |
}; | |
} | |
public function setScaleConstraints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{ | |
this.minScaleX = _arg1; | |
this.maxScaleX = _arg2; | |
this.minScaleY = _arg3; | |
this.maxScaleY = _arg4; | |
} | |
public function rotate(_arg1:Number, _arg2:Boolean=true, _arg3:Boolean=true):void{ | |
var _local4:Matrix; | |
var _local5:Object; | |
if (!this._lockRotation){ | |
if (((_arg2) && (!((this._bounds == null))))){ | |
_local5 = {angle:_arg1}; | |
this.rotateCheck(_local5); | |
_arg1 = _local5.angle; | |
}; | |
_local4 = this._targetObject.transform.matrix; | |
_local4.rotate(_arg1); | |
this._targetObject.transform.matrix = _local4; | |
if (this._proxy != null){ | |
_local4 = this._proxy.transform.matrix; | |
_local4.rotate(_arg1); | |
this._proxy.transform.matrix = _local4; | |
}; | |
this.reposition(false); | |
if (((((_arg3) && (this._dispatchRotateEvents))) && (!((_arg1 == 0))))){ | |
dispatchEvent(new TransformEvent(TransformEvent.ROTATE, [this])); | |
}; | |
}; | |
} | |
public function rotateCheck(_arg1:Object):void{ | |
var _local2:Number; | |
var _local3:Matrix; | |
var _local4:Matrix; | |
var _local5:Number; | |
var _local6:uint; | |
if (this._lockRotation){ | |
_arg1.angle = 0; | |
} else { | |
if (((!((this._bounds == null))) && (!((_arg1.angle == 0))))){ | |
_local2 = (this._target.rotation * _DEG2RAD); | |
_local3 = this._target.transform.matrix; | |
_local4 = _local3.clone(); | |
_local4.rotate(_arg1.angle); | |
this._target.transform.matrix = _local4; | |
this.reposition(true); | |
if (!this._bounds.containsRect(this.getBounds(this._target, this._targetObject.parent))){ | |
_local4 = _local3.clone(); | |
_local5 = _DEG2RAD; | |
if (TransformManager.acuteAngle(_arg1.angle) < 0){ | |
_local5 = (_local5 * -1); | |
}; | |
_local6 = 1; | |
while (_local6 < 360) { | |
_local4.rotate(_local5); | |
this._target.transform.matrix = _local4; | |
this.reposition(true); | |
if (!this._bounds.containsRect(this.getBounds(this._target, this._targetObject.parent))){ | |
_arg1.angle = ((_local6 - 1) * _local5); | |
break; | |
}; | |
_local6++; | |
}; | |
}; | |
this._target.transform.matrix = _local3; | |
}; | |
}; | |
} | |
public function get enabled():Boolean{ | |
return (this._enabled); | |
} | |
public function set enabled(_arg1:Boolean):void{ | |
if (_arg1 != this._enabled){ | |
this._enabled = _arg1; | |
this.selected = false; | |
if (_arg1){ | |
this._targetObject.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown); | |
this._targetObject.addEventListener(MouseEvent.ROLL_OVER, this.onRollOverItem); | |
this._targetObject.addEventListener(MouseEvent.ROLL_OUT, this.onRollOutItem); | |
} else { | |
this._targetObject.removeEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDown); | |
this._targetObject.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOverItem); | |
this._targetObject.removeEventListener(MouseEvent.ROLL_OUT, this.onRollOutItem); | |
if (this._stage != null){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onMouseUp); | |
}; | |
}; | |
}; | |
} | |
public function get x():Number{ | |
return (this._targetObject.x); | |
} | |
public function set x(_arg1:Number):void{ | |
this.move((_arg1 - this._targetObject.x), 0, true, true); | |
} | |
public function get y():Number{ | |
return (this._targetObject.y); | |
} | |
public function set y(_arg1:Number):void{ | |
this.move(0, (_arg1 - this._targetObject.y), true, true); | |
} | |
public function get targetObject():DisplayObject{ | |
return (this._targetObject); | |
} | |
public function get scaleX():Number{ | |
return (MatrixTools.getScaleX(this._targetObject.transform.matrix, this._flipX)); | |
} | |
public function set scaleX(_arg1:Number):void{ | |
var _local2:Matrix = this._targetObject.transform.matrix; | |
this.scaleRotated((_arg1 / MatrixTools.getScaleX(_local2, this._flipX)), 1, (this._targetObject.rotation * _DEG2RAD), Math.atan2(_local2.c, _local2.d), true, true); | |
} | |
public function get scaleY():Number{ | |
return (MatrixTools.getScaleY(this._targetObject.transform.matrix, this._flipX)); | |
} | |
public function set scaleY(_arg1:Number):void{ | |
var _local2:Matrix = this._targetObject.transform.matrix; | |
this.scaleRotated(1, (_arg1 / MatrixTools.getScaleY(_local2, this._flipX)), (this._targetObject.rotation * _DEG2RAD), Math.atan2(_local2.c, _local2.d), true, true); | |
} | |
public function get width():Number{ | |
var _local1:Sprite; | |
var _local2:Number; | |
if (this._targetObject.parent != null){ | |
return (this.getBounds(this._targetObject, this._targetObject.parent).width); | |
}; | |
_local1 = new Sprite(); | |
_local1.addChild(this._targetObject); | |
_local2 = this.getBounds(this._targetObject, _local1).width; | |
_local1.removeChild(this._targetObject); | |
return (_local2); | |
} | |
public function set width(_arg1:Number):void{ | |
this.scale((_arg1 / this.width), 1, 0, true, true); | |
} | |
public function get height():Number{ | |
var _local1:Sprite; | |
var _local2:Number; | |
if (this._targetObject.parent != null){ | |
return (this.getBounds(this._targetObject, this._targetObject.parent).height); | |
}; | |
_local1 = new Sprite(); | |
_local1.addChild(this._targetObject); | |
_local2 = this.getBounds(this._targetObject, _local1).height; | |
_local1.removeChild(this._targetObject); | |
return (_local2); | |
} | |
public function set height(_arg1:Number):void{ | |
this.scale(1, (_arg1 / this.height), 0, true, true); | |
} | |
public function get rotation():Number{ | |
return ((MatrixTools.getAngle(this._targetObject.transform.matrix, this._flipX) * _RAD2DEG)); | |
} | |
public function set rotation(_arg1:Number):void{ | |
this.rotate(((_arg1 * _DEG2RAD) - MatrixTools.getAngle(this._targetObject.transform.matrix, this._flipX)), true, true); | |
} | |
public function get alpha():Number{ | |
return (this._targetObject.alpha); | |
} | |
public function set alpha(_arg1:Number):void{ | |
this._targetObject.alpha = _arg1; | |
} | |
public function get center():Point{ | |
if (this._targetObject.parent != null){ | |
return (this._targetObject.parent.globalToLocal(this._targetObject.localToGlobal(this.innerCenter))); | |
}; | |
return (this.innerCenter); | |
} | |
public function get innerCenter():Point{ | |
var _local1:Rectangle = this.getBounds(this._targetObject, this._targetObject); | |
return (new Point((_local1.x + (_local1.width / 2)), (_local1.y + (_local1.height / 2)))); | |
} | |
public function get constrainScale():Boolean{ | |
return (this._constrainScale); | |
} | |
public function set constrainScale(_arg1:Boolean):void{ | |
this._constrainScale = _arg1; | |
var _local2:Matrix = this._targetObject.transform.matrix; | |
this._constrainRatio = (MatrixTools.getScaleX(_local2, this._flipX) / MatrixTools.getScaleY(_local2, this._flipX)); | |
} | |
public function get lockScale():Boolean{ | |
return (this._lockScale); | |
} | |
public function set lockScale(_arg1:Boolean):void{ | |
this._lockScale = _arg1; | |
} | |
public function get lockRotation():Boolean{ | |
return (this._lockRotation); | |
} | |
public function set lockRotation(_arg1:Boolean):void{ | |
this._lockRotation = _arg1; | |
} | |
public function get lockPosition():Boolean{ | |
return (this._lockPosition); | |
} | |
public function set lockPosition(_arg1:Boolean):void{ | |
this._lockPosition = _arg1; | |
} | |
public function get allowDelete():Boolean{ | |
return (this._allowDelete); | |
} | |
public function set allowDelete(_arg1:Boolean):void{ | |
if (_arg1 != this._allowDelete){ | |
this._allowDelete = _arg1; | |
if (this._createdManager != null){ | |
this._createdManager.allowDelete = _arg1; | |
}; | |
}; | |
} | |
public function get selected():Boolean{ | |
return (this._selected); | |
} | |
public function set selected(_arg1:Boolean):void{ | |
if (_arg1 != this._selected){ | |
this._selected = _arg1; | |
if (_arg1){ | |
if (this._targetObject.parent == null){ | |
return; | |
}; | |
if (this._targetObject.hasOwnProperty("setStyle")){ | |
(this._targetObject as Object).setStyle("focusThickness", 0); | |
}; | |
if (this._proxy != null){ | |
this.calibrateProxy(); | |
}; | |
dispatchEvent(new TransformEvent(TransformEvent.SELECT, [this])); | |
} else { | |
this.origin = this._unselectedOrigin; | |
dispatchEvent(new TransformEvent(TransformEvent.DESELECT, [this])); | |
}; | |
}; | |
} | |
public function get bounds():Rectangle{ | |
return (this._bounds); | |
} | |
public function set bounds(_arg1:Rectangle):void{ | |
this._bounds = _arg1; | |
this.setCornerAngles(); | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
} | |
public function get origin():Point{ | |
return (this._origin); | |
} | |
public function set origin(_arg1:Point):void{ | |
if (!this._selected){ | |
this._unselectedOrigin = _arg1; | |
}; | |
this._origin = _arg1; | |
if (((!((this._proxy == null))) && (!((this._proxy.parent == null))))){ | |
this._localOrigin = this._proxy.globalToLocal(this._proxy.parent.localToGlobal(_arg1)); | |
} else { | |
if (this._targetObject.parent != null){ | |
this._localOrigin = this._targetObject.globalToLocal(this._targetObject.parent.localToGlobal(_arg1)); | |
}; | |
}; | |
this.setCornerAngles(); | |
} | |
public function get maxWidth():Number{ | |
return (this._maxWidth); | |
} | |
public function set maxWidth(_arg1:Number):void{ | |
if (_arg1 < 1){ | |
this._maxWidth = 1; | |
} else { | |
this._maxWidth = _arg1; | |
}; | |
var _local2:Matrix = this._targetObject.transform.matrix; | |
var _local3:Number = (this.getBounds(this._targetObject, this._targetObject).width * Math.sqrt(((_local2.a * _local2.a) + (_local2.b * _local2.b)))); | |
if (_local3 > this._maxWidth){ | |
this._targetObject.scaleX = (this._targetObject.scaleX * (this._maxWidth / _local3)); | |
if (this._constrainScale){ | |
this._targetObject.scaleY = (this._targetObject.scaleX / this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function get maxHeight():Number{ | |
return (this._maxHeight); | |
} | |
public function set maxHeight(_arg1:Number):void{ | |
if (_arg1 < 1){ | |
this._maxHeight = 1; | |
} else { | |
this._maxHeight = _arg1; | |
}; | |
var _local2:Matrix = this._targetObject.transform.matrix; | |
var _local3:Number = (this.getBounds(this._targetObject, this._targetObject).height * Math.sqrt(((_local2.c * _local2.c) + (_local2.d * _local2.d)))); | |
if (_local3 > this._maxHeight){ | |
this._targetObject.scaleY = (this._targetObject.scaleY * (this._maxHeight / _local3)); | |
if (this._constrainScale){ | |
this._targetObject.scaleX = (this._targetObject.scaleY * this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function get minHeight():Number{ | |
return (this._minHeight); | |
} | |
public function set minHeight(_arg1:Number):void{ | |
if (_arg1 < 1){ | |
this._minHeight = 1; | |
} else { | |
this._minHeight = _arg1; | |
}; | |
var _local2:Matrix = this._targetObject.transform.matrix; | |
var _local3:Number = (this.getBounds(this._targetObject, this._targetObject).height * Math.sqrt(((_local2.c * _local2.c) + (_local2.d * _local2.d)))); | |
if ((((_local3 < this._minHeight)) && (!((_local3 == 0))))){ | |
this._targetObject.scaleY = (this._targetObject.scaleY * (this._minHeight / _local3)); | |
if (this._constrainScale){ | |
this._targetObject.scaleX = (this._targetObject.scaleY * this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function get minWidth():Number{ | |
return (this._minWidth); | |
} | |
public function set minWidth(_arg1:Number):void{ | |
if (_arg1 < 1){ | |
this._minWidth = 1; | |
} else { | |
this._minWidth = _arg1; | |
}; | |
var _local2:Matrix = this._targetObject.transform.matrix; | |
var _local3:Number = (this.getBounds(this._targetObject, this._targetObject).width * Math.sqrt(((_local2.a * _local2.a) + (_local2.b * _local2.b)))); | |
if ((((_local3 < this._minWidth)) && (!((_local3 == 0))))){ | |
this._targetObject.scaleX = (this._targetObject.scaleX * (this._minWidth / _local3)); | |
if (this._constrainScale){ | |
this._targetObject.scaleY = (this._targetObject.scaleX / this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function get minScaleX():Number{ | |
return (this._minScaleX); | |
} | |
public function set minScaleX(_arg1:Number):void{ | |
if (_arg1 == 0){ | |
_arg1 = ((this.getBounds(this._targetObject, this._targetObject).width) || (500)); | |
this._minScaleX = (1 / _arg1); | |
} else { | |
this._minScaleX = _arg1; | |
}; | |
if (this._targetObject.scaleX < this._minScaleX){ | |
this._targetObject.scaleX = this._minScaleX; | |
if (this._constrainScale){ | |
this._targetObject.scaleY = (this._targetObject.scaleX / this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function get minScaleY():Number{ | |
return (this._minScaleY); | |
} | |
public function set minScaleY(_arg1:Number):void{ | |
if (_arg1 == 0){ | |
_arg1 = ((this.getBounds(this._targetObject, this._targetObject).height) || (500)); | |
this._minScaleY = (1 / _arg1); | |
} else { | |
this._minScaleY = _arg1; | |
}; | |
if (this._targetObject.scaleY < this._minScaleY){ | |
this._targetObject.scaleY = this._minScaleY; | |
if (this._constrainScale){ | |
this._targetObject.scaleX = (this._targetObject.scaleY * this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function get maxScaleX():Number{ | |
return (this._maxScaleX); | |
} | |
public function set maxScaleX(_arg1:Number):void{ | |
if (_arg1 == 0){ | |
_arg1 = ((this.getBounds(this._targetObject, this._targetObject).width) || (0.005)); | |
this._maxScaleX = (0 - (1 / _arg1)); | |
} else { | |
this._maxScaleX = _arg1; | |
}; | |
if (this._targetObject.scaleX > this._maxScaleX){ | |
this._targetObject.scaleX = this._maxScaleX; | |
if (this._constrainScale){ | |
this._targetObject.scaleY = (this._targetObject.scaleX / this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function get maxScaleY():Number{ | |
return (this._maxScaleY); | |
} | |
public function set maxScaleY(_arg1:Number):void{ | |
if (_arg1 == 0){ | |
_arg1 = ((this.getBounds(this._targetObject, this._targetObject).height) || (0.005)); | |
this._maxScaleY = (0 - (1 / _arg1)); | |
} else { | |
this._maxScaleY = _arg1; | |
}; | |
if (this._targetObject.scaleY > this._maxScaleY){ | |
this._targetObject.scaleY = this._maxScaleY; | |
if (this._constrainScale){ | |
this._targetObject.scaleX = (this._targetObject.scaleY * this._constrainRatio); | |
}; | |
}; | |
if (this._selected){ | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [this])); | |
}; | |
} | |
public function set maxScale(_arg1:Number):void{ | |
this.maxScaleX = (this.maxScaleY = _arg1); | |
} | |
public function set minScale(_arg1:Number):void{ | |
this.minScaleX = (this.minScaleY = _arg1); | |
} | |
public function get hasSizeLimits():Boolean{ | |
return (((((((((((((((!((this._minScaleX == -(Infinity)))) || (!((this._minScaleY == -(Infinity)))))) || (!((this._maxScaleX == Infinity))))) || (!((this._maxScaleY == Infinity))))) || (!((this._minWidth == 1))))) || (!((this._minHeight == 1))))) || (!((this._maxWidth == Infinity))))) || (!((this._maxHeight == Infinity))))); | |
} | |
public function get scaleMode():String{ | |
return (this._scaleMode); | |
} | |
public function set scaleMode(_arg1:String):void{ | |
this._scaleMode = _arg1; | |
if (_arg1 != TransformManager.SCALE_NORMAL){ | |
this.createProxy(); | |
} else { | |
this.removeProxy(); | |
}; | |
} | |
public function get hasSelectableText():Boolean{ | |
return (this._hasSelectableText); | |
} | |
public function set hasSelectableText(_arg1:Boolean):void{ | |
this._hasSelectableText = _arg1; | |
if (_arg1){ | |
this.scaleMode = TransformManager.SCALE_WIDTH_AND_HEIGHT; | |
this.allowDelete = false; | |
}; | |
} | |
public function get manager():TransformManager{ | |
return (this._manager); | |
} | |
} | |
}//package com.greensock.transform | |
package com.greensock.transform { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.ui.*; | |
import flash.utils.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.greensock.events.*; | |
import com.greensock.transform.utils.*; | |
public class TransformManager extends EventDispatcher { | |
public static const VERSION:Number = 1.96681; | |
public static const SCALE_NORMAL:String = "scaleNormal"; | |
public static const SCALE_WIDTH_AND_HEIGHT:String = "scaleWidthAndHeight"; | |
private static const _DEG2RAD:Number = 0.0174532925199433; | |
private static const _RAD2DEG:Number = 57.2957795130823; | |
private static var _currentCursor:CustomCursor; | |
private static var _cursorManager:TransformManager; | |
private static var _keysDown:Object; | |
private static var _keyListenerInits:Dictionary = new Dictionary(); | |
private static var _keyDispatcher:EventDispatcher = new EventDispatcher(); | |
private static var _tempDeselectedItem:TransformItem; | |
private static var _scaleCursor:CustomCursor; | |
private static var _rotationCursor:CustomCursor; | |
private static var _moveCursor:CustomCursor; | |
private static var _handleOrientationsNormal:Object = { | |
center:0, | |
top:1, | |
right:2, | |
bottom:3, | |
left:4, | |
topLeft:5, | |
topRight:6, | |
bottomRight:7, | |
bottomLeft:8 | |
}; | |
private static var _handleOrientationsFlipped:Object = { | |
center:0, | |
top:1, | |
right:4, | |
bottom:3, | |
left:2, | |
topLeft:6, | |
topRight:5, | |
bottomRight:8, | |
bottomLeft:7 | |
}; | |
private var _allowDelete:Boolean; | |
private var _allowMultiSelect:Boolean; | |
private var _hideCenterHandle:Boolean; | |
private var _multiSelectMode:Boolean; | |
private var _ignoreEvents:Boolean; | |
private var _autoDeselect:Boolean; | |
private var _constrainScale:Boolean; | |
private var _lockScale:Boolean; | |
private var _scaleFromCenter:Boolean; | |
private var _lockRotation:Boolean; | |
private var _lockPosition:Boolean; | |
private var _arrowKeysMove:Boolean; | |
private var _selConstrainScale:Boolean; | |
private var _selLockScale:Boolean; | |
private var _selLockRotation:Boolean; | |
private var _selLockPosition:Boolean; | |
private var _selHasTextFields:Boolean; | |
private var _selHasSizeLimits:Boolean; | |
private var _selMinBounds:Rectangle; | |
private var _selMaxBounds:Rectangle; | |
private var _lineColor:uint; | |
private var _lineThickness:Number; | |
private var _handleColor:uint; | |
private var _handleSize:Number; | |
private var _paddingForRotation:Number; | |
private var _selectedItems:Array; | |
private var _forceSelectionToFront:Boolean; | |
private var _items:Array; | |
private var _ignoredObjects:Array; | |
private var _enabled:Boolean; | |
private var _bounds:Rectangle; | |
private var _selection:Sprite; | |
private var _dummyBox:Sprite; | |
private var _handles:Array; | |
private var _handlesDict:Dictionary; | |
public var _parent:DisplayObjectContainer; | |
private var _stage:Stage; | |
private var _origin:Point; | |
private var _trackingInfo:Object; | |
private var _initted:Boolean; | |
private var _isFlex:Boolean; | |
private var _edges:Sprite; | |
private var _lockCursor:Boolean; | |
private var _onUnlock:Function; | |
private var _onUnlockParam:Event; | |
private var _dispatchScaleEvents:Boolean; | |
private var _dispatchMoveEvents:Boolean; | |
private var _dispatchRotateEvents:Boolean; | |
private var _isTransforming:Boolean; | |
private var _prevScaleX:Number = 0; | |
private var _prevScaleY:Number = 0; | |
private var _lockOrigin:Boolean; | |
private var _lastClickTime:uint = 0; | |
private var _lastClickEvent:MouseEvent; | |
private var _flipX:Boolean; | |
private var _selectionElements:Array; | |
public var vars:Object; | |
public function TransformManager(_arg1:Object=null){ | |
this._selectionElements = []; | |
super(); | |
if (TransformItem.VERSION < 1.965){ | |
throw (new Error("TransformManager Error: You have an outdated TransformManager-related class file. You may need to clear your ASO files. Please make sure you're using the latest version of TransformManager and TransformItem, available from www.greensock.com.")); | |
}; | |
this.init(_arg1); | |
} | |
public static function customizeMoveCursor(_arg1:Shape=null, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0):void{ | |
_moveCursor = _applyCursor(_moveCursor, ((_arg1) || (_createMoveCursor(0, 0))), _arg2, _arg3, _arg4, false); | |
} | |
public static function customizeScaleCursor(_arg1:Shape=null, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0, _arg5:Boolean=true):void{ | |
_scaleCursor = _applyCursor(_scaleCursor, ((_arg1) || (_createScaleCursor(0, 0))), _arg2, _arg3, _arg4, _arg5); | |
} | |
public static function customizeRotationCursor(_arg1:Shape=null, _arg2:Boolean=true, _arg3:Number=0, _arg4:Number=0, _arg5:Boolean=true):void{ | |
_rotationCursor = _applyCursor(_rotationCursor, ((_arg1) || (_createRotationCursor(0, 0))), _arg2, _arg3, _arg4, _arg5); | |
} | |
private static function _applyCursor(_arg1:CustomCursor, _arg2:Shape, _arg3:Boolean, _arg4:Number, _arg5:Number, _arg6:Boolean):CustomCursor{ | |
_arg2.visible = false; | |
if (_arg1 == null){ | |
return (new CustomCursor(_arg2, _arg3, _arg4, _arg5, _arg6)); | |
}; | |
if (((!((_arg1.shape == null))) && (!((_arg1.shape.parent == null))))){ | |
_arg1.shape.parent.removeChild(_arg1.shape); | |
}; | |
_arg1.shape = _arg2; | |
_arg1.hideMouse = _arg3; | |
_arg1.xOffset = _arg4; | |
_arg1.yOffset = _arg5; | |
_arg1.autoRotate = _arg6; | |
return (_arg1); | |
} | |
private static function _createScaleCursor(_arg1:Number=0, _arg2:Number=0):Shape{ | |
var _local6:uint; | |
var _local7:uint; | |
var _local3:Number = 9; | |
var _local4:Shape = new Shape(); | |
var _local5:Graphics = _local4.graphics; | |
var _local8:int; | |
while (_local8 < 2) { | |
if (_local8 == 0){ | |
_local6 = 0xFFFFFF; | |
_local7 = 5; | |
} else { | |
_local6 = 0; | |
_local7 = 2; | |
}; | |
_local5.lineStyle(_local7, _local6, 1, false, null, "square", "miter", 3); | |
_local5.beginFill(_local6, 1); | |
_local5.moveTo((_arg1 - _local3), _arg2); | |
_local5.lineTo(((_arg1 + 2) - _local3), (_arg2 - 1.5)); | |
_local5.lineTo(((_arg1 + 2) - _local3), (_arg2 + 1.5)); | |
_local5.lineTo((_arg1 - _local3), _arg2); | |
_local5.endFill(); | |
_local5.moveTo(((_arg1 + 2) - _local3), _arg2); | |
_local5.lineTo((_arg1 - 2), _arg2); | |
_local5.moveTo((_arg1 - _local3), _arg2); | |
_local5.beginFill(_local6, 1); | |
_local5.moveTo((_arg1 + _local3), _arg2); | |
_local5.lineTo(((_arg1 + _local3) - 2), (_arg2 - 1.5)); | |
_local5.lineTo(((_arg1 + _local3) - 2), (_arg2 + 1.5)); | |
_local5.lineTo((_arg1 + _local3), _arg2); | |
_local5.endFill(); | |
_local5.moveTo((_arg1 + 2), _arg2); | |
_local5.lineTo(((_arg1 + _local3) - 2), _arg2); | |
_local5.moveTo((_arg1 + 2), _arg2); | |
_local8++; | |
}; | |
return (_local4); | |
} | |
private static function _createRotationCursor(_arg1:Number=0, _arg2:Number=0):Shape{ | |
var _local7:uint; | |
var _local8:uint; | |
var _local3:Number = 2; | |
var _local4:Number = 6; | |
var _local5:Shape = new Shape(); | |
var _local6:Graphics = _local5.graphics; | |
var _local9:int; | |
while (_local9 < 2) { | |
if (_local9 == 0){ | |
_local7 = 0xFFFFFF; | |
_local8 = 5; | |
} else { | |
_local7 = 0; | |
_local8 = 2; | |
}; | |
_local6.lineStyle(_local8, _local7, 1, false, null, "square", "miter", 3); | |
_local6.beginFill(_local7, 1); | |
_local6.moveTo(_arg1, (_arg2 - _local4)); | |
_local6.lineTo(_arg1, ((_arg2 - _local4) - _local3)); | |
_local6.lineTo((_arg1 + _local3), ((_arg2 - _local4) - _local3)); | |
_local6.lineTo(_arg1, (_arg2 - _local4)); | |
_local6.endFill(); | |
_local6.beginFill(_local7, 1); | |
_local6.moveTo(_arg1, (_arg2 + _local4)); | |
_local6.lineTo(_arg1, ((_arg2 + _local4) + _local3)); | |
_local6.lineTo((_arg1 + _local3), ((_arg2 + _local4) + _local3)); | |
_local6.lineTo(_arg1, (_arg2 + _local4)); | |
_local6.endFill(); | |
_local6.lineStyle(_local8, _local7, 1, false, null, "none", "miter", 3); | |
_local6.moveTo((_arg1 + (_local3 / 2)), ((_arg2 - _local4) - (_local3 / 2))); | |
_local6.curveTo((_arg1 + (_local3 * 4.5)), _arg2, (_arg1 + (_local3 / 2)), ((_arg2 + _local4) + (_local3 / 2))); | |
_local6.moveTo(_arg1, _arg2); | |
_local9++; | |
}; | |
_local5.rotation = 45; | |
return (_local5); | |
} | |
private static function _createMoveCursor(_arg1:Number=0, _arg2:Number=0):Shape{ | |
var _local6:uint; | |
var _local7:uint; | |
var _local8:int; | |
var _local3:Number = 8; | |
var _local4:Shape = new Shape(); | |
var _local5:Graphics = _local4.graphics; | |
_local8 = 0; | |
while (_local8 < 2) { | |
if (_local8 == 0){ | |
_local6 = 0xFFFFFF; | |
_local7 = 5; | |
} else { | |
_local6 = 0; | |
_local7 = 2; | |
}; | |
_local5.lineStyle(_local7, _local6, 1, false, null, "square", "miter", 3); | |
_local5.beginFill(_local6, 1); | |
_local5.moveTo((_arg1 - _local3), _arg2); | |
_local5.lineTo(((_arg1 + 2) - _local3), (_arg2 - 1.5)); | |
_local5.lineTo(((_arg1 + 2) - _local3), (_arg2 + 1.5)); | |
_local5.lineTo((_arg1 + -(_local3)), _arg2); | |
_local5.endFill(); | |
_local5.beginFill(_local6, 1); | |
_local5.moveTo(((_arg1 + 2) - _local3), _arg2); | |
_local5.lineTo((_arg1 + _local3), _arg2); | |
_local5.moveTo((_arg1 + _local3), _arg2); | |
_local5.lineTo(((_arg1 + _local3) - 2), (_arg2 - 1.5)); | |
_local5.lineTo(((_arg1 + _local3) - 2), (_arg2 + 1.5)); | |
_local5.lineTo((_arg1 + _local3), _arg2); | |
_local5.endFill(); | |
_local5.beginFill(_local6, 1); | |
_local5.moveTo(_arg1, (_arg2 - _local3)); | |
_local5.lineTo((_arg1 - 1.5), ((_arg2 + 2) - _local3)); | |
_local5.lineTo((_arg1 + 1.5), ((_arg2 + 2) - _local3)); | |
_local5.lineTo(_arg1, (_arg2 - _local3)); | |
_local5.endFill(); | |
_local5.beginFill(_local6, 1); | |
_local5.moveTo(_arg1, ((_arg2 + 2) - _local3)); | |
_local5.lineTo(_arg1, (_arg2 + _local3)); | |
_local5.moveTo(_arg1, (_arg2 + _local3)); | |
_local5.lineTo((_arg1 - 1.5), ((_arg2 + _local3) - 2)); | |
_local5.lineTo((_arg1 + 1.5), ((_arg2 + _local3) - 2)); | |
_local5.lineTo(_arg1, (_arg2 + _local3)); | |
_local5.endFill(); | |
_local8++; | |
}; | |
return (_local4); | |
} | |
private static function initKeyListeners(_arg1:DisplayObjectContainer):void{ | |
if (!(_arg1 in _keyListenerInits)){ | |
_keysDown = {}; | |
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPress); | |
_arg1.addEventListener(KeyboardEvent.KEY_UP, onKeyRelease); | |
_arg1.addEventListener(Event.DEACTIVATE, clearKeys); | |
_keyListenerInits[_arg1] = _arg1; | |
}; | |
} | |
public static function isKeyDown(_arg1:uint):Boolean{ | |
if (_keysDown == null){ | |
throw (new Error("Key class has yet been initialized.")); | |
}; | |
return (Boolean((_arg1 in _keysDown))); | |
} | |
private static function onKeyPress(_arg1:KeyboardEvent):void{ | |
var _local2:KeyboardEvent; | |
_keysDown[_arg1.keyCode] = true; | |
if ((((_arg1.keyCode == Keyboard.DELETE)) || ((_arg1.keyCode == Keyboard.BACKSPACE)))){ | |
_keyDispatcher.dispatchEvent(new KeyboardEvent("pressDelete")); | |
} else { | |
if ((((_arg1.keyCode == Keyboard.SHIFT)) || ((_arg1.keyCode == Keyboard.CONTROL)))){ | |
_keyDispatcher.dispatchEvent(new KeyboardEvent("pressMultiSelectKey")); | |
} else { | |
if ((((((((_arg1.keyCode == Keyboard.UP)) || ((_arg1.keyCode == Keyboard.DOWN)))) || ((_arg1.keyCode == Keyboard.LEFT)))) || ((_arg1.keyCode == Keyboard.RIGHT)))){ | |
_local2 = new KeyboardEvent("pressArrowKey", true, false, _arg1.charCode, _arg1.keyCode, _arg1.keyLocation, _arg1.ctrlKey, _arg1.altKey, _arg1.shiftKey); | |
_keyDispatcher.dispatchEvent(_local2); | |
}; | |
}; | |
}; | |
} | |
private static function onKeyRelease(_arg1:KeyboardEvent):void{ | |
if ((((_arg1.keyCode == Keyboard.SHIFT)) || ((_arg1.keyCode == Keyboard.CONTROL)))){ | |
_keyDispatcher.dispatchEvent(new KeyboardEvent("releaseMultiSelectKey")); | |
}; | |
delete _keysDown[_arg1.keyCode]; | |
} | |
private static function clearKeys(_arg1:Event):void{ | |
_keysDown = {}; | |
} | |
private static function setDefault(_arg1, _arg2){ | |
if (_arg1 == undefined){ | |
return (_arg2); | |
}; | |
return (_arg1); | |
} | |
private static function bringToFront(_arg1:DisplayObject):void{ | |
if (_arg1.parent != null){ | |
if (_arg1.parent.hasOwnProperty("setElementIndex")){ | |
(_arg1.parent as Object).setElementIndex(_arg1, (_arg1.parent.numChildren - 1)); | |
} else { | |
_arg1.parent.setChildIndex(_arg1, (_arg1.parent.numChildren - 1)); | |
}; | |
}; | |
} | |
public static function positiveAngle(_arg1:Number):Number{ | |
var _local2:Number = (Math.PI * 2); | |
return ((((_arg1 % _local2) + _local2) % _local2)); | |
} | |
public static function acuteAngle(_arg1:Number):Number{ | |
if (_arg1 != (_arg1 % Math.PI)){ | |
_arg1 = (_arg1 % (Math.PI * 2)); | |
if (_arg1 < -(Math.PI)){ | |
return ((Math.PI + (_arg1 % Math.PI))); | |
}; | |
if (_arg1 > Math.PI){ | |
return ((-(Math.PI) + (_arg1 % Math.PI))); | |
}; | |
}; | |
return (_arg1); | |
} | |
public static function get moveCursor():Shape{ | |
return (_moveCursor.shape); | |
} | |
public static function get scaleCursor():Shape{ | |
return (_scaleCursor.shape); | |
} | |
public static function get rotationCursor():Shape{ | |
return (_rotationCursor.shape); | |
} | |
protected function init(_arg1:Object):void{ | |
this.vars = ((_arg1) || ({})); | |
this._allowDelete = setDefault(this.vars.allowDelete, false); | |
this._allowMultiSelect = setDefault(this.vars.allowMultiSelect, true); | |
this._autoDeselect = setDefault(this.vars.autoDeselect, true); | |
this._constrainScale = setDefault(this.vars.constrainScale, false); | |
this._lockScale = setDefault(this.vars.lockScale, false); | |
this._scaleFromCenter = setDefault(this.vars.scaleFromCenter, false); | |
this._lockRotation = setDefault(this.vars.lockRotation, false); | |
this._lockPosition = setDefault(this.vars.lockPosition, false); | |
this._arrowKeysMove = setDefault(this.vars.arrowKeysMove, false); | |
this._forceSelectionToFront = setDefault(this.vars.forceSelectionToFront, true); | |
this._lineColor = setDefault(this.vars.lineColor, 3381759); | |
this._lineThickness = setDefault(this.vars.lineThickness, 1); | |
this._handleColor = setDefault(this.vars.handleFillColor, 0xFFFFFF); | |
this._handleSize = setDefault(this.vars.handleSize, 8); | |
this._paddingForRotation = setDefault(this.vars.paddingForRotation, 12); | |
this._hideCenterHandle = setDefault(this.vars.hideCenterHandle, false); | |
this._multiSelectMode = (this._ignoreEvents = false); | |
this._bounds = this.vars.bounds; | |
this._enabled = true; | |
_keyDispatcher.addEventListener("pressDelete", this.onPressDelete, false, 0, true); | |
_keyDispatcher.addEventListener("pressArrowKey", this.onPressArrowKey, false, 0, true); | |
_keyDispatcher.addEventListener("pressMultiSelectKey", this.onPressMultiSelectKey, false, 0, true); | |
_keyDispatcher.addEventListener("releaseMultiSelectKey", this.onReleaseMultiSelectKey, false, 0, true); | |
this._items = ((this.vars.items) || ([])); | |
this._selectedItems = []; | |
this.ignoredObjects = ((this.vars.ignoredObjects) || ([])); | |
this._handles = []; | |
this._handlesDict = new Dictionary(); | |
if (this.vars.targetObjects != undefined){ | |
this.addItems(this.vars.targetObjects); | |
}; | |
} | |
public function initParent(_arg1:DisplayObjectContainer):void{ | |
var i:* = 0; | |
var $parent:* = _arg1; | |
if (((!(this._initted)) && ((this._parent == null)))){ | |
if (("flexMode" in this.vars)){ | |
this._isFlex = Boolean(this.vars.flexMode); | |
} else { | |
try { | |
this._isFlex = Boolean(getDefinitionByName("mx.managers.SystemManager")); | |
} catch($e:Error) { | |
_isFlex = false; | |
}; | |
if (((this._isFlex) && (!(($parent is (getDefinitionByName("mx.core.UIComponent") as Class)))))){ | |
this._isFlex = false; | |
}; | |
}; | |
this._parent = $parent; | |
i = (this._items.length - 1); | |
while (i > -1) { | |
this._items[i].targetObject.removeEventListener(Event.ADDED_TO_STAGE, this.onTargetAddedToStage); | |
i = (i - 1); | |
}; | |
if (this._parent.stage == null){ | |
this._parent.addEventListener(Event.ADDED_TO_STAGE, this.initStage, false, 0, true); | |
} else { | |
this.initStage(); | |
}; | |
}; | |
} | |
protected function onTargetAddedToStage(_arg1:Event):void{ | |
this.initParent(_arg1.target.parent); | |
} | |
protected function initStage(_arg1:Event=null):void{ | |
var _local2:int; | |
this._parent.removeEventListener(Event.ADDED_TO_STAGE, this.initStage); | |
this._stage = this._parent.stage; | |
initKeyListeners(this._stage); | |
this._stage.addEventListener(MouseEvent.MOUSE_DOWN, this.checkForDeselect, false, 0, true); | |
this._stage.addEventListener(Event.DEACTIVATE, this.onReleaseMultiSelectKey, false, 0, true); | |
this.initSelection(); | |
if (_moveCursor == null){ | |
customizeMoveCursor(null, true, 0, 0); | |
}; | |
if (_scaleCursor == null){ | |
customizeScaleCursor(null, true, 0, 0); | |
}; | |
if (_rotationCursor == null){ | |
customizeRotationCursor(null, true, 0, 0); | |
}; | |
this._initted = true; | |
if (this._selectedItems.length != 0){ | |
if (this._forceSelectionToFront){ | |
_local2 = (this._selectedItems.length - 1); | |
while (_local2 > -1) { | |
bringToFront(this._selectedItems[_local2].targetObject); | |
_local2--; | |
}; | |
}; | |
this.calibrateConstraints(); | |
this.updateSelection(); | |
}; | |
} | |
public function addItem(_arg1:DisplayObject, _arg2:String="scaleNormal", _arg3:Boolean=false):TransformItem{ | |
if ((((_arg1 == this._dummyBox)) || ((_arg1 == this._selection)))){ | |
return (null); | |
}; | |
var _local4:Array = ["constrainScale", "scaleFromCenter", "lockScale", "lockRotation", "lockPosition", "autoDeselect", "allowDelete", "bounds", "enabled", "forceSelectionToFront"]; | |
var _local5:Object = {manager:this}; | |
var _local6:uint; | |
while (_local6 < _local4.length) { | |
_local5[_local4[_local6]] = this[_local4[_local6]]; | |
_local6++; | |
}; | |
var _local7:TransformItem = this.getItem(_arg1); | |
if (_local7 != null){ | |
_local7.update(null); | |
return (_local7); | |
}; | |
if (("flexMode" in this.vars)){ | |
_local5.flexMode = this.vars.flexMode; | |
}; | |
_local5.scaleMode = ((_arg1 is TextField)) ? SCALE_WIDTH_AND_HEIGHT : _arg2; | |
_local5.hasSelectableText = ((_arg1 is TextField)) ? true : _arg3; | |
var _local8 = new TransformItem(_arg1, _local5); | |
_local8.addEventListener(TransformEvent.SELECT, this.onSelectItem); | |
_local8.addEventListener(TransformEvent.DESELECT, this.onDeselectItem); | |
_local8.addEventListener(TransformEvent.MOUSE_DOWN, this.onMouseDownItem); | |
_local8.addEventListener(TransformEvent.SELECT_MOUSE_DOWN, this.onPressMove); | |
_local8.addEventListener(TransformEvent.SELECT_MOUSE_UP, this.onReleaseMove); | |
_local8.addEventListener(TransformEvent.UPDATE, this.onUpdateItem); | |
_local8.addEventListener(TransformEvent.SCALE, this.onUpdateItem); | |
_local8.addEventListener(TransformEvent.ROTATE, this.onUpdateItem); | |
_local8.addEventListener(TransformEvent.MOVE, this.onUpdateItem); | |
_local8.addEventListener(TransformEvent.ROLL_OVER_SELECTED, this.onRollOverSelectedItem); | |
_local8.addEventListener(TransformEvent.ROLL_OUT_SELECTED, this.onRollOutSelectedItem); | |
_local8.addEventListener(TransformEvent.DESTROY, this.onDestroyItem); | |
this._items.push(_local8); | |
if (!this._initted){ | |
if (_arg1.parent == null){ | |
_arg1.addEventListener(Event.ADDED_TO_STAGE, this.onTargetAddedToStage, false, 0, true); | |
} else { | |
this.initParent(_arg1.parent); | |
}; | |
}; | |
return (_local8); | |
} | |
public function addItems(_arg1:Array, _arg2:String="scaleNormal", _arg3:Boolean=false):Array{ | |
var _local4:Array = []; | |
var _local5:uint; | |
while (_local5 < _arg1.length) { | |
_local4.push(this.addItem(_arg1[_local5], _arg2, _arg3)); | |
_local5++; | |
}; | |
return (_local4); | |
} | |
public function removeItem(_arg1):void{ | |
var _local3:int; | |
var _local2:TransformItem = this.findObject(_arg1); | |
if (_local2 != null){ | |
_local2.selected = false; | |
_local2.removeEventListener(TransformEvent.SELECT, this.onSelectItem); | |
_local2.removeEventListener(TransformEvent.DESELECT, this.onDeselectItem); | |
_local2.removeEventListener(TransformEvent.MOUSE_DOWN, this.onMouseDownItem); | |
_local2.removeEventListener(TransformEvent.SELECT_MOUSE_DOWN, this.onPressMove); | |
_local2.removeEventListener(TransformEvent.SELECT_MOUSE_UP, this.onReleaseMove); | |
_local2.removeEventListener(TransformEvent.UPDATE, this.onUpdateItem); | |
_local2.removeEventListener(TransformEvent.SCALE, this.onUpdateItem); | |
_local2.removeEventListener(TransformEvent.ROTATE, this.onUpdateItem); | |
_local2.removeEventListener(TransformEvent.MOVE, this.onUpdateItem); | |
_local2.removeEventListener(TransformEvent.ROLL_OVER_SELECTED, this.onRollOverSelectedItem); | |
_local2.removeEventListener(TransformEvent.ROLL_OUT_SELECTED, this.onRollOutSelectedItem); | |
_local2.removeEventListener(TransformEvent.DESTROY, this.onDestroyItem); | |
_local3 = (this._items.length - 1); | |
while (_local3 > -1) { | |
if (_local2 == this._items[_local3]){ | |
this._items.splice(_local3, 1); | |
_local2.destroy(); | |
break; | |
}; | |
_local3--; | |
}; | |
}; | |
} | |
public function removeAllItems():void{ | |
var _local1:TransformItem; | |
var _local2:int = (this._items.length - 1); | |
while (_local2 > -1) { | |
_local1 = this._items[_local2]; | |
_local1.selected = false; | |
_local1.removeEventListener(TransformEvent.SELECT, this.onSelectItem); | |
_local1.removeEventListener(TransformEvent.DESELECT, this.onDeselectItem); | |
_local1.removeEventListener(TransformEvent.MOUSE_DOWN, this.onMouseDownItem); | |
_local1.removeEventListener(TransformEvent.SELECT_MOUSE_DOWN, this.onPressMove); | |
_local1.removeEventListener(TransformEvent.SELECT_MOUSE_UP, this.onReleaseMove); | |
_local1.removeEventListener(TransformEvent.UPDATE, this.onUpdateItem); | |
_local1.removeEventListener(TransformEvent.SCALE, this.onUpdateItem); | |
_local1.removeEventListener(TransformEvent.ROTATE, this.onUpdateItem); | |
_local1.removeEventListener(TransformEvent.MOVE, this.onUpdateItem); | |
_local1.removeEventListener(TransformEvent.ROLL_OVER_SELECTED, this.onRollOverSelectedItem); | |
_local1.removeEventListener(TransformEvent.ROLL_OUT_SELECTED, this.onRollOutSelectedItem); | |
_local1.removeEventListener(TransformEvent.DESTROY, this.onDestroyItem); | |
this._items.splice(_local2, 1); | |
_local1.destroy(); | |
_local2--; | |
}; | |
} | |
public function addIgnoredObject(_arg1:DisplayObject):void{ | |
var _local2:uint; | |
while (_local2 < this._ignoredObjects.length) { | |
if (this._ignoredObjects[_local2] == _arg1){ | |
return; | |
}; | |
_local2++; | |
}; | |
this.removeItem(_arg1); | |
this._ignoredObjects.push(_arg1); | |
} | |
public function removeIgnoredObject(_arg1:DisplayObject):void{ | |
var _local2:uint; | |
while (_local2 < this._ignoredObjects.length) { | |
if (this._ignoredObjects[_local2] == _arg1){ | |
this._ignoredObjects.splice(_local2, 1); | |
}; | |
_local2++; | |
}; | |
} | |
private function onDestroyItem(_arg1:TransformEvent):void{ | |
this.removeItem(_arg1.target); | |
} | |
private function setOrigin(_arg1:Point):void{ | |
var _local2:Point; | |
var _local3:Rectangle; | |
var _local4:int; | |
if (!this._lockOrigin){ | |
this._lockOrigin = true; | |
this._origin = _arg1; | |
_local2 = this._dummyBox.globalToLocal(this._parent.localToGlobal(_arg1)); | |
_local3 = this._dummyBox.getBounds(this._dummyBox); | |
this._dummyBox.graphics.clear(); | |
this._dummyBox.graphics.beginFill(26367, 1); | |
this._dummyBox.graphics.drawRect((_local3.x - _local2.x), (_local3.y - _local2.y), _local3.width, _local3.height); | |
this._dummyBox.graphics.endFill(); | |
this._dummyBox.x = this._origin.x; | |
this._dummyBox.y = this._origin.y; | |
this.enforceSafetyZone(); | |
_local4 = (this._selectedItems.length - 1); | |
while (_local4 > -1) { | |
this._selectedItems[_local4].origin = this._origin; | |
_local4--; | |
}; | |
this.plotHandles(); | |
this.renderSelection(); | |
this._lockOrigin = false; | |
}; | |
} | |
private function enforceSafetyZone():void{ | |
var locks:* = null; | |
var prevLockPosition:* = false; | |
var prevLockScale:* = false; | |
var b:* = null; | |
var recordLocks:* = function ():Array{ | |
var _local1:Array = []; | |
var _local2:int = (_selectedItems.length - 1); | |
while (_local2 > -1) { | |
_local1[_local2] = { | |
position:_selectedItems[_local2].lockPosition, | |
scale:_selectedItems[_local2].lockScale | |
}; | |
_local2--; | |
}; | |
return (_local1); | |
}; | |
var restoreLocks:* = function (_arg1:Array):void{ | |
var _local2:int = (_arg1.length - 1); | |
while (_local2 > -1) { | |
_selectedItems[_local2].lockPosition = _arg1[_local2].position; | |
_selectedItems[_local2].lockScale = _arg1[_local2].scale; | |
_local2--; | |
}; | |
}; | |
var shiftSelection:* = function (_arg1:Number, _arg2:Number):void{ | |
_dummyBox.x = (_dummyBox.x + _arg1); | |
_dummyBox.y = (_dummyBox.y + _arg2); | |
var _local3:int = (_selectedItems.length - 1); | |
while (_local3 > -1) { | |
_selectedItems[_local3].move(_arg1, _arg2, false, false); | |
_local3--; | |
}; | |
_origin.x = (_origin.x + _arg1); | |
_origin.y = (_origin.y + _arg2); | |
}; | |
var shiftSelectionScale:* = function (_arg1:Number):void{ | |
var _local3:int; | |
var _local2:Point = _origin.clone(); | |
_origin.x = (_selMaxBounds.x + (_selMaxBounds.width / 2)); | |
_origin.y = (_selMaxBounds.y + (_selMaxBounds.height / 2)); | |
_local3 = (_selectedItems.length - 1); | |
while (_local3 > -1) { | |
_selectedItems[_local3].origin = _origin; | |
_local3--; | |
}; | |
scaleSelection(_arg1, _arg1, false); | |
_origin.x = _local2.x; | |
_origin.y = _local2.y; | |
_local3 = (_selectedItems.length - 1); | |
while (_local3 > -1) { | |
_selectedItems[_local3].origin = _origin; | |
_local3--; | |
}; | |
updateSelection(); | |
}; | |
if (this._selMaxBounds != null){ | |
prevLockPosition = this._selLockPosition; | |
prevLockScale = this._selLockScale; | |
this._selLockPosition = false; | |
this._selLockScale = false; | |
if (!this._selMaxBounds.containsPoint(this._origin)){ | |
locks = recordLocks(); | |
if (this._selMaxBounds.left > this._origin.x){ | |
shiftSelection((this._selMaxBounds.left - this._origin.x), 0); | |
} else { | |
if (this._selMaxBounds.right < this._origin.x){ | |
shiftSelection((this._selMaxBounds.right - this._origin.x), 0); | |
}; | |
}; | |
if (this._selMaxBounds.top > this._origin.y){ | |
shiftSelection(0, (this._selMaxBounds.top - this._origin.y)); | |
} else { | |
if (this._selMaxBounds.bottom < this._origin.y){ | |
shiftSelection(0, (this._selMaxBounds.bottom - this._origin.y)); | |
}; | |
}; | |
}; | |
if (this._selectedItems.length != 0){ | |
if (locks == null){ | |
locks = recordLocks(); | |
}; | |
if (this._handles[0].point == null){ | |
this.plotHandles(); | |
}; | |
b = this.getSelectionRect(); | |
if ((this._selMaxBounds.width - b.width) < 0.2){ | |
shiftSelectionScale((1 - (0.22 / b.width))); | |
}; | |
b = this.getSelectionRect(); | |
if ((this._selMaxBounds.height - b.height) < 0.2){ | |
shiftSelectionScale((1 - (0.22 / b.height))); | |
}; | |
if (Math.abs((b.top - this._selMaxBounds.top)) < 0.1){ | |
shiftSelection(0, 0.1); | |
}; | |
if (Math.abs((b.bottom - this._selMaxBounds.bottom)) < 0.1){ | |
shiftSelection(0, -0.1); | |
}; | |
if (Math.abs((b.left - this._selMaxBounds.left)) < 0.1){ | |
shiftSelection(0.1, 0); | |
}; | |
if (Math.abs((b.right - this._selMaxBounds.right)) < 0.1){ | |
shiftSelection(-0.1, 0); | |
}; | |
}; | |
if (locks != null){ | |
restoreLocks(locks); | |
}; | |
this._selLockPosition = prevLockPosition; | |
this._selLockScale = prevLockScale; | |
}; | |
} | |
protected function onPressDelete(_arg1:Event=null):void{ | |
var _local2:Array; | |
var _local3:TransformItem; | |
var _local4:Boolean; | |
var _local5:int; | |
if (((this._enabled) && (this._allowDelete))){ | |
_local2 = []; | |
_local4 = Boolean((this._selectedItems.length > 1)); | |
_local5 = this._selectedItems.length; | |
while (_local5--) { | |
_local3 = this._selectedItems[_local5]; | |
if (_local3.onPressDelete(_arg1, _local4)){ | |
_local2[_local2.length] = _local3; | |
}; | |
}; | |
if (this._selectedItems.length == 0){ | |
this.removeParentListeners(); | |
}; | |
if (_local2.length > 0){ | |
dispatchEvent(new TransformEvent(TransformEvent.DELETE, _local2)); | |
}; | |
}; | |
} | |
public function deleteSelection(_arg1:Event=null):void{ | |
var _local3:TransformItem; | |
var _local2:Array = []; | |
var _local4:int = (this._selectedItems.length - 1); | |
while (_local4 > -1) { | |
_local3 = this._selectedItems[_local4]; | |
_local3.deleteObject(); | |
_local2.push(_local3); | |
_local4--; | |
}; | |
if (_local2.length != 0){ | |
dispatchEvent(new TransformEvent(TransformEvent.DELETE, _local2)); | |
}; | |
} | |
private function onPressArrowKey(_arg1:KeyboardEvent=null):void{ | |
var _local2:int; | |
if (((((((this._arrowKeysMove) && (this._enabled))) && (!((this._selectedItems.length == 0))))) && (!((this._stage.focus is TextField))))){ | |
_local2 = (isKeyDown(Keyboard.SHIFT)) ? 10 : 1; | |
this.dispatchInteractiveEvent(TransformEvent.START_INTERACTIVE_MOVE); | |
switch (_arg1.keyCode){ | |
case Keyboard.UP: | |
this.moveSelection(0, -(_local2)); | |
break; | |
case Keyboard.DOWN: | |
this.moveSelection(0, _local2); | |
break; | |
case Keyboard.LEFT: | |
this.moveSelection(-(_local2), 0); | |
break; | |
case Keyboard.RIGHT: | |
this.moveSelection(_local2, 0); | |
break; | |
}; | |
this.dispatchInteractiveEvent(TransformEvent.FINISH_INTERACTIVE_MOVE); | |
}; | |
} | |
public function centerOrigin():void{ | |
this.setOrigin(this.getSelectionCenter()); | |
} | |
public function getSelectionCenter():Point{ | |
var _local1:Rectangle = this._dummyBox.getBounds(this._dummyBox); | |
return (this._parent.globalToLocal(this._dummyBox.localToGlobal(new Point((_local1.x + (_local1.width / 2)), (_local1.y + (_local1.height / 2)))))); | |
} | |
public function getSelectionBounds(_arg1:DisplayObject=null):Rectangle{ | |
if (((this._parent.contains(this._dummyBox)) && (!((this._selectedItems.length == 0))))){ | |
if (_arg1){ | |
return (this._dummyBox.getBounds(_arg1)); | |
}; | |
return (this._dummyBox.getBounds(this._parent)); | |
}; | |
return (null); | |
} | |
public function getSelectionBoundsWithHandles(_arg1:DisplayObject=null):Rectangle{ | |
if (((this._parent.contains(this._selection)) && (!((this._selectedItems.length == 0))))){ | |
if (_arg1){ | |
return (this._selection.getBounds(_arg1)); | |
}; | |
return (this._selection.getBounds(this._parent)); | |
}; | |
return (null); | |
} | |
public function getUnrotatedSelectionWidth():Number{ | |
var _local1:Rectangle = this._dummyBox.getBounds(this._dummyBox); | |
return ((_local1.width * MatrixTools.getScaleX(this._dummyBox.transform.matrix, this._flipX))); | |
} | |
public function getUnrotatedSelectionHeight():Number{ | |
var _local1:Rectangle = this._dummyBox.getBounds(this._dummyBox); | |
return ((_local1.height * MatrixTools.getScaleY(this._dummyBox.transform.matrix, this._flipX))); | |
} | |
public function getItem(_arg1:DisplayObject):TransformItem{ | |
var _local2:int = (this._items.length - 1); | |
while (_local2 > -1) { | |
if (this._items[_local2].targetObject == _arg1){ | |
return (this._items[_local2]); | |
}; | |
_local2--; | |
}; | |
return (null); | |
} | |
private function findObject(_arg1):TransformItem{ | |
if ((_arg1 is DisplayObject)){ | |
return (this.getItem(_arg1)); | |
}; | |
if ((_arg1 is TransformItem)){ | |
return (_arg1); | |
}; | |
return (null); | |
} | |
private function updateItemProp(_arg1:String, _arg2):void{ | |
var _local3:int = (this._items.length - 1); | |
while (_local3 > -1) { | |
this._items[_local3][_arg1] = _arg2; | |
_local3--; | |
}; | |
} | |
private function removeParentListeners():void{ | |
if (((!((this._parent == null))) && (!((this._stage == null))))){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onReleaseMove); | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveMove); | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveRotate); | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveScale); | |
}; | |
} | |
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ | |
if (_arg1 == TransformEvent.MOVE){ | |
this._dispatchMoveEvents = true; | |
} else { | |
if (_arg1 == TransformEvent.SCALE){ | |
this._dispatchScaleEvents = true; | |
} else { | |
if (_arg1 == TransformEvent.ROTATE){ | |
this._dispatchRotateEvents = true; | |
}; | |
}; | |
}; | |
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); | |
} | |
protected function dispatchInteractiveEvent(_arg1:String):void{ | |
dispatchEvent(new TransformEvent(_arg1, this._selectedItems.slice())); | |
var _local2:int = this._selectedItems.length; | |
while (--_local2 > -1) { | |
TransformItem(this._selectedItems[_local2]).dispatchEvent(new TransformEvent(_arg1, [this._selectedItems[_local2]])); | |
}; | |
} | |
public function destroy():void{ | |
this.deselectAll(); | |
_keyDispatcher.removeEventListener("pressDelete", this.onPressDelete); | |
_keyDispatcher.removeEventListener("pressArrowKey", this.onPressArrowKey); | |
_keyDispatcher.removeEventListener("pressMultiSelectKey", this.onPressMultiSelectKey); | |
_keyDispatcher.removeEventListener("releaseMultiSelectKey", this.onReleaseMultiSelectKey); | |
if (this._stage != null){ | |
this._stage.removeEventListener(Event.DEACTIVATE, this.onReleaseMultiSelectKey); | |
}; | |
this.removeParentListeners(); | |
var _local1:int = (this._items.length - 1); | |
while (_local1 > -1) { | |
this._items[_local1].destroy(); | |
_local1--; | |
}; | |
dispatchEvent(new TransformEvent(TransformEvent.DESTROY, this._items.slice())); | |
} | |
public function moveSelectionDepthDown():void{ | |
this.moveSelectionDepth(-1); | |
} | |
public function moveSelectionDepthUp():void{ | |
this.moveSelectionDepth(1); | |
} | |
private function moveSelectionDepth(_arg1:int=1):void{ | |
var _local2:Array; | |
var _local3:Boolean; | |
var _local4:int; | |
var _local5:Array; | |
var _local6:Boolean; | |
if (((((((((this._enabled) && (!((this._selectedItems.length == 0))))) && (!((this._parent == null))))) && (this._parent.contains(this._dummyBox)))) && (this._parent.contains(this._selection)))){ | |
_local2 = []; | |
_local3 = this._parent.hasOwnProperty("getElementIndex"); | |
_local4 = (this._items.length - 1); | |
while (_local4 > -1) { | |
if (this._items[_local4].targetObject.parent == this._parent){ | |
_local2.push({ | |
depth:(_local3) ? Object(this._parent).getElementIndex(this._items[_local4].targetObject) : this._parent.getChildIndex(this._items[_local4].targetObject), | |
item:this._items[_local4] | |
}); | |
}; | |
_local4--; | |
}; | |
_local2.sortOn("depth", Array.NUMERIC); | |
_local5 = []; | |
_local6 = false; | |
if (_arg1 == -1){ | |
_local5.push(_local2[0].item.targetObject); | |
if (!_local2[0].item.selected){ | |
_local6 = true; | |
}; | |
_local4 = 1; | |
while (_local4 < _local2.length) { | |
if (((_local2[_local4].item.selected) && (_local6))){ | |
_local5.splice(-1, 0, _local2[_local4].item.targetObject); | |
} else { | |
_local5.push(_local2[_local4].item.targetObject); | |
if (((!(_local2[_local4].item.selected)) && (!(_local6)))){ | |
_local6 = true; | |
}; | |
}; | |
_local4++; | |
}; | |
} else { | |
_local5.push(_local2[(_local2.length - 1)].item.targetObject); | |
if (!_local2[(_local2.length - 1)].item.selected){ | |
_local6 = true; | |
}; | |
_local4 = (_local2.length - 2); | |
while (_local4 > -1) { | |
if (((_local2[_local4].item.selected) && (_local6))){ | |
_local5.splice(1, 0, _local2[_local4].item.targetObject); | |
} else { | |
_local5.unshift(_local2[_local4].item.targetObject); | |
if (((!(_local2[_local4].item.selected)) && (!(_local6)))){ | |
_local6 = true; | |
}; | |
}; | |
_local4--; | |
}; | |
}; | |
_local3 = Boolean(((this._isFlex) && (this._parent.hasOwnProperty("setElementIndex")))); | |
_local4 = 0; | |
while (_local4 < _local5.length) { | |
if (_local3){ | |
Object(this._parent).setElementIndex(_local5[_local4], _local2[_local4].depth); | |
} else { | |
this._parent.setChildIndex(_local5[_local4], _local2[_local4].depth); | |
}; | |
_local4++; | |
}; | |
dispatchEvent(new TransformEvent(TransformEvent.DEPTH_CHANGE, this._items.slice())); | |
}; | |
} | |
private function checkForDeselect(_arg1:MouseEvent=null):void{ | |
var _local2:int; | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:TransformItem; | |
if (((!((this._selectedItems.length == 0))) && (!((this._parent == null))))){ | |
_local2 = this._selectedItems.length; | |
_local3 = _arg1.stageX; | |
_local4 = _arg1.stageY; | |
_local5 = _tempDeselectedItem; | |
_tempDeselectedItem = null; | |
if (this._selection.hitTestPoint(_local3, _local4, true)){ | |
return; | |
}; | |
if (_local5){ | |
if (_local5.targetObject.hitTestPoint(_local3, _local4, true)){ | |
return; | |
}; | |
}; | |
while (_local2--) { | |
if (this._selectedItems[_local2].targetObject.hitTestPoint(_local3, _local4, true)){ | |
return; | |
}; | |
}; | |
_local2 = this._ignoredObjects.length; | |
while (_local2--) { | |
if (this._ignoredObjects[_local2].hitTestPoint(_local3, _local4, true)){ | |
return; | |
}; | |
}; | |
if (this._autoDeselect){ | |
this.deselectAll(); | |
} else { | |
dispatchEvent(new TransformEvent(TransformEvent.CLICK_OFF, this._selectedItems.slice(), _arg1)); | |
}; | |
}; | |
} | |
private function onMouseDownItem(_arg1:TransformEvent):void{ | |
if (isKeyDown(Keyboard.CONTROL)){ | |
_arg1.target.selected = !(_arg1.target.selected); | |
if (!_arg1.target.selected){ | |
_tempDeselectedItem = (_arg1.target as TransformItem); | |
}; | |
} else { | |
_arg1.target.selected = true; | |
}; | |
if (!_arg1.target.hasSelectableText){ | |
this._stage.stageFocusRect = false; | |
this._stage.focus = _arg1.target.targetObject; | |
}; | |
} | |
private function onMouseDownSelection(_arg1:MouseEvent):void{ | |
this._stage.addEventListener(MouseEvent.MOUSE_UP, this.onReleaseMove, false, 0, true); | |
this.onPressMove(_arg1); | |
} | |
public function selectItem(_arg1, _arg2:Boolean=false):TransformItem{ | |
var _local4:Boolean; | |
var _local3:TransformItem = this.findObject(_arg1); | |
if (_local3 == null){ | |
} else { | |
if (!_local3.selected){ | |
_local4 = this._multiSelectMode; | |
this._multiSelectMode = _arg2; | |
this._ignoreEvents = true; | |
_local3.selected = true; | |
this._ignoreEvents = false; | |
this._multiSelectMode = _local4; | |
dispatchEvent(new TransformEvent(TransformEvent.SELECTION_CHANGE, [_local3])); | |
}; | |
}; | |
return (_local3); | |
} | |
public function deselectItem(_arg1):TransformItem{ | |
var _local2:TransformItem = this.findObject(_arg1); | |
if (_local2 != null){ | |
_local2.selected = false; | |
}; | |
return (_local2); | |
} | |
public function selectItems(_arg1:Array, _arg2:Boolean=false):Array{ | |
var _local3:uint; | |
var _local4:uint; | |
var _local5:TransformItem; | |
var _local6:TransformItem; | |
var _local7:Boolean; | |
var _local10:Array; | |
var _local8:Array = []; | |
this._ignoreEvents = true; | |
_local3 = 0; | |
while (_local3 < _arg1.length) { | |
_local5 = this.findObject(_arg1[_local3]); | |
if (_local5 != null){ | |
_local8.push(_local5); | |
}; | |
_local3++; | |
}; | |
if (!_arg2){ | |
_local10 = this._selectedItems.slice(); | |
_local3 = 0; | |
while (_local3 < _local10.length) { | |
_local6 = _local10[_local3]; | |
_local7 = false; | |
_local4 = 0; | |
while (_local4 < _local8.length) { | |
if (_local8[_local4] == _local6){ | |
_local7 = true; | |
break; | |
}; | |
_local4++; | |
}; | |
if (!_local7){ | |
_local6.selected = false; | |
}; | |
_local3++; | |
}; | |
}; | |
var _local9:Boolean = this._multiSelectMode; | |
this._multiSelectMode = true; | |
_local3 = 0; | |
while (_local3 < _local8.length) { | |
_local8[_local3].selected = true; | |
_local3++; | |
}; | |
this._multiSelectMode = _local9; | |
this._ignoreEvents = false; | |
dispatchEvent(new TransformEvent(TransformEvent.SELECTION_CHANGE, _local8)); | |
return (_local8); | |
} | |
public function deselectAll():void{ | |
var _local1:Array = this._selectedItems.slice(); | |
this._ignoreEvents = true; | |
var _local2:int = (this._selectedItems.length - 1); | |
while (_local2 > -1) { | |
this._selectedItems[_local2].selected = false; | |
_local2--; | |
}; | |
this._ignoreEvents = false; | |
this.swapCursorOut(null); | |
dispatchEvent(new TransformEvent(TransformEvent.SELECTION_CHANGE, _local1)); | |
} | |
public function isSelected(_arg1):Boolean{ | |
var _local2:TransformItem = this.findObject(_arg1); | |
if (_local2 != null){ | |
return (_local2.selected); | |
}; | |
return (false); | |
} | |
private function onSelectItem(_arg1:TransformEvent):void{ | |
var _local2:int; | |
var _local3:Boolean = this._ignoreEvents; | |
this._ignoreEvents = true; | |
var _local4:Array = [(_arg1.target as TransformItem)]; | |
if (!this._multiSelectMode){ | |
_local2 = (this._selectedItems.length - 1); | |
while (_local2 > -1) { | |
_local4.push(this._selectedItems[_local2]); | |
this._selectedItems[_local2].selected = false; | |
this._selectedItems.splice(_local2, 1); | |
_local2--; | |
}; | |
}; | |
this._selectedItems.push(_arg1.target); | |
if (this._initted){ | |
if (this._forceSelectionToFront){ | |
_local2 = (this._selectedItems.length - 1); | |
while (_local2 > -1) { | |
bringToFront(this._selectedItems[_local2].targetObject); | |
_local2--; | |
}; | |
}; | |
this.calibrateConstraints(); | |
this.updateSelection(); | |
if (this.mouseIsOverSelection(true)){ | |
this.onRollOverSelectedItem(_arg1); | |
}; | |
}; | |
this._ignoreEvents = _local3; | |
if (!this._ignoreEvents){ | |
dispatchEvent(new TransformEvent(TransformEvent.SELECTION_CHANGE, _local4)); | |
}; | |
} | |
private function calibrateConstraints():void{ | |
var _local2:TransformItem; | |
this._selConstrainScale = false; | |
this._selLockScale = this._lockScale; | |
this._selLockRotation = this._lockRotation; | |
this._selLockPosition = this._lockPosition; | |
this._selHasTextFields = (this._selHasSizeLimits = false); | |
this._selMinBounds = null; | |
this._selMaxBounds = null; | |
var _local1:int = this._selectedItems.length; | |
while (--_local1 > -1) { | |
_local2 = this._selectedItems[_local1]; | |
if (_local2.constrainScale){ | |
this._selConstrainScale = true; | |
}; | |
if (_local2.lockScale){ | |
this._selLockScale = true; | |
}; | |
if (_local2.lockRotation){ | |
this._selLockRotation = true; | |
}; | |
if (_local2.lockPosition){ | |
this._selLockPosition = true; | |
}; | |
if (_local2.scaleMode != SCALE_NORMAL){ | |
this._selHasTextFields = true; | |
}; | |
if (_local2.hasSizeLimits){ | |
this._selHasSizeLimits = true; | |
}; | |
if (_local2.bounds != null){ | |
if (this._selMinBounds == null){ | |
this._selMinBounds = _local2.bounds.clone(); | |
this._selMaxBounds = this._selMinBounds.clone(); | |
} else { | |
this._selMinBounds = this._selMinBounds.intersection(_local2.bounds); | |
this._selMaxBounds = this._selMaxBounds.union(_local2.bounds); | |
}; | |
}; | |
}; | |
} | |
private function onDeselectItem(_arg1:TransformEvent):void{ | |
var _local2:int = (this._selectedItems.length - 1); | |
while (_local2 > -1) { | |
if (this._selectedItems[_local2] == _arg1.target){ | |
this._selectedItems.splice(_local2, 1); | |
this.updateSelection(); | |
if (!this._ignoreEvents){ | |
dispatchEvent(new TransformEvent(TransformEvent.SELECTION_CHANGE, [(_arg1.target as TransformItem)])); | |
}; | |
if (!this.mouseIsOverSelection(true)){ | |
this.swapCursorOut(); | |
}; | |
if (((this._lockCursor) && ((this._selectedItems.length == 0)))){ | |
this.unlockCursor(); | |
}; | |
return; | |
}; | |
_local2--; | |
}; | |
} | |
private function onUpdateItem(_arg1:TransformEvent):void{ | |
if (!this._ignoreEvents){ | |
if (_arg1.type == TransformEvent.UPDATE){ | |
this.calibrateConstraints(); | |
}; | |
if (((_arg1.target.selected) && (!(this._isTransforming)))){ | |
this.updateSelection(true); | |
dispatchEvent(new TransformEvent(TransformEvent.UPDATE, [_arg1.target])); | |
}; | |
}; | |
} | |
public function updateSelection(_arg1:Boolean=true):void{ | |
var _local2:Rectangle; | |
var _local3:TransformItem; | |
var _local4:DisplayObject; | |
var _local5:Matrix; | |
if (!this._initted){ | |
} else { | |
if (this._selectedItems.length != 0){ | |
if (this._dummyBox.parent != this._parent){ | |
if (((this._isFlex) && (this._parent.hasOwnProperty("addElement")))){ | |
(this._parent as Object).addElement(this._dummyBox); | |
} else { | |
this._parent.addChild(this._dummyBox); | |
}; | |
}; | |
this._dummyBox.transform.matrix = new Matrix(); | |
this._dummyBox.graphics.clear(); | |
this._dummyBox.graphics.beginFill(26367, 1); | |
if (this._selectedItems.length == 1){ | |
_local3 = this._selectedItems[0]; | |
_local4 = _local3.targetObject; | |
_local5 = _local4.transform.matrix; | |
if (_local3.manualBoundsOffset != null){ | |
_local4.transform.matrix = new Matrix(); | |
this._dummyBox.graphics.drawRect(_local3.manualBoundsOffset.x, _local3.manualBoundsOffset.y, (_local4.width + _local3.manualBoundsOffset.width), (_local4.height + _local3.manualBoundsOffset.height)); | |
this._dummyBox.transform.matrix = (_local4.transform.matrix = _local5); | |
} else { | |
if (_local4.width != 0){ | |
_local4.transform.matrix = new Matrix(); | |
_local2 = _local4.getBounds(_local4); | |
this._dummyBox.graphics.drawRect(_local2.x, _local2.y, _local4.width, _local4.height); | |
this._dummyBox.transform.matrix = (_local4.transform.matrix = _local5); | |
} else { | |
_local2 = _local4.getBounds(_local4); | |
this._dummyBox.graphics.drawRect(_local2.x, _local2.y, _local2.width, _local2.height); | |
this._dummyBox.transform.matrix = _local4.transform.matrix; | |
}; | |
}; | |
this._flipX = Boolean((_local3.scaleX < 0)); | |
} else { | |
this._flipX = false; | |
_local2 = this.getSelectionRect(); | |
this._dummyBox.graphics.drawRect(_local2.x, _local2.y, _local2.width, _local2.height); | |
}; | |
this._dummyBox.graphics.endFill(); | |
if (((_arg1) || ((this._origin == null)))){ | |
this.centerOrigin(); | |
} else { | |
this.setOrigin(this._origin); | |
}; | |
if (this._selection.parent != this._parent){ | |
if (((this._isFlex) && (this._parent.hasOwnProperty("addElement")))){ | |
(this._parent as Object).addElement(this._selection); | |
} else { | |
this._parent.addChild(this._selection); | |
}; | |
}; | |
this.renderSelection(); | |
bringToFront(this._selection); | |
} else { | |
if (this._parent != null){ | |
if (this._selection.parent == this._parent){ | |
if (((this._isFlex) && (this._parent.hasOwnProperty("removeElement")))){ | |
(this._parent as Object).removeElement(this._selection); | |
} else { | |
this._parent.removeChild(this._selection); | |
}; | |
}; | |
if (this._dummyBox.parent == this._parent){ | |
if (((this._isFlex) && (this._parent.hasOwnProperty("removeElement")))){ | |
(this._parent as Object).removeElement(this._dummyBox); | |
} else { | |
this._parent.removeChild(this._dummyBox); | |
}; | |
}; | |
}; | |
}; | |
}; | |
} | |
private function renderSelection():void{ | |
var _local1:Matrix; | |
var _local2:Number; | |
var _local3:Boolean; | |
var _local4:Point; | |
var _local5:Point; | |
var _local6:int; | |
var _local7:Object; | |
var _local8:Number; | |
var _local9:Object; | |
var _local10:Sprite; | |
var _local11:Number; | |
var _local12:Object; | |
if (this._initted){ | |
_local1 = this._dummyBox.transform.matrix; | |
this._selection.graphics.clear(); | |
if (this._lineThickness){ | |
this._selection.graphics.lineStyle(this._lineThickness, this._lineColor, 1, false, "none"); | |
}; | |
this._edges.graphics.clear(); | |
this._edges.graphics.lineStyle(10, 0xFF0000, 0, false, "none"); | |
_local2 = (MatrixTools.getAngle(_local1, this._flipX) * _RAD2DEG); | |
_local3 = Boolean(((MatrixTools.getScaleX(_local1, this._flipX) * MatrixTools.getScaleY(_local1, this._flipX)) < 0)); | |
_local6 = (this._handles.length - 1); | |
while (_local6 > -1) { | |
_local7 = this._handles[_local6]; | |
_local4 = _local1.transformPoint(_local7.point); | |
_local7.handle.x = _local4.x; | |
_local7.handle.y = _local4.y; | |
_local8 = _local2; | |
if (_local3){ | |
_local8 = (_local8 + _local7.flipRotation); | |
}; | |
if (this._flipX){ | |
_local8 = (_local8 + 180); | |
}; | |
_local7.handle.rotation = _local8; | |
if (_local6 == 8){ | |
this._selection.graphics.moveTo(_local4.x, _local4.y); | |
this._edges.graphics.moveTo(_local4.x, _local4.y); | |
_local5 = _local4; | |
} else { | |
if (_local6 > 4){ | |
this._selection.graphics.lineTo(_local4.x, _local4.y); | |
this._edges.graphics.lineTo(_local4.x, _local4.y); | |
}; | |
}; | |
_local6--; | |
}; | |
this._selection.graphics.lineTo(_local5.x, _local5.y); | |
this._edges.graphics.lineTo(_local5.x, _local5.y); | |
_local12 = (_local3) ? _handleOrientationsFlipped : _handleOrientationsNormal; | |
_local6 = this._selectionElements.length; | |
while (--_local6 > -1) { | |
_local9 = this._selectionElements[_local6]; | |
_local10 = this._handles[_local12[_local9.alignment]].handle; | |
_local8 = this._dummyBox.rotation; | |
if (_local3){ | |
_local8 = (_local8 + 180); | |
}; | |
_local9.element.rotation = _local8; | |
_local11 = ((_local9.element.rotation * _DEG2RAD) + _local9.angle); | |
_local9.element.x = (_local10.x + (Math.cos(_local11) * _local9.length)); | |
_local9.element.y = (_local10.y + (Math.sin(_local11) * _local9.length)); | |
}; | |
}; | |
} | |
public function addSelectionBoxElement(_arg1:DisplayObject, _arg2:String="topRight", _arg3:Number=0, _arg4:Number=0, _arg5:Boolean=false):void{ | |
if (!(_arg2 in _handleOrientationsNormal)){ | |
throw (new Error((_arg2 + " not a valid alignment parameter in addSelectionBoxElement()."))); | |
}; | |
this.removeSelectionBoxElement(_arg1); | |
this._selectionElements.push({ | |
element:_arg1, | |
alignment:_arg2, | |
angle:Math.atan2(_arg4, _arg3), | |
length:Math.sqrt(((_arg3 * _arg3) + (_arg4 * _arg4))), | |
underHandles:_arg5 | |
}); | |
if (this._selection != null){ | |
if (_arg5){ | |
this._selection.addChildAt(_arg1, 0); | |
} else { | |
this._selection.addChild(_arg1); | |
}; | |
this.plotHandles(); | |
this.renderSelection(); | |
}; | |
} | |
public function removeSelectionBoxElement(_arg1:DisplayObject):void{ | |
var _local2:int = this._selectionElements.length; | |
while (--_local2 > -1) { | |
if (this._selectionElements[_local2].element == _arg1){ | |
this._selectionElements.splice(_local2, 1); | |
if (_arg1.parent == this._selection){ | |
this._selection.removeChild(_arg1); | |
}; | |
}; | |
}; | |
} | |
private function getSelectionRect():Rectangle{ | |
if (this._selectedItems.length == 0){ | |
return (new Rectangle()); | |
}; | |
var _local1:int = (this._selectedItems.length - 1); | |
var _local2:Rectangle = this._selectedItems[_local1].targetObject.getBounds(this._parent); | |
while (_local1--) { | |
_local2 = _local2.union(this._selectedItems[_local1].targetObject.getBounds(this._parent)); | |
}; | |
return (_local2); | |
} | |
private function initSelection():void{ | |
var _local1:int; | |
this._selection = (this._isFlex) ? new (getDefinitionByName("mx.core.UIComponent")) : new Sprite(); | |
this._selection.name = "__selection_mc"; | |
this._edges = new Sprite(); | |
this._edges.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDownSelection, false, 0, true); | |
this._selection.addChild(this._edges); | |
this._dummyBox = (this._isFlex) ? new (getDefinitionByName("mx.core.UIComponent")) : new Sprite(); | |
this._dummyBox.name = "__dummyBox_mc"; | |
this._dummyBox.visible = false; | |
this._handles = []; | |
this.createHandle("c", "center", 0, 0, null); | |
this.createHandle("t", "stretchV", -90, 0, "b"); | |
this.createHandle("r", "stretchH", 0, 0, "l"); | |
this.createHandle("b", "stretchV", 90, 0, "t"); | |
this.createHandle("l", "stretchH", 180, 0, "r"); | |
this.createHandle("tl", "corner", -135, -90, "br"); | |
this.createHandle("tr", "corner", -45, 90, "bl"); | |
this.createHandle("br", "corner", 45, -90, "tl"); | |
this.createHandle("bl", "corner", 135, 90, "tr"); | |
if (this._selectionElements != null){ | |
_local1 = this._selectionElements.length; | |
while (--_local1 > -1) { | |
if (this._selectionElements[_local1].underHandles){ | |
this._selection.addChildAt(this._selectionElements[_local1].element, 0); | |
} else { | |
this._selection.addChild(this._selectionElements[_local1].element); | |
}; | |
}; | |
}; | |
this.redrawHandles(); | |
this.setCursorListeners(true); | |
} | |
private function createHandle(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number=0, _arg5:String=null):Object{ | |
var _local9:Function; | |
var _local10:Sprite; | |
var _local6:Sprite = new Sprite(); | |
_local6.name = _arg1; | |
var _local7:Sprite = new Sprite(); | |
_local7.name = "scaleHandle"; | |
var _local8:Object = { | |
handle:_local6, | |
scaleHandle:_local7, | |
type:_arg2, | |
name:_arg1, | |
oppositeName:_arg5, | |
flipRotation:_arg4, | |
cursorRotation:_arg3 | |
}; | |
this._handlesDict[_local7] = _local8; | |
if (_arg2 != "center"){ | |
if (_arg2 == "stretchH"){ | |
_local9 = this.onPressStretchH; | |
} else { | |
if (_arg2 == "stretchV"){ | |
_local9 = this.onPressStretchV; | |
} else { | |
_local9 = this.onPressScale; | |
_local10 = new Sprite(); | |
_local10.name = "rotationHandle"; | |
_local10.addEventListener(MouseEvent.MOUSE_DOWN, this.onPressRotate, false, 0, true); | |
_local6.addChild(_local10); | |
this._handlesDict[_local10] = _local8; | |
_local8.rotationHandle = _local10; | |
}; | |
}; | |
_local7.addEventListener(MouseEvent.MOUSE_DOWN, _local9, false, 0, true); | |
} else { | |
_local7.addEventListener(MouseEvent.MOUSE_DOWN, this.onMouseDownSelection, false, 0, true); | |
}; | |
_local6.addChild(_local7); | |
this._selection.addChild(_local6); | |
this._handles.push(_local8); | |
return (_local8); | |
} | |
private function redrawHandles():void{ | |
var _local1:uint; | |
var _local2:Sprite; | |
var _local3:Sprite; | |
var _local4:String; | |
var _local5:Number; | |
var _local6:Number; | |
var _local7:Number = (this._handleSize / 2); | |
_local1 = 0; | |
while (_local1 < this._handles.length) { | |
_local2 = this._handles[_local1].scaleHandle; | |
_local4 = this._handles[_local1].name; | |
_local2.graphics.clear(); | |
if (this._lineThickness){ | |
_local2.graphics.lineStyle(this._lineThickness, this._lineColor, 1, false, "none"); | |
}; | |
_local2.graphics.beginFill(this._handleColor, 1); | |
_local2.graphics.drawRect((0 - (this._handleSize / 2)), (0 - (this._handleSize / 2)), this._handleSize, this._handleSize); | |
_local2.graphics.endFill(); | |
if (this._handles[_local1].type == "corner"){ | |
_local3 = this._handles[_local1].rotationHandle; | |
if (_local4 == "tl"){ | |
_local6 = (-(_local7) - this._paddingForRotation); | |
_local5 = _local6; | |
} else { | |
if (_local4 == "tr"){ | |
_local5 = -(_local7); | |
_local6 = (-(_local7) - this._paddingForRotation); | |
} else { | |
if (_local4 == "br"){ | |
_local6 = -(_local7); | |
_local5 = _local6; | |
} else { | |
_local5 = (-(_local7) - this._paddingForRotation); | |
_local6 = -(_local7); | |
}; | |
}; | |
}; | |
_local3.graphics.clear(); | |
_local3.graphics.lineStyle(0, this._lineColor, 0); | |
_local3.graphics.beginFill(0xFF0000, 0); | |
_local3.graphics.drawRect(_local5, _local6, (this._handleSize + this._paddingForRotation), (this._handleSize + this._paddingForRotation)); | |
_local3.graphics.endFill(); | |
} else { | |
if (this._handles[_local1].type == "center"){ | |
_local2.visible = !(this._hideCenterHandle); | |
}; | |
}; | |
_local1++; | |
}; | |
} | |
private function plotHandles():void{ | |
var _local1:Rectangle = this._dummyBox.getBounds(this._dummyBox); | |
this._handles[0].point = new Point((_local1.x + (_local1.width / 2)), (_local1.y + (_local1.height / 2))); | |
this._handles[1].point = new Point((_local1.x + (_local1.width / 2)), _local1.y); | |
this._handles[2].point = new Point((_local1.x + _local1.width), (_local1.y + (_local1.height / 2))); | |
this._handles[3].point = new Point((_local1.x + (_local1.width / 2)), (_local1.y + _local1.height)); | |
this._handles[4].point = new Point(_local1.x, (_local1.y + (_local1.height / 2))); | |
this._handles[5].point = new Point(_local1.x, _local1.y); | |
this._handles[6].point = new Point((_local1.x + _local1.width), _local1.y); | |
this._handles[7].point = new Point((_local1.x + _local1.width), (_local1.y + _local1.height)); | |
this._handles[8].point = new Point(_local1.x, (_local1.y + _local1.height)); | |
} | |
private function onPressMove(_arg1:Event):void{ | |
if (!this._selLockPosition){ | |
this._isTransforming = true; | |
this._trackingInfo = { | |
moved:false, | |
offsetX:(this._parent.mouseX - this._dummyBox.x), | |
offsetY:(this._parent.mouseY - this._dummyBox.y), | |
x:this._dummyBox.x, | |
y:this._dummyBox.y, | |
mouseX:this._parent.mouseX, | |
mouseY:this._parent.mouseY | |
}; | |
this._stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveMove, false, 0, true); | |
this.swapCursorIn(_moveCursor, null); | |
this.lockCursor(); | |
this.onMouseMoveMove(); | |
}; | |
} | |
private function onMouseMoveMove(_arg1:MouseEvent=null):void{ | |
if (((!(this._trackingInfo.moved)) && (!((_arg1 == null))))){ | |
this._trackingInfo.moved = true; | |
this.dispatchInteractiveEvent(TransformEvent.START_INTERACTIVE_MOVE); | |
}; | |
var _local2:Number = int((this._parent.mouseX - (this._dummyBox.x + this._trackingInfo.offsetX))); | |
var _local3:Number = int((this._parent.mouseY - (this._dummyBox.y + this._trackingInfo.offsetY))); | |
var _local4:Number = (this._parent.mouseX - this._trackingInfo.mouseX); | |
var _local5:Number = (this._parent.mouseY - this._trackingInfo.mouseY); | |
if (!isKeyDown(Keyboard.SHIFT)){ | |
this.moveSelection(_local2, _local3); | |
} else { | |
if (Math.abs(_local4) > Math.abs(_local5)){ | |
this.moveSelection(_local2, (this._trackingInfo.y - this._dummyBox.y)); | |
} else { | |
this.moveSelection((this._trackingInfo.x - this._dummyBox.x), _local3); | |
}; | |
}; | |
if (_arg1 != null){ | |
_arg1.updateAfterEvent(); | |
}; | |
} | |
public function moveSelection(_arg1:Number, _arg2:Number, _arg3:Boolean=true):void{ | |
var _local4:Object; | |
var _local5:Matrix; | |
var _local6:int; | |
if (!this._selLockPosition){ | |
_local4 = { | |
x:_arg1, | |
y:_arg2 | |
}; | |
_local5 = this._dummyBox.transform.matrix; | |
this._dummyBox.x = (this._dummyBox.x + _arg1); | |
this._dummyBox.y = (this._dummyBox.y + _arg2); | |
if (((!((this._selMinBounds == null))) && (!(this._selMinBounds.containsRect(this._dummyBox.getBounds(this._parent)))))){ | |
_local6 = (this._selectedItems.length - 1); | |
while (_local6 > -1) { | |
this._selectedItems[_local6].moveCheck(_arg1, _arg2, _local4); | |
_local6--; | |
}; | |
_local5.translate(_local4.x, _local4.y); | |
this._dummyBox.transform.matrix = _local5; | |
}; | |
this._ignoreEvents = true; | |
_local6 = (this._selectedItems.length - 1); | |
while (_local6 > -1) { | |
this._selectedItems[_local6].move(_local4.x, _local4.y, false, _arg3); | |
_local6--; | |
}; | |
this._ignoreEvents = false; | |
this._origin.x = this._dummyBox.x; | |
this._origin.y = this._dummyBox.y; | |
this.renderSelection(); | |
if (((((this._dispatchMoveEvents) && (_arg3))) && (((!((_local4.x == 0))) || (!((_local4.y == 0))))))){ | |
dispatchEvent(new TransformEvent(TransformEvent.MOVE, this._selectedItems.slice())); | |
}; | |
}; | |
} | |
private function onReleaseMove(_arg1:Event):void{ | |
var _local2:uint = getTimer(); | |
var _local3:MouseEvent = ((_arg1 is MouseEvent)) ? (_arg1 as MouseEvent) : TransformEvent(_arg1).mouseEvent; | |
if (((((((((_local2 - this._lastClickTime) < 500)) && (!((this._lastClickEvent == null))))) && ((Math.abs((_local3.stageX - this._lastClickEvent.stageX)) < 3)))) && ((Math.abs((_local3.stageY - this._lastClickEvent.stageY)) < 3)))){ | |
dispatchEvent(new TransformEvent(TransformEvent.DOUBLE_CLICK, this._selectedItems.slice())); | |
}; | |
this._lastClickTime = _local2; | |
this._lastClickEvent = _local3; | |
if (!this._selLockPosition){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveMove); | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onReleaseMove); | |
this.unlockCursor(); | |
this._isTransforming = false; | |
if (this._trackingInfo.moved){ | |
this.dispatchInteractiveEvent(TransformEvent.FINISH_INTERACTIVE_MOVE); | |
}; | |
}; | |
} | |
private function onPressScale(_arg1:MouseEvent):void{ | |
if (((!(this._selLockScale)) && (((!(this._selHasTextFields)) || ((this._selectedItems.length == 1)))))){ | |
this._isTransforming = true; | |
this.setScaleOrigin((_arg1.target as Sprite)); | |
this.captureScaleTrackingInfo((_arg1.target as Sprite)); | |
this._stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveScale, false, 0, true); | |
this._stage.addEventListener(MouseEvent.MOUSE_UP, this.onReleaseScale, false, 0, true); | |
this.lockCursor(); | |
this.onMouseMoveScale(); | |
}; | |
} | |
private function setScaleOrigin(_arg1:Sprite):void{ | |
var _local2:DisplayObject; | |
bringToFront(_arg1.parent); | |
if (this._scaleFromCenter){ | |
this.centerOrigin(); | |
} else { | |
_local2 = this._selection.getChildByName(this._handlesDict[_arg1].oppositeName); | |
this.setOrigin(new Point(_local2.x, _local2.y)); | |
}; | |
} | |
private function onMouseMoveScale(_arg1:MouseEvent=null):void{ | |
if (((!(this._trackingInfo.scaled)) && (!((_arg1 == null))))){ | |
this._trackingInfo.scaled = true; | |
this.dispatchInteractiveEvent(TransformEvent.START_INTERACTIVE_SCALE); | |
}; | |
this.updateScale(true, true); | |
if (_arg1 != null){ | |
_arg1.updateAfterEvent(); | |
}; | |
} | |
private function updateScale(_arg1:Boolean=true, _arg2:Boolean=true):void{ | |
var _local11:Number; | |
var _local12:Number; | |
var _local13:Number; | |
var _local14:Number; | |
var _local15:Number; | |
var _local3:Object = this._trackingInfo; | |
var _local4:Number = (this._parent.mouseX - _local3.mouseOffsetX); | |
var _local5:Number = (this._parent.mouseY - _local3.mouseOffsetY); | |
if (this._bounds != null){ | |
if (_local4 >= this._bounds.right){ | |
_local4 = (this._bounds.right - 0.02); | |
} else { | |
if (_local4 <= this._bounds.left){ | |
_local4 = (this._bounds.left + 0.02); | |
}; | |
}; | |
if (_local5 >= this._bounds.bottom){ | |
_local5 = (this._bounds.bottom - 0.02); | |
} else { | |
if (_local5 <= this._bounds.top){ | |
_local5 = (this._bounds.top + 0.02); | |
}; | |
}; | |
}; | |
var _local6:Number = (_local4 - this._origin.x); | |
var _local7:Number = (this._origin.y - _local5); | |
var _local8:Number = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); | |
var _local9:Number = Math.atan2(_local7, _local6); | |
var _local10:Boolean = ((this._selConstrainScale) || (isKeyDown(Keyboard.SHIFT))); | |
if (_local10){ | |
_local15 = (((_local9 - _local3.angleToMouse) + (Math.PI * 3.5)) % (Math.PI * 2)); | |
if (_local15 < Math.PI){ | |
_local8 = (_local8 * -1); | |
}; | |
_local11 = (_local8 * _local3.scaleRatioXConst); | |
_local12 = (_local8 * _local3.scaleRatioYConst); | |
} else { | |
_local9 = (_local9 + _local3.angle); | |
_local11 = ((_local3.scaleRatioX * Math.cos(_local9)) * _local8); | |
_local12 = ((_local3.scaleRatioY * Math.sin(_local9)) * _local8); | |
}; | |
if (((((_arg1) || (_local10))) && ((((_local11 > 0.001)) || ((_local11 < -0.001)))))){ | |
_local13 = (_local11 / this._prevScaleX); | |
} else { | |
_local13 = 1; | |
}; | |
if (((((_arg2) || (_local10))) && ((((_local12 > 0.001)) || ((_local12 < -0.001)))))){ | |
_local14 = (_local12 / this._prevScaleY); | |
} else { | |
_local14 = 1; | |
}; | |
this.scaleSelection(_local13, _local14); | |
} | |
public function scaleSelection(_arg1:Number, _arg2:Number, _arg3:Boolean=true):void{ | |
var _local4:int; | |
var _local5:Matrix; | |
var _local6:Matrix; | |
var _local7:Number; | |
var _local8:Number; | |
var _local9:Object; | |
if (((!(this._selLockScale)) && (((!(this._selHasTextFields)) || ((((((this._selectedItems.length == 1)) && ((_arg1 > 0)))) && ((_arg2 > 0)))))))){ | |
_local5 = this._dummyBox.transform.matrix; | |
_local6 = _local5.clone(); | |
_local7 = MatrixTools.getAngle(_local5, this._flipX); | |
_local8 = MatrixTools.getSkew(_local5); | |
if (((!((_local7 == -(_local8)))) && ((Math.abs(((_local7 + _local8) % (Math.PI - 0.01))) < 0.01)))){ | |
_local8 = -(_local7); | |
}; | |
MatrixTools.scaleMatrix(_local5, _arg1, _arg2, _local7, _local8); | |
this._dummyBox.transform.matrix = _local5; | |
_local9 = { | |
sx:_arg1, | |
sy:_arg2 | |
}; | |
if (((this._selHasSizeLimits) || (((!((this._selMinBounds == null))) && (!(this._selMinBounds.containsRect(this._dummyBox.getBounds(this._parent)))))))){ | |
_local4 = (this._selectedItems.length - 1); | |
while (_local4 > -1) { | |
this._selectedItems[_local4].scaleCheck(_local9, _local7, _local8, ((this._selConstrainScale) || (isKeyDown(Keyboard.SHIFT)))); | |
_local4--; | |
}; | |
MatrixTools.scaleMatrix(_local6, _local9.sx, _local9.sy, _local7, _local8); | |
this._dummyBox.transform.matrix = _local6; | |
}; | |
this._ignoreEvents = true; | |
_local4 = (this._selectedItems.length - 1); | |
while (_local4 > -1) { | |
this._selectedItems[_local4].scaleRotated(_local9.sx, _local9.sy, _local7, _local8, false, _arg3); | |
_local4--; | |
}; | |
this._ignoreEvents = false; | |
if (_local9.sx < 0){ | |
this._flipX = !(this._flipX); | |
}; | |
this._prevScaleX = (this._prevScaleX * _local9.sx); | |
this._prevScaleY = (this._prevScaleY * _local9.sy); | |
this.renderSelection(); | |
if (((((this._dispatchScaleEvents) && (_arg3))) && (((!((_local9.sx == 1))) || (!((_local9.sy == 1))))))){ | |
dispatchEvent(new TransformEvent(TransformEvent.SCALE, this._selectedItems.slice())); | |
}; | |
}; | |
} | |
public function flipSelectionHorizontal():void{ | |
if (((this._enabled) && (!((this._selectedItems.length == 0))))){ | |
this.scaleSelection(-1, 1); | |
}; | |
} | |
public function flipSelectionVertical():void{ | |
if (((this._enabled) && (!((this._selectedItems.length == 0))))){ | |
this.scaleSelection(1, -1); | |
}; | |
} | |
private function onReleaseScale(_arg1:MouseEvent):void{ | |
if (!this._selLockScale){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onReleaseScale); | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveScale); | |
this.unlockCursor(); | |
this.centerOrigin(); | |
this._isTransforming = false; | |
if (this._trackingInfo.scaled){ | |
this.dispatchInteractiveEvent(TransformEvent.FINISH_INTERACTIVE_SCALE); | |
}; | |
}; | |
} | |
private function captureScaleTrackingInfo(_arg1:Sprite):void{ | |
var _local2:Point = this._parent.globalToLocal(_arg1.localToGlobal(new Point(0, 0))); | |
var _local3:Number = (_local2.x - this._origin.x); | |
var _local4:Number = (this._origin.y - _local2.y); | |
var _local5:Number = Math.sqrt(((_local3 * _local3) + (_local4 * _local4))); | |
var _local6:Number = Math.atan2(_local4, _local3); | |
var _local7:Matrix = this._dummyBox.transform.matrix; | |
var _local8:Number = MatrixTools.getAngle(_local7, this._flipX); | |
var _local9:Number = MatrixTools.getSkew(_local7); | |
var _local10:Number = (_local6 + _local8); | |
var _local11:Number = (this._prevScaleX = MatrixTools.getScaleX(_local7, this._flipX)); | |
var _local12:Number = (this._prevScaleY = MatrixTools.getScaleY(_local7, this._flipX)); | |
this._trackingInfo = { | |
scaleRatioX:(_local11 / (Math.cos(_local10) * _local5)), | |
scaleRatioY:(_local12 / (Math.sin(_local10) * _local5)), | |
scaleRatioXConst:(_local11 / _local5), | |
scaleRatioYConst:(_local12 / _local5), | |
angleToMouse:positiveAngle(_local6), | |
angle:_local8, | |
skew:_local9, | |
mouseX:this._parent.mouseX, | |
mouseY:this._parent.mouseY, | |
scaleX:_local11, | |
scaleY:_local12, | |
mouseOffsetX:(this._parent.mouseX - _local2.x), | |
mouseOffsetY:(this._parent.mouseY - _local2.y), | |
handle:_arg1, | |
scaled:false | |
}; | |
} | |
private function onPressStretchH(_arg1:MouseEvent):void{ | |
if (!this._selLockScale){ | |
this._isTransforming = true; | |
this.setScaleOrigin((_arg1.target as Sprite)); | |
this.captureScaleTrackingInfo((_arg1.target as Sprite)); | |
this._stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveStretchH, false, 0, true); | |
this._stage.addEventListener(MouseEvent.MOUSE_UP, this.onReleaseStretchH, false, 0, true); | |
this.lockCursor(); | |
this.onMouseMoveStretchH(); | |
}; | |
} | |
private function onMouseMoveStretchH(_arg1:MouseEvent=null):void{ | |
if (((!(this._trackingInfo.scaled)) && (!((_arg1 == null))))){ | |
this._trackingInfo.scaled = true; | |
this.dispatchInteractiveEvent(TransformEvent.START_INTERACTIVE_SCALE); | |
}; | |
this.updateScale(true, false); | |
if (_arg1 != null){ | |
_arg1.updateAfterEvent(); | |
}; | |
} | |
private function onReleaseStretchH(_arg1:MouseEvent):void{ | |
if (!this._selLockScale){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onReleaseStretchH); | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveStretchH); | |
this.unlockCursor(); | |
this.centerOrigin(); | |
this._isTransforming = false; | |
if (this._trackingInfo.scaled){ | |
this.dispatchInteractiveEvent(TransformEvent.FINISH_INTERACTIVE_SCALE); | |
}; | |
}; | |
} | |
private function onPressStretchV(_arg1:MouseEvent):void{ | |
if (!this._selLockScale){ | |
this._isTransforming = true; | |
this.setScaleOrigin((_arg1.target as Sprite)); | |
this.captureScaleTrackingInfo((_arg1.target as Sprite)); | |
this._stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveStretchV, false, 0, true); | |
this._stage.addEventListener(MouseEvent.MOUSE_UP, this.onReleaseStretchV, false, 0, true); | |
this.lockCursor(); | |
this.onMouseMoveStretchV(); | |
}; | |
} | |
private function onMouseMoveStretchV(_arg1:MouseEvent=null):void{ | |
if (((!(this._trackingInfo.scaled)) && (!((_arg1 == null))))){ | |
this._trackingInfo.scaled = true; | |
this.dispatchInteractiveEvent(TransformEvent.START_INTERACTIVE_SCALE); | |
}; | |
this.updateScale(false, true); | |
if (_arg1 != null){ | |
_arg1.updateAfterEvent(); | |
}; | |
} | |
private function onReleaseStretchV(_arg1:MouseEvent):void{ | |
if (!this._selLockScale){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onReleaseStretchV); | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveStretchV); | |
this.unlockCursor(); | |
this.centerOrigin(); | |
this._isTransforming = false; | |
if (this._trackingInfo.scaled){ | |
this.dispatchInteractiveEvent(TransformEvent.FINISH_INTERACTIVE_SCALE); | |
}; | |
}; | |
} | |
private function onPressRotate(_arg1:MouseEvent):void{ | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:Number; | |
if (!this._selLockRotation){ | |
this._isTransforming = true; | |
this.centerOrigin(); | |
_local2 = (this._parent.mouseX - this._origin.x); | |
_local3 = (this._origin.y - this._parent.mouseY); | |
_local4 = Math.atan2(_local3, _local2); | |
_local5 = (this._dummyBox.rotation * _DEG2RAD); | |
this._trackingInfo = { | |
angleToMouse:positiveAngle(_local4), | |
angle:_local5, | |
mouseX:this._parent.mouseX, | |
mouseY:this._parent.mouseY, | |
rotation:this._dummyBox.rotation, | |
handle:_arg1.target, | |
rotated:false | |
}; | |
this._stage.addEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveRotate, false, 0, true); | |
this._stage.addEventListener(MouseEvent.MOUSE_UP, this.onReleaseRotate, false, 0, true); | |
this.lockCursor(); | |
this.onMouseMoveRotate(); | |
}; | |
} | |
private function onMouseMoveRotate(_arg1:MouseEvent=null):void{ | |
var _local8:Number; | |
var _local2:Object = this._trackingInfo; | |
if (((!(_local2.rotated)) && (!((_arg1 == null))))){ | |
this._trackingInfo.rotated = true; | |
this.dispatchInteractiveEvent(TransformEvent.START_INTERACTIVE_ROTATE); | |
}; | |
var _local3:Number = (this._parent.mouseX - this._origin.x); | |
var _local4:Number = (this._origin.y - this._parent.mouseY); | |
var _local5:Number = Math.atan2(_local4, _local3); | |
var _local6:Number = (_local2.angleToMouse - Math.atan2(_local4, _local3)); | |
var _local7:Number = (_local6 + _local2.angle); | |
if (isKeyDown(Keyboard.SHIFT)){ | |
_local8 = (Math.PI * 0.25); | |
_local7 = (Math.round((_local7 / _local8)) * _local8); | |
}; | |
_local7 = (_local7 - (this._dummyBox.rotation * _DEG2RAD)); | |
if (Math.abs(_local7) > (0.25 * _DEG2RAD)){ | |
this.rotateSelection((_local7 % (Math.PI * 2))); | |
}; | |
if (_arg1 != null){ | |
_arg1.updateAfterEvent(); | |
}; | |
} | |
public function rotateSelection(_arg1:Number, _arg2:Boolean=true):void{ | |
var _local3:int; | |
var _local4:Matrix; | |
var _local5:Matrix; | |
var _local6:Object; | |
if (!this._selLockRotation){ | |
_local4 = this._dummyBox.transform.matrix; | |
_local5 = _local4.clone(); | |
_local4.tx = (_local4.ty = 0); | |
_local4.rotate(_arg1); | |
_local4.tx = this._origin.x; | |
_local4.ty = this._origin.y; | |
this._dummyBox.transform.matrix = _local4; | |
_local6 = {angle:_arg1}; | |
if (((!((this._selMinBounds == null))) && (!(this._selMinBounds.containsRect(this._dummyBox.getBounds(this._parent)))))){ | |
_local3 = (this._selectedItems.length - 1); | |
while (_local3 > -1) { | |
this._selectedItems[_local3].rotateCheck(_local6); | |
_local3--; | |
}; | |
_local5.tx = (_local5.ty = 0); | |
_local5.rotate(_local6.angle); | |
_local5.tx = this._origin.x; | |
_local5.ty = this._origin.y; | |
this._dummyBox.transform.matrix = _local5; | |
}; | |
this._ignoreEvents = true; | |
_local3 = (this._selectedItems.length - 1); | |
while (_local3 > -1) { | |
this._selectedItems[_local3].rotate(_local6.angle, false, _arg2); | |
_local3--; | |
}; | |
this._ignoreEvents = false; | |
this.renderSelection(); | |
if (((((this._dispatchRotateEvents) && (_arg2))) && (!(((_local6.angle % (Math.PI * 2)) == 0))))){ | |
dispatchEvent(new TransformEvent(TransformEvent.ROTATE, this._selectedItems.slice())); | |
}; | |
}; | |
} | |
private function onReleaseRotate(_arg1:MouseEvent):void{ | |
if (!this._selLockRotation){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_UP, this.onReleaseRotate); | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.onMouseMoveRotate); | |
this.unlockCursor(); | |
this._isTransforming = false; | |
if (this._trackingInfo.rotated){ | |
this.dispatchInteractiveEvent(TransformEvent.FINISH_INTERACTIVE_ROTATE); | |
}; | |
}; | |
} | |
private function swapCursorIn(_arg1:CustomCursor, _arg2:Object):void{ | |
var _local3:Boolean; | |
var _local4:Number; | |
if (((!((_currentCursor == _arg1))) && (!((this._stage == null))))){ | |
if (_currentCursor != null){ | |
_local3 = true; | |
this.swapCursorOut(null); | |
}; | |
_currentCursor = _arg1; | |
_cursorManager = this; | |
if (_currentCursor.hideMouse){ | |
Mouse.hide(); | |
}; | |
_local4 = (MatrixTools.getAngle(this._parent.transform.concatenatedMatrix, false) * _RAD2DEG); | |
this._stage.addChild(_currentCursor.shape); | |
this._stage.addEventListener(MouseEvent.MOUSE_MOVE, this.snapCursor); | |
if (((!((_arg2 == null))) && (_currentCursor.autoRotate))){ | |
_currentCursor.shape.rotation = ((_arg2.handle.rotation + _arg2.cursorRotation) + _local4); | |
}; | |
_currentCursor.shape.visible = true; | |
bringToFront(_currentCursor.shape); | |
this.snapCursor(); | |
if (!_local3){ | |
dispatchEvent(new TransformEvent(TransformEvent.SEIZE_CURSOR, this._selectedItems.slice())); | |
}; | |
}; | |
} | |
private function swapCursorOut(_arg1:Event=null):void{ | |
if (_currentCursor != null){ | |
if (this._lockCursor){ | |
this._onUnlock = this.swapCursorOut; | |
this._onUnlockParam = _arg1; | |
} else { | |
if (this._stage){ | |
this._stage.removeEventListener(MouseEvent.MOUSE_MOVE, this.snapCursor); | |
if (_cursorManager == this){ | |
if (_currentCursor.hideMouse){ | |
Mouse.show(); | |
}; | |
_currentCursor.shape.visible = false; | |
_currentCursor = null; | |
if (!this.mouseIsOverSelection(false)){ | |
dispatchEvent(new TransformEvent(TransformEvent.RELEASE_CURSOR, this._selectedItems.slice())); | |
}; | |
}; | |
}; | |
}; | |
}; | |
} | |
private function snapCursor(_arg1:MouseEvent=null):void{ | |
if (_currentCursor != null){ | |
_currentCursor.shape.x = (_currentCursor.shape.stage.mouseX + _currentCursor.xOffset); | |
_currentCursor.shape.y = (_currentCursor.shape.stage.mouseY + _currentCursor.yOffset); | |
}; | |
if (_arg1 != null){ | |
_arg1.updateAfterEvent(); | |
}; | |
} | |
private function onRollOverScale(_arg1:MouseEvent):void{ | |
if (((!(this._selLockScale)) && (((!(this._selHasTextFields)) || ((this._selectedItems.length == 1)))))){ | |
if (this._lockCursor){ | |
this._onUnlock = this.onRollOverScale; | |
this._onUnlockParam = _arg1; | |
} else { | |
this.swapCursorIn(_scaleCursor, this._handlesDict[_arg1.target]); | |
}; | |
}; | |
} | |
private function onRollOverRotate(_arg1:MouseEvent):void{ | |
if (!this._selLockRotation){ | |
if (this._lockCursor){ | |
this._onUnlock = this.onRollOverRotate; | |
this._onUnlockParam = _arg1; | |
} else { | |
this.swapCursorIn(_rotationCursor, this._handlesDict[_arg1.target]); | |
}; | |
}; | |
} | |
private function onRollOverMove(_arg1:Event=null):void{ | |
if (!this._selLockPosition){ | |
if (this._lockCursor){ | |
this._onUnlock = this.onRollOverMove; | |
this._onUnlockParam = _arg1; | |
} else { | |
this.swapCursorIn(_moveCursor, null); | |
}; | |
}; | |
} | |
private function onRollOverSelectedItem(_arg1:TransformEvent):void{ | |
if (((!(this._selLockPosition)) && (!(_arg1.items[0].hasSelectableText)))){ | |
if (this._lockCursor){ | |
this._onUnlock = this.onRollOverSelectedItem; | |
this._onUnlockParam = _arg1; | |
} else { | |
this.swapCursorIn(_moveCursor, null); | |
}; | |
}; | |
} | |
private function onRollOutSelectedItem(_arg1:TransformEvent):void{ | |
this.swapCursorOut(null); | |
} | |
private function setCursorListeners(_arg1:Boolean=true):void{ | |
var _local2:Sprite; | |
var _local3:Sprite; | |
var _local4:int; | |
_local4 = (this._handles.length - 1); | |
while (_local4 > -1) { | |
_local2 = this._handles[_local4].handle.getChildByName("scaleHandle"); | |
_local3 = this._handles[_local4].handle.getChildByName("rotationHandle"); | |
if (this._handles[_local4].handle.name != "c"){ | |
if (_arg1){ | |
_local2.addEventListener(MouseEvent.ROLL_OVER, this.onRollOverScale, false, 0, true); | |
_local2.addEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut, false, 0, true); | |
if (_local3 != null){ | |
_local3.addEventListener(MouseEvent.ROLL_OVER, this.onRollOverRotate, false, 0, true); | |
_local3.addEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut, false, 0, true); | |
}; | |
} else { | |
_local2.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOverScale); | |
_local2.removeEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut); | |
if (_local3 != null){ | |
_local3.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOverRotate); | |
_local3.removeEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut); | |
}; | |
}; | |
} else { | |
if (_arg1){ | |
_local2.addEventListener(MouseEvent.ROLL_OVER, this.onRollOverMove, false, 0, true); | |
_local2.addEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut, false, 0, true); | |
} else { | |
_local2.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOverMove); | |
_local2.removeEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut); | |
}; | |
}; | |
_local4--; | |
}; | |
if (_arg1){ | |
this._edges.addEventListener(MouseEvent.ROLL_OVER, this.onRollOverMove, false, 0, true); | |
this._edges.addEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut, false, 0, true); | |
} else { | |
this._edges.removeEventListener(MouseEvent.ROLL_OVER, this.onRollOverMove); | |
this._edges.removeEventListener(MouseEvent.ROLL_OUT, this.swapCursorOut); | |
}; | |
} | |
protected function lockCursor():void{ | |
this._lockCursor = true; | |
this._onUnlock = null; | |
this._onUnlockParam = null; | |
} | |
protected function unlockCursor():void{ | |
this._lockCursor = false; | |
if (this._onUnlock != null){ | |
this._onUnlock(this._onUnlockParam); | |
}; | |
} | |
protected function mouseIsOverSelection(_arg1:Boolean=false):Boolean{ | |
var _local2:int; | |
if ((((this._selectedItems.length == 0)) || ((this._stage == null)))){ | |
return (false); | |
}; | |
if (this._selection.hitTestPoint(this._stage.mouseX, this._stage.mouseY, true)){ | |
return (true); | |
}; | |
_local2 = (this._selectedItems.length - 1); | |
while (_local2 > -1) { | |
if (((this._selectedItems[_local2].targetObject.hitTestPoint(this._stage.mouseX, this._stage.mouseY, true)) && (!(((this._selectedItems[_local2].hasSelectableText) && (_arg1)))))){ | |
return (true); | |
}; | |
_local2--; | |
}; | |
return (false); | |
} | |
private function onPressMultiSelectKey(_arg1:Event=null):void{ | |
if (((this._allowMultiSelect) && (!(this._multiSelectMode)))){ | |
this._multiSelectMode = true; | |
}; | |
} | |
private function onReleaseMultiSelectKey(_arg1:Event=null):void{ | |
if (((this._multiSelectMode) && (this._allowMultiSelect))){ | |
this._multiSelectMode = false; | |
}; | |
} | |
public function exportFullXML():XML{ | |
var _local3:int; | |
var _local1:XML = <items></items> | |
; | |
var _local2:uint = this._items.length; | |
_local3 = 0; | |
while (_local3 < _local2) { | |
_local1.appendChild(this.exportItemXML(this._items[_local3].targetObject)); | |
_local3++; | |
}; | |
var _local4:XML = this.exportSettingsXML(); | |
var _local5:XML = <transformManager></transformManager> | |
; | |
_local5.appendChild(_local4); | |
_local5.appendChild(_local1); | |
return (_local5); | |
} | |
public function applyFullXML(_arg1:XML, _arg2:DisplayObjectContainer, _arg3:uint=0xCCCCCC):Array{ | |
var _local4:XML; | |
var _local5:DisplayObject; | |
var _local9:Boolean; | |
var _local11:uint; | |
var _local12:int; | |
this.applySettingsXML(_arg1.settings[0]); | |
var _local6:DisplayObjectContainer = ((this._parent) || (_arg2)); | |
var _local7:Array = []; | |
var _local8:Array = []; | |
var _local10:XMLList = _arg1.items[0].item; | |
for each (_local4 in _local10) { | |
_local9 = Boolean((_local6.getChildByName(_arg1.@name) == null)); | |
_local5 = this.applyItemXML(_local4, _local6, _arg3); | |
_local8.push({ | |
level:Number(_local4.@level), | |
mc:_local5, | |
node:_local4 | |
}); | |
if (_local9){ | |
_local7.push(_local5); | |
}; | |
}; | |
_local8.sortOn("level", (Array.NUMERIC | Array.DESCENDING)); | |
_local11 = _local6.numChildren; | |
_local12 = _local8.length; | |
while (_local12--) { | |
if ((((_local8[_local12].level < _local11)) && ((_local8[_local12].mc.parent == _local6)))){ | |
if (_local6.hasOwnProperty("setElementIndex")){ | |
(_local6 as Object).setElementIndex(_local8[_local12].mc, _local8[_local12].level); | |
} else { | |
_local6.setChildIndex(_local8[_local12].mc, _local8[_local12].level); | |
}; | |
}; | |
}; | |
return (_local7); | |
} | |
public function exportItemXML(_arg1:DisplayObject):XML{ | |
var _local2:XML = <item></item> | |
; | |
var _local3:TransformItem = this.getItem(_arg1); | |
var _local4:Matrix = _arg1.transform.matrix; | |
var _local5:Rectangle = _arg1.getBounds(_arg1); | |
_local2.@name = _arg1.name; | |
_local2.@level = ((_arg1.parent)!=null) ? _arg1.parent.getChildIndex(_arg1) : 0; | |
_local2.@a = _local4.a; | |
_local2.@b = _local4.b; | |
_local2.@c = _local4.c; | |
_local2.@d = _local4.d; | |
_local2.@tx = _local4.tx; | |
_local2.@ty = _local4.ty; | |
_local2.@xOffset = _local5.x; | |
_local2.@yOffset = _local5.y; | |
_local2.@rawWidth = _local5.width; | |
_local2.@rawHeight = _local5.height; | |
_local2.@scaleMode = ((_local3)!=null) ? _local3.scaleMode : TransformManager.SCALE_NORMAL; | |
_local2.@hasSelectableText = ((_local3)!=null) ? uint(_local3.hasSelectableText) : 0; | |
_local2.@minScaleX = ((_local3)!=null) ? _local3.minScaleX : -(Infinity); | |
_local2.@maxScaleX = ((_local3)!=null) ? _local3.maxScaleX : Infinity; | |
_local2.@minScaleY = ((_local3)!=null) ? _local3.minScaleY : -(Infinity); | |
_local2.@maxScaleY = ((_local3)!=null) ? _local3.maxScaleY : Infinity; | |
_local2.@lockScale = ((_local3)!=null) ? uint(_local3.lockScale) : 0; | |
_local2.@lockPosition = ((_local3)!=null) ? uint(_local3.lockPosition) : 0; | |
_local2.@lockRotation = ((_local3)!=null) ? uint(_local3.lockRotation) : 0; | |
_local2.@constrainScale = ((_local3)!=null) ? uint(_local3.constrainScale) : 0; | |
_local2.@minWidth = ((_local3)!=null) ? _local3.minWidth : 1; | |
_local2.@maxWidth = ((_local3)!=null) ? _local3.maxWidth : Infinity; | |
_local2.@minHeight = ((_local3)!=null) ? _local3.minHeight : 1; | |
_local2.@maxHeight = ((_local3)!=null) ? _local3.maxHeight : Infinity; | |
return (_local2); | |
} | |
public function applyItemXML(_arg1:XML, _arg2:DisplayObjectContainer=null, _arg3:uint=0xCCCCCC):DisplayObject{ | |
var _local8:int; | |
var _local9:Graphics; | |
var _local4:DisplayObjectContainer = ((this._parent) || (_arg2)); | |
var _local5:DisplayObject = _local4.getChildByName(_arg1.@name); | |
if (_local5 == null){ | |
_local8 = this._items.length; | |
while (_local8--) { | |
if (TransformItem(this._items[_local8]).targetObject.name == _arg1.@name){ | |
_local5 = TransformItem(this._items[_local8]).targetObject; | |
break; | |
}; | |
}; | |
}; | |
if (_local5 == null){ | |
_local5 = (this._isFlex) ? new (getDefinitionByName("mx.core.UIComponent")) : new Sprite(); | |
_local5.name = _arg1.@name; | |
_local9 = (_local5 as Sprite).graphics; | |
_local9.beginFill(_arg3, 1); | |
_local9.drawRect(Number(_arg1.@xOffset), Number(_arg1.@yOffset), Number(_arg1.@rawWidth), Number(_arg1.@rawHeight)); | |
_local9.endFill(); | |
if (_local4.hasOwnProperty("addElement")){ | |
(_local4 as Object).addElement(_local5); | |
} else { | |
_local4.addChild(_local5); | |
}; | |
}; | |
if (_arg1.@scaleMode == TransformManager.SCALE_WIDTH_AND_HEIGHT){ | |
_local5.width = Number(_arg1.@rawWidth); | |
_local5.height = Number(_arg1.@rawHeight); | |
}; | |
var _local6:Matrix = (_local5.transform.matrix = new Matrix(Number(_arg1.@a), Number(_arg1.@b), Number(_arg1.@c), Number(_arg1.@d), Number(_arg1.@tx), Number(_arg1.@ty))); | |
if ((((_local4.numChildren > _arg1.@level)) && ((_local5.parent == _local4)))){ | |
if (_local4.hasOwnProperty("setElementIndex")){ | |
(_local4 as Object).setElementIndex(_local5, _arg1.@level); | |
} else { | |
_local4.setChildIndex(_local5, _arg1.@level); | |
}; | |
}; | |
var _local7:TransformItem = this.addItem(_local5, _arg1.@scaleMode, Boolean(uint(_arg1.@hasSelectableText))); | |
_local7.minScaleX = Number(_arg1.@minScaleX); | |
_local7.maxScaleX = Number(_arg1.@maxScaleX); | |
_local7.minScaleY = Number(_arg1.@minScaleY); | |
_local7.maxScaleY = Number(_arg1.@maxScaleY); | |
_local7.lockScale = Boolean(uint(_arg1.@lockScale)); | |
_local7.lockPosition = Boolean(uint(_arg1.@lockPosition)); | |
_local7.lockRotation = Boolean(uint(_arg1.@lockRotation)); | |
_local7.constrainScale = Boolean(uint(_arg1.@constrainScale)); | |
_local7.minWidth = ((Number(_arg1.@minWidth)) || (1)); | |
_local7.maxWidth = ((Number(_arg1.@maxWidth)) || (Infinity)); | |
_local7.minHeight = ((Number(_arg1.@minHeight)) || (1)); | |
_local7.maxHeight = ((Number(_arg1.@maxHeight)) || (Infinity)); | |
_local5.transform.matrix = _local6; | |
return (_local5); | |
} | |
public function exportSettingsXML():XML{ | |
var _local1:XML = <settings></settings> | |
; | |
_local1.@allowDelete = uint(this.allowDelete); | |
_local1.@allowMultiSelect = uint(this.allowMultiSelect); | |
_local1.@autoDeselect = uint(this.autoDeselect); | |
_local1.@constrainScale = uint(this.constrainScale); | |
_local1.@lockScale = uint(this.lockScale); | |
_local1.@scaleFromCenter = uint(this.scaleFromCenter); | |
_local1.@lockRotation = uint(this.lockRotation); | |
_local1.@lockPosition = uint(this.lockPosition); | |
_local1.@arrowKeysMove = uint(this.arrowKeysMove); | |
_local1.@forceSelectionToFront = uint(this.forceSelectionToFront); | |
_local1.@lineColor = this.lineColor; | |
_local1.@lineThickness = this.lineThickness; | |
_local1.@handleColor = this.handleFillColor; | |
_local1.@handleSize = this.handleSize; | |
_local1.@paddingForRotation = this.paddingForRotation; | |
_local1.@hideCenterHandle = uint(this.hideCenterHandle); | |
_local1.@hasBounds = ((this._bounds)==null) ? 0 : 1; | |
if (this._bounds != null){ | |
_local1.@boundsX = this._bounds.x; | |
_local1.@boundsY = this._bounds.y; | |
_local1.@boundsWidth = this._bounds.width; | |
_local1.@boundsHeight = this._bounds.height; | |
}; | |
return (_local1); | |
} | |
public function applySettingsXML(_arg1:XML):void{ | |
this.allowDelete = Boolean(uint(_arg1.@allowDelete)); | |
this.allowMultiSelect = Boolean(uint(_arg1.@allowMultiSelect)); | |
this.autoDeselect = Boolean(uint(_arg1.@autoDeselect)); | |
this.constrainScale = Boolean(uint(_arg1.@constrainScale)); | |
this.lockScale = Boolean(uint(_arg1.@lockScale)); | |
this.scaleFromCenter = Boolean(uint(_arg1.@scaleFromCenter)); | |
this.lockRotation = Boolean(uint(_arg1.@lockRotation)); | |
this.lockPosition = Boolean(uint(_arg1.@lockPosition)); | |
this.arrowKeysMove = Boolean(uint(_arg1.@arrowKeysMove)); | |
this.forceSelectionToFront = Boolean(uint(_arg1.@forceSelectionToFront)); | |
this.lineColor = uint(_arg1.@lineColor); | |
this.lineThickness = Number(_arg1.@lineThickness); | |
this.handleFillColor = uint(_arg1.@handleColor); | |
this.handleSize = Number(_arg1.@handleSize); | |
this.paddingForRotation = Number(_arg1.@paddingForRotation); | |
this.hideCenterHandle = Boolean(uint(_arg1.@hideCenterHandle)); | |
if (Boolean(uint(_arg1.@hasBounds))){ | |
this.bounds = new Rectangle(Number(_arg1.@boundsX), Number(_arg1.@boundsY), Number(_arg1.@boundsWidth), Number(_arg1.@boundsHeight)); | |
}; | |
} | |
public function get enabled():Boolean{ | |
return (this._enabled); | |
} | |
public function set enabled(_arg1:Boolean):void{ | |
this._enabled = _arg1; | |
this.updateItemProp("enabled", _arg1); | |
if (!_arg1){ | |
this.swapCursorOut(); | |
this.removeParentListeners(); | |
}; | |
} | |
public function get selectionScaleX():Number{ | |
return (MatrixTools.getScaleX(this._dummyBox.transform.matrix, this._flipX)); | |
} | |
public function set selectionScaleX(_arg1:Number):void{ | |
this.scaleSelection((_arg1 / this.selectionScaleX), 1); | |
} | |
public function get selectionScaleY():Number{ | |
return (MatrixTools.getScaleY(this._dummyBox.transform.matrix, this._flipX)); | |
} | |
public function set selectionScaleY(_arg1:Number):void{ | |
this.scaleSelection(1, (_arg1 / this.selectionScaleY)); | |
} | |
public function get selectionRotation():Number{ | |
return (this._dummyBox.rotation); | |
} | |
public function set selectionRotation(_arg1:Number):void{ | |
this.rotateSelection(((_arg1 - this.selectionRotation) * _DEG2RAD)); | |
} | |
public function get selectionX():Number{ | |
return (this._dummyBox.x); | |
} | |
public function set selectionX(_arg1:Number):void{ | |
this.moveSelection((_arg1 - this._dummyBox.x), 0, true); | |
} | |
public function get selectionY():Number{ | |
return (this._dummyBox.y); | |
} | |
public function set selectionY(_arg1:Number):void{ | |
this.moveSelection(0, (_arg1 - this._dummyBox.y), true); | |
} | |
public function get items():Array{ | |
return (this._items); | |
} | |
public function get targetObjects():Array{ | |
var _local1:Array = []; | |
var _local2:uint; | |
while (_local2 < this._items.length) { | |
_local1.push(this._items[_local2].targetObject); | |
_local2++; | |
}; | |
return (_local1); | |
} | |
public function get selectedTargetObjects():Array{ | |
var _local1:Array = []; | |
var _local2:uint; | |
while (_local2 < this._selectedItems.length) { | |
_local1.push(this._selectedItems[_local2].targetObject); | |
_local2++; | |
}; | |
return (_local1); | |
} | |
public function set selectedTargetObjects(_arg1:Array):void{ | |
this.selectItems(_arg1, false); | |
} | |
public function get selectedItems():Array{ | |
return (this._selectedItems); | |
} | |
public function set selectedItems(_arg1:Array):void{ | |
this.selectItems(_arg1, false); | |
} | |
public function get constrainScale():Boolean{ | |
return (this._constrainScale); | |
} | |
public function set constrainScale(_arg1:Boolean):void{ | |
this._constrainScale = _arg1; | |
this.updateItemProp("constrainScale", _arg1); | |
this.calibrateConstraints(); | |
} | |
public function get lockScale():Boolean{ | |
return (this._lockScale); | |
} | |
public function set lockScale(_arg1:Boolean):void{ | |
this._lockScale = _arg1; | |
this.updateItemProp("lockScale", _arg1); | |
this.calibrateConstraints(); | |
} | |
public function get scaleFromCenter():Boolean{ | |
return (this._scaleFromCenter); | |
} | |
public function set scaleFromCenter(_arg1:Boolean):void{ | |
this._scaleFromCenter = _arg1; | |
} | |
public function get lockRotation():Boolean{ | |
return (this._lockRotation); | |
} | |
public function set lockRotation(_arg1:Boolean):void{ | |
this._lockRotation = _arg1; | |
this.updateItemProp("lockRotation", _arg1); | |
this.calibrateConstraints(); | |
} | |
public function get lockPosition():Boolean{ | |
return (this._lockPosition); | |
} | |
public function set lockPosition(_arg1:Boolean):void{ | |
this._lockPosition = _arg1; | |
this.updateItemProp("lockPosition", _arg1); | |
this.calibrateConstraints(); | |
} | |
public function get allowMultiSelect():Boolean{ | |
return (this._allowMultiSelect); | |
} | |
public function set allowMultiSelect(_arg1:Boolean):void{ | |
this._allowMultiSelect = _arg1; | |
if (!_arg1){ | |
this._multiSelectMode = false; | |
}; | |
} | |
public function get allowDelete():Boolean{ | |
return (this._allowDelete); | |
} | |
public function set allowDelete(_arg1:Boolean):void{ | |
this._allowDelete = _arg1; | |
this.updateItemProp("allowDelete", _arg1); | |
} | |
public function get autoDeselect():Boolean{ | |
return (this._autoDeselect); | |
} | |
public function set autoDeselect(_arg1:Boolean):void{ | |
this._autoDeselect = _arg1; | |
} | |
public function get lineColor():uint{ | |
return (this._lineColor); | |
} | |
public function set lineColor(_arg1:uint):void{ | |
this._lineColor = _arg1; | |
this.redrawHandles(); | |
this.updateSelection(); | |
} | |
public function get lineThickness():Number{ | |
return (this._lineThickness); | |
} | |
public function set lineThickness(_arg1:Number):void{ | |
this._lineThickness = _arg1; | |
this.redrawHandles(); | |
this.updateSelection(); | |
} | |
public function get handleFillColor():uint{ | |
return (this._handleColor); | |
} | |
public function set handleFillColor(_arg1:uint):void{ | |
this._handleColor = _arg1; | |
this.redrawHandles(); | |
} | |
public function get handleSize():Number{ | |
return (this._handleSize); | |
} | |
public function set handleSize(_arg1:Number):void{ | |
this._handleSize = _arg1; | |
this.redrawHandles(); | |
} | |
public function get paddingForRotation():Number{ | |
return (this._paddingForRotation); | |
} | |
public function set paddingForRotation(_arg1:Number):void{ | |
this._paddingForRotation = _arg1; | |
this.redrawHandles(); | |
} | |
public function get bounds():Rectangle{ | |
return (this._bounds); | |
} | |
public function set bounds(_arg1:Rectangle):void{ | |
this._bounds = _arg1; | |
if (this._selectedItems.length != 0){ | |
this.calibrateConstraints(); | |
}; | |
this.updateItemProp("bounds", _arg1); | |
} | |
public function get forceSelectionToFront():Boolean{ | |
return (this._forceSelectionToFront); | |
} | |
public function set forceSelectionToFront(_arg1:Boolean):void{ | |
this._forceSelectionToFront = _arg1; | |
} | |
public function get arrowKeysMove():Boolean{ | |
return (this._arrowKeysMove); | |
} | |
public function set arrowKeysMove(_arg1:Boolean):void{ | |
this._arrowKeysMove = _arg1; | |
} | |
public function get ignoredObjects():Array{ | |
return (this._ignoredObjects.slice()); | |
} | |
public function set ignoredObjects(_arg1:Array):void{ | |
this._ignoredObjects = []; | |
var _local2:uint; | |
while (_local2 < _arg1.length) { | |
if ((_arg1[_local2] is DisplayObject)){ | |
this._ignoredObjects.push(_arg1[_local2]); | |
}; | |
_local2++; | |
}; | |
} | |
public function get hideCenterHandle():Boolean{ | |
return (this._hideCenterHandle); | |
} | |
public function set hideCenterHandle(_arg1:Boolean):void{ | |
this._hideCenterHandle = _arg1; | |
this.redrawHandles(); | |
} | |
public function get isShowingCustomCursor():Boolean{ | |
return (Boolean(!((_currentCursor == null)))); | |
} | |
} | |
}//package com.greensock.transform | |
import flash.display.*; | |
class CustomCursor { | |
public var shape:Shape; | |
public var hideMouse:Boolean; | |
public var xOffset:Number; | |
public var yOffset:Number; | |
public var autoRotate:Boolean; | |
public function CustomCursor(_arg1:Shape, _arg2:Boolean, _arg3:Number, _arg4:Number, _arg5:Boolean){ | |
this.shape = _arg1; | |
this.hideMouse = _arg2; | |
this.xOffset = _arg3; | |
this.yOffset = _arg4; | |
this.autoRotate = _arg5; | |
} | |
} | |
package com.greensock.transform.utils { | |
import flash.geom.*; | |
public class MatrixTools { | |
private static const VERSION:Number = 1.21; | |
public static function getDirectionX(_arg1:Matrix):Number{ | |
var _local2:Number = Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))); | |
if (_arg1.a < 0){ | |
return (-(_local2)); | |
}; | |
return (_local2); | |
} | |
public static function getDirectionY(_arg1:Matrix):Number{ | |
var _local2:Number = Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))); | |
if (_arg1.d < 0){ | |
return (-(_local2)); | |
}; | |
return (_local2); | |
} | |
public static function getScaleX(_arg1:Matrix, _arg2:Boolean=false):Number{ | |
var _local3:Number = Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))); | |
return ((_arg2) ? -(_local3) : _local3); | |
} | |
public static function getScaleY(_arg1:Matrix, _arg2:Boolean=false):Number{ | |
var _local3:Number = Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))); | |
if (_arg2){ | |
_local3 = -(_local3); | |
}; | |
var _local4:Number = Math.atan2(_arg1.b, _arg1.a); | |
var _local5:Number = Math.atan2(_arg1.d, _arg1.c); | |
if (_local4 > _local5){ | |
_local4 = (_local4 - (Math.PI * 2)); | |
}; | |
if ((_local5 - _local4) > Math.PI){ | |
return (-(_local3)); | |
}; | |
return (_local3); | |
} | |
public static function getAngle(_arg1:Matrix, _arg2:Boolean=false):Number{ | |
var _local3:Number = Math.atan2(_arg1.b, _arg1.a); | |
if (_arg2){ | |
_local3 = (_local3 + ((_local3)<0) ? Math.PI : -(Math.PI)); | |
}; | |
return (_local3); | |
} | |
public static function getFlashAngle(_arg1:Matrix):Number{ | |
var _local2:Number = Math.atan2(_arg1.b, _arg1.a); | |
if ((((_local2 < 0)) && (((_arg1.a * _arg1.d) < 0)))){ | |
_local2 = ((_local2 - Math.PI) % Math.PI); | |
}; | |
return (_local2); | |
} | |
public static function scaleMatrix(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{ | |
var _local6:Number = Math.cos(_arg4); | |
var _local7:Number = Math.sin(_arg4); | |
var _local8:Number = Math.cos(_arg5); | |
var _local9:Number = Math.sin(_arg5); | |
var _local10:Number = (((_local6 * _arg1.a) + (_local7 * _arg1.b)) * _arg2); | |
var _local11:Number = (((_local6 * _arg1.b) - (_local7 * _arg1.a)) * _arg3); | |
var _local12:Number = (((_local8 * _arg1.c) - (_local9 * _arg1.d)) * _arg2); | |
var _local13:Number = (((_local8 * _arg1.d) + (_local9 * _arg1.c)) * _arg3); | |
_arg1.a = ((_local6 * _local10) - (_local7 * _local11)); | |
_arg1.b = ((_local6 * _local11) + (_local7 * _local10)); | |
_arg1.c = ((_local8 * _local12) + (_local9 * _local13)); | |
_arg1.d = ((_local8 * _local13) - (_local9 * _local12)); | |
} | |
public static function getSkew(_arg1:Matrix):Number{ | |
return (Math.atan2(_arg1.c, _arg1.d)); | |
} | |
public static function setSkewX(_arg1:Matrix, _arg2:Number):void{ | |
var _local3:Number = Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))); | |
_arg1.c = (-(_local3) * Math.sin(_arg2)); | |
_arg1.d = (_local3 * Math.cos(_arg2)); | |
} | |
public static function setSkewY(_arg1:Matrix, _arg2:Number):void{ | |
var _local3:Number = Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))); | |
_arg1.a = (_local3 * Math.cos(_arg2)); | |
_arg1.b = (_local3 * Math.sin(_arg2)); | |
} | |
} | |
}//package com.greensock.transform.utils | |
package com.google.analytics { | |
import com.google.analytics.v4.*; | |
import com.google.analytics.debug.*; | |
import flash.events.*; | |
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher { | |
function set config(_arg1:Configuration):void; | |
function isReady():Boolean; | |
function get mode():String; | |
function set debug(_arg1:DebugConfiguration):void; | |
function get account():String; | |
function set mode(_arg1:String):void; | |
function get config():Configuration; | |
function get debug():DebugConfiguration; | |
function set account(_arg1:String):void; | |
function get visualDebug():Boolean; | |
function set visualDebug(_arg1:Boolean):void; | |
} | |
}//package com.google.analytics | |
package com.google.analytics.external { | |
import com.google.analytics.debug.*; | |
public class AdSenseGlobals extends JavascriptProxy { | |
public static var gaGlobal_js:XML = <script> | |
<![CDATA[ | |
function() | |
{ | |
try | |
{ | |
gaGlobal | |
} | |
catch(e) | |
{ | |
gaGlobal = {} ; | |
} | |
} | |
]]> | |
</script> | |
; | |
private var _gaGlobalVerified:Boolean = false; | |
public function AdSenseGlobals(_arg1:DebugConfiguration){ | |
_gaGlobalVerified = false; | |
super(_arg1); | |
} | |
public function set vid(_arg1:String):void{ | |
if (!isAvailable()){ | |
return; | |
}; | |
_verify(); | |
setProperty("gaGlobal.vid", _arg1); | |
} | |
public function get hid():String{ | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_verify(); | |
return (getProperty("gaGlobal.hid")); | |
} | |
public function get dh():String{ | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_verify(); | |
return (getProperty("gaGlobal.dh")); | |
} | |
public function get gaGlobal():Object{ | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_verify(); | |
return (getProperty("gaGlobal")); | |
} | |
public function set hid(_arg1:String):void{ | |
if (!isAvailable()){ | |
return; | |
}; | |
_verify(); | |
setProperty("gaGlobal.hid", _arg1); | |
} | |
public function get sid():String{ | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_verify(); | |
return (getProperty("gaGlobal.sid")); | |
} | |
private function _verify():void{ | |
if (!_gaGlobalVerified){ | |
executeBlock(gaGlobal_js); | |
_gaGlobalVerified = true; | |
}; | |
} | |
public function get vid():String{ | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_verify(); | |
return (getProperty("gaGlobal.vid")); | |
} | |
public function set sid(_arg1:String):void{ | |
if (!isAvailable()){ | |
return; | |
}; | |
_verify(); | |
setProperty("gaGlobal.sid", _arg1); | |
} | |
} | |
}//package com.google.analytics.external | |
package com.google.analytics.external { | |
import com.google.analytics.debug.*; | |
import flash.system.*; | |
import flash.external.*; | |
public class JavascriptProxy { | |
public static var setProperty_js:XML = <script> | |
<![CDATA[ | |
function( path , value ) | |
{ | |
var paths; | |
var prop; | |
if( path.indexOf(".") > 0 ) | |
{ | |
paths = path.split("."); | |
prop = paths.pop() ; | |
} | |
else | |
{ | |
paths = []; | |
prop = path; | |
} | |
var target = window ; | |
var len = paths.length ; | |
for( var i = 0 ; i < len ; i++ ) | |
{ | |
target = target[ paths[i] ] ; | |
} | |
target[ prop ] = value ; | |
} | |
]]> | |
</script> | |
; | |
public static var hasProperty_js:XML = <script> | |
<![CDATA[ | |
function( path ) | |
{ | |
var paths; | |
if( path.indexOf(".") > 0 ) | |
{ | |
paths = path.split("."); | |
} | |
else | |
{ | |
paths = [path]; | |
} | |
var target = window ; | |
var len = paths.length ; | |
for( var i = 0 ; i < len ; i++ ) | |
{ | |
target = target[ paths[i] ] ; | |
} | |
if( target ) | |
{ | |
return true; | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
]]> | |
</script> | |
; | |
public static var setPropertyRef_js:XML = <script> | |
<![CDATA[ | |
function( path , target ) | |
{ | |
var paths; | |
var prop; | |
if( path.indexOf(".") > 0 ) | |
{ | |
paths = path.split("."); | |
prop = paths.pop() ; | |
} | |
else | |
{ | |
paths = []; | |
prop = path; | |
} | |
alert( "paths:"+paths.length+", prop:"+prop ); | |
var targets; | |
var name; | |
if( target.indexOf(".") > 0 ) | |
{ | |
targets = target.split("."); | |
name = targets.pop(); | |
} | |
else | |
{ | |
targets = []; | |
name = target; | |
} | |
alert( "targets:"+targets.length+", name:"+name ); | |
var root = window; | |
var len = paths.length; | |
for( var i = 0 ; i < len ; i++ ) | |
{ | |
root = root[ paths[i] ] ; | |
} | |
var ref = window; | |
var depth = targets.length; | |
for( var j = 0 ; j < depth ; j++ ) | |
{ | |
ref = ref[ targets[j] ] ; | |
} | |
root[ prop ] = ref[name] ; | |
} | |
]]> | |
</script> | |
; | |
private var _notAvailableWarning:Boolean = true; | |
private var _debug:DebugConfiguration; | |
public function JavascriptProxy(_arg1:DebugConfiguration){ | |
_notAvailableWarning = true; | |
super(); | |
_debug = _arg1; | |
} | |
public function getProperty(_arg1:String){ | |
return (call((_arg1 + ".valueOf"))); | |
} | |
public function hasProperty(_arg1:String):Boolean{ | |
return (call(hasProperty_js, _arg1)); | |
} | |
public function setProperty(_arg1:String, _arg2):void{ | |
call(setProperty_js, _arg1, _arg2); | |
} | |
public function executeBlock(_arg1:String):void{ | |
var data:* = _arg1; | |
if (isAvailable()){ | |
try { | |
ExternalInterface.call(data); | |
} catch(e:SecurityError) { | |
if (_debug.javascript){ | |
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML."); | |
}; | |
} catch(e:Error) { | |
if (_debug.javascript){ | |
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message)); | |
}; | |
}; | |
}; | |
} | |
public function getPropertyString(_arg1:String):String{ | |
return (call((_arg1 + ".toString"))); | |
} | |
public function setPropertyByReference(_arg1:String, _arg2:String):void{ | |
call(setPropertyRef_js, _arg1, _arg2); | |
} | |
public function call(_arg1:String, ... _args){ | |
var output:* = null; | |
var functionName:* = _arg1; | |
var args:* = _args; | |
if (isAvailable()){ | |
try { | |
if (((_debug.javascript) && (_debug.verbose))){ | |
output = ""; | |
output = ("Flash->JS: " + functionName); | |
output = (output + "( "); | |
if (args.length > 0){ | |
output = (output + args.join(",")); | |
}; | |
output = (output + " )"); | |
_debug.info(output); | |
}; | |
args.unshift(functionName); | |
return (ExternalInterface.call.apply(ExternalInterface, args)); | |
} catch(e:SecurityError) { | |
if (_debug.javascript){ | |
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML."); | |
}; | |
} catch(e:Error) { | |
if (_debug.javascript){ | |
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message)); | |
}; | |
}; | |
}; | |
return (null); | |
} | |
public function isAvailable():Boolean{ | |
var _local1:Boolean; | |
_local1 = ExternalInterface.available; | |
if (((_local1) && ((Capabilities.playerType == "External")))){ | |
_local1 = false; | |
}; | |
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){ | |
_debug.warning("ExternalInterface is not available."); | |
_notAvailableWarning = false; | |
}; | |
return (_local1); | |
} | |
} | |
}//package com.google.analytics.external | |
package com.google.analytics.external { | |
import com.google.analytics.debug.*; | |
public class HTMLDOM extends JavascriptProxy { | |
public static var cache_properties_js:XML = <script> | |
<![CDATA[ | |
function() | |
{ | |
var obj = {}; | |
obj.host = document.location.host; | |
obj.language = navigator.language ? navigator.language : navigator.browserLanguage; | |
obj.characterSet = document.characterSet ? document.characterSet : document.charset; | |
obj.colorDepth = window.screen.colorDepth; | |
obj.location = document.location.toString(); | |
obj.pathname = document.location.pathname; | |
obj.protocol = document.location.protocol; | |
obj.search = document.location.search; | |
obj.referrer = document.referrer; | |
obj.title = document.title; | |
return obj; | |
} | |
]]> | |
</script> | |
; | |
private var _referrer:String; | |
private var _protocol:String; | |
private var _host:String; | |
private var _location:String; | |
private var _pathname:String; | |
private var _title:String; | |
private var _characterSet:String; | |
private var _search:String; | |
private var _language:String; | |
private var _colorDepth:String; | |
public function HTMLDOM(_arg1:DebugConfiguration){ | |
super(_arg1); | |
} | |
public function get search():String{ | |
if (_search){ | |
return (_search); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_search = getProperty("document.location.search"); | |
return (_search); | |
} | |
public function get location():String{ | |
if (_location){ | |
return (_location); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_location = getPropertyString("document.location"); | |
return (_location); | |
} | |
public function get pathname():String{ | |
if (_pathname){ | |
return (_pathname); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_pathname = getProperty("document.location.pathname"); | |
return (_pathname); | |
} | |
public function get referrer():String{ | |
if (_referrer){ | |
return (_referrer); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_referrer = getProperty("document.referrer"); | |
return (_referrer); | |
} | |
public function get protocol():String{ | |
if (_protocol){ | |
return (_protocol); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_protocol = getProperty("document.location.protocol"); | |
return (_protocol); | |
} | |
public function cacheProperties():void{ | |
var _local1:Object; | |
if (!isAvailable()){ | |
return; | |
}; | |
_local1 = call(cache_properties_js); | |
if (_local1){ | |
_host = _local1.host; | |
_language = _local1.language; | |
_characterSet = _local1.characterSet; | |
_colorDepth = _local1.colorDepth; | |
_location = _local1.location; | |
_pathname = _local1.pathname; | |
_protocol = _local1.protocol; | |
_search = _local1.search; | |
_referrer = _local1.referrer; | |
_title = _local1.title; | |
}; | |
} | |
public function get colorDepth():String{ | |
if (_colorDepth){ | |
return (_colorDepth); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_colorDepth = getProperty("window.screen.colorDepth"); | |
return (_colorDepth); | |
} | |
public function get title():String{ | |
if (_title){ | |
return (_title); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_title = getProperty("document.title"); | |
return (_title); | |
} | |
public function get host():String{ | |
if (_host){ | |
return (_host); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_host = getProperty("document.location.host"); | |
return (_host); | |
} | |
public function get characterSet():String{ | |
var _local1:String; | |
if (_characterSet){ | |
return (_characterSet); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_local1 = getProperty("document.characterSet"); | |
if (_local1 == null){ | |
_local1 = getProperty("document.charset"); | |
}; | |
_characterSet = _local1; | |
return (_characterSet); | |
} | |
public function get language():String{ | |
var _local1:String; | |
if (_language){ | |
return (_language); | |
}; | |
if (!isAvailable()){ | |
return (null); | |
}; | |
_local1 = getProperty("navigator.language"); | |
if (_local1 == null){ | |
_local1 = getProperty("navigator.browserLanguage"); | |
}; | |
_language = _local1; | |
return (_language); | |
} | |
} | |
}//package com.google.analytics.external | |
package com.google.analytics.events { | |
import flash.events.*; | |
import com.google.analytics.*; | |
public class AnalyticsEvent extends Event { | |
public static const READY:String = "ready"; | |
public var tracker:AnalyticsTracker; | |
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){ | |
super(_arg1, _arg3, _arg4); | |
this.tracker = _arg2; | |
} | |
override public function clone():Event{ | |
return (new AnalyticsEvent(type, tracker, bubbles, cancelable)); | |
} | |
} | |
}//package com.google.analytics.events | |
package com.google.analytics.core { | |
public class Utils { | |
public static function trim(_arg1:String, _arg2:Boolean=false):String{ | |
var _local3:Array; | |
var _local4:String; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
if (_arg1 == ""){ | |
return (""); | |
}; | |
_local3 = [" ", "\n", "\r", "\t"]; | |
_local4 = _arg1; | |
if (_arg2){ | |
_local5 = 0; | |
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) { | |
_local4 = _local4.split(_local3[_local5]).join(""); | |
_local5++; | |
}; | |
} else { | |
_local6 = 0; | |
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) { | |
_local6++; | |
}; | |
_local4 = _local4.substr(_local6); | |
_local7 = (_local4.length - 1); | |
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) { | |
_local7--; | |
}; | |
_local4 = _local4.substring(0, (_local7 + 1)); | |
}; | |
return (_local4); | |
} | |
public static function generateHash(_arg1:String):int{ | |
var _local2:int; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
_local2 = 1; | |
_local3 = 0; | |
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){ | |
_local2 = 0; | |
_local4 = (_arg1.length - 1); | |
while (_local4 >= 0) { | |
_local5 = _arg1.charCodeAt(_local4); | |
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14)); | |
_local3 = (_local2 & 266338304); | |
if (_local3 != 0){ | |
_local2 = (_local2 ^ (_local3 >> 21)); | |
}; | |
_local4--; | |
}; | |
}; | |
return (_local2); | |
} | |
public static function generate32bitRandom():int{ | |
return (Math.round((Math.random() * 2147483647))); | |
} | |
public static function validateAccount(_arg1:String):Boolean{ | |
var _local2:RegExp; | |
_local2 = /^UA-[0-9]*-[0-9]*$/; | |
return (_local2.test(_arg1)); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import flash.utils.*; | |
import flash.net.*; | |
public class RequestObject { | |
public var start:int; | |
public var request:URLRequest; | |
public var end:int; | |
public function RequestObject(_arg1:URLRequest){ | |
start = getTimer(); | |
this.request = _arg1; | |
} | |
public function toString():String{ | |
var _local1:Array; | |
_local1 = []; | |
_local1.push((("duration: " + duration) + "ms")); | |
_local1.push(("url: " + request.url)); | |
return ((("{ " + _local1.join(", ")) + " }")); | |
} | |
public function get duration():int{ | |
if (!hasCompleted()){ | |
return (0); | |
}; | |
return ((end - start)); | |
} | |
public function hasCompleted():Boolean{ | |
return ((end > 0)); | |
} | |
public function complete():void{ | |
end = getTimer(); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.v4.*; | |
import com.google.analytics.utils.*; | |
public class BrowserInfo { | |
private var _config:Configuration; | |
private var _info:Environment; | |
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){ | |
_config = _arg1; | |
_info = _arg2; | |
} | |
public function get utmul():String{ | |
return (_info.language.toLowerCase()); | |
} | |
public function get utmje():String{ | |
return ("0"); | |
} | |
public function toURLString():String{ | |
var _local1:Variables; | |
_local1 = toVariables(); | |
return (_local1.toString()); | |
} | |
public function get utmsr():String{ | |
return (((_info.screenWidth + "x") + _info.screenHeight)); | |
} | |
public function get utmcs():String{ | |
return (_info.languageEncoding); | |
} | |
public function get utmfl():String{ | |
var _local1:Version; | |
if (_config.detectFlash){ | |
_local1 = _info.flashVersion; | |
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build)); | |
}; | |
return ("-"); | |
} | |
public function toVariables():Variables{ | |
var _local1:Variables; | |
_local1 = new Variables(); | |
_local1.URIencode = true; | |
_local1.utmcs = utmcs; | |
_local1.utmsr = utmsr; | |
_local1.utmsc = utmsc; | |
_local1.utmul = utmul; | |
_local1.utmje = utmje; | |
_local1.utmfl = utmfl; | |
return (_local1); | |
} | |
public function get utmsc():String{ | |
return ((_info.screenColorDepth + "-bit")); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
public class OrganicReferrer { | |
private var _engine:String; | |
private var _keyword:String; | |
public function OrganicReferrer(_arg1:String, _arg2:String){ | |
this.engine = _arg1; | |
this.keyword = _arg2; | |
} | |
public function set engine(_arg1:String):void{ | |
_engine = _arg1.toLowerCase(); | |
} | |
public function get keyword():String{ | |
return (_keyword); | |
} | |
public function toString():String{ | |
return (((engine + "?") + keyword)); | |
} | |
public function get engine():String{ | |
return (_engine); | |
} | |
public function set keyword(_arg1:String):void{ | |
_keyword = _arg1.toLowerCase(); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import flash.display.*; | |
import com.google.analytics.v4.*; | |
import com.google.analytics.debug.*; | |
import flash.net.*; | |
import com.google.analytics.utils.*; | |
import flash.events.*; | |
import flash.system.*; | |
public class GIFRequest { | |
private var _info:Environment; | |
private var _count:int; | |
private var _utmac:String; | |
private var _alertcount:int; | |
private var _debug:DebugConfiguration; | |
private var _lastRequest:URLRequest; | |
private var _buffer:Buffer; | |
private var _config:Configuration; | |
private var _requests:Array; | |
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){ | |
_config = _arg1; | |
_debug = _arg2; | |
_buffer = _arg3; | |
_info = _arg4; | |
_count = 0; | |
_alertcount = 0; | |
_requests = []; | |
} | |
public function get utmn():String{ | |
return ((Utils.generate32bitRandom() as String)); | |
} | |
public function onIOError(_arg1:IOErrorEvent):void{ | |
var _local2:String; | |
var _local3:String; | |
var _local4:String; | |
_local2 = _lastRequest.url; | |
_local3 = String((_requests.length - 1)); | |
_local4 = (("Gif Request #" + _local3) + " failed"); | |
if (_debug.GIFRequests){ | |
if (!_debug.verbose){ | |
if (_local2.indexOf("?") > -1){ | |
_local2 = _local2.split("?")[0]; | |
}; | |
_local2 = _shortenURL(_local2); | |
}; | |
if (int(_debug.mode) > int(VisualDebugMode.basic)){ | |
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable")); | |
}; | |
_debug.failure(_local4); | |
} else { | |
_debug.warning(_local4); | |
}; | |
_removeListeners(_arg1.target); | |
} | |
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{ | |
var _local5:String; | |
var _local6:URLRequest; | |
var _local7:URLRequest; | |
_utmac = _arg1; | |
if (!_arg2){ | |
_arg2 = new Variables(); | |
}; | |
_arg2.URIencode = false; | |
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"]; | |
_arg2.post = ["utmcc"]; | |
if (_debug.verbose){ | |
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek); | |
}; | |
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){ | |
if (_arg4){ | |
updateToken(); | |
}; | |
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){ | |
if (((!(_arg3)) && (_arg4))){ | |
_buffer.utmb.token = (_buffer.utmb.token - 1); | |
}; | |
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1); | |
if (_debug.verbose){ | |
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek); | |
}; | |
_arg2.utmwv = utmwv; | |
_arg2.utmn = Utils.generate32bitRandom(); | |
if (_info.domainName != ""){ | |
_arg2.utmhn = _info.domainName; | |
}; | |
if (_config.sampleRate < 1){ | |
_arg2.utmsp = (_config.sampleRate * 100); | |
}; | |
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){ | |
_local5 = _info.locationSWFPath; | |
if (_local5.lastIndexOf("/") > 0){ | |
_local5 = _local5.substring(0, _local5.lastIndexOf("/")); | |
}; | |
_local6 = new URLRequest(); | |
if (_config.localGIFpath.indexOf("http") == 0){ | |
_local6.url = _config.localGIFpath; | |
} else { | |
_local6.url = (_local5 + _config.localGIFpath); | |
}; | |
_local6.url = (_local6.url + ("?" + _arg2.toString())); | |
if (((_debug.active) && (_debug.GIFRequests))){ | |
_debugSend(_local6); | |
} else { | |
sendRequest(_local6); | |
}; | |
}; | |
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){ | |
_local7 = new URLRequest(); | |
if (_info.protocol == Protocols.HTTPS){ | |
_local7.url = _config.secureRemoteGIFpath; | |
} else { | |
if (_info.protocol == Protocols.HTTP){ | |
_local7.url = _config.remoteGIFpath; | |
} else { | |
_local7.url = _config.remoteGIFpath; | |
}; | |
}; | |
_arg2.utmac = utmac; | |
_arg2.utmcc = encodeURIComponent(utmcc); | |
_local7.url = (_local7.url + ("?" + _arg2.toString())); | |
if (((_debug.active) && (_debug.GIFRequests))){ | |
_debugSend(_local7); | |
} else { | |
sendRequest(_local7); | |
}; | |
}; | |
}; | |
}; | |
} | |
public function onSecurityError(_arg1:SecurityErrorEvent):void{ | |
if (_debug.GIFRequests){ | |
_debug.failure(_arg1.text); | |
}; | |
} | |
public function get utmsp():String{ | |
return (((_config.sampleRate * 100) as String)); | |
} | |
public function get utmcc():String{ | |
var _local1:Array; | |
_local1 = []; | |
if (_buffer.hasUTMA()){ | |
_local1.push((_buffer.utma.toURLString() + ";")); | |
}; | |
if (_buffer.hasUTMZ()){ | |
_local1.push((_buffer.utmz.toURLString() + ";")); | |
}; | |
if (_buffer.hasUTMV()){ | |
_local1.push((_buffer.utmv.toURLString() + ";")); | |
}; | |
return (_local1.join("+")); | |
} | |
public function get utmac():String{ | |
return (_utmac); | |
} | |
public function get utmwv():String{ | |
return (_config.version); | |
} | |
public function sendRequest(_arg1:URLRequest):void{ | |
var loader:* = null; | |
var context:* = null; | |
var request:* = _arg1; | |
loader = new Loader(); | |
loader.name = String(_count++); | |
context = new LoaderContext(false); | |
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError); | |
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); | |
_lastRequest = request; | |
_requests[loader.name] = new RequestObject(request); | |
try { | |
loader.load(request, context); | |
} catch(e:Error) { | |
_debug.failure("\"Loader.load()\" could not instanciate Gif Request"); | |
}; | |
} | |
private function _removeListeners(_arg1:Object):void{ | |
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError); | |
_arg1.removeEventListener(Event.COMPLETE, onComplete); | |
} | |
public function updateToken():void{ | |
var _local1:Number; | |
var _local2:Number; | |
_local1 = new Date().getTime(); | |
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000)); | |
if (_debug.verbose){ | |
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek); | |
}; | |
if (_local2 >= 1){ | |
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity); | |
_buffer.utmb.lastTime = _local1; | |
if (_debug.verbose){ | |
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek); | |
}; | |
}; | |
} | |
private function _shortenURL(_arg1:String):String{ | |
var _local2:Array; | |
if (_arg1.length > 60){ | |
_local2 = _arg1.split("/"); | |
while (_arg1.length > 60) { | |
_local2.shift(); | |
_arg1 = ("../" + _local2.join("/")); | |
}; | |
}; | |
return (_arg1); | |
} | |
public function get utmhn():String{ | |
return (_info.domainName); | |
} | |
private function _debugSend(_arg1:URLRequest):void{ | |
var _local2:String; | |
var _local3:String; | |
_local2 = ""; | |
switch (_debug.mode){ | |
case VisualDebugMode.geek: | |
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url); | |
break; | |
case VisualDebugMode.advanced: | |
_local3 = _arg1.url; | |
if (_local3.indexOf("?") > -1){ | |
_local3 = _local3.split("?")[0]; | |
}; | |
_local3 = _shortenURL(_local3); | |
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?"); | |
break; | |
case VisualDebugMode.basic: | |
default: | |
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?"); | |
}; | |
_debug.alertGifRequest(_local2, _arg1, this); | |
_alertcount++; | |
} | |
public function onComplete(_arg1:Event):void{ | |
var _local2:String; | |
var _local3:String; | |
var _local4:String; | |
_local2 = _arg1.target.loader.name; | |
_requests[_local2].complete(); | |
_local3 = (("Gif Request #" + _local2) + " sent"); | |
_local4 = _requests[_local2].request.url; | |
if (_debug.GIFRequests){ | |
if (!_debug.verbose){ | |
if (_local4.indexOf("?") > -1){ | |
_local4 = _local4.split("?")[0]; | |
}; | |
_local4 = _shortenURL(_local4); | |
}; | |
if (int(_debug.mode) > int(VisualDebugMode.basic)){ | |
_local3 = (_local3 + ((" to \"" + _local4) + "\"")); | |
}; | |
_debug.success(_local3); | |
} else { | |
_debug.info(_local3); | |
}; | |
_removeListeners(_arg1.target); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.v4.*; | |
import com.google.analytics.debug.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.google.analytics.data.*; | |
public dynamic class Buffer { | |
private var _SO:SharedObject; | |
private var _OBJ:Object; | |
private var _utma:UTMA; | |
private var _utmb:UTMB; | |
private var _utmc:UTMC; | |
private var _debug:DebugConfiguration; | |
private var _utmk:UTMK; | |
private var _config:Configuration; | |
private var _utmv:UTMV; | |
private var _utmz:UTMZ; | |
private var _volatile:Boolean; | |
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){ | |
var _local5:Boolean; | |
var _local6:String; | |
super(); | |
_config = _arg1; | |
_debug = _arg2; | |
UTMB.defaultTimespan = _config.sessionTimeout; | |
UTMZ.defaultTimespan = _config.conversionTimeout; | |
if (!_arg3){ | |
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath); | |
_local5 = false; | |
if (_SO.data.utma){ | |
if (!hasUTMA()){ | |
_createUMTA(); | |
}; | |
_utma.fromSharedObject(_SO.data.utma); | |
if (_debug.verbose){ | |
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek); | |
}; | |
if (_utma.isExpired()){ | |
if (_debug.verbose){ | |
_debug.warning("UTMA has expired", VisualDebugMode.advanced); | |
}; | |
_clearUTMA(); | |
_local5 = true; | |
}; | |
}; | |
if (_SO.data.utmb){ | |
if (!hasUTMB()){ | |
_createUMTB(); | |
}; | |
_utmb.fromSharedObject(_SO.data.utmb); | |
if (_debug.verbose){ | |
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek); | |
}; | |
if (_utmb.isExpired()){ | |
if (_debug.verbose){ | |
_debug.warning("UTMB has expired", VisualDebugMode.advanced); | |
}; | |
_clearUTMB(); | |
_local5 = true; | |
}; | |
}; | |
if (_SO.data.utmc){ | |
delete _SO.data.utmc; | |
_local5 = true; | |
}; | |
if (_SO.data.utmk){ | |
if (!hasUTMK()){ | |
_createUMTK(); | |
}; | |
_utmk.fromSharedObject(_SO.data.utmk); | |
if (_debug.verbose){ | |
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek); | |
}; | |
}; | |
if (_SO.data.utmv){ | |
if (!hasUTMV()){ | |
_createUMTV(); | |
}; | |
_utmv.fromSharedObject(_SO.data.utmv); | |
if (_debug.verbose){ | |
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek); | |
}; | |
if (_utmv.isExpired()){ | |
if (_debug.verbose){ | |
_debug.warning("UTMV has expired", VisualDebugMode.advanced); | |
}; | |
_clearUTMV(); | |
_local5 = true; | |
}; | |
}; | |
if (_SO.data.utmz){ | |
if (!hasUTMZ()){ | |
_createUMTZ(); | |
}; | |
_utmz.fromSharedObject(_SO.data.utmz); | |
if (_debug.verbose){ | |
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek); | |
}; | |
if (_utmz.isExpired()){ | |
if (_debug.verbose){ | |
_debug.warning("UTMZ has expired", VisualDebugMode.advanced); | |
}; | |
_clearUTMZ(); | |
_local5 = true; | |
}; | |
}; | |
if (_local5){ | |
save(); | |
}; | |
} else { | |
_OBJ = new Object(); | |
if (_arg4){ | |
for (_local6 in _arg4) { | |
_OBJ[_local6] = _arg4[_local6]; | |
}; | |
}; | |
}; | |
_volatile = _arg3; | |
} | |
public function save():void{ | |
var flushStatus:* = null; | |
if (!isVolatile()){ | |
flushStatus = null; | |
try { | |
flushStatus = _SO.flush(); | |
} catch(e:Error) { | |
_debug.warning("Error...Could not write SharedObject to disk"); | |
}; | |
switch (flushStatus){ | |
case SharedObjectFlushStatus.PENDING: | |
_debug.info("Requesting permission to save object..."); | |
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus); | |
break; | |
case SharedObjectFlushStatus.FLUSHED: | |
_debug.info("Value flushed to disk."); | |
break; | |
}; | |
}; | |
} | |
public function get utmv():UTMV{ | |
if (!hasUTMV()){ | |
_createUMTV(); | |
}; | |
return (_utmv); | |
} | |
public function clearCookies():void{ | |
utma.reset(); | |
utmb.reset(); | |
utmc.reset(); | |
utmz.reset(); | |
utmv.reset(); | |
utmk.reset(); | |
} | |
public function get utmz():UTMZ{ | |
if (!hasUTMZ()){ | |
_createUMTZ(); | |
}; | |
return (_utmz); | |
} | |
public function hasUTMA():Boolean{ | |
if (_utma){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function hasUTMB():Boolean{ | |
if (_utmb){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function isGenuine():Boolean{ | |
if (!hasUTMK()){ | |
return (true); | |
}; | |
return ((utmk.hash == generateCookiesHash())); | |
} | |
public function resetCurrentSession():void{ | |
_clearUTMB(); | |
_clearUTMC(); | |
save(); | |
} | |
public function hasUTMC():Boolean{ | |
if (_utmc){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function hasUTMK():Boolean{ | |
if (_utmk){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function generateCookiesHash():Number{ | |
var _local1:String; | |
_local1 = ""; | |
_local1 = (_local1 + utma.valueOf()); | |
_local1 = (_local1 + utmb.valueOf()); | |
_local1 = (_local1 + utmc.valueOf()); | |
_local1 = (_local1 + utmz.valueOf()); | |
_local1 = (_local1 + utmv.valueOf()); | |
return (Utils.generateHash(_local1)); | |
} | |
private function _createUMTA():void{ | |
_utma = new UTMA(); | |
_utma.proxy = this; | |
} | |
private function _createUMTB():void{ | |
_utmb = new UTMB(); | |
_utmb.proxy = this; | |
} | |
private function _createUMTC():void{ | |
_utmc = new UTMC(); | |
} | |
public function hasUTMV():Boolean{ | |
if (_utmv){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _createUMTK():void{ | |
_utmk = new UTMK(); | |
_utmk.proxy = this; | |
} | |
public function hasUTMZ():Boolean{ | |
if (_utmz){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _createUMTV():void{ | |
_utmv = new UTMV(); | |
_utmv.proxy = this; | |
} | |
private function _createUMTZ():void{ | |
_utmz = new UTMZ(); | |
_utmz.proxy = this; | |
} | |
public function updateUTMA(_arg1:Number):void{ | |
if (_debug.verbose){ | |
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced); | |
}; | |
if (!utma.isEmpty()){ | |
if (isNaN(utma.sessionCount)){ | |
utma.sessionCount = 1; | |
} else { | |
utma.sessionCount = (utma.sessionCount + 1); | |
}; | |
utma.lastTime = utma.currentTime; | |
utma.currentTime = _arg1; | |
}; | |
} | |
private function _onFlushStatus(_arg1:NetStatusEvent):void{ | |
_debug.info("User closed permission dialog..."); | |
switch (_arg1.info.code){ | |
case "SharedObject.Flush.Success": | |
_debug.info("User granted permission -- value saved."); | |
break; | |
case "SharedObject.Flush.Failed": | |
_debug.info("User denied permission -- value not saved."); | |
break; | |
}; | |
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus); | |
} | |
private function _clearUTMA():void{ | |
_utma = null; | |
if (!isVolatile()){ | |
_SO.data.utma = null; | |
delete _SO.data.utma; | |
}; | |
} | |
private function _clearUTMC():void{ | |
_utmc = null; | |
} | |
private function _clearUTMB():void{ | |
_utmb = null; | |
if (!isVolatile()){ | |
_SO.data.utmb = null; | |
delete _SO.data.utmb; | |
}; | |
} | |
public function update(_arg1:String, _arg2):void{ | |
if (isVolatile()){ | |
_OBJ[_arg1] = _arg2; | |
} else { | |
_SO.data[_arg1] = _arg2; | |
}; | |
} | |
private function _clearUTMZ():void{ | |
_utmz = null; | |
if (!isVolatile()){ | |
_SO.data.utmz = null; | |
delete _SO.data.utmz; | |
}; | |
} | |
private function _clearUTMV():void{ | |
_utmv = null; | |
if (!isVolatile()){ | |
_SO.data.utmv = null; | |
delete _SO.data.utmv; | |
}; | |
} | |
public function isVolatile():Boolean{ | |
return (_volatile); | |
} | |
public function get utma():UTMA{ | |
if (!hasUTMA()){ | |
_createUMTA(); | |
}; | |
return (_utma); | |
} | |
public function get utmb():UTMB{ | |
if (!hasUTMB()){ | |
_createUMTB(); | |
}; | |
return (_utmb); | |
} | |
public function get utmc():UTMC{ | |
if (!hasUTMC()){ | |
_createUMTC(); | |
}; | |
return (_utmc); | |
} | |
public function get utmk():UTMK{ | |
if (!hasUTMK()){ | |
_createUMTK(); | |
}; | |
return (_utmk); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.debug.*; | |
public class Domain { | |
private var _mode:DomainNameMode; | |
private var _name:String; | |
private var _debug:DebugConfiguration; | |
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){ | |
_debug = _arg3; | |
if (_arg1 == null){ | |
_arg1 = DomainNameMode.auto; | |
}; | |
_mode = _arg1; | |
if (_arg1 == DomainNameMode.custom){ | |
this.name = _arg2; | |
} else { | |
_name = _arg2; | |
}; | |
} | |
public function get mode():DomainNameMode{ | |
return (_mode); | |
} | |
public function set mode(_arg1:DomainNameMode):void{ | |
_mode = _arg1; | |
if (_mode == DomainNameMode.none){ | |
_name = ""; | |
}; | |
} | |
public function get name():String{ | |
return (_name); | |
} | |
public function set name(_arg1:String):void{ | |
if (((!((_arg1.charAt(0) == "."))) && (_debug))){ | |
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek); | |
}; | |
_name = _arg1; | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.v4.*; | |
import flash.errors.*; | |
public class TrackerCache implements GoogleAnalyticsAPI { | |
public static var CACHE_THROW_ERROR:Boolean; | |
public var tracker:GoogleAnalyticsAPI; | |
private var _ar:Array; | |
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){ | |
this.tracker = _arg1; | |
_ar = []; | |
} | |
public function size():uint{ | |
return (_ar.length); | |
} | |
public function flush():void{ | |
var _local1:Object; | |
var _local2:String; | |
var _local3:Array; | |
var _local4:int; | |
var _local5:int; | |
if (tracker == null){ | |
return; | |
}; | |
if (size() > 0){ | |
_local4 = _ar.length; | |
while (_local5 < _local4) { | |
_local1 = _ar.shift(); | |
_local2 = (_local1.name as String); | |
_local3 = (_local1.args as Array); | |
if (((!((_local2 == null))) && ((_local2 in tracker)))){ | |
(tracker[_local2] as Function).apply(tracker, _local3); | |
}; | |
_local5++; | |
}; | |
}; | |
} | |
public function enqueue(_arg1:String, ... _args):Boolean{ | |
if (_arg1 == null){ | |
return (false); | |
}; | |
_ar.push({ | |
name:_arg1, | |
args:_args | |
}); | |
return (true); | |
} | |
public function link(_arg1:String, _arg2:Boolean=false):void{ | |
enqueue("link", _arg1, _arg2); | |
} | |
public function addOrganic(_arg1:String, _arg2:String):void{ | |
enqueue("addOrganic", _arg1, _arg2); | |
} | |
public function setAllowLinker(_arg1:Boolean):void{ | |
enqueue("setAllowLinker", _arg1); | |
} | |
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{ | |
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4); | |
return (true); | |
} | |
public function trackTrans():void{ | |
enqueue("trackTrans"); | |
} | |
public function trackPageview(_arg1:String=""):void{ | |
enqueue("trackPageview", _arg1); | |
} | |
public function setClientInfo(_arg1:Boolean):void{ | |
enqueue("setClientInfo", _arg1); | |
} | |
public function getClientInfo():Boolean{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment.")); | |
}; | |
return (false); | |
} | |
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{ | |
enqueue("linkByPost", _arg1, _arg2); | |
} | |
public function setCookieTimeout(_arg1:int):void{ | |
enqueue("setCookieTimeout", _arg1); | |
} | |
public function isEmpty():Boolean{ | |
return ((_ar.length == 0)); | |
} | |
public function resetSession():void{ | |
enqueue("resetSession"); | |
} | |
public function setDetectFlash(_arg1:Boolean):void{ | |
enqueue("setDetectFlash", _arg1); | |
} | |
public function clear():void{ | |
_ar = []; | |
} | |
public function getDetectTitle():Boolean{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment.")); | |
}; | |
return (false); | |
} | |
public function setCampNameKey(_arg1:String):void{ | |
enqueue("setCampNameKey", _arg1); | |
} | |
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{ | |
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6); | |
} | |
public function createEventTracker(_arg1:String):EventTracker{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment.")); | |
}; | |
return (null); | |
} | |
public function setVar(_arg1:String):void{ | |
enqueue("setVar", _arg1); | |
} | |
public function clearIgnoredOrganic():void{ | |
enqueue("clearIgnoredOrganic"); | |
} | |
public function setDomainName(_arg1:String):void{ | |
enqueue("setDomainName", _arg1); | |
} | |
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment.")); | |
}; | |
return (null); | |
} | |
public function setCampSourceKey(_arg1:String):void{ | |
enqueue("setCampSourceKey", _arg1); | |
} | |
public function setCampContentKey(_arg1:String):void{ | |
enqueue("setCampContentKey", _arg1); | |
} | |
public function clearIgnoredRef():void{ | |
enqueue("clearIgnoredRef"); | |
} | |
public function setLocalServerMode():void{ | |
enqueue("setLocalServerMode"); | |
} | |
public function getLocalGifPath():String{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment.")); | |
}; | |
return (""); | |
} | |
public function setAllowAnchor(_arg1:Boolean):void{ | |
enqueue("setAllowAnchor", _arg1); | |
} | |
public function setLocalGifPath(_arg1:String):void{ | |
enqueue("setLocalGifPath", _arg1); | |
} | |
public function getVersion():String{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment.")); | |
}; | |
return (""); | |
} | |
public function setCookiePath(_arg1:String):void{ | |
enqueue("setCookiePath", _arg1); | |
} | |
public function setSampleRate(_arg1:Number):void{ | |
enqueue("setSampleRate", _arg1); | |
} | |
public function setAllowHash(_arg1:Boolean):void{ | |
enqueue("setAllowHash", _arg1); | |
} | |
public function addIgnoredOrganic(_arg1:String):void{ | |
enqueue("addIgnoredOrganic", _arg1); | |
} | |
public function setCampNOKey(_arg1:String):void{ | |
enqueue("setCampNOKey", _arg1); | |
} | |
public function getServiceMode():ServerOperationMode{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment.")); | |
}; | |
return (null); | |
} | |
public function setLocalRemoteServerMode():void{ | |
enqueue("setLocalRemoteServerMode"); | |
} | |
public function cookiePathCopy(_arg1:String):void{ | |
enqueue("cookiePathCopy", _arg1); | |
} | |
public function setDetectTitle(_arg1:Boolean):void{ | |
enqueue("setDetectTitle", _arg1); | |
} | |
public function getDetectFlash():Boolean{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment.")); | |
}; | |
return (false); | |
} | |
public function setCampaignTrack(_arg1:Boolean):void{ | |
enqueue("setCampaignTrack", _arg1); | |
} | |
public function clearOrganic():void{ | |
enqueue("clearOrganic"); | |
} | |
public function setCampTermKey(_arg1:String):void{ | |
enqueue("setCampTermKey", _arg1); | |
} | |
public function addIgnoredRef(_arg1:String):void{ | |
enqueue("addIgnoredRef", _arg1); | |
} | |
public function setCampMediumKey(_arg1:String):void{ | |
enqueue("setCampMediumKey", _arg1); | |
} | |
public function setSessionTimeout(_arg1:int):void{ | |
enqueue("setSessionTimeout", _arg1); | |
} | |
public function setRemoteServerMode():void{ | |
enqueue("setRemoteServerMode"); | |
} | |
public function element(){ | |
return (_ar[0]); | |
} | |
public function getAccount():String{ | |
if (CACHE_THROW_ERROR){ | |
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment.")); | |
}; | |
return (""); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
public namespace ga_internal; | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
public class DomainNameMode { | |
public static const custom:DomainNameMode = new DomainNameMode(2, "custom"); | |
; | |
public static const none:DomainNameMode = new DomainNameMode(0, "none"); | |
; | |
public static const auto:DomainNameMode = new DomainNameMode(1, "auto"); | |
; | |
private var _value:int; | |
private var _name:String; | |
public function DomainNameMode(_arg1:int=0, _arg2:String=""){ | |
_value = _arg1; | |
_name = _arg2; | |
} | |
public function valueOf():int{ | |
return (_value); | |
} | |
public function toString():String{ | |
return (_name); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.v4.*; | |
public class EventTracker { | |
private var _parent:GoogleAnalyticsAPI; | |
public var name:String; | |
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){ | |
this.name = _arg1; | |
_parent = _arg2; | |
} | |
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{ | |
return (_parent.trackEvent(name, _arg1, _arg2, _arg3)); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
public class ServerOperationMode { | |
public static const both:ServerOperationMode = new ServerOperationMode(2, "both"); | |
; | |
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote"); | |
; | |
public static const local:ServerOperationMode = new ServerOperationMode(0, "local"); | |
; | |
private var _value:int; | |
private var _name:String; | |
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){ | |
_value = _arg1; | |
_name = _arg2; | |
} | |
public function valueOf():int{ | |
return (_value); | |
} | |
public function toString():String{ | |
return (_name); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.utils.*; | |
public class Organic { | |
public static var throwErrors:Boolean = false; | |
private var _sourcesCache:Array; | |
private var _sourcesEngine:Array; | |
private var _ignoredKeywords:Array; | |
private var _ignoredReferralsCache:Object; | |
private var _ignoredReferrals:Array; | |
private var _ignoredKeywordsCache:Object; | |
private var _sources:Array; | |
public function Organic(){ | |
_sources = []; | |
_sourcesCache = []; | |
_sourcesEngine = []; | |
_ignoredReferrals = []; | |
_ignoredReferralsCache = {}; | |
_ignoredKeywords = []; | |
_ignoredKeywordsCache = {}; | |
} | |
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{ | |
var _local3:String; | |
var _local4:Variables; | |
if (_arg2.indexOf((_arg1 + "=")) > -1){ | |
if (_arg2.charAt(0) == "?"){ | |
_arg2 = _arg2.substr(1); | |
}; | |
_arg2 = _arg2.split("+").join("%20"); | |
_local4 = new Variables(_arg2); | |
_local3 = _local4[_arg1]; | |
}; | |
return (_local3); | |
} | |
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{ | |
var _local3:String; | |
_local3 = _arg1.keyword; | |
return (getKeywordValueFromPath(_local3, _arg2)); | |
} | |
public function isIgnoredKeyword(_arg1:String):Boolean{ | |
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function isIgnoredReferral(_arg1:String):Boolean{ | |
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function clear():void{ | |
clearEngines(); | |
clearIgnoredReferrals(); | |
clearIgnoredKeywords(); | |
} | |
public function get ignoredKeywordsCount():int{ | |
return (_ignoredKeywords.length); | |
} | |
public function match(_arg1:String):Boolean{ | |
if (_arg1 == ""){ | |
return (false); | |
}; | |
_arg1 = _arg1.toLowerCase(); | |
if (_sourcesEngine[_arg1] != undefined){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function get count():int{ | |
return (_sources.length); | |
} | |
public function addSource(_arg1:String, _arg2:String):void{ | |
var _local3:OrganicReferrer; | |
_local3 = new OrganicReferrer(_arg1, _arg2); | |
if (_sourcesCache[_local3.toString()] == undefined){ | |
_sources.push(_local3); | |
_sourcesCache[_local3.toString()] = (_sources.length - 1); | |
if (_sourcesEngine[_local3.engine] == undefined){ | |
_sourcesEngine[_local3.engine] = [(_sources.length - 1)]; | |
} else { | |
_sourcesEngine[_local3.engine].push((_sources.length - 1)); | |
}; | |
} else { | |
if (throwErrors){ | |
throw (new Error((_local3.toString() + " already exists, we don't add it."))); | |
}; | |
}; | |
} | |
public function clearIgnoredKeywords():void{ | |
_ignoredKeywords = []; | |
_ignoredKeywordsCache = {}; | |
} | |
public function clearEngines():void{ | |
_sources = []; | |
_sourcesCache = []; | |
_sourcesEngine = []; | |
} | |
public function get ignoredReferralsCount():int{ | |
return (_ignoredReferrals.length); | |
} | |
public function addIgnoredReferral(_arg1:String):void{ | |
if (_ignoredReferralsCache[_arg1] == undefined){ | |
_ignoredReferrals.push(_arg1); | |
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1); | |
} else { | |
if (throwErrors){ | |
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it."))); | |
}; | |
}; | |
} | |
public function clearIgnoredReferrals():void{ | |
_ignoredReferrals = []; | |
_ignoredReferralsCache = {}; | |
} | |
public function getReferrerByName(_arg1:String):OrganicReferrer{ | |
var _local2:int; | |
if (match(_arg1)){ | |
_local2 = _sourcesEngine[_arg1][0]; | |
return (_sources[_local2]); | |
}; | |
return (null); | |
} | |
public function addIgnoredKeyword(_arg1:String):void{ | |
if (_ignoredKeywordsCache[_arg1] == undefined){ | |
_ignoredKeywords.push(_arg1); | |
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1); | |
} else { | |
if (throwErrors){ | |
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it."))); | |
}; | |
}; | |
} | |
public function get sources():Array{ | |
return (_sources); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
public class TrackerMode { | |
public static const BRIDGE:String = "Bridge"; | |
public static const AS3:String = "AS3"; | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.v4.*; | |
import com.google.analytics.utils.*; | |
import com.google.analytics.external.*; | |
public class DocumentInfo { | |
private var _config:Configuration; | |
private var _utmr:String; | |
private var _adSense:AdSenseGlobals; | |
private var _info:Environment; | |
private var _pageURL:String; | |
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){ | |
_config = _arg1; | |
_info = _arg2; | |
_utmr = _arg3; | |
_pageURL = _arg4; | |
_adSense = _arg5; | |
} | |
public function get utmr():String{ | |
if (!_utmr){ | |
return ("-"); | |
}; | |
return (_utmr); | |
} | |
public function toURLString():String{ | |
var _local1:Variables; | |
_local1 = toVariables(); | |
return (_local1.toString()); | |
} | |
private function _renderPageURL(_arg1:String=""):String{ | |
var _local2:String; | |
var _local3:String; | |
_local2 = _info.locationPath; | |
_local3 = _info.locationSearch; | |
if (((!(_arg1)) || ((_arg1 == "")))){ | |
_arg1 = (_local2 + unescape(_local3)); | |
}; | |
return (_arg1); | |
} | |
public function get utmp():String{ | |
return (_renderPageURL(_pageURL)); | |
} | |
private function _generateHitId():Number{ | |
var _local1:Number; | |
if (((_adSense.hid) && (!((_adSense.hid == ""))))){ | |
_local1 = Number(_adSense.hid); | |
} else { | |
_local1 = Math.round((Math.random() * 2147483647)); | |
_adSense.hid = String(_local1); | |
}; | |
return (_local1); | |
} | |
public function get utmhid():String{ | |
return (String(_generateHitId())); | |
} | |
public function toVariables():Variables{ | |
var _local1:Variables; | |
_local1 = new Variables(); | |
_local1.URIencode = true; | |
if (((_config.detectTitle) && (!((utmdt == ""))))){ | |
_local1.utmdt = utmdt; | |
}; | |
_local1.utmhid = utmhid; | |
_local1.utmr = utmr; | |
_local1.utmp = utmp; | |
return (_local1); | |
} | |
public function get utmdt():String{ | |
return (_info.documentTitle); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import com.google.analytics.utils.*; | |
import com.google.analytics.data.*; | |
public class EventInfo { | |
private var _isEventHit:Boolean; | |
private var _ext10:X10; | |
private var _x10:X10; | |
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){ | |
_isEventHit = _arg1; | |
_x10 = _arg2; | |
_ext10 = _arg3; | |
} | |
public function toURLString():String{ | |
var _local1:Variables; | |
_local1 = toVariables(); | |
return (_local1.toString()); | |
} | |
public function get utmt():String{ | |
return ("event"); | |
} | |
public function get utme():String{ | |
return (_x10.renderMergedUrlString(_ext10)); | |
} | |
public function toVariables():Variables{ | |
var _local1:Variables; | |
_local1 = new Variables(); | |
_local1.URIencode = true; | |
if (_isEventHit){ | |
_local1.utmt = utmt; | |
}; | |
_local1.utme = utme; | |
return (_local1); | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.core { | |
import flash.display.*; | |
import flash.utils.*; | |
import com.google.analytics.v4.*; | |
import com.google.analytics.debug.*; | |
import flash.events.*; | |
public class IdleTimer { | |
private var _loop:Timer; | |
private var _stage:Stage; | |
private var _lastMove:int; | |
private var _debug:DebugConfiguration; | |
private var _session:Timer; | |
private var _inactivity:Number; | |
private var _buffer:Buffer; | |
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){ | |
var _local5:Number; | |
var _local6:Number; | |
var _local7:Number; | |
super(); | |
_local5 = _arg1.idleLoop; | |
_local6 = _arg1.idleTimeout; | |
_local7 = _arg1.sessionTimeout; | |
_loop = new Timer((_local5 * 1000)); | |
_session = new Timer((_local7 * 1000), 1); | |
_debug = _arg2; | |
_stage = _arg3.stage; | |
_buffer = _arg4; | |
_lastMove = getTimer(); | |
_inactivity = (_local6 * 1000); | |
_loop.addEventListener(TimerEvent.TIMER, checkForIdle); | |
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession); | |
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); | |
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek); | |
_loop.start(); | |
} | |
private function onMouseMove(_arg1:MouseEvent):void{ | |
_lastMove = getTimer(); | |
if (_session.running){ | |
_debug.info("session timer reset", VisualDebugMode.geek); | |
_session.reset(); | |
}; | |
} | |
public function endSession(_arg1:TimerEvent):void{ | |
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession); | |
_debug.info("session timer end session", VisualDebugMode.geek); | |
_session.reset(); | |
_buffer.resetCurrentSession(); | |
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek); | |
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek); | |
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession); | |
} | |
public function checkForIdle(_arg1:TimerEvent):void{ | |
var _local2:int; | |
_local2 = getTimer(); | |
if ((_local2 - _lastMove) >= _inactivity){ | |
if (!_session.running){ | |
_debug.info("session timer start", VisualDebugMode.geek); | |
_session.start(); | |
}; | |
}; | |
} | |
} | |
}//package com.google.analytics.core | |
package com.google.analytics.campaign { | |
public class CampaignKey { | |
public var UCMD:String = "utm_medium"; | |
public var UCID:String = "utm_id"; | |
public var UCTR:String = "utm_term"; | |
public var UCSR:String = "utm_source"; | |
public var UCNO:String = "utm_nooverride"; | |
public var UCCN:String = "utm_campaign"; | |
public var UGCLID:String = "gclid"; | |
public var UCCT:String = "utm_content"; | |
public function CampaignKey(){ | |
UCCN = "utm_campaign"; | |
UCCT = "utm_content"; | |
UCID = "utm_id"; | |
UCMD = "utm_medium"; | |
UCNO = "utm_nooverride"; | |
UCSR = "utm_source"; | |
UCTR = "utm_term"; | |
UGCLID = "gclid"; | |
super(); | |
} | |
} | |
}//package com.google.analytics.campaign | |
package com.google.analytics.campaign { | |
import com.google.analytics.utils.*; | |
public class CampaignTracker { | |
public var content:String; | |
public var id:String; | |
public var clickId:String; | |
public var name:String; | |
public var term:String; | |
public var medium:String; | |
public var source:String; | |
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){ | |
this.id = _arg1; | |
this.source = _arg2; | |
this.clickId = _arg3; | |
this.name = _arg4; | |
this.medium = _arg5; | |
this.term = _arg6; | |
this.content = _arg7; | |
} | |
public function toTrackerString():String{ | |
var _local1:Array; | |
_local1 = []; | |
_addIfNotEmpty(_local1, "utmcsr=", source); | |
_addIfNotEmpty(_local1, "utmccn=", name); | |
_addIfNotEmpty(_local1, "utmcmd=", medium); | |
_addIfNotEmpty(_local1, "utmctr=", term); | |
_addIfNotEmpty(_local1, "utmcct=", content); | |
_addIfNotEmpty(_local1, "utmcid=", id); | |
_addIfNotEmpty(_local1, "utmgclid=", clickId); | |
return (_local1.join(CampaignManager.trackingDelimiter)); | |
} | |
public function isValid():Boolean{ | |
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){ | |
return (true); | |
}; | |
return (false); | |
} | |
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{ | |
if (_arg3 != ""){ | |
_arg3 = _arg3.split("+").join("%20"); | |
_arg3 = _arg3.split(" ").join("%20"); | |
_arg1.push((_arg2 + _arg3)); | |
}; | |
} | |
public function fromTrackerString(_arg1:String):void{ | |
var _local2:String; | |
var _local3:Variables; | |
_local2 = _arg1.split(CampaignManager.trackingDelimiter).join("&"); | |
_local3 = new Variables(_local2); | |
if (_local3.hasOwnProperty("utmcid")){ | |
this.id = _local3["utmcid"]; | |
}; | |
if (_local3.hasOwnProperty("utmcsr")){ | |
this.source = _local3["utmcsr"]; | |
}; | |
if (_local3.hasOwnProperty("utmccn")){ | |
this.name = _local3["utmccn"]; | |
}; | |
if (_local3.hasOwnProperty("utmcmd")){ | |
this.medium = _local3["utmcmd"]; | |
}; | |
if (_local3.hasOwnProperty("utmctr")){ | |
this.term = _local3["utmctr"]; | |
}; | |
if (_local3.hasOwnProperty("utmcct")){ | |
this.content = _local3["utmcct"]; | |
}; | |
if (_local3.hasOwnProperty("utmgclid")){ | |
this.clickId = _local3["utmgclid"]; | |
}; | |
} | |
} | |
}//package com.google.analytics.campaign | |
package com.google.analytics.campaign { | |
import com.google.analytics.utils.*; | |
public class CampaignInfo { | |
private var _new:Boolean; | |
private var _empty:Boolean; | |
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){ | |
_empty = _arg1; | |
_new = _arg2; | |
} | |
public function isEmpty():Boolean{ | |
return (_empty); | |
} | |
public function toURLString():String{ | |
var _local1:Variables; | |
_local1 = toVariables(); | |
return (_local1.toString()); | |
} | |
public function toVariables():Variables{ | |
var _local1:Variables; | |
_local1 = new Variables(); | |
_local1.URIencode = true; | |
if (((!(isEmpty())) && (isNew()))){ | |
_local1.utmcn = utmcn; | |
}; | |
if (((!(isEmpty())) && (!(isNew())))){ | |
_local1.utmcr = utmcr; | |
}; | |
return (_local1); | |
} | |
public function isNew():Boolean{ | |
return (_new); | |
} | |
public function get utmcn():String{ | |
return ("1"); | |
} | |
public function get utmcr():String{ | |
return ("1"); | |
} | |
} | |
}//package com.google.analytics.campaign | |
package com.google.analytics.campaign { | |
import com.google.analytics.core.*; | |
import com.google.analytics.v4.*; | |
import com.google.analytics.debug.*; | |
import com.google.analytics.utils.*; | |
public class CampaignManager { | |
public static const trackingDelimiter:String = "|"; | |
private var _config:Configuration; | |
private var _domainHash:Number; | |
private var _debug:DebugConfiguration; | |
private var _timeStamp:Number; | |
private var _referrer:String; | |
private var _buffer:Buffer; | |
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){ | |
_config = _arg1; | |
_debug = _arg2; | |
_buffer = _arg3; | |
_domainHash = _arg4; | |
_referrer = _arg5; | |
_timeStamp = _arg6; | |
} | |
public static function isInvalidReferrer(_arg1:String):Boolean{ | |
var _local2:URL; | |
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){ | |
return (true); | |
}; | |
if (_arg1.indexOf("://") > -1){ | |
_local2 = new URL(_arg1); | |
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){ | |
return (true); | |
}; | |
}; | |
return (false); | |
} | |
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{ | |
var _local3:URL; | |
_local3 = new URL(_arg1); | |
if (_local3.hostName.indexOf(_arg2.google) > -1){ | |
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){ | |
if (_local3.path == ("/" + _arg2.googleCsePath)){ | |
return (true); | |
}; | |
}; | |
}; | |
return (false); | |
} | |
public function hasNoOverride(_arg1:String):Boolean{ | |
var _local2:CampaignKey; | |
var _local3:Variables; | |
var _local4:String; | |
_local2 = _config.campaignKey; | |
if (_arg1 == ""){ | |
return (false); | |
}; | |
_local3 = new Variables(_arg1); | |
_local4 = ""; | |
if (_local3.hasOwnProperty(_local2.UCNO)){ | |
_local4 = _local3[_local2.UCNO]; | |
switch (_local4){ | |
case "1": | |
return (true); | |
case "": | |
case "0": | |
default: | |
return (false); | |
}; | |
}; | |
return (false); | |
} | |
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{ | |
var _local3:CampaignInfo; | |
var _local4:CampaignTracker; | |
var _local5:Boolean; | |
var _local6:Boolean; | |
var _local7:int; | |
var _local8:CampaignTracker; | |
var _local9:int; | |
_local3 = new CampaignInfo(); | |
_local5 = false; | |
_local6 = false; | |
_local7 = 0; | |
if (((_config.allowLinker) && (_buffer.isGenuine()))){ | |
if (!_buffer.hasUTMZ()){ | |
return (_local3); | |
}; | |
}; | |
_local4 = getTrackerFromSearchString(_arg1); | |
if (isValid(_local4)){ | |
_local6 = hasNoOverride(_arg1); | |
if (((_local6) && (!(_buffer.hasUTMZ())))){ | |
return (_local3); | |
}; | |
}; | |
if (!isValid(_local4)){ | |
_local4 = getOrganicCampaign(); | |
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){ | |
return (_local3); | |
}; | |
}; | |
if (((!(isValid(_local4))) && (_arg2))){ | |
_local4 = getReferrerCampaign(); | |
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){ | |
return (_local3); | |
}; | |
}; | |
if (!isValid(_local4)){ | |
if (((!(_buffer.hasUTMZ())) && (_arg2))){ | |
_local4 = getDirectCampaign(); | |
}; | |
}; | |
if (!isValid(_local4)){ | |
return (_local3); | |
}; | |
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){ | |
_local8 = new CampaignTracker(); | |
_local8.fromTrackerString(_buffer.utmz.campaignTracking); | |
_local5 = (_local8.toTrackerString() == _local4.toTrackerString()); | |
_local7 = _buffer.utmz.responseCount; | |
}; | |
if (((!(_local5)) || (_arg2))){ | |
_local9 = _buffer.utma.sessionCount; | |
_local7++; | |
if (_local9 == 0){ | |
_local9 = 1; | |
}; | |
_buffer.utmz.domainHash = _domainHash; | |
_buffer.utmz.campaignCreation = _timeStamp; | |
_buffer.utmz.campaignSessions = _local9; | |
_buffer.utmz.responseCount = _local7; | |
_buffer.utmz.campaignTracking = _local4.toTrackerString(); | |
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek); | |
_local3 = new CampaignInfo(false, true); | |
} else { | |
_local3 = new CampaignInfo(false, false); | |
}; | |
return (_local3); | |
} | |
public function isValid(_arg1:CampaignTracker):Boolean{ | |
if (((_arg1) && (_arg1.isValid()))){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{ | |
var _local2:CampaignTracker; | |
var _local3:CampaignTracker; | |
var _local4:CampaignKey; | |
var _local5:Variables; | |
_local2 = getOrganicCampaign(); | |
_local3 = new CampaignTracker(); | |
_local4 = _config.campaignKey; | |
if (_arg1 == ""){ | |
return (_local3); | |
}; | |
_local5 = new Variables(_arg1); | |
if (_local5.hasOwnProperty(_local4.UCID)){ | |
_local3.id = _local5[_local4.UCID]; | |
}; | |
if (_local5.hasOwnProperty(_local4.UCSR)){ | |
_local3.source = _local5[_local4.UCSR]; | |
}; | |
if (_local5.hasOwnProperty(_local4.UGCLID)){ | |
_local3.clickId = _local5[_local4.UGCLID]; | |
}; | |
if (_local5.hasOwnProperty(_local4.UCCN)){ | |
_local3.name = _local5[_local4.UCCN]; | |
} else { | |
_local3.name = "(not set)"; | |
}; | |
if (_local5.hasOwnProperty(_local4.UCMD)){ | |
_local3.medium = _local5[_local4.UCMD]; | |
} else { | |
_local3.medium = "(not set)"; | |
}; | |
if (_local5.hasOwnProperty(_local4.UCTR)){ | |
_local3.term = _local5[_local4.UCTR]; | |
} else { | |
if (((_local2) && (!((_local2.term == ""))))){ | |
_local3.term = _local2.term; | |
}; | |
}; | |
if (_local5.hasOwnProperty(_local4.UCCT)){ | |
_local3.content = _local5[_local4.UCCT]; | |
}; | |
return (_local3); | |
} | |
public function getOrganicCampaign():CampaignTracker{ | |
var _local1:CampaignTracker; | |
var _local2:URL; | |
var _local3:String; | |
var _local4:Array; | |
var _local5:OrganicReferrer; | |
var _local6:String; | |
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){ | |
return (_local1); | |
}; | |
_local2 = new URL(_referrer); | |
_local3 = ""; | |
if (_local2.hostName != ""){ | |
if (_local2.hostName.indexOf(".") > -1){ | |
_local4 = _local2.hostName.split("."); | |
switch (_local4.length){ | |
case 2: | |
_local3 = _local4[0]; | |
break; | |
case 3: | |
_local3 = _local4[1]; | |
break; | |
}; | |
}; | |
}; | |
if (_config.organic.match(_local3)){ | |
_local5 = _config.organic.getReferrerByName(_local3); | |
_local6 = _config.organic.getKeywordValue(_local5, _local2.search); | |
_local1 = new CampaignTracker(); | |
_local1.source = _local5.engine; | |
_local1.name = "(organic)"; | |
_local1.medium = "organic"; | |
_local1.term = _local6; | |
}; | |
return (_local1); | |
} | |
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{ | |
if (((_arg1) && ((_arg1.medium == "referral")))){ | |
return (_config.organic.isIgnoredReferral(_arg1.source)); | |
}; | |
return (false); | |
} | |
public function getDirectCampaign():CampaignTracker{ | |
var _local1:CampaignTracker; | |
_local1 = new CampaignTracker(); | |
_local1.source = "(direct)"; | |
_local1.name = "(direct)"; | |
_local1.medium = "(none)"; | |
return (_local1); | |
} | |
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{ | |
if (((_arg1) && ((_arg1.medium == "organic")))){ | |
return (_config.organic.isIgnoredKeyword(_arg1.term)); | |
}; | |
return (false); | |
} | |
public function getReferrerCampaign():CampaignTracker{ | |
var _local1:CampaignTracker; | |
var _local2:URL; | |
var _local3:String; | |
var _local4:String; | |
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){ | |
return (_local1); | |
}; | |
_local2 = new URL(_referrer); | |
_local3 = _local2.hostName; | |
_local4 = _local2.path; | |
if (_local3.indexOf("www.") == 0){ | |
_local3 = _local3.substr(4); | |
}; | |
_local1 = new CampaignTracker(); | |
_local1.source = _local3; | |
_local1.name = "(referral)"; | |
_local1.medium = "referral"; | |
_local1.content = _local4; | |
return (_local1); | |
} | |
} | |
}//package com.google.analytics.campaign | |
package com.google.analytics.data { | |
public class UTMC extends UTMCookie { | |
private var _domainHash:Number; | |
public function UTMC(_arg1:Number=NaN){ | |
super("utmc", "__utmc", ["domainHash"]); | |
this.domainHash = _arg1; | |
} | |
public function set domainHash(_arg1:Number):void{ | |
_domainHash = _arg1; | |
update(); | |
} | |
public function get domainHash():Number{ | |
return (_domainHash); | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
public class X10 { | |
private var _delimEnd:String = ")"; | |
private var _delimSet:String = "*"; | |
private var _escapeChar:String = "'"; | |
private var _delimBegin:String = "("; | |
private var _delimNumValue:String = "!"; | |
private var _key:String = "k"; | |
private var _set:Array; | |
private var _projectData:Object; | |
private var _hasData:int; | |
private var _escapeCharMap:Object; | |
private var _minimum:int; | |
private var _value:String = "v"; | |
public function X10(){ | |
_key = "k"; | |
_value = "v"; | |
_set = [_key, _value]; | |
_delimBegin = "("; | |
_delimEnd = ")"; | |
_delimSet = "*"; | |
_delimNumValue = "!"; | |
_escapeChar = "'"; | |
super(); | |
_projectData = {}; | |
_escapeCharMap = {}; | |
_escapeCharMap[_escapeChar] = "'0"; | |
_escapeCharMap[_delimEnd] = "'1"; | |
_escapeCharMap[_delimSet] = "'2"; | |
_escapeCharMap[_delimNumValue] = "'3"; | |
_minimum = 1; | |
} | |
private function _clearInternal(_arg1:Number, _arg2:String):void{ | |
var _local3:Boolean; | |
var _local4:int; | |
var _local5:int; | |
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){ | |
_projectData[_arg1][_arg2] = undefined; | |
_local3 = true; | |
_local5 = _set.length; | |
_local4 = 0; | |
while (_local4 < _local5) { | |
if (_projectData[_arg1][_set[_local4]] != undefined){ | |
_local3 = false; | |
break; | |
}; | |
_local4++; | |
}; | |
if (_local3){ | |
_projectData[_arg1] = undefined; | |
_hasData = (_hasData - 1); | |
}; | |
}; | |
} | |
public function hasData():Boolean{ | |
return ((_hasData > 0)); | |
} | |
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{ | |
if (!hasProject(_arg1)){ | |
_projectData[_arg1] = {}; | |
}; | |
if (_projectData[_arg1][_arg2] == undefined){ | |
_projectData[_arg1][_arg2] = []; | |
}; | |
_projectData[_arg1][_arg2][_arg3] = _arg4; | |
_hasData = (_hasData + 1); | |
} | |
public function hasProject(_arg1:Number):Boolean{ | |
return (_projectData[_arg1]); | |
} | |
public function clearKey(_arg1:Number):void{ | |
_clearInternal(_arg1, _key); | |
} | |
private function _renderDataType(_arg1:Array):String{ | |
var _local2:Array; | |
var _local3:String; | |
var _local4:int; | |
_local2 = []; | |
_local4 = 0; | |
while (_local4 < _arg1.length) { | |
if (_arg1[_local4] != undefined){ | |
_local3 = ""; | |
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){ | |
_local3 = (_local3 + _local4.toString()); | |
_local3 = (_local3 + _delimNumValue); | |
}; | |
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4])); | |
_local2.push(_local3); | |
}; | |
_local4++; | |
}; | |
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd)); | |
} | |
public function getKey(_arg1:Number, _arg2:Number):String{ | |
return ((_getInternal(_arg1, _key, _arg2) as String)); | |
} | |
public function clearValue(_arg1:Number):void{ | |
_clearInternal(_arg1, _value); | |
} | |
public function renderMergedUrlString(_arg1:X10=null):String{ | |
var _local2:Array; | |
var _local3:String; | |
if (!_arg1){ | |
return (renderUrlString()); | |
}; | |
_local2 = [_arg1.renderUrlString()]; | |
for (_local3 in _projectData) { | |
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){ | |
_local2.push((_local3 + _renderProject(_projectData[_local3]))); | |
}; | |
}; | |
return (_local2.join("")); | |
} | |
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{ | |
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){ | |
return (false); | |
}; | |
_setInternal(_arg1, _value, _arg2, _arg3.toString()); | |
return (true); | |
} | |
public function renderUrlString():String{ | |
var _local1:Array; | |
var _local2:String; | |
_local1 = []; | |
for (_local2 in _projectData) { | |
if (hasProject(Number(_local2))){ | |
_local1.push((_local2 + _renderProject(_projectData[_local2]))); | |
}; | |
}; | |
return (_local1.join("")); | |
} | |
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{ | |
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){ | |
return (_projectData[_arg1][_arg2][_arg3]); | |
}; | |
return (undefined); | |
} | |
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{ | |
_setInternal(_arg1, _key, _arg2, _arg3); | |
return (true); | |
} | |
public function getValue(_arg1:Number, _arg2:Number){ | |
var _local3:*; | |
_local3 = _getInternal(_arg1, _value, _arg2); | |
if (_local3 == null){ | |
return (null); | |
}; | |
return (Number(_local3)); | |
} | |
private function _renderProject(_arg1:Object):String{ | |
var _local2:String; | |
var _local3:Boolean; | |
var _local4:int; | |
var _local5:Array; | |
var _local6:int; | |
_local2 = ""; | |
_local3 = false; | |
_local6 = _set.length; | |
_local4 = 0; | |
while (_local4 < _local6) { | |
_local5 = _arg1[_set[_local4]]; | |
if (_local5){ | |
if (_local3){ | |
_local2 = (_local2 + _set[_local4]); | |
}; | |
_local2 = (_local2 + _renderDataType(_local5)); | |
_local3 = false; | |
} else { | |
_local3 = true; | |
}; | |
_local4++; | |
}; | |
return (_local2); | |
} | |
private function _escapeExtensibleValue(_arg1:String):String{ | |
var _local2:String; | |
var _local3:int; | |
var _local4:String; | |
var _local5:String; | |
_local2 = ""; | |
_local3 = 0; | |
while (_local3 < _arg1.length) { | |
_local4 = _arg1.charAt(_local3); | |
_local5 = _escapeCharMap[_local4]; | |
if (_local5){ | |
_local2 = (_local2 + _local5); | |
} else { | |
_local2 = (_local2 + _local4); | |
}; | |
_local3++; | |
}; | |
return (_local2); | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
import com.google.analytics.utils.*; | |
public class UTMB extends UTMCookie { | |
public static var defaultTimespan:Number = Timespan.thirtyminutes; | |
private var _lastTime:Number; | |
private var _domainHash:Number; | |
private var _trackCount:Number; | |
private var _token:Number; | |
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){ | |
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000)); | |
this.domainHash = _arg1; | |
this.trackCount = _arg2; | |
this.token = _arg3; | |
this.lastTime = _arg4; | |
} | |
public function get token():Number{ | |
return (_token); | |
} | |
public function set trackCount(_arg1:Number):void{ | |
_trackCount = _arg1; | |
update(); | |
} | |
public function set lastTime(_arg1:Number):void{ | |
_lastTime = _arg1; | |
update(); | |
} | |
public function get lastTime():Number{ | |
return (_lastTime); | |
} | |
public function set domainHash(_arg1:Number):void{ | |
_domainHash = _arg1; | |
update(); | |
} | |
public function get domainHash():Number{ | |
return (_domainHash); | |
} | |
public function set token(_arg1:Number):void{ | |
_token = _arg1; | |
update(); | |
} | |
public function get trackCount():Number{ | |
return (_trackCount); | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
import com.google.analytics.utils.*; | |
public class UTMZ extends UTMCookie { | |
public static var defaultTimespan:Number = Timespan.sixmonths; | |
private var _domainHash:Number; | |
private var _campaignSessions:Number; | |
private var _campaignTracking:String; | |
private var _responseCount:Number; | |
private var _campaignCreation:Number; | |
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){ | |
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000)); | |
this.domainHash = _arg1; | |
this.campaignCreation = _arg2; | |
this.campaignSessions = _arg3; | |
this.responseCount = _arg4; | |
this.campaignTracking = _arg5; | |
} | |
public function get campaignCreation():Number{ | |
return (_campaignCreation); | |
} | |
public function set campaignSessions(_arg1:Number):void{ | |
_campaignSessions = _arg1; | |
update(); | |
} | |
public function set responseCount(_arg1:Number):void{ | |
_responseCount = _arg1; | |
update(); | |
} | |
public function set campaignCreation(_arg1:Number):void{ | |
_campaignCreation = _arg1; | |
update(); | |
} | |
public function get campaignSessions():Number{ | |
return (_campaignSessions); | |
} | |
public function get responseCount():Number{ | |
return (_responseCount); | |
} | |
public function set domainHash(_arg1:Number):void{ | |
_domainHash = _arg1; | |
update(); | |
} | |
public function get campaignTracking():String{ | |
return (_campaignTracking); | |
} | |
public function set campaignTracking(_arg1:String):void{ | |
_campaignTracking = _arg1; | |
update(); | |
} | |
public function get domainHash():Number{ | |
return (_domainHash); | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
public interface Cookie { | |
function toURLString():String; | |
function toSharedObject():Object; | |
function set creation(_arg1:Date):void; | |
function fromSharedObject(_arg1:Object):void; | |
function get expiration():Date; | |
function isExpired():Boolean; | |
function set expiration(_arg1:Date):void; | |
function get creation():Date; | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
import com.google.analytics.utils.*; | |
public class UTMA extends UTMCookie { | |
private var _domainHash:Number; | |
private var _firstTime:Number; | |
private var _currentTime:Number; | |
private var _sessionId:Number; | |
private var _lastTime:Number; | |
private var _sessionCount:Number; | |
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){ | |
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000)); | |
this.domainHash = _arg1; | |
this.sessionId = _arg2; | |
this.firstTime = _arg3; | |
this.lastTime = _arg4; | |
this.currentTime = _arg5; | |
this.sessionCount = _arg6; | |
} | |
public function get lastTime():Number{ | |
return (_lastTime); | |
} | |
public function set lastTime(_arg1:Number):void{ | |
_lastTime = _arg1; | |
update(); | |
} | |
public function get sessionCount():Number{ | |
return (_sessionCount); | |
} | |
public function get firstTime():Number{ | |
return (_firstTime); | |
} | |
public function set sessionId(_arg1:Number):void{ | |
_sessionId = _arg1; | |
update(); | |
} | |
public function set sessionCount(_arg1:Number):void{ | |
_sessionCount = _arg1; | |
update(); | |
} | |
public function set firstTime(_arg1:Number):void{ | |
_firstTime = _arg1; | |
update(); | |
} | |
public function set currentTime(_arg1:Number):void{ | |
_currentTime = _arg1; | |
update(); | |
} | |
public function get sessionId():Number{ | |
return (_sessionId); | |
} | |
public function set domainHash(_arg1:Number):void{ | |
_domainHash = _arg1; | |
update(); | |
} | |
public function get currentTime():Number{ | |
return (_currentTime); | |
} | |
public function get domainHash():Number{ | |
return (_domainHash); | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
import com.google.analytics.core.*; | |
public class UTMCookie implements Cookie { | |
protected var inURL:String; | |
protected var name:String; | |
private var _creation:Date; | |
private var _expiration:Date; | |
public var proxy:Buffer; | |
private var _timespan:Number; | |
protected var fields:Array; | |
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){ | |
this.name = _arg1; | |
this.inURL = _arg2; | |
this.fields = _arg3; | |
_timestamp(_arg4); | |
} | |
public function isEmpty():Boolean{ | |
var _local1:int; | |
var _local2:String; | |
var _local3:int; | |
_local1 = 0; | |
_local3 = 0; | |
while (_local3 < fields.length) { | |
_local2 = fields[_local3]; | |
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){ | |
_local1++; | |
} else { | |
if ((((this[_local2] is String)) && ((this[_local2] == "")))){ | |
_local1++; | |
}; | |
}; | |
_local3++; | |
}; | |
if (_local1 == fields.length){ | |
return (true); | |
}; | |
return (false); | |
} | |
protected function update():void{ | |
resetTimestamp(); | |
if (proxy){ | |
proxy.update(name, toSharedObject()); | |
}; | |
} | |
public function fromSharedObject(_arg1:Object):void{ | |
var _local2:String; | |
var _local3:int; | |
var _local4:int; | |
_local3 = fields.length; | |
_local4 = 0; | |
while (_local4 < _local3) { | |
_local2 = fields[_local4]; | |
if (_arg1[_local2]){ | |
this[_local2] = _arg1[_local2]; | |
}; | |
_local4++; | |
}; | |
if (_arg1.creation){ | |
this.creation = _arg1.creation; | |
}; | |
if (_arg1.expiration){ | |
this.expiration = _arg1.expiration; | |
}; | |
} | |
private function _timestamp(_arg1:Number):void{ | |
creation = new Date(); | |
_timespan = _arg1; | |
if (_arg1 > 0){ | |
expiration = new Date((creation.valueOf() + _arg1)); | |
}; | |
} | |
public function isExpired():Boolean{ | |
var _local1:Date; | |
var _local2:Number; | |
_local1 = new Date(); | |
_local2 = (expiration.valueOf() - _local1.valueOf()); | |
if (_local2 <= 0){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function set expiration(_arg1:Date):void{ | |
_expiration = _arg1; | |
} | |
public function get creation():Date{ | |
return (_creation); | |
} | |
public function reset():void{ | |
var _local1:String; | |
var _local2:int; | |
_local2 = 0; | |
while (_local2 < fields.length) { | |
_local1 = fields[_local2]; | |
if ((this[_local1] is Number)){ | |
this[_local1] = NaN; | |
} else { | |
if ((this[_local1] is String)){ | |
this[_local1] = ""; | |
}; | |
}; | |
_local2++; | |
}; | |
resetTimestamp(); | |
update(); | |
} | |
public function valueOf():String{ | |
var _local1:Array; | |
var _local2:String; | |
var _local3:*; | |
var _local4:int; | |
_local1 = []; | |
_local4 = 0; | |
while (_local4 < fields.length) { | |
_local2 = fields[_local4]; | |
_local3 = this[_local2]; | |
if ((_local3 is String)){ | |
if (_local3 == ""){ | |
_local3 = "-"; | |
_local1.push(_local3); | |
} else { | |
_local1.push(_local3); | |
}; | |
} else { | |
if ((_local3 is Number)){ | |
if (_local3 == 0){ | |
_local1.push(_local3); | |
} else { | |
if (isNaN(_local3)){ | |
_local3 = "-"; | |
_local1.push(_local3); | |
} else { | |
_local1.push(_local3); | |
}; | |
}; | |
}; | |
}; | |
_local4++; | |
}; | |
return (("" + _local1.join("."))); | |
} | |
public function resetTimestamp(_arg1:Number=NaN):void{ | |
if (!isNaN(_arg1)){ | |
_timespan = _arg1; | |
}; | |
_creation = null; | |
_expiration = null; | |
_timestamp(_timespan); | |
} | |
public function get expiration():Date{ | |
if (_expiration){ | |
return (_expiration); | |
}; | |
return (new Date((new Date().valueOf() + 1000))); | |
} | |
public function toURLString():String{ | |
return (((inURL + "=") + valueOf())); | |
} | |
public function toSharedObject():Object{ | |
var _local1:Object; | |
var _local2:String; | |
var _local3:*; | |
var _local4:int; | |
_local1 = {}; | |
_local4 = 0; | |
while (_local4 < fields.length) { | |
_local2 = fields[_local4]; | |
_local3 = this[_local2]; | |
if ((_local3 is String)){ | |
_local1[_local2] = _local3; | |
} else { | |
if (_local3 == 0){ | |
_local1[_local2] = _local3; | |
} else { | |
if (isNaN(_local3)){ | |
} else { | |
_local1[_local2] = _local3; | |
}; | |
}; | |
}; | |
_local4++; | |
}; | |
_local1.creation = creation; | |
_local1.expiration = expiration; | |
return (_local1); | |
} | |
public function toString(_arg1:Boolean=false):String{ | |
var _local2:Array; | |
var _local3:String; | |
var _local4:*; | |
var _local5:int; | |
var _local6:int; | |
var _local7:String; | |
_local2 = []; | |
_local5 = fields.length; | |
_local6 = 0; | |
while (_local6 < _local5) { | |
_local3 = fields[_local6]; | |
_local4 = this[_local3]; | |
if ((_local4 is String)){ | |
_local2.push((((_local3 + ": \"") + _local4) + "\"")); | |
} else { | |
if (_local4 == 0){ | |
_local2.push(((_local3 + ": ") + _local4)); | |
} else { | |
if (isNaN(_local4)){ | |
} else { | |
_local2.push(((_local3 + ": ") + _local4)); | |
}; | |
}; | |
}; | |
_local6++; | |
}; | |
_local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}"); | |
if (_arg1){ | |
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration)); | |
}; | |
return (_local7); | |
} | |
public function set creation(_arg1:Date):void{ | |
_creation = _arg1; | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
import com.google.analytics.utils.*; | |
public class UTMV extends UTMCookie { | |
private var _domainHash:Number; | |
private var _value:String; | |
public function UTMV(_arg1:Number=NaN, _arg2:String=""){ | |
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000)); | |
this.domainHash = _arg1; | |
this.value = _arg2; | |
} | |
public function get value():String{ | |
return (_value); | |
} | |
public function set value(_arg1:String):void{ | |
_value = _arg1; | |
update(); | |
} | |
override public function toURLString():String{ | |
return (((inURL + "=") + encodeURI(valueOf()))); | |
} | |
public function get domainHash():Number{ | |
return (_domainHash); | |
} | |
public function set domainHash(_arg1:Number):void{ | |
_domainHash = _arg1; | |
update(); | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.data { | |
public class UTMK extends UTMCookie { | |
private var _hash:Number; | |
public function UTMK(_arg1:Number=NaN){ | |
super("utmk", "__utmk", ["hash"]); | |
this.hash = _arg1; | |
} | |
public function get hash():Number{ | |
return (_hash); | |
} | |
public function set hash(_arg1:Number):void{ | |
_hash = _arg1; | |
update(); | |
} | |
} | |
}//package com.google.analytics.data | |
package com.google.analytics.v4 { | |
import com.google.analytics.core.*; | |
import com.google.analytics.debug.*; | |
import com.google.analytics.utils.*; | |
import com.google.analytics.campaign.*; | |
public class Configuration { | |
public var serverMode:ServerOperationMode; | |
public var detectFlash:Boolean = true; | |
public var allowLocalTracking:Boolean = true; | |
public var secureRemoteGIFpath:String = "https://ssl.google-analytics.com/__utm.gif"; | |
public var hasSiteOverlay:Boolean = false; | |
private var _version:String = "4.3as"; | |
public var allowDomainHash:Boolean = true; | |
public var detectClientInfo:Boolean = true; | |
public var idleLoop:Number = 30; | |
public var isTrackOutboundSubdomains:Boolean = false; | |
public var cookiePath:String = "/"; | |
public var transactionFieldDelim:String = "|"; | |
private var _organic:Organic; | |
private var _cookieName:String = "analytics"; | |
public var campaignKey:CampaignKey; | |
public var google:String = "google"; | |
public var googleCsePath:String = "cse"; | |
public var bucketCapacity:Number = 10; | |
private var _sampleRate:Number = 1; | |
public var remoteGIFpath:String = "http://www.google-analytics.com/__utm.gif"; | |
public var googleSearchParam:String = "q"; | |
public var allowLinker:Boolean = false; | |
public var maxOutboundLinkExamined:Number = 1000; | |
private var _debug:DebugConfiguration; | |
private var _trackingLimitPerSession:int = 500; | |
private var _domain:Domain; | |
public var allowAnchor:Boolean = false; | |
public var tokenCliff:int = 10; | |
public var sessionTimeout:Number; | |
public var idleTimeout:Number = 60; | |
public var campaignTracking:Boolean = true; | |
public var domainName:String = ""; | |
public var detectTitle:Boolean = true; | |
public var tokenRate:Number = 0.2; | |
public var conversionTimeout:Number; | |
public var localGIFpath:String = "/__utm.gif"; | |
public function Configuration(_arg1:DebugConfiguration=null){ | |
_version = "4.3as"; | |
_sampleRate = 1; | |
_trackingLimitPerSession = 500; | |
_organic = new Organic(); | |
googleCsePath = "cse"; | |
googleSearchParam = "q"; | |
google = "google"; | |
_cookieName = "analytics"; | |
allowDomainHash = true; | |
allowAnchor = false; | |
allowLinker = false; | |
hasSiteOverlay = false; | |
tokenRate = 0.2; | |
conversionTimeout = Timespan.sixmonths; | |
sessionTimeout = Timespan.thirtyminutes; | |
idleLoop = 30; | |
idleTimeout = 60; | |
maxOutboundLinkExamined = 1000; | |
tokenCliff = 10; | |
bucketCapacity = 10; | |
detectClientInfo = true; | |
detectFlash = true; | |
detectTitle = true; | |
campaignKey = new CampaignKey(); | |
campaignTracking = true; | |
isTrackOutboundSubdomains = false; | |
serverMode = ServerOperationMode.remote; | |
localGIFpath = "/__utm.gif"; | |
remoteGIFpath = "http://www.google-analytics.com/__utm.gif"; | |
secureRemoteGIFpath = "https://ssl.google-analytics.com/__utm.gif"; | |
cookiePath = "/"; | |
transactionFieldDelim = "|"; | |
domainName = ""; | |
allowLocalTracking = true; | |
super(); | |
_debug = _arg1; | |
_domain = new Domain(DomainNameMode.auto, "", _debug); | |
serverMode = ServerOperationMode.remote; | |
_initOrganicSources(); | |
} | |
public function get organic():Organic{ | |
return (_organic); | |
} | |
public function get trackingLimitPerSession():int{ | |
return (_trackingLimitPerSession); | |
} | |
private function _initOrganicSources():void{ | |
addOrganicSource(google, googleSearchParam); | |
addOrganicSource("yahoo", "p"); | |
addOrganicSource("msn", "q"); | |
addOrganicSource("aol", "query"); | |
addOrganicSource("aol", "encquery"); | |
addOrganicSource("lycos", "query"); | |
addOrganicSource("ask", "q"); | |
addOrganicSource("altavista", "q"); | |
addOrganicSource("netscape", "query"); | |
addOrganicSource("cnn", "query"); | |
addOrganicSource("looksmart", "qt"); | |
addOrganicSource("about", "terms"); | |
addOrganicSource("mamma", "query"); | |
addOrganicSource("alltheweb", "q"); | |
addOrganicSource("gigablast", "q"); | |
addOrganicSource("voila", "rdata"); | |
addOrganicSource("virgilio", "qs"); | |
addOrganicSource("live", "q"); | |
addOrganicSource("baidu", "wd"); | |
addOrganicSource("alice", "qs"); | |
addOrganicSource("yandex", "text"); | |
addOrganicSource("najdi", "q"); | |
addOrganicSource("aol", "q"); | |
addOrganicSource("club-internet", "q"); | |
addOrganicSource("mama", "query"); | |
addOrganicSource("seznam", "q"); | |
addOrganicSource("search", "q"); | |
addOrganicSource("wp", "szukaj"); | |
addOrganicSource("onet", "qt"); | |
addOrganicSource("netsprint", "q"); | |
addOrganicSource("google.interia", "q"); | |
addOrganicSource("szukacz", "q"); | |
addOrganicSource("yam", "k"); | |
addOrganicSource("pchome", "q"); | |
addOrganicSource("kvasir", "searchExpr"); | |
addOrganicSource("sesam", "q"); | |
addOrganicSource("ozu", "q"); | |
addOrganicSource("terra", "query"); | |
addOrganicSource("nostrum", "query"); | |
addOrganicSource("mynet", "q"); | |
addOrganicSource("ekolay", "q"); | |
addOrganicSource("search.ilse", "search_for"); | |
} | |
public function get sampleRate():Number{ | |
return (_sampleRate); | |
} | |
public function get cookieName():String{ | |
return (_cookieName); | |
} | |
public function addOrganicSource(_arg1:String, _arg2:String):void{ | |
var engine:* = _arg1; | |
var keyword:* = _arg2; | |
try { | |
_organic.addSource(engine, keyword); | |
} catch(e:Error) { | |
if (((_debug) && (_debug.active))){ | |
_debug.warning(e.message); | |
}; | |
}; | |
} | |
public function get domain():Domain{ | |
return (_domain); | |
} | |
public function set sampleRate(_arg1:Number):void{ | |
if (_arg1 <= 0){ | |
_arg1 = 0.1; | |
}; | |
if (_arg1 > 1){ | |
_arg1 = 1; | |
}; | |
_arg1 = Number(_arg1.toFixed(2)); | |
_sampleRate = _arg1; | |
} | |
public function get version():String{ | |
return (_version); | |
} | |
} | |
}//package com.google.analytics.v4 | |
package com.google.analytics.v4 { | |
import com.google.analytics.core.*; | |
import com.google.analytics.debug.*; | |
import com.google.analytics.external.*; | |
public class Bridge implements GoogleAnalyticsAPI { | |
private static var _linkTrackingObject_js:XML = <script> | |
<![CDATA[ | |
function( container , target ) | |
{ | |
var targets ; | |
var name ; | |
if( target.indexOf(".") > 0 ) | |
{ | |
targets = target.split("."); | |
name = targets.pop(); | |
} | |
else | |
{ | |
targets = []; | |
name = target; | |
} | |
var ref = window; | |
var depth = targets.length; | |
for( var j = 0 ; j < depth ; j++ ) | |
{ | |
ref = ref[ targets[j] ] ; | |
} | |
window[container][target] = ref[name] ; | |
} | |
]]> | |
</script> | |
; | |
private static var _createTrackingObject_js:XML = <script> | |
<![CDATA[ | |
function( acct ) | |
{ | |
_GATracker[acct] = _gat._getTracker(acct); | |
} | |
]]> | |
</script> | |
; | |
private static var _injectTrackingObject_js:XML = <script> | |
<![CDATA[ | |
function() | |
{ | |
try | |
{ | |
_GATracker | |
} | |
catch(e) | |
{ | |
_GATracker = {}; | |
} | |
} | |
]]> | |
</script> | |
; | |
private static var _checkGAJS_js:XML = <script> | |
<![CDATA[ | |
function() | |
{ | |
if( _gat && _gat._getTracker ) | |
{ | |
return true; | |
} | |
return false; | |
} | |
]]> | |
</script> | |
; | |
private static var _checkValidTrackingObject_js:XML = <script> | |
<![CDATA[ | |
function(acct) | |
{ | |
if( _GATracker[acct] && (_GATracker[acct]._getAccount) ) | |
{ | |
return true ; | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
]]> | |
</script> | |
; | |
private var _debug:DebugConfiguration; | |
private var _proxy:JavascriptProxy; | |
private var _jsContainer:String = "_GATracker"; | |
private var _hasGATracker:Boolean = false; | |
private var _account:String; | |
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){ | |
var _local4:String; | |
var _local5:String; | |
var _local6:String; | |
_hasGATracker = false; | |
_jsContainer = "_GATracker"; | |
super(); | |
_account = _arg1; | |
_debug = _arg2; | |
_proxy = _arg3; | |
if (!_checkGAJS()){ | |
_local4 = ""; | |
_local4 = (_local4 + "ga.js not found, be sure to check if\n"); | |
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n"); | |
_local4 = (_local4 + "is included in the HTML."); | |
_debug.warning(_local4); | |
throw (new Error(_local4)); | |
}; | |
if (!_hasGATracker){ | |
if (((_debug.javascript) && (_debug.verbose))){ | |
_local5 = ""; | |
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n"); | |
_local5 = (_local5 + "we create it"); | |
_debug.info(_local5, VisualDebugMode.advanced); | |
}; | |
_injectTrackingObject(); | |
}; | |
if (Utils.validateAccount(_arg1)){ | |
_createTrackingObject(_arg1); | |
} else { | |
if (_checkTrackingObject(_arg1)){ | |
_linkTrackingObject(_arg1); | |
} else { | |
_local6 = ""; | |
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n")); | |
_local6 = (_local6 + "Bridge object not created."); | |
_debug.warning(_local6); | |
throw (new Error(_local6)); | |
}; | |
}; | |
} | |
public function link(_arg1:String, _arg2:Boolean=false):void{ | |
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )")); | |
_call("_link", _arg1, _arg2); | |
} | |
public function addOrganic(_arg1:String, _arg2:String):void{ | |
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )")); | |
_call("_addOrganic", _arg1); | |
} | |
public function setAllowLinker(_arg1:Boolean):void{ | |
_debug.info((("setAllowLinker( " + _arg1) + " )")); | |
_call("_setAllowLinker", _arg1); | |
} | |
private function _linkTrackingObject(_arg1:String):void{ | |
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1); | |
} | |
public function setClientInfo(_arg1:Boolean):void{ | |
_debug.info((("setClientInfo( " + _arg1) + " )")); | |
_call("_setClientInfo", _arg1); | |
} | |
public function trackTrans():void{ | |
_debug.info("trackTrans()"); | |
_call("_trackTrans"); | |
} | |
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{ | |
var _local5:int; | |
_local5 = 2; | |
if (((_arg3) && (!((_arg3 == ""))))){ | |
_local5 = 3; | |
}; | |
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){ | |
_local5 = 4; | |
}; | |
switch (_local5){ | |
case 4: | |
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )")); | |
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4)); | |
case 3: | |
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )")); | |
return (_call("_trackEvent", _arg1, _arg2, _arg3)); | |
case 2: | |
default: | |
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )")); | |
return (_call("_trackEvent", _arg1, _arg2)); | |
}; | |
} | |
public function trackPageview(_arg1:String=""):void{ | |
_debug.info((("trackPageview( " + _arg1) + " )")); | |
_call("_trackPageview", _arg1); | |
} | |
public function setCookieTimeout(_arg1:int):void{ | |
_debug.info((("setCookieTimeout( " + _arg1) + " )")); | |
_call("_setCookieTimeout", _arg1); | |
} | |
private function _checkValidTrackingObject(_arg1:String):Boolean{ | |
return (_proxy.call(_checkValidTrackingObject_js, _arg1)); | |
} | |
private function _checkGAJS():Boolean{ | |
return (_proxy.call(_checkGAJS_js)); | |
} | |
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{ | |
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented")); | |
} | |
public function getClientInfo():Boolean{ | |
_debug.info("getClientInfo()"); | |
return (_call("_getClientInfo")); | |
} | |
private function _call(_arg1:String, ... _args){ | |
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1)); | |
return (_proxy.call.apply(_proxy, _args)); | |
} | |
public function hasGAJS():Boolean{ | |
return (_checkGAJS()); | |
} | |
private function _checkTrackingObject(_arg1:String):Boolean{ | |
var _local2:Boolean; | |
var _local3:Boolean; | |
_local2 = _proxy.hasProperty(_arg1); | |
_local3 = _proxy.hasProperty((_arg1 + "._getAccount")); | |
return (((_local2) && (_local3))); | |
} | |
public function resetSession():void{ | |
_debug.warning("resetSession() not implemented"); | |
} | |
public function getDetectTitle():Boolean{ | |
_debug.info("getDetectTitle()"); | |
return (_call("_getDetectTitle")); | |
} | |
public function setDetectFlash(_arg1:Boolean):void{ | |
_debug.info((("setDetectFlash( " + _arg1) + " )")); | |
_call("_setDetectFlash", _arg1); | |
} | |
public function setCampNameKey(_arg1:String):void{ | |
_debug.info((("setCampNameKey( " + _arg1) + " )")); | |
_call("_setCampNameKey", _arg1); | |
} | |
public function createEventTracker(_arg1:String):EventTracker{ | |
_debug.info((("createEventTracker( " + _arg1) + " )")); | |
return (new EventTracker(_arg1, this)); | |
} | |
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{ | |
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )")); | |
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6); | |
} | |
public function clearIgnoredOrganic():void{ | |
_debug.info("clearIgnoredOrganic()"); | |
_call("_clearIgnoreOrganic"); | |
} | |
public function setVar(_arg1:String):void{ | |
_debug.info((("setVar( " + _arg1) + " )")); | |
_call("_setVar", _arg1); | |
} | |
public function setDomainName(_arg1:String):void{ | |
_debug.info((("setDomainName( " + _arg1) + " )")); | |
_call("_setDomainName", _arg1); | |
} | |
public function hasTrackingAccount(_arg1:String):Boolean{ | |
if (Utils.validateAccount(_arg1)){ | |
return (_checkValidTrackingObject(_arg1)); | |
}; | |
return (_checkTrackingObject(_arg1)); | |
} | |
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{ | |
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )")); | |
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); | |
return (null); | |
} | |
public function setCampSourceKey(_arg1:String):void{ | |
_debug.info((("setCampSourceKey( " + _arg1) + " )")); | |
_call("_setCampSourceKey", _arg1); | |
} | |
public function setCampContentKey(_arg1:String):void{ | |
_debug.info((("setCampContentKey( " + _arg1) + " )")); | |
_call("_setCampContentKey", _arg1); | |
} | |
public function clearIgnoredRef():void{ | |
_debug.info("clearIgnoredRef()"); | |
_call("_clearIgnoreRef"); | |
} | |
public function setLocalServerMode():void{ | |
_debug.info("setLocalServerMode()"); | |
_call("_setLocalServerMode"); | |
} | |
public function getLocalGifPath():String{ | |
_debug.info("getLocalGifPath()"); | |
return (_call("_getLocalGifPath")); | |
} | |
public function setAllowAnchor(_arg1:Boolean):void{ | |
_debug.info((("setAllowAnchor( " + _arg1) + " )")); | |
_call("_setAllowAnchor", _arg1); | |
} | |
public function setLocalGifPath(_arg1:String):void{ | |
_debug.info((("setLocalGifPath( " + _arg1) + " )")); | |
_call("_setLocalGifPath", _arg1); | |
} | |
public function getVersion():String{ | |
_debug.info("getVersion()"); | |
return (_call("_getVersion")); | |
} | |
private function _injectTrackingObject():void{ | |
_proxy.executeBlock(_injectTrackingObject_js); | |
_hasGATracker = true; | |
} | |
public function setCookiePath(_arg1:String):void{ | |
_debug.info((("setCookiePath( " + _arg1) + " )")); | |
_call("_setCookiePath", _arg1); | |
} | |
public function setSampleRate(_arg1:Number):void{ | |
_debug.info((("setSampleRate( " + _arg1) + " )")); | |
_call("_setSampleRate", _arg1); | |
} | |
public function setAllowHash(_arg1:Boolean):void{ | |
_debug.info((("setAllowHash( " + _arg1) + " )")); | |
_call("_setAllowHash", _arg1); | |
} | |
public function addIgnoredOrganic(_arg1:String):void{ | |
_debug.info((("addIgnoredOrganic( " + _arg1) + " )")); | |
_call("_addIgnoredOrganic", _arg1); | |
} | |
public function setCampNOKey(_arg1:String):void{ | |
_debug.info((("setCampNOKey( " + _arg1) + " )")); | |
_call("_setCampNOKey", _arg1); | |
} | |
public function cookiePathCopy(_arg1:String):void{ | |
_debug.info((("cookiePathCopy( " + _arg1) + " )")); | |
_call("_cookiePathCopy", _arg1); | |
} | |
public function setLocalRemoteServerMode():void{ | |
_debug.info("setLocalRemoteServerMode()"); | |
_call("_setLocalRemoteServerMode"); | |
} | |
public function getServiceMode():ServerOperationMode{ | |
_debug.info("getServiceMode()"); | |
return (_call("_getServiceMode")); | |
} | |
public function setDetectTitle(_arg1:Boolean):void{ | |
_debug.info((("setDetectTitle( " + _arg1) + " )")); | |
_call("_setDetectTitle", _arg1); | |
} | |
public function setCampTermKey(_arg1:String):void{ | |
_debug.info((("setCampTermKey( " + _arg1) + " )")); | |
_call("_setCampTermKey", _arg1); | |
} | |
private function _createTrackingObject(_arg1:String):void{ | |
_proxy.call(_createTrackingObject_js, _arg1); | |
} | |
public function getDetectFlash():Boolean{ | |
_debug.info("getDetectFlash()"); | |
return (_call("_getDetectFlash")); | |
} | |
public function setCampaignTrack(_arg1:Boolean):void{ | |
_debug.info((("setCampaignTrack( " + _arg1) + " )")); | |
_call("_setCampaignTrack", _arg1); | |
} | |
public function clearOrganic():void{ | |
_debug.info("clearOrganic()"); | |
_call("_clearOrganic"); | |
} | |
public function addIgnoredRef(_arg1:String):void{ | |
_debug.info((("addIgnoredRef( " + _arg1) + " )")); | |
_call("_addIgnoredRef", _arg1); | |
} | |
public function setCampMediumKey(_arg1:String):void{ | |
_debug.info((("setCampMediumKey( " + _arg1) + " )")); | |
_call("_setCampMediumKey", _arg1); | |
} | |
public function setSessionTimeout(_arg1:int):void{ | |
_debug.info((("setSessionTimeout( " + _arg1) + " )")); | |
_call("_setSessionTimeout", _arg1); | |
} | |
public function setRemoteServerMode():void{ | |
_debug.info("setRemoteServerMode()"); | |
_call("_setRemoteServerMode"); | |
} | |
public function getAccount():String{ | |
_debug.info("getAccount()"); | |
return (_call("_getAccount")); | |
} | |
} | |
}//package com.google.analytics.v4 | |
package com.google.analytics.v4 { | |
import com.google.analytics.core.*; | |
public interface GoogleAnalyticsAPI { | |
function getServiceMode():ServerOperationMode; | |
function setLocalRemoteServerMode():void; | |
function setCampSourceKey(_arg1:String):void; | |
function setCampContentKey(_arg1:String):void; | |
function addOrganic(_arg1:String, _arg2:String):void; | |
function setDetectFlash(_arg1:Boolean):void; | |
function resetSession():void; | |
function setCampTermKey(_arg1:String):void; | |
function setCampNameKey(_arg1:String):void; | |
function addIgnoredOrganic(_arg1:String):void; | |
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void; | |
function setAllowLinker(_arg1:Boolean):void; | |
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object; | |
function getDetectFlash():Boolean; | |
function setCampaignTrack(_arg1:Boolean):void; | |
function createEventTracker(_arg1:String):EventTracker; | |
function setCookieTimeout(_arg1:int):void; | |
function setAllowAnchor(_arg1:Boolean):void; | |
function trackTrans():void; | |
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean; | |
function trackPageview(_arg1:String=""):void; | |
function setLocalGifPath(_arg1:String):void; | |
function getVersion():String; | |
function getLocalGifPath():String; | |
function setVar(_arg1:String):void; | |
function clearIgnoredOrganic():void; | |
function setCampMediumKey(_arg1:String):void; | |
function addIgnoredRef(_arg1:String):void; | |
function setClientInfo(_arg1:Boolean):void; | |
function setCookiePath(_arg1:String):void; | |
function setSampleRate(_arg1:Number):void; | |
function setSessionTimeout(_arg1:int):void; | |
function setRemoteServerMode():void; | |
function clearIgnoredRef():void; | |
function linkByPost(_arg1:Object, _arg2:Boolean=false):void; | |
function setLocalServerMode():void; | |
function setDetectTitle(_arg1:Boolean):void; | |
function setAllowHash(_arg1:Boolean):void; | |
function clearOrganic():void; | |
function getAccount():String; | |
function setDomainName(_arg1:String):void; | |
function link(_arg1:String, _arg2:Boolean=false):void; | |
function setCampNOKey(_arg1:String):void; | |
function getClientInfo():Boolean; | |
function cookiePathCopy(_arg1:String):void; | |
function getDetectTitle():Boolean; | |
} | |
}//package com.google.analytics.v4 | |
package com.google.analytics.v4 { | |
import com.google.analytics.core.*; | |
import com.google.analytics.debug.*; | |
import com.google.analytics.utils.*; | |
import com.google.analytics.data.*; | |
import com.google.analytics.external.*; | |
import com.google.analytics.campaign.*; | |
public class Tracker implements GoogleAnalyticsAPI { | |
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3; | |
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1; | |
private const EVENT_TRACKER_PROJECT_ID:int = 5; | |
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1; | |
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2; | |
private var _adSense:AdSenseGlobals; | |
private var _eventTracker:X10; | |
private var _noSessionInformation:Boolean = false; | |
private var _browserInfo:BrowserInfo; | |
private var _debug:DebugConfiguration; | |
private var _isNewVisitor:Boolean = false; | |
private var _buffer:Buffer; | |
private var _config:Configuration; | |
private var _x10Module:X10; | |
private var _campaign:CampaignManager; | |
private var _formatedReferrer:String; | |
private var _timeStamp:Number; | |
private var _info:Environment; | |
private var _domainHash:Number; | |
private var _campaignInfo:CampaignInfo; | |
private var _gifRequest:GIFRequest; | |
private var _hasInitData:Boolean = false; | |
private var _account:String; | |
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals){ | |
var _local8:String; | |
_hasInitData = false; | |
_isNewVisitor = false; | |
_noSessionInformation = false; | |
super(); | |
_account = _arg1; | |
_config = _arg2; | |
_debug = _arg3; | |
_info = _arg4; | |
_buffer = _arg5; | |
_gifRequest = _arg6; | |
_adSense = _arg7; | |
if (!Utils.validateAccount(_arg1)){ | |
_local8 = (("Account \"" + _arg1) + "\" is not valid."); | |
_debug.warning(_local8); | |
throw (new Error(_local8)); | |
}; | |
_initData(); | |
} | |
private function _doTracking():Boolean{ | |
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){ | |
return (true); | |
}; | |
if (_config.allowLocalTracking){ | |
return (true); | |
}; | |
return (false); | |
} | |
public function addOrganic(_arg1:String, _arg2:String):void{ | |
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )")); | |
_config.organic.addSource(_arg1, _arg2); | |
} | |
public function setAllowLinker(_arg1:Boolean):void{ | |
_config.allowLinker = _arg1; | |
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )")); | |
} | |
public function trackPageview(_arg1:String=""):void{ | |
_debug.info((("trackPageview( " + _arg1) + " )")); | |
if (_doTracking()){ | |
_initData(); | |
_trackMetrics(_arg1); | |
_noSessionInformation = false; | |
} else { | |
_debug.warning((("trackPageview( " + _arg1) + " ) failed")); | |
}; | |
} | |
public function setCookieTimeout(_arg1:int):void{ | |
_config.conversionTimeout = _arg1; | |
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )")); | |
} | |
public function trackTrans():void{ | |
_debug.warning("trackTrans() not implemented"); | |
} | |
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{ | |
var _local5:Boolean; | |
var _local6:int; | |
_local5 = true; | |
_local6 = 2; | |
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){ | |
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID); | |
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID); | |
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1); | |
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2); | |
if (((_arg3) && (!((_arg3 == ""))))){ | |
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3); | |
_local6 = 3; | |
if (!isNaN(_arg4)){ | |
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4); | |
_local6 = 4; | |
}; | |
}; | |
if (_local5){ | |
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek); | |
_sendXEvent(_eventTracker); | |
}; | |
} else { | |
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek); | |
_local5 = false; | |
}; | |
switch (_local6){ | |
case 4: | |
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )")); | |
break; | |
case 3: | |
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )")); | |
break; | |
case 2: | |
default: | |
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )")); | |
}; | |
return (_local5); | |
} | |
public function setClientInfo(_arg1:Boolean):void{ | |
_config.detectClientInfo = _arg1; | |
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )")); | |
} | |
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{ | |
_debug.warning((("linkByPost( " + [_arg1, _arg2].join(", ")) + " ) not implemented")); | |
} | |
private function _initData():void{ | |
var _local1:String; | |
var _local2:String; | |
if (!_hasInitData){ | |
_updateDomainName(); | |
_domainHash = _getDomainHash(); | |
_timeStamp = Math.round((new Date().getTime() / 1000)); | |
if (_debug.verbose){ | |
_local1 = ""; | |
_local1 = (_local1 + "_initData 0"); | |
_local1 = (_local1 + ("\ndomain name: " + _config.domainName)); | |
_local1 = (_local1 + ("\ndomain hash: " + _domainHash)); | |
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")")); | |
_debug.info(_local1, VisualDebugMode.geek); | |
}; | |
}; | |
if (_doTracking()){ | |
_handleCookie(); | |
}; | |
if (!_hasInitData){ | |
if (_doTracking()){ | |
_formatedReferrer = _formatReferrer(); | |
_browserInfo = new BrowserInfo(_config, _info); | |
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced); | |
if (_config.campaignTracking){ | |
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp); | |
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation); | |
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced); | |
}; | |
}; | |
_x10Module = new X10(); | |
_eventTracker = new X10(); | |
_hasInitData = true; | |
}; | |
if (_config.hasSiteOverlay){ | |
_debug.warning("Site Overlay is not supported"); | |
}; | |
if (_debug.verbose){ | |
_local2 = ""; | |
_local2 = (_local2 + "_initData (misc)"); | |
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4))); | |
_local2 = (_local2 + ("\nprotocol: " + _info.protocol)); | |
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\"")); | |
_local2 = (_local2 + ("\nlanguage: " + _info.language)); | |
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash())); | |
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent)); | |
_debug.info(_local2, VisualDebugMode.geek); | |
}; | |
} | |
public function getDetectTitle():Boolean{ | |
_debug.info("getDetectTitle()"); | |
return (_config.detectTitle); | |
} | |
public function resetSession():void{ | |
_debug.info("resetSession()"); | |
_buffer.resetCurrentSession(); | |
} | |
private function _sendXEvent(_arg1:X10=null):void{ | |
var _local2:Variables; | |
var _local3:EventInfo; | |
var _local4:Variables; | |
var _local5:Variables; | |
_initData(); | |
if (_takeSample()){ | |
_local2 = new Variables(); | |
_local2.URIencode = true; | |
_local3 = new EventInfo(true, _x10Module, _arg1); | |
_local4 = _local3.toVariables(); | |
_local5 = _renderMetricsSearchVariables(); | |
_local2.join(_local4, _local5); | |
_gifRequest.send(_account, _local2, false, true); | |
}; | |
} | |
public function setDetectFlash(_arg1:Boolean):void{ | |
_config.detectFlash = _arg1; | |
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )")); | |
} | |
public function setCampNameKey(_arg1:String):void{ | |
var _local2:String; | |
_config.campaignKey.UCCN = _arg1; | |
_local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )"); | |
if (_debug.mode == VisualDebugMode.geek){ | |
_debug.info((_local2 + " [UCCN]")); | |
} else { | |
_debug.info(_local2); | |
}; | |
} | |
private function _formatReferrer():String{ | |
var _local1:String; | |
var _local2:String; | |
var _local3:URL; | |
var _local4:URL; | |
_local1 = _info.referrer; | |
if ((((_local1 == "")) || ((_local1 == "localhost")))){ | |
_local1 = "-"; | |
} else { | |
_local2 = _info.domainName; | |
_local3 = new URL(_local1); | |
_local4 = new URL(("http://" + _local2)); | |
if (_local3.hostName == _local2){ | |
return ("-"); | |
}; | |
if (_local4.domain == _local3.domain){ | |
if (_local4.subDomain != _local3.subDomain){ | |
_local1 = "0"; | |
}; | |
}; | |
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){ | |
_local1 = "-"; | |
}; | |
}; | |
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced); | |
return (_local1); | |
} | |
private function _visitCode():Number{ | |
if (_debug.verbose){ | |
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek); | |
}; | |
return (_buffer.utma.sessionId); | |
} | |
public function createEventTracker(_arg1:String):EventTracker{ | |
_debug.info((("createEventTracker( " + _arg1) + " )")); | |
return (new EventTracker(_arg1, this)); | |
} | |
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{ | |
_debug.warning((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " ) not implemented")); | |
} | |
public function clearIgnoredOrganic():void{ | |
_debug.info("clearIgnoredOrganic()"); | |
_config.organic.clearIgnoredKeywords(); | |
} | |
public function setVar(_arg1:String):void{ | |
var _local2:Variables; | |
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){ | |
_initData(); | |
_buffer.utmv.domainHash = _domainHash; | |
_buffer.utmv.value = _arg1; | |
if (_debug.verbose){ | |
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek); | |
}; | |
_debug.info((("setVar( " + _arg1) + " )")); | |
if (_takeSample()){ | |
_local2 = new Variables(); | |
_local2.utmt = "var"; | |
_gifRequest.send(_account, _local2); | |
}; | |
} else { | |
_debug.warning((("setVar \"" + _arg1) + "\" is ignored")); | |
}; | |
} | |
public function setDomainName(_arg1:String):void{ | |
if (_arg1 == "auto"){ | |
_config.domain.mode = DomainNameMode.auto; | |
} else { | |
if (_arg1 == "none"){ | |
_config.domain.mode = DomainNameMode.none; | |
} else { | |
_config.domain.mode = DomainNameMode.custom; | |
_config.domain.name = _arg1; | |
}; | |
}; | |
_updateDomainName(); | |
_debug.info((("setDomainName( " + _config.domainName) + " )")); | |
} | |
public function getClientInfo():Boolean{ | |
_debug.info("getClientInfo()"); | |
return (_config.detectClientInfo); | |
} | |
private function _updateDomainName():void{ | |
var _local1:String; | |
if (_config.domain.mode == DomainNameMode.auto){ | |
_local1 = _info.domainName; | |
if (_local1.substring(0, 4) == "www."){ | |
_local1 = _local1.substring(4); | |
}; | |
_config.domain.name = _local1; | |
}; | |
_config.domainName = _config.domain.name.toLowerCase(); | |
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced); | |
} | |
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{ | |
_debug.warning((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " ) not implemented")); | |
return (null); | |
} | |
public function setCampContentKey(_arg1:String):void{ | |
var _local2:String; | |
_config.campaignKey.UCCT = _arg1; | |
_local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )"); | |
if (_debug.mode == VisualDebugMode.geek){ | |
_debug.info((_local2 + " [UCCT]")); | |
} else { | |
_debug.info(_local2); | |
}; | |
} | |
private function _handleCookie():void{ | |
var _local1:String; | |
var _local2:String; | |
var _local3:Array; | |
var _local4:String; | |
if (_config.allowLinker){ | |
}; | |
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){ | |
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){ | |
_buffer.updateUTMA(_timeStamp); | |
_noSessionInformation = true; | |
}; | |
if (_debug.verbose){ | |
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek); | |
}; | |
} else { | |
_debug.info("create a new utma", VisualDebugMode.advanced); | |
_buffer.utma.domainHash = _domainHash; | |
_buffer.utma.sessionId = _getUniqueSessionId(); | |
_buffer.utma.firstTime = _timeStamp; | |
_buffer.utma.lastTime = _timeStamp; | |
_buffer.utma.currentTime = _timeStamp; | |
_buffer.utma.sessionCount = 1; | |
if (_debug.verbose){ | |
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek); | |
}; | |
_noSessionInformation = true; | |
_isNewVisitor = true; | |
}; | |
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){ | |
if (_adSense.sid){ | |
_buffer.utma.currentTime = Number(_adSense.sid); | |
if (_debug.verbose){ | |
_local1 = ""; | |
_local1 = (_local1 + "AdSense sid found\n"); | |
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")")); | |
_debug.info(_local1, VisualDebugMode.geek); | |
}; | |
}; | |
if (_isNewVisitor){ | |
if (_adSense.sid){ | |
_buffer.utma.lastTime = Number(_adSense.sid); | |
if (_debug.verbose){ | |
_local2 = ""; | |
_local2 = (_local2 + "AdSense sid found (new visitor)\n"); | |
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")")); | |
_debug.info(_local2, VisualDebugMode.geek); | |
}; | |
}; | |
if (_adSense.vid){ | |
_local3 = _adSense.vid.split("."); | |
_buffer.utma.sessionId = Number(_local3[0]); | |
_buffer.utma.firstTime = Number(_local3[1]); | |
if (_debug.verbose){ | |
_local4 = ""; | |
_local4 = (_local4 + "AdSense vid found (new visitor)\n"); | |
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n")); | |
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")")); | |
_debug.info(_local4, VisualDebugMode.geek); | |
}; | |
}; | |
if (_debug.verbose){ | |
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek); | |
}; | |
}; | |
}; | |
_buffer.utmb.domainHash = _domainHash; | |
if (isNaN(_buffer.utmb.trackCount)){ | |
_buffer.utmb.trackCount = 0; | |
}; | |
if (isNaN(_buffer.utmb.token)){ | |
_buffer.utmb.token = _config.tokenCliff; | |
}; | |
if (isNaN(_buffer.utmb.lastTime)){ | |
_buffer.utmb.lastTime = _buffer.utma.currentTime; | |
}; | |
_buffer.utmc.domainHash = _domainHash; | |
if (_debug.verbose){ | |
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced); | |
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced); | |
}; | |
} | |
public function setLocalServerMode():void{ | |
_config.serverMode = ServerOperationMode.local; | |
_debug.info("setLocalServerMode()"); | |
} | |
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{ | |
var _local2:Variables; | |
var _local3:DocumentInfo; | |
var _local4:Variables; | |
var _local5:Variables; | |
_local2 = new Variables(); | |
_local2.URIencode = true; | |
_local3 = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense); | |
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek); | |
if (_config.campaignTracking){ | |
_local4 = _campaignInfo.toVariables(); | |
}; | |
_local5 = _browserInfo.toVariables(); | |
_local2.join(_local3.toVariables(), _local5, _local4); | |
return (_local2); | |
} | |
public function clearIgnoredRef():void{ | |
_debug.info("clearIgnoredRef()"); | |
_config.organic.clearIgnoredReferrals(); | |
} | |
public function setCampSourceKey(_arg1:String):void{ | |
var _local2:String; | |
_config.campaignKey.UCSR = _arg1; | |
_local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )"); | |
if (_debug.mode == VisualDebugMode.geek){ | |
_debug.info((_local2 + " [UCSR]")); | |
} else { | |
_debug.info(_local2); | |
}; | |
} | |
public function getLocalGifPath():String{ | |
_debug.info("getLocalGifPath()"); | |
return (_config.localGIFpath); | |
} | |
public function setLocalGifPath(_arg1:String):void{ | |
_config.localGIFpath = _arg1; | |
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )")); | |
} | |
public function getVersion():String{ | |
_debug.info("getVersion()"); | |
return (_config.version); | |
} | |
public function setAllowAnchor(_arg1:Boolean):void{ | |
_config.allowAnchor = _arg1; | |
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )")); | |
} | |
private function _isNotGoogleSearch():Boolean{ | |
var _local1:String; | |
var _local2:Boolean; | |
var _local3:Boolean; | |
var _local4:Boolean; | |
var _local5:Boolean; | |
_local1 = _config.domainName; | |
_local2 = (_local1.indexOf("www.google.") < 0); | |
_local3 = (_local1.indexOf(".google.") < 0); | |
_local4 = (_local1.indexOf("google.") < 0); | |
_local5 = (_local1.indexOf("google.org") > -1); | |
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5))); | |
} | |
public function setSampleRate(_arg1:Number):void{ | |
if (_arg1 < 0){ | |
_debug.warning("sample rate can not be negative, ignoring value."); | |
} else { | |
_config.sampleRate = _arg1; | |
}; | |
_debug.info((("setSampleRate( " + _config.sampleRate) + " )")); | |
} | |
private function _takeSample():Boolean{ | |
if (_debug.verbose){ | |
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek); | |
}; | |
return (((_visitCode() % 10000) < (_config.sampleRate * 10000))); | |
} | |
public function setCookiePath(_arg1:String):void{ | |
_config.cookiePath = _arg1; | |
_debug.info((("setCookiePath( " + _config.cookiePath) + " )")); | |
} | |
public function setAllowHash(_arg1:Boolean):void{ | |
_config.allowDomainHash = _arg1; | |
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )")); | |
} | |
private function _generateUserDataHash():Number{ | |
var _local1:String; | |
_local1 = ""; | |
_local1 = (_local1 + _info.appName); | |
_local1 = (_local1 + _info.appVersion); | |
_local1 = (_local1 + _info.language); | |
_local1 = (_local1 + _info.platform); | |
_local1 = (_local1 + _info.userAgent.toString()); | |
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth)); | |
_local1 = (_local1 + _info.referrer); | |
return (Utils.generateHash(_local1)); | |
} | |
public function addIgnoredOrganic(_arg1:String):void{ | |
_debug.info((("addIgnoredOrganic( " + _arg1) + " )")); | |
_config.organic.addIgnoredKeyword(_arg1); | |
} | |
public function setLocalRemoteServerMode():void{ | |
_config.serverMode = ServerOperationMode.both; | |
_debug.info("setLocalRemoteServerMode()"); | |
} | |
public function cookiePathCopy(_arg1:String):void{ | |
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented")); | |
} | |
public function setDetectTitle(_arg1:Boolean):void{ | |
_config.detectTitle = _arg1; | |
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )")); | |
} | |
public function setCampTermKey(_arg1:String):void{ | |
var _local2:String; | |
_config.campaignKey.UCTR = _arg1; | |
_local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )"); | |
if (_debug.mode == VisualDebugMode.geek){ | |
_debug.info((_local2 + " [UCTR]")); | |
} else { | |
_debug.info(_local2); | |
}; | |
} | |
public function getServiceMode():ServerOperationMode{ | |
_debug.info("getServiceMode()"); | |
return (_config.serverMode); | |
} | |
public function setCampNOKey(_arg1:String):void{ | |
var _local2:String; | |
_config.campaignKey.UCNO = _arg1; | |
_local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )"); | |
if (_debug.mode == VisualDebugMode.geek){ | |
_debug.info((_local2 + " [UCNO]")); | |
} else { | |
_debug.info(_local2); | |
}; | |
} | |
private function _trackMetrics(_arg1:String=""):void{ | |
var _local2:Variables; | |
var _local3:Variables; | |
var _local4:Variables; | |
var _local5:EventInfo; | |
if (_takeSample()){ | |
_local2 = new Variables(); | |
_local2.URIencode = true; | |
if (((_x10Module) && (_x10Module.hasData()))){ | |
_local5 = new EventInfo(false, _x10Module); | |
_local3 = _local5.toVariables(); | |
}; | |
_local4 = _renderMetricsSearchVariables(_arg1); | |
_local2.join(_local3, _local4); | |
_gifRequest.send(_account, _local2); | |
}; | |
} | |
public function setCampaignTrack(_arg1:Boolean):void{ | |
_config.campaignTracking = _arg1; | |
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )")); | |
} | |
public function addIgnoredRef(_arg1:String):void{ | |
_debug.info((("addIgnoredRef( " + _arg1) + " )")); | |
_config.organic.addIgnoredReferral(_arg1); | |
} | |
public function clearOrganic():void{ | |
_debug.info("clearOrganic()"); | |
_config.organic.clearEngines(); | |
} | |
public function getDetectFlash():Boolean{ | |
_debug.info("getDetectFlash()"); | |
return (_config.detectFlash); | |
} | |
public function setCampMediumKey(_arg1:String):void{ | |
var _local2:String; | |
_config.campaignKey.UCMD = _arg1; | |
_local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )"); | |
if (_debug.mode == VisualDebugMode.geek){ | |
_debug.info((_local2 + " [UCMD]")); | |
} else { | |
_debug.info(_local2); | |
}; | |
} | |
private function _getUniqueSessionId():Number{ | |
var _local1:Number; | |
_local1 = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647); | |
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek); | |
return (_local1); | |
} | |
private function _getDomainHash():Number{ | |
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){ | |
_config.domainName = ""; | |
return (1); | |
}; | |
_updateDomainName(); | |
if (_config.allowDomainHash){ | |
return (Utils.generateHash(_config.domainName)); | |
}; | |
return (1); | |
} | |
public function setSessionTimeout(_arg1:int):void{ | |
_config.sessionTimeout = _arg1; | |
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )")); | |
} | |
public function getAccount():String{ | |
_debug.info("getAccount()"); | |
return (_account); | |
} | |
public function link(_arg1:String, _arg2:Boolean=false):void{ | |
_debug.warning((("link( " + [_arg1, _arg2].join(", ")) + " ) not implemented")); | |
} | |
public function setRemoteServerMode():void{ | |
_config.serverMode = ServerOperationMode.remote; | |
_debug.info("setRemoteServerMode()"); | |
} | |
} | |
}//package com.google.analytics.v4 | |
package com.google.analytics.debug { | |
import flash.display.*; | |
import com.google.analytics.core.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.google.analytics.*; | |
public class Layout implements ILayout { | |
private var _display:DisplayObject; | |
private var _infoQueue:Array; | |
private var _maxCharPerLine:int = 85; | |
private var _hasInfo:Boolean; | |
private var _warningQueue:Array; | |
private var _hasDebug:Boolean; | |
private var _hasWarning:Boolean; | |
private var _mainPanel:Panel; | |
private var _GRAlertQueue:Array; | |
private var _debug:DebugConfiguration; | |
public var visualDebug:Debug; | |
private var _hasGRAlert:Boolean; | |
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){ | |
_maxCharPerLine = 85; | |
super(); | |
_display = _arg2; | |
_debug = _arg1; | |
_hasWarning = false; | |
_hasInfo = false; | |
_hasDebug = false; | |
_hasGRAlert = false; | |
_warningQueue = []; | |
_infoQueue = []; | |
_GRAlertQueue = []; | |
} | |
private function onKey(_arg1:KeyboardEvent=null):void{ | |
switch (_arg1.keyCode){ | |
case _debug.showHideKey: | |
_mainPanel.visible = !(_mainPanel.visible); | |
break; | |
case _debug.destroyKey: | |
destroy(); | |
break; | |
}; | |
} | |
public function bringToFront(_arg1:DisplayObject):void{ | |
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1)); | |
} | |
public function createFailureAlert(_arg1:String):void{ | |
var _local2:AlertAction; | |
var _local3:Alert; | |
if (_debug.verbose){ | |
_arg1 = _filterMaxChars(_arg1); | |
_local2 = new AlertAction("Close", "close", "close"); | |
} else { | |
_local2 = new AlertAction("X", "close", "close"); | |
}; | |
_local3 = new FailureAlert(_debug, _arg1, [_local2]); | |
addToPanel("analytics", _local3); | |
if (_hasDebug){ | |
if (_debug.verbose){ | |
_arg1 = _arg1.split("\n").join(""); | |
_arg1 = _filterMaxChars(_arg1, 66); | |
}; | |
visualDebug.writeBold(_arg1); | |
}; | |
} | |
public function init():void{ | |
var _local1:int; | |
var _local2:uint; | |
var _local3:uint; | |
var _local4:Panel; | |
_local1 = 10; | |
_local2 = (_display.stage.stageWidth - (_local1 * 2)); | |
_local3 = (_display.stage.stageHeight - (_local1 * 2)); | |
_local4 = new Panel("analytics", _local2, _local3); | |
_local4.alignement = Align.top; | |
_local4.stickToEdge = false; | |
_local4.title = ("Google Analytics v" + GATracker.version); | |
_mainPanel = _local4; | |
addToStage(_local4); | |
bringToFront(_local4); | |
if (_debug.minimizedOnStart){ | |
_mainPanel.onToggle(); | |
}; | |
createVisualDebug(); | |
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true); | |
} | |
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{ | |
var _local3:DisplayObject; | |
var _local4:Panel; | |
_local3 = _display.stage.getChildByName(_arg1); | |
if (_local3){ | |
_local4 = (_local3 as Panel); | |
_local4.addData(_arg2); | |
} else { | |
trace((("panel \"" + _arg1) + "\" not found")); | |
}; | |
} | |
private function _clearInfo(_arg1:Event):void{ | |
_hasInfo = false; | |
if (_infoQueue.length > 0){ | |
createInfo(_infoQueue.shift()); | |
}; | |
} | |
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{ | |
var _local3:String; | |
var _local4:Array; | |
var _local5:Array; | |
var _local6:String; | |
var _local7:int; | |
_local3 = "\n"; | |
_local4 = []; | |
_local5 = _arg1.split(_local3); | |
if (_arg2 == 0){ | |
_arg2 = _maxCharPerLine; | |
}; | |
_local7 = 0; | |
while (_local7 < _local5.length) { | |
_local6 = _local5[_local7]; | |
while (_local6.length > _arg2) { | |
_local4.push(_local6.substr(0, _arg2)); | |
_local6 = _local6.substring(_arg2); | |
}; | |
_local4.push(_local6); | |
_local7++; | |
}; | |
return (_local4.join(_local3)); | |
} | |
public function createWarning(_arg1:String):void{ | |
var _local2:Warning; | |
if (((_hasWarning) || (!(isAvailable())))){ | |
_warningQueue.push(_arg1); | |
return; | |
}; | |
_arg1 = _filterMaxChars(_arg1); | |
_hasWarning = true; | |
_local2 = new Warning(_arg1, _debug.warningTimeout); | |
addToPanel("analytics", _local2); | |
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true); | |
if (_hasDebug){ | |
visualDebug.writeBold(_arg1); | |
}; | |
} | |
private function _clearGRAlert(_arg1:Event):void{ | |
_hasGRAlert = false; | |
if (_GRAlertQueue.length > 0){ | |
createGIFRequestAlert.apply(this, _GRAlertQueue.shift()); | |
}; | |
} | |
public function createSuccessAlert(_arg1:String):void{ | |
var _local2:AlertAction; | |
var _local3:Alert; | |
if (_debug.verbose){ | |
_arg1 = _filterMaxChars(_arg1); | |
_local2 = new AlertAction("Close", "close", "close"); | |
} else { | |
_local2 = new AlertAction("X", "close", "close"); | |
}; | |
_local3 = new SuccessAlert(_debug, _arg1, [_local2]); | |
addToPanel("analytics", _local3); | |
if (_hasDebug){ | |
if (_debug.verbose){ | |
_arg1 = _arg1.split("\n").join(""); | |
_arg1 = _filterMaxChars(_arg1, 66); | |
}; | |
visualDebug.writeBold(_arg1); | |
}; | |
} | |
public function isAvailable():Boolean{ | |
return (!((_display.stage == null))); | |
} | |
public function createAlert(_arg1:String):void{ | |
var _local2:Alert; | |
_arg1 = _filterMaxChars(_arg1); | |
_local2 = new Alert(_arg1, [new AlertAction("Close", "close", "close")]); | |
addToPanel("analytics", _local2); | |
if (_hasDebug){ | |
visualDebug.writeBold(_arg1); | |
}; | |
} | |
public function createInfo(_arg1:String):void{ | |
var _local2:Info; | |
if (((_hasInfo) || (!(isAvailable())))){ | |
_infoQueue.push(_arg1); | |
return; | |
}; | |
_arg1 = _filterMaxChars(_arg1); | |
_hasInfo = true; | |
_local2 = new Info(_arg1, _debug.infoTimeout); | |
addToPanel("analytics", _local2); | |
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true); | |
if (_hasDebug){ | |
visualDebug.write(_arg1); | |
}; | |
} | |
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{ | |
var f:* = null; | |
var gra:* = null; | |
var message:* = _arg1; | |
var request:* = _arg2; | |
var ref:* = _arg3; | |
if (_hasGRAlert){ | |
_GRAlertQueue.push([message, request, ref]); | |
return; | |
}; | |
_hasGRAlert = true; | |
f = function ():void{ | |
ref.sendRequest(request); | |
}; | |
message = _filterMaxChars(message); | |
gra = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]); | |
addToPanel("analytics", gra); | |
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true); | |
if (_hasDebug){ | |
if (_debug.verbose){ | |
message = message.split("\n").join(""); | |
message = _filterMaxChars(message, 66); | |
}; | |
visualDebug.write(message); | |
}; | |
} | |
public function createVisualDebug():void{ | |
if (!visualDebug){ | |
visualDebug = new Debug(); | |
visualDebug.alignement = Align.bottom; | |
visualDebug.stickToEdge = true; | |
addToPanel("analytics", visualDebug); | |
_hasDebug = true; | |
}; | |
} | |
public function addToStage(_arg1:DisplayObject):void{ | |
_display.stage.addChild(_arg1); | |
} | |
private function _clearWarning(_arg1:Event):void{ | |
_hasWarning = false; | |
if (_warningQueue.length > 0){ | |
createWarning(_warningQueue.shift()); | |
}; | |
} | |
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{ | |
var _local4:Panel; | |
_local4 = new Panel(_arg1, _arg2, _arg3); | |
_local4.alignement = Align.center; | |
_local4.stickToEdge = false; | |
addToStage(_local4); | |
bringToFront(_local4); | |
} | |
public function destroy():void{ | |
_mainPanel.close(); | |
_debug.layout = null; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public class FailureAlert extends Alert { | |
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){ | |
var _local4:Align; | |
var _local5:Boolean; | |
var _local6:Boolean; | |
_local4 = Align.bottomLeft; | |
_local5 = true; | |
_local6 = false; | |
if (_arg1.verbose){ | |
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2); | |
_local4 = Align.center; | |
_local5 = false; | |
_local6 = true; | |
}; | |
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.ui.*; | |
import flash.events.*; | |
public class Debug extends Label { | |
public static var count:uint = 0; | |
private var _lines:Array; | |
private var _preferredForcedWidth:uint = 540; | |
public var maxLines:uint = 16; | |
private var _linediff:int = 0; | |
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){ | |
_linediff = 0; | |
_preferredForcedWidth = 540; | |
maxLines = 16; | |
if (_arg2 == null){ | |
_arg2 = Align.bottom; | |
}; | |
super("", "uiLabel", _arg1, _arg2, _arg3); | |
this.name = ("Debug" + count++); | |
_lines = []; | |
selectable = true; | |
addEventListener(KeyboardEvent.KEY_DOWN, onKey); | |
} | |
public function close():void{ | |
dispose(); | |
} | |
public function writeBold(_arg1:String):void{ | |
write(_arg1, true); | |
} | |
override protected function dispose():void{ | |
removeEventListener(KeyboardEvent.KEY_DOWN, onKey); | |
super.dispose(); | |
} | |
override public function get forcedWidth():uint{ | |
if (this.parent){ | |
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){ | |
return (_preferredForcedWidth); | |
}; | |
return (UISprite(this.parent).forcedWidth); | |
}; | |
return (super.forcedWidth); | |
} | |
private function onKey(_arg1:KeyboardEvent=null):void{ | |
var _local2:Array; | |
switch (_arg1.keyCode){ | |
case Keyboard.DOWN: | |
_local2 = _getLinesToDisplay(1); | |
break; | |
case Keyboard.UP: | |
_local2 = _getLinesToDisplay(-1); | |
break; | |
default: | |
_local2 = null; | |
}; | |
if (_local2 == null){ | |
return; | |
}; | |
text = _local2.join("\n"); | |
} | |
public function write(_arg1:String, _arg2:Boolean=false):void{ | |
var _local3:Array; | |
var _local4:String; | |
var _local5:String; | |
var _local6:int; | |
var _local7:Array; | |
if (_arg1.indexOf("") > -1){ | |
_local3 = _arg1.split("\n"); | |
} else { | |
_local3 = [_arg1]; | |
}; | |
_local4 = ""; | |
_local5 = ""; | |
if (_arg2){ | |
_local4 = "<b>"; | |
_local5 = "</b>"; | |
}; | |
_local6 = 0; | |
while (_local6 < _local3.length) { | |
_lines.push(((_local4 + _local3[_local6]) + _local5)); | |
_local6++; | |
}; | |
_local7 = _getLinesToDisplay(); | |
text = _local7.join("\n"); | |
} | |
private function _getLinesToDisplay(_arg1:int=0):Array{ | |
var _local2:Array; | |
var _local3:uint; | |
var _local4:uint; | |
if ((_lines.length - 1) > maxLines){ | |
if ((_linediff <= 0)){ | |
_linediff = (_linediff + _arg1); | |
} else { | |
if ((((_linediff > 0)) && ((_arg1 < 0)))){ | |
_linediff = (_linediff + _arg1); | |
}; | |
}; | |
_local3 = ((_lines.length - maxLines) + _linediff); | |
_local4 = (_local3 + maxLines); | |
_local2 = _lines.slice(_local3, _local4); | |
} else { | |
_local2 = _lines; | |
}; | |
return (_local2); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.net.*; | |
import flash.text.*; | |
public class _Style { | |
public var borderColor:uint; | |
public var backgroundColor:uint; | |
private var _sheet:StyleSheet; | |
public var roundedCorner:uint; | |
public var alertColor:uint; | |
public var infoColor:uint; | |
public var successColor:uint; | |
private var _loader:URLLoader; | |
public var failureColor:uint; | |
private var _defaultSheet:String; | |
public var warningColor:uint; | |
public function _Style(){ | |
_sheet = new StyleSheet(); | |
_loader = new URLLoader(); | |
_init(); | |
} | |
private function _parseSheet(_arg1:String):void{ | |
_sheet.parseCSS(_arg1); | |
} | |
public function get sheet():StyleSheet{ | |
return (_sheet); | |
} | |
private function _init():void{ | |
_defaultSheet = ""; | |
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n"); | |
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n"); | |
_defaultSheet = (_defaultSheet + "\n"); | |
roundedCorner = 6; | |
backgroundColor = 0xCCCCCC; | |
borderColor = 0x555555; | |
infoColor = 16777113; | |
alertColor = 0xFFCC00; | |
warningColor = 0xCC0000; | |
successColor = 0xFF00; | |
failureColor = 0xFF0000; | |
_parseSheet(_defaultSheet); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.display.*; | |
import flash.events.*; | |
public class Panel extends UISprite { | |
protected var baseAlpha:Number; | |
private var _border:Shape; | |
private var _name:String; | |
private var _title:Label; | |
private var _data:UISprite; | |
private var _backgroundColor:uint; | |
private var _colapsed:Boolean; | |
private var _stickToEdge:Boolean; | |
private var _background:Shape; | |
private var _savedW:uint; | |
private var _mask:Sprite; | |
private var _savedH:uint; | |
private var _borderColor:uint; | |
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){ | |
_name = _arg1; | |
this.name = _arg1; | |
this.mouseEnabled = false; | |
_colapsed = false; | |
forcedWidth = _arg2; | |
forcedHeight = _arg3; | |
this.baseAlpha = _arg6; | |
_background = new Shape(); | |
_data = new UISprite(); | |
_data.forcedWidth = _arg2; | |
_data.forcedHeight = _arg3; | |
_data.mouseEnabled = false; | |
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8); | |
_title.buttonMode = true; | |
_title.margin.top = 0.6; | |
_title.margin.left = 0.6; | |
_title.addEventListener(MouseEvent.CLICK, onToggle); | |
_title.mouseChildren = false; | |
_border = new Shape(); | |
_mask = new Sprite(); | |
_mask.useHandCursor = false; | |
_mask.mouseEnabled = false; | |
_mask.mouseChildren = false; | |
if (_arg7 == null){ | |
_arg7 = Align.none; | |
}; | |
this.alignement = _arg7; | |
this.stickToEdge = _arg8; | |
if (_arg4 == 0){ | |
_arg4 = Style.backgroundColor; | |
}; | |
_backgroundColor = _arg4; | |
if (_arg5 == 0){ | |
_arg5 = Style.borderColor; | |
}; | |
_borderColor = _arg5; | |
} | |
public function set stickToEdge(_arg1:Boolean):void{ | |
_stickToEdge = _arg1; | |
_title.stickToEdge = _arg1; | |
} | |
public function onToggle(_arg1:MouseEvent=null):void{ | |
if (_colapsed){ | |
_data.visible = true; | |
} else { | |
_data.visible = false; | |
}; | |
_colapsed = !(_colapsed); | |
_update(); | |
resize(); | |
} | |
override protected function dispose():void{ | |
_title.removeEventListener(MouseEvent.CLICK, onToggle); | |
super.dispose(); | |
} | |
private function _draw():void{ | |
var _local1:uint; | |
var _local2:uint; | |
var _local3:Graphics; | |
var _local4:Graphics; | |
var _local5:Graphics; | |
var _local6:Graphics; | |
if (((_savedW) && (_savedH))){ | |
forcedWidth = _savedW; | |
forcedHeight = _savedH; | |
}; | |
if (!_colapsed){ | |
_local1 = forcedWidth; | |
_local2 = forcedHeight; | |
} else { | |
_local1 = _title.width; | |
_local2 = _title.height; | |
_savedW = forcedWidth; | |
_savedH = forcedHeight; | |
forcedWidth = _local1; | |
forcedHeight = _local2; | |
}; | |
_local3 = _background.graphics; | |
_local3.clear(); | |
_local3.beginFill(_backgroundColor); | |
Background.drawRounded(this, _local3, _local1, _local2); | |
_local3.endFill(); | |
_local4 = _data.graphics; | |
_local4.clear(); | |
_local4.beginFill(_backgroundColor, 0); | |
Background.drawRounded(this, _local4, _local1, _local2); | |
_local4.endFill(); | |
_local5 = _border.graphics; | |
_local5.clear(); | |
_local5.lineStyle(0.1, _borderColor); | |
Background.drawRounded(this, _local5, _local1, _local2); | |
_local5.endFill(); | |
_local6 = _mask.graphics; | |
_local6.clear(); | |
_local6.beginFill(_backgroundColor); | |
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1)); | |
_local6.endFill(); | |
} | |
override protected function layout():void{ | |
_update(); | |
addChild(_background); | |
addChild(_data); | |
addChild(_title); | |
addChild(_border); | |
addChild(_mask); | |
mask = _mask; | |
} | |
public function get title():String{ | |
return (_title.text); | |
} | |
public function get stickToEdge():Boolean{ | |
return (_stickToEdge); | |
} | |
public function set title(_arg1:String):void{ | |
_title.text = _arg1; | |
} | |
private function _update():void{ | |
_draw(); | |
if (baseAlpha < 1){ | |
_background.alpha = baseAlpha; | |
_border.alpha = baseAlpha; | |
}; | |
} | |
public function addData(_arg1:DisplayObject):void{ | |
_data.addChild(_arg1); | |
} | |
public function close():void{ | |
dispose(); | |
if (parent != null){ | |
parent.removeChild(this); | |
}; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.utils.*; | |
import flash.events.*; | |
public class Info extends Label { | |
private var _timer:Timer; | |
public function Info(_arg1:String="", _arg2:uint=3000){ | |
super(_arg1, "uiInfo", Style.infoColor, Align.top, true); | |
if (_arg2 > 0){ | |
_timer = new Timer(_arg2, 1); | |
_timer.start(); | |
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true); | |
}; | |
} | |
public function onComplete(_arg1:TimerEvent):void{ | |
close(); | |
} | |
override public function onLink(_arg1:TextEvent):void{ | |
switch (_arg1.text){ | |
case "hide": | |
close(); | |
break; | |
}; | |
} | |
public function close():void{ | |
if (parent != null){ | |
parent.removeChild(this); | |
}; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.ui.*; | |
import flash.utils.*; | |
import com.google.analytics.core.*; | |
import flash.net.*; | |
public class DebugConfiguration { | |
public var showHideKey:Number; | |
private var _mode:VisualDebugMode; | |
private var _verbose:Boolean = false; | |
public var destroyKey:Number; | |
public var GIFRequests:Boolean = false; | |
public var infoTimeout:Number = 1000; | |
public var showInfos:Boolean = true; | |
public var minimizedOnStart:Boolean = false; | |
private var _active:Boolean = false; | |
public var traceOutput:Boolean = false; | |
public var layout:ILayout; | |
public var warningTimeout:Number = 1500; | |
public var javascript:Boolean = false; | |
public var showWarnings:Boolean = true; | |
private var _visualInitialized:Boolean = false; | |
public function DebugConfiguration(){ | |
_active = false; | |
_verbose = false; | |
_visualInitialized = false; | |
_mode = VisualDebugMode.basic; | |
traceOutput = false; | |
javascript = false; | |
GIFRequests = false; | |
showInfos = true; | |
infoTimeout = 1000; | |
showWarnings = true; | |
warningTimeout = 1500; | |
minimizedOnStart = false; | |
showHideKey = Keyboard.SPACE; | |
destroyKey = Keyboard.BACKSPACE; | |
super(); | |
} | |
public function get verbose():Boolean{ | |
return (_verbose); | |
} | |
public function set verbose(_arg1:Boolean):void{ | |
_verbose = _arg1; | |
} | |
public function set mode(_arg1):void{ | |
if ((_arg1 is String)){ | |
switch (_arg1){ | |
case "geek": | |
_arg1 = VisualDebugMode.geek; | |
break; | |
case "advanced": | |
_arg1 = VisualDebugMode.advanced; | |
break; | |
case "basic": | |
default: | |
_arg1 = VisualDebugMode.basic; | |
}; | |
}; | |
_mode = _arg1; | |
} | |
public function success(_arg1:String):void{ | |
if (layout){ | |
layout.createSuccessAlert(_arg1); | |
}; | |
if (traceOutput){ | |
trace((("[+] " + _arg1) + " !!")); | |
}; | |
} | |
public function get active():Boolean{ | |
return (_active); | |
} | |
private function _initializeVisual():void{ | |
if (layout){ | |
layout.init(); | |
_visualInitialized = true; | |
}; | |
} | |
private function _destroyVisual():void{ | |
if (((layout) && (_visualInitialized))){ | |
layout.destroy(); | |
}; | |
} | |
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{ | |
if (_filter(_arg2)){ | |
return; | |
}; | |
if (((layout) && (showWarnings))){ | |
layout.createWarning(_arg1); | |
}; | |
if (traceOutput){ | |
trace((("## " + _arg1) + " ##")); | |
}; | |
} | |
private function _filter(_arg1:VisualDebugMode=null):Boolean{ | |
return (((_arg1) && ((int(_arg1) >= int(this.mode))))); | |
} | |
public function failure(_arg1:String):void{ | |
if (layout){ | |
layout.createFailureAlert(_arg1); | |
}; | |
if (traceOutput){ | |
trace((("[-] " + _arg1) + " !!")); | |
}; | |
} | |
public function get mode(){ | |
return (_mode); | |
} | |
public function set active(_arg1:Boolean):void{ | |
_active = _arg1; | |
if (_active){ | |
_initializeVisual(); | |
} else { | |
_destroyVisual(); | |
}; | |
} | |
protected function trace(_arg1:String):void{ | |
var _local2:Array; | |
var _local3:String; | |
var _local4:String; | |
var _local5:int; | |
var _local6:int; | |
var _local7:Array; | |
var _local8:int; | |
_local2 = []; | |
_local3 = ""; | |
_local4 = ""; | |
if (this.mode == VisualDebugMode.geek){ | |
_local3 = (getTimer() + " - "); | |
_local4 = (new Array(_local3.length).join(" ") + " "); | |
}; | |
if (_arg1.indexOf("\n") > -1){ | |
_local7 = _arg1.split("\n"); | |
_local8 = 0; | |
while (_local8 < _local7.length) { | |
if (_local7[_local8] == ""){ | |
} else { | |
if (_local8 == 0){ | |
_local2.push((_local3 + _local7[_local8])); | |
} else { | |
_local2.push((_local4 + _local7[_local8])); | |
}; | |
}; | |
_local8++; | |
}; | |
} else { | |
_local2.push((_local3 + _arg1)); | |
}; | |
_local5 = _local2.length; | |
_local6 = 0; | |
while (_local6 < _local5) { | |
trace(_local2[_local6]); | |
_local6++; | |
}; | |
} | |
public function alert(_arg1:String):void{ | |
if (layout){ | |
layout.createAlert(_arg1); | |
}; | |
if (traceOutput){ | |
trace((("!! " + _arg1) + " !!")); | |
}; | |
} | |
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{ | |
if (_filter(_arg2)){ | |
return; | |
}; | |
if (((layout) && (showInfos))){ | |
layout.createInfo(_arg1); | |
}; | |
if (traceOutput){ | |
trace(_arg1); | |
}; | |
} | |
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{ | |
if (layout){ | |
layout.createGIFRequestAlert(_arg1, _arg2, _arg3); | |
}; | |
if (traceOutput){ | |
trace(((">> " + _arg1) + " <<")); | |
}; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
public class Label extends UISprite { | |
public static var count:uint = 0; | |
private var _text:String; | |
private var _textField:TextField; | |
private var _color:uint; | |
protected var selectable:Boolean; | |
public var stickToEdge:Boolean; | |
private var _background:Shape; | |
private var _tag:String; | |
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){ | |
this.name = ("Label" + count++); | |
selectable = false; | |
_background = new Shape(); | |
_textField = new TextField(); | |
_text = _arg1; | |
_tag = _arg2; | |
if (_arg4 == null){ | |
_arg4 = Align.none; | |
}; | |
this.alignement = _arg4; | |
this.stickToEdge = _arg5; | |
if (_arg3 == 0){ | |
_arg3 = Style.backgroundColor; | |
}; | |
_color = _arg3; | |
_textField.addEventListener(TextEvent.LINK, onLink); | |
} | |
override protected function dispose():void{ | |
_textField.removeEventListener(TextEvent.LINK, onLink); | |
super.dispose(); | |
} | |
private function _draw():void{ | |
var _local1:Graphics; | |
var _local2:uint; | |
var _local3:uint; | |
_local1 = _background.graphics; | |
_local1.clear(); | |
_local1.beginFill(_color); | |
_local2 = _textField.width; | |
_local3 = _textField.height; | |
if (forcedWidth > 0){ | |
_local2 = forcedWidth; | |
}; | |
Background.drawRounded(this, _local1, _local2, _local3); | |
_local1.endFill(); | |
} | |
override protected function layout():void{ | |
_textField.type = TextFieldType.DYNAMIC; | |
_textField.autoSize = TextFieldAutoSize.LEFT; | |
_textField.background = false; | |
_textField.selectable = selectable; | |
_textField.multiline = true; | |
_textField.styleSheet = Style.sheet; | |
this.text = _text; | |
addChild(_background); | |
addChild(_textField); | |
} | |
public function get text():String{ | |
return (_textField.text); | |
} | |
public function set tag(_arg1:String):void{ | |
_tag = _arg1; | |
text = ""; | |
} | |
public function set text(_arg1:String):void{ | |
if (_arg1 == ""){ | |
_arg1 = _text; | |
}; | |
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>"); | |
_text = _arg1; | |
_draw(); | |
resize(); | |
} | |
public function appendText(_arg1:String, _arg2:String=""):void{ | |
if (_arg1 == ""){ | |
return; | |
}; | |
if (_arg2 == ""){ | |
_arg2 = tag; | |
}; | |
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>")); | |
_text = (_text + _arg1); | |
_draw(); | |
resize(); | |
} | |
public function onLink(_arg1:TextEvent):void{ | |
} | |
public function get tag():String{ | |
return (_tag); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public class Margin { | |
public var bottom:int; | |
public var top:int; | |
public var right:int; | |
public var left:int; | |
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){ | |
this.top = _arg1; | |
this.bottom = _arg2; | |
this.left = _arg3; | |
this.right = _arg4; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public const Style:_Style = new _Style(); | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public class SuccessAlert extends Alert { | |
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){ | |
var _local4:Align; | |
var _local5:Boolean; | |
var _local6:Boolean; | |
_local4 = Align.bottomLeft; | |
_local5 = true; | |
_local6 = false; | |
if (_arg1.verbose){ | |
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2); | |
_local4 = Align.center; | |
_local5 = false; | |
_local6 = true; | |
}; | |
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public class Align { | |
public static const bottomRight:Align = new Align(18, "bottomRight"); | |
; | |
public static const right:Align = new Align(16, "right"); | |
; | |
public static const left:Align = new Align(32, "left"); | |
; | |
public static const topRight:Align = new Align(17, "topRight"); | |
; | |
public static const bottom:Align = new Align(2, "bottom"); | |
; | |
public static const bottomLeft:Align = new Align(34, "bottomLeft"); | |
; | |
public static const topLeft:Align = new Align(33, "topLeft"); | |
; | |
public static const center:Align = new Align(0x0100, "center"); | |
; | |
public static const none:Align = new Align(0, "none"); | |
; | |
public static const top:Align = new Align(1, "top"); | |
; | |
private var _value:int; | |
private var _name:String; | |
public function Align(_arg1:int=0, _arg2:String=""){ | |
_value = _arg1; | |
_name = _arg2; | |
} | |
public function valueOf():int{ | |
return (_value); | |
} | |
public function toString():String{ | |
return (_name); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.utils.*; | |
import flash.events.*; | |
public class Warning extends Label { | |
private var _timer:Timer; | |
public function Warning(_arg1:String="", _arg2:uint=3000){ | |
super(_arg1, "uiWarning", Style.warningColor, Align.top, false); | |
margin.top = 32; | |
if (_arg2 > 0){ | |
_timer = new Timer(_arg2, 1); | |
_timer.start(); | |
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true); | |
}; | |
} | |
public function onComplete(_arg1:TimerEvent):void{ | |
close(); | |
} | |
override public function onLink(_arg1:TextEvent):void{ | |
switch (_arg1.text){ | |
case "hide": | |
close(); | |
break; | |
}; | |
} | |
public function close():void{ | |
if (parent != null){ | |
parent.removeChild(this); | |
}; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.display.*; | |
import flash.events.*; | |
public class UISprite extends Sprite { | |
private var _forcedHeight:uint; | |
protected var listenResize:Boolean; | |
public var alignement:Align; | |
private var _forcedWidth:uint; | |
public var margin:Margin; | |
protected var alignTarget:DisplayObject; | |
public function UISprite(_arg1:DisplayObject=null){ | |
listenResize = false; | |
alignement = Align.none; | |
this.alignTarget = _arg1; | |
margin = new Margin(); | |
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); | |
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage); | |
} | |
protected function dispose():void{ | |
var _local1:DisplayObject; | |
var _local2:int; | |
_local2 = 0; | |
while (_local2 < numChildren) { | |
_local1 = getChildAt(_local2); | |
if (_local1){ | |
removeChild(_local1); | |
}; | |
_local2++; | |
}; | |
} | |
protected function layout():void{ | |
} | |
public function get forcedHeight():uint{ | |
if (_forcedHeight){ | |
return (_forcedHeight); | |
}; | |
return (height); | |
} | |
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{ | |
var _local3:uint; | |
var _local4:uint; | |
var _local5:uint; | |
var _local6:uint; | |
var _local7:UISprite; | |
if (_arg2 == null){ | |
if ((parent is Stage)){ | |
_arg2 = this.stage; | |
} else { | |
_arg2 = parent; | |
}; | |
}; | |
if (_arg2 == this.stage){ | |
if (this.stage == null){ | |
return; | |
}; | |
_local3 = this.stage.stageHeight; | |
_local4 = this.stage.stageWidth; | |
_local5 = 0; | |
_local6 = 0; | |
} else { | |
_local7 = (_arg2 as UISprite); | |
if (_local7.forcedHeight){ | |
_local3 = _local7.forcedHeight; | |
} else { | |
_local3 = _local7.height; | |
}; | |
if (_local7.forcedWidth){ | |
_local4 = _local7.forcedWidth; | |
} else { | |
_local4 = _local7.width; | |
}; | |
_local5 = 0; | |
_local6 = 0; | |
}; | |
switch (_arg1){ | |
case Align.top: | |
x = ((_local4 / 2) - (forcedWidth / 2)); | |
y = (_local6 + margin.top); | |
break; | |
case Align.bottom: | |
x = ((_local4 / 2) - (forcedWidth / 2)); | |
y = (((_local6 + _local3) - forcedHeight) - margin.bottom); | |
break; | |
case Align.left: | |
x = (_local5 + margin.left); | |
y = ((_local3 / 2) - (forcedHeight / 2)); | |
break; | |
case Align.right: | |
x = (((_local5 + _local4) - forcedWidth) - margin.right); | |
y = ((_local3 / 2) - (forcedHeight / 2)); | |
break; | |
case Align.center: | |
x = ((_local4 / 2) - (forcedWidth / 2)); | |
y = ((_local3 / 2) - (forcedHeight / 2)); | |
break; | |
case Align.topLeft: | |
x = (_local5 + margin.left); | |
y = (_local6 + margin.top); | |
break; | |
case Align.topRight: | |
x = (((_local5 + _local4) - forcedWidth) - margin.right); | |
y = (_local6 + margin.top); | |
break; | |
case Align.bottomLeft: | |
x = (_local5 + margin.left); | |
y = (((_local6 + _local3) - forcedHeight) - margin.bottom); | |
break; | |
case Align.bottomRight: | |
x = (((_local5 + _local4) - forcedWidth) - margin.right); | |
y = (((_local6 + _local3) - forcedHeight) - margin.bottom); | |
break; | |
}; | |
if (((!(listenResize)) && (!((_arg1 == Align.none))))){ | |
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true); | |
listenResize = true; | |
}; | |
this.alignement = _arg1; | |
this.alignTarget = _arg2; | |
} | |
public function get forcedWidth():uint{ | |
if (_forcedWidth){ | |
return (_forcedWidth); | |
}; | |
return (width); | |
} | |
protected function onResize(_arg1:Event):void{ | |
resize(); | |
} | |
private function _onRemovedFromStage(_arg1:Event):void{ | |
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage); | |
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage); | |
dispose(); | |
} | |
public function resize():void{ | |
if (alignement != Align.none){ | |
alignTo(alignement, alignTarget); | |
}; | |
} | |
private function _onAddedToStage(_arg1:Event):void{ | |
layout(); | |
resize(); | |
} | |
public function set forcedHeight(_arg1:uint):void{ | |
_forcedHeight = _arg1; | |
} | |
public function set forcedWidth(_arg1:uint):void{ | |
_forcedWidth = _arg1; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.display.*; | |
public class Background { | |
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{ | |
var _local5:uint; | |
var _local6:uint; | |
var _local7:uint; | |
_local7 = Style.roundedCorner; | |
if ((((_arg3 > 0)) && ((_arg4 > 0)))){ | |
_local5 = _arg3; | |
_local6 = _arg4; | |
} else { | |
_local5 = _arg1.width; | |
_local6 = _arg1.height; | |
}; | |
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){ | |
switch (_arg1.alignement){ | |
case Align.top: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7); | |
break; | |
case Align.topLeft: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7); | |
break; | |
case Align.topRight: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0); | |
break; | |
case Align.bottom: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0); | |
break; | |
case Align.bottomLeft: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0); | |
break; | |
case Align.bottomRight: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0); | |
break; | |
case Align.left: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7); | |
break; | |
case Align.right: | |
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0); | |
break; | |
case Align.center: | |
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7); | |
break; | |
}; | |
} else { | |
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7); | |
}; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public class AlertAction { | |
public var container:Alert; | |
private var _callback; | |
public var name:String; | |
public var activator:String; | |
public function AlertAction(_arg1:String, _arg2:String, _arg3){ | |
this.name = _arg1; | |
this.activator = _arg2; | |
_callback = _arg3; | |
} | |
public function execute():void{ | |
if (_callback){ | |
if ((_callback is Function)){ | |
(_callback as Function)(); | |
} else { | |
if ((_callback is String)){ | |
var _local1 = container; | |
_local1[_callback](); | |
}; | |
}; | |
}; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.events.*; | |
public class Alert extends Label { | |
public var actionOnNextLine:Boolean = true; | |
public var autoClose:Boolean = true; | |
private var _actions:Array; | |
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){ | |
var _local8:int; | |
autoClose = true; | |
actionOnNextLine = true; | |
if (_arg4 == 0){ | |
_arg4 = Style.alertColor; | |
}; | |
if (_arg5 == null){ | |
_arg5 = Align.center; | |
}; | |
super(_arg1, _arg3, _arg4, _arg5, _arg6); | |
this.selectable = true; | |
super.mouseChildren = true; | |
this.buttonMode = true; | |
this.mouseEnabled = true; | |
this.useHandCursor = true; | |
this.actionOnNextLine = _arg7; | |
_actions = []; | |
_local8 = 0; | |
while (_local8 < _arg2.length) { | |
_arg2[_local8].container = this; | |
_actions.push(_arg2[_local8]); | |
_local8++; | |
}; | |
} | |
protected function getAction(_arg1:String):AlertAction{ | |
var _local2:int; | |
_local2 = 0; | |
while (_local2 < _actions.length) { | |
if (_arg1 == _actions[_local2].activator){ | |
return (_actions[_local2]); | |
}; | |
_local2++; | |
}; | |
return (null); | |
} | |
override protected function layout():void{ | |
super.layout(); | |
_defineActions(); | |
} | |
protected function spaces(_arg1:int):String{ | |
var _local2:String; | |
var _local3:String; | |
var _local4:int; | |
_local2 = ""; | |
_local3 = " "; | |
_local4 = 0; | |
while (_local4 < (_arg1 + 1)) { | |
_local2 = (_local2 + _local3); | |
_local4++; | |
}; | |
return (_local2); | |
} | |
override public function onLink(_arg1:TextEvent):void{ | |
var _local2:AlertAction; | |
if (isValidAction(_arg1.text)){ | |
_local2 = getAction(_arg1.text); | |
if (_local2){ | |
_local2.execute(); | |
}; | |
}; | |
if (autoClose){ | |
close(); | |
}; | |
} | |
protected function isValidAction(_arg1:String):Boolean{ | |
var _local2:int; | |
_local2 = 0; | |
while (_local2 < _actions.length) { | |
if (_arg1 == _actions[_local2].activator){ | |
return (true); | |
}; | |
_local2++; | |
}; | |
return (false); | |
} | |
private function _defineActions():void{ | |
var _local1:String; | |
var _local2:Array; | |
var _local3:AlertAction; | |
var _local4:int; | |
_local1 = ""; | |
if (actionOnNextLine){ | |
_local1 = (_local1 + "\n"); | |
} else { | |
_local1 = (_local1 + " |"); | |
}; | |
_local1 = (_local1 + " "); | |
_local2 = []; | |
_local4 = 0; | |
while (_local4 < _actions.length) { | |
_local3 = _actions[_local4]; | |
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>")); | |
_local4++; | |
}; | |
_local1 = (_local1 + _local2.join(" | ")); | |
appendText(_local1, "uiAlertAction"); | |
} | |
public function close():void{ | |
if (parent != null){ | |
parent.removeChild(this); | |
}; | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public class VisualDebugMode { | |
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced"); | |
; | |
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek"); | |
; | |
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic"); | |
; | |
private var _value:int; | |
private var _name:String; | |
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){ | |
_value = _arg1; | |
_name = _arg2; | |
} | |
public function valueOf():int{ | |
return (_value); | |
} | |
public function toString():String{ | |
return (_name); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
import flash.display.*; | |
import com.google.analytics.core.*; | |
import flash.net.*; | |
public interface ILayout { | |
function createWarning(_arg1:String):void; | |
function addToStage(_arg1:DisplayObject):void; | |
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void; | |
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void; | |
function createInfo(_arg1:String):void; | |
function createFailureAlert(_arg1:String):void; | |
function addToPanel(_arg1:String, _arg2:DisplayObject):void; | |
function init():void; | |
function createSuccessAlert(_arg1:String):void; | |
function createVisualDebug():void; | |
function createAlert(_arg1:String):void; | |
function destroy():void; | |
function bringToFront(_arg1:DisplayObject):void; | |
function isAvailable():Boolean; | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics.debug { | |
public class GIFRequestAlert extends Alert { | |
public function GIFRequestAlert(_arg1:String, _arg2:Array){ | |
super(_arg1, _arg2); | |
} | |
} | |
}//package com.google.analytics.debug | |
package com.google.analytics { | |
import com.google.analytics.utils.*; | |
public class API { | |
public static var version:Version = new Version(); | |
version.major = 1; | |
version.minor = 0; | |
version.build = 1; | |
version.revision = "$Rev: 234 $ ".split(" ")[1]; | |
} | |
}//package com.google.analytics | |
package com.google.analytics.utils { | |
public class Version { | |
private var _maxBuild:uint = 0xFF; | |
private var _maxMinor:uint = 15; | |
private var _maxMajor:uint = 15; | |
private var _revision:uint; | |
private var _separator:String = "."; | |
private var _maxRevision:uint = 0xFFFF; | |
private var _build:uint; | |
private var _minor:uint; | |
private var _major:uint; | |
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){ | |
var _local5:Version; | |
_maxMajor = 15; | |
_maxMinor = 15; | |
_maxBuild = 0xFF; | |
_maxRevision = 0xFFFF; | |
_separator = "."; | |
super(); | |
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){ | |
_local5 = Version.fromNumber(_arg1); | |
_arg1 = _local5.major; | |
_arg2 = _local5.minor; | |
_arg3 = _local5.build; | |
_arg4 = _local5.revision; | |
}; | |
this.major = _arg1; | |
this.minor = _arg2; | |
this.build = _arg3; | |
this.revision = _arg4; | |
} | |
public static function fromString(_arg1:String="", _arg2:String="."):Version{ | |
var _local3:Version; | |
var _local4:Array; | |
_local3 = new (Version); | |
if ((((_arg1 == "")) || ((_arg1 == null)))){ | |
return (_local3); | |
}; | |
if (_arg1.indexOf(_arg2) > -1){ | |
_local4 = _arg1.split(_arg2); | |
_local3.major = parseInt(_local4[0]); | |
_local3.minor = parseInt(_local4[1]); | |
_local3.build = parseInt(_local4[2]); | |
_local3.revision = parseInt(_local4[3]); | |
} else { | |
_local3.major = parseInt(_arg1); | |
}; | |
return (_local3); | |
} | |
public static function fromNumber(_arg1:Number=0):Version{ | |
var _local2:Version; | |
_local2 = new (Version); | |
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){ | |
return (_local2); | |
}; | |
_local2.major = (_arg1 >>> 28); | |
_local2.minor = ((_arg1 & 251658240) >>> 24); | |
_local2.build = ((_arg1 & 0xFF0000) >>> 16); | |
_local2.revision = (_arg1 & 0xFFFF); | |
return (_local2); | |
} | |
public function toString(_arg1:int=0):String{ | |
var _local2:Array; | |
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){ | |
_arg1 = getFields(); | |
}; | |
switch (_arg1){ | |
case 1: | |
_local2 = [major]; | |
break; | |
case 2: | |
_local2 = [major, minor]; | |
break; | |
case 3: | |
_local2 = [major, minor, build]; | |
break; | |
case 4: | |
default: | |
_local2 = [major, minor, build, revision]; | |
}; | |
return (_local2.join(_separator)); | |
} | |
public function get revision():uint{ | |
return (_revision); | |
} | |
public function set build(_arg1:uint):void{ | |
_build = Math.min(_arg1, _maxBuild); | |
} | |
public function set minor(_arg1:uint):void{ | |
_minor = Math.min(_arg1, _maxMinor); | |
} | |
public function get build():uint{ | |
return (_build); | |
} | |
public function set major(_arg1:uint):void{ | |
_major = Math.min(_arg1, _maxMajor); | |
} | |
public function get minor():uint{ | |
return (_minor); | |
} | |
public function valueOf():uint{ | |
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision)); | |
} | |
public function get major():uint{ | |
return (_major); | |
} | |
public function set revision(_arg1:uint):void{ | |
_revision = Math.min(_arg1, _maxRevision); | |
} | |
private function getFields():int{ | |
var _local1:int; | |
_local1 = 4; | |
if (revision == 0){ | |
_local1--; | |
}; | |
if ((((_local1 == 3)) && ((build == 0)))){ | |
_local1--; | |
}; | |
if ((((_local1 == 2)) && ((minor == 0)))){ | |
_local1--; | |
}; | |
return (_local1); | |
} | |
public function equals(_arg1):Boolean{ | |
if (!(_arg1 is Version)){ | |
return (false); | |
}; | |
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){ | |
return (true); | |
}; | |
return (false); | |
} | |
} | |
}//package com.google.analytics.utils | |
package com.google.analytics.utils { | |
import com.google.analytics.core.*; | |
import com.google.analytics.debug.*; | |
import com.google.analytics.external.*; | |
import flash.system.*; | |
public class Environment { | |
private var _dom:HTMLDOM; | |
private var _appName:String; | |
private var _debug:DebugConfiguration; | |
private var _appVersion:Version; | |
private var _url:String; | |
private var _protocol:Protocols; | |
private var _userAgent:UserAgent; | |
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){ | |
var _local6:Version; | |
super(); | |
if (_arg2 == ""){ | |
if (isAIR()){ | |
_arg2 = "AIR"; | |
} else { | |
_arg2 = "Flash"; | |
}; | |
}; | |
if (_arg3 == ""){ | |
_local6 = flashVersion; | |
} else { | |
_local6 = Version.fromString(_arg3); | |
}; | |
_url = _arg1; | |
_appName = _arg2; | |
_appVersion = _local6; | |
_debug = _arg4; | |
_dom = _arg5; | |
} | |
public function isAIR():Boolean{ | |
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application")))); | |
} | |
public function get playerType():String{ | |
return (Capabilities.playerType); | |
} | |
public function get locationSearch():String{ | |
var _local1:String; | |
_local1 = _dom.search; | |
if (_local1){ | |
return (_local1); | |
}; | |
return (""); | |
} | |
public function get protocol():Protocols{ | |
if (!_protocol){ | |
_findProtocol(); | |
}; | |
return (_protocol); | |
} | |
public function get flashVersion():Version{ | |
var _local1:Version; | |
_local1 = Version.fromString(Capabilities.version.split(" ")[1], ","); | |
return (_local1); | |
} | |
public function get screenWidth():Number{ | |
return (Capabilities.screenResolutionX); | |
} | |
public function get languageEncoding():String{ | |
var _local1:String; | |
if (System.useCodePage){ | |
_local1 = _dom.characterSet; | |
if (_local1){ | |
return (_local1); | |
}; | |
return ("-"); | |
}; | |
return ("UTF-8"); | |
} | |
public function get appName():String{ | |
return (_appName); | |
} | |
public function get screenColorDepth():String{ | |
var _local1:String; | |
var _local2:String; | |
switch (Capabilities.screenColor){ | |
case "bw": | |
_local1 = "1"; | |
break; | |
case "gray": | |
_local1 = "2"; | |
break; | |
case "color": | |
default: | |
_local1 = "24"; | |
}; | |
_local2 = _dom.colorDepth; | |
if (_local2){ | |
_local1 = _local2; | |
}; | |
return (_local1); | |
} | |
private function _findProtocol():void{ | |
var _local1:Protocols; | |
var _local2:String; | |
var _local3:String; | |
var _local4:String; | |
var _local5:String; | |
_local1 = Protocols.none; | |
if (_url != ""){ | |
_local4 = _url.toLowerCase(); | |
_local5 = _local4.substr(0, 5); | |
switch (_local5){ | |
case "file:": | |
_local1 = Protocols.file; | |
break; | |
case "http:": | |
_local1 = Protocols.HTTP; | |
break; | |
case "https": | |
if (_local4.charAt(5) == ":"){ | |
_local1 = Protocols.HTTPS; | |
}; | |
break; | |
default: | |
_protocol = Protocols.none; | |
}; | |
}; | |
_local2 = _dom.protocol; | |
_local3 = (_local1.toString() + ":").toLowerCase(); | |
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){ | |
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2)); | |
}; | |
_protocol = _local1; | |
} | |
public function get locationSWFPath():String{ | |
return (_url); | |
} | |
public function get platform():String{ | |
var _local1:String; | |
_local1 = Capabilities.manufacturer; | |
return (_local1.split("Adobe ")[1]); | |
} | |
public function get operatingSystem():String{ | |
return (Capabilities.os); | |
} | |
public function set appName(_arg1:String):void{ | |
_appName = _arg1; | |
userAgent.applicationProduct = _arg1; | |
} | |
public function get userAgent():UserAgent{ | |
if (!_userAgent){ | |
_userAgent = new UserAgent(this, appName, appVersion.toString(4)); | |
}; | |
return (_userAgent); | |
} | |
ga_internal function set url(_arg1:String):void{ | |
_url = _arg1; | |
} | |
public function get referrer():String{ | |
var _local1:String; | |
_local1 = _dom.referrer; | |
if (_local1){ | |
return (_local1); | |
}; | |
if (protocol == Protocols.file){ | |
return ("localhost"); | |
}; | |
return (""); | |
} | |
public function isInHTML():Boolean{ | |
return ((Capabilities.playerType == "PlugIn")); | |
} | |
public function get language():String{ | |
var _local1:String; | |
var _local2:String; | |
_local1 = _dom.language; | |
_local2 = Capabilities.language; | |
if (_local1){ | |
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){ | |
_local2 = _local1; | |
}; | |
}; | |
return (_local2); | |
} | |
public function get domainName():String{ | |
var _local1:String; | |
var _local2:String; | |
var _local3:int; | |
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){ | |
_local1 = _url.toLowerCase(); | |
if (protocol == Protocols.HTTP){ | |
_local2 = _local1.split("http://").join(""); | |
} else { | |
if (protocol == Protocols.HTTPS){ | |
_local2 = _local1.split("https://").join(""); | |
}; | |
}; | |
_local3 = _local2.indexOf("/"); | |
if (_local3 > -1){ | |
_local2 = _local2.substring(0, _local3); | |
}; | |
return (_local2); | |
}; | |
if (protocol == Protocols.file){ | |
return ("localhost"); | |
}; | |
return (""); | |
} | |
public function set userAgent(_arg1:UserAgent):void{ | |
_userAgent = _arg1; | |
} | |
public function set appVersion(_arg1:Version):void{ | |
_appVersion = _arg1; | |
userAgent.applicationVersion = _arg1.toString(4); | |
} | |
public function get screenHeight():Number{ | |
return (Capabilities.screenResolutionY); | |
} | |
public function get locationPath():String{ | |
var _local1:String; | |
_local1 = _dom.pathname; | |
if (_local1){ | |
return (_local1); | |
}; | |
return (""); | |
} | |
public function get documentTitle():String{ | |
var _local1:String; | |
_local1 = _dom.title; | |
if (_local1){ | |
return (_local1); | |
}; | |
return (""); | |
} | |
public function get appVersion():Version{ | |
return (_appVersion); | |
} | |
} | |
}//package com.google.analytics.utils | |
package com.google.analytics.utils { | |
import flash.net.*; | |
public dynamic class Variables { | |
public var post:Array; | |
public var URIencode:Boolean; | |
public var pre:Array; | |
public var sort:Boolean = true; | |
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){ | |
pre = []; | |
post = []; | |
sort = true; | |
super(); | |
if (_arg1){ | |
decode(_arg1); | |
}; | |
if (_arg2){ | |
this.pre = _arg2; | |
}; | |
if (_arg3){ | |
this.post = _arg3; | |
}; | |
} | |
private function _join(_arg1:Variables):void{ | |
var _local2:String; | |
if (!_arg1){ | |
return; | |
}; | |
for (_local2 in _arg1) { | |
this[_local2] = _arg1[_local2]; | |
}; | |
} | |
public function join(... _args):void{ | |
var _local2:int; | |
var _local3:int; | |
_local2 = _args.length; | |
_local3 = 0; | |
while (_local3 < _local2) { | |
if (!(_args[_local3] is Variables)){ | |
} else { | |
_join(_args[_local3]); | |
}; | |
_local3++; | |
}; | |
} | |
public function toString():String{ | |
var _local1:Array; | |
var _local2:String; | |
var _local3:String; | |
var _local4:String; | |
var _local5:int; | |
var _local6:int; | |
var _local7:String; | |
var _local8:String; | |
_local1 = []; | |
for (_local3 in this) { | |
_local2 = this[_local3]; | |
if (URIencode){ | |
_local2 = encodeURI(_local2); | |
}; | |
_local1.push(((_local3 + "=") + _local2)); | |
}; | |
if (sort){ | |
_local1.sort(); | |
}; | |
if (pre.length > 0){ | |
pre.reverse(); | |
_local5 = 0; | |
while (_local5 < pre.length) { | |
_local7 = pre[_local5]; | |
_local6 = 0; | |
while (_local6 < _local1.length) { | |
_local4 = _local1[_local6]; | |
if (_local4.indexOf(_local7) == 0){ | |
_local1.unshift(_local1.splice(_local6, 1)[0]); | |
}; | |
_local6++; | |
}; | |
_local5++; | |
}; | |
pre.reverse(); | |
}; | |
if (post.length > 0){ | |
_local5 = 0; | |
while (_local5 < post.length) { | |
_local8 = post[_local5]; | |
_local6 = 0; | |
while (_local6 < _local1.length) { | |
_local4 = _local1[_local6]; | |
if (_local4.indexOf(_local8) == 0){ | |
_local1.push(_local1.splice(_local6, 1)[0]); | |
}; | |
_local6++; | |
}; | |
_local5++; | |
}; | |
}; | |
return (_local1.join("&")); | |
} | |
public function decode(_arg1:String):void{ | |
var _local2:Array; | |
var _local3:String; | |
var _local4:String; | |
var _local5:String; | |
var _local6:Array; | |
var _local7:int; | |
if (_arg1 == ""){ | |
return; | |
}; | |
if (_arg1.indexOf("&") > -1){ | |
_local2 = _arg1.split("&"); | |
} else { | |
_local2 = [_arg1]; | |
}; | |
_local7 = 0; | |
while (_local7 < _local2.length) { | |
_local3 = _local2[_local7]; | |
if (_local3.indexOf("=") > -1){ | |
_local6 = _local3.split("="); | |
_local4 = _local6[0]; | |
_local5 = decodeURI(_local6[1]); | |
this[_local4] = _local5; | |
}; | |
_local7++; | |
}; | |
} | |
public function toURLVariables():URLVariables{ | |
var _local1:URLVariables; | |
var _local2:String; | |
_local1 = new URLVariables(); | |
for (_local2 in this) { | |
_local1[_local2] = this[_local2]; | |
}; | |
return (_local1); | |
} | |
} | |
}//package com.google.analytics.utils | |
package com.google.analytics.utils { | |
import com.google.analytics.core.*; | |
import flash.system.*; | |
public class UserAgent { | |
public static var minimal:Boolean = false; | |
private var _version:Version; | |
private var _localInfo:Environment; | |
private var _applicationProduct:String; | |
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){ | |
_localInfo = _arg1; | |
applicationProduct = _arg2; | |
_version = Version.fromString(_arg3); | |
} | |
public function get tamarinProductToken():String{ | |
if (UserAgent.minimal){ | |
return (""); | |
}; | |
if (System.vmVersion){ | |
return (("Tamarin/" + Utils.trim(System.vmVersion, true))); | |
}; | |
return (""); | |
} | |
public function set applicationProduct(_arg1:String):void{ | |
_applicationProduct = _arg1; | |
} | |
public function get applicationVersion():String{ | |
return (_version.toString(2)); | |
} | |
public function get applicationProductToken():String{ | |
var _local1:String; | |
_local1 = applicationProduct; | |
if (applicationVersion != ""){ | |
_local1 = (_local1 + ("/" + applicationVersion)); | |
}; | |
return (_local1); | |
} | |
public function get vendorProductToken():String{ | |
var _local1:String; | |
_local1 = ""; | |
if (_localInfo.isAIR()){ | |
_local1 = (_local1 + "AIR"); | |
} else { | |
_local1 = (_local1 + "FlashPlayer"); | |
}; | |
_local1 = (_local1 + "/"); | |
_local1 = (_local1 + _version.toString(3)); | |
return (_local1); | |
} | |
public function toString():String{ | |
var _local1:String; | |
_local1 = ""; | |
_local1 = (_local1 + applicationProductToken); | |
if (applicationComment != ""){ | |
_local1 = (_local1 + (" " + applicationComment)); | |
}; | |
if (tamarinProductToken != ""){ | |
_local1 = (_local1 + (" " + tamarinProductToken)); | |
}; | |
if (vendorProductToken != ""){ | |
_local1 = (_local1 + (" " + vendorProductToken)); | |
}; | |
return (_local1); | |
} | |
public function get applicationComment():String{ | |
var _local1:Array; | |
_local1 = []; | |
_local1.push(_localInfo.platform); | |
_local1.push(_localInfo.playerType); | |
if (!UserAgent.minimal){ | |
_local1.push(_localInfo.operatingSystem); | |
_local1.push(_localInfo.language); | |
}; | |
if (Capabilities.isDebugger){ | |
_local1.push("DEBUG"); | |
}; | |
if (_local1.length > 0){ | |
return ((("(" + _local1.join("; ")) + ")")); | |
}; | |
return (""); | |
} | |
public function set applicationVersion(_arg1:String):void{ | |
_version = Version.fromString(_arg1); | |
} | |
public function get applicationProduct():String{ | |
return (_applicationProduct); | |
} | |
} | |
}//package com.google.analytics.utils | |
package com.google.analytics.utils { | |
public class Protocols { | |
public static const none:Protocols = new Protocols(0, "none"); | |
; | |
public static const HTTPS:Protocols = new Protocols(3, "HTTPS"); | |
; | |
public static const file:Protocols = new Protocols(1, "file"); | |
; | |
public static const HTTP:Protocols = new Protocols(2, "HTTP"); | |
; | |
private var _value:int; | |
private var _name:String; | |
public function Protocols(_arg1:int=0, _arg2:String=""){ | |
_value = _arg1; | |
_name = _arg2; | |
} | |
public function valueOf():int{ | |
return (_value); | |
} | |
public function toString():String{ | |
return (_name); | |
} | |
} | |
}//package com.google.analytics.utils | |
package com.google.analytics.utils { | |
public class URL { | |
private var _url:String; | |
public function URL(_arg1:String=""){ | |
_url = _arg1.toLowerCase(); | |
} | |
public function get domain():String{ | |
var _local1:Array; | |
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){ | |
_local1 = hostName.split("."); | |
switch (_local1.length){ | |
case 2: | |
return (hostName); | |
case 3: | |
if (_local1[1] == "co"){ | |
return (hostName); | |
}; | |
_local1.shift(); | |
return (_local1.join(".")); | |
case 4: | |
_local1.shift(); | |
return (_local1.join(".")); | |
}; | |
}; | |
return (""); | |
} | |
public function get path():String{ | |
var _local1:String; | |
_local1 = _url; | |
if (_local1.indexOf("://") > -1){ | |
_local1 = _local1.split("://")[1]; | |
}; | |
if (_local1.indexOf(hostName) == 0){ | |
_local1 = _local1.substr(hostName.length); | |
}; | |
if (_local1.indexOf("?") > -1){ | |
_local1 = _local1.split("?")[0]; | |
}; | |
if (_local1.charAt(0) != "/"){ | |
_local1 = ("/" + _local1); | |
}; | |
return (_local1); | |
} | |
public function get search():String{ | |
var _local1:String; | |
_local1 = _url; | |
if (_local1.indexOf("://") > -1){ | |
_local1 = _local1.split("://")[1]; | |
}; | |
if (_local1.indexOf(hostName) == 0){ | |
_local1 = _local1.substr(hostName.length); | |
}; | |
if (_local1.indexOf("?") > -1){ | |
_local1 = _local1.split("?")[1]; | |
} else { | |
_local1 = ""; | |
}; | |
return (_local1); | |
} | |
public function get subDomain():String{ | |
if (((!((domain == ""))) && (!((domain == hostName))))){ | |
return (hostName.split(("." + domain)).join("")); | |
}; | |
return (""); | |
} | |
public function get protocol():Protocols{ | |
var _local1:String; | |
_local1 = _url.split("://")[0]; | |
switch (_local1){ | |
case "file": | |
return (Protocols.file); | |
case "http": | |
return (Protocols.HTTP); | |
case "https": | |
return (Protocols.HTTPS); | |
default: | |
return (Protocols.none); | |
}; | |
} | |
public function get hostName():String{ | |
var _local1:String; | |
_local1 = _url; | |
if (_local1.indexOf("://") > -1){ | |
_local1 = _local1.split("://")[1]; | |
}; | |
if (_local1.indexOf("/") > -1){ | |
_local1 = _local1.split("/")[0]; | |
}; | |
if (_local1.indexOf("?") > -1){ | |
_local1 = _local1.split("?")[0]; | |
}; | |
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){ | |
return (""); | |
}; | |
return (_local1); | |
} | |
} | |
}//package com.google.analytics.utils | |
package com.google.analytics.utils { | |
public class Timespan { | |
public static var sixmonths:Number = 15768000; | |
public static var twoyears:Number = 63072000; | |
public static var thirtyminutes:Number = 1800; | |
} | |
}//package com.google.analytics.utils | |
package com.google.analytics { | |
import flash.display.*; | |
import com.google.analytics.core.*; | |
import com.google.analytics.v4.*; | |
import com.google.analytics.debug.*; | |
import com.google.analytics.utils.*; | |
import flash.events.*; | |
import com.google.analytics.external.*; | |
import com.google.analytics.events.*; | |
public class GATracker implements AnalyticsTracker { | |
public static var version:Version = API.version; | |
public static var autobuild:Boolean = true; | |
private var _adSense:AdSenseGlobals; | |
private var _env:Environment; | |
private var _visualDebug:Boolean; | |
private var _idleTimer:IdleTimer; | |
private var _debug:DebugConfiguration; | |
private var _buffer:Buffer; | |
private var _config:Configuration; | |
private var _mode:String; | |
private var _display:DisplayObject; | |
private var _jsproxy:JavascriptProxy; | |
private var _dom:HTMLDOM; | |
private var _eventDispatcher:EventDispatcher; | |
private var _ready:Boolean = false; | |
private var _gifRequest:GIFRequest; | |
private var _account:String; | |
private var _tracker:GoogleAnalyticsAPI; | |
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){ | |
_ready = false; | |
super(); | |
_display = _arg1; | |
_eventDispatcher = new EventDispatcher(this); | |
_tracker = new TrackerCache(); | |
this.account = _arg2; | |
this.mode = _arg3; | |
this.visualDebug = _arg4; | |
if (!_arg6){ | |
this.debug = new DebugConfiguration(); | |
}; | |
if (!_arg5){ | |
this.config = new Configuration(_arg6); | |
}; | |
if (autobuild){ | |
_factory(); | |
}; | |
} | |
public function link(_arg1:String, _arg2:Boolean=false):void{ | |
_tracker.link(_arg1, _arg2); | |
} | |
public function addOrganic(_arg1:String, _arg2:String):void{ | |
_tracker.addOrganic(_arg1, _arg2); | |
} | |
public function setAllowLinker(_arg1:Boolean):void{ | |
_tracker.setAllowLinker(_arg1); | |
} | |
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{ | |
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4)); | |
} | |
public function setCookieTimeout(_arg1:int):void{ | |
_tracker.setCookieTimeout(_arg1); | |
} | |
public function trackTrans():void{ | |
_tracker.trackTrans(); | |
} | |
public function trackPageview(_arg1:String=""):void{ | |
_tracker.trackPageview(_arg1); | |
} | |
public function getClientInfo():Boolean{ | |
return (_tracker.getClientInfo()); | |
} | |
public function setClientInfo(_arg1:Boolean):void{ | |
_tracker.setClientInfo(_arg1); | |
} | |
public function get account():String{ | |
return (_account); | |
} | |
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{ | |
_tracker.linkByPost(_arg1, _arg2); | |
} | |
public function getDetectTitle():Boolean{ | |
return (_tracker.getDetectTitle()); | |
} | |
public function dispatchEvent(_arg1:Event):Boolean{ | |
return (_eventDispatcher.dispatchEvent(_arg1)); | |
} | |
public function get config():Configuration{ | |
return (_config); | |
} | |
public function set mode(_arg1:String):void{ | |
_mode = _arg1; | |
} | |
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{ | |
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3); | |
} | |
public function setDetectFlash(_arg1:Boolean):void{ | |
_tracker.setDetectFlash(_arg1); | |
} | |
public function resetSession():void{ | |
_tracker.resetSession(); | |
} | |
public function setCampNameKey(_arg1:String):void{ | |
_tracker.setCampNameKey(_arg1); | |
} | |
public function get debug():DebugConfiguration{ | |
return (_debug); | |
} | |
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{ | |
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6); | |
} | |
private function _bridgeFactory():GoogleAnalyticsAPI{ | |
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account)); | |
return (new Bridge(account, _debug, _jsproxy)); | |
} | |
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ | |
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); | |
} | |
public function clearIgnoredOrganic():void{ | |
_tracker.clearIgnoredOrganic(); | |
} | |
public function set account(_arg1:String):void{ | |
_account = _arg1; | |
} | |
public function setVar(_arg1:String):void{ | |
_tracker.setVar(_arg1); | |
} | |
public function build():void{ | |
if (!isReady()){ | |
_factory(); | |
}; | |
} | |
public function setDomainName(_arg1:String):void{ | |
_tracker.setDomainName(_arg1); | |
} | |
public function createEventTracker(_arg1:String):EventTracker{ | |
return (_tracker.createEventTracker(_arg1)); | |
} | |
public function set config(_arg1:Configuration):void{ | |
_config = _arg1; | |
} | |
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{ | |
return (_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8)); | |
} | |
public function setCampSourceKey(_arg1:String):void{ | |
_tracker.setCampSourceKey(_arg1); | |
} | |
public function setCampContentKey(_arg1:String):void{ | |
_tracker.setCampContentKey(_arg1); | |
} | |
public function willTrigger(_arg1:String):Boolean{ | |
return (_eventDispatcher.willTrigger(_arg1)); | |
} | |
public function setLocalServerMode():void{ | |
_tracker.setLocalServerMode(); | |
} | |
public function isReady():Boolean{ | |
return (_ready); | |
} | |
public function getLocalGifPath():String{ | |
return (_tracker.getLocalGifPath()); | |
} | |
public function setAllowAnchor(_arg1:Boolean):void{ | |
_tracker.setAllowAnchor(_arg1); | |
} | |
public function clearIgnoredRef():void{ | |
_tracker.clearIgnoredRef(); | |
} | |
public function get mode():String{ | |
return (_mode); | |
} | |
public function set debug(_arg1:DebugConfiguration):void{ | |
_debug = _arg1; | |
} | |
public function setLocalGifPath(_arg1:String):void{ | |
_tracker.setLocalGifPath(_arg1); | |
} | |
public function getVersion():String{ | |
return (_tracker.getVersion()); | |
} | |
public function setSampleRate(_arg1:Number):void{ | |
_tracker.setSampleRate(_arg1); | |
} | |
public function setCookiePath(_arg1:String):void{ | |
_tracker.setCookiePath(_arg1); | |
} | |
public function setAllowHash(_arg1:Boolean):void{ | |
_tracker.setAllowHash(_arg1); | |
} | |
public function setCampNOKey(_arg1:String):void{ | |
_tracker.setCampNOKey(_arg1); | |
} | |
public function addIgnoredOrganic(_arg1:String):void{ | |
_tracker.addIgnoredOrganic(_arg1); | |
} | |
public function setLocalRemoteServerMode():void{ | |
_tracker.setLocalRemoteServerMode(); | |
} | |
public function cookiePathCopy(_arg1:String):void{ | |
_tracker.cookiePathCopy(_arg1); | |
} | |
private function _factory():void{ | |
var _local1:GoogleAnalyticsAPI; | |
var _local2:TrackerCache; | |
_jsproxy = new JavascriptProxy(debug); | |
if (visualDebug){ | |
debug.layout = new Layout(debug, _display); | |
debug.active = visualDebug; | |
}; | |
_local2 = (_tracker as TrackerCache); | |
switch (mode){ | |
case TrackerMode.BRIDGE: | |
_local1 = _bridgeFactory(); | |
break; | |
case TrackerMode.AS3: | |
default: | |
_local1 = _trackerFactory(); | |
}; | |
if (!_local2.isEmpty()){ | |
_local2.tracker = _local1; | |
_local2.flush(); | |
}; | |
_tracker = _local1; | |
_ready = true; | |
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this)); | |
} | |
public function setCampTermKey(_arg1:String):void{ | |
_tracker.setCampTermKey(_arg1); | |
} | |
private function _trackerFactory():GoogleAnalyticsAPI{ | |
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account)); | |
_adSense = new AdSenseGlobals(debug); | |
_dom = new HTMLDOM(debug); | |
_dom.cacheProperties(); | |
_env = new Environment("", "", "", debug, _dom); | |
_buffer = new Buffer(config, debug, false); | |
_gifRequest = new GIFRequest(config, debug, _buffer, _env); | |
_idleTimer = new IdleTimer(config, debug, _display, _buffer); | |
_env.url = _display.stage.loaderInfo.url; | |
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense)); | |
} | |
public function setDetectTitle(_arg1:Boolean):void{ | |
_tracker.setDetectTitle(_arg1); | |
} | |
public function getServiceMode():ServerOperationMode{ | |
return (_tracker.getServiceMode()); | |
} | |
public function clearOrganic():void{ | |
_tracker.clearOrganic(); | |
} | |
public function setCampaignTrack(_arg1:Boolean):void{ | |
_tracker.setCampaignTrack(_arg1); | |
} | |
public function addIgnoredRef(_arg1:String):void{ | |
_tracker.addIgnoredRef(_arg1); | |
} | |
public function set visualDebug(_arg1:Boolean):void{ | |
_visualDebug = _arg1; | |
} | |
public function setCampMediumKey(_arg1:String):void{ | |
_tracker.setCampMediumKey(_arg1); | |
} | |
public function setSessionTimeout(_arg1:int):void{ | |
_tracker.setSessionTimeout(_arg1); | |
} | |
public function getDetectFlash():Boolean{ | |
return (_tracker.getDetectFlash()); | |
} | |
public function get visualDebug():Boolean{ | |
return (_visualDebug); | |
} | |
public function getAccount():String{ | |
return (_tracker.getAccount()); | |
} | |
public function hasEventListener(_arg1:String):Boolean{ | |
return (_eventDispatcher.hasEventListener(_arg1)); | |
} | |
public function setRemoteServerMode():void{ | |
_tracker.setRemoteServerMode(); | |
} | |
} | |
var _local1:* = ServerOperationMode; | |
return (_local1); | |
}//package com.google.analytics | |
package com.adobe.images { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.utils.*; | |
public class PNGEncoder { | |
private static var crcTable:Array; | |
private static var crcTableComputed:Boolean = false; | |
public static function encode(_arg1:BitmapData):ByteArray{ | |
var _local6:uint; | |
var _local7:int; | |
var _local2:ByteArray = new ByteArray(); | |
_local2.writeUnsignedInt(2303741511); | |
_local2.writeUnsignedInt(218765834); | |
var _local3:ByteArray = new ByteArray(); | |
_local3.writeInt(_arg1.width); | |
_local3.writeInt(_arg1.height); | |
_local3.writeUnsignedInt(134610944); | |
_local3.writeByte(0); | |
writeChunk(_local2, 1229472850, _local3); | |
var _local4:ByteArray = new ByteArray(); | |
var _local5:int; | |
while (_local5 < _arg1.height) { | |
_local4.writeByte(0); | |
if (!_arg1.transparent){ | |
_local7 = 0; | |
while (_local7 < _arg1.width) { | |
_local6 = _arg1.getPixel(_local7, _local5); | |
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF))); | |
_local7++; | |
}; | |
} else { | |
_local7 = 0; | |
while (_local7 < _arg1.width) { | |
_local6 = _arg1.getPixel32(_local7, _local5); | |
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24)))); | |
_local7++; | |
}; | |
}; | |
_local5++; | |
}; | |
_local4.compress(); | |
writeChunk(_local2, 1229209940, _local4); | |
writeChunk(_local2, 1229278788, null); | |
return (_local2); | |
} | |
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{ | |
var _local8:uint; | |
var _local9:uint; | |
var _local10:uint; | |
if (!crcTableComputed){ | |
crcTableComputed = true; | |
crcTable = []; | |
_local9 = 0; | |
while (_local9 < 0x0100) { | |
_local8 = _local9; | |
_local10 = 0; | |
while (_local10 < 8) { | |
if ((_local8 & 1)){ | |
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1)))); | |
} else { | |
_local8 = uint((_local8 >>> 1)); | |
}; | |
_local10++; | |
}; | |
crcTable[_local9] = _local8; | |
_local9++; | |
}; | |
}; | |
var _local4:uint; | |
if (_arg3 != null){ | |
_local4 = _arg3.length; | |
}; | |
_arg1.writeUnsignedInt(_local4); | |
var _local5:uint = _arg1.position; | |
_arg1.writeUnsignedInt(_arg2); | |
if (_arg3 != null){ | |
_arg1.writeBytes(_arg3); | |
}; | |
var _local6:uint = _arg1.position; | |
_arg1.position = _local5; | |
_local8 = 4294967295; | |
var _local7:int; | |
while (_local7 < (_local6 - _local5)) { | |
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8)))); | |
_local7++; | |
}; | |
_local8 = uint((_local8 ^ uint(4294967295))); | |
_arg1.position = _local6; | |
_arg1.writeUnsignedInt(_local8); | |
} | |
} | |
}//package com.adobe.images | |
package com.adobe.serialization.json { | |
public class JSONDecoder { | |
private var value; | |
private var tokenizer:JSONTokenizer; | |
private var token:JSONToken; | |
public function JSONDecoder(_arg1:String){ | |
this.tokenizer = new JSONTokenizer(_arg1); | |
this.nextToken(); | |
this.value = this.parseValue(); | |
} | |
public function getValue(){ | |
return (this.value); | |
} | |
private function nextToken():JSONToken{ | |
return ((this.token = this.tokenizer.getNextToken())); | |
} | |
private function parseArray():Array{ | |
var _local1:Array = new Array(); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACKET){ | |
return (_local1); | |
}; | |
_local1.push(this.parseValue()); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACKET){ | |
return (_local1); | |
}; | |
if (this.token.type == JSONTokenType.COMMA){ | |
this.nextToken(); | |
} else { | |
this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value)); | |
}; | |
//unresolved jump | |
} | |
private function parseObject():Object{ | |
var _local2:String; | |
var _local1:Object = new Object(); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACE){ | |
return (_local1); | |
}; | |
if (this.token.type == JSONTokenType.STRING){ | |
_local2 = String(this.token.value); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.COLON){ | |
this.nextToken(); | |
_local1[_local2] = this.parseValue(); | |
this.nextToken(); | |
if (this.token.type == JSONTokenType.RIGHT_BRACE){ | |
return (_local1); | |
}; | |
if (this.token.type == JSONTokenType.COMMA){ | |
this.nextToken(); | |
} else { | |
this.tokenizer.parseError(("Expecting } or , but found " + this.token.value)); | |
}; | |
} else { | |
this.tokenizer.parseError(("Expecting : but found " + this.token.value)); | |
}; | |
} else { | |
this.tokenizer.parseError(("Expecting string but found " + this.token.value)); | |
}; | |
//unresolved jump | |
} | |
private function parseValue():Object{ | |
if (this.token == null){ | |
this.tokenizer.parseError("Unexpected end of input"); | |
}; | |
switch (this.token.type){ | |
case JSONTokenType.LEFT_BRACE: | |
return (this.parseObject()); | |
case JSONTokenType.LEFT_BRACKET: | |
return (this.parseArray()); | |
case JSONTokenType.STRING: | |
case JSONTokenType.NUMBER: | |
case JSONTokenType.TRUE: | |
case JSONTokenType.FALSE: | |
case JSONTokenType.NULL: | |
return (this.token.value); | |
default: | |
this.tokenizer.parseError(("Unexpected " + this.token.value)); | |
}; | |
return (null); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONToken { | |
private var _type:int; | |
private var _value:Object; | |
public function JSONToken(_arg1:int=-1, _arg2:Object=null){ | |
this._type = _arg1; | |
this._value = _arg2; | |
} | |
public function get type():int{ | |
return (this._type); | |
} | |
public function set type(_arg1:int):void{ | |
this._type = _arg1; | |
} | |
public function get value():Object{ | |
return (this._value); | |
} | |
public function set value(_arg1:Object):void{ | |
this._value = _arg1; | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
import flash.utils.*; | |
public class JSONEncoder { | |
private var jsonString:String; | |
public function JSONEncoder(_arg1){ | |
this.jsonString = this.convertToString(_arg1); | |
} | |
public function getString():String{ | |
return (this.jsonString); | |
} | |
private function convertToString(_arg1):String{ | |
if ((_arg1 is String)){ | |
return (this.escapeString((_arg1 as String))); | |
}; | |
if ((_arg1 is Number)){ | |
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null"); | |
}; | |
if ((_arg1 is Boolean)){ | |
return ((_arg1) ? "true" : "false"); | |
}; | |
if ((_arg1 is Array)){ | |
return (this.arrayToString((_arg1 as Array))); | |
}; | |
if ((((_arg1 is Object)) && (!((_arg1 == null))))){ | |
return (this.objectToString(_arg1)); | |
}; | |
return ("null"); | |
} | |
private function escapeString(_arg1:String):String{ | |
var _local3:String; | |
var _local6:String; | |
var _local7:String; | |
var _local2 = ""; | |
var _local4:Number = _arg1.length; | |
var _local5:int; | |
while (_local5 < _local4) { | |
_local3 = _arg1.charAt(_local5); | |
switch (_local3){ | |
case "\"": | |
_local2 = (_local2 + "\\\""); | |
break; | |
case "\\": | |
_local2 = (_local2 + "\\\\"); | |
break; | |
case "\b": | |
_local2 = (_local2 + "\\b"); | |
break; | |
case "\f": | |
_local2 = (_local2 + "\\f"); | |
break; | |
case "\n": | |
_local2 = (_local2 + "\\n"); | |
break; | |
case "\r": | |
_local2 = (_local2 + "\\r"); | |
break; | |
case "\t": | |
_local2 = (_local2 + "\\t"); | |
break; | |
default: | |
if (_local3 < " "){ | |
_local6 = _local3.charCodeAt(0).toString(16); | |
_local7 = ((_local6.length == 2)) ? "00" : "000"; | |
_local2 = (_local2 + (("\\u" + _local7) + _local6)); | |
} else { | |
_local2 = (_local2 + _local3); | |
}; | |
}; | |
_local5++; | |
}; | |
return ((("\"" + _local2) + "\"")); | |
} | |
private function arrayToString(_arg1:Array):String{ | |
var _local2 = ""; | |
var _local3:int; | |
while (_local3 < _arg1.length) { | |
if (_local2.length > 0){ | |
_local2 = (_local2 + ","); | |
}; | |
_local2 = (_local2 + this.convertToString(_arg1[_local3])); | |
_local3++; | |
}; | |
return ((("[" + _local2) + "]")); | |
} | |
private function objectToString(_arg1:Object):String{ | |
var value:* = null; | |
var key:* = null; | |
var v:* = null; | |
var o:* = _arg1; | |
var s:* = ""; | |
var classInfo:* = describeType(o); | |
if ([email protected]() == "Object"){ | |
for (key in o) { | |
value = o[key]; | |
if ((value is Function)){ | |
} else { | |
if (s.length > 0){ | |
s = (s + ","); | |
}; | |
s = (s + ((this.escapeString(key) + ":") + this.convertToString(value))); | |
}; | |
}; | |
} else { | |
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) { | |
if (s.length > 0){ | |
s = (s + ","); | |
}; | |
s = (s + ((this.escapeString([email protected]()) + ":") + this.convertToString(o[v.@name]))); | |
}; | |
}; | |
return ((("{" + s) + "}")); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONTokenizer { | |
private var obj:Object; | |
private var jsonString:String; | |
private var loc:int; | |
private var ch:String; | |
public function JSONTokenizer(_arg1:String){ | |
this.jsonString = _arg1; | |
this.loc = 0; | |
this.nextChar(); | |
} | |
public function getNextToken():JSONToken{ | |
var _local2:String; | |
var _local3:String; | |
var _local4:String; | |
var _local1:JSONToken = new JSONToken(); | |
this.skipIgnored(); | |
switch (this.ch){ | |
case "{": | |
_local1.type = JSONTokenType.LEFT_BRACE; | |
_local1.value = "{"; | |
this.nextChar(); | |
break; | |
case "}": | |
_local1.type = JSONTokenType.RIGHT_BRACE; | |
_local1.value = "}"; | |
this.nextChar(); | |
break; | |
case "[": | |
_local1.type = JSONTokenType.LEFT_BRACKET; | |
_local1.value = "["; | |
this.nextChar(); | |
break; | |
case "]": | |
_local1.type = JSONTokenType.RIGHT_BRACKET; | |
_local1.value = "]"; | |
this.nextChar(); | |
break; | |
case ",": | |
_local1.type = JSONTokenType.COMMA; | |
_local1.value = ","; | |
this.nextChar(); | |
break; | |
case ":": | |
_local1.type = JSONTokenType.COLON; | |
_local1.value = ":"; | |
this.nextChar(); | |
break; | |
case "t": | |
_local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar()); | |
if (_local2 == "true"){ | |
_local1.type = JSONTokenType.TRUE; | |
_local1.value = true; | |
this.nextChar(); | |
} else { | |
this.parseError(("Expecting 'true' but found " + _local2)); | |
}; | |
break; | |
case "f": | |
_local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar()); | |
if (_local3 == "false"){ | |
_local1.type = JSONTokenType.FALSE; | |
_local1.value = false; | |
this.nextChar(); | |
} else { | |
this.parseError(("Expecting 'false' but found " + _local3)); | |
}; | |
break; | |
case "n": | |
_local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar()); | |
if (_local4 == "null"){ | |
_local1.type = JSONTokenType.NULL; | |
_local1.value = null; | |
this.nextChar(); | |
} else { | |
this.parseError(("Expecting 'null' but found " + _local4)); | |
}; | |
break; | |
case "\"": | |
_local1 = this.readString(); | |
break; | |
default: | |
if (((this.isDigit(this.ch)) || ((this.ch == "-")))){ | |
_local1 = this.readNumber(); | |
} else { | |
if (this.ch == ""){ | |
return (null); | |
}; | |
this.parseError((("Unexpected " + this.ch) + " encountered")); | |
}; | |
}; | |
return (_local1); | |
} | |
private function readString():JSONToken{ | |
var _local3:String; | |
var _local4:int; | |
var _local1:JSONToken = new JSONToken(); | |
_local1.type = JSONTokenType.STRING; | |
var _local2 = ""; | |
this.nextChar(); | |
while (((!((this.ch == "\""))) && (!((this.ch == ""))))) { | |
if (this.ch == "\\"){ | |
this.nextChar(); | |
switch (this.ch){ | |
case "\"": | |
_local2 = (_local2 + "\""); | |
break; | |
case "/": | |
_local2 = (_local2 + "/"); | |
break; | |
case "\\": | |
_local2 = (_local2 + "\\"); | |
break; | |
case "b": | |
_local2 = (_local2 + "\b"); | |
break; | |
case "f": | |
_local2 = (_local2 + "\f"); | |
break; | |
case "n": | |
_local2 = (_local2 + "\n"); | |
break; | |
case "r": | |
_local2 = (_local2 + "\r"); | |
break; | |
case "t": | |
_local2 = (_local2 + "\t"); | |
break; | |
case "u": | |
_local3 = ""; | |
_local4 = 0; | |
while (_local4 < 4) { | |
if (!this.isHexDigit(this.nextChar())){ | |
this.parseError((" Excepted a hex digit, but found: " + this.ch)); | |
}; | |
_local3 = (_local3 + this.ch); | |
_local4++; | |
}; | |
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16))); | |
break; | |
default: | |
_local2 = (_local2 + ("\\" + this.ch)); | |
}; | |
} else { | |
_local2 = (_local2 + this.ch); | |
}; | |
this.nextChar(); | |
}; | |
if (this.ch == ""){ | |
this.parseError("Unterminated string literal"); | |
}; | |
this.nextChar(); | |
_local1.value = _local2; | |
return (_local1); | |
} | |
private function readNumber():JSONToken{ | |
var _local1:JSONToken = new JSONToken(); | |
_local1.type = JSONTokenType.NUMBER; | |
var _local2 = ""; | |
if (this.ch == "-"){ | |
_local2 = (_local2 + "-"); | |
this.nextChar(); | |
}; | |
if (!this.isDigit(this.ch)){ | |
this.parseError("Expecting a digit"); | |
}; | |
if (this.ch == "0"){ | |
_local2 = (_local2 + this.ch); | |
this.nextChar(); | |
if (this.isDigit(this.ch)){ | |
this.parseError("A digit cannot immediately follow 0"); | |
}; | |
} else { | |
while (this.isDigit(this.ch)) { | |
_local2 = (_local2 + this.ch); | |
this.nextChar(); | |
}; | |
}; | |
if (this.ch == "."){ | |
_local2 = (_local2 + "."); | |
this.nextChar(); | |
if (!this.isDigit(this.ch)){ | |
this.parseError("Expecting a digit"); | |
}; | |
while (this.isDigit(this.ch)) { | |
_local2 = (_local2 + this.ch); | |
this.nextChar(); | |
}; | |
}; | |
if ((((this.ch == "e")) || ((this.ch == "E")))){ | |
_local2 = (_local2 + "e"); | |
this.nextChar(); | |
if ((((this.ch == "+")) || ((this.ch == "-")))){ | |
_local2 = (_local2 + this.ch); | |
this.nextChar(); | |
}; | |
if (!this.isDigit(this.ch)){ | |
this.parseError("Scientific notation number needs exponent value"); | |
}; | |
while (this.isDigit(this.ch)) { | |
_local2 = (_local2 + this.ch); | |
this.nextChar(); | |
}; | |
}; | |
var _local3:Number = Number(_local2); | |
if (((isFinite(_local3)) && (!(isNaN(_local3))))){ | |
_local1.value = _local3; | |
return (_local1); | |
}; | |
this.parseError((("Number " + _local3) + " is not valid!")); | |
return (null); | |
} | |
private function nextChar():String{ | |
return ((this.ch = this.jsonString.charAt(this.loc++))); | |
} | |
private function skipIgnored():void{ | |
var _local1:int; | |
do { | |
_local1 = this.loc; | |
this.skipWhite(); | |
this.skipComments(); | |
} while (_local1 != this.loc); | |
} | |
private function skipComments():void{ | |
if (this.ch == "/"){ | |
this.nextChar(); | |
switch (this.ch){ | |
case "/": | |
do { | |
this.nextChar(); | |
} while (((!((this.ch == "\n"))) && (!((this.ch == ""))))); | |
this.nextChar(); | |
break; | |
case "*": | |
this.nextChar(); | |
while (true) { | |
if (this.ch == "*"){ | |
this.nextChar(); | |
if (this.ch == "/"){ | |
this.nextChar(); | |
break; | |
}; | |
} else { | |
this.nextChar(); | |
}; | |
if (this.ch == ""){ | |
this.parseError("Multi-line comment not closed"); | |
}; | |
}; | |
break; | |
default: | |
this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )")); | |
}; | |
}; | |
} | |
private function skipWhite():void{ | |
while (this.isWhiteSpace(this.ch)) { | |
this.nextChar(); | |
}; | |
} | |
private function isWhiteSpace(_arg1:String):Boolean{ | |
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r")))); | |
} | |
private function isDigit(_arg1:String):Boolean{ | |
return ((((_arg1 >= "0")) && ((_arg1 <= "9")))); | |
} | |
private function isHexDigit(_arg1:String):Boolean{ | |
var _local2:String = _arg1.toUpperCase(); | |
return (((this.isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F")))))); | |
} | |
public function parseError(_arg1:String):void{ | |
throw (new JSONParseError(_arg1, this.loc, this.jsonString)); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONParseError extends Error { | |
private var _location:int; | |
private var _text:String; | |
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){ | |
super(_arg1); | |
name = "JSONParseError"; | |
this._location = _arg2; | |
this._text = _arg3; | |
} | |
public function get location():int{ | |
return (this._location); | |
} | |
public function get text():String{ | |
return (this._text); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSONTokenType { | |
public static const UNKNOWN:int = -1; | |
public static const COMMA:int = 0; | |
public static const LEFT_BRACE:int = 1; | |
public static const RIGHT_BRACE:int = 2; | |
public static const LEFT_BRACKET:int = 3; | |
public static const RIGHT_BRACKET:int = 4; | |
public static const COLON:int = 6; | |
public static const TRUE:int = 7; | |
public static const FALSE:int = 8; | |
public static const NULL:int = 9; | |
public static const STRING:int = 10; | |
public static const NUMBER:int = 11; | |
} | |
}//package com.adobe.serialization.json | |
package com.adobe.serialization.json { | |
public class JSON { | |
public static function encode(_arg1:Object):String{ | |
var _local2:JSONEncoder = new JSONEncoder(_arg1); | |
return (_local2.getString()); | |
} | |
public static function decode(_arg1:String){ | |
var _local2:JSONDecoder = new JSONDecoder(_arg1); | |
return (_local2.getValue()); | |
} | |
} | |
}//package com.adobe.serialization.json | |
package com.hurlant.crypto.symmetric { | |
import flash.utils.*; | |
import com.hurlant.util.*; | |
public class DESKey implements ISymmetricKey { | |
private static const SP8:Array = [268439616, 0x1000, 262144, 268701760, 268435456, 268439616, 64, 268435456, 262208, 268697600, 268701760, 266240, 268701696, 266304, 0x1000, 64, 268697600, 268435520, 268439552, 4160, 266240, 262208, 268697664, 268701696, 4160, 0, 0, 268697664, 268435520, 268439552, 266304, 262144, 266304, 262144, 268701696, 0x1000, 64, 268697664, 0x1000, 266304, 268439552, 64, 268435520, 268697600, 268697664, 268435456, 262144, 268439616, 0, 268701760, 262208, 268435520, 268697600, 268439552, 268439616, 0, 268701760, 266240, 266240, 4160, 4160, 262208, 268435456, 268701696]; | |
private static const bytebit:Array = [128, 64, 32, 16, 8, 4, 2, 1]; | |
private static const bigbyte:Array = [0x800000, 0x400000, 0x200000, 0x100000, 524288, 262144, 131072, 65536, 0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, 128, 64, 32, 16, 8, 4, 2, 1]; | |
private static const pc1:Array = [56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 27, 19, 11, 3]; | |
private static const pc2:Array = [13, 16, 10, 23, 0, 4, 2, 27, 14, 5, 20, 9, 22, 18, 11, 3, 25, 7, 15, 6, 26, 19, 12, 1, 40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47, 43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31]; | |
private static const Df_Key:Array = [1, 35, 69, 103, 137, 171, 205, 239, 254, 220, 186, 152, 118, 84, 50, 16, 137, 171, 205, 239, 1, 35, 69, 103]; | |
private static const totrot:Array = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; | |
private static const SP1:Array = [16843776, 0, 65536, 16843780, 16842756, 66564, 4, 65536, 0x0400, 16843776, 16843780, 0x0400, 16778244, 16842756, 16777216, 4, 0x0404, 16778240, 16778240, 66560, 66560, 16842752, 16842752, 16778244, 65540, 16777220, 16777220, 65540, 0, 0x0404, 66564, 16777216, 65536, 16843780, 4, 16842752, 16843776, 16777216, 16777216, 0x0400, 16842756, 65536, 66560, 16777220, 0x0400, 4, 16778244, 66564, 16843780, 65540, 16842752, 16778244, 16777220, 0x0404, 66564, 16843776, 0x0404, 16778240, 16778240, 0, 65540, 66560, 0, 16842756]; | |
private static const SP2:Array = [2148565024, 2147516416, 0x8000, 1081376, 0x100000, 32, 2148532256, 2147516448, 2147483680, 2148565024, 2148564992, 2147483648, 2147516416, 0x100000, 32, 2148532256, 0x108000, 0x100020, 2147516448, 0, 2147483648, 0x8000, 1081376, 2148532224, 0x100020, 2147483680, 0, 0x108000, 32800, 2148564992, 2148532224, 32800, 0, 1081376, 2148532256, 0x100000, 2147516448, 2148532224, 2148564992, 0x8000, 2148532224, 2147516416, 32, 2148565024, 1081376, 32, 0x8000, 2147483648, 32800, 2148564992, 0x100000, 2147483680, 0x100020, 2147516448, 2147483680, 0x100020, 0x108000, 0, 2147516416, 32800, 2147483648, 2148532256, 2148565024, 0x108000]; | |
private static const SP3:Array = [520, 134349312, 0, 134348808, 134218240, 0, 131592, 134218240, 131080, 134217736, 134217736, 131072, 134349320, 131080, 134348800, 520, 134217728, 8, 134349312, 0x0200, 131584, 134348800, 134348808, 131592, 134218248, 131584, 131072, 134218248, 8, 134349320, 0x0200, 134217728, 134349312, 134217728, 131080, 520, 131072, 134349312, 134218240, 0, 0x0200, 131080, 134349320, 134218240, 134217736, 0x0200, 0, 134348808, 134218248, 131072, 134217728, 134349320, 8, 131592, 131584, 134217736, 134348800, 134218248, 520, 134348800, 131592, 8, 134348808, 131584]; | |
private static const SP4:Array = [8396801, 8321, 8321, 128, 8396928, 0x800081, 0x800001, 8193, 0, 0x802000, 0x802000, 8396929, 129, 0, 0x800080, 0x800001, 1, 0x2000, 0x800000, 8396801, 128, 0x800000, 8193, 8320, 0x800081, 1, 8320, 0x800080, 0x2000, 8396928, 8396929, 129, 0x800080, 0x800001, 0x802000, 8396929, 129, 0, 0, 0x802000, 8320, 0x800080, 0x800081, 1, 8396801, 8321, 8321, 128, 8396929, 129, 1, 0x2000, 0x800001, 8193, 8396928, 0x800081, 8193, 8320, 0x800000, 8396801, 128, 0x800000, 0x2000, 8396928]; | |
private static const SP5:Array = [0x0100, 34078976, 34078720, 1107296512, 524288, 0x0100, 1073741824, 34078720, 1074266368, 524288, 33554688, 1074266368, 1107296512, 1107820544, 524544, 1073741824, 33554432, 1074266112, 1074266112, 0, 1073742080, 1107820800, 1107820800, 33554688, 1107820544, 1073742080, 0, 1107296256, 34078976, 33554432, 1107296256, 524544, 524288, 1107296512, 0x0100, 33554432, 1073741824, 34078720, 1107296512, 1074266368, 33554688, 1073741824, 1107820544, 34078976, 1074266368, 0x0100, 33554432, 1107820544, 1107820800, 524544, 1107296256, 1107820800, 34078720, 0, 1074266112, 1107296256, 524544, 33554688, 1073742080, 524288, 0, 1074266112, 34078976, 1073742080]; | |
private static const SP6:Array = [536870928, 541065216, 0x4000, 541081616, 541065216, 16, 541081616, 0x400000, 536887296, 4210704, 0x400000, 536870928, 0x400010, 536887296, 536870912, 16400, 0, 0x400010, 536887312, 0x4000, 0x404000, 536887312, 16, 541065232, 541065232, 0, 4210704, 541081600, 16400, 0x404000, 541081600, 536870912, 536887296, 16, 541065232, 0x404000, 541081616, 0x400000, 16400, 536870928, 0x400000, 536887296, 536870912, 16400, 536870928, 541081616, 0x404000, 541065216, 4210704, 541081600, 0, 541065232, 16, 0x4000, 541065216, 4210704, 0x4000, 0x400010, 536887312, 0, 541081600, 536870912, 0x400010, 536887312]; | |
private static const SP7:Array = [0x200000, 69206018, 67110914, 0, 0x0800, 67110914, 2099202, 69208064, 69208066, 0x200000, 0, 67108866, 2, 67108864, 69206018, 2050, 67110912, 2099202, 0x200002, 67110912, 67108866, 69206016, 69208064, 0x200002, 69206016, 0x0800, 2050, 69208066, 0x200800, 2, 67108864, 0x200800, 67108864, 0x200800, 0x200000, 67110914, 67110914, 69206018, 69206018, 2, 0x200002, 67108864, 67110912, 0x200000, 69208064, 2050, 2099202, 69208064, 2050, 67108866, 69208066, 69206016, 0x200800, 0, 2, 69208066, 0, 2099202, 69206016, 0x0800, 67108866, 67110912, 0x0800, 0x200002]; | |
protected var encKey:Array; | |
protected var key:ByteArray; | |
protected var decKey:Array; | |
public function DESKey(_arg1:ByteArray){ | |
this.key = _arg1; | |
this.encKey = generateWorkingKey(true, _arg1, 0); | |
this.decKey = generateWorkingKey(false, _arg1, 0); | |
} | |
protected function generateWorkingKey(_arg1:Boolean, _arg2:ByteArray, _arg3:uint):Array{ | |
var _local4:Array; | |
var _local5:ByteArray; | |
var _local6:ByteArray; | |
var _local7:uint; | |
var _local8:uint; | |
var _local9:uint; | |
var _local10:uint; | |
var _local11:uint; | |
var _local12:uint; | |
var _local13:uint; | |
_local4 = []; | |
_local5 = new ByteArray(); | |
_local6 = new ByteArray(); | |
_local8 = 0; | |
while (_local8 < 56) { | |
_local7 = pc1[_local8]; | |
_local5[_local8] = !(((_arg2[(_arg3 + (_local7 >>> 3))] & bytebit[(_local7 & 7)]) == 0)); | |
_local8++; | |
}; | |
_local9 = 0; | |
while (_local9 < 16) { | |
if (_arg1){ | |
_local10 = (_local9 << 1); | |
} else { | |
_local10 = ((15 - _local9) << 1); | |
}; | |
_local11 = (_local10 + 1); | |
_local4[_local10] = (_local4[_local11] = 0); | |
_local8 = 0; | |
while (_local8 < 28) { | |
_local7 = (_local8 + totrot[_local9]); | |
if (_local7 < 28){ | |
_local6[_local8] = _local5[_local7]; | |
} else { | |
_local6[_local8] = _local5[(_local7 - 28)]; | |
}; | |
_local8++; | |
}; | |
_local8 = 28; | |
while (_local8 < 56) { | |
_local7 = (_local8 + totrot[_local9]); | |
if (_local7 < 56){ | |
_local6[_local8] = _local5[_local7]; | |
} else { | |
_local6[_local8] = _local5[(_local7 - 28)]; | |
}; | |
_local8++; | |
}; | |
_local8 = 0; | |
while (_local8 < 24) { | |
if (_local6[pc2[_local8]]){ | |
_local4[_local10] = (_local4[_local10] | bigbyte[_local8]); | |
}; | |
if (_local6[pc2[(_local8 + 24)]]){ | |
_local4[_local11] = (_local4[_local11] | bigbyte[_local8]); | |
}; | |
_local8++; | |
}; | |
_local9++; | |
}; | |
_local9 = 0; | |
while (_local9 != 32) { | |
_local12 = _local4[_local9]; | |
_local13 = _local4[(_local9 + 1)]; | |
_local4[_local9] = (((((_local12 & 0xFC0000) << 6) | ((_local12 & 4032) << 10)) | ((_local13 & 0xFC0000) >>> 10)) | ((_local13 & 4032) >>> 6)); | |
_local4[(_local9 + 1)] = (((((_local12 & 258048) << 12) | ((_local12 & 63) << 16)) | ((_local13 & 258048) >>> 4)) | (_local13 & 63)); | |
_local9 = (_local9 + 2); | |
}; | |
return (_local4); | |
} | |
public function encrypt(_arg1:ByteArray, _arg2:uint=0):void{ | |
desFunc(encKey, _arg1, _arg2, _arg1, _arg2); | |
} | |
public function decrypt(_arg1:ByteArray, _arg2:uint=0):void{ | |
desFunc(decKey, _arg1, _arg2, _arg1, _arg2); | |
} | |
public function dispose():void{ | |
var _local1:uint; | |
_local1 = 0; | |
_local1 = 0; | |
while (_local1 < encKey.length) { | |
encKey[_local1] = 0; | |
_local1++; | |
}; | |
_local1 = 0; | |
while (_local1 < decKey.length) { | |
decKey[_local1] = 0; | |
_local1++; | |
}; | |
encKey = null; | |
decKey = null; | |
_local1 = 0; | |
while (_local1 < key.length) { | |
key[_local1] = 0; | |
_local1++; | |
}; | |
key.length = 0; | |
key = null; | |
Memory.gc(); | |
} | |
protected function desFunc(_arg1:Array, _arg2:ByteArray, _arg3:uint, _arg4:ByteArray, _arg5:uint):void{ | |
var _local6:uint; | |
var _local7:uint; | |
var _local8:uint; | |
var _local9:uint; | |
var _local10:uint; | |
_local8 = ((_arg2[(_arg3 + 0)] & 0xFF) << 24); | |
_local8 = (_local8 | ((_arg2[(_arg3 + 1)] & 0xFF) << 16)); | |
_local8 = (_local8 | ((_arg2[(_arg3 + 2)] & 0xFF) << 8)); | |
_local8 = (_local8 | (_arg2[(_arg3 + 3)] & 0xFF)); | |
_local7 = ((_arg2[(_arg3 + 4)] & 0xFF) << 24); | |
_local7 = (_local7 | ((_arg2[(_arg3 + 5)] & 0xFF) << 16)); | |
_local7 = (_local7 | ((_arg2[(_arg3 + 6)] & 0xFF) << 8)); | |
_local7 = (_local7 | (_arg2[(_arg3 + 7)] & 0xFF)); | |
_local6 = (((_local8 >>> 4) ^ _local7) & 252645135); | |
_local7 = (_local7 ^ _local6); | |
_local8 = (_local8 ^ (_local6 << 4)); | |
_local6 = (((_local8 >>> 16) ^ _local7) & 0xFFFF); | |
_local7 = (_local7 ^ _local6); | |
_local8 = (_local8 ^ (_local6 << 16)); | |
_local6 = (((_local7 >>> 2) ^ _local8) & 858993459); | |
_local8 = (_local8 ^ _local6); | |
_local7 = (_local7 ^ (_local6 << 2)); | |
_local6 = (((_local7 >>> 8) ^ _local8) & 0xFF00FF); | |
_local8 = (_local8 ^ _local6); | |
_local7 = (_local7 ^ (_local6 << 8)); | |
_local7 = (((_local7 << 1) | ((_local7 >>> 31) & 1)) & 4294967295); | |
_local6 = ((_local8 ^ _local7) & 2863311530); | |
_local8 = (_local8 ^ _local6); | |
_local7 = (_local7 ^ _local6); | |
_local8 = (((_local8 << 1) | ((_local8 >>> 31) & 1)) & 4294967295); | |
_local9 = 0; | |
while (_local9 < 8) { | |
_local6 = ((_local7 << 28) | (_local7 >>> 4)); | |
_local6 = (_local6 ^ _arg1[((_local9 * 4) + 0)]); | |
_local10 = SP7[(_local6 & 63)]; | |
_local10 = (_local10 | SP5[((_local6 >>> 8) & 63)]); | |
_local10 = (_local10 | SP3[((_local6 >>> 16) & 63)]); | |
_local10 = (_local10 | SP1[((_local6 >>> 24) & 63)]); | |
_local6 = (_local7 ^ _arg1[((_local9 * 4) + 1)]); | |
_local10 = (_local10 | SP8[(_local6 & 63)]); | |
_local10 = (_local10 | SP6[((_local6 >>> 8) & 63)]); | |
_local10 = (_local10 | SP4[((_local6 >>> 16) & 63)]); | |
_local10 = (_local10 | SP2[((_local6 >>> 24) & 63)]); | |
_local8 = (_local8 ^ _local10); | |
_local6 = ((_local8 << 28) | (_local8 >>> 4)); | |
_local6 = (_local6 ^ _arg1[((_local9 * 4) + 2)]); | |
_local10 = SP7[(_local6 & 63)]; | |
_local10 = (_local10 | SP5[((_local6 >>> 8) & 63)]); | |
_local10 = (_local10 | SP3[((_local6 >>> 16) & 63)]); | |
_local10 = (_local10 | SP1[((_local6 >>> 24) & 63)]); | |
_local6 = (_local8 ^ _arg1[((_local9 * 4) + 3)]); | |
_local10 = (_local10 | SP8[(_local6 & 63)]); | |
_local10 = (_local10 | SP6[((_local6 >>> 8) & 63)]); | |
_local10 = (_local10 | SP4[((_local6 >>> 16) & 63)]); | |
_local10 = (_local10 | SP2[((_local6 >>> 24) & 63)]); | |
_local7 = (_local7 ^ _local10); | |
_local9++; | |
}; | |
_local7 = ((_local7 << 31) | (_local7 >>> 1)); | |
_local6 = ((_local8 ^ _local7) & 2863311530); | |
_local8 = (_local8 ^ _local6); | |
_local7 = (_local7 ^ _local6); | |
_local8 = ((_local8 << 31) | (_local8 >>> 1)); | |
_local6 = (((_local8 >>> 8) ^ _local7) & 0xFF00FF); | |
_local7 = (_local7 ^ _local6); | |
_local8 = (_local8 ^ (_local6 << 8)); | |
_local6 = (((_local8 >>> 2) ^ _local7) & 858993459); | |
_local7 = (_local7 ^ _local6); | |
_local8 = (_local8 ^ (_local6 << 2)); | |
_local6 = (((_local7 >>> 16) ^ _local8) & 0xFFFF); | |
_local8 = (_local8 ^ _local6); | |
_local7 = (_local7 ^ (_local6 << 16)); | |
_local6 = (((_local7 >>> 4) ^ _local8) & 252645135); | |
_local8 = (_local8 ^ _local6); | |
_local7 = (_local7 ^ (_local6 << 4)); | |
_arg4[(_arg5 + 0)] = ((_local7 >>> 24) & 0xFF); | |
_arg4[(_arg5 + 1)] = ((_local7 >>> 16) & 0xFF); | |
_arg4[(_arg5 + 2)] = ((_local7 >>> 8) & 0xFF); | |
_arg4[(_arg5 + 3)] = (_local7 & 0xFF); | |
_arg4[(_arg5 + 4)] = ((_local8 >>> 24) & 0xFF); | |
_arg4[(_arg5 + 5)] = ((_local8 >>> 16) & 0xFF); | |
_arg4[(_arg5 + 6)] = ((_local8 >>> 8) & 0xFF); | |
_arg4[(_arg5 + 7)] = (_local8 & 0xFF); | |
} | |
public function toString():String{ | |
return ("des"); | |
} | |
public function getBlockSize():uint{ | |
return (8); | |
} | |
} | |
}//package com.hurlant.crypto.symmetric | |
package com.hurlant.crypto.symmetric { | |
import flash.utils.*; | |
public interface ISymmetricKey { | |
function encrypt(_arg1:ByteArray, _arg2:uint=0):void; | |
function dispose():void; | |
function getBlockSize():uint; | |
function toString():String; | |
function decrypt(_arg1:ByteArray, _arg2:uint=0):void; | |
} | |
}//package com.hurlant.crypto.symmetric | |
package com.hurlant.util { | |
import flash.net.*; | |
import flash.system.*; | |
public class Memory { | |
public static function gc():void{ | |
try { | |
new LocalConnection().connect("foo"); | |
new LocalConnection().connect("foo"); | |
} catch(e) { | |
}; | |
} | |
public static function get used():uint{ | |
return (System.totalMemory); | |
} | |
} | |
}//package com.hurlant.util | |
package com.meitu.controls { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.events.*; | |
import flash.text.*; | |
import com.meitu.core.*; | |
public class SimpleStateButton extends CustomUIComponent implements IDestroyable { | |
private var state_normal:BitmapData; | |
private var state_hover:BitmapData; | |
private var state_down:BitmapData; | |
private var state_disabled:BitmapData; | |
private var _states:Array; | |
private var has_hover:Boolean = false; | |
private var has_down:Boolean = false; | |
private var hovering:Boolean = false; | |
private var is_selected:Boolean = false; | |
private var _enabled:Boolean = false; | |
private var _textPadding:int = 2; | |
private var _adaptLabel:Boolean; | |
private var _selectedBold:Boolean; | |
private var _selectedColor:int; | |
private var _label:String; | |
private var _textFormat:TextFormat; | |
private var _disabledTextFormat:TextFormat; | |
private var instance:Bitmap; | |
private var _textLabel:TextField; | |
public function SimpleStateButton(_arg1:BitmapData, _arg2:BitmapData=null, _arg3:BitmapData=null, _arg4:BitmapData=null){ | |
this._textFormat = new TextFormat("宋体", 12, 0); | |
super(); | |
this.state_normal = _arg1.clone(); | |
if (_arg2){ | |
this.has_hover = true; | |
this.state_hover = _arg2.clone(); | |
} else { | |
this.state_hover = _arg1.clone(); | |
}; | |
if (_arg3){ | |
this.has_down = true; | |
this.state_down = _arg3.clone(); | |
} else { | |
this.state_down = _arg1.clone(); | |
}; | |
if (_arg4){ | |
this.state_disabled = _arg4.clone(); | |
} else { | |
this.state_disabled = _arg1.clone(); | |
}; | |
this._states = [{ | |
name:"state_normal", | |
bitmapdata:this.state_normal | |
}, { | |
name:"state_hover", | |
bitmapdata:this.state_hover | |
}, { | |
name:"state_down", | |
bitmapdata:this.state_down | |
}, { | |
name:"state_disabled", | |
bitmapdata:this.state_disabled | |
}]; | |
if (((this.state_normal.rect.equals(this.state_hover.rect)) && (this.state_normal.rect.equals(this.state_down.rect)))){ | |
this.init(); | |
} else { | |
throw (new Error("State bitmap data dimensions must be equal")); | |
}; | |
} | |
public function set adaptLabel(_arg1:Boolean):void{ | |
this._adaptLabel = _arg1; | |
} | |
public function set selected(_arg1:Boolean):void{ | |
this.is_selected = _arg1; | |
var _local2:TextFormat = this._textLabel.defaultTextFormat; | |
if (this.is_selected){ | |
this.updateState(this.state_down); | |
_local2.bold = this._selectedBold; | |
_local2.color = (this._selectedColor) ? this._selectedColor : _local2.color; | |
} else { | |
if (this.hovering){ | |
this.updateState(this.state_hover); | |
} else { | |
this.updateState(this.state_normal); | |
}; | |
_local2.bold = (this._selectedBold) ? false : _local2.bold; | |
_local2.color = (this._selectedColor) ? _local2.color : this._selectedColor; | |
}; | |
this._textLabel.setTextFormat(_local2); | |
} | |
public function get selected():Boolean{ | |
return (this.is_selected); | |
} | |
public function set enabled(_arg1:Boolean):void{ | |
var _local2:TextFormat; | |
this._enabled = _arg1; | |
this.mouseEnabled = this._enabled; | |
this.tabEnabled = this._enabled; | |
if (this._enabled){ | |
if (this.is_selected){ | |
this.updateState(this.state_down); | |
} else { | |
this.updateState(this.state_normal); | |
}; | |
_local2 = this._textLabel.defaultTextFormat; | |
} else { | |
this.updateState(this.state_disabled); | |
_local2 = (this._disabledTextFormat) ? this._disabledTextFormat : this._textLabel.defaultTextFormat; | |
}; | |
this._textLabel.setTextFormat(_local2); | |
} | |
public function get enabled():Boolean{ | |
return (this._enabled); | |
} | |
public function get label():String{ | |
return (this._label); | |
} | |
public function set label(_arg1:String):void{ | |
this._label = _arg1; | |
this._textLabel.text = this._label; | |
if (this._adaptLabel){ | |
this.stateBitmapDataAdapt(); | |
}; | |
this.resize(); | |
} | |
public function set textPadding(_arg1:int):void{ | |
this._textPadding = _arg1; | |
} | |
override public function setStyle(_arg1:String, _arg2:Object):void{ | |
switch (_arg1){ | |
case "textFormat": | |
this._textFormat = (_arg2 as TextFormat); | |
this._textLabel.setTextFormat(this._textFormat); | |
this._textLabel.defaultTextFormat = this._textFormat; | |
this.resize(); | |
break; | |
case "disabledTextFormat": | |
this._disabledTextFormat = (_arg2 as TextFormat); | |
break; | |
case "selectedBold": | |
this._selectedBold = Boolean(_arg2); | |
break; | |
case "selectedColor": | |
this._selectedColor = int(_arg2); | |
this.selected = this.selected; | |
break; | |
case "upSkin": | |
this.state_normal = getSkinBitmapData(_arg2); | |
this.updateSkin(); | |
break; | |
case "overSkin": | |
this.state_hover = getSkinBitmapData(_arg2); | |
this.updateSkin(); | |
break; | |
case "downSkin": | |
this.state_down = getSkinBitmapData(_arg2); | |
this.updateSkin(); | |
break; | |
case "disabledSkin": | |
this.state_disabled = getSkinBitmapData(_arg2); | |
this.updateSkin(); | |
break; | |
}; | |
} | |
public function destroy():void{ | |
removeEventListener(MouseEvent.ROLL_OVER, this.onStateRollOver); | |
removeEventListener(MouseEvent.ROLL_OUT, this.onStateRollOut); | |
removeEventListener(MouseEvent.MOUSE_DOWN, this.onStateMouseDown); | |
removeEventListener(MouseEvent.MOUSE_UP, this.onStateMouseUp); | |
this.instance.bitmapData.dispose(); | |
} | |
private function init():void{ | |
buttonMode = true; | |
useHandCursor = true; | |
this.instance = new Bitmap(); | |
this.instance.bitmapData = this.state_normal; | |
this._textLabel = new TextField(); | |
this._textLabel.autoSize = TextFieldAutoSize.CENTER; | |
this._textLabel.selectable = false; | |
this._textLabel.mouseEnabled = false; | |
addChild(this.instance); | |
addChild(this._textLabel); | |
if (this.has_hover){ | |
addEventListener(MouseEvent.ROLL_OVER, this.onStateRollOver); | |
addEventListener(MouseEvent.ROLL_OUT, this.onStateRollOut); | |
}; | |
if (this.has_down){ | |
addEventListener(MouseEvent.MOUSE_DOWN, this.onStateMouseDown); | |
addEventListener(MouseEvent.MOUSE_UP, this.onStateMouseUp); | |
}; | |
} | |
private function updateSkin():void{ | |
if (this.enabled){ | |
if (this.is_selected){ | |
this.updateState(this.state_down); | |
} else { | |
if (this.hovering){ | |
this.updateState(this.state_hover); | |
} else { | |
this.updateState(this.state_normal); | |
}; | |
}; | |
} else { | |
this.updateState(this.state_disabled); | |
}; | |
this.resize(); | |
} | |
private function resize():void{ | |
this._textLabel.width = (this._textLabel.textWidth + 4); | |
this._textLabel.x = ((this.instance.width - this._textLabel.width) * 0.5); | |
this._textLabel.y = ((this.instance.height - this._textLabel.height) * 0.5); | |
} | |
private function updateState(_arg1:BitmapData):void{ | |
this.instance.bitmapData = _arg1; | |
} | |
private function stateBitmapDataAdapt():void{ | |
var _local3:BitmapData; | |
var _local4:BitmapData; | |
var _local6:Matrix; | |
var _local1:int = this._states.length; | |
var _local2:int = ((this._textLabel.textWidth + (2 * this._textPadding)) + 4); | |
var _local5:int; | |
while (_local5 < _local1) { | |
_local4 = (this._states[_local5]["bitmapdata"] as BitmapData); | |
_local6 = new Matrix(); | |
_local6.scale((_local2 / _local4.width), 1); | |
_local3 = new BitmapData(_local2, _local4.height); | |
_local3.draw(_local4, _local6); | |
this[this._states[_local5]["name"]] = _local3; | |
_local5++; | |
}; | |
} | |
private function onStateRollOver(_arg1:MouseEvent):void{ | |
this.hovering = true; | |
if (((!(this.is_selected)) && (this.enabled))){ | |
this.updateState(this.state_hover); | |
}; | |
} | |
private function onStateRollOut(_arg1:MouseEvent):void{ | |
this.hovering = false; | |
if (((!(this.is_selected)) && (this.enabled))){ | |
this.updateState(this.state_normal); | |
}; | |
} | |
private function onStateMouseDown(_arg1:MouseEvent):void{ | |
if (this.enabled){ | |
this.updateState(this.state_down); | |
}; | |
} | |
private function onStateMouseUp(_arg1:MouseEvent):void{ | |
if (((!(this.selected)) && (this.enabled))){ | |
if (this.hovering){ | |
this.updateState(this.state_hover); | |
} else { | |
this.updateState(this.state_normal); | |
}; | |
}; | |
} | |
} | |
}//package com.meitu.controls | |
package com.meitu.controls { | |
import flash.display.*; | |
import flash.utils.*; | |
import flash.system.*; | |
public class CustomUIComponent extends Sprite { | |
protected var _styles:Object; | |
public function CustomUIComponent(){ | |
this._styles = {}; | |
super(); | |
} | |
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{ | |
var classDef:* = null; | |
var skin:* = undefined; | |
var value:* = _arg1; | |
skin = value; | |
if ((skin is Class)){ | |
return ((new (skin) as DisplayObject)); | |
}; | |
if ((skin is DisplayObject)){ | |
(skin as DisplayObject).x = 0; | |
(skin as DisplayObject).y = 0; | |
return ((skin as DisplayObject)); | |
}; | |
try { | |
classDef = getDefinitionByName(skin.toString()); | |
} catch(e:Error) { | |
try { | |
classDef = (ApplicationDomain.currentDomain.getDefinition(skin.toString()) as Object); | |
} catch(e:Error) { | |
}; | |
if (classDef == null){ | |
return (null); | |
}; | |
}; | |
return ((new (classDef) as DisplayObject)); | |
} | |
protected function getSkinBitmapData(_arg1:Object):BitmapData{ | |
if ((_arg1 is BitmapData)){ | |
return ((_arg1 as BitmapData)); | |
}; | |
var _local2:DisplayObject = this.getDisplayObjectInstance(_arg1); | |
var _local3:BitmapData = new BitmapData(_local2.width, _local2.height); | |
_local3.draw(_local2); | |
return (_local3); | |
} | |
public function setStyle(_arg1:String, _arg2:Object):void{ | |
} | |
} | |
}//package com.meitu.controls | |
package com.meitu.controls { | |
public class TabBarDirection { | |
public static const HORIZONTAL:String = "horizontal"; | |
public static const VERTICAL:String = "vertical"; | |
public static const ALTERNATE:String = "alternate"; | |
public static const ALTERNATE_LOCK_WIDTH:String = "alternateLockWidth"; | |
} | |
}//package com.meitu.controls | |
package com.meitu.controls { | |
import flash.display.*; | |
import flash.events.*; | |
import flash.text.*; | |
import fl.data.*; | |
import com.meitu.events.*; | |
public class NewTabBar extends CustomUIComponent { | |
private var _stateNormal:BitmapData; | |
private var _stateHover:BitmapData; | |
private var _stateDown:BitmapData; | |
private var _stateDisabled:BitmapData; | |
private var _dataProvider:DataProvider; | |
private var _buttons:Array; | |
private var _textFormat:TextFormat; | |
private var _labelFunction:Function = null; | |
private var _labelField:String = "label"; | |
private var _enabled:Boolean = true; | |
private var _firstTabStyle:Object; | |
private var _lastTabStyle:Object; | |
private var _direction:String; | |
public var spaceWidth:Number = 0; | |
public var spaceHeight:Number = 0; | |
private var _numHorizontal:int = 0; | |
private var _lockWidth:int; | |
private var _defaultIndex:int = 0; | |
private var _selectedIndex:int = -1; | |
private var _adaptLabel:Boolean; | |
public function NewTabBar(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData=null, _arg4:BitmapData=null){ | |
this._stateNormal = _arg1.clone(); | |
this._stateHover = _arg3; | |
this._stateDown = _arg2; | |
this._stateDisabled = _arg4; | |
this.init(); | |
} | |
public function set adaptLabel(_arg1:Boolean):void{ | |
this._adaptLabel = _arg1; | |
} | |
public function get labelField():String{ | |
return (this._labelField); | |
} | |
public function set labelField(_arg1:String):void{ | |
if (this._labelField != _arg1){ | |
this._labelField = _arg1; | |
}; | |
} | |
public function get enabled():Boolean{ | |
return (this._enabled); | |
} | |
public function set enabled(_arg1:Boolean):void{ | |
this._enabled = _arg1; | |
var _local2:int = this._buttons.length; | |
var _local3:int; | |
while (_local3 < _local2) { | |
if (this._enabled){ | |
this._buttons[_local3].enabled = true; | |
} else { | |
this._buttons[_local3].enabled = false; | |
}; | |
_local3++; | |
}; | |
} | |
public function get defaultIndex():int{ | |
return (this._defaultIndex); | |
} | |
public function set defaultIndex(_arg1:int):void{ | |
if ((((_arg1 >= 0)) && ((_arg1 < this._dataProvider.length)))){ | |
this._defaultIndex = _arg1; | |
}; | |
} | |
public function get selectedIndex():int{ | |
return (this._selectedIndex); | |
} | |
public function set selectedIndex(_arg1:int):void{ | |
var _local2:SimpleStateButton; | |
if ((((_arg1 < 0)) || ((_arg1 >= this._buttons.length)))){ | |
return; | |
}; | |
var _local3:Object = this._dataProvider.getItemAt(_arg1); | |
var _local4:int = this._selectedIndex; | |
dispatchEvent(new TabBarEvent(TabBarEvent.ITEM_CLICK, _local4, _arg1, _local3)); | |
if (this._selectedIndex != _arg1){ | |
if (this._selectedIndex != -1){ | |
_local2 = (this._buttons[this._selectedIndex] as SimpleStateButton); | |
_local2.selected = false; | |
_local2.buttonMode = (_local2.mouseEnabled = (_local2.enabled = true)); | |
}; | |
this._selectedIndex = _arg1; | |
this._defaultIndex = _arg1; | |
if (_arg1 != -1){ | |
_local2 = (this._buttons[_arg1] as SimpleStateButton); | |
_local2.selected = true; | |
_local2.buttonMode = (_local2.mouseEnabled = (_local2.enabled = false)); | |
if (_local2.parent){ | |
_local2.parent.setChildIndex(_local2, (_local2.parent.numChildren - 1)); | |
}; | |
}; | |
dispatchEvent(new TabBarEvent(TabBarEvent.CHANGE, _local4, _arg1, _local3)); | |
}; | |
} | |
public function get selectedItem():Object{ | |
if (this.selectedIndex >= 0){ | |
return (this._dataProvider.getItemAt(this.selectedIndex)); | |
}; | |
return (null); | |
} | |
public function set selectedItem(_arg1:Object):void{ | |
var _local2:int = this._dataProvider.getItemIndex(_arg1); | |
this.selectedIndex = _local2; | |
} | |
private function init():void{ | |
this._direction = TabBarDirection.HORIZONTAL; | |
this._dataProvider = new DataProvider(); | |
this._buttons = []; | |
} | |
public function setDirection(_arg1:String, _arg2:int=0):void{ | |
this._direction = _arg1; | |
if (_arg1 == TabBarDirection.ALTERNATE){ | |
if (_arg2 >= 1){ | |
this._numHorizontal = _arg2; | |
} else { | |
this._direction = TabBarDirection.HORIZONTAL; | |
}; | |
} else { | |
if (_arg1 == TabBarDirection.ALTERNATE_LOCK_WIDTH){ | |
this._lockWidth = _arg2; | |
}; | |
}; | |
} | |
public function addItem(_arg1:Object):void{ | |
this._dataProvider.addItem(_arg1); | |
} | |
public function addItemAt(_arg1:Object, _arg2:int):void{ | |
this._dataProvider.addItemAt(_arg1, _arg2); | |
if (_arg2 <= this._selectedIndex){ | |
this.selectedIndex = (this._selectedIndex + 1); | |
}; | |
} | |
public function addItems(_arg1:Object):void{ | |
this._dataProvider.addItems(_arg1); | |
} | |
public function addItemsAt(_arg1:Object, _arg2:uint):void{ | |
this._dataProvider.addItemsAt(_arg1, _arg2); | |
if (_arg2 <= this._selectedIndex){ | |
this.selectedIndex = (this._selectedIndex + (_arg1 as Array).length); | |
}; | |
} | |
public function removeAll():void{ | |
this._dataProvider.removeAll(); | |
} | |
public function removeItemAt(_arg1:uint):void{ | |
this._dataProvider.removeItemAt(_arg1); | |
if (this._selectedIndex >= this._dataProvider.length){ | |
this.selectedIndex = (this._dataProvider.length - 1); | |
} else { | |
if (_arg1 <= this._selectedIndex){ | |
this.selectedIndex = (this._selectedIndex - 1); | |
} else { | |
this._defaultIndex = this._selectedIndex; | |
}; | |
}; | |
} | |
public function replaceItemAt(_arg1:Object, _arg2:uint):void{ | |
this._dataProvider.replaceItemAt(_arg1, _arg2); | |
} | |
override public function setStyle(_arg1:String, _arg2:Object):void{ | |
_styles[_arg1] = _arg2; | |
switch (_arg1){ | |
case "textFormat": | |
this._textFormat = (_arg2 as TextFormat); | |
this.updateSkin("textFormat", this._textFormat); | |
break; | |
case "upSkin": | |
this._stateNormal = getSkinBitmapData(_arg2); | |
this.updateSkin("upSkin", this._stateNormal); | |
this.realign(); | |
break; | |
case "overSkin": | |
this._stateHover = getSkinBitmapData(_arg2); | |
this.updateSkin("overSkin", this._stateHover); | |
this.realign(); | |
break; | |
case "downSkin": | |
this._stateDown = getSkinBitmapData(_arg2); | |
this.updateSkin("downSkin", this._stateDown); | |
this.realign(); | |
break; | |
case "disabledSkin": | |
this._stateDisabled = getSkinBitmapData(_arg2); | |
this.updateSkin("disabledSkin", this._stateDisabled); | |
this.realign(); | |
break; | |
case "disabledTextFormat": | |
this.updateSkin("disabledTextFormat", _arg2); | |
break; | |
case "selectedColor": | |
this.updateSkin("selectedColor", _arg2); | |
break; | |
case "firstTabStyle": | |
this._firstTabStyle = _arg2; | |
this.firstTabUpdate(_arg2); | |
break; | |
case "lastTabStyle": | |
this._lastTabStyle = _arg2; | |
this.lastTabUpdate(_arg2); | |
break; | |
}; | |
} | |
public function update():void{ | |
var _local5:SimpleStateButton; | |
var _local6:Object; | |
var _local7:*; | |
var _local8:String; | |
var _local1:int = this._buttons.length; | |
var _local2:int = (_local1 - 1); | |
while (_local2 > -1) { | |
this._buttons[_local2].removeEventListener(MouseEvent.CLICK, this.tabItemClickedHandler); | |
this.removeChildAt(_local2); | |
this._buttons[_local2] = null; | |
_local2--; | |
}; | |
this._buttons.length = 0; | |
var _local3:int = this._dataProvider.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
_local5 = new SimpleStateButton(this._stateNormal, this._stateHover, this._stateDown, this._stateDisabled); | |
_local5.adaptLabel = this._adaptLabel; | |
_local6 = this._dataProvider.getItemAt(_local4); | |
if (_local6.hasOwnProperty(this.labelField)){ | |
_local5.label = this.itemToLabel(_local6); | |
}; | |
_local5.selected = (_local4 == this._selectedIndex); | |
_local5.enabled = this._enabled; | |
_local5.buttonMode = this.buttonMode; | |
_local5.useHandCursor = this.useHandCursor; | |
for (_local8 in _styles) { | |
_local7 = _styles[_local8]; | |
_local5.setStyle(_local8, _local7); | |
}; | |
_local5.addEventListener(MouseEvent.CLICK, this.tabItemClickedHandler); | |
this._buttons.push(_local5); | |
addChild(_local5); | |
_local4++; | |
}; | |
this.realign(); | |
this.selectedIndex = this._defaultIndex; | |
} | |
private function realign():void{ | |
var _local2:SimpleStateButton; | |
var _local4:int; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
var _local8:int; | |
var _local9:int; | |
var _local10:SimpleStateButton; | |
var _local11:Boolean; | |
var _local1:int = this._buttons.length; | |
var _local3:int; | |
while (_local3 < _local1) { | |
_local2 = this._buttons[_local3]; | |
if (_local3 > 0){ | |
_local10 = (this._buttons[(_local3 - 1)] as SimpleStateButton); | |
_local4 = _local10.width; | |
_local5 = _local10.x; | |
_local6 = this.spaceWidth; | |
_local7 = _local10.height; | |
_local8 = _local10.y; | |
_local9 = this.spaceHeight; | |
}; | |
if (this._direction == TabBarDirection.HORIZONTAL){ | |
_local2.x = (((_local5 + _local4) + _local6) >> 0); | |
_local2.y = 0; | |
} else { | |
if (this._direction == TabBarDirection.VERTICAL){ | |
_local2.x = 0; | |
_local2.y = (((_local8 + _local7) + _local9) >> 0); | |
} else { | |
if (this._direction == TabBarDirection.ALTERNATE){ | |
_local2.x = ((((_local3 % this._numHorizontal) == 0)) ? 0 : ((_local5 + _local4) + _local6) >> 0); | |
_local2.y = (((_local2.height + this.spaceHeight) * Math.floor((_local3 / this._numHorizontal))) >> 0); | |
} else { | |
if (this._direction == TabBarDirection.ALTERNATE_LOCK_WIDTH){ | |
_local11 = ((this._lockWidth - ((_local5 + _local4) + this.spaceWidth)) >= _local2.width); | |
_local2.x = (_local11) ? ((_local5 + _local4) + _local6) : 0; | |
_local2.y = (_local11) ? _local8 : ((_local8 + _local7) + _local9); | |
}; | |
}; | |
}; | |
}; | |
_local3++; | |
}; | |
} | |
private function itemToIndex(_arg1:Object):int{ | |
return (this._dataProvider.getItemIndex(_arg1)); | |
} | |
private function itemToLabel(_arg1:Object):String{ | |
if (this._labelFunction != null){ | |
this._labelFunction(_arg1, this.itemToIndex(_arg1)); | |
} else { | |
if (((this.labelField) && (_arg1.hasOwnProperty(this.labelField)))){ | |
return (_arg1[this.labelField]); | |
}; | |
}; | |
return (""); | |
} | |
private function updateSkin(_arg1:String, _arg2:Object):void{ | |
var _local3:int = this._buttons.length; | |
var _local4:int; | |
while (_local4 < _local3) { | |
this._buttons[_local4].setStyle(_arg1, _arg2); | |
_local4++; | |
}; | |
} | |
private function firstTabUpdate(_arg1:Object):void{ | |
var _local2:SimpleStateButton; | |
var _local3:String; | |
if (((this._buttons) && ((this._buttons.length > 0)))){ | |
_local2 = (this._buttons[0] as SimpleStateButton); | |
for (_local3 in _arg1) { | |
_local2.setStyle(_local3, _arg1[_local3]); | |
}; | |
this.realign(); | |
}; | |
} | |
private function lastTabUpdate(_arg1:Object):void{ | |
var _local2:SimpleStateButton; | |
var _local3:String; | |
if (((this._buttons) && ((this._buttons.length > 1)))){ | |
_local2 = (this._buttons[(this._buttons.length - 1)] as SimpleStateButton); | |
for (_local3 in _arg1) { | |
_local2.setStyle(_local3, _arg1[_local3]); | |
}; | |
this.realign(); | |
}; | |
} | |
private function tabItemClickedHandler(_arg1:MouseEvent):void{ | |
var _local2:SimpleStateButton = (_arg1.target as SimpleStateButton); | |
var _local3:int = this._buttons.indexOf(_local2); | |
this.selectedIndex = _local3; | |
} | |
} | |
}//package com.meitu.controls | |
package com.meitu.net { | |
public class FilePath { | |
public const regex:RegExp; | |
public var separator:String; | |
public var drive:String; | |
public var paths:Array; | |
public var filename:String; | |
public var extension:String; | |
public function FilePath(_arg1:String){ | |
this.regex = /^((\w)?:)?([^.]+)?(\.(\w+)?)?/; | |
super(); | |
this.separator = ((_arg1.indexOf("\\"))!=-1) ? "\\" : "/"; | |
var _local2:Array = this.regex.exec(_arg1); | |
this.drive = _local2[2]; | |
this.paths = (_local2[3] as String).split(this.separator); | |
if (this.paths[0] == ""){ | |
this.paths.shift(); | |
}; | |
this.filename = this.paths.pop(); | |
this.extension = _local2[5]; | |
} | |
public function toString():String{ | |
var _local1 = ""; | |
if (this.drive){ | |
_local1 = (_local1 + ((this.drive + ":") + this.separator)); | |
}; | |
if (((this.paths) && ((this.paths.length > 0)))){ | |
_local1 = (_local1 + (this.paths.join(this.separator) + this.separator)); | |
}; | |
if (this.filename){ | |
_local1 = (_local1 + this.filename); | |
}; | |
if (this.extension){ | |
_local1 = (_local1 + ("." + this.extension)); | |
}; | |
return (_local1); | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.net.*; | |
import flash.external.*; | |
public class QueryString { | |
private static var _pageURL:String; | |
public static function set pageURL(_arg1:String):void{ | |
_pageURL = _arg1; | |
} | |
public static function get pageURL():String{ | |
return (((_pageURL) || (getPageURL()))); | |
} | |
public static function getPageURL():String{ | |
var pageurl:* = null; | |
if (ExternalInterface.available){ | |
try { | |
pageurl = JSCaller.call("eval", "window.location.href"); | |
if (pageurl != null){ | |
return (pageurl); | |
}; | |
return (""); | |
} catch(e:Error) { | |
return (""); | |
}; | |
}; | |
return (""); | |
} | |
public static function parseValues(_arg1:String):Object{ | |
var param:* = null; | |
var source:* = null; | |
var urlVariables:* = null; | |
var key:* = null; | |
var params:* = null; | |
var num:* = 0; | |
var item:* = null; | |
var value:* = null; | |
var delimiterIndex:* = 0; | |
var i:* = 0; | |
var pageURL:* = _arg1; | |
if ((((((pageURL == "")) || ((pageURL == null)))) || ((pageURL.indexOf("?") == -1)))){ | |
return (null); | |
}; | |
param = {}; | |
source = pageURL.substr((pageURL.indexOf("?") + 1)); | |
try { | |
urlVariables = new URLVariables(source); | |
for (key in urlVariables) { | |
param[key] = urlVariables[key]; | |
}; | |
} catch(error:Error) { | |
params = source.split("&"); | |
num = params.length; | |
i = 0; | |
while (i < num) { | |
item = params[i]; | |
delimiterIndex = item.indexOf("="); | |
key = ((delimiterIndex == -1)) ? item : item.substr(0, delimiterIndex); | |
value = ((delimiterIndex == -1)) ? "" : item.substr((delimiterIndex + 1)); | |
param[key] = value; | |
i = (i + 1); | |
}; | |
}; | |
return (param); | |
} | |
public static function getValue(_arg1:String):String{ | |
var _local2:Object = parseValues(pageURL); | |
return ((_local2) ? ((_local2[_arg1]) || ("")) : ""); | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.display.*; | |
public interface IGoogleAnalytics { | |
function init(_arg1:DisplayObject, _arg2:String):void; | |
function trackPageview(_arg1:String):void; | |
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):void; | |
function setVar(_arg1:String):void; | |
function set enabled(_arg1:Boolean):void; | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.utils.*; | |
public class UploadPostHelper { | |
private static var _boundary:String = ""; | |
public static function getBoundary():String{ | |
var _local1:int; | |
if (_boundary.length == 0){ | |
_local1 = 0; | |
while (_local1 < 32) { | |
_boundary = (_boundary + String.fromCharCode(int((97 + (Math.random() * 25))))); | |
_local1++; | |
}; | |
}; | |
return (_boundary); | |
} | |
public static function getPostData(_arg1:String, _arg2:ByteArray, _arg3:Object=null, _arg4:String="Filedata", _arg5:String="application/octet-stream", _arg6:String="filename"):ByteArray{ | |
var _local7:int; | |
var _local8:String; | |
var _local10:String; | |
var _local9:ByteArray = new ByteArray(); | |
_local9.endian = Endian.BIG_ENDIAN; | |
if (_arg3 == null){ | |
_arg3 = new Object(); | |
}; | |
_arg3[_arg6] = _arg1; | |
for (_local10 in _arg3) { | |
_local9 = BOUNDARY(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local8 = (("Content-Disposition: form-data; name=\"" + _local10) + "\""); | |
_local7 = 0; | |
while (_local7 < _local8.length) { | |
_local9.writeByte(_local8.charCodeAt(_local7)); | |
_local7++; | |
}; | |
_local9 = LINEBREAK(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local9.writeUTFBytes(_arg3[_local10]); | |
_local9 = LINEBREAK(_local9); | |
}; | |
_local9 = BOUNDARY(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local8 = (((("Content-Disposition: form-data; name=\"" + _arg4) + "\"; ") + _arg6) + "=\""); | |
_local7 = 0; | |
while (_local7 < _local8.length) { | |
_local9.writeByte(_local8.charCodeAt(_local7)); | |
_local7++; | |
}; | |
_local9.writeUTFBytes(_arg1); | |
_local9 = QUOTATIONMARK(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local8 = ("Content-Type: " + _arg5); | |
_local7 = 0; | |
while (_local7 < _local8.length) { | |
_local9.writeByte(_local8.charCodeAt(_local7)); | |
_local7++; | |
}; | |
_local9 = LINEBREAK(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local9.writeBytes(_arg2, 0, _arg2.length); | |
_local9 = LINEBREAK(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local9 = BOUNDARY(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local8 = "Content-Disposition: form-data; name=\"Upload\""; | |
_local7 = 0; | |
while (_local7 < _local8.length) { | |
_local9.writeByte(_local8.charCodeAt(_local7)); | |
_local7++; | |
}; | |
_local9 = LINEBREAK(_local9); | |
_local9 = LINEBREAK(_local9); | |
_local8 = "Submit Query"; | |
_local7 = 0; | |
while (_local7 < _local8.length) { | |
_local9.writeByte(_local8.charCodeAt(_local7)); | |
_local7++; | |
}; | |
_local9 = LINEBREAK(_local9); | |
_local9 = BOUNDARY(_local9); | |
_local9 = DOUBLEDASH(_local9); | |
return (_local9); | |
} | |
private static function BOUNDARY(_arg1:ByteArray):ByteArray{ | |
var _local2:int = UploadPostHelper.getBoundary().length; | |
_arg1 = DOUBLEDASH(_arg1); | |
var _local3:int; | |
while (_local3 < _local2) { | |
_arg1.writeByte(_boundary.charCodeAt(_local3)); | |
_local3++; | |
}; | |
return (_arg1); | |
} | |
private static function LINEBREAK(_arg1:ByteArray):ByteArray{ | |
_arg1.writeShort(3338); | |
return (_arg1); | |
} | |
private static function QUOTATIONMARK(_arg1:ByteArray):ByteArray{ | |
_arg1.writeByte(34); | |
return (_arg1); | |
} | |
private static function DOUBLEDASH(_arg1:ByteArray):ByteArray{ | |
_arg1.writeShort(0x2D2D); | |
return (_arg1); | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.display.*; | |
import com.google.analytics.core.*; | |
import com.google.analytics.*; | |
import flash.external.*; | |
public class GoogleAnalytics implements IGoogleAnalytics { | |
private var _enabled:Boolean = true; | |
private var _tracker:GATracker; | |
public function set enabled(_arg1:Boolean):void{ | |
this._enabled = _arg1; | |
} | |
public function init(_arg1:DisplayObject, _arg2:String):void{ | |
if (((JSCaller.secureMode) && (!(JSCaller.objectIDSecure)))){ | |
return; | |
}; | |
try { | |
this._tracker = new GATracker(_arg1, _arg2, TrackerMode.AS3); | |
} catch(error:Error) { | |
}; | |
} | |
public function trackPageview(_arg1:String):void{ | |
if (((((!(this._tracker)) || (!(ExternalInterface.available)))) || (!(_arg1)))){ | |
return; | |
}; | |
try { | |
this._tracker.trackPageview(_arg1); | |
} catch(error:Error) { | |
}; | |
} | |
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):void{ | |
if (((((((!(this._tracker)) || (!(ExternalInterface.available)))) || (!(_arg1)))) || (!(_arg2)))){ | |
return; | |
}; | |
try { | |
this._tracker.trackEvent(_arg1, _arg2, _arg3, _arg4); | |
} catch(error:Error) { | |
}; | |
} | |
public function setVar(_arg1:String):void{ | |
if (((((!(this._tracker)) || (!(ExternalInterface.available)))) || (!(_arg1)))){ | |
return; | |
}; | |
try { | |
this._tracker.setVar(_arg1); | |
} catch(error:Error) { | |
}; | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.utils.*; | |
public final class FileTypeCheck { | |
private static var _fileData:ByteArray; | |
public static function isBMP(_arg1:ByteArray):Boolean{ | |
_arg1.position = 0; | |
if (_arg1.bytesAvailable < 2){ | |
return (false); | |
}; | |
return ((_arg1.readUTFBytes(2).toLocaleUpperCase() == "BM")); | |
} | |
public static function isFLV(_arg1:ByteArray):Boolean{ | |
_arg1.position = 0; | |
if (_arg1.bytesAvailable < 3){ | |
return (false); | |
}; | |
return ((_arg1.readUTFBytes(3).toLocaleUpperCase() == "FLV")); | |
} | |
public static function isPNG(_arg1:ByteArray):Boolean{ | |
_fileData = _arg1; | |
_fileData.position = 0; | |
if (_fileData.bytesAvailable < 8){ | |
return (false); | |
}; | |
var _local2:Array = [137, 80, 78, 71, 13, 10, 26, 10]; | |
return (_local2.every(everyCallBack)); | |
} | |
public static function isGIF(_arg1:ByteArray):Boolean{ | |
_fileData = _arg1; | |
_fileData.position = 0; | |
if (_fileData.bytesAvailable < 6){ | |
return (false); | |
}; | |
var _local2:Array = [71, 73, 70, 56, 57, 97]; | |
var _local3:Array = [71, 73, 70, 56, 55, 97]; | |
var _local4:Boolean = _local2.every(everyCallBack); | |
var _local5:Boolean = _local3.every(everyCallBack); | |
return (((_local4) || (_local5))); | |
} | |
public static function isJPEG(_arg1:ByteArray):Boolean{ | |
_fileData = _arg1; | |
_fileData.position = 0; | |
if (_fileData.bytesAvailable < 2){ | |
return (false); | |
}; | |
var _local2:Array = [0xFF, 216]; | |
return (_local2.every(everyCallBack)); | |
} | |
public static function isTGA(_arg1:ByteArray):Boolean{ | |
_fileData = _arg1; | |
_fileData.position = 0; | |
if (_fileData.bytesAvailable < 5){ | |
return (false); | |
}; | |
var _local2:Array = [0, 0, 2, 0, 0]; | |
var _local3:Array = [0, 0, 16, 0, 0]; | |
var _local4:Boolean = _local2.every(everyCallBack); | |
var _local5:Boolean = _local3.every(everyCallBack); | |
return (((_local4) || (_local5))); | |
} | |
public static function isPCX(_arg1:ByteArray):Boolean{ | |
return (false); | |
} | |
public static function isTIFF(_arg1:ByteArray):Boolean{ | |
return (false); | |
} | |
public static function isICO(_arg1:ByteArray):Boolean{ | |
return (false); | |
} | |
public static function isCUR(_arg1:ByteArray):Boolean{ | |
return (false); | |
} | |
public static function isIFF(_arg1:ByteArray):Boolean{ | |
return (false); | |
} | |
public static function isANI(_arg1:ByteArray):Boolean{ | |
return (false); | |
} | |
private static function everyCallBack(_arg1:int, _arg2:int, _arg3:Array):Boolean{ | |
return ((_fileData[_arg2] == _arg1)); | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.utils.*; | |
import flash.net.*; | |
import flash.events.*; | |
import com.meitu.events.*; | |
import com.meitu.display.*; | |
import com.meitu.display.image.*; | |
import com.meitu.data.*; | |
import flash.errors.*; | |
public class FileBrower extends EventDispatcher { | |
private static var _instance:FileBrower; | |
private var _status:String; | |
private var _fileReferenceList:FileReferenceList; | |
private var _fileReference:FileReference; | |
private var _BMPDecoder:BMPDecoder; | |
public var datas:Array; | |
public var bitmaps:Array; | |
private var _bitmapBytes:Array; | |
public var fileNames:Array; | |
private var _bitmapFileFilter:FileFilter; | |
private var _bitmapFileFlag:Array; | |
private var _formatErrorFiles:Array; | |
private var _sizeOverproofFiles:Array; | |
private var _imageCompleteFun:Function; | |
private var _args:Object; | |
private var _maxFileSize:uint; | |
private var _numTotalFile:int; | |
private var _numLoadedFile:int; | |
private var _numTotalBitmapFile:int; | |
private var _numLoadedBitmapFile:int; | |
public function FileBrower(_arg1:PrivateClass){ | |
this.datas = []; | |
this.bitmaps = []; | |
this._bitmapBytes = []; | |
this.fileNames = []; | |
this._bitmapFileFilter = new FileFilter("(*.jpg,*.jpeg,*.gif,*.png,*.bmp)", "*.jpg;*.jpeg;*.gif;*.png;*.bmp;"); | |
this._bitmapFileFlag = []; | |
this._formatErrorFiles = []; | |
this._sizeOverproofFiles = []; | |
super(); | |
this._fileReferenceList = new FileReferenceList(); | |
this._fileReferenceList.addEventListener(Event.SELECT, this.fileReferenceListSelectHandler); | |
this._fileReferenceList.addEventListener(Event.CANCEL, this.fileReferenceListCancelHandler); | |
} | |
public static function getInstance():FileBrower{ | |
if (_instance == null){ | |
_instance = new FileBrower(new PrivateClass()); | |
}; | |
return (_instance); | |
} | |
public function get bitmapBytes():Array{ | |
return (this._bitmapBytes.concat()); | |
} | |
public function get maxFileSize():uint{ | |
return (this._maxFileSize); | |
} | |
public function set maxFileSize(_arg1:uint):void{ | |
this._maxFileSize = _arg1; | |
} | |
public function browse(_arg1:Array=null, _arg2:Function=null, _arg3:Boolean=false, _arg4:Object=null):void{ | |
var typeFilter = _arg1; | |
var imageCompleteFun = _arg2; | |
var multipleSelection:Boolean = _arg3; | |
var args = _arg4; | |
this._imageCompleteFun = imageCompleteFun; | |
this._args = args; | |
if (multipleSelection){ | |
try { | |
this._status = "load"; | |
this._fileReferenceList.browse(typeFilter); | |
} catch(error:IllegalOperationError) { | |
this.dispatchEvent(new FileBrowserErrorEvent(FileBrowserErrorEvent.ILLEGAL_OPERATION, error.errorID, "load_multi")); | |
}; | |
} else { | |
if (!this._fileReference){ | |
this._fileReference = new FileReference(); | |
this._fileReference.addEventListener(Event.SELECT, this.fileReferenceSelectHandler); | |
this._fileReference.addEventListener(Event.CANCEL, this.fileReferenceCancelHandler); | |
this._fileReference.addEventListener(Event.COMPLETE, this.fileReferenceCompleteHandler); | |
}; | |
try { | |
this._status = "load"; | |
this._fileReference.cancel(); | |
this._fileReference.browse(typeFilter); | |
} catch(error:IllegalOperationError) { | |
this.dispatchEvent(new FileBrowserErrorEvent(FileBrowserErrorEvent.ILLEGAL_OPERATION, error.errorID, "load_single")); | |
}; | |
}; | |
} | |
public function save(_arg1:ByteArray, _arg2:String=null):void{ | |
var datas:* = _arg1; | |
var defaultFileName = _arg2; | |
if (!this._fileReference){ | |
this._fileReference = new FileReference(); | |
this._fileReference.addEventListener(Event.SELECT, this.fileReferenceSelectHandler); | |
this._fileReference.addEventListener(Event.COMPLETE, this.fileReferenceCompleteHandler); | |
}; | |
try { | |
this._status = "save"; | |
this._fileReference.cancel(); | |
this._fileReference.save(datas, defaultFileName); | |
} catch(error:IllegalOperationError) { | |
this.dispatchEvent(new FileBrowserErrorEvent(FileBrowserErrorEvent.ILLEGAL_OPERATION, error.errorID, _status)); | |
}; | |
} | |
private function pushImage(_arg1:Bitmap, _arg2:int=0):void{ | |
var _local3:int; | |
if (_arg1){ | |
this.bitmaps[_arg2] = _arg1; | |
}; | |
if (this._numLoadedBitmapFile == this._numTotalBitmapFile){ | |
_local3 = (this.bitmaps.length - 1); | |
while (_local3 > -1) { | |
if (!this.bitmaps[_local3]){ | |
this.bitmaps.splice(_local3, 1); | |
}; | |
_local3--; | |
}; | |
if (this.bitmaps.length){ | |
if (this._imageCompleteFun != null){ | |
this._imageCompleteFun(this._args); | |
this._imageCompleteFun = null; | |
} else { | |
this.dispatchEvent(new FileBrowerEvent(FileBrowerEvent.IMAGE_COMPLETE)); | |
}; | |
} else { | |
this.dispatchEvent(new FileBrowserErrorEvent(FileBrowserErrorEvent.IMAGE_FORMAT_ERROR)); | |
}; | |
}; | |
} | |
private function fileReferenceListCancelHandler(_arg1:Event):void{ | |
this.dispatchEvent(_arg1); | |
} | |
private function fileReferenceCancelHandler(_arg1:Event):void{ | |
this.dispatchEvent(_arg1); | |
} | |
private function fileReferenceListSelectHandler(_arg1:Event):void{ | |
var _local3:FileReference; | |
var _local2:Array = _arg1.currentTarget.fileList; | |
this._numLoadedFile = 0; | |
this._numTotalFile = _local2.length; | |
this._numLoadedBitmapFile = 0; | |
this._numTotalBitmapFile = 0; | |
this._bitmapFileFlag.length = 0; | |
this.datas.length = 0; | |
this.fileNames.length = 0; | |
this.bitmaps.length = 0; | |
this._bitmapBytes.length = 0; | |
this._formatErrorFiles.length = 0; | |
this._sizeOverproofFiles.length = 0; | |
var _local4:int; | |
while (_local4 < this._numTotalFile) { | |
_local3 = (_local2[_local4] as FileReference); | |
_local3.addEventListener(Event.COMPLETE, FunctionUtil.eventDelegate(this.fileReferenceCompleteHandler, _local4)); | |
_local3.load(); | |
this._status = "load"; | |
if ((((this._maxFileSize > 0)) && ((_local3.size > this._maxFileSize)))){ | |
this._sizeOverproofFiles.push(_local3); | |
}; | |
_local4++; | |
}; | |
} | |
private function fileReferenceSelectHandler(_arg1:Event):void{ | |
if (this._status != "save"){ | |
this._numLoadedFile = 0; | |
this._numTotalFile = 1; | |
this._numLoadedBitmapFile = 0; | |
this._numTotalBitmapFile = 0; | |
this._bitmapFileFlag.length = 0; | |
this.datas.length = 0; | |
this.fileNames.length = 0; | |
this.bitmaps.length = 0; | |
this._bitmapBytes.length = 0; | |
this._formatErrorFiles.length = 0; | |
this._sizeOverproofFiles.length = 0; | |
this._fileReference.load(); | |
this._status = "load"; | |
if ((((this._maxFileSize > 0)) && ((this._fileReference.size > this._maxFileSize)))){ | |
this._sizeOverproofFiles.push(this._fileReference); | |
}; | |
}; | |
} | |
private function fileReferenceCompleteHandler(_arg1:Event, _arg2:int=0):void{ | |
var _local4:Boolean; | |
var _local5:Boolean; | |
var _local6:Boolean; | |
var _local7:Boolean; | |
var _local8:FileBrowerEvent; | |
var _local3:FileReference = (_arg1.currentTarget as FileReference); | |
if (this._status == "load"){ | |
_local4 = FileTypeCheck.isJPEG(_local3.data); | |
_local5 = FileTypeCheck.isPNG(_local3.data); | |
_local6 = FileTypeCheck.isGIF(_local3.data); | |
_local7 = FileTypeCheck.isBMP(_local3.data); | |
if (((((((_local4) || (_local5))) || (_local6))) || (_local7))){ | |
this._bitmapFileFlag.push({ | |
selectedIndex:_arg2, | |
imageIndex:this.datas.length, | |
isBMP:_local7 | |
}); | |
this._bitmapBytes.push(_local3.data); | |
this._numTotalBitmapFile++; | |
} else { | |
this._formatErrorFiles.push(_local3.data); | |
}; | |
this.datas.push(_local3.data); | |
this.fileNames.push(_local3.name); | |
this._numLoadedFile++; | |
if (this._numLoadedFile == this._numTotalFile){ | |
if (this._bitmapFileFlag.length > 1){ | |
this._bitmapFileFlag.sort(this.selectedIndexSort); | |
}; | |
this.loadImage(); | |
this.dispatchEvent(_arg1); | |
if (this._formatErrorFiles.length > 0){ | |
this.dispatchEvent(new FileBrowserErrorEvent(FileBrowserErrorEvent.IMAGE_FORMAT_ERROR)); | |
}; | |
if (this._sizeOverproofFiles.length > 0){ | |
this.dispatchEvent(new FileBrowserErrorEvent(FileBrowserErrorEvent.FILE_OVERPROOF)); | |
}; | |
}; | |
} else { | |
if (this._status == "save"){ | |
_local8 = new FileBrowerEvent(FileBrowerEvent.SAVE_COMPLETE); | |
_local8.fileName = _local3.name; | |
this.dispatchEvent(_local8); | |
}; | |
}; | |
} | |
private function selectedIndexSort(_arg1:Object, _arg2:Object):Number{ | |
return (((_arg1.selectedIndex)<_arg2.selectedIndex) ? -1 : 1); | |
} | |
private function loadImage():void{ | |
var isBMP:* = false; | |
var byteArray:* = null; | |
var bitmapData:* = null; | |
var image:* = null; | |
var loader:* = null; | |
var numTotalBitmapFile:* = this._bitmapFileFlag.length; | |
var i:* = 0; | |
while (i < numTotalBitmapFile) { | |
isBMP = this._bitmapFileFlag[i]["isBMP"]; | |
byteArray = this.datas[this._bitmapFileFlag[i]["imageIndex"]]; | |
if (isBMP){ | |
if (!this._BMPDecoder){ | |
this._BMPDecoder = new BMPDecoder(); | |
}; | |
try { | |
bitmapData = this._BMPDecoder.decode(byteArray); | |
} catch(error:Error) { | |
_formatErrorFiles.push(byteArray); | |
}; | |
this._numLoadedBitmapFile++; | |
if (bitmapData){ | |
image = new Bitmap(bitmapData, "auto", true); | |
this.pushImage(image, i); | |
}; | |
} else { | |
loader = new Loader(); | |
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, FunctionUtil.eventDelegate(this.imageLoadedCompleteHandler, i)); | |
loader.loadBytes(byteArray); | |
}; | |
i = (i + 1); | |
}; | |
} | |
private function imageLoadedCompleteHandler(_arg1:Event, _arg2:int=0):void{ | |
var _local5:Object; | |
var _local6:Boolean; | |
var _local7:Number; | |
var _local8:Matrix; | |
var _local9:BitmapData; | |
this._numLoadedBitmapFile++; | |
_arg1.currentTarget.removeEventListener(Event.COMPLETE, this.imageLoadedCompleteHandler); | |
var _local3:Bitmap = (_arg1.currentTarget.content as Bitmap); | |
_local3.smoothing = true; | |
var _local4:Boolean = BitmapDataUtil.legalSize(_local3.width, _local3.height); | |
if (_local4){ | |
this.pushImage(_local3, _arg2); | |
} else { | |
if ((((_local3.width == 0)) || ((_local3.height == 0)))){ | |
this.pushImage(null, _arg2); | |
} else { | |
_local5 = BitmapDataUtil.getLegalSize(_local3.width, _local3.height); | |
if (_local5){ | |
_local6 = true; | |
try { | |
_local6 = _local3.bitmapData.transparent; | |
} catch(error:Error) { | |
}; | |
_local7 = (_local5.width / _local3.width); | |
_local8 = new Matrix(); | |
_local8.scale(_local7, _local7); | |
_local9 = (_local6) ? new BitmapData(_local5.width, _local5.height, true, 0) : new BitmapData(_local5.width, _local5.height, false); | |
_local9.draw(_local3, _local8); | |
this.pushImage(new Bitmap(_local9, "auto", true), _arg2); | |
} else { | |
this.pushImage(null, _arg2); | |
}; | |
}; | |
}; | |
} | |
} | |
}//package com.meitu.net | |
class PrivateClass { | |
public function PrivateClass(){ | |
} | |
} | |
package com.meitu.net { | |
import flash.external.*; | |
public final class JSCaller { | |
private static var _secureMode:Boolean = false; | |
public static function addCallback(_arg1:String, _arg2:Function):void{ | |
if (ExternalInterface.available){ | |
if (((!(secureMode)) || (((secureMode) && (objectIDSecure))))){ | |
ExternalInterface.addCallback(_arg1, _arg2); | |
}; | |
}; | |
} | |
public static function call(_arg1:String, ... _args){ | |
if (ExternalInterface.available){ | |
if (((!(secureMode)) || (((secureMode) && (objectIDSecure))))){ | |
_args.unshift(_arg1); | |
return (ExternalInterface.call.apply(ExternalInterface, _args)); | |
}; | |
}; | |
return (null); | |
} | |
public static function set secureMode(_arg1:Boolean):void{ | |
_secureMode = _arg1; | |
} | |
public static function get secureMode():Boolean{ | |
return (_secureMode); | |
} | |
public static function get objectID():String{ | |
return ((ExternalInterface.available) ? ExternalInterface.objectID : null); | |
} | |
public static function get objectIDSecure():Boolean{ | |
var _local1:Boolean; | |
if (((!(objectID)) || ((objectID == objectID.replace(/[^0-9a-zA-Z_]/g, ""))))){ | |
return (true); | |
}; | |
return (false); | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.net.*; | |
public class URL { | |
public static const regex:RegExp = /^((\w+):\/{2,3})?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/; | |
public var protocol:String; | |
public var host:String; | |
public var port:int; | |
public var pathname:FilePath; | |
public var username:String; | |
public var password:String; | |
public var queryString:URLVariables; | |
public var fragment:String; | |
public function URL(_arg1:String, _arg2:Boolean=true){ | |
if (!_arg1){ | |
_arg1 = ""; | |
}; | |
var _local3:Array = regex.exec(_arg1); | |
if (!_local3){ | |
return; | |
}; | |
this.protocol = _local3[2]; | |
this.username = _local3[4]; | |
this.password = _local3[5]; | |
this.host = _local3[6]; | |
this.port = _local3[7]; | |
this.pathname = (_local3[8]) ? new FilePath(_local3[8]) : null; | |
try { | |
this.queryString = (_local3[9]) ? new URLVariables(_local3[9]) : null; | |
} catch(error:Error) { | |
}; | |
this.fragment = _local3[10]; | |
if (((((_arg2) && (!(this.pathname)))) && (this.host))){ | |
this.pathname = new FilePath(this.host); | |
this.host = null; | |
}; | |
} | |
public static function isHTTP(_arg1:String):Boolean{ | |
return ((_arg1.substr(0, 7).toLowerCase() == "http://")); | |
} | |
public static function URLParse(_arg1:String, _arg2:Boolean=true):Object{ | |
var _local10:URLVariables; | |
if ((((_arg1 == null)) || ((_arg1 == "")))){ | |
return (null); | |
}; | |
var _local3:Array = regex.exec(_arg1); | |
var _local4:String = _local3[2]; | |
var _local5:String = _local3[4]; | |
var _local6:String = _local3[5]; | |
var _local7:String = _local3[6]; | |
var _local8:int = _local3[7]; | |
var _local9:String = (_local3[8]) ? new FilePath(_local3[8]).toString() : null; | |
try { | |
_local10 = (_local3[9]) ? new URLVariables(_local3[9]) : null; | |
} catch(error:Error) { | |
}; | |
var _local11:String = _local3[10]; | |
if (((((_arg2) && (!(_local9)))) && (_local7))){ | |
_local9 = new FilePath(_local7).toString(); | |
_local7 = null; | |
}; | |
var _local12:Object = { | |
protocol:_local4, | |
host:_local7, | |
port:_local8, | |
pathname:_local9, | |
queryString:_local10, | |
fragment:_local11, | |
username:_local5, | |
password:_local6 | |
}; | |
return (_local12); | |
} | |
public function toString():String{ | |
var _local1 = ""; | |
if (this.protocol){ | |
_local1 = (_local1 + (this.protocol + "://")); | |
if (this.protocol == "file"){ | |
_local1 = (_local1 + "/"); | |
}; | |
}; | |
if (((this.username) && (this.password))){ | |
_local1 = (_local1 + (((this.username + ":") + this.password) + "@")); | |
}; | |
if (this.host){ | |
_local1 = (_local1 + this.host); | |
if (this.protocol == "file"){ | |
_local1 = (_local1 + ":"); | |
}; | |
}; | |
if (this.port){ | |
_local1 = (_local1 + (":" + this.port.toString())); | |
}; | |
if (this.pathname){ | |
_local1 = (_local1 + ("/" + this.pathname.toString())); | |
}; | |
if (this.queryString){ | |
_local1 = (_local1 + ("?" + this.queryString.toString())); | |
}; | |
if (this.fragment){ | |
_local1 = (_local1 + ("#" + this.fragment)); | |
}; | |
return (_local1); | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.net { | |
import flash.display.*; | |
import flash.net.*; | |
import flash.events.*; | |
import flash.text.*; | |
import flash.system.*; | |
import flash.media.*; | |
public class SWFLibrary extends EventDispatcher { | |
private var _libraryURL:String; | |
private var _loaded:Boolean; | |
private var _loading:Boolean; | |
private var _request:URLRequest; | |
private var _loader:Loader; | |
private var _loaderContext:LoaderContext; | |
public var loaderInfo:LoaderInfo; | |
public function SWFLibrary(_arg1:uint=0, _arg2:SecurityDomain=null){ | |
this._request = new URLRequest(); | |
this._loader = new Loader(); | |
this._loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.loadCompleteHandler); | |
this._loader.contentLoaderInfo.addEventListener(Event.INIT, this.loadInitHandler); | |
this._loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.loadErrorHandler); | |
this._loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.loadHTTPStatusHandler); | |
this._loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this.loadProgressHandler); | |
this.loaderInfo = this._loader.contentLoaderInfo; | |
this._loaded = false; | |
switch (_arg1){ | |
case 0: | |
this._loaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, _arg2); | |
break; | |
case 1: | |
this._loaderContext = new LoaderContext(false, new ApplicationDomain(ApplicationDomain.currentDomain), _arg2); | |
break; | |
case 2: | |
this._loaderContext = new LoaderContext(false, new ApplicationDomain(null)); | |
break; | |
case 3: | |
this._loaderContext = new LoaderContext(false, new ApplicationDomain(null), SecurityDomain.currentDomain); | |
break; | |
default: | |
this._loaderContext = new LoaderContext(false, new ApplicationDomain(ApplicationDomain.currentDomain.parentDomain.parentDomain)); | |
}; | |
} | |
public function load(_arg1:String):void{ | |
this._loaded = false; | |
this._request.url = _arg1; | |
this._loader.load(this._request, this._loaderContext); | |
this._libraryURL = _arg1; | |
this._loading = true; | |
} | |
public function close():void{ | |
this._loader.close(); | |
this._loading = false; | |
} | |
public function unload():void{ | |
this._loader.unload(); | |
this._loading = false; | |
} | |
public function get content(){ | |
return (this._loader.content); | |
} | |
public function get loaded():Boolean{ | |
return (this._loaded); | |
} | |
public function get loading():Boolean{ | |
return (this._loading); | |
} | |
public function get url():String{ | |
return (this._libraryURL); | |
} | |
public function getSprite(_arg1:String):Sprite{ | |
var _local2:Class = this.getAsset(_arg1); | |
if (_local2){ | |
return (Sprite(new (_local2))); | |
}; | |
return (null); | |
} | |
public function getMovieClip(_arg1:String):MovieClip{ | |
var _local2:Class = this.getAsset(_arg1); | |
if (_local2){ | |
return (MovieClip(new (_local2))); | |
}; | |
return (null); | |
} | |
public function getSound(_arg1:String):Sound{ | |
var _local2:Class = this.getAsset(_arg1); | |
if (_local2){ | |
return (Sound(new (_local2))); | |
}; | |
return (null); | |
} | |
public function getFont(_arg1:String):Font{ | |
var _local2:Class = this.getAsset(_arg1); | |
if (_local2){ | |
return (Font(new (_local2))); | |
}; | |
return (null); | |
} | |
public function getBitmapData(_arg1:String):BitmapData{ | |
var _local2:Class = this.getAsset(_arg1); | |
if (_local2){ | |
return (BitmapData(new _local2(0, 0))); | |
}; | |
return (null); | |
} | |
public function getBitmap(_arg1:String):Bitmap{ | |
var _local2:Class = this.getAsset(_arg1); | |
if (_local2){ | |
return (new Bitmap(BitmapData(new _local2(0, 0)))); | |
}; | |
return (null); | |
} | |
public function getAsset(_arg1:String):Class{ | |
var Asset:* = null; | |
var linkage:* = _arg1; | |
try { | |
Asset = (this.loaderInfo.applicationDomain.getDefinition(linkage) as Class); | |
} catch(error:Error) { | |
return (null); | |
}; | |
return (Asset); | |
} | |
public function hasDefinition(_arg1:String):Boolean{ | |
return (this.loaderInfo.applicationDomain.hasDefinition(_arg1)); | |
} | |
public function dispose():void{ | |
this._loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.loadCompleteHandler); | |
this._loader.contentLoaderInfo.removeEventListener(Event.INIT, this.loadInitHandler); | |
this._loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, this.loadErrorHandler); | |
this._loader.contentLoaderInfo.removeEventListener(HTTPStatusEvent.HTTP_STATUS, this.loadHTTPStatusHandler); | |
this._loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, this.loadProgressHandler); | |
} | |
private function loadCompleteHandler(_arg1:Event):void{ | |
this._loaded = true; | |
this._loading = false; | |
dispatchEvent(_arg1); | |
} | |
private function loadInitHandler(_arg1:Event):void{ | |
dispatchEvent(_arg1); | |
} | |
private function loadOpenHandler(_arg1:Event):void{ | |
this._loading = true; | |
dispatchEvent(_arg1); | |
} | |
private function loadErrorHandler(_arg1:IOErrorEvent):void{ | |
this._loading = false; | |
dispatchEvent(_arg1); | |
} | |
private function loadHTTPStatusHandler(_arg1:HTTPStatusEvent):void{ | |
dispatchEvent(_arg1); | |
} | |
private function loadProgressHandler(_arg1:ProgressEvent):void{ | |
dispatchEvent(_arg1); | |
} | |
} | |
}//package com.meitu.net | |
package com.meitu.effect.mt { | |
import flash.display.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.texture.*; | |
public class ABao_Filter extends ShaderFilter { | |
private static var curveCache:BitmapData; | |
private static var colorBalanceCache:BitmapData; | |
public function ABao_Filter(_arg1:ByteArray){ | |
this.shader = new Shader(_arg1); | |
this.curve = generateCurve(); | |
this.colorBalance = generateColorBalance(); | |
} | |
private static function generateColorBalance():BitmapData{ | |
if (colorBalanceCache){ | |
return (colorBalanceCache); | |
}; | |
var _local1:TCBTexture = new TCBTexture(); | |
_local1.SetParam(0, 0, 0, 20, 0, 0, 0, 0, 0, true); | |
colorBalanceCache = _local1.getTexture(); | |
return (colorBalanceCache); | |
} | |
private static function generateCurve():BitmapData{ | |
if (curveCache){ | |
return (curveCache); | |
}; | |
var _local1:TCurveTexture = new TCurveTexture(); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(128, 143); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelA); | |
_local1.commitCurve(); | |
curveCache = _local1.getTexture(); | |
return (curveCache); | |
} | |
private function set curve(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.curve; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get curve():BitmapData{ | |
return (this.shader.data.curve.input); | |
} | |
private function set colorBalance(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.ColorBalance; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get colorBalance():BitmapData{ | |
return (this.shader.data.ColorBalance.input); | |
} | |
} | |
}//package com.meitu.effect.mt | |
package com.meitu.effect.mt { | |
import flash.display.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.texture.*; | |
public class LightRed_Filter extends ShaderFilter { | |
private static var curveCache:BitmapData; | |
private var _texture:BitmapData; | |
public function LightRed_Filter(_arg1:ByteArray){ | |
this.shader = new Shader(_arg1); | |
this.curve = generateCurve(); | |
} | |
private static function generateCurve():BitmapData{ | |
if (curveCache){ | |
return (curveCache); | |
}; | |
var _local1:TCurveTexture = new TCurveTexture(); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(148, 178); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelA); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(76, 84); | |
_local1.curveMaker.Append(127, 151); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelR); | |
_local1.commitCurve(); | |
curveCache = _local1.getTexture(); | |
return (curveCache); | |
} | |
public function apply(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = new BitmapData(_arg1.width, _arg1.height); | |
var _local3:Bitmap = new Bitmap(_arg1, "auto", true); | |
var _local4:Bitmap = new Bitmap(this._texture, "auto", true); | |
_local4.blendMode = BlendMode.SCREEN; | |
_local4.alpha = 1; | |
_local4.width = _arg1.width; | |
_local4.height = _arg1.height; | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local3); | |
_local5.addChild(_local4); | |
_local2.draw(_local5); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
return (_local2); | |
} | |
private function set curve(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.curve; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get curve():BitmapData{ | |
return (this.shader.data.curve.input); | |
} | |
public function set texture(_arg1:BitmapData):void{ | |
this._texture = _arg1; | |
} | |
} | |
}//package com.meitu.effect.mt | |
package com.meitu.effect.mt.std { | |
import mx.core.*; | |
public class BrightnessFilter_ShaderByteCode extends ByteArrayAsset { | |
} | |
}//package com.meitu.effect.mt.std | |
package com.meitu.effect.mt.std { | |
import mx.core.*; | |
public class SaturationFilter_ShaderByteCode extends ByteArrayAsset { | |
} | |
}//package com.meitu.effect.mt.std | |
package com.meitu.effect.mt.std { | |
import flash.display.*; | |
public class LevelAdjustment { | |
private static var _instance:LevelAdjustment = new (LevelAdjustment); | |
; | |
private var cmRGB:ChannelMap; | |
private var cmB:ChannelMap; | |
private var cmG:ChannelMap; | |
private var cmR:ChannelMap; | |
private var ccm:ChannelMap; | |
private var bm:BitmapData; | |
private var input:Array; | |
private var gamma:Number; | |
private var output:Array; | |
public static function get instance():LevelAdjustment{ | |
if (!_instance){ | |
_instance = new (LevelAdjustment); | |
}; | |
return (_instance); | |
} | |
public function setParament(_arg1:BitmapData, _arg2:Array, _arg3:Array, _arg4:Array):BitmapData{ | |
this.cmRGB = new ChannelMap(); | |
this.cmR = new ChannelMap(); | |
this.cmG = new ChannelMap(); | |
this.cmB = new ChannelMap(); | |
var _local5:Array = [this.cmRGB, this.cmR, this.cmG, this.cmB]; | |
var _local6:int; | |
while (_local6 < _local5.length) { | |
if (((_arg2[_local6]) && (_arg4[_local6]))){ | |
_local5[_local6].minin = _arg2[_local6].x; | |
_local5[_local6].maxin = _arg2[_local6].y; | |
_local5[_local6].midin = (1 / _arg3[_local6]); | |
_local5[_local6].minout = _arg4[_local6].x; | |
_local5[_local6].maxout = _arg4[_local6].y; | |
}; | |
_local6++; | |
}; | |
var _local7:BitmapData = _arg1.clone(); | |
if (((((!(this.cmR.flat)) || (!(this.cmG.flat)))) || (!(this.cmB.flat)))){ | |
_local7.paletteMap(_local7, _local7.rect, _local7.rect.topLeft, (this.cmR.flat) ? null : this.cmR.ComputeArray(16), (this.cmG.flat) ? null : this.cmG.ComputeArray(8), (this.cmB.flat) ? null : this.cmB.ComputeArray(0)); | |
}; | |
if (!this.cmRGB.flat){ | |
_local7.paletteMap(_local7, _local7.rect, _local7.rect.topLeft, this.cmRGB.ComputeArray(16), this.cmRGB.ComputeArray(8), this.cmRGB.ComputeArray(0)); | |
}; | |
return (_local7); | |
} | |
} | |
}//package com.meitu.effect.mt.std | |
package com.meitu.effect.mt.std { | |
public class ChannelMap { | |
public var mid:Number = 0.5; | |
public var maxin:Number = 0xFF; | |
public var maxout:Number = 0xFF; | |
public var midin:Number = 1; | |
private var knLog127Over255:Number; | |
public var minin:Number = 0; | |
public var minout:Number = 0; | |
public function ChannelMap(){ | |
this.knLog127Over255 = Math.log((127 / 0xFF)); | |
super(); | |
} | |
public function get flat():Boolean{ | |
return (Boolean((((((((((this.minout == 0)) && ((this.maxout == 0xFF)))) && ((this.midin == 1)))) && ((this.minin == 0)))) && ((this.maxin == 0xFF))))); | |
} | |
public function ComputeArray(_arg1:int=16):Array{ | |
var _local2:int; | |
var _local4:int; | |
var _local3:Array = new Array(); | |
while (_local4++ < 0x0100) { | |
_local2 = this.map(_local4); | |
if (_local2 < 0){ | |
_local2 = 0; | |
} else { | |
if (_local2 > 0xFF){ | |
_local2 = 0xFF; | |
}; | |
}; | |
_local3.push((_local2 << _arg1)); | |
}; | |
return (_local3); | |
} | |
public function map(_arg1:Number):int{ | |
_arg1 = ((_arg1 - this.minin) / (this.maxin - this.minin)); | |
_arg1 = Math.pow(_arg1, this.midin); | |
_arg1 = (this.minout + (_arg1 * (this.maxout - this.minout))); | |
if (_arg1 > this.maxout){ | |
_arg1 = this.maxout; | |
} else { | |
if (_arg1 < this.minout){ | |
_arg1 = this.minout; | |
}; | |
}; | |
return (Math.round(_arg1)); | |
} | |
public function SetMid(_arg1:int):void{ | |
this.mid = ((_arg1 - this.minin) / (this.maxin - this.minin)); | |
this.midin = this.MidToIn(this.mid); | |
} | |
public function Reset():void{ | |
this.minout = 0; | |
this.maxout = 0xFF; | |
this.midin = 1; | |
this.minin = 0; | |
this.maxin = 0xFF; | |
this.mid = 0.5; | |
} | |
public function MidToIn(_arg1:Number):Number{ | |
return (Math.min(Math.max(Math.pow(9.99, ((2 * _arg1) - 1)), 0.1), 9.99)); | |
} | |
} | |
}//package com.meitu.effect.mt.std | |
package com.meitu.effect.mt.std { | |
import flash.display.*; | |
import flash.filters.*; | |
public class SaturationFilter extends ShaderFilter { | |
private static var ShaderByteCode:Class = SaturationFilter_ShaderByteCode; | |
public function SaturationFilter(){ | |
this.shader = new Shader(new ShaderByteCode()); | |
} | |
public function set saturation(_arg1:Number):void{ | |
this.shader.data.saturation.value[0] = _arg1; | |
} | |
} | |
}//package com.meitu.effect.mt.std | |
package com.meitu.effect.mt.std { | |
import flash.display.*; | |
import flash.filters.*; | |
public class BrightnessFilter extends ShaderFilter { | |
private static var ShaderByteCode:Class = BrightnessFilter_ShaderByteCode; | |
public function BrightnessFilter(){ | |
this.shader = new Shader(new ShaderByteCode()); | |
} | |
public function set brightness(_arg1:Number):void{ | |
this.shader.data.brightness.value[0] = _arg1; | |
} | |
} | |
}//package com.meitu.effect.mt.std | |
package com.meitu.effect.mt.atn { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.mt.std.*; | |
import com.meitu.effect.texture.*; | |
import flash.display.shaders.*; | |
public class Bluebell_Filter extends ShaderFilter { | |
private static var curveCache:BitmapData; | |
private static var colorBalanceCache:BitmapData; | |
public function Bluebell_Filter(_arg1:ByteArray){ | |
this.shader = new Shader(_arg1); | |
this.curve = generateCurve(); | |
this.colorBalance = generateColorBalance(); | |
} | |
private static function generateCurve():BitmapData{ | |
if (curveCache){ | |
return (curveCache); | |
}; | |
var _local1:TCurveTexture = new TCurveTexture(); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(112, 122); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelA); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(110, 118); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelR); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(0xFF, 225); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelB); | |
_local1.commitCurve(); | |
curveCache = _local1.getTexture(); | |
return (curveCache); | |
} | |
private static function generateColorBalance():BitmapData{ | |
if (colorBalanceCache){ | |
return (colorBalanceCache); | |
}; | |
var _local1:TCBTexture = new TCBTexture(); | |
_local1.SetParam(0, 0, 0, 10, -15, -10, 0, 0, 0, true); | |
colorBalanceCache = _local1.getTexture(); | |
return (colorBalanceCache); | |
} | |
public function apply(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = new BitmapData(_arg1.width, _arg1.height); | |
var _local3:Bitmap = new Bitmap(_arg1, "auto", true); | |
var _local4:Bitmap = new Bitmap(new BitmapData(_arg1.width, _arg1.height, true, 4278259759), "auto", true); | |
var _local5:Bitmap = new Bitmap(new BitmapData(_arg1.width, _arg1.height, true, 4279369735), "auto", true); | |
_local4.blendShader = new BlendModeExclusion(); | |
_local4.blendMode = BlendMode.SHADER; | |
_local5.blendShader = new BlendModeExclusion(); | |
_local5.blendMode = BlendMode.SHADER; | |
_local5.alpha = 0.54; | |
var _local6:Sprite = new Sprite(); | |
_local6.addChild(_local3); | |
_local6.addChild(_local4); | |
_local6.addChild(_local5); | |
_local2.draw(_local6); | |
_local2 = LevelAdjustment.instance.setParament(_local2, [new Point(0, 0xFF), null, null, new Point(0, 0xFF)], [1, 1, 1, 1], [new Point(28, 0xFF), null, null, new Point(29, 219)]); | |
this.step = 1; | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
this.step = 2; | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
return (_local2); | |
} | |
private function set curve(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.curve; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get curve():BitmapData{ | |
return (this.shader.data.curve.input); | |
} | |
private function set colorBalance(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.ColorBalance; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get colorBalance():BitmapData{ | |
return (this.shader.data.ColorBalance.input); | |
} | |
private function set step(_arg1:int):void{ | |
this.shader.data.stepIndex.value[0] = _arg1; | |
} | |
} | |
}//package com.meitu.effect.mt.atn | |
package com.meitu.effect.mt.atn { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.mt.std.*; | |
import com.meitu.effect.texture.*; | |
public class LordKelvin_Filter extends ShaderFilter { | |
private static var curveCache:BitmapData; | |
public function LordKelvin_Filter(_arg1:ByteArray){ | |
this.shader = new Shader(_arg1); | |
this.curve = generateCurve(); | |
} | |
private static function generateCurve():BitmapData{ | |
if (curveCache){ | |
return (curveCache); | |
}; | |
var _local1:TCurveTexture = new TCurveTexture(); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(0, 43); | |
_local1.curveMaker.Append(52, 136); | |
_local1.curveMaker.Append(107, 201); | |
_local1.curveMaker.Append(0xFF, 0xFF); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelR); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(0, 27); | |
_local1.curveMaker.Append(52, 86); | |
_local1.curveMaker.Append(214, 219); | |
_local1.curveMaker.Append(0xFF, 219); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelG); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(49, 86); | |
_local1.curveMaker.Append(122, 100); | |
_local1.curveMaker.Append(201, 167); | |
_local1.curveMaker.Append(0xFF, 167); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelB); | |
_local1.commitCurve(); | |
curveCache = _local1.getTexture(); | |
return (curveCache); | |
} | |
public function apply(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
_local2 = LevelAdjustment.instance.setParament(_local2, [new Point(0, 0xFF)], [0.94], [new Point(0, 250)]); | |
return (_local2); | |
} | |
private function set curve(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.curve; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get curve():BitmapData{ | |
return (this.shader.data.curve.input); | |
} | |
} | |
}//package com.meitu.effect.mt.atn | |
package com.meitu.effect.mt.atn { | |
import flash.display.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.texture.*; | |
public class SmokedvalFilter extends ShaderFilter { | |
private static var curveCache:BitmapData; | |
public function SmokedvalFilter(_arg1:ByteArray){ | |
this.shader = new Shader(_arg1); | |
this.curve = generateCurve(); | |
} | |
private static function generateCurve():BitmapData{ | |
if (curveCache){ | |
return (curveCache); | |
}; | |
var _local1:TCurveTexture = new TCurveTexture(); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(14, 0); | |
_local1.curveMaker.Append(156, 162); | |
_local1.curveMaker.Append(0xFF, 0xFF); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelA); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(17, 0); | |
_local1.curveMaker.Append(173, 186); | |
_local1.curveMaker.Append(0xFF, 0xFF); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelR); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(17, 0); | |
_local1.curveMaker.Append(168, 177); | |
_local1.curveMaker.Append(0xFF, 0xFF); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelG); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(2, 14); | |
_local1.curveMaker.Append(0xFF, 0xFF); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelB); | |
_local1.commitCurve(); | |
curveCache = _local1.getTexture(); | |
return (curveCache); | |
} | |
public function apply(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
return (_local2); | |
} | |
private function set curve(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.curve; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get curve():BitmapData{ | |
return (this.shader.data.curve.input); | |
} | |
} | |
}//package com.meitu.effect.mt.atn | |
package com.meitu.effect.mt.atn { | |
import flash.display.*; | |
import flash.geom.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.mt.std.*; | |
import com.meitu.effect.texture.*; | |
public class XProII_Filter extends ShaderFilter { | |
private static var curveCache:BitmapData; | |
public function XProII_Filter(_arg1:ByteArray){ | |
this.shader = new Shader(_arg1); | |
this.curve = generateCurve(); | |
} | |
private static function generateCurve():BitmapData{ | |
if (curveCache){ | |
return (curveCache); | |
}; | |
var _local1:TCurveTexture = new TCurveTexture(); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(58, 48); | |
_local1.curveMaker.Append(212, 227); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelA); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(250, 0xFF); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelG); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(0, 15); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelB); | |
_local1.commitCurve(); | |
curveCache = _local1.getTexture(); | |
return (curveCache); | |
} | |
public function apply(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = new BitmapData(_arg1.width, _arg1.height); | |
var _local3:Bitmap = new Bitmap(_arg1, "auto", true); | |
var _local4:Bitmap = new Bitmap(new BitmapData(_arg1.width, _arg1.height, true, 4294770667), "auto", true); | |
_local4.blendMode = BlendMode.MULTIPLY; | |
_local3.bitmapData = LevelAdjustment.instance.setParament(_local3.bitmapData, [new Point(0, 0xFF), new Point(28, 0xFF), new Point(0, 0xFF), new Point(0, 0xFF)], [0.77, 1.09, 1.06, 1.14], [new Point(0, 0xFF), new Point(0, 0xFF), new Point(0, 0xFF), new Point(45, 0xFF)]); | |
_local3.bitmapData = LevelAdjustment.instance.setParament(_local3.bitmapData, [new Point(15, 243), new Point(49, 0xFF), new Point(0, 0xFF), new Point(0, 0xFF)], [1.03, 2.35, 1.14, 0.57], [new Point(0, 238), new Point(11, 232), new Point(0, 250), new Point(56, 238)]); | |
_local3.bitmapData.applyFilter(_local3.bitmapData, _local3.bitmapData.rect, _local3.bitmapData.rect.topLeft, this); | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local3); | |
_local5.addChild(_local4); | |
_local2.draw(_local5); | |
return (_local2); | |
} | |
private function set curve(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.curve; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get curve():BitmapData{ | |
return (this.shader.data.curve.input); | |
} | |
} | |
}//package com.meitu.effect.mt.atn | |
package com.meitu.effect.mt.atn { | |
import mx.core.*; | |
public class JaejunggimFilter_pixelImageClass extends BitmapAsset { | |
} | |
}//package com.meitu.effect.mt.atn | |
package com.meitu.effect.mt.atn { | |
import flash.display.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.mt.std.*; | |
import flash.display.shaders.*; | |
public class JaejunggimFilter extends ShaderFilter { | |
private static var pixelImageClass:Class = JaejunggimFilter_pixelImageClass; | |
private var _saturationFilter:SaturationFilter; | |
private var _brightnessFilter:BrightnessFilter; | |
public function JaejunggimFilter(_arg1:ByteArray){ | |
this._saturationFilter = new SaturationFilter(); | |
this._brightnessFilter = new BrightnessFilter(); | |
super(); | |
this.shader = new Shader(_arg1); | |
var _local2:Bitmap = new pixelImageClass(); | |
this.pixelImage = _local2.bitmapData; | |
this._saturationFilter.saturation = 1.25; | |
this._brightnessFilter.brightness = 0.05; | |
} | |
public function apply(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
var _local3:Bitmap = new Bitmap(_local2); | |
var _local4:Bitmap = new Bitmap(new BitmapData(_arg1.width, _arg1.height, true, 4293977499), "auto", true); | |
_local4.smoothing = true; | |
_local4.blendShader = new BlendModeMultiply(); | |
_local4.blendMode = BlendMode.SHADER; | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local3); | |
_local5.addChild(_local4); | |
_local2.draw(_local5); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this._saturationFilter); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this._brightnessFilter); | |
return (_local2); | |
} | |
private function set pixelImage(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.pixelImage; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get pixelImage():BitmapData{ | |
return (this.shader.data.pixelImage.input); | |
} | |
} | |
}//package com.meitu.effect.mt.atn | |
package com.meitu.effect.mt.atn { | |
import flash.display.*; | |
import flash.utils.*; | |
import flash.filters.*; | |
import com.meitu.effect.texture.*; | |
import flash.display.shaders.*; | |
public class Nashville_Filter extends ShaderFilter { | |
private static var curveCache:BitmapData; | |
private static var colorBalanceCache:BitmapData; | |
public function Nashville_Filter(_arg1:ByteArray){ | |
this.shader = new Shader(_arg1); | |
this.curve = generateCurve(); | |
this.colorBalance = generateColorBalance(); | |
} | |
private static function generateColorBalance():BitmapData{ | |
if (colorBalanceCache){ | |
return (colorBalanceCache); | |
}; | |
var _local1:TCBTexture = new TCBTexture(); | |
_local1.SetParam(-15, -15, 10, 30, 25, 30, 0, 0, 0, true); | |
colorBalanceCache = _local1.getTexture(); | |
return (colorBalanceCache); | |
} | |
private static function generateCurve():BitmapData{ | |
if (curveCache){ | |
return (curveCache); | |
}; | |
var _local1:TCurveTexture = new TCurveTexture(); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(132, 164); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelA); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(125, 142); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelR); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(113, 127); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelG); | |
_local1.curveMaker.Reset(); | |
_local1.curveMaker.Append(137, 134); | |
_local1.curveMaker.MakeCurve(); | |
_local1.setChannelCurve(TCurveTexture.emCurveChannelB); | |
_local1.commitCurve(); | |
curveCache = _local1.getTexture(); | |
return (curveCache); | |
} | |
public function apply(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = new BitmapData(_arg1.width, _arg1.height); | |
var _local3:Bitmap = new Bitmap(_arg1, "auto", true); | |
var _local4:Bitmap = new Bitmap(new BitmapData(_arg1.width, _arg1.height, true, 4294433197), "auto", true); | |
var _local5:Bitmap = new Bitmap(new BitmapData(_arg1.width, _arg1.height, true, 4278211750), "auto", true); | |
_local4.blendShader = new BlendModeMultiply(); | |
_local4.blendMode = BlendMode.SHADER; | |
_local5.smoothing = true; | |
_local5.alpha = 0.3; | |
_local5.blendShader = new BlendModeScreen(); | |
_local5.blendMode = BlendMode.SHADER; | |
var _local6:Sprite = new Sprite(); | |
_local6.addChild(_local3); | |
_local6.addChild(_local4); | |
_local2.draw(_local6); | |
this.step = 1; | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
_local6 = new Sprite(); | |
_local3.bitmapData = _local2; | |
_local6.addChild(_local3); | |
_local6.addChild(_local5); | |
_local2 = new BitmapData(_arg1.width, _arg1.height); | |
_local2.draw(_local6); | |
this.step = 2; | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, this); | |
return (_local2); | |
} | |
private function set curve(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.curve; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function set colorBalance(_arg1:BitmapData):void{ | |
var _local2:ShaderInput = this.shader.data.ColorBalance; | |
_local2.height = _arg1.height; | |
_local2.width = _arg1.width; | |
_local2.input = _arg1; | |
} | |
private function get colorBalance():BitmapData{ | |
return (this.shader.data.ColorBalance.input); | |
} | |
private function get curve():BitmapData{ | |
return (this.shader.data.curve.input); | |
} | |
private function set step(_arg1:int):void{ | |
this.shader.data.stepIndex.value[0] = _arg1; | |
} | |
} | |
}//package com.meitu.effect.mt.atn | |
package com.meitu.effect.texture { | |
import __AS3__.vec.*; | |
public class TCurve { | |
public var Table:Vector.<uint>; | |
private var FChannel:int = 0; | |
private var cd:Curves; | |
public function TCurve(){ | |
this.FChannel = 0; | |
this.Table = new Vector.<uint>(0x0100, true); | |
this.cd = new Curves(); | |
this.Reset(); | |
} | |
public static function getCRBasis():Vector.<Vector.<Number>>{ | |
var _local1:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>(4, true); | |
_local1[0] = new Vector.<Number>(4); | |
_local1[0][0] = -0.5; | |
_local1[0][1] = 1.5; | |
_local1[0][2] = -1.5; | |
_local1[0][3] = 0.5; | |
_local1[1] = new Vector.<Number>(4); | |
_local1[1][0] = 1; | |
_local1[1][1] = -2.5; | |
_local1[1][2] = 2; | |
_local1[1][3] = -0.5; | |
_local1[2] = new Vector.<Number>(4); | |
_local1[2][0] = -0.5; | |
_local1[2][1] = 0; | |
_local1[2][2] = 0.5; | |
_local1[2][3] = 0; | |
_local1[3] = new Vector.<Number>(4); | |
_local1[3][0] = 0; | |
_local1[3][1] = 1; | |
_local1[3][2] = 0; | |
_local1[3][3] = 0; | |
return (_local1); | |
} | |
public static function SIGN(_arg1:Number):int{ | |
return (((_arg1 > 0)) ? 1 : ((_arg1 < 0)) ? -1 : 0); | |
} | |
public static function SROUND(_arg1:Number):int{ | |
return (((_arg1 + (0.5 * SIGN(_arg1))) >> 0)); | |
} | |
public function Reset():void{ | |
var _local1:int; | |
var _local2:int; | |
_local1 = 0; | |
while (_local1 < 1) { | |
_local2 = 0; | |
while (_local2 < 17) { | |
this.cd.points[_local1][_local2][0] = -1; | |
_local2++; | |
}; | |
_local1++; | |
}; | |
_local1 = 0; | |
while (_local1 < 0x0100) { | |
this.cd.curve[this.FChannel][_local1] = _local1; | |
this.Table[_local1] = _local1; | |
_local1++; | |
}; | |
_local1 = 0; | |
while (_local1 < 17) { | |
this.cd.points[this.FChannel][_local1][0] = -1; | |
this.cd.points[this.FChannel][_local1][1] = -1; | |
_local1++; | |
}; | |
this.cd.points[this.FChannel][0][0] = 0; | |
this.cd.points[this.FChannel][0][1] = 0; | |
this.cd.points[this.FChannel][16][0] = 0xFF; | |
this.cd.points[this.FChannel][16][1] = 0xFF; | |
} | |
private function CLAMP0255(_arg1:int):int{ | |
if (_arg1 < 0){ | |
return (0); | |
}; | |
if (_arg1 > 0xFF){ | |
return (0xFF); | |
}; | |
return (_arg1); | |
} | |
public function Append(_arg1:int, _arg2:int):void{ | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
_local3 = this.CLAMP0255(_arg1); | |
_local4 = this.CLAMP0255(_arg2); | |
_local5 = ((_local3 + 8) / 16); | |
this.cd.points[this.FChannel][_local5][0] = _local3; | |
this.cd.points[this.FChannel][_local5][1] = _local4; | |
} | |
function bender_CR_compose(_arg1:Vector.<Vector.<Number>>, _arg2:Vector.<Vector.<Number>>, _arg3:Vector.<Vector.<Number>>):void{ | |
var _local4:int; | |
var _local5:int; | |
_local4 = 0; | |
while (_local4 < 4) { | |
_local5 = 0; | |
while (_local5 < 4) { | |
_arg3[_local4][_local5] = ((((_arg1[_local4][0] * _arg2[0][_local5]) + (_arg1[_local4][1] * _arg2[1][_local5])) + (_arg1[_local4][2] * _arg2[2][_local5])) + (_arg1[_local4][3] * _arg2[3][_local5])); | |
_local5++; | |
}; | |
_local4++; | |
}; | |
} | |
private function dumpCR(_arg1:Vector.<Vector.<Number>>, _arg2:int=4, _arg3:int=4, _arg4:String=""):void{ | |
var _local6:String; | |
var _local7:int; | |
if (_arg4){ | |
}; | |
var _local5:int; | |
while (_local5 < _arg2) { | |
_local6 = ""; | |
_local7 = 0; | |
while (_local7 < _arg3) { | |
_local6 = (_local6 + (_arg1[_local5][_local7] + " ")); | |
_local7++; | |
}; | |
_local5++; | |
}; | |
} | |
private function bender_plot_curve(_arg1:Curves, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int):void{ | |
var _local7:Number; | |
var _local8:Number; | |
var _local9:Number; | |
var _local10:Number; | |
var _local11:Number; | |
var _local12:Number; | |
var _local13:Number; | |
var _local14:Number; | |
var _local15:Number; | |
var _local16:Number; | |
var _local17:Number; | |
var _local18:int; | |
var _local19:int; | |
var _local20:int; | |
var _local21:int; | |
var _local22:int; | |
var _local23:int; | |
var _local24:Vector.<Vector.<Number>> = getCRBasis(); | |
var _local25:Vector.<Vector.<Number>> = getCRBasis(); | |
var _local26:Vector.<Vector.<Number>> = getCRBasis(); | |
var _local27:Vector.<Vector.<Number>> = getCRBasis(); | |
var _local28:* = 1; | |
var _local29:* = 1; | |
_local23 = 0; | |
while (_local23 < 4) { | |
_local24[_local23][2] = 0; | |
_local24[_local23][3] = 0; | |
_local23++; | |
}; | |
_local24[0][0] = (_arg1.points[_arg2][_arg3][0] * _local28); | |
_local24[1][0] = (_arg1.points[_arg2][_arg4][0] * _local28); | |
_local24[2][0] = (_arg1.points[_arg2][_arg5][0] * _local28); | |
_local24[3][0] = (_arg1.points[_arg2][_arg6][0] * _local28); | |
_local24[0][1] = (_arg1.points[_arg2][_arg3][1] * _local29); | |
_local24[1][1] = (_arg1.points[_arg2][_arg4][1] * _local29); | |
_local24[2][1] = (_arg1.points[_arg2][_arg5][1] * _local29); | |
_local24[3][1] = (_arg1.points[_arg2][_arg6][1] * _local29); | |
_local22 = (4 * 0x0100); | |
_local15 = (1 / _local22); | |
_local16 = ((1 / _local22) * _local15); | |
_local17 = (_local16 * _local15); | |
_local25[0][0] = 0; | |
_local25[0][1] = 0; | |
_local25[0][2] = 0; | |
_local25[0][3] = 1; | |
_local25[1][0] = _local17; | |
_local25[1][1] = _local16; | |
_local25[1][2] = _local15; | |
_local25[1][3] = 0; | |
_local25[2][0] = (6 * _local17); | |
_local25[2][1] = (2 * _local16); | |
_local25[2][2] = 0; | |
_local25[2][3] = 0; | |
_local25[3][0] = (6 * _local17); | |
_local25[3][1] = 0; | |
_local25[3][2] = 0; | |
_local25[3][3] = 0; | |
this.bender_CR_compose(getCRBasis(), _local24, _local26); | |
this.bender_CR_compose(_local25, _local26, _local27); | |
_local7 = _local27[0][0]; | |
_local8 = _local27[1][0]; | |
_local9 = _local27[2][0]; | |
_local10 = _local27[3][0]; | |
_local11 = _local27[0][1]; | |
_local12 = _local27[1][1]; | |
_local13 = _local27[2][1]; | |
_local14 = _local27[3][1]; | |
_local18 = this.CLAMP0255(_local7); | |
_local19 = this.CLAMP0255(_local11); | |
_arg1.curve[_arg2][_local18] = _local19; | |
_local23 = 0; | |
while (_local23 < _local22) { | |
_local7 = (_local7 + _local8); | |
_local8 = (_local8 + _local9); | |
_local9 = (_local9 + _local10); | |
_local11 = (_local11 + _local12); | |
_local12 = (_local12 + _local13); | |
_local13 = (_local13 + _local14); | |
_local20 = this.CLAMP0255(SROUND(_local7)); | |
_local21 = this.CLAMP0255(SROUND(_local11)); | |
if (((!((_local18 == _local20))) || (!((_local19 == _local21))))){ | |
_arg1.curve[_arg2][_local20] = _local21; | |
}; | |
_local18 = _local20; | |
_local19 = _local21; | |
_local23++; | |
}; | |
} | |
private function bender_calculate_curve(_arg1:int):void{ | |
var _local2:int; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
var _local9:*; | |
var _local10:*; | |
var _local8:Vector.<int> = new Vector.<int>(17, true); | |
_local3 = 0; | |
_local2 = 0; | |
while (_local2 < 17) { | |
if (this.cd.points[_arg1][_local2][0] != -1){ | |
_local9 = _local3; | |
_local3 = (_local3 + 1); | |
_local10 = _local9; | |
_local8[_local10] = _local2; | |
}; | |
_local2++; | |
}; | |
if (_local3 != 0){ | |
_local2 = 0; | |
while (_local2 < this.cd.points[_arg1][_local8[0]][0]) { | |
this.cd.curve[_arg1][_local2] = this.cd.points[_arg1][_local8[0]][1]; | |
_local2++; | |
}; | |
_local2 = this.cd.points[_arg1][_local8[(_local3 - 1)]][0]; | |
while (_local2 < 0x0100) { | |
this.cd.curve[_arg1][_local2] = this.cd.points[_arg1][_local8[(_local3 - 1)]][1]; | |
_local2++; | |
}; | |
}; | |
_local2 = 0; | |
while (_local2 < (_local3 - 1)) { | |
_local4 = ((_local2)==0) ? _local8[_local2] : _local8[(_local2 - 1)]; | |
_local5 = _local8[_local2]; | |
_local6 = _local8[(_local2 + 1)]; | |
_local7 = ((_local2)==(_local3 - 2)) ? _local8[(_local3 - 1)] : _local8[(_local2 + 2)]; | |
this.bender_plot_curve(this.cd, _arg1, _local4, _local5, _local6, _local7); | |
_local2++; | |
}; | |
} | |
public function MakeCurve():void{ | |
var _local1:int; | |
this.bender_calculate_curve(this.FChannel); | |
while (_local1 < 0x0100) { | |
this.Table[_local1] = this.cd.curve[this.FChannel][_local1]; | |
_local1++; | |
}; | |
} | |
} | |
}//package com.meitu.effect.texture | |
import __AS3__.vec.*; | |
class Curves { | |
public var points:Vector.<Vector.<Vector.<Number>>>; | |
public var curve:Vector.<Vector.<int>>; | |
public function Curves(){ | |
var _local2:int; | |
super(); | |
this.points = new Vector.<Vector.<Vector.<Number>>>(1, true); | |
this.points[0] = new Vector.<Vector.<Number>>(17, true); | |
var _local1:Vector.<Vector.<Number>> = this.points[0]; | |
while (_local2 < 17) { | |
_local1[_local2] = new Vector.<Number>(2, true); | |
_local2++; | |
}; | |
this.curve = new Vector.<Vector.<int>>(1, true); | |
this.curve[0] = new Vector.<int>(0x0100, true); | |
} | |
} | |
package com.meitu.effect.texture { | |
import flash.display.*; | |
import __AS3__.vec.*; | |
public class TCBTexture { | |
private var FData:Vector.<uint>; | |
private var FTexture:BitmapData; | |
public var cbMaker:TColorBalance; | |
public function TCBTexture(){ | |
this.FData = new Vector.<uint>(0x0400); | |
super(); | |
this.cbMaker = new TColorBalance(); | |
this.FTexture = new BitmapData(0x0100, 4, true, 0); | |
} | |
public function getTexture():BitmapData{ | |
return (this.FTexture); | |
} | |
public function SetParam(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int, _arg9:int, _arg10:Boolean):void{ | |
var _local11:uint; | |
var _local12:uint; | |
var _local13:uint; | |
var _local14:uint; | |
var _local15:uint; | |
var _local17:int; | |
this.cbMaker.SetParam(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10); | |
var _local16:ColorBalanceData = this.cbMaker.FColorBalance; | |
while (_local17 < 0x0100) { | |
_local13 = _local16.b_lookup[_local17]; | |
_local12 = _local16.g_lookup[_local17]; | |
_local11 = _local16.r_lookup[_local17]; | |
_local14 = (_arg10) ? 0xFF : 0; | |
_local11 = (_local11 << 24); | |
_local12 = (_local12 << 24); | |
_local13 = (_local13 << 24); | |
_local14 = (_local14 << 24); | |
this.FTexture.setPixel32(_local17, 0, _local11); | |
this.FTexture.setPixel32(_local17, 1, _local12); | |
this.FTexture.setPixel32(_local17, 2, _local13); | |
this.FTexture.setPixel32(_local17, 3, _local14); | |
_local17++; | |
}; | |
} | |
} | |
}//package com.meitu.effect.texture | |
package com.meitu.effect.texture { | |
import __AS3__.vec.*; | |
public class TColorBalance { | |
public static const CB_SHADOWS:int = 0; | |
public static const CB_MIDTONES:int = 1; | |
public static const CB_HIGHLIGHTS:int = 2; | |
private var FPreserve_luminosity:Boolean; | |
private var highlights_add:Vector.<Number>; | |
private var midtones_add:Vector.<Number>; | |
private var shadows_add:Vector.<Number>; | |
private var highlights_sub:Vector.<Number>; | |
private var midtones_sub:Vector.<Number>; | |
private var shadows_sub:Vector.<Number>; | |
public var FColorBalance:ColorBalanceData; | |
public function TColorBalance(){ | |
this.highlights_add = new Vector.<Number>(0x0100, true); | |
this.midtones_add = new Vector.<Number>(0x0100, true); | |
this.shadows_add = new Vector.<Number>(0x0100, true); | |
this.highlights_sub = new Vector.<Number>(0x0100, true); | |
this.midtones_sub = new Vector.<Number>(0x0100, true); | |
this.shadows_sub = new Vector.<Number>(0x0100, true); | |
this.FColorBalance = new ColorBalanceData(); | |
super(); | |
this.FPreserve_luminosity = true; | |
this.color_balance_transfer_init(); | |
} | |
private function color_balance_init():void{ | |
var _local1:int; | |
var _local2:ColorBalanceData = this.FColorBalance; | |
_local1 = CB_SHADOWS; | |
while (_local1 <= CB_HIGHLIGHTS) { | |
_local2.cyan_red[_local1] = 0; | |
_local2.magenta_green[_local1] = 0; | |
_local2.yellow_blue[_local1] = 0; | |
_local1++; | |
}; | |
_local2.preserve_luminosity = true; | |
} | |
private function CLAMP0255(_arg1:int):int{ | |
if (_arg1 < 0){ | |
return (0); | |
}; | |
if (_arg1 > 0xFF){ | |
return (0xFF); | |
}; | |
return (_arg1); | |
} | |
private function color_balance_create_lookup_tables():void{ | |
var _local1:int; | |
var _local2:int; | |
var _local3:int; | |
var _local4:int; | |
var _local5:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>(3, true); | |
var _local6:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>(3, true); | |
var _local7:Vector.<Vector.<Number>> = new Vector.<Vector.<Number>>(3, true); | |
var _local8:ColorBalanceData = this.FColorBalance; | |
_local5[CB_SHADOWS] = ((_local8.cyan_red[CB_SHADOWS])>0) ? this.shadows_add : this.shadows_sub; | |
_local5[CB_MIDTONES] = ((_local8.cyan_red[CB_MIDTONES])>0) ? this.midtones_add : this.midtones_sub; | |
_local5[CB_HIGHLIGHTS] = ((_local8.cyan_red[CB_HIGHLIGHTS])>0) ? this.highlights_add : this.highlights_sub; | |
_local6[CB_SHADOWS] = ((_local8.magenta_green[CB_SHADOWS])>0) ? this.shadows_add : this.shadows_sub; | |
_local6[CB_MIDTONES] = ((_local8.magenta_green[CB_MIDTONES])>0) ? this.midtones_add : this.midtones_sub; | |
_local6[CB_HIGHLIGHTS] = ((_local8.magenta_green[CB_HIGHLIGHTS])>0) ? this.highlights_add : this.highlights_sub; | |
_local7[CB_SHADOWS] = ((_local8.yellow_blue[CB_SHADOWS])>0) ? this.shadows_add : this.shadows_sub; | |
_local7[CB_MIDTONES] = ((_local8.yellow_blue[CB_MIDTONES])>0) ? this.midtones_add : this.midtones_sub; | |
_local7[CB_HIGHLIGHTS] = ((_local8.yellow_blue[CB_HIGHLIGHTS])>0) ? this.highlights_add : this.highlights_sub; | |
_local1 = 0; | |
while (_local1 < 0x0100) { | |
_local2 = _local1; | |
_local3 = _local1; | |
_local4 = _local1; | |
_local2 = (_local2 + (_local8.cyan_red[CB_SHADOWS] * _local5[CB_SHADOWS][_local2])); | |
_local2 = this.CLAMP0255(_local2); | |
_local2 = (_local2 + (_local8.cyan_red[CB_MIDTONES] * _local5[CB_MIDTONES][_local2])); | |
_local2 = this.CLAMP0255(_local2); | |
_local2 = (_local2 + (_local8.cyan_red[CB_HIGHLIGHTS] * _local5[CB_HIGHLIGHTS][_local2])); | |
_local2 = this.CLAMP0255(_local2); | |
_local3 = (_local3 + (_local8.magenta_green[CB_SHADOWS] * _local6[CB_SHADOWS][_local3])); | |
_local3 = this.CLAMP0255(_local3); | |
_local3 = (_local3 + (_local8.magenta_green[CB_MIDTONES] * _local6[CB_MIDTONES][_local3])); | |
_local3 = this.CLAMP0255(_local3); | |
_local3 = (_local3 + (_local8.magenta_green[CB_HIGHLIGHTS] * _local6[CB_HIGHLIGHTS][_local3])); | |
_local3 = this.CLAMP0255(_local3); | |
_local4 = (_local4 + (_local8.yellow_blue[CB_SHADOWS] * _local7[CB_SHADOWS][_local4])); | |
_local4 = this.CLAMP0255(_local4); | |
_local4 = (_local4 + (_local8.yellow_blue[CB_MIDTONES] * _local7[CB_MIDTONES][_local4])); | |
_local4 = this.CLAMP0255(_local4); | |
_local4 = (_local4 + (_local8.yellow_blue[CB_HIGHLIGHTS] * _local7[CB_HIGHLIGHTS][_local4])); | |
_local4 = this.CLAMP0255(_local4); | |
_local8.r_lookup[_local1] = _local2; | |
_local8.g_lookup[_local1] = _local3; | |
_local8.b_lookup[_local1] = _local4; | |
_local1++; | |
}; | |
} | |
private function color_balance_transfer_init():void{ | |
var _local1:int; | |
var _local2:Number; | |
var _local3:Number; | |
_local1 = 0; | |
while (_local1 < 0x0100) { | |
_local2 = (1.075 - (1 / ((_local1 / 16) + 1))); | |
_local3 = (0.667 * (1 - Math.pow(((_local1 - 127) / 127), 2))); | |
this.shadows_add[_local1] = _local2; | |
this.shadows_sub[(0xFF - _local1)] = _local2; | |
this.midtones_add[_local1] = _local3; | |
this.midtones_sub[_local1] = _local3; | |
this.highlights_add[(0xFF - _local1)] = _local2; | |
this.highlights_sub[_local1] = _local2; | |
_local1++; | |
}; | |
} | |
public function SetParam(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int, _arg9:int, _arg10:Boolean):void{ | |
this.FPreserve_luminosity = _arg10; | |
this.FColorBalance.cyan_red[CB_SHADOWS] = _arg1; | |
this.FColorBalance.magenta_green[CB_SHADOWS] = _arg2; | |
this.FColorBalance.yellow_blue[CB_SHADOWS] = _arg3; | |
this.FColorBalance.cyan_red[CB_MIDTONES] = _arg4; | |
this.FColorBalance.magenta_green[CB_MIDTONES] = _arg5; | |
this.FColorBalance.yellow_blue[CB_MIDTONES] = _arg6; | |
this.FColorBalance.cyan_red[CB_HIGHLIGHTS] = _arg7; | |
this.FColorBalance.magenta_green[CB_HIGHLIGHTS] = _arg8; | |
this.FColorBalance.yellow_blue[CB_HIGHLIGHTS] = _arg9; | |
this.color_balance_create_lookup_tables(); | |
} | |
} | |
}//package com.meitu.effect.texture | |
package com.meitu.effect.texture { | |
import flash.display.*; | |
import __AS3__.vec.*; | |
public class TCurveTexture { | |
public static const emCurveChannelB:int = 0; | |
public static const emCurveChannelG:int = 1; | |
public static const emCurveChannelR:int = 2; | |
public static const emCurveChannelA:int = 3; | |
public static const CurveWidth:int = 0x0100; | |
private var FData:Vector.<uint>; | |
private var FTexture:BitmapData; | |
public var curveMaker:TCurve; | |
public function TCurveTexture(){ | |
this.FData = new Vector.<uint>(0x0400); | |
super(); | |
this.curveMaker = new TCurve(); | |
this.reset(); | |
this.FTexture = new BitmapData(CurveWidth, 4, true, 0); | |
} | |
public function getTexture():BitmapData{ | |
return (this.FTexture); | |
} | |
public function reset():void{ | |
var _local1:int; | |
while (_local1 < CurveWidth) { | |
this.FData[(_local1 * 4)] = _local1; | |
this.FData[((_local1 * 4) + 1)] = _local1; | |
this.FData[((_local1 * 4) + 2)] = _local1; | |
this.FData[((_local1 * 4) + 3)] = _local1; | |
_local1++; | |
}; | |
} | |
public function setChannelCurve(_arg1:int):void{ | |
var _local3:int; | |
var _local2:int = _arg1; | |
while (_local3 < 0x0100) { | |
this.FData[((_local3 * 4) + _local2)] = this.curveMaker.Table[_local3]; | |
_local3++; | |
}; | |
} | |
public function commitCurve():void{ | |
var _local1:int; | |
var _local2:int; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
while (_local5 < CurveWidth) { | |
_local3 = this.FData[(_local5 * 4)]; | |
_local2 = this.FData[((_local5 * 4) + 1)]; | |
_local1 = this.FData[((_local5 * 4) + 2)]; | |
_local4 = this.FData[((_local5 * 4) + 3)]; | |
_local1 = (_local1 << 24); | |
_local2 = (_local2 << 24); | |
_local3 = (_local3 << 24); | |
_local4 = (_local4 << 24); | |
this.FTexture.setPixel32(_local5, 0, _local1); | |
this.FTexture.setPixel32(_local5, 1, _local2); | |
this.FTexture.setPixel32(_local5, 2, _local3); | |
this.FTexture.setPixel32(_local5, 3, _local4); | |
_local5++; | |
}; | |
} | |
} | |
}//package com.meitu.effect.texture | |
package com.meitu.effect.texture { | |
import __AS3__.vec.*; | |
public class ColorBalanceData { | |
public var preserve_luminosity:Boolean; | |
public var cyan_red:Vector.<Number>; | |
public var magenta_green:Vector.<Number>; | |
public var yellow_blue:Vector.<Number>; | |
public var r_lookup:Vector.<uint>; | |
public var g_lookup:Vector.<uint>; | |
public var b_lookup:Vector.<uint>; | |
public function ColorBalanceData(){ | |
this.cyan_red = new Vector.<Number>(3, true); | |
this.magenta_green = new Vector.<Number>(3, true); | |
this.yellow_blue = new Vector.<Number>(3, true); | |
this.r_lookup = new Vector.<uint>(0x0100, true); | |
this.g_lookup = new Vector.<uint>(0x0100, true); | |
this.b_lookup = new Vector.<uint>(0x0100, true); | |
super(); | |
} | |
} | |
}//package com.meitu.effect.texture | |
package com.meitu.effect.lightomtc { | |
import flash.display.*; | |
import flash.geom.*; | |
import __AS3__.vec.*; | |
import flash.filters.*; | |
public class BaseEffect { | |
public static function Sophia(_arg1:BitmapData):BitmapData{ | |
var _local2:ColorMatrix = new ColorMatrix(); | |
_local2.AdjustSaturation(1.4); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2.filter); | |
Filter.Vignette(_arg1, 0, 30); | |
var _local3:Array = new Array(0, 65536, 65536, 131072, 131072, 196608, 262144, 262144, 327680, 327680, 393216, 458752, 458752, 524288, 524288, 589824, 655360, 655360, 720896, 720896, 786432, 851968, 851968, 917504, 917504, 983040, 0x100000, 0x100000, 0x110000, 0x120000, 0x120000, 0x130000, 0x130000, 0x140000, 0x150000, 0x150000, 0x160000, 0x170000, 0x170000, 0x180000, 0x190000, 0x190000, 0x1A0000, 0x1B0000, 0x1B0000, 0x1C0000, 0x1D0000, 0x1D0000, 0x1E0000, 0x1F0000, 0x200000, 0x200000, 0x210000, 0x220000, 0x220000, 0x230000, 0x240000, 0x250000, 0x250000, 0x260000, 0x270000, 0x280000, 0x280000, 0x290000, 0x2A0000, 0x2B0000, 0x2C0000, 0x2C0000, 0x2D0000, 0x2E0000, 0x2F0000, 0x300000, 0x300000, 0x310000, 0x320000, 0x330000, 0x340000, 0x350000, 0x360000, 0x360000, 0x370000, 0x380000, 0x390000, 0x3A0000, 0x3B0000, 0x3C0000, 0x3D0000, 0x3E0000, 0x3F0000, 0x400000, 0x410000, 0x420000, 0x430000, 0x440000, 0x450000, 0x460000, 0x470000, 0x480000, 0x490000, 0x4A0000, 0x4B0000, 0x4C0000, 0x4D0000, 0x4E0000, 0x4F0000, 0x500000, 0x510000, 0x530000, 0x540000, 0x550000, 0x560000, 0x570000, 0x580000, 0x5A0000, 0x5B0000, 0x5C0000, 0x5D0000, 0x5E0000, 0x600000, 0x610000, 0x620000, 0x630000, 0x650000, 0x660000, 0x670000, 0x680000, 0x6A0000, 0x6B0000, 0x6C0000, 0x6E0000, 0x6F0000, 0x700000, 0x720000, 0x730000, 0x740000, 0x760000, 0x770000, 0x780000, 0x7A0000, 0x7B0000, 0x7D0000, 0x7E0000, 0x7F0000, 0x810000, 0x820000, 0x840000, 0x850000, 0x860000, 0x880000, 0x890000, 0x8B0000, 0x8C0000, 0x8E0000, 0x8F0000, 0x910000, 0x920000, 0x940000, 0x950000, 0x970000, 0x980000, 0x9A0000, 0x9B0000, 0x9D0000, 0x9E0000, 0xA00000, 0xA10000, 0xA30000, 0xA40000, 0xA60000, 0xA70000, 0xA90000, 0xAA0000, 0xAC0000, 0xAE0000, 0xAF0000, 0xB10000, 0xB20000, 0xB40000, 0xB50000, 0xB70000, 0xB90000, 0xBA0000, 0xBC0000, 0xBD0000, 0xBF0000, 0xC10000, 0xC20000, 0xC40000, 0xC50000, 0xC70000, 0xC90000, 0xCA0000, 0xCC0000, 0xCD0000, 0xCF0000, 0xD10000, 0xD20000, 0xD40000, 0xD60000, 0xD70000, 0xD90000, 0xDB0000, 0xDC0000, 0xDE0000, 0xDF0000, 0xE10000, 0xE30000, 0xE40000, 0xE60000, 0xE80000, 0xE90000, 0xEB0000, 0xED0000, 0xEE0000, 0xF00000, 0xF20000, 0xF30000, 0xF50000, 0xF70000, 0xF80000, 0xFA0000, 0xFC0000, 0xFD0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000, 0xFF0000); | |
var _local4:Array = new Array(0, 0x0100, 0x0200, 0x0300, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0x1000, 0x1100, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0x6800, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, 0x8000, 0x8200, 0x8300, 0x8400, 0x8500, 0x8600, 0x8800, 0x8900, 0x8A00, 0x8B00, 0x8D00, 0x8E00, 0x8F00, 0x9000, 0x9100, 0x9300, 0x9400, 0x9500, 0x9600, 0x9700, 0x9900, 0x9A00, 0x9B00, 0x9C00, 0x9D00, 0x9F00, 0xA000, 0xA100, 0xA200, 0xA300, 0xA500, 0xA600, 0xA700, 0xA800, 0xA900, 0xAA00, 0xAC00, 0xAD00, 0xAE00, 0xAF00, 0xB000, 0xB100, 0xB200, 0xB400, 0xB500, 0xB600, 0xB700, 0xB800, 0xB900, 0xBA00, 0xBB00, 0xBC00, 0xBE00, 0xBF00, 0xC000, 0xC100, 0xC200, 0xC300, 0xC400, 0xC500, 0xC600, 0xC700, 0xC800, 0xC900, 0xCA00, 0xCB00, 0xCC00, 0xCD00, 0xCE00, 0xCF00, 0xD000, 0xD100, 0xD200, 0xD300, 0xD400, 0xD500, 0xD600, 0xD700, 0xD700, 0xD800, 0xD900, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDE00, 0xDE00, 0xDF00, 0xE000, 0xE100, 0xE200, 0xE300, 0xE300, 0xE400, 0xE500, 0xE600, 0xE700, 0xE800, 0xE800, 0xE900, 0xEA00, 0xEB00, 0xEB00, 0xEC00, 0xED00, 0xEE00, 0xEF00, 0xEF00, 0xF000, 0xF100, 0xF200, 0xF200, 0xF300, 0xF400, 0xF500, 0xF500, 0xF600, 0xF700, 0xF800, 0xF800, 0xF900, 0xFA00, 0xFB00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFE00, 0xFF00); | |
var _local5:Array = new Array(22, 23, 24, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 60, 61, 62, 63, 64, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 99, 100, 101, 102, 103, 104, 104, 105, 106, 107, 108, 108, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 126, 127, 128, 129, 130, 130, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 148, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 179, 180, 181, 182, 183, 184, 184, 185, 186, 187, 188, 188, 189, 190, 191, 192, 192, 193, 194, 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, 203, 204, 205, 206, 206, 207, 208, 209, 210, 210, 211, 212, 213, 214, 215, 215, 216, 217, 218, 219, 219, 220, 221, 222, 223, 223, 224, 225, 226, 227, 228, 228, 229, 230); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local3, _local4, _local5); | |
return (_arg1); | |
} | |
public static function Harry(_arg1:BitmapData):BitmapData{ | |
var _local2:uint; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
var _local8:int; | |
var _local9:int; | |
_arg1.lock(); | |
while (_local9 < _arg1.height) { | |
_local8 = 0; | |
while (_local8 < _arg1.width) { | |
_local2 = _arg1.getPixel(_local8, _local9); | |
_local5 = ((_local2 >>> 16) & 0xFF); | |
_local6 = ((_local2 >>> 8) & 0xFF); | |
_local7 = (_local2 & 0xFF); | |
_local4 = (((0.299 * _local5) + (0.587 * _local6)) + (0.114 * _local7)); | |
_local5 = ((_local4)>206) ? 0xFF : (_local4 + 49); | |
_local6 = ((_local4)<14) ? 0 : (_local4 - 14); | |
_local7 = ((_local4)<56) ? 0 : (_local4 - 56); | |
_local3 = Math.round(((Math.random() * 20) - 10)); | |
_local5 = (_local5 + _local3); | |
_local6 = (_local6 + _local3); | |
_local7 = (_local7 + _local3); | |
if (_local5 > 0xFF){ | |
_local5 = 0xFF; | |
} else { | |
if (_local5 < 0){ | |
_local5 = 0; | |
}; | |
}; | |
if (_local6 > 0xFF){ | |
_local6 = 0xFF; | |
} else { | |
if (_local6 < 0){ | |
_local6 = 0; | |
}; | |
}; | |
if (_local7 > 0xFF){ | |
_local7 = 0xFF; | |
} else { | |
if (_local7 < 0){ | |
_local7 = 0; | |
}; | |
}; | |
_arg1.setPixel(_local8, _local9, (((_local5 << 16) | (_local6 << 8)) | _local7)); | |
_local8++; | |
}; | |
_local9++; | |
}; | |
_arg1.unlock(); | |
return (_arg1); | |
} | |
public static function Agatha(_arg1:BitmapData):BitmapData{ | |
var _local2:ColorMatrix = new ColorMatrix(); | |
_local2.Desaturate(); | |
_local2.AdjustContrast(0.25); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2.filter); | |
var _local3:BitmapData = new BitmapData(_arg1.width, _arg1.height, false, 0x808080); | |
Filter.Noise(_local3, 100); | |
_local3.applyFilter(_local3, _local3.rect, _local3.rect.topLeft, new BlurFilter(1.6, 1.6, 3)); | |
var _local4:Bitmap = new Bitmap(_local3); | |
_local4.blendMode = "overlay"; | |
_local4.alpha = 0.75; | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local4); | |
_arg1.draw(_local5); | |
Filter.Noise(_arg1, 10); | |
return (_arg1); | |
} | |
public static function Courtney(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
var _local3:Matrix = new Matrix(); | |
_local3.createGradientBox(_arg1.width, _arg1.height, (45 / (180 / Math.PI)), 0, 0); | |
var _local4:Sprite = new Sprite(); | |
_local4.graphics.beginGradientFill("linear", new Array(16718994, 16758246, 16736969, 16758246, 16718994), new Array(1, 1, 1, 1, 1), new Array(0, 64, 128, 192, 0xFF), _local3); | |
_local4.graphics.drawRect(0, 0, _arg1.width, _arg1.height); | |
_local4.graphics.endFill(); | |
_local4.blendMode = "darken"; | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local4); | |
_arg1.draw(_local5); | |
var _local6:Bitmap = new Bitmap(_local2); | |
_local6.blendMode = "overlay"; | |
_local5 = new Sprite(); | |
_local6.x = -3; | |
_local6.y = -2; | |
_local5.addChild(_local6); | |
_arg1.draw(_local5); | |
_local6.x = 4; | |
_local6.y = 1; | |
_arg1.draw(_local5); | |
return (_arg1); | |
} | |
public static function Bob(_arg1:BitmapData):BitmapData{ | |
var _local2:ColorMatrix = new ColorMatrix(); | |
_local2.AdjustSaturation(0.2); | |
_local2.AdjustBrightness(0.5); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2.filter); | |
var _local3:BitmapData = _arg1.clone(); | |
var _local4:Bitmap = new Bitmap(_local3); | |
_local4.blendMode = "screen"; | |
var _local5:Sprite = new Sprite(); | |
_local4.x = -2; | |
_local4.y = -1; | |
_local5.addChild(_local4); | |
_local5.alpha = 0.4; | |
_arg1.draw(_local5); | |
_local4.blendMode = "hardlight"; | |
_local4.x = 2; | |
_local4.y = 1; | |
_arg1.draw(_local5); | |
return (_arg1); | |
} | |
public static function Sara(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
var _local3:ColorMatrix = new ColorMatrix(); | |
_local3.AdjustSaturation(2); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, _local3.filter); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, new BlurFilter(5, 5, 3)); | |
_local3 = new ColorMatrix(); | |
_local3.AdjustContrast(0.25); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local3.filter); | |
var _local4:Bitmap = new Bitmap(_local2); | |
_local4.alpha = 0.8; | |
_local4.blendMode = "lighten"; | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local4); | |
_arg1.draw(_local5); | |
return (_arg1); | |
} | |
public static function Antonio(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
var _local3:ColorMatrix = new ColorMatrix(); | |
_local3.Desaturate(); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, _local3.filter); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, new BlurFilter(10, 10, 10)); | |
var _local4:Bitmap = new Bitmap(_local2); | |
_local4.blendMode = "hardlight"; | |
var _local5:Sprite = new Sprite(); | |
_local5.addChild(_local4); | |
_arg1.draw(_local5); | |
return (_arg1); | |
} | |
public static function Rachel(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
var _local3:BitmapData = _arg1.clone(); | |
var _local4:ColorMatrix = new ColorMatrix(); | |
_local4.AdjustSaturation(0.2); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local4.filter); | |
_local4 = new ColorMatrix(); | |
_local4.Colorize(240); | |
_local3.applyFilter(_local3, _local3.rect, _local3.rect.topLeft, _local4.filter); | |
var _local5:Bitmap = new Bitmap(_local3); | |
_local5.blendMode = "add"; | |
_local5.alpha = 0.6; | |
_local5.x = 25; | |
_local5.y = 15; | |
var _local6:Sprite = new Sprite(); | |
_local6.addChild(_local5); | |
_arg1.draw(_local6); | |
_local4 = new ColorMatrix(); | |
_local4.AdjustSaturation(2); | |
_local2.applyFilter(_local2, _local2.rect, _local2.rect.topLeft, _local4.filter); | |
var _local7:Matrix = new Matrix(); | |
_local7.createGradientBox(_arg1.width, _arg1.height, (40 / (180 / Math.PI)), 0, 0); | |
var _local8:Sprite = new Sprite(); | |
_local8.graphics.beginGradientFill("linear", new Array(0, 0), new Array(1, 0), new Array(0, 200), _local7); | |
_local8.graphics.drawRect(0, 0, _arg1.width, _arg1.height); | |
_local8.graphics.endFill(); | |
_local8.cacheAsBitmap = true; | |
_local5 = new Bitmap(_local2); | |
_local5.cacheAsBitmap = true; | |
_local5.mask = _local8; | |
_local6 = new Sprite(); | |
_local6.cacheAsBitmap = true; | |
_local6.addChild(_local5); | |
_local6.addChild(_local8); | |
_arg1.draw(_local6); | |
return (_arg1); | |
} | |
public static function Tony(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0, 0, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, 11, 11, 11, 12, 12, 12, 14, 14, 14, 15, 15, 15, 17, 17, 17, 18, 18, 18, 20, 20, 21, 21, 21, 23, 23, 23, 24, 26, 26, 27, 29, 29, 30, 32, 32, 33, 35, 35, 36, 38, 38, 39, 41, 41, 42, 44, 44, 45, 48, 48, 50, 53, 53, 54, 56, 56, 59, 62, 62, 63, 65, 65, 66, 71, 71, 72, 74, 74, 78, 78, 78, 83, 84, 84, 87, 90, 90, 92, 96, 96, 98, 101, 101, 104, 105, 105, 108, 111, 111, 116, 117, 117, 120, 123, 123, 125, 129, 129, 131, 132, 132, 137, 138, 138, 143, 146, 146, 147, 152, 152, 153, 155, 155, 159, 162, 162, 164, 168, 168, 170, 173, 173, 176, 179, 179, 182, 183, 183, 186, 189, 189, 191, 192, 192, 195, 197, 197, 201, 203, 203, 206, 206, 206, 209, 212, 212, 215, 216, 216, 218, 219, 219, 222, 225, 225, 227, 228, 228, 231, 233, 233, 234, 236, 236, 237, 240, 240, 242, 245, 245, 248, 249, 249, 249, 251, 251, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254); | |
var _local3:Array = new Array(0, 2, 3, 3, 5, 6, 6, 8, 9, 9, 9, 11, 11, 12, 14, 14, 15, 17, 17, 17, 18, 18, 20, 21, 21, 23, 24, 24, 24, 26, 26, 27, 29, 29, 30, 32, 32, 33, 35, 35, 36, 38, 38, 41, 41, 41, 42, 44, 44, 45, 47, 47, 50, 50, 50, 51, 53, 53, 54, 56, 56, 59, 60, 60, 62, 63, 63, 66, 68, 68, 69, 71, 71, 72, 74, 74, 75, 78, 78, 80, 83, 83, 84, 86, 86, 89, 90, 90, 92, 95, 95, 96, 98, 98, 101, 102, 102, 105, 107, 107, 108, 110, 110, 113, 116, 116, 117, 119, 119, 122, 123, 123, 125, 128, 128, 129, 132, 132, 134, 137, 137, 138, 140, 140, 141, 144, 144, 146, 149, 149, 150, 153, 153, 155, 156, 156, 159, 161, 161, 162, 165, 165, 167, 168, 168, 171, 173, 173, 174, 176, 176, 179, 180, 180, 182, 185, 185, 186, 188, 188, 189, 191, 191, 192, 194, 194, 195, 198, 198, 200, 201, 201, 203, 204, 204, 206, 207, 207, 209, 210, 210, 212, 213, 213, 215, 215, 215, 216, 218, 218, 219, 221, 221, 222, 224, 224, 224, 225, 225, 227, 227, 227, 228, 230, 230, 230, 231, 231, 233, 233, 233, 234, 234, 234, 236, 236, 236, 237, 237, 237, 239, 239, 239, 240, 240, 240, 242, 243, 243, 243, 243, 243, 245, 245, 245, 246, 246, 246, 248, 248, 248, 249, 249, 249, 249, 251, 251, 251, 252, 252, 252, 252, 252, 254, 254, 254); | |
var _local4:Array = new Array(23, 24, 26, 26, 27, 29, 29, 30, 32, 32, 32, 33, 33, 35, 36, 36, 36, 38, 38, 39, 41, 41, 41, 44, 44, 45, 47, 47, 47, 48, 48, 50, 51, 51, 51, 53, 53, 54, 56, 56, 57, 59, 59, 60, 62, 62, 62, 63, 63, 65, 66, 66, 66, 68, 68, 69, 71, 71, 72, 74, 74, 75, 75, 75, 77, 78, 78, 80, 81, 81, 81, 83, 83, 84, 86, 86, 87, 87, 87, 89, 90, 90, 92, 93, 93, 95, 96, 96, 98, 99, 99, 99, 101, 101, 102, 104, 104, 105, 105, 105, 107, 108, 108, 110, 110, 110, 111, 113, 113, 114, 116, 116, 117, 119, 119, 119, 120, 120, 122, 123, 123, 125, 125, 125, 126, 128, 128, 129, 131, 131, 132, 134, 134, 134, 135, 135, 137, 138, 138, 140, 141, 141, 143, 143, 143, 144, 146, 146, 147, 149, 149, 149, 150, 150, 152, 153, 153, 153, 155, 155, 156, 158, 158, 159, 161, 161, 162, 162, 162, 164, 165, 165, 167, 168, 168, 170, 171, 171, 171, 173, 173, 174, 176, 176, 177, 177, 177, 179, 180, 180, 182, 183, 183, 185, 186, 186, 186, 188, 188, 189, 191, 191, 191, 192, 192, 194, 195, 195, 197, 198, 198, 200, 201, 201, 203, 203, 203, 204, 206, 206, 207, 207, 207, 209, 210, 210, 212, 213, 213, 215, 216, 216, 218, 218, 218, 219, 221, 221, 222, 222, 222, 224, 225, 225, 227, 228, 228, 230, 230, 230, 231, 233, 233, 234, 236, 236); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, ComputePaletteArray(_local2, 16), ComputePaletteArray(_local3, 8), ComputePaletteArray(_local4, 0)); | |
var _local5:BitmapData = _arg1.clone(); | |
var _local6:ColorMatrix = new ColorMatrix(); | |
_local6.AdjustSaturation(0.5); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local6.filter); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, new BlurFilter(5, 5, 3)); | |
var _local7:Matrix = new Matrix(); | |
_local7.createGradientBox(_arg1.width, _arg1.height, (40 / (180 / Math.PI)), 0, 0); | |
var _local8:Sprite = new Sprite(); | |
_local8.graphics.beginGradientFill("radial", new Array(0, 0), new Array(1, 0), new Array(0, 0xFF), _local7); | |
_local8.graphics.drawRect(0, 0, _arg1.width, _arg1.height); | |
_local8.graphics.endFill(); | |
_local8.cacheAsBitmap = true; | |
var _local9:Bitmap = new Bitmap(_local5); | |
_local9.cacheAsBitmap = true; | |
_local9.mask = _local8; | |
var _local10:Sprite = new Sprite(); | |
_local10.cacheAsBitmap = true; | |
_local10.addChild(_local9); | |
_local10.addChild(_local8); | |
_arg1.draw(_local10); | |
return (_arg1); | |
} | |
public static function Melissa(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0x3F0000, 0x400000, 0x410000, 0x410000, 0x420000, 0x430000, 0x440000, 0x440000, 0x450000, 0x460000, 0x470000, 0x470000, 0x480000, 0x490000, 0x4A0000, 0x4A0000, 0x4B0000, 0x4C0000, 0x4D0000, 0x4D0000, 0x4E0000, 0x4F0000, 0x500000, 0x500000, 0x510000, 0x520000, 0x530000, 0x530000, 0x540000, 0x550000, 0x560000, 0x560000, 0x570000, 0x580000, 0x590000, 0x590000, 0x5A0000, 0x5B0000, 0x5C0000, 0x5C0000, 0x5D0000, 0x5E0000, 0x5F0000, 0x5F0000, 0x600000, 0x610000, 0x620000, 0x620000, 0x630000, 0x640000, 0x650000, 0x650000, 0x660000, 0x670000, 0x680000, 0x680000, 0x690000, 0x6A0000, 0x6B0000, 0x6B0000, 0x6C0000, 0x6D0000, 0x6E0000, 0x6E0000, 0x6F0000, 0x700000, 0x710000, 0x710000, 0x720000, 0x730000, 0x740000, 0x740000, 0x750000, 0x760000, 0x770000, 0x770000, 0x780000, 0x790000, 0x7A0000, 0x7A0000, 0x7B0000, 0x7C0000, 0x7D0000, 0x7D0000, 0x7E0000, 0x7F0000, 0x800000, 0x810000, 0x810000, 0x820000, 0x830000, 0x840000, 0x840000, 0x850000, 0x860000, 0x870000, 0x870000, 0x880000, 0x890000, 0x8A0000, 0x8A0000, 0x8B0000, 0x8C0000, 0x8D0000, 0x8D0000, 0x8E0000, 0x8F0000, 0x900000, 0x900000, 0x910000, 0x920000, 0x930000, 0x930000, 0x940000, 0x950000, 0x960000, 0x960000, 0x970000, 0x980000, 0x990000, 0x990000, 0x9A0000, 0x9B0000, 0x9C0000, 0x9C0000, 0x9D0000, 0x9E0000, 0x9F0000, 0x9F0000, 0xA00000, 0xA10000, 0xA20000, 0xA20000, 0xA30000, 0xA40000, 0xA50000, 0xA50000, 0xA60000, 0xA70000, 0xA80000, 0xA80000, 0xA90000, 0xAA0000, 0xAB0000, 0xAB0000, 0xAC0000, 0xAD0000, 0xAE0000, 0xAE0000, 0xAF0000, 0xB00000, 0xB10000, 0xB10000, 0xB20000, 0xB30000, 0xB40000, 0xB40000, 0xB50000, 0xB60000, 0xB70000, 0xB70000, 0xB80000, 0xB90000, 0xBA0000, 0xBA0000, 0xBB0000, 0xBC0000, 0xBD0000, 0xBD0000, 0xBE0000, 0xBF0000, 0xC00000, 0xC10000, 0xC10000, 0xC20000, 0xC30000, 0xC40000, 0xC40000, 0xC50000, 0xC60000, 0xC70000, 0xC70000, 0xC80000, 0xC90000, 0xCA0000, 0xCA0000, 0xCB0000, 0xCC0000, 0xCD0000, 0xCD0000, 0xCE0000, 0xCF0000, 0xD00000, 0xD00000, 0xD10000, 0xD20000, 0xD30000, 0xD30000, 0xD40000, 0xD50000, 0xD60000, 0xD60000, 0xD70000, 0xD80000, 0xD90000, 0xD90000, 0xDA0000, 0xDB0000, 0xDC0000, 0xDC0000, 0xDD0000, 0xDE0000, 0xDF0000, 0xDF0000, 0xE00000, 0xE10000, 0xE20000, 0xE20000, 0xE30000, 0xE40000, 0xE50000, 0xE50000, 0xE60000, 0xE70000, 0xE80000, 0xE80000, 0xE90000, 0xEA0000, 0xEB0000, 0xEB0000, 0xEC0000, 0xED0000, 0xEE0000, 0xEE0000, 0xEF0000, 0xF00000, 0xF10000, 0xF10000, 0xF20000, 0xF30000, 0xF40000, 0xF40000, 0xF50000, 0xF60000, 0xF70000, 0xF70000, 0xF80000, 0xF90000, 0xFA0000, 0xFA0000, 0xFB0000, 0xFC0000, 0xFD0000, 0xFD0000, 0xFE0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, 0x8000, 0x8100, 0x8200, 0x8300, 0x8400, 0x8500, 0x8600, 0x8700, 0x8800, 0x8900, 0x8A00, 0x8B00, 0x8C00, 0x8D00, 0x8E00, 0x8F00, 0x9000, 0x9100, 0x9200, 0x9300, 0x9400, 0x9500, 0x9600, 0x9700, 0x9800, 0x9900, 0x9A00, 0x9B00, 0x9C00, 0x9D00, 0x9E00, 0x9F00, 0xA000, 0xA100, 0xA200, 0xA300, 0xA400, 0xA500, 0xA600, 0xA700, 0xA800, 0xA900, 0xAA00, 0xAB00, 0xAC00, 0xAD00, 0xAE00, 0xAF00, 0xB000, 0xB100, 0xB200, 0xB300, 0xB400, 0xB500, 0xB600, 0xB700, 0xB800, 0xB900, 0xBA00, 0xBB00, 0xBC00, 0xBD00, 0xBE00, 0xBF00, 0xC000, 0xC100, 0xC200, 0xC300, 0xC400, 0xC500, 0xC600, 0xC700, 0xC800, 0xC900, 0xCA00, 0xCB00, 0xCC00, 0xCD00, 0xCE00, 0xCF00, 0xD000, 0xD100, 0xD200, 0xD300, 0xD400, 0xD500, 0xD600, 0xD700, 0xD800, 0xD900, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDE00, 0xDF00, 0xE000, 0xE100, 0xE200, 0xE300, 0xE400, 0xE500, 0xE600, 0xE700, 0xE800, 0xE900, 0xEA00, 0xEB00, 0xEC00, 0xED00, 0xEE00, 0xEF00, 0xF000, 0xF100, 0xF200, 0xF300, 0xF400, 0xF500, 0xF600, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00); | |
var _local4:Array = new Array(63, 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, 160, 160, 161, 161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, 167, 167, 168, 168, 169, 169, 170, 170, 171, 171, 172, 172, 173, 173, 174, 174, 175, 175, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 181, 182, 182, 183, 183, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 190, 191); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
var _local5:BitmapData = _arg1.clone(); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, new BlurFilter(10, 10, 3)); | |
Filter.Noise(_arg1, 20); | |
var _local6:Matrix = new Matrix(); | |
_local6.createGradientBox(_arg1.width, _arg1.height, (35 / (180 / Math.PI)), 0, 0); | |
var _local7:Sprite = new Sprite(); | |
_local7.graphics.beginGradientFill("linear", new Array(0, 0, 0, 0), new Array(0, 1, 1, 0), new Array(0, 90, 155, 0xFF), _local6); | |
_local7.graphics.drawRect(0, 0, _arg1.width, _arg1.height); | |
_local7.graphics.endFill(); | |
_local7.cacheAsBitmap = true; | |
var _local8:Bitmap = new Bitmap(_local5); | |
_local8.cacheAsBitmap = true; | |
_local8.mask = _local7; | |
var _local9:Sprite = new Sprite(); | |
_local9.cacheAsBitmap = true; | |
_local9.addChild(_local8); | |
_local9.addChild(_local7); | |
_arg1.draw(_local9); | |
return (_arg1); | |
} | |
public static function Ivan(_arg1:BitmapData):BitmapData{ | |
var _local2:uint; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
var _local8:int; | |
var _local11:int; | |
var _local9:Array = new Array(655538, 721072, 852143, 983213, 0x1100AC, 0x1300AB, 0x1500A9, 0x1700A8, 0x1900A6, 0x1B00A5, 0x1D00A4, 0x1F00A2, 0x2000A1, 0x22009F, 0x24009E, 0x26009D, 0x28009B, 0x2A009A, 0x2C0098, 0x2E0097, 0x300096, 0x320094, 0x340093, 0x360092, 0x370090, 0x39008F, 0x3B008D, 0x3D008C, 0x3F008B, 0x410089, 0x430088, 0x450086, 0x470085, 0x490084, 0x4B0082, 0x4C0081, 0x4E007F, 0x50007E, 0x52007D, 0x54007B, 0x56007A, 0x580078, 0x5A0077, 0x5C0076, 0x5E0074, 0x600073, 0x620072, 0x630070, 0x65006F, 0x67006D, 0x69006C, 0x6B006B, 0x6D0069, 0x6F0068, 0x710066, 0x730065, 0x750064, 0x770062, 0x790061, 0x7A005F, 0x7C005E, 0x7E005D, 0x80005B, 0x82005A, 0x840059, 0x860057, 0x880056, 0x8A0054, 0x8C0053, 0x8E0052, 0x8F0050, 0x91004F, 0x93004D, 0x95004C, 0x97004B, 0x990049, 0x9B0048, 0x9D0046, 0x9F0045, 0xA10044, 0xA30042, 0xA50041, 0xA6003F, 0xA8003E, 0xAA003D, 0xAC003B, 0xAE003A, 0xB00039, 0xB20037, 0xB40036, 0xB60034, 0xB80033, 0xBA0032, 0xBC0030, 0xBD002F, 0xBF002D, 0xC1002C, 0xC3002B, 0xC50029, 0xC70028, 0xC90026, 0xCB0025, 0xCD0024, 0xCF0022, 0xD10021, 0xD2001F, 0xD4001E, 0xD6001D, 0xD8001B, 0xDA001A, 0xDC0019, 0xDE0017, 0xE00016, 0xE20014, 0xE40013, 0xE60012, 0xE80010, 0xE9000F, 0xEB000D, 0xED000C, 0xEF000B, 0xF10009, 0xF30008, 0xF50006, 0xF70005, 0xF90004, 0xFB0002, 0xFD0001, 0xFF0000, 0xFF0100, 0xFF0300, 0xFF0500, 0xFF0700, 0xFF0900, 0xFF0B00, 0xFF0D00, 0xFF0F00, 0xFF1100, 0xFF1300, 0xFF1500, 0xFF1700, 0xFF1900, 0xFF1B00, 0xFF1D00, 0xFF1F00, 0xFF2100, 0xFF2300, 0xFF2500, 0xFF2700, 0xFF2900, 0xFF2B00, 0xFF2D00, 0xFF2F00, 0xFF3100, 0xFF3300, 0xFF3500, 0xFF3700, 0xFF3900, 0xFF3B00, 0xFF3D00, 0xFF3F00, 0xFF4100, 0xFF4300, 0xFF4500, 0xFF4700, 0xFF4900, 0xFF4B00, 0xFF4D00, 0xFF4F00, 0xFF5100, 0xFF5300, 0xFF5500, 0xFF5700, 0xFF5900, 0xFF5B00, 0xFF5D00, 0xFF5F00, 0xFF6100, 0xFF6300, 0xFF6500, 0xFF6700, 0xFF6900, 0xFF6B00, 0xFF6D00, 0xFF6F00, 0xFF7100, 0xFF7300, 0xFF7500, 0xFF7700, 0xFF7900, 0xFF7B00, 0xFF7D00, 0xFF7E00, 0xFF8000, 0xFF8200, 0xFF8400, 0xFF8600, 0xFF8800, 0xFF8A00, 0xFF8C00, 0xFF8E00, 0xFF9000, 0xFF9200, 0xFF9400, 0xFF9600, 0xFF9800, 0xFF9A00, 0xFF9C00, 0xFF9E00, 0xFFA000, 0xFFA200, 0xFFA400, 0xFFA600, 0xFFA800, 0xFFAA00, 0xFFAC00, 0xFFAE00, 0xFFB000, 0xFFB200, 0xFFB400, 0xFFB600, 0xFFB800, 0xFFBA00, 0xFFBC00, 0xFFBE00, 0xFFC000, 0xFFC200, 0xFFC400, 0xFFC600, 0xFFC800, 0xFFCA00, 0xFFCC00, 0xFFCE00, 0xFFD000, 0xFFD200, 0xFFD400, 0xFFD600, 0xFFD800, 0xFFDA00, 0xFFDC00, 0xFFDE00, 0xFFE000, 0xFFE200, 0xFFE400, 0xFFE600, 0xFFE800, 0xFFEA00, 0xFFEC00, 0xFFEE00, 0xFFF000, 0xFFF200, 0xFFF400, 0xFFF600, 0xFFF800, 0xFFFA00, 0xFFFC00); | |
var _local10:BitmapData = _arg1.clone(); | |
while (_local11 < _local10.height) { | |
_local8 = 0; | |
while (_local8 < _local10.width) { | |
_local2 = _local10.getPixel(_local8, _local11); | |
_local5 = ((_local2 >>> 16) & 0xFF); | |
_local6 = ((_local2 >>> 8) & 0xFF); | |
_local7 = (_local2 & 0xFF); | |
_local10.setPixel(_local8, _local11, _local9[int((((_local5 + _local6) + _local7) / 3))]); | |
_local8++; | |
}; | |
_local11++; | |
}; | |
var _local12:Bitmap = new Bitmap(_local10); | |
_local12.blendMode = "overlay"; | |
_local12.alpha = 0.5; | |
var _local13:Sprite = new Sprite(); | |
_local13.addChild(_local12); | |
_arg1.draw(_local13); | |
return (_arg1); | |
} | |
public static function Salomon(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0, 0, 65536, 65536, 65536, 131072, 131072, 131072, 196608, 196608, 262144, 262144, 262144, 327680, 327680, 327680, 393216, 393216, 458752, 458752, 458752, 524288, 524288, 589824, 589824, 589824, 655360, 655360, 720896, 720896, 786432, 786432, 851968, 851968, 917504, 917504, 983040, 983040, 0x100000, 0x100000, 0x110000, 0x110000, 0x120000, 0x120000, 0x130000, 0x140000, 0x140000, 0x150000, 0x160000, 0x160000, 0x170000, 0x170000, 0x180000, 0x190000, 0x1A0000, 0x1A0000, 0x1B0000, 0x1C0000, 0x1D0000, 0x1D0000, 0x1E0000, 0x1F0000, 0x200000, 0x210000, 0x220000, 0x220000, 0x230000, 0x240000, 0x250000, 0x260000, 0x270000, 0x280000, 0x290000, 0x2A0000, 0x2B0000, 0x2C0000, 0x2D0000, 0x2E0000, 0x2F0000, 0x300000, 0x320000, 0x330000, 0x340000, 0x350000, 0x360000, 0x380000, 0x390000, 0x3A0000, 0x3B0000, 0x3D0000, 0x3E0000, 0x3F0000, 0x400000, 0x420000, 0x430000, 0x440000, 0x460000, 0x470000, 0x490000, 0x4A0000, 0x4B0000, 0x4D0000, 0x4E0000, 0x500000, 0x510000, 0x520000, 0x540000, 0x550000, 0x570000, 0x580000, 0x5A0000, 0x5B0000, 0x5D0000, 0x5E0000, 0x600000, 0x610000, 0x630000, 0x640000, 0x660000, 0x680000, 0x690000, 0x6B0000, 0x6C0000, 0x6E0000, 0x6F0000, 0x710000, 0x730000, 0x740000, 0x760000, 0x770000, 0x790000, 0x7A0000, 0x7C0000, 0x7E0000, 0x7F0000, 0x810000, 0x820000, 0x840000, 0x860000, 0x870000, 0x890000, 0x8A0000, 0x8C0000, 0x8E0000, 0x8F0000, 0x910000, 0x920000, 0x940000, 0x950000, 0x970000, 0x990000, 0x9A0000, 0x9C0000, 0x9D0000, 0x9F0000, 0xA00000, 0xA20000, 0xA30000, 0xA50000, 0xA60000, 0xA80000, 0xAA0000, 0xAB0000, 0xAD0000, 0xAE0000, 0xAF0000, 0xB10000, 0xB20000, 0xB40000, 0xB50000, 0xB70000, 0xB80000, 0xBA0000, 0xBB0000, 0xBC0000, 0xBE0000, 0xBF0000, 0xC10000, 0xC20000, 0xC30000, 0xC50000, 0xC60000, 0xC70000, 0xC80000, 0xCA0000, 0xCB0000, 0xCC0000, 0xCD0000, 0xCF0000, 0xD00000, 0xD10000, 0xD20000, 0xD30000, 0xD50000, 0xD60000, 0xD70000, 0xD80000, 0xD90000, 0xDA0000, 0xDB0000, 0xDC0000, 0xDD0000, 0xDE0000, 0xDF0000, 0xE00000, 0xE10000, 0xE20000, 0xE30000, 0xE40000, 0xE50000, 0xE50000, 0xE60000, 0xE70000, 0xE80000, 0xE90000, 0xE90000, 0xEA0000, 0xEB0000, 0xEC0000, 0xEC0000, 0xED0000, 0xEE0000, 0xEE0000, 0xEF0000, 0xEF0000, 0xF00000, 0xF10000, 0xF10000, 0xF20000, 0xF20000, 0xF30000, 0xF40000, 0xF40000, 0xF50000, 0xF50000, 0xF60000, 0xF60000, 0xF70000, 0xF70000, 0xF80000, 0xF80000, 0xF90000, 0xF90000, 0xFA0000, 0xFA0000, 0xFB0000, 0xFB0000, 0xFB0000, 0xFC0000, 0xFC0000, 0xFD0000, 0xFD0000, 0xFE0000, 0xFE0000, 0xFF0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0x0100, 0x0200, 0x0200, 0x0300, 0x0400, 0x0500, 0x0500, 0x0600, 0x0700, 0x0800, 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0x0F00, 0x1000, 0x1100, 0x1200, 0x1200, 0x1300, 0x1400, 0x1500, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1D00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, 0x3000, 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4300, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6600, 0x6700, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0x7200, 0x7400, 0x7500, 0x7600, 0x7700, 0x7800, 0x7A00, 0x7B00, 0x7C00, 0x7D00, 0x7F00, 0x8000, 0x8100, 0x8300, 0x8400, 0x8500, 0x8700, 0x8800, 0x8900, 0x8A00, 0x8C00, 0x8D00, 0x8E00, 0x9000, 0x9100, 0x9300, 0x9400, 0x9500, 0x9700, 0x9800, 0x9900, 0x9B00, 0x9C00, 0x9D00, 0x9F00, 0xA000, 0xA200, 0xA300, 0xA400, 0xA600, 0xA700, 0xA800, 0xAA00, 0xAB00, 0xAC00, 0xAE00, 0xAF00, 0xB000, 0xB200, 0xB300, 0xB400, 0xB600, 0xB700, 0xB800, 0xBA00, 0xBB00, 0xBC00, 0xBE00, 0xBF00, 0xC000, 0xC100, 0xC300, 0xC400, 0xC500, 0xC600, 0xC700, 0xC900, 0xCA00, 0xCB00, 0xCC00, 0xCD00, 0xCF00, 0xD000, 0xD100, 0xD200, 0xD300, 0xD400, 0xD500, 0xD600, 0xD700, 0xD800, 0xD900, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDE00, 0xDF00, 0xE000, 0xE100, 0xE200, 0xE300, 0xE300, 0xE400, 0xE500, 0xE600, 0xE700, 0xE800, 0xE800, 0xE900, 0xEA00, 0xEB00, 0xEC00, 0xEC00, 0xED00, 0xEE00, 0xEF00, 0xEF00, 0xF000, 0xF100, 0xF200, 0xF200, 0xF300, 0xF400, 0xF500, 0xF500, 0xF600, 0xF700, 0xF700, 0xF800, 0xF900, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFC00, 0xFD00, 0xFE00, 0xFE00, 0xFF00); | |
var _local4:Array = new Array(56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 57, 57, 58, 58, 59, 60, 60, 61, 62, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 68, 69, 70, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 83, 83, 84, 84, 85, 86, 86, 87, 88, 88, 89, 89, 90, 91, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 97, 98, 99, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 110, 111, 112, 112, 113, 113, 114, 115, 115, 116, 117, 117, 118, 118, 119, 120, 120, 121, 121, 122, 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 131, 132, 133, 133, 134, 134, 135, 136, 136, 137, 138, 138, 139, 139, 140, 141, 141, 142, 143, 143, 144, 144, 145, 146, 146, 147, 147, 148, 149, 149, 150, 151, 151, 152, 152, 153, 154, 154, 155, 155, 156, 157, 157, 158, 159, 159, 160, 160, 161, 162, 162, 163, 164, 164, 165, 165, 166, 167, 167, 168, 168, 169, 170, 170, 171, 172, 172, 173, 173, 174, 175, 175, 176, 176, 177, 178, 178, 179, 180, 180, 181, 181, 182, 183, 183, 184, 185, 185, 186, 186, 187, 188, 188, 189, 189, 190, 191, 191, 192, 193, 193, 194, 194, 195, 196, 196, 197, 197, 198, 199, 199, 200, 201, 201, 202, 202, 203, 204, 204, 205, 206, 206, 207, 207, 208); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
_local2 = new Array(0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x160000, 0x170000, 0x180000, 0x190000, 0x1A0000, 0x1B0000, 0x1C0000, 0x1D0000, 0x1E0000, 0x1F0000, 0x200000, 0x210000, 0x220000, 0x230000, 0x240000, 0x250000, 0x260000, 0x270000, 0x280000, 0x290000, 0x2A0000, 0x2B0000, 0x2C0000, 0x2D0000, 0x2E0000, 0x2F0000, 0x300000, 0x310000, 0x320000, 0x330000, 0x340000, 0x350000, 0x360000, 0x370000, 0x380000, 0x390000, 0x3A0000, 0x3B0000, 0x3C0000, 0x3D0000, 0x3E0000, 0x3F0000, 0x400000, 0x410000, 0x420000, 0x430000, 0x440000, 0x450000, 0x460000, 0x470000, 0x480000, 0x490000, 0x4A0000, 0x4B0000, 0x4C0000, 0x4D0000, 0x4E0000, 0x4E0000, 0x4F0000, 0x500000, 0x510000, 0x520000, 0x530000, 0x540000, 0x550000, 0x560000, 0x570000, 0x580000, 0x590000, 0x5A0000, 0x5B0000, 0x5C0000, 0x5D0000, 0x5E0000, 0x5E0000, 0x5F0000, 0x600000, 0x610000, 0x620000, 0x630000, 0x640000, 0x650000, 0x660000, 0x670000, 0x680000, 0x680000, 0x690000, 0x6A0000, 0x6B0000, 0x6C0000, 0x6D0000, 0x6E0000, 0x6F0000, 0x6F0000, 0x700000, 0x710000, 0x720000, 0x730000, 0x740000, 0x750000, 0x750000, 0x760000, 0x770000, 0x780000, 0x790000, 0x7A0000, 0x7A0000, 0x7B0000, 0x7C0000, 0x7D0000, 0x7E0000, 0x7F0000, 0x7F0000, 0x800000, 0x810000, 0x820000, 0x830000, 0x830000, 0x840000, 0x850000, 0x860000, 0x860000, 0x870000, 0x880000, 0x890000, 0x8A0000, 0x8A0000, 0x8B0000, 0x8C0000, 0x8D0000, 0x8D0000, 0x8E0000, 0x8F0000, 0x8F0000, 0x900000, 0x910000, 0x920000, 0x920000, 0x930000, 0x940000, 0x940000, 0x950000, 0x960000, 0x970000, 0x970000, 0x980000, 0x990000, 0x990000, 0x9A0000, 0x9B0000, 0x9B0000, 0x9C0000, 0x9D0000, 0x9D0000, 0x9E0000, 0x9F0000, 0x9F0000, 0xA00000, 0xA10000, 0xA10000, 0xA20000, 0xA20000, 0xA30000, 0xA40000, 0xA40000, 0xA50000, 0xA60000, 0xA60000, 0xA70000, 0xA70000, 0xA80000, 0xA90000, 0xA90000, 0xAA0000, 0xAA0000, 0xAB0000, 0xAC0000, 0xAC0000, 0xAD0000, 0xAD0000, 0xAE0000, 0xAF0000, 0xAF0000, 0xB00000, 0xB00000, 0xB10000, 0xB20000, 0xB20000, 0xB30000, 0xB30000, 0xB40000, 0xB40000, 0xB50000, 0xB60000, 0xB60000, 0xB70000, 0xB70000, 0xB80000, 0xB80000, 0xB90000, 0xB90000, 0xBA0000, 0xBB0000, 0xBB0000, 0xBC0000, 0xBC0000, 0xBD0000, 0xBD0000, 0xBE0000, 0xBE0000, 0xBF0000, 0xC00000, 0xC00000, 0xC10000, 0xC10000, 0xC20000, 0xC20000, 0xC30000, 0xC30000, 0xC40000, 0xC40000, 0xC50000, 0xC50000, 0xC60000, 0xC70000, 0xC70000, 0xC80000, 0xC80000, 0xC90000, 0xC90000, 0xCA0000, 0xCA0000, 0xCB0000, 0xCB0000, 0xCC0000, 0xCC0000, 0xCD0000, 0xCD0000, 0xCE0000, 0xCE0000, 0xCF0000, 0xCF0000, 0xD00000, 0xD00000); | |
_local3 = new Array(0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, 0x5000, 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0x6800, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7600, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, 0x7F00, 0x8000, 0x8100, 0x8200, 0x8300, 0x8300, 0x8400, 0x8500, 0x8600, 0x8600, 0x8700, 0x8800, 0x8900, 0x8A00, 0x8A00, 0x8B00, 0x8C00, 0x8D00, 0x8D00, 0x8E00, 0x8F00, 0x8F00, 0x9000, 0x9100, 0x9200, 0x9200, 0x9300, 0x9400, 0x9400, 0x9500, 0x9600, 0x9700, 0x9700, 0x9800, 0x9900, 0x9900, 0x9A00, 0x9B00, 0x9B00, 0x9C00, 0x9D00, 0x9D00, 0x9E00, 0x9F00, 0x9F00, 0xA000, 0xA100, 0xA100, 0xA200, 0xA300, 0xA300, 0xA400, 0xA500, 0xA500, 0xA600, 0xA700, 0xA700, 0xA800, 0xA800, 0xA900, 0xAA00, 0xAA00, 0xAB00, 0xAC00, 0xAC00, 0xAD00, 0xAD00, 0xAE00, 0xAF00, 0xAF00, 0xB000, 0xB000, 0xB100, 0xB200, 0xB200, 0xB300, 0xB300, 0xB400, 0xB500, 0xB500, 0xB600, 0xB600, 0xB700, 0xB800, 0xB800, 0xB900, 0xB900, 0xBA00, 0xBA00, 0xBB00, 0xBC00, 0xBC00, 0xBD00, 0xBD00, 0xBE00, 0xBE00, 0xBF00, 0xC000, 0xC000, 0xC100, 0xC100, 0xC200, 0xC200, 0xC300, 0xC400, 0xC400, 0xC500, 0xC500, 0xC600, 0xC600, 0xC700, 0xC700, 0xC800, 0xC900, 0xC900, 0xCA00, 0xCA00, 0xCB00, 0xCB00, 0xCC00, 0xCC00, 0xCD00, 0xCE00, 0xCE00, 0xCF00, 0xCF00, 0xD000, 0xD000, 0xD100, 0xD100, 0xD200); | |
_local4 = new Array(23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 105, 106, 107, 108, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 118, 119, 120, 120, 121, 122, 123, 124, 125, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 133, 134, 135, 136, 136, 137, 138, 139, 139, 140, 141, 142, 142, 143, 144, 145, 145, 146, 147, 147, 148, 149, 150, 150, 151, 152, 152, 153, 154, 154, 155, 156, 156, 157, 158, 158, 159, 160, 160, 161, 161, 162, 163, 163, 164, 165, 165, 166, 166, 167, 168, 168, 169, 169, 170, 171, 171, 172, 172, 173, 174, 174, 175, 175, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 182, 183, 183, 184, 184, 185, 185, 186, 187, 187, 188, 188, 189, 189, 190, 190, 191, 191, 192, 192, 193, 193, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199, 199, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207, 208); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
return (_arg1); | |
} | |
public static function Anne(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0, 0, 65536, 65536, 131072, 131072, 196608, 196608, 262144, 262144, 327680, 327680, 393216, 393216, 458752, 458752, 524288, 524288, 589824, 589824, 655360, 655360, 720896, 720896, 786432, 851968, 851968, 917504, 983040, 983040, 0x100000, 0x110000, 0x110000, 0x120000, 0x130000, 0x140000, 0x140000, 0x150000, 0x160000, 0x170000, 0x180000, 0x190000, 0x1A0000, 0x1B0000, 0x1C0000, 0x1C0000, 0x1E0000, 0x1F0000, 0x200000, 0x210000, 0x220000, 0x230000, 0x240000, 0x250000, 0x270000, 0x280000, 0x290000, 0x2A0000, 0x2C0000, 0x2D0000, 0x2F0000, 0x300000, 0x310000, 0x330000, 0x350000, 0x360000, 0x380000, 0x390000, 0x3B0000, 0x3D0000, 0x3F0000, 0x400000, 0x420000, 0x440000, 0x460000, 0x480000, 0x4A0000, 0x4C0000, 0x4E0000, 0x500000, 0x520000, 0x540000, 0x570000, 0x590000, 0x5B0000, 0x5D0000, 0x600000, 0x620000, 0x640000, 0x670000, 0x690000, 0x6B0000, 0x6D0000, 0x6F0000, 0x720000, 0x740000, 0x760000, 0x780000, 0x7A0000, 0x7C0000, 0x7E0000, 0x800000, 0x820000, 0x840000, 0x860000, 0x880000, 0x8A0000, 0x8C0000, 0x8D0000, 0x8F0000, 0x910000, 0x930000, 0x950000, 0x960000, 0x980000, 0x9A0000, 0x9B0000, 0x9D0000, 0x9F0000, 0xA00000, 0xA20000, 0xA30000, 0xA50000, 0xA60000, 0xA80000, 0xA90000, 0xAB0000, 0xAC0000, 0xAE0000, 0xAF0000, 0xB10000, 0xB20000, 0xB30000, 0xB50000, 0xB60000, 0xB70000, 0xB90000, 0xBA0000, 0xBB0000, 0xBC0000, 0xBE0000, 0xBF0000, 0xC00000, 0xC10000, 0xC20000, 0xC40000, 0xC50000, 0xC60000, 0xC70000, 0xC80000, 0xC90000, 0xCA0000, 0xCB0000, 0xCC0000, 0xCD0000, 0xCE0000, 0xCF0000, 0xD00000, 0xD10000, 0xD20000, 0xD30000, 0xD40000, 0xD50000, 0xD50000, 0xD60000, 0xD70000, 0xD80000, 0xD90000, 0xDA0000, 0xDA0000, 0xDB0000, 0xDC0000, 0xDD0000, 0xDD0000, 0xDE0000, 0xDF0000, 0xE00000, 0xE00000, 0xE10000, 0xE20000, 0xE20000, 0xE30000, 0xE40000, 0xE40000, 0xE50000, 0xE50000, 0xE60000, 0xE70000, 0xE70000, 0xE80000, 0xE80000, 0xE90000, 0xE90000, 0xEA0000, 0xEB0000, 0xEB0000, 0xEC0000, 0xEC0000, 0xED0000, 0xED0000, 0xED0000, 0xEE0000, 0xEE0000, 0xEF0000, 0xEF0000, 0xF00000, 0xF00000, 0xF10000, 0xF10000, 0xF10000, 0xF20000, 0xF20000, 0xF30000, 0xF30000, 0xF30000, 0xF40000, 0xF40000, 0xF40000, 0xF50000, 0xF50000, 0xF50000, 0xF60000, 0xF60000, 0xF60000, 0xF70000, 0xF70000, 0xF70000, 0xF80000, 0xF80000, 0xF80000, 0xF90000, 0xF90000, 0xF90000, 0xF90000, 0xFA0000, 0xFA0000, 0xFA0000, 0xFA0000, 0xFB0000, 0xFB0000, 0xFB0000, 0xFC0000, 0xFC0000, 0xFC0000, 0xFC0000, 0xFD0000, 0xFD0000, 0xFD0000, 0xFD0000, 0xFE0000, 0xFE0000, 0xFE0000, 0xFE0000, 0xFF0000, 0xFF0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0x0100, 0x0100, 0x0200, 0x0200, 0x0300, 0x0400, 0x0400, 0x0500, 0x0600, 0x0600, 0x0700, 0x0700, 0x0800, 0x0900, 0x0900, 0x0A00, 0x0B00, 0x0B00, 0x0C00, 0x0D00, 0x0D00, 0x0E00, 0x0F00, 0x0F00, 0x1000, 0x1100, 0x1100, 0x1200, 0x1300, 0x1300, 0x1400, 0x1500, 0x1600, 0x1600, 0x1700, 0x1800, 0x1900, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1C00, 0x1D00, 0x1E00, 0x1F00, 0x2000, 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4400, 0x4500, 0x4600, 0x4700, 0x4900, 0x4A00, 0x4B00, 0x4D00, 0x4E00, 0x5000, 0x5100, 0x5200, 0x5400, 0x5500, 0x5700, 0x5800, 0x5A00, 0x5C00, 0x5D00, 0x5F00, 0x6000, 0x6200, 0x6400, 0x6500, 0x6700, 0x6900, 0x6A00, 0x6C00, 0x6E00, 0x7000, 0x7200, 0x7300, 0x7500, 0x7700, 0x7900, 0x7B00, 0x7C00, 0x7E00, 0x8000, 0x8200, 0x8400, 0x8500, 0x8700, 0x8900, 0x8A00, 0x8C00, 0x8E00, 0x8F00, 0x9100, 0x9300, 0x9400, 0x9600, 0x9700, 0x9900, 0x9A00, 0x9C00, 0x9D00, 0x9F00, 0xA000, 0xA200, 0xA300, 0xA500, 0xA600, 0xA700, 0xA900, 0xAA00, 0xAB00, 0xAD00, 0xAE00, 0xAF00, 0xB100, 0xB200, 0xB300, 0xB400, 0xB600, 0xB700, 0xB800, 0xB900, 0xBA00, 0xBB00, 0xBD00, 0xBE00, 0xBF00, 0xC000, 0xC100, 0xC200, 0xC300, 0xC400, 0xC500, 0xC600, 0xC700, 0xC800, 0xC900, 0xCA00, 0xCB00, 0xCC00, 0xCD00, 0xCE00, 0xCF00, 0xD000, 0xD100, 0xD100, 0xD200, 0xD300, 0xD400, 0xD500, 0xD600, 0xD600, 0xD700, 0xD800, 0xD900, 0xDA00, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDD00, 0xDE00, 0xDF00, 0xE000, 0xE000, 0xE100, 0xE200, 0xE200, 0xE300, 0xE400, 0xE400, 0xE500, 0xE600, 0xE600, 0xE700, 0xE800, 0xE800, 0xE900, 0xEA00, 0xEA00, 0xEB00, 0xEB00, 0xEC00, 0xED00, 0xED00, 0xEE00, 0xEE00, 0xEF00, 0xEF00, 0xF000, 0xF100, 0xF100, 0xF200, 0xF200, 0xF300, 0xF300, 0xF400, 0xF400, 0xF500, 0xF500, 0xF600, 0xF600, 0xF700, 0xF700, 0xF800, 0xF800, 0xF900, 0xF900, 0xFA00, 0xFA00, 0xFB00, 0xFB00, 0xFC00, 0xFC00, 0xFD00, 0xFE00, 0xFE00, 0xFF00, 0xFF00); | |
var _local4:Array = new Array(0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 83, 84, 84, 85, 86, 87, 88, 89, 89, 90, 91, 92, 93, 93, 94, 95, 96, 96, 97, 98, 99, 100, 100, 101, 102, 103, 103, 104, 105, 106, 106, 107, 108, 109, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 126, 127, 128, 129, 130, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 184, 185, 186, 187, 188, 189, 190, 191, 193, 194, 195, 196, 197, 198, 199, 201, 202, 203, 204, 205, 206, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 220, 222, 223, 224, 225, 226, 228, 229, 230, 231, 232, 233, 235, 236, 237, 238, 239, 241, 242, 243, 244, 245, 247, 248, 249, 250, 251, 253, 254, 0xFF); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
var _local5:ColorMatrix = new ColorMatrix(); | |
_local5.AdjustContrast(0.25); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local5.filter); | |
return (_arg1); | |
} | |
public static function Amber(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0, 131072, 196608, 327680, 458752, 524288, 655360, 786432, 851968, 983040, 0x110000, 0x120000, 0x140000, 0x160000, 0x180000, 0x190000, 0x1B0000, 0x1D0000, 0x1E0000, 0x200000, 0x220000, 0x230000, 0x250000, 0x260000, 0x280000, 0x2A0000, 0x2B0000, 0x2D0000, 0x2F0000, 0x300000, 0x320000, 0x340000, 0x350000, 0x370000, 0x390000, 0x3A0000, 0x3C0000, 0x3D0000, 0x3F0000, 0x410000, 0x420000, 0x440000, 0x450000, 0x470000, 0x490000, 0x4A0000, 0x4C0000, 0x4D0000, 0x4F0000, 0x500000, 0x520000, 0x530000, 0x550000, 0x570000, 0x580000, 0x5A0000, 0x5B0000, 0x5D0000, 0x5E0000, 0x600000, 0x610000, 0x630000, 0x640000, 0x660000, 0x670000, 0x690000, 0x6A0000, 0x6B0000, 0x6D0000, 0x6E0000, 0x700000, 0x710000, 0x730000, 0x740000, 0x750000, 0x770000, 0x780000, 0x790000, 0x7B0000, 0x7C0000, 0x7E0000, 0x7F0000, 0x800000, 0x820000, 0x830000, 0x840000, 0x850000, 0x870000, 0x880000, 0x890000, 0x8B0000, 0x8C0000, 0x8D0000, 0x8E0000, 0x8F0000, 0x910000, 0x920000, 0x930000, 0x940000, 0x950000, 0x970000, 0x980000, 0x990000, 0x9A0000, 0x9B0000, 0x9C0000, 0x9D0000, 0x9E0000, 0x9F0000, 0xA10000, 0xA20000, 0xA30000, 0xA40000, 0xA50000, 0xA60000, 0xA70000, 0xA80000, 0xA90000, 0xAA0000, 0xAB0000, 0xAC0000, 0xAD0000, 0xAE0000, 0xAF0000, 0xB00000, 0xB10000, 0xB20000, 0xB30000, 0xB30000, 0xB40000, 0xB50000, 0xB60000, 0xB70000, 0xB80000, 0xB90000, 0xBA0000, 0xBB0000, 0xBB0000, 0xBC0000, 0xBD0000, 0xBE0000, 0xBF0000, 0xC00000, 0xC00000, 0xC10000, 0xC20000, 0xC30000, 0xC40000, 0xC40000, 0xC50000, 0xC60000, 0xC70000, 0xC70000, 0xC80000, 0xC90000, 0xCA0000, 0xCA0000, 0xCB0000, 0xCC0000, 0xCD0000, 0xCD0000, 0xCE0000, 0xCF0000, 0xCF0000, 0xD00000, 0xD10000, 0xD10000, 0xD20000, 0xD30000, 0xD30000, 0xD40000, 0xD50000, 0xD50000, 0xD60000, 0xD70000, 0xD70000, 0xD80000, 0xD80000, 0xD90000, 0xDA0000, 0xDA0000, 0xDB0000, 0xDB0000, 0xDC0000, 0xDD0000, 0xDD0000, 0xDE0000, 0xDE0000, 0xDF0000, 0xE00000, 0xE00000, 0xE10000, 0xE10000, 0xE20000, 0xE20000, 0xE30000, 0xE30000, 0xE40000, 0xE40000, 0xE50000, 0xE60000, 0xE60000, 0xE70000, 0xE70000, 0xE80000, 0xE80000, 0xE90000, 0xE90000, 0xEA0000, 0xEA0000, 0xEB0000, 0xEB0000, 0xEC0000, 0xEC0000, 0xED0000, 0xED0000, 0xEE0000, 0xEE0000, 0xEE0000, 0xEF0000, 0xEF0000, 0xF00000, 0xF00000, 0xF10000, 0xF10000, 0xF20000, 0xF20000, 0xF30000, 0xF30000, 0xF40000, 0xF40000, 0xF40000, 0xF50000, 0xF50000, 0xF60000, 0xF60000, 0xF70000, 0xF70000, 0xF80000, 0xF80000, 0xF80000, 0xF90000, 0xF90000, 0xFA0000, 0xFA0000, 0xFB0000, 0xFB0000, 0xFC0000, 0xFC0000, 0xFC0000, 0xFD0000, 0xFD0000, 0xFE0000, 0xFE0000, 0xFF0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0x0100, 0x0100, 0x0200, 0x0300, 0x0300, 0x0400, 0x0400, 0x0500, 0x0600, 0x0600, 0x0700, 0x0800, 0x0800, 0x0900, 0x0A00, 0x0A00, 0x0B00, 0x0B00, 0x0C00, 0x0D00, 0x0D00, 0x0E00, 0x0F00, 0x0F00, 0x1000, 0x1100, 0x1100, 0x1200, 0x1300, 0x1300, 0x1400, 0x1400, 0x1500, 0x1600, 0x1600, 0x1700, 0x1800, 0x1800, 0x1900, 0x1A00, 0x1A00, 0x1B00, 0x1C00, 0x1C00, 0x1D00, 0x1E00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2100, 0x2200, 0x2300, 0x2300, 0x2400, 0x2500, 0x2500, 0x2600, 0x2700, 0x2800, 0x2800, 0x2900, 0x2A00, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2D00, 0x2E00, 0x2F00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3200, 0x3300, 0x3400, 0x3500, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, 0x5000, 0x5100, 0x5200, 0x5300, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7600, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7C00, 0x7D00, 0x7F00, 0x8000, 0x8100, 0x8200, 0x8300, 0x8400, 0x8500, 0x8700, 0x8800, 0x8900, 0x8A00, 0x8B00, 0x8D00, 0x8E00, 0x8F00, 0x9000, 0x9100, 0x9300, 0x9400, 0x9500, 0x9600, 0x9800, 0x9900, 0x9A00, 0x9B00, 0x9D00, 0x9E00, 0x9F00, 0xA000, 0xA200, 0xA300, 0xA400, 0xA500, 0xA700, 0xA800, 0xA900, 0xAB00, 0xAC00, 0xAD00, 0xAE00, 0xB000, 0xB100, 0xB200, 0xB400, 0xB500, 0xB600, 0xB800, 0xB900, 0xBA00, 0xBC00, 0xBD00, 0xBE00, 0xC000, 0xC100, 0xC200, 0xC400, 0xC500, 0xC600, 0xC800, 0xC900, 0xCA00, 0xCC00, 0xCD00, 0xCF00, 0xD000, 0xD100, 0xD300, 0xD400, 0xD500, 0xD700, 0xD800, 0xD900, 0xDB00, 0xDC00, 0xDE00, 0xDF00, 0xE000, 0xE200, 0xE300, 0xE500, 0xE600, 0xE700, 0xE900, 0xEA00, 0xEB00, 0xED00, 0xEE00, 0xF000, 0xF100, 0xF200, 0xF400, 0xF500, 0xF700, 0xF800, 0xF900, 0xFB00, 0xFC00, 0xFE00, 0xFF00); | |
var _local4:Array = new Array(127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
return (_arg1); | |
} | |
public static function Peter(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(786432, 851968, 851968, 917504, 917504, 983040, 0x100000, 0x100000, 0x110000, 0x110000, 0x120000, 0x120000, 0x130000, 0x130000, 0x140000, 0x140000, 0x140000, 0x150000, 0x150000, 0x150000, 0x160000, 0x160000, 0x160000, 0x160000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x170000, 0x180000, 0x180000, 0x180000, 0x180000, 0x180000, 0x190000, 0x190000, 0x190000, 0x1A0000, 0x1A0000, 0x1B0000, 0x1B0000, 0x1C0000, 0x1D0000, 0x1D0000, 0x1E0000, 0x1F0000, 0x200000, 0x200000, 0x210000, 0x220000, 0x230000, 0x240000, 0x250000, 0x260000, 0x270000, 0x280000, 0x290000, 0x2A0000, 0x2B0000, 0x2C0000, 0x2E0000, 0x2F0000, 0x300000, 0x310000, 0x320000, 0x340000, 0x350000, 0x360000, 0x370000, 0x390000, 0x3A0000, 0x3B0000, 0x3C0000, 0x3E0000, 0x3F0000, 0x400000, 0x420000, 0x430000, 0x440000, 0x460000, 0x470000, 0x480000, 0x4A0000, 0x4B0000, 0x4C0000, 0x4E0000, 0x4F0000, 0x500000, 0x510000, 0x530000, 0x540000, 0x550000, 0x570000, 0x580000, 0x590000, 0x5B0000, 0x5C0000, 0x5D0000, 0x5E0000, 0x600000, 0x610000, 0x620000, 0x640000, 0x650000, 0x660000, 0x670000, 0x690000, 0x6A0000, 0x6B0000, 0x6D0000, 0x6E0000, 0x6F0000, 0x700000, 0x720000, 0x730000, 0x740000, 0x750000, 0x770000, 0x780000, 0x790000, 0x7A0000, 0x7C0000, 0x7D0000, 0x7E0000, 0x7F0000, 0x810000, 0x820000, 0x830000, 0x840000, 0x850000, 0x870000, 0x880000, 0x890000, 0x8A0000, 0x8B0000, 0x8D0000, 0x8E0000, 0x8F0000, 0x900000, 0x910000, 0x920000, 0x940000, 0x950000, 0x960000, 0x970000, 0x980000, 0x990000, 0x9A0000, 0x9C0000, 0x9D0000, 0x9E0000, 0x9F0000, 0xA00000, 0xA10000, 0xA20000, 0xA30000, 0xA40000, 0xA50000, 0xA70000, 0xA80000, 0xA90000, 0xAA0000, 0xAB0000, 0xAC0000, 0xAD0000, 0xAE0000, 0xAF0000, 0xB00000, 0xB10000, 0xB20000, 0xB30000, 0xB40000, 0xB50000, 0xB60000, 0xB70000, 0xB80000, 0xB90000, 0xBA0000, 0xBB0000, 0xBB0000, 0xBC0000, 0xBD0000, 0xBE0000, 0xBF0000, 0xC00000, 0xC10000, 0xC20000, 0xC30000, 0xC30000, 0xC40000, 0xC50000, 0xC60000, 0xC70000, 0xC80000, 0xC80000, 0xC90000, 0xCA0000, 0xCB0000, 0xCC0000, 0xCC0000, 0xCD0000, 0xCE0000, 0xCF0000, 0xD00000, 0xD00000, 0xD10000, 0xD20000, 0xD30000, 0xD30000, 0xD40000, 0xD50000, 0xD60000, 0xD60000, 0xD70000, 0xD80000, 0xD80000, 0xD90000, 0xDA0000, 0xDA0000, 0xDB0000, 0xDC0000, 0xDD0000, 0xDD0000, 0xDE0000, 0xDF0000, 0xDF0000, 0xE00000, 0xE10000, 0xE10000, 0xE20000, 0xE30000, 0xE30000, 0xE40000, 0xE50000, 0xE50000, 0xE60000, 0xE70000, 0xE70000, 0xE80000, 0xE90000, 0xE90000, 0xEA0000); | |
var _local3:Array = new Array(0x0900, 0x0A00, 0x0A00, 0x0B00, 0x0B00, 0x0C00, 0x0D00, 0x0D00, 0x0E00, 0x0E00, 0x0F00, 0x1000, 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1F00, 0x2000, 0x2100, 0x2200, 0x2300, 0x2500, 0x2600, 0x2700, 0x2900, 0x2A00, 0x2B00, 0x2D00, 0x2E00, 0x3000, 0x3100, 0x3200, 0x3400, 0x3500, 0x3700, 0x3800, 0x3900, 0x3B00, 0x3C00, 0x3E00, 0x3F00, 0x4000, 0x4200, 0x4300, 0x4400, 0x4600, 0x4700, 0x4800, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4F00, 0x5000, 0x5100, 0x5200, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6400, 0x6500, 0x6600, 0x6700, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, 0x8000, 0x8000, 0x8100, 0x8200, 0x8300, 0x8400, 0x8500, 0x8600, 0x8700, 0x8800, 0x8900, 0x8900, 0x8A00, 0x8B00, 0x8C00, 0x8D00, 0x8E00, 0x8F00, 0x8F00, 0x9000, 0x9100, 0x9200, 0x9300, 0x9400, 0x9400, 0x9500, 0x9600, 0x9700, 0x9800, 0x9900, 0x9900, 0x9A00, 0x9B00, 0x9C00, 0x9D00, 0x9D00, 0x9E00, 0x9F00, 0xA000, 0xA000, 0xA100, 0xA200, 0xA300, 0xA400, 0xA400, 0xA500, 0xA600, 0xA700, 0xA700, 0xA800, 0xA900, 0xAA00, 0xAA00, 0xAB00, 0xAC00, 0xAC00, 0xAD00, 0xAE00, 0xAF00, 0xAF00, 0xB000, 0xB100, 0xB200, 0xB200, 0xB300, 0xB400, 0xB400, 0xB500, 0xB600, 0xB700, 0xB700, 0xB800, 0xB900, 0xB900, 0xBA00, 0xBB00, 0xBB00, 0xBC00, 0xBD00, 0xBE00, 0xBE00, 0xBF00, 0xC000, 0xC000, 0xC100, 0xC200, 0xC200, 0xC300, 0xC400, 0xC400, 0xC500, 0xC600, 0xC600, 0xC700, 0xC800, 0xC900, 0xC900, 0xCA00, 0xCB00, 0xCB00, 0xCC00, 0xCD00, 0xCD00, 0xCE00, 0xCF00, 0xCF00, 0xD000, 0xD100, 0xD100, 0xD200, 0xD300, 0xD300, 0xD400, 0xD500, 0xD500, 0xD600, 0xD600, 0xD700, 0xD800, 0xD800, 0xD900, 0xDA00, 0xDA00, 0xDB00, 0xDC00, 0xDC00, 0xDD00, 0xDE00, 0xDE00, 0xDF00, 0xE000, 0xE000, 0xE100, 0xE200, 0xE200, 0xE300, 0xE400, 0xE400, 0xE500, 0xE500, 0xE600, 0xE700, 0xE700, 0xE800, 0xE900, 0xE900, 0xEA00); | |
var _local4:Array = new Array(32, 33, 34, 35, 36, 37, 38, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 113, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, 141, 142, 142, 143, 143, 144, 144, 144, 145, 145, 146, 146, 146, 147, 147, 148, 148, 148, 149, 149, 149, 150, 150, 150, 151, 151, 151, 152, 152, 152, 153, 153, 153, 154, 154, 154, 155, 155, 155, 156, 156, 156, 157, 157, 157, 158, 158, 158, 159, 159, 159, 160, 160, 160, 161, 161, 161, 162, 162, 162, 163, 163, 163, 164, 164, 164, 165, 165, 166, 166, 166, 167, 167, 168, 168, 168, 169, 169, 169, 170, 170, 171, 171, 171, 172, 172, 172, 173, 173, 173, 174, 174, 174, 175, 175, 175, 175, 176, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
return (_arg1); | |
} | |
public static function Karen(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0, 131072, 262144, 393216, 458752, 589824, 720896, 851968, 983040, 0x110000, 0x120000, 0x140000, 0x160000, 0x180000, 0x1A0000, 0x1B0000, 0x1D0000, 0x1F0000, 0x210000, 0x230000, 0x250000, 0x260000, 0x280000, 0x2A0000, 0x2C0000, 0x2E0000, 0x2F0000, 0x310000, 0x330000, 0x350000, 0x360000, 0x380000, 0x3A0000, 0x3C0000, 0x3D0000, 0x3F0000, 0x410000, 0x430000, 0x440000, 0x460000, 0x480000, 0x4A0000, 0x4B0000, 0x4D0000, 0x4F0000, 0x500000, 0x520000, 0x540000, 0x550000, 0x570000, 0x590000, 0x5A0000, 0x5C0000, 0x5E0000, 0x5F0000, 0x610000, 0x620000, 0x640000, 0x660000, 0x670000, 0x690000, 0x6A0000, 0x6C0000, 0x6D0000, 0x6F0000, 0x710000, 0x720000, 0x740000, 0x750000, 0x770000, 0x780000, 0x790000, 0x7B0000, 0x7C0000, 0x7E0000, 0x7F0000, 0x810000, 0x820000, 0x830000, 0x850000, 0x860000, 0x870000, 0x890000, 0x8A0000, 0x8B0000, 0x8D0000, 0x8E0000, 0x8F0000, 0x910000, 0x920000, 0x930000, 0x940000, 0x960000, 0x970000, 0x980000, 0x990000, 0x9A0000, 0x9C0000, 0x9D0000, 0x9E0000, 0x9F0000, 0xA00000, 0xA10000, 0xA20000, 0xA40000, 0xA50000, 0xA60000, 0xA70000, 0xA80000, 0xA90000, 0xAA0000, 0xAB0000, 0xAC0000, 0xAD0000, 0xAE0000, 0xAF0000, 0xB00000, 0xB10000, 0xB20000, 0xB30000, 0xB40000, 0xB50000, 0xB60000, 0xB70000, 0xB80000, 0xB90000, 0xB90000, 0xBA0000, 0xBB0000, 0xBC0000, 0xBD0000, 0xBE0000, 0xBF0000, 0xC00000, 0xC00000, 0xC10000, 0xC20000, 0xC30000, 0xC40000, 0xC50000, 0xC50000, 0xC60000, 0xC70000, 0xC80000, 0xC80000, 0xC90000, 0xCA0000, 0xCB0000, 0xCB0000, 0xCC0000, 0xCD0000, 0xCE0000, 0xCE0000, 0xCF0000, 0xD00000, 0xD00000, 0xD10000, 0xD20000, 0xD20000, 0xD30000, 0xD40000, 0xD40000, 0xD50000, 0xD60000, 0xD60000, 0xD70000, 0xD70000, 0xD80000, 0xD90000, 0xD90000, 0xDA0000, 0xDA0000, 0xDB0000, 0xDC0000, 0xDC0000, 0xDD0000, 0xDD0000, 0xDE0000, 0xDE0000, 0xDF0000, 0xE00000, 0xE00000, 0xE10000, 0xE10000, 0xE20000, 0xE20000, 0xE30000, 0xE30000, 0xE40000, 0xE40000, 0xE50000, 0xE50000, 0xE60000, 0xE60000, 0xE70000, 0xE70000, 0xE80000, 0xE80000, 0xE90000, 0xE90000, 0xE90000, 0xEA0000, 0xEA0000, 0xEB0000, 0xEB0000, 0xEC0000, 0xEC0000, 0xED0000, 0xED0000, 0xED0000, 0xEE0000, 0xEE0000, 0xEF0000, 0xEF0000, 0xF00000, 0xF00000, 0xF00000, 0xF10000, 0xF10000, 0xF20000, 0xF20000, 0xF20000, 0xF30000, 0xF30000, 0xF40000, 0xF40000, 0xF40000, 0xF50000, 0xF50000, 0xF50000, 0xF60000, 0xF60000, 0xF70000, 0xF70000, 0xF70000, 0xF80000, 0xF80000, 0xF80000, 0xF90000, 0xF90000, 0xFA0000, 0xFA0000, 0xFA0000, 0xFB0000, 0xFB0000, 0xFB0000, 0xFC0000, 0xFC0000, 0xFC0000, 0xFD0000, 0xFD0000, 0xFE0000, 0xFE0000, 0xFE0000, 0xFF0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0x0100, 0x0200, 0x0200, 0x0300, 0x0400, 0x0500, 0x0500, 0x0600, 0x0700, 0x0800, 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0x0F00, 0x1000, 0x1100, 0x1200, 0x1300, 0x1300, 0x1400, 0x1500, 0x1600, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2200, 0x2200, 0x2300, 0x2400, 0x2500, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2E00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, 0x5000, 0x5100, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, 0x8000, 0x8100, 0x8200, 0x8300, 0x8400, 0x8500, 0x8600, 0x8700, 0x8900, 0x8A00, 0x8B00, 0x8C00, 0x8D00, 0x8E00, 0x8F00, 0x9000, 0x9100, 0x9200, 0x9400, 0x9500, 0x9600, 0x9700, 0x9800, 0x9900, 0x9A00, 0x9B00, 0x9D00, 0x9E00, 0x9F00, 0xA000, 0xA100, 0xA200, 0xA300, 0xA500, 0xA600, 0xA700, 0xA800, 0xA900, 0xAA00, 0xAC00, 0xAD00, 0xAE00, 0xAF00, 0xB000, 0xB100, 0xB300, 0xB400, 0xB500, 0xB600, 0xB700, 0xB900, 0xBA00, 0xBB00, 0xBC00, 0xBD00, 0xBF00, 0xC000, 0xC100, 0xC200, 0xC300, 0xC500, 0xC600, 0xC700, 0xC800, 0xCA00, 0xCB00, 0xCC00, 0xCD00, 0xCE00, 0xD000, 0xD100, 0xD200, 0xD300, 0xD500, 0xD600, 0xD700, 0xD800, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDE00, 0xE000, 0xE100, 0xE200, 0xE300, 0xE500, 0xE600, 0xE700, 0xE800, 0xEA00, 0xEB00, 0xEC00, 0xED00, 0xEF00, 0xF000, 0xF100, 0xF200, 0xF400, 0xF500, 0xF600, 0xF700, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFE00, 0xFF00); | |
var _local4:Array = new Array(0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 34, 34, 35, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 86, 87, 88, 90, 91, 92, 94, 95, 96, 98, 99, 101, 102, 104, 105, 106, 108, 109, 111, 113, 114, 116, 117, 119, 120, 122, 124, 125, 127, 129, 130, 132, 134, 136, 137, 139, 141, 143, 145, 146, 148, 150, 152, 154, 156, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 247, 249, 251, 253, 0xFF); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
return (_arg1); | |
} | |
public static function William(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = _arg1.clone(); | |
var _local3:Bitmap = new Bitmap(_local2); | |
_local3.width = (_local3.width + 30); | |
_local3.height = (_local3.height + 30); | |
_local3.x = (_local3.y = -15); | |
_local3.alpha = 0.3; | |
var _local4:Sprite = new Sprite(); | |
_local4.addChild(_local3); | |
_arg1.draw(_local4); | |
return (_arg1); | |
} | |
public static function Julia(_arg1:BitmapData):BitmapData{ | |
var _local2:ColorMatrix; | |
var _local3:uint; | |
var _local4:int; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
var _local8:int; | |
var _local9:int; | |
_local2 = new ColorMatrix(); | |
_local2.AdjustSaturation(2); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2.filter); | |
_arg1.lock(); | |
while (_local9 < _arg1.height) { | |
_local8 = 0; | |
while (_local8 < _arg1.width) { | |
_local3 = _arg1.getPixel(_local8, _local9); | |
_local5 = ((_local3 >>> 16) & 0xFF); | |
_local6 = ((_local3 >>> 8) & 0xFF); | |
_local7 = (_local3 & 0xFF); | |
_local5 = (((_local5 * 0.393) + (_local6 * 0.769)) + (_local7 * 0.189)); | |
_local6 = (((_local5 * 0.349) + (_local6 * 0.686)) + (_local7 * 0.168)); | |
_local7 = (((_local5 * 0.272) + (_local6 * 0.534)) + (_local7 * 0.131)); | |
if (_local5 > 0xFF){ | |
_local5 = 0xFF; | |
} else { | |
if (_local5 < 0){ | |
_local5 = 0; | |
}; | |
}; | |
if (_local6 > 0xFF){ | |
_local6 = 0xFF; | |
} else { | |
if (_local6 < 0){ | |
_local6 = 0; | |
}; | |
}; | |
if (_local7 > 0xFF){ | |
_local7 = 0xFF; | |
} else { | |
if (_local7 < 0){ | |
_local7 = 0; | |
}; | |
}; | |
_arg1.setPixel(_local8, _local9, (((_local5 << 16) | (_local6 << 8)) | _local7)); | |
_local8++; | |
}; | |
_local9++; | |
}; | |
_arg1.unlock(); | |
_local2 = new ColorMatrix(); | |
_local2.AdjustSaturation(2); | |
_local2.AdjustContrast(0.1); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2.filter); | |
return (_arg1); | |
} | |
public static function Leslie(_arg1:BitmapData):BitmapData{ | |
var _local2:BitmapData = new BitmapData(_arg1.width, _arg1.height, true, 0xFFFFFF); | |
_local2.perlinNoise(20, 20, 5, 5643, true, true, BitmapDataChannel.BLUE, true, null); | |
var _local3:DisplacementMapFilter = new DisplacementMapFilter(); | |
_local3.mapBitmap = _local2; | |
_local3.scaleX = (_local3.scaleY = 8); | |
_local3.mode = DisplacementMapFilterMode.CLAMP; | |
_local3.componentX = (_local3.componentY = BitmapDataChannel.RED); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local3); | |
return (_arg1); | |
} | |
public static function Greg(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0, 65536, 65536, 131072, 131072, 196608, 196608, 262144, 327680, 327680, 393216, 393216, 458752, 524288, 524288, 589824, 589824, 655360, 720896, 720896, 786432, 786432, 851968, 917504, 917504, 983040, 0x100000, 0x100000, 0x110000, 0x110000, 0x120000, 0x130000, 0x130000, 0x140000, 0x150000, 0x150000, 0x160000, 0x170000, 0x180000, 0x180000, 0x190000, 0x1A0000, 0x1A0000, 0x1B0000, 0x1C0000, 0x1D0000, 0x1D0000, 0x1E0000, 0x1F0000, 0x200000, 0x210000, 0x210000, 0x220000, 0x230000, 0x240000, 0x250000, 0x260000, 0x260000, 0x270000, 0x280000, 0x290000, 0x2A0000, 0x2B0000, 0x2C0000, 0x2D0000, 0x2E0000, 0x2F0000, 0x300000, 0x310000, 0x320000, 0x330000, 0x340000, 0x350000, 0x360000, 0x370000, 0x380000, 0x390000, 0x3A0000, 0x3B0000, 0x3C0000, 0x3D0000, 0x3F0000, 0x400000, 0x410000, 0x420000, 0x430000, 0x440000, 0x460000, 0x470000, 0x480000, 0x490000, 0x4A0000, 0x4C0000, 0x4D0000, 0x4E0000, 0x4F0000, 0x510000, 0x520000, 0x530000, 0x540000, 0x560000, 0x570000, 0x580000, 0x5A0000, 0x5B0000, 0x5C0000, 0x5E0000, 0x5F0000, 0x600000, 0x620000, 0x630000, 0x640000, 0x660000, 0x670000, 0x690000, 0x6A0000, 0x6B0000, 0x6D0000, 0x6E0000, 0x700000, 0x710000, 0x730000, 0x740000, 0x760000, 0x770000, 0x790000, 0x7A0000, 0x7C0000, 0x7D0000, 0x7E0000, 0x800000, 0x820000, 0x830000, 0x850000, 0x860000, 0x880000, 0x890000, 0x8B0000, 0x8C0000, 0x8E0000, 0x8F0000, 0x910000, 0x920000, 0x940000, 0x950000, 0x970000, 0x980000, 0x9A0000, 0x9B0000, 0x9D0000, 0x9E0000, 0xA00000, 0xA10000, 0xA30000, 0xA40000, 0xA60000, 0xA70000, 0xA90000, 0xAA0000, 0xAC0000, 0xAD0000, 0xAF0000, 0xB00000, 0xB10000, 0xB30000, 0xB40000, 0xB60000, 0xB70000, 0xB80000, 0xBA0000, 0xBB0000, 0xBC0000, 0xBD0000, 0xBF0000, 0xC00000, 0xC10000, 0xC20000, 0xC40000, 0xC50000, 0xC60000, 0xC70000, 0xC80000, 0xC90000, 0xCA0000, 0xCC0000, 0xCD0000, 0xCE0000, 0xCF0000, 0xD00000, 0xD10000, 0xD20000, 0xD30000, 0xD40000, 0xD50000, 0xD60000, 0xD70000, 0xD80000, 0xD80000, 0xD90000, 0xDA0000, 0xDB0000, 0xDC0000, 0xDD0000, 0xDE0000, 0xDE0000, 0xDF0000, 0xE00000, 0xE10000, 0xE20000, 0xE20000, 0xE30000, 0xE40000, 0xE50000, 0xE50000, 0xE60000, 0xE70000, 0xE80000, 0xE80000, 0xE90000, 0xEA0000, 0xEA0000, 0xEB0000, 0xEC0000, 0xEC0000, 0xED0000, 0xEE0000, 0xEE0000, 0xEF0000, 0xF00000, 0xF00000, 0xF10000, 0xF10000, 0xF20000, 0xF30000, 0xF30000, 0xF40000, 0xF40000, 0xF50000, 0xF60000, 0xF60000, 0xF70000, 0xF70000, 0xF80000, 0xF80000, 0xF90000, 0xF90000, 0xFA0000, 0xFB0000, 0xFB0000, 0xFC0000, 0xFC0000, 0xFD0000, 0xFD0000, 0xFE0000, 0xFE0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0200, 0x0200, 0x0200, 0x0200, 0x0300, 0x0300, 0x0300, 0x0400, 0x0400, 0x0500, 0x0500, 0x0600, 0x0600, 0x0700, 0x0700, 0x0800, 0x0900, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0E00, 0x0F00, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1700, 0x1800, 0x1900, 0x1B00, 0x1C00, 0x1E00, 0x2000, 0x2100, 0x2300, 0x2500, 0x2700, 0x2900, 0x2B00, 0x2D00, 0x2F00, 0x3100, 0x3400, 0x3600, 0x3800, 0x3B00, 0x3D00, 0x4000, 0x4200, 0x4500, 0x4800, 0x4A00, 0x4D00, 0x5000, 0x5300, 0x5500, 0x5800, 0x5B00, 0x5E00, 0x6100, 0x6300, 0x6600, 0x6900, 0x6C00, 0x6E00, 0x7100, 0x7400, 0x7600, 0x7900, 0x7B00, 0x7E00, 0x8000, 0x8300, 0x8500, 0x8800, 0x8A00, 0x8C00, 0x8E00, 0x9000, 0x9200, 0x9500, 0x9700, 0x9800, 0x9A00, 0x9C00, 0x9E00, 0xA000, 0xA200, 0xA300, 0xA500, 0xA700, 0xA800, 0xAA00, 0xAB00, 0xAD00, 0xAE00, 0xB000, 0xB100, 0xB200, 0xB400, 0xB500, 0xB600, 0xB700, 0xB800, 0xB900, 0xBB00, 0xBC00, 0xBD00, 0xBE00, 0xBF00, 0xBF00, 0xC000, 0xC100, 0xC200, 0xC300, 0xC400, 0xC400, 0xC500, 0xC600, 0xC700, 0xC700, 0xC800, 0xC800, 0xC900, 0xCA00, 0xCA00, 0xCB00, 0xCB00, 0xCC00, 0xCC00, 0xCC00, 0xCD00, 0xCD00, 0xCE00, 0xCE00, 0xCE00, 0xCF00, 0xCF00, 0xCF00, 0xCF00, 0xD000, 0xD000, 0xD000, 0xD000, 0xD000, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD200, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100); | |
var _local4:Array = new Array(0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 39, 40, 41, 43, 44, 45, 47, 48, 50, 51, 53, 54, 56, 57, 59, 60, 62, 63, 65, 67, 68, 70, 71, 73, 75, 77, 78, 80, 82, 83, 85, 87, 89, 90, 92, 94, 96, 98, 99, 101, 103, 105, 107, 108, 110, 112, 114, 116, 118, 119, 121, 123, 125, 127, 129, 131, 132, 134, 136, 138, 140, 142, 143, 145, 147, 149, 151, 152, 154, 156, 158, 160, 161, 163, 165, 167, 168, 170, 172, 173, 175, 177, 178, 180, 182, 183, 185, 187, 188, 190, 191, 193, 194, 196, 197, 199, 200, 202, 203, 205, 206, 207, 209, 210, 211, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 232, 233, 234, 235, 235, 236, 237, 238, 238, 239, 239, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248, 248, 248, 249, 249, 249, 250, 250, 250, 250, 251, 251, 251, 251, 252, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 0xFF, 0xFF, 0xFF, 0xFF); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
return (_arg1); | |
} | |
public static function Hagrid(_arg1:BitmapData):BitmapData{ | |
var _local2:ColorMatrix; | |
var _local3:BitmapData; | |
var _local4:BitmapData; | |
var _local5:BitmapData; | |
var _local6:BitmapData; | |
var _local7:* = 1; | |
_local6 = _arg1.clone(); | |
_local3 = _arg1.clone(); | |
_local5 = _arg1.clone(); | |
_local2 = new ColorMatrix(); | |
_local2.Invert(); | |
_local5.applyFilter(_local5, _local5.rect, _local5.rect.topLeft, _local2.filter); | |
_local5.applyFilter(_local5, _local5.rect, _local5.rect.topLeft, new BlurFilter(5, 5, 3)); | |
var _local8:Bitmap = new Bitmap(_local5); | |
_local8.alpha = 0.4; | |
var _local9:Sprite = new Sprite(); | |
_local9.addChild(_local8); | |
_local3.draw(_local9); | |
var _local10:ChannelMap = new ChannelMap(); | |
_local10.minin = 85; | |
_local10.maxin = 170; | |
_local3.paletteMap(_local3, _local3.rect, _local3.rect.topLeft, _local10.ComputeArray(16), _local10.ComputeArray(8), _local10.ComputeArray(0)); | |
_local4 = _local6.clone(); | |
_local2 = new ColorMatrix(); | |
_local2.Invert(); | |
_local2.Desaturate(); | |
_local4.applyFilter(_local4, _local4.rect, _local4.rect.topLeft, _local2.filter); | |
_local4.applyFilter(_local4, _local4.rect, _local4.rect.topLeft, new BlurFilter(50, 50, 10)); | |
var _local11:Bitmap = new Bitmap(_local4); | |
_local11.blendMode = "overlay"; | |
var _local12:Sprite = new Sprite(); | |
_local12.addChild(_local11); | |
_arg1.draw(_local12); | |
var _local13:Bitmap = new Bitmap(_local3); | |
_local13.blendMode = "overlay"; | |
var _local14:Sprite = new Sprite(); | |
_local14.addChild(_local13); | |
_arg1.draw(_local14); | |
return (_arg1); | |
} | |
public static function Tom(_arg1:BitmapData):BitmapData{ | |
var _local2:int; | |
var _local3:int; | |
var _local4:int; | |
var _local5:uint; | |
var _local6:int; | |
var _local7:int; | |
var _local10:int; | |
var _local8:ColorMatrix = new ColorMatrix(); | |
_local8.Desaturate(); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local8.filter); | |
var _local9:Vector.<int> = new Vector.<int>(0x0100, true); | |
while (_local10 < _arg1.width) { | |
_local7 = 0; | |
while (_local7 < _arg1.height) { | |
_local5 = _arg1.getPixel32(_local10, _local7); | |
if (0 < ((_local5 >>> 24) & 0xFF)){ | |
_local2 = ((_local5 >>> 16) & 0xFF); | |
_local3 = ((_local5 >>> 8) & 0xFF); | |
_local4 = (_local5 & 0xFF); | |
_local9[_local2] = (_local9[_local2] + 1); | |
_local9[_local3] = (_local9[_local3] + 1); | |
_local9[_local4] = (_local9[_local4] + 1); | |
}; | |
_local7++; | |
}; | |
_local10++; | |
}; | |
var _local11:int = Math.round(((_arg1.width * _arg1.height) / 1000)); | |
var _local12:ChannelMap = new ChannelMap(); | |
_local6 = 0; | |
while (_local6 < 0x0100) { | |
if (_local9[_local6] > _local11){ | |
_local12.minin = _local6; | |
break; | |
}; | |
_local6++; | |
}; | |
_local6 = 0xFF; | |
while (_local6 >= 0) { | |
if (_local9[_local6] > _local11){ | |
_local12.maxin = _local6; | |
break; | |
}; | |
_local6--; | |
}; | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local12.ComputeArray(16), _local12.ComputeArray(8), _local12.ComputeArray(0)); | |
return (_arg1); | |
} | |
public static function Lucas(_arg1:BitmapData):BitmapData{ | |
var _local2:uint; | |
var _local3:int; | |
var _local4:int; | |
var _local5:int; | |
var _local6:int; | |
var _local7:int; | |
var _local8:int; | |
_arg1.lock(); | |
while (_local8 < _arg1.height) { | |
_local7 = 0; | |
while (_local7 < _arg1.width) { | |
_local2 = _arg1.getPixel(_local7, _local8); | |
_local4 = ((_local2 >>> 16) & 0xFF); | |
_local5 = ((_local2 >>> 8) & 0xFF); | |
_local6 = (_local2 & 0xFF); | |
_local4 = (((_local4 * 0.393) + (_local5 * 0.769)) + (_local6 * 0.189)); | |
_local5 = (((_local4 * 0.349) + (_local5 * 0.686)) + (_local6 * 0.168)); | |
_local6 = (((_local4 * 0.272) + (_local5 * 0.534)) + (_local6 * 0.131)); | |
if (_local4 > 0xFF){ | |
_local4 = 0xFF; | |
} else { | |
if (_local4 < 0){ | |
_local4 = 0; | |
}; | |
}; | |
if (_local5 > 0xFF){ | |
_local5 = 0xFF; | |
} else { | |
if (_local5 < 0){ | |
_local5 = 0; | |
}; | |
}; | |
if (_local6 > 0xFF){ | |
_local6 = 0xFF; | |
} else { | |
if (_local6 < 0){ | |
_local6 = 0; | |
}; | |
}; | |
_arg1.setPixel(_local7, _local8, (((_local4 << 16) | (_local5 << 8)) | _local6)); | |
_local7++; | |
}; | |
_local8++; | |
}; | |
_arg1.unlock(); | |
return (_arg1); | |
} | |
public static function Josh(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0, 65536, 131072, 196608, 262144, 327680, 393216, 458752, 524288, 589824, 655360, 720896, 786432, 851968, 917504, 983040, 0x100000, 0x110000, 0x120000, 0x130000, 0x140000, 0x150000, 0x160000, 0x170000, 0x180000, 0x190000, 0x1A0000, 0x1B0000, 0x1C0000, 0x1D0000, 0x1E0000, 0x1F0000, 0x200000, 0x210000, 0x220000, 0x230000, 0x240000, 0x250000, 0x260000, 0x270000, 0x280000, 0x290000, 0x2A0000, 0x2B0000, 0x2C0000, 0x2D0000, 0x2E0000, 0x2F0000, 0x300000, 0x310000, 0x320000, 0x330000, 0x340000, 0x350000, 0x360000, 0x370000, 0x380000, 0x390000, 0x3A0000, 0x3B0000, 0x3C0000, 0x3D0000, 0x3E0000, 0x3F0000, 0x400000, 0x410000, 0x420000, 0x430000, 0x440000, 0x450000, 0x460000, 0x470000, 0x480000, 0x490000, 0x4A0000, 0x4B0000, 0x4C0000, 0x4D0000, 0x4E0000, 0x4F0000, 0x500000, 0x510000, 0x520000, 0x530000, 0x540000, 0x550000, 0x560000, 0x570000, 0x580000, 0x590000, 0x5A0000, 0x5B0000, 0x5C0000, 0x5D0000, 0x5E0000, 0x5F0000, 0x600000, 0x610000, 0x620000, 0x630000, 0x640000, 0x650000, 0x660000, 0x670000, 0x680000, 0x690000, 0x6A0000, 0x6B0000, 0x6C0000, 0x6D0000, 0x6E0000, 0x6F0000, 0x700000, 0x710000, 0x720000, 0x730000, 0x740000, 0x750000, 0x760000, 0x770000, 0x780000, 0x790000, 0x7A0000, 0x7B0000, 0x7C0000, 0x7D0000, 0x7E0000, 0x7F0000, 0x800000, 0x810000, 0x820000, 0x830000, 0x840000, 0x850000, 0x860000, 0x870000, 0x880000, 0x890000, 0x8A0000, 0x8B0000, 0x8C0000, 0x8D0000, 0x8E0000, 0x8F0000, 0x900000, 0x910000, 0x920000, 0x930000, 0x940000, 0x950000, 0x960000, 0x970000, 0x980000, 0x990000, 0x9A0000, 0x9B0000, 0x9C0000, 0x9D0000, 0x9E0000, 0x9F0000, 0xA00000, 0xA10000, 0xA20000, 0xA30000, 0xA40000, 0xA50000, 0xA60000, 0xA70000, 0xA80000, 0xA90000, 0xAA0000, 0xAB0000, 0xAC0000, 0xAD0000, 0xAE0000, 0xAF0000, 0xB00000, 0xB10000, 0xB20000, 0xB30000, 0xB40000, 0xB50000, 0xB60000, 0xB70000, 0xB80000, 0xB90000, 0xBA0000, 0xBB0000, 0xBC0000, 0xBD0000, 0xBE0000, 0xBF0000, 0xC00000, 0xC10000, 0xC20000, 0xC30000, 0xC40000, 0xC50000, 0xC60000, 0xC70000, 0xC80000, 0xC90000, 0xCA0000, 0xCB0000, 0xCC0000, 0xCD0000, 0xCE0000, 0xCF0000, 0xD00000, 0xD10000, 0xD20000, 0xD30000, 0xD40000, 0xD50000, 0xD60000, 0xD70000, 0xD80000, 0xD90000, 0xDA0000, 0xDB0000, 0xDC0000, 0xDD0000, 0xDE0000, 0xDF0000, 0xE00000, 0xE10000, 0xE20000, 0xE30000, 0xE40000, 0xE50000, 0xE60000, 0xE70000, 0xE80000, 0xE90000, 0xEA0000, 0xEB0000, 0xEC0000, 0xED0000, 0xEE0000, 0xEF0000, 0xF00000, 0xF10000, 0xF20000, 0xF30000, 0xF40000, 0xF50000, 0xF60000, 0xF70000, 0xF80000, 0xF90000, 0xFA0000, 0xFB0000, 0xFC0000, 0xFD0000, 0xFE0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0x6800, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, 0x8000, 0x8100, 0x8200, 0x8300, 0x8400, 0x8500, 0x8600, 0x8700, 0x8800, 0x8900, 0x8A00, 0x8B00, 0x8C00, 0x8D00, 0x8E00, 0x8F00, 0x9000, 0x9100, 0x9200, 0x9300, 0x9400, 0x9500, 0x9600, 0x9700, 0x9800, 0x9900, 0x9A00, 0x9B00, 0x9C00, 0x9D00, 0x9E00, 0x9F00, 0xA000, 0xA100, 0xA200, 0xA300, 0xA400, 0xA500, 0xA600, 0xA700, 0xA800, 0xA900, 0xAA00, 0xAB00, 0xAC00, 0xAD00, 0xAE00, 0xAF00, 0xB000, 0xB100, 0xB200, 0xB300, 0xB400, 0xB500, 0xB600, 0xB700, 0xB800, 0xB900, 0xBA00, 0xBB00, 0xBC00, 0xBD00, 0xBE00, 0xBF00, 0xC000, 0xC100, 0xC200, 0xC300, 0xC400, 0xC500, 0xC600, 0xC700, 0xC800, 0xC900, 0xCA00, 0xCB00, 0xCC00, 0xCD00, 0xCE00, 0xCF00, 0xD000, 0xD100, 0xD200, 0xD300, 0xD400, 0xD500, 0xD600, 0xD700, 0xD800, 0xD900, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDE00, 0xDF00, 0xE000, 0xE100, 0xE200, 0xE300, 0xE400, 0xE500, 0xE600, 0xE700, 0xE800, 0xE900, 0xEA00, 0xEB00, 0xEC00, 0xED00, 0xEE00, 0xEF00, 0xF000, 0xF100, 0xF200, 0xF300, 0xF400, 0xF500, 0xF600, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00); | |
var _local4:Array = new Array(62, 63, 64, 64, 65, 66, 67, 68, 68, 69, 70, 71, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 101, 101, 102, 103, 104, 104, 105, 106, 107, 107, 108, 109, 110, 110, 111, 112, 112, 113, 114, 115, 115, 116, 117, 117, 118, 119, 119, 120, 121, 122, 122, 123, 124, 124, 125, 126, 126, 127, 128, 128, 129, 129, 130, 131, 131, 132, 133, 133, 134, 135, 135, 136, 136, 137, 138, 138, 139, 139, 140, 141, 141, 142, 142, 143, 143, 144, 145, 145, 146, 146, 147, 147, 148, 148, 149, 149, 150, 150, 151, 152, 152, 153, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, 159, 160, 160, 161, 161, 162, 162, 162, 163, 163, 164, 164, 164, 165, 165, 166, 166, 166, 167, 167, 167, 168, 168, 169, 169, 169, 170, 170, 170, 171, 171, 171, 172, 172, 172, 173, 173, 173, 174, 174, 174, 175, 175, 175, 175, 176, 176, 176, 177, 177, 177, 178, 178, 178, 178, 179, 179, 179, 180, 180, 180, 180, 181, 181, 181, 181, 182, 182, 182, 182, 183, 183, 183, 183, 184, 184, 184, 184, 185, 185, 185, 185, 186, 186, 186, 186, 187, 187, 187, 187, 188, 188, 188, 188, 189, 189, 189, 189, 189, 190, 190, 190, 190, 191, 191, 191, 191, 192, 192, 192); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
var _local5:ColorMatrix = new ColorMatrix(); | |
_local5.AdjustContrast(0.35); | |
_arg1.applyFilter(_arg1, _arg1.rect, _arg1.rect.topLeft, _local5.filter); | |
return (_arg1); | |
} | |
public static function Aladin(_arg1:BitmapData):BitmapData{ | |
var _local2:Array = new Array(0x360000, 0x360000, 0x370000, 0x370000, 0x370000, 0x380000, 0x380000, 0x390000, 0x390000, 0x390000, 0x3A0000, 0x3A0000, 0x3A0000, 0x3B0000, 0x3B0000, 0x3C0000, 0x3C0000, 0x3C0000, 0x3D0000, 0x3D0000, 0x3D0000, 0x3E0000, 0x3E0000, 0x3F0000, 0x3F0000, 0x3F0000, 0x400000, 0x400000, 0x410000, 0x410000, 0x410000, 0x420000, 0x420000, 0x430000, 0x430000, 0x430000, 0x440000, 0x440000, 0x450000, 0x450000, 0x450000, 0x460000, 0x460000, 0x470000, 0x470000, 0x480000, 0x480000, 0x490000, 0x490000, 0x490000, 0x4A0000, 0x4A0000, 0x4B0000, 0x4B0000, 0x4C0000, 0x4C0000, 0x4D0000, 0x4D0000, 0x4E0000, 0x4E0000, 0x4F0000, 0x4F0000, 0x500000, 0x500000, 0x510000, 0x510000, 0x520000, 0x520000, 0x530000, 0x530000, 0x540000, 0x550000, 0x550000, 0x560000, 0x560000, 0x570000, 0x570000, 0x580000, 0x590000, 0x590000, 0x5A0000, 0x5A0000, 0x5B0000, 0x5C0000, 0x5C0000, 0x5D0000, 0x5E0000, 0x5E0000, 0x5F0000, 0x600000, 0x600000, 0x610000, 0x620000, 0x620000, 0x630000, 0x640000, 0x640000, 0x650000, 0x660000, 0x660000, 0x670000, 0x680000, 0x690000, 0x690000, 0x6A0000, 0x6B0000, 0x6B0000, 0x6C0000, 0x6D0000, 0x6E0000, 0x6F0000, 0x6F0000, 0x700000, 0x710000, 0x720000, 0x720000, 0x730000, 0x740000, 0x750000, 0x760000, 0x760000, 0x770000, 0x780000, 0x790000, 0x7A0000, 0x7B0000, 0x7B0000, 0x7C0000, 0x7D0000, 0x7E0000, 0x7F0000, 0x800000, 0x800000, 0x810000, 0x820000, 0x830000, 0x840000, 0x850000, 0x860000, 0x870000, 0x870000, 0x880000, 0x890000, 0x8A0000, 0x8B0000, 0x8C0000, 0x8D0000, 0x8E0000, 0x8F0000, 0x900000, 0x910000, 0x920000, 0x920000, 0x930000, 0x940000, 0x950000, 0x960000, 0x970000, 0x980000, 0x990000, 0x9A0000, 0x9B0000, 0x9C0000, 0x9D0000, 0x9E0000, 0x9F0000, 0xA00000, 0xA10000, 0xA20000, 0xA30000, 0xA40000, 0xA50000, 0xA60000, 0xA70000, 0xA80000, 0xA90000, 0xAA0000, 0xAB0000, 0xAC0000, 0xAD0000, 0xAE0000, 0xAF0000, 0xB00000, 0xB10000, 0xB20000, 0xB30000, 0xB40000, 0xB50000, 0xB60000, 0xB70000, 0xB80000, 0xB90000, 0xBA0000, 0xBB0000, 0xBC0000, 0xBD0000, 0xBF0000, 0xC00000, 0xC10000, 0xC20000, 0xC30000, 0xC40000, 0xC50000, 0xC60000, 0xC70000, 0xC80000, 0xC90000, 0xCA0000, 0xCB0000, 0xCC0000, 0xCD0000, 0xCF0000, 0xD00000, 0xD10000, 0xD20000, 0xD30000, 0xD40000, 0xD50000, 0xD60000, 0xD70000, 0xD80000, 0xD90000, 0xDB0000, 0xDC0000, 0xDD0000, 0xDE0000, 0xDF0000, 0xE00000, 0xE10000, 0xE20000, 0xE30000, 0xE40000, 0xE60000, 0xE70000, 0xE80000, 0xE90000, 0xEA0000, 0xEB0000, 0xEC0000, 0xED0000, 0xEE0000, 0xEF0000, 0xF10000, 0xF20000, 0xF30000, 0xF40000, 0xF50000, 0xF60000, 0xF70000, 0xF80000, 0xF90000, 0xFB0000, 0xFC0000, 0xFD0000, 0xFE0000, 0xFF0000); | |
var _local3:Array = new Array(0, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1E00, 0x1F00, 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, 0x6000, 0x6100, 0x6200, 0x6300, 0x6400, 0x6500, 0x6600, 0x6700, 0x6900, 0x6A00, 0x6B00, 0x6C00, 0x6D00, 0x6E00, 0x6F00, 0x7000, 0x7100, 0x7200, 0x7300, 0x7400, 0x7500, 0x7600, 0x7700, 0x7800, 0x7900, 0x7A00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, 0x8000, 0x8100, 0x8200, 0x8300, 0x8400, 0x8500, 0x8600, 0x8700, 0x8900, 0x8A00, 0x8B00, 0x8C00, 0x8D00, 0x8E00, 0x8F00, 0x9000, 0x9100, 0x9200, 0x9300, 0x9400, 0x9500, 0x9600, 0x9700, 0x9800, 0x9900, 0x9A00, 0x9B00, 0x9C00, 0x9D00, 0x9E00, 0x9F00, 0xA000, 0xA000, 0xA100, 0xA200, 0xA300, 0xA400, 0xA500, 0xA600, 0xA700, 0xA800, 0xA900, 0xAA00, 0xAB00, 0xAB00, 0xAC00, 0xAD00, 0xAE00, 0xAF00, 0xB000, 0xB100, 0xB100, 0xB200, 0xB300, 0xB400, 0xB500, 0xB500, 0xB600, 0xB700, 0xB800, 0xB800, 0xB900, 0xBA00, 0xBB00, 0xBB00, 0xBC00, 0xBD00, 0xBD00, 0xBE00, 0xBF00, 0xBF00, 0xC000, 0xC100, 0xC100, 0xC200, 0xC200, 0xC300, 0xC300, 0xC400, 0xC500, 0xC500, 0xC600, 0xC600, 0xC700, 0xC700, 0xC700, 0xC800, 0xC800, 0xC900, 0xC900, 0xCA00, 0xCA00, 0xCA00, 0xCB00, 0xCB00, 0xCB00, 0xCC00, 0xCC00, 0xCC00, 0xCD00, 0xCD00, 0xCD00, 0xCE00, 0xCE00, 0xCE00, 0xCF00, 0xCF00, 0xCF00, 0xCF00, 0xD000, 0xD000, 0xD000, 0xD100, 0xD100, 0xD100, 0xD100, 0xD100, 0xD200, 0xD200, 0xD200, 0xD200, 0xD300, 0xD300, 0xD300, 0xD300, 0xD400, 0xD400, 0xD400); | |
var _local4:Array = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 70, 71, 72, 73, 74, 75, 76, 77, 77, 78, 79, 80, 81, 82, 82, 83, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 92, 92, 93, 94, 95, 95, 96, 97, 98, 98, 99, 100, 100, 101, 102, 102, 103, 104, 104, 105, 106, 106, 107, 107, 108, 109, 109, 110, 110, 111, 111, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 119, 120, 120, 121, 121, 122, 122, 122, 123, 123, 124, 124, 124, 125, 125, 125, 126, 126, 126, 127, 127, 127, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, 133, 133, 133, 133, 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 138, 138, 138, 138, 138, 138, 139, 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142); | |
_arg1.paletteMap(_arg1, _arg1.rect, _arg1.rect.topLeft, _local2, _local3, _local4); | |
return (_arg1); | |
} | |
private static function ComputePaletteArray(_arg1:Array, _arg2:int):Array{ | |
var _local3:int; | |
while (_local3 < 0x0100) { | |
_arg1[_local3] = (_arg1[_local3] << _arg2); | |
_local3++; | |
}; | |
return (_arg1); | |
} | |
} | |
}//package com.meitu.effect.lightomtc | |
package com.meitu.effect.lightomtc { | |
import flash.filters.*; | |
public class ColorMatrix { | |
private const LUMA_R:Number = 0.212671; | |
private const LUMA_G:Number = 0.71516; | |
private const LUMA_B:Number = 0.072169; | |
private const LUMA_R2:Number = 0.3086; | |
private const LUMA_G2:Number = 0.6094; | |
private const LUMA_B2:Number = 0.082; | |
private const ONETHIRD:Number = 0.333333333333333; | |
private const IDENTITY:Array; | |
private const RAD:Number = 0.0174532925199433; | |
public var matrix:Array; | |
public function ColorMatrix(){ | |
this.IDENTITY = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; | |
super(); | |
this.matrix = this.IDENTITY.concat(); | |
} | |
public function Invert():void{ | |
this.concat([-1, 0, 0, 0, 0xFF, 0, -1, 0, 0, 0xFF, 0, 0, -1, 0, 0xFF, 0, 0, 0, 1, 0]); | |
} | |
public function AdjustSaturation(_arg1:Number):void{ | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:Number; | |
_local2 = (1 - _arg1); | |
_local3 = (_local2 * this.LUMA_R); | |
_local4 = (_local2 * this.LUMA_G); | |
_local5 = (_local2 * this.LUMA_B); | |
this.concat([(_local3 + _arg1), _local4, _local5, 0, 0, _local3, (_local4 + _arg1), _local5, 0, 0, _local3, _local4, (_local5 + _arg1), 0, 0, 0, 0, 0, 1, 0]); | |
} | |
public function AdjustContrast(_arg1:Number):void{ | |
_arg1 = (_arg1 + 1); | |
this.concat([_arg1, 0, 0, 0, (128 * (1 - _arg1)), 0, _arg1, 0, 0, (128 * (1 - _arg1)), 0, 0, _arg1, 0, (128 * (1 - _arg1)), 0, 0, 0, 1, 0]); | |
} | |
public function AdjustBrightness(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{ | |
if (isNaN(_arg2)){ | |
_arg2 = _arg1; | |
}; | |
if (isNaN(_arg3)){ | |
_arg3 = _arg1; | |
}; | |
this.concat([1, 0, 0, 0, _arg1, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg3, 0, 0, 0, 1, 0]); | |
} | |
public function AdjustHue(_arg1:Number):void{ | |
_arg1 = (_arg1 * this.RAD); | |
var _local2:Number = Math.cos(_arg1); | |
var _local3:Number = Math.sin(_arg1); | |
this.concat([((this.LUMA_R + (_local2 * (1 - this.LUMA_R))) + (_local3 * -(this.LUMA_R))), ((this.LUMA_G + (_local2 * -(this.LUMA_G))) + (_local3 * -(this.LUMA_G))), ((this.LUMA_B + (_local2 * -(this.LUMA_B))) + (_local3 * (1 - this.LUMA_B))), 0, 0, ((this.LUMA_R + (_local2 * -(this.LUMA_R))) + (_local3 * 0.143)), ((this.LUMA_G + (_local2 * (1 - this.LUMA_G))) + (_local3 * 0.14)), ((this.LUMA_B + (_local2 * -(this.LUMA_B))) + (_local3 * -0.283)), 0, 0, ((this.LUMA_R + (_local2 * -(this.LUMA_R))) + (_local3 * -((1 - this.LUMA_R)))), ((this.LUMA_G + (_local2 * -(this.LUMA_G))) + (_local3 * this.LUMA_G)), ((this.LUMA_B + (_local2 * (1 - this.LUMA_B))) + (_local3 * this.LUMA_B)), 0, 0, 0, 0, 0, 1, 0]); | |
} | |
public function Colorize(_arg1:int):void{ | |
var _local2:Number; | |
var _local3:Number; | |
var _local4:Number; | |
var _local5:* = 1; | |
var _local6:* = 1; | |
var _local7:Number = (_arg1 / 60); | |
var _local8:int = int(_local7); | |
var _local9:Number = (_local7 - _local8); | |
var _local10:Number = (_local6 * (1 - _local5)); | |
var _local11:Number = (_local6 * (1 - (_local5 * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment