Section 1
//TextFieldColor (br.hellokeita.utils.TextFieldColor)
package br.hellokeita.utils {
import flash.text.*;
import flash.filters.*;
public class TextFieldColor {
private var $textField:TextField;
private var $selectedColor:uint;
private var $textColor:uint;
private var $selectionColor:uint;
private var colorMatrixFilter:ColorMatrixFilter;
private static const byteToPerc:Number = 0;
public function TextFieldColor(_arg1:TextField, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
$textField = _arg1;
colorMatrixFilter = new ColorMatrixFilter();
$textColor = _arg2;
$selectionColor = _arg3;
$selectedColor = _arg4;
updateFilter();
}
private function updateFilter():void{
$textField.textColor = 0xFF0000;
var _local1:Array = splitRGB($selectionColor);
var _local2:Array = splitRGB($textColor);
var _local3:Array = splitRGB($selectedColor);
var _local4:int = _local1[0];
var _local5:int = _local1[1];
var _local6:int = _local1[2];
var _local7:Number = ((((_local2[0] - 0xFF) - _local1[0]) * byteToPerc) + 1);
var _local8:Number = ((((_local2[1] - 0xFF) - _local1[1]) * byteToPerc) + 1);
var _local9:Number = ((((_local2[2] - 0xFF) - _local1[2]) * byteToPerc) + 1);
var _local10:Number = (((((_local3[0] - 0xFF) - _local1[0]) * byteToPerc) + 1) - _local7);
var _local11:Number = (((((_local3[1] - 0xFF) - _local1[1]) * byteToPerc) + 1) - _local8);
var _local12:Number = (((((_local3[2] - 0xFF) - _local1[2]) * byteToPerc) + 1) - _local9);
colorMatrixFilter.matrix = [_local7, _local10, 0, 0, _local4, _local8, _local11, 0, 0, _local5, _local9, _local12, 0, 0, _local6, 0, 0, 0, 1, 0];
$textField.filters = [colorMatrixFilter];
}
public function set textColor(_arg1:uint):void{
$textColor = _arg1;
updateFilter();
}
public function get textField():TextField{
return ($textField);
}
public function set selectionColor(_arg1:uint):void{
$selectionColor = _arg1;
updateFilter();
}
public function get selectedColor():uint{
return ($selectedColor);
}
public function set selectedColor(_arg1:uint):void{
$selectedColor = _arg1;
updateFilter();
}
public function get selectionColor():uint{
return ($selectionColor);
}
public function set textField(_arg1:TextField):void{
$textField = _arg1;
}
public function get textColor():uint{
return ($textColor);
}
private static function splitRGB(_arg1:uint):Array{
return ([((_arg1 >> 16) & 0xFF), ((_arg1 >> 8) & 0xFF), (_arg1 & 0xFF)]);
}
}
}//package br.hellokeita.utils
Section 2
//VideoPlayerEvent (com.conceptualideas.flvplayer.events.VideoPlayerEvent)
package com.conceptualideas.flvplayer.events {
import flash.events.*;
public class VideoPlayerEvent extends Event {
private var _data:String;
public static const STREAM_STOPED:String = "stream_stoped";
public static const STOP:String = "stop";
public static const VIDEO_FINISHED_PLAYING:String = "video_finished_playing";
public static const VIDEO_PLAYING:String = "video_playing";
public static const BUFFER_FULL:String = "buffer_full";
public static const BUFFER_FLUSHED:String = "buffer_flushed";
public static const BUFFER_EMPTY:String = "buffer_empty";
public static const PAUSE:String = "pause";
public static const VIDEO_LAST_SECOND:String = "video_last_second";
public static const BUFFERING:String = "buffering";
public static const PLAY:String = "play";
public static const FULL_SCREEN:String = "full_screen";
public function VideoPlayerEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function set data(_arg1:String):void{
_data = _arg1;
}
public function get data():String{
return (_data);
}
override public function toString():String{
return (formatToString("VideoPlayerEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new VideoPlayerEvent(type, bubbles, cancelable));
}
}
}//package com.conceptualideas.flvplayer.events
Section 3
//VideoClient (com.conceptualideas.flvplayer.VideoClient)
package com.conceptualideas.flvplayer {
import flash.events.*;
import flash.utils.*;
import com.conceptualideas.flvplayer.events.*;
public dynamic class VideoClient extends EventDispatcher {
public var videoSampleAccess:Boolean;// = true
private var _dict:Dictionary;
private var mp4:Boolean;// = false
public static const METADATA_LOADED:String = "metadata_loaded";
public static const VIDEO_FINISHED:String = "video_finished";
public function VideoClient(){
_dict = new Dictionary(true);
}
public function onPlayStatus(_arg1:Object):void{
trace("onPlayStatus");
if ((((_arg1.code == "NetStream.Play.Complete")) || ((_arg1.code == "NetStream.Play.Stop")))){
dispatchEvent(new VideoPlayerEvent(VideoPlayerEvent.VIDEO_FINISHED_PLAYING, true));
dispatchEvent(new Event(VideoClient.VIDEO_FINISHED, true));
};
}
public function get width():Number{
return (retrive("width"));
}
public function onCaption(_arg1:String, _arg2:Number):void{
var _local3:Object = {type:"caption", captions:_arg1, speaker:_arg2};
}
public function onImageData(_arg1:Object):void{
var _local2:Object = {type:"imagedata"};
}
public function onFCSubscribe(_arg1:Object):void{
var _local3:*;
var _local2:Object = {type:"fcsubscribe"};
for (_local3 in _arg1) {
_local2[_local3] = _arg1[_local3];
};
}
public function RtmpSampleAccess(_arg1:Object):void{
var _local2:Object = {type:"rtmpsampleaccess"};
}
public function get duration():Number{
return (retrive("duration"));
}
public function onBWDone(... _args):void{
var _local2:Object;
if (_args.length > 0){
_local2 = {type:"bandwidth", bandwidth:_args[0]};
};
}
public function onCuePoint(_arg1:Object):void{
}
public function onMetaData(_arg1:Object):void{
var _local2:String;
if (_arg1.seekpoints){
_arg1.keyframes = convertSeekpoints(_arg1.seekpoints);
trace(_arg1.keyframes.times);
trace(_arg1.keyframes.filepositions);
mp4 = true;
trace("--- MP4 --");
};
dump(_arg1);
for (_local2 in _arg1) {
_dict[_local2] = _arg1[_local2];
};
dispatchEvent(new Event(VideoClient.METADATA_LOADED, true));
}
public function retrive(_arg1:String){
return (_dict[_arg1]);
}
public function isMp4():Boolean{
return (mp4);
}
public function onLastSecond(_arg1:Object):void{
dispatchEvent(new VideoPlayerEvent(VideoPlayerEvent.VIDEO_LAST_SECOND, true));
}
private function convertSeekpoints(_arg1:Object):Object{
var _local3:*;
var _local2:Object = new Object();
_local2.times = new Array();
_local2.filepositions = new Array();
for (_local3 in _arg1) {
_local2.times[_local3] = Number(_arg1[_local3]["time"]);
_local2.filepositions[_local3] = Number(_arg1[_local3]["offset"]);
};
return (_local2);
}
public function onBWCheck(... _args):Number{
return (0);
}
public function get height():Number{
return (retrive("height"));
}
public function changeMode(_arg1:Object):void{
}
private function dump(_arg1:Object):void{
var _local2:Object;
for (_local2 in _arg1) {
trace(((_local2 + " :: ") + _arg1[_local2]));
};
}
public function onTextData(_arg1:Object):void{
var _local3:*;
var _local2:Object = {type:"textdata"};
for (_local3 in _arg1) {
_local2[_local3] = _arg1[_local3];
};
}
}
}//package com.conceptualideas.flvplayer
Section 4
//CIArrowButton (com.conceptualideas.utils.CIArrowButton)
package com.conceptualideas.utils {
import flash.display.*;
public class CIArrowButton extends Sprite {
private var ICON_WIDTH:Number;// = 7
private var bg:Sprite;
private var ICON_HEIGHT:Number;// = 7
private var PADDING:Number;// = 5
private var BUTTON_HEIGHT:Number;// = 13
private var BUTTON_WIDTH:Number;// = 26
private var icon:Sprite;
private var BUTTON_RADIUS:Number;// = 8
public function CIArrowButton(_arg1:Array=null, _arg2:Array=null):void{
this.buttonMode = true;
this.init();
}
public function reverse():void{
if (icon.scaleX >= 0){
icon.x = (((BUTTON_WIDTH / 2) + (BUTTON_RADIUS / 2)) - 2);
} else {
icon.x = ((BUTTON_WIDTH / 2) - 2);
};
icon.scaleX = (icon.scaleX * -1);
}
private function getIconPoints():Array{
var _local1:Object = {x:0, y:0};
var _local2:Array = [_local1, {x:(_local1.x + ICON_WIDTH), y:(_local1.y + (ICON_HEIGHT / 2))}, {x:_local1.x, y:(_local1.y + ICON_HEIGHT)}];
return (_local2);
}
private function init():void{
drawButton();
}
private function dragArrow():void{
var _local1:* = Drawing.buildMatrix(0.5, 0.5, ICON_WIDTH, ICON_HEIGHT, ((100 / 180) * Math.PI));
var _local2:Object = {colors:[0x545454, 0x333333], type:"linear", alphas:[100, 100], ratios:[0, 0xFF], matrix:_local1};
var _local3:Object = {alpha:0, thickness:0, color:0x595959};
icon = new Sprite();
Drawing.drawPoly(icon, getIconPoints(), _local2, _local3);
bg.addChild(icon);
icon.x = ((BUTTON_WIDTH / 2) - 2);
icon.y = (Math.floor(((BUTTON_WIDTH / 2) - (ICON_HEIGHT / 2))) + 0.5);
}
private function drawButton():void{
drawBackground();
dragArrow();
}
private function drawBackground():void{
bg = new Sprite();
addChild(bg);
var _local1:* = Drawing.buildMatrix(0.5, 0.5, BUTTON_WIDTH, BUTTON_HEIGHT, ((90 / 180) * Math.PI));
bg.graphics.beginGradientFill("linear", [0xFFFFFF, 0xBFBFBF], [100, 100], [0, 0xFF], _local1);
bg.graphics.lineStyle(0, 0x595959);
bg.graphics.drawCircle((BUTTON_WIDTH / 2), (BUTTON_WIDTH / 2), BUTTON_RADIUS);
bg.graphics.endFill();
}
}
}//package com.conceptualideas.utils
Section 5
//CIBannerAd (com.conceptualideas.utils.CIBannerAd)
package com.conceptualideas.utils {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import gs.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
public class CIBannerAd extends Sprite {
private var container:Sprite;
private var reopenButton:Sprite;
private var txtShowAd:TextField;
private var currentLink:String;
private var isOpen:Boolean;// = false
private var txtHeader:TextField;
private var navigation:Sprite;
private var txtMiddle:TextField;
private var adsBy:TextField;
private var adMask:Shape;
private var overlayMatrix:Matrix;
private var button:Sprite;
private var txtBottom:TextField;
private var timer:Timer;// = null
private var _height:Number;
private var _width:Number;
private var isImage:Boolean;// = false
private var image:Sprite;
private var _config:Object;
private var _ads:Array;
private var currentAd:Number;// = -1
public function CIBannerAd():void{
_ads = [];
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
button.x = ((_width - button.width) - 5);
button.y = 10;
resize();
}
private function nextAd():void{
currentAd++;
if (currentAd > (_ads.length - 1)){
currentAd = 0;
};
displayAd();
}
private function fit(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:String="uniform"):void{
var _local5:Number = (_arg2 / _arg1.width);
var _local6:Number = (_arg3 / _arg1.height);
switch (_arg4.toLowerCase()){
case "exactfit":
_arg1.width = _arg2;
_arg1.height = _arg3;
break;
case "fill":
if (_local5 > _local6){
_arg1.width = (_arg1.width * _local5);
_arg1.height = (_arg1.height * _local5);
} else {
_arg1.width = (_arg1.width * _local6);
_arg1.height = (_arg1.height * _local6);
};
break;
case "none":
break;
case "uniform":
if (_local5 > _local6){
_arg1.width = (_arg1.width * _local6);
_arg1.height = (_arg1.height * _local6);
} else {
_arg1.width = (_arg1.width * _local5);
_arg1.height = (_arg1.height * _local5);
};
break;
};
_arg1.x = Math.round(((_arg2 / 2) - (_arg1.width / 2)));
_arg1.y = Math.round(((_arg3 / 2) - (_arg1.height / 2)));
_arg1.width = Math.ceil(_arg1.width);
_arg1.height = Math.ceil(_arg1.height);
}
private function populateTextField(_arg1:TextField, _arg2:Object, _arg3:Object, _arg4:Boolean=false):void{
var _local6:String;
var _local7:String;
_arg4 = false;
if (((((!((_arg2 is String))) && (_arg2.link))) && (!((_arg2.link == ""))))){
_local7 = ((_arg2.link.indexOf("http://"))==-1) ? ("http://" + _arg2.link) : _arg2.link;
_arg1.htmlText = (((("<a href='" + _local7) + "'>") + _arg2.text) + "</a>");
} else {
_arg1.htmlText = ((_arg2 is String)) ? String(_arg2) : _arg2.text;
};
var _local5:TextFormat = new TextFormat();
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local5.font = _config.font;
_arg1.visible = true;
_arg1.antiAliasType = AntiAliasType.NORMAL;
_arg1.setTextFormat(_local5);
_arg1.defaultTextFormat = _local5;
_arg1.embedFonts = _arg4;
}
protected function loadImage(_arg1:String, _arg2:Function, ... _args):void{
var url = _arg1;
var callback = _arg2;
var args = _args;
var loader:Loader = new Loader();
var func:Function = function (_arg1:Event):void{
var _local2:Array = [_arg1].concat(args);
callback.apply(null, _local2);
};
loader.contentLoaderInfo.addEventListener(Event.INIT, func);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOEvent, false, 0, true);
loader.load(new URLRequest(url));
}
private function displayText():void{
var _local1:CIAd = _ads[currentAd];
if (_local1.header){
populateTextField(txtHeader, {link:_local1.link, text:_local1.header}, {size:20, color:_config.colors.title, underline:false, bold:true}, true);
};
if (_local1.description){
populateTextField(txtMiddle, {link:_local1.link, text:_local1.description}, {size:15, color:_config.colors.desc}, true);
};
if (_local1.bottom){
populateTextField(txtBottom, {link:_local1.bottom, text:_local1.bottom}, {size:14, color:_config.colors.link, bold:false}, true);
};
startRotate();
}
public function initialize(_arg1:Object):void{
_config = _arg1;
_width = _arg1.width;
_height = _arg1.height;
if (!_config.colors){
_config.colors = {};
};
if (!_config.colors.title){
_config.colors.title = 0xFFFFFF;
};
if (!_config.colors.desc){
_config.colors.desc = 0xFFFFFF;
};
if (!_config.colors.link){
_config.colors.link = 16711519;
};
if (!_config.colors.by){
_config.colors.by = 0x999999;
};
createChildren();
if (((_config.by) && (_config.by.text))){
populateTextField(adsBy, _arg1.by, {size:13, color:_config.colors.by}, false);
};
}
private function setTextFieldPlacement(_arg1:Number):void{
txtHeader.x = (txtMiddle.x = (txtBottom.x = _arg1));
}
private function createChildren():void{
container = new Sprite();
container.addEventListener(MouseEvent.ROLL_OVER, onRollOver, false, 0, true);
container.addEventListener(MouseEvent.ROLL_OUT, onRollOut, false, 0, true);
addChild(container);
button = new CICloseButton();
button.buttonMode = true;
button.addEventListener(MouseEvent.CLICK, onCloseAd, false, 0, true);
container.addChild(button);
reopenButton = new Sprite();
txtShowAd = getTextField();
var _local1:Object = {size:10, color:0};
if (_config.font){
_local1.font = _config.font;
};
populateTextField(txtShowAd, {text:"Show Ad"}, _local1);
var _local2:Matrix = new Matrix();
_local2.createGradientBox((txtShowAd.width + 5), txtShowAd.height, (90 * (Math.PI / 180)), 0, 0);
reopenButton.graphics.beginGradientFill("linear", [0xBFBFBF, 0xB0B0B0], [1, 1], [0, 0xFF], _local2);
reopenButton.graphics.drawRoundRect(0, 0, (txtShowAd.width + 5), txtShowAd.height, 5, 5);
reopenButton.graphics.endFill();
reopenButton.buttonMode = true;
reopenButton.mouseChildren = false;
reopenButton.addEventListener(MouseEvent.CLICK, onReopenRequest, false, 0, true);
txtShowAd.y = ((reopenButton.height - txtShowAd.height) / 2);
txtShowAd.x = ((reopenButton.width - txtShowAd.width) / 2);
reopenButton.addChild(txtShowAd);
txtHeader = getTextField();
txtMiddle = getTextField();
txtBottom = getTextField();
adsBy = getTextField();
image = new Sprite();
navigation = new Sprite();
var _local3:CIArrowButton = new CIArrowButton();
var _local4:Sprite = new CIArrowButton();
_local3.addEventListener(MouseEvent.CLICK, onPreviousAd, false, 0, true);
_local4.addEventListener(MouseEvent.CLICK, onNextAd, false, 0, true);
_local3.reverse();
navigation.addChild(_local3);
navigation.addChild(_local4);
navigation.visible = false;
_local4.x = ((_local3.x + _local3.width) + 5);
container.addChild(navigation);
container.addChild(txtHeader);
container.addChild(txtMiddle);
container.addChild(txtBottom);
container.addChild(adsBy);
container.addChild(image);
adMask = new Shape();
adMask.graphics.beginFill(0xFF0000);
adMask.graphics.drawRect(0, 0, 10, 10);
adMask.graphics.endFill();
addChild(adMask);
container.mask = adMask;
overlayMatrix = new Matrix();
resize();
}
public function has():Boolean{
return ((_ads.length) ? true : false);
}
public function addAd(_arg1:String, _arg2:String, _arg3:String=null, _arg4:String=null, _arg5:String=null, _arg6:String="text"):void{
_ads.push(new CIAd(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6));
}
private function drawContainer():void{
var _local1:Graphics = container.graphics;
_local1.clear();
overlayMatrix.createGradientBox(_width, _height, (180 * 0.0174532925199), 0, 0);
_local1.beginGradientFill("linear", [0, 0], [0.6, 0], [200, 0xFF], overlayMatrix);
_local1.drawRect(0, 2, _width, _height);
_local1.endFill();
}
private function onReopenRequest(_arg1:MouseEvent):void{
show();
}
private function resize():void{
drawContainer();
reopenButton.x = ((_width - reopenButton.width) - 5);
adsBy.x = ((button.x - adsBy.width) - 2);
reopenButton.y = ((_height - reopenButton.height) - 10);
adsBy.y = (button.y - 4);
txtHeader.width = _width;
txtMiddle.width = _width;
txtBottom.width = _width;
txtHeader.x = (txtMiddle.x = (txtBottom.x = 5));
txtHeader.y = 3;
spaceText(txtMiddle, txtHeader);
spaceText(txtBottom, txtMiddle);
navigation.x = ((_width - navigation.width) - 10);
navigation.y = ((_height - navigation.height) - 10);
adMask.width = _width;
adMask.height = _height;
if (((((!(isNaN(currentAd))) && (!((currentAd == -1))))) && (CIAd(_ads[currentAd]).showBoth()))){
setTextFieldPlacement(((image.x + image.width) + 10));
};
}
private function onNextAd(_arg1:MouseEvent):void{
nextAd();
}
private function onPreviousAd(_arg1:MouseEvent):void{
previousAd();
}
private function displayAd():void{
if (_ads.length > 1){
navigation.visible = true;
};
var _local1:CIAd = _ads[currentAd];
removeImage();
if (((!(_local1.showImage())) && (_local1.showText()))){
setTextFieldPlacement(0);
displayText();
isImage = false;
} else {
if (_local1.showImage()){
isImage = true;
txtHeader.text = (txtMiddle.text = (txtBottom.text = ""));
loadImage(_local1.image, onImageLoaded, _local1.link);
};
};
resize();
}
private function clearContainer():void{
container.graphics.clear();
}
private function getTextField():TextField{
var _local1:TextField = new TextField();
_local1.autoSize = TextFieldAutoSize.LEFT;
_local1.selectable = false;
return (_local1);
}
public function hide(_arg1:Boolean=false):void{
var tween = _arg1;
TweenLite.killTweensOf(peak, false);
if (tween){
isOpen = false;
TweenLite.to(container, 0.5, {y:_height, onComplete:function ():void{
showReopenButton();
}, overwrite:true});
} else {
container.y = _height;
};
}
private function removeReopenButton():void{
var func:Function = function ():void{
txtShowAd.text = "";
};
TweenLite.to(reopenButton, 0.5, {alpha:0, onComplete:func});
}
public function clear():void{
_ads = [];
}
private function removeImage():void{
if (image){
while (image.numChildren > 0) {
image.removeChildAt(0);
};
};
}
private function spaceText(_arg1:TextField, _arg2:TextField):void{
if (_arg1.text != ""){
_arg1.y = ((_arg2.y + _arg2.getLineMetrics(0).height) + 2);
};
}
private function onRollOut(_arg1:MouseEvent):void{
}
private function onIOEvent(_arg1:IOErrorEvent):void{
}
private function showReopenButton():void{
addChild(reopenButton);
txtShowAd.text = "Show ad";
TweenLite.to(reopenButton, 0.5, {alpha:1});
}
private function onCloseAd(_arg1:MouseEvent):void{
hide(true);
}
private function startRotate():void{
if (timer){
timer.reset();
timer.start();
};
}
private function peak():void{
if (!isImage){
isOpen = false;
TweenLite.to(container, 1, {y:(_height - txtHeader.height)});
} else {
hide(true);
};
}
private function onTimerTick(_arg1:TimerEvent):void{
nextAd();
}
private function onImageLoaded(_arg1:Event, _arg2:String, _arg3:String="_self"):void{
var e = _arg1;
var link = _arg2;
var window = _arg3;
var obj:Sprite = new Sprite();
var bmp:Bitmap = (e.target.content as Bitmap);
bmp.smoothing = true;
obj.addChild(bmp);
obj.buttonMode = true;
fit(obj, (_width - 20), (_height - 10));
trace("OBJ ::", obj.width, obj.height);
obj.x = 5;
var func:Function = function ():void{
navigateToURL(new URLRequest(link), window);
};
obj.addEventListener(MouseEvent.CLICK, func);
image.addChild(obj);
image.y = 5;
if (CIAd(_ads[currentAd]).showText()){
displayText();
resize();
} else {
startRotate();
};
}
private function onRollOver(_arg1:MouseEvent):void{
if (!isOpen){
show();
};
}
private function previousAd():void{
currentAd--;
if (currentAd < 0){
currentAd = (_ads.length - 1);
};
displayAd();
}
public function show():void{
if (currentAd == -1){
if (_config.auto){
timer = new Timer((_config.auto * 1000), 1);
timer.addEventListener(TimerEvent.TIMER, onTimerTick, false, 0, true);
};
};
nextAd();
removeReopenButton();
TweenLite.to(container, 1, {y:0, onComplete:function ():void{
isOpen = true;
}});
}
}
}//package com.conceptualideas.utils
class CIAd {
private var _image:String;
private var _bottom:String;
private var _header:String;
private var _link:String;
private var _show:String;
private var _description:String;
private function CIAd(_arg1:String, _arg2:String, _arg3:String=null, _arg4:String=null, _arg5:String=null, _arg6:String="text"){
this._header = _arg1;
this._description = _arg3;
this._image = _arg5;
this._link = _arg2;
this._bottom = _arg4;
this._show = _arg6;
}
public function get link():String{
return (_link);
}
public function get bottom():String{
return (_bottom);
}
public function showBoth():Boolean{
return (((this._show)=="both") ? true : false);
}
public function get description():String{
return (_description);
}
public function get header():String{
return (_header);
}
public function showText():Boolean{
return (((((this._show == "text")) || ((this._show == "both")))) ? true : false);
}
public function get image():String{
return (_image);
}
public function showImage():Boolean{
return (((((this._show == "image")) || ((this._show == "both")))) ? true : false);
}
}
Section 6
//CICloseButton (com.conceptualideas.utils.CICloseButton)
package com.conceptualideas.utils {
import flash.display.*;
import flash.geom.*;
public class CICloseButton extends Sprite {
private const X_SHADOW_BOTTOM_Y_OFFSET:Number = 2;
private const RATIOS:Array;
private const BORDER_WIDTH:Number = 2;
private const ALPHAS:Array;
private const BUTTON_WIDTH:Number = 15;
private const X_SHADOW_TOP_Y_OFFSET:Number = 1;
private const X_SHADOW_BOTTOM_X_OFFSET:Number = 1;
private const BUTTON_ROUND:Number = 4;
private const X_INDENT:Number = 5;
private const X_SHADOW_TOP_X_OFFSET:Number = -2;
private var outerColors:Array;
private var outerMatrix:Matrix;
private var g:Graphics;
private var innerColors:Array;
private var innerMatrix:Matrix;
public function CICloseButton(_arg1:Array=null, _arg2:Array=null):void{
ALPHAS = [100, 100];
RATIOS = [0, 0xFF];
super();
this.outerColors = (_arg1) ? _arg1 : [0xBFBFBF, 0xB0B0B0];
this.innerColors = (_arg2) ? _arg2 : [0xFFFFFF, 0xC0C0C0];
this.init();
}
private function drawXShadow():void{
g.lineStyle(1, 0xFFFFFF, 100, false, "normal", "square", "bevel");
g.moveTo((X_INDENT + X_SHADOW_TOP_X_OFFSET), (X_INDENT + X_SHADOW_TOP_Y_OFFSET));
g.lineTo(((BUTTON_WIDTH - X_INDENT) - X_SHADOW_BOTTOM_X_OFFSET), ((BUTTON_WIDTH - X_INDENT) + X_SHADOW_BOTTOM_Y_OFFSET));
g.moveTo(((BUTTON_WIDTH - X_INDENT) - X_SHADOW_TOP_X_OFFSET), (X_INDENT + X_SHADOW_TOP_Y_OFFSET));
g.lineTo((X_INDENT + X_SHADOW_BOTTOM_X_OFFSET), ((BUTTON_WIDTH - X_INDENT) + X_SHADOW_BOTTOM_Y_OFFSET));
}
private function drawX(_arg1:Array, _arg2:uint):void{
g.lineStyle(3, _arg2, 1, false, "normal", "square", "bevel");
g.lineGradientStyle("linear", _arg1, [100, 100], [0, 0xFF], outerMatrix);
g.moveTo(X_INDENT, X_INDENT);
g.lineTo((BUTTON_WIDTH - X_INDENT), (BUTTON_WIDTH - X_INDENT));
g.moveTo((BUTTON_WIDTH - X_INDENT), X_INDENT);
g.lineTo(X_INDENT, (BUTTON_WIDTH - X_INDENT));
}
private function init():void{
this.g = this.graphics;
innerMatrix = new Matrix();
innerMatrix.createGradientBox(BUTTON_WIDTH, BUTTON_WIDTH, (Math.PI / 2), 0, 0);
outerMatrix = new Matrix();
outerMatrix.createGradientBox((BUTTON_WIDTH - (BORDER_WIDTH * 2)), (BUTTON_WIDTH - (BORDER_WIDTH * 2)), (Math.PI / 2), 0, 0);
drawButton();
}
private function drawOuterBorder():void{
g.beginGradientFill("linear", outerColors, ALPHAS, RATIOS, outerMatrix);
g.drawRoundRect(0, 0, BUTTON_WIDTH, BUTTON_WIDTH, BUTTON_ROUND, BUTTON_ROUND);
g.endFill();
}
private function drawButton():void{
drawOuterBorder();
drawInnerBorder();
drawXShadow();
drawX([0x5E5E5E, 0xA0A0A0], 0x555555);
}
private function drawState(_arg1:String="out"):void{
}
private function drawInnerBorder():void{
g.beginGradientFill("linear", innerColors, ALPHAS, RATIOS, innerMatrix);
g.drawRect(BORDER_WIDTH, BORDER_WIDTH, (BUTTON_WIDTH - (BORDER_WIDTH * 2)), (BUTTON_WIDTH - (BORDER_WIDTH * 2)));
g.endFill();
}
}
}//package com.conceptualideas.utils
Section 7
//CIDimmer (com.conceptualideas.utils.CIDimmer)
package com.conceptualideas.utils {
import flash.external.*;
public class CIDimmer {
private var config:Object;
private var swfID:String;
private static var _instance:CIDimmer;
public function CIDimmer(_arg1:Blocker):void{
var _local2:String;
config = {areas:["left", "right", "top", "bottom"], leftOpacity:80, rightOpacity:80, topOpacity:80, bottomOpacity:80, backgroundColor:"#000000"};
super();
if (!(_arg1 is Blocker)){
throw (Error("Must use CIDimmer.instance()"));
};
if (ExternalInterface.available){
swfID = ExternalInterface.objectID;
_local2 = new JS_CIDimmer().toString();
ExternalInterface.call("eval", _local2);
init(config);
};
}
public function init(_arg1:Object):void{
var _local2:String;
for (_local2 in _arg1) {
config[_local2] = _arg1[_local2];
};
config.object = swfID;
ExternalInterface.call("window.CIDimmer.init", config);
}
public function toggle():void{
ExternalInterface.call("window.CIDimmer.toggle");
}
public static function instance():CIDimmer{
if (!_instance){
_instance = new CIDimmer(new Blocker());
};
return (_instance);
}
}
}//package com.conceptualideas.utils
class Blocker {
private function Blocker(){
}
}
Section 8
//ColorTools (com.conceptualideas.utils.ColorTools)
package com.conceptualideas.utils {
import flash.geom.*;
public class ColorTools {
private static var color_transform:ColorTransform;
public static function lightenColor(_arg1:Number, _arg2:Number):Number{
var _local3:ColorTransform = new ColorTransform();
_local3.color = _arg1;
_local3.redOffset = (_local3.redOffset + _arg2);
_local3.greenOffset = (_local3.greenOffset + _arg2);
_local3.blueOffset = (_local3.blueOffset + _arg2);
if (_local3.redOffset > 0xFF){
_local3.redOffset = 0xFF;
};
if (_local3.greenOffset > 0xFF){
_local3.greenOffset = 0xFF;
};
if (_local3.blueOffset > 0xFF){
_local3.blueOffset = 0xFF;
};
return ((_local3.color as Number));
}
public static function isBright(_arg1:Number):Boolean{
return (((perceivedBrightness(_arg1))<130) ? false : true);
}
public static function applySolidColor(_arg1:Number, _arg2:Object):void{
if (!isNaN(_arg1)){
color_transform = new ColorTransform();
color_transform.color = _arg1;
_arg2.transform.colorTransform = color_transform;
};
}
public static function applyVariableColor(_arg1:Number, _arg2:Object, _arg3:Number=0):void{
color_transform = new ColorTransform();
color_transform.color = _arg1;
color_transform.redMultiplier = ((color_transform.redOffset)>0) ? (color_transform.redOffset / 0xFF) : 0;
color_transform.redOffset = (0 + _arg3);
color_transform.greenMultiplier = ((color_transform.greenOffset)>0) ? (color_transform.greenOffset / 0xFF) : 0;
color_transform.greenOffset = (0 + _arg3);
color_transform.blueMultiplier = ((color_transform.blueOffset)>0) ? (color_transform.blueOffset / 0xFF) : 0;
color_transform.blueOffset = (0 + _arg3);
_arg2.transform.colorTransform = color_transform;
}
public static function darkenColor(_arg1:Number, _arg2:Number):Number{
var _local3:ColorTransform = new ColorTransform();
_local3.color = _arg1;
_local3.redOffset = (_local3.redOffset - _arg2);
_local3.greenOffset = (_local3.greenOffset - _arg2);
_local3.blueOffset = (_local3.blueOffset - _arg2);
if (_local3.redOffset < 0){
_local3.redOffset = 0;
};
if (_local3.greenOffset < 0){
_local3.greenOffset = 0;
};
if (_local3.blueOffset < 0){
_local3.blueOffset = 0;
};
return ((_local3.color as Number));
}
public static function perceivedBrightness(_arg1:Number):Number{
var _local2:ColorTransform = new ColorTransform();
_local2.color = _arg1;
var _local3:Number = _local2.redOffset;
var _local4:Number = _local2.greenOffset;
var _local5:Number = _local2.blueOffset;
return (Math.sqrt(((((_local3 * _local3) * 0.241) + ((_local4 * _local4) * 0.691)) + ((_local5 * _local5) * 0.068))));
}
public static function enhanceStrongestBasicColor(_arg1:Number, _arg2:Object, _arg3:Number):void{
var _local4:Number;
color_transform = new ColorTransform();
color_transform.color = _arg1;
var _local5:Number = 200;
var _local6:Array = new Array();
_local6 = [{color:"red", value:color_transform.redOffset}, {color:"green", value:color_transform.greenOffset}, {color:"blue", value:color_transform.blueOffset}];
_local6.sort(sortByColor);
var _local7:int;
while (_local7 < _local6.length) {
if (_local6[_local7].value <= _local5){
_local4 = _local7;
break;
};
_local7++;
};
if (!isNaN(_local4)){
color_transform.redOffset = (color_transform.redOffset + _arg3);
color_transform.greenOffset = (color_transform.greenOffset + _arg3);
color_transform.blueOffset = (color_transform.blueOffset + _arg3);
} else {
color_transform.redOffset = (color_transform.redOffset - _arg3);
color_transform.greenOffset = (color_transform.greenOffset - _arg3);
color_transform.blueOffset = (color_transform.blueOffset - _arg3);
};
_arg2.transform.colorTransform = color_transform;
}
private static function sortByColor(_arg1:Object, _arg2:Object):Number{
if (_arg1.value > _arg2.value){
return (-1);
};
if (_arg1.value < _arg2.value){
return (1);
};
return (0);
}
}
}//package com.conceptualideas.utils
Section 9
//DomainTools (com.conceptualideas.utils.DomainTools)
package com.conceptualideas.utils {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import org.osflash.thunderbolt.*;
import flash.system.*;
import flash.external.*;
public class DomainTools {
private var _url:String;
private static var _instance:DomainTools;
public function get noCache():String{
return (String(Math.ceil((Math.random() * 999))));
}
public function setUserSetting(_arg1:String, _arg2):void{
var _local3:SharedObject = SharedObject.getLocal("application_settings");
_local3.data[_arg1] = _arg2;
_local3.flush();
}
public function get domain():String{
var _local1:String;
if (!local){
if (_url.indexOf("www.") != -1){
_local1 = _url.split("www.")[1];
};
_local1 = _url.split("http://")[1];
return (_local1.substr(0, _local1.indexOf("/")).toLowerCase());
};
return (_local1.substr(0, (_local1.lastIndexOf("/") + 1)));
}
public function get swfPath():String{
return (((_url.indexOf("?"))!=-1) ? _url.substr(0, _url.indexOf("?")) : _url);
}
public function get http():String{
return ((local) ? ("http://www." + domain) : domain);
}
private function onSecurityError(_arg1:SecurityErrorEvent):void{
trace(_arg1);
}
public function log(_arg1:String="info", _arg2:String=null, ... _args):void{
var _local4:Array = [_arg2].concat(_args);
switch (_arg1){
case "info":
Logger.info.apply(Logger, _local4);
break;
case "debug":
Logger.debug.apply(Logger, _local4);
break;
};
}
public function sendURL(_arg1:String, _arg2:Object=null, _arg3:String="POST"):void{
var _local5:String;
var _local6:URLRequest;
var _local4:URLVariables = new URLVariables();
for (_local5 in _arg2) {
_local4[_local5] = _arg2[_local5];
};
_arg1 = relToAbsPath(fixUrl(_arg1));
_local6 = new URLRequest(_arg1);
_local6.data = _local4;
_local6.method = _arg3;
sendToURL(_local6);
}
public function init(_arg1:DisplayObject):void{
FlashVarUtil.instance().init(_arg1);
trace("DomainTools!!");
_url = _arg1.root.loaderInfo.url;
}
public function get base():String{
var _local1:String = _url.split("?")[0];
return (_local1.substr(0, (_local1.lastIndexOf("/") + 1)));
}
private function onIOEvent(_arg1:IOErrorEvent):void{
trace(_arg1);
}
public function fixUrl(_arg1:String):String{
var _local2:String;
if (_arg1.indexOf("file:///") != -1){
_arg1 = ("file:///" + _arg1.replace("file:///", "").replace("//", "/"));
} else {
_local2 = "";
if (_arg1.match(/http|https/)){
_local2 = ((_arg1.indexOf("http://"))!=-1) ? "http://" : "https://";
};
_arg1 = (_local2 + _arg1.replace(_local2, "").replace("//", "/"));
};
return (_arg1);
}
public function loadImage(_arg1:String, _arg2:Function, ... _args):Loader{
var ctx:LoaderContext;
var url = _arg1;
var callback = _arg2;
var args = _args;
var loader:Loader = new Loader();
var func:Function = function (_arg1:Event):void{
var _local2:Array = [_arg1].concat(args);
callback.apply(null, _local2);
};
url = relToAbsPath(url);
loader.contentLoaderInfo.addEventListener(Event.INIT, func);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOEvent, false, 0, true);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError, false, 0, true);
if ((((url.indexOf("http") == 0)) && (!(local)))){
ctx = new LoaderContext(true, ApplicationDomain.currentDomain, SecurityDomain.currentDomain);
loader.load(new URLRequest(url), ctx);
} else {
loader.load(new URLRequest(url));
};
return (loader);
}
public function extend(_arg1:Object, ... _args){
var _local3:Object;
var _local4:*;
var _local5:*;
var _local6:*;
_arg1 = ((_arg1) || ({}));
while (_args.length > 0) {
_local3 = _args.shift();
if (_local3 != null){
for (_local4 in _local3) {
_local5 = _arg1[_local4];
_local6 = _local3[_local4];
if (_local5 == null){
_local5 = {};
};
if (_arg1 === _local6){
} else {
if (((!((_local6 == null))) && ((_local6.toString() == "[object Object]")))){
_arg1[_local4] = extend(_local5, _local6);
} else {
if (_local6 != undefined){
_arg1[_local4] = _local6;
};
};
};
};
};
};
return (_arg1);
}
public function hasJS():Boolean{
if (ExternalInterface.available){
if (ExternalInterface.call("function(){ return (typeof 'abc' =='string')?true:false;}")){
return (true);
};
};
return (false);
}
public function getTopLevel(_arg1:String, _arg2:Number=1):String{
var _local3:Number = 0;
while (_local3 < _arg2) {
if (_arg1.lastIndexOf("/") == (_arg1.length - 1)){
_arg1 = _arg1.substr(0, _arg1.lastIndexOf("/"));
};
_arg1 = _arg1.substr(0, _arg1.lastIndexOf("/"));
_local3++;
};
return ((_arg1 + "/"));
}
public function loadURL(_arg1:String, _arg2:Function, _arg3:Object=null, _arg4:String="GET", _arg5:Boolean=false, ... _args):void{
var key:String;
var url = _arg1;
var callback = _arg2;
var params = _arg3;
var method = _arg4;
var removeNoCache = _arg5;
var args = _args;
var _params:URLVariables = new URLVariables();
for (key in params) {
_params[key] = params[key];
};
url = fixUrl(relToAbsPath(decodeURIComponent(url)));
if (!local){
if (!removeNoCache){
url = (url + ((((url.indexOf("?"))==-1) ? "?" : "&" + "noCache=") + noCache));
};
if (((removeNoCache) && (!(params)))){
url = url.substr(0, (url.length - 1));
};
};
if (url.lastIndexOf("&") == (url.length - 1)){
url = url.substr(0, (url.length - 1));
};
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(url);
var func:Function = function (_arg1:Event):void{
var _local2:Array = [_arg1].concat(args);
callback.apply(null, _local2);
};
if (params){
request.data = _params;
};
request.method = method;
loader.addEventListener(Event.COMPLETE, func);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOEvent, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError, false, 0, true);
loader.load(request);
}
public function relToAbsPath(_arg1:String):String{
var _local2:String;
if (_arg1.indexOf("../") == 0){
_local2 = (getTopLevel(base) + _arg1.substr(3));
} else {
if (_arg1.indexOf("/") == 0){
_local2 = ((http + "/") + _arg1.substr(1));
} else {
if ((((_arg1.indexOf("http") == -1)) && (!(local)))){
_local2 = (base + _arg1);
} else {
_local2 = _arg1;
};
};
};
return (_local2);
}
public function get local():Boolean{
return (!((_url.indexOf("file://") == -1)));
}
public function get vars():FlashVarUtil{
return (FlashVarUtil.instance());
}
public function get swfName():String{
var _local1:String = swfPath;
return (_local1.substr((_local1.lastIndexOf("/") + 1)));
}
public function getUsersetting(_arg1:String){
var _local2:SharedObject = SharedObject.getLocal("application_settings");
return (_local2.data[_arg1]);
}
public function navigate(_arg1:String, _arg2:String="_self", _arg3:Object=null, _arg4:String="GET"):void{
var _local6:URLVariables;
var _local7:String;
var _local5:URLRequest = new URLRequest(_arg1);
if (_arg3){
_local6 = new URLVariables();
for (_local7 in _arg3) {
_local6[_local7] = _arg3[_local7];
};
_local5.data = _local6;
_local5.method = _arg4;
};
navigateToURL(_local5, _arg2);
}
public function get adsense():Object{
var params:Object = {};
return (params);
}
public function fixBlur(_arg1:DisplayObject, _arg2:String="x"):void{
var _local3:Number = 0;
if (String(_arg1[_arg2]).indexOf(".") != -1){
_local3 = (Number(("0." + String(_arg1[_arg2]).split(".")[1])) % 2);
_local3 = (_local3 + (Number(String(_arg1[_arg2]).split(".")[0]) % 2));
} else {
_local3 = (_arg1[_arg2] % 2);
};
_arg1[_arg2] = (_arg1[_arg2] + _local3);
}
public function onExternalSite(_arg1:String):Boolean{
var viewingURL:String;
var domain = _arg1;
if (hasJS()){
viewingURL = ExternalInterface.call("function(){ var loc=\"\";try{ loc=window.location.host.toString()}catch(e){} return loc}");
if (((!((viewingURL == ""))) || (!((viewingURL == null))))){
try {
if (viewingURL.indexOf(domain) >= 0){
return (false);
} else {
trace("onExternal !!");
};
} catch(e:Error) {
trace("onExternal !!");
return (true);
};
};
};
return (true);
}
public static function instance():DomainTools{
if (!_instance){
_instance = new (DomainTools);
};
return (_instance);
}
}
}//package com.conceptualideas.utils
Section 10
//Drawing (com.conceptualideas.utils.Drawing)
package com.conceptualideas.utils {
import flash.geom.*;
public class Drawing {
public static function drawPoly(_arg1, _arg2:Array, _arg3:Object=null, _arg4:Object=null):void{
if (_arg3 != null){
setFill(_arg1, _arg3);
};
setLineStyle(_arg1, _arg4);
_arg1.graphics.moveTo(_arg2[0].x, _arg2[0].y);
var _local5:Number = 1;
while (_local5 < _arg2.length) {
_arg1.graphics.lineTo(_arg2[_local5].x, _arg2[_local5].y);
_local5++;
};
if (_arg3 != null){
_arg1.graphics.endFill();
};
}
public static function buildFill(_arg1:String, _arg2:Array, _arg3:Array, _arg4:Array, _arg5:Object=null):Object{
return ({type:_arg1, colors:_arg2, alphas:_arg3, ratios:_arg4, matrix:(_arg5 as Matrix)});
}
public static function drawCircle(_arg1, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null, _arg6:Object=null, _arg7:Boolean=false):void{
if (_arg5 != null){
setFill(_arg1, _arg5);
};
setLineStyle(_arg1, _arg6);
_arg1.graphics.drawCircle(_arg2, _arg3, _arg4);
if (((!((_arg5 == null))) && (!(_arg7)))){
_arg1.graphics.endFill();
};
}
public static function setFill(_arg1, _arg2:Object):void{
if ((_arg2 is Number)){
_arg1.graphics.beginFill(Number(_arg2));
} else {
_arg1.graphics.beginGradientFill(_arg2.type, _arg2.colors, _arg2.alphas, _arg2.ratios, _arg2.matrix);
};
}
public static function buildMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0):Matrix{
var _local6:Matrix = new Matrix();
_local6.createGradientBox(_arg3, _arg4, ((_arg5 / 180) * Math.PI), _arg1, _arg2);
return (_local6);
}
public static function drawRect(_arg1, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Object=null, _arg7:Object=null, _arg8:Object=null, _arg9:Boolean=false):void{
if (_arg6){
setFill(_arg1, _arg6);
};
setLineStyle(_arg1, _arg7);
if (isNaN(Number(_arg8))){
_arg1.graphics.drawRect(_arg2, _arg3, _arg4, _arg5);
} else {
_arg1.graphics.drawRoundRect(_arg2, _arg3, _arg4, _arg5, Number(_arg8), Number(_arg8));
};
if (((!((_arg6 == null))) && (!(_arg9)))){
_arg1.graphics.endFill();
};
}
public static function buildSingleFill(_arg1:uint, _arg2:Number):Object{
return (buildFill("linear", [_arg1, _arg1], [_arg2, _arg2], [0, 225]));
}
public static function setLineStyle(_arg1, _arg2:Object):void{
if (_arg2 != null){
_arg1.graphics.lineStyle(_arg2.thickness, _arg2.color, _arg2.alpha, _arg2.pixelHinting, _arg2.scaleMode, _arg2.caps, _arg2.joins, _arg2.miterLimit);
};
}
public static function drawArrow(_arg1, _arg2:Number, _arg3:Number, _arg4:String, _arg5:Object=null, _arg6:Object=null):void{
var _local7:Array = [];
switch (_arg4){
case "left":
_local7 = [{x:(_arg2 + 10), y:_arg3}, {x:_arg2, y:(_arg3 + 6)}, {x:_arg2, y:(_arg3 + 8)}, {x:(_arg2 + 10), y:(_arg3 + 14)}, {x:(_arg2 + 10), y:(_arg3 + 11)}, {x:(_arg2 + 4), y:(_arg3 + 7)}, {x:(_arg2 + 10), y:(_arg3 + 3)}, {x:(_arg2 + 10), y:_arg3}];
break;
case "right":
_local7 = [{x:_arg2, y:_arg3}, {x:(_arg2 + 10), y:(_arg3 + 6)}, {x:(_arg2 + 10), y:(_arg3 + 8)}, {x:_arg2, y:(_arg3 + 14)}, {x:_arg2, y:(_arg3 + 11)}, {x:(_arg2 + 6), y:(_arg3 + 7)}, {x:_arg2, y:(_arg3 + 3)}, {x:_arg2, y:_arg3}];
break;
};
drawPoly(_arg1, _local7, _arg5);
}
public static function drawStar(_arg1, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Object=null, _arg8:Object=null):void{
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_arg4 = (_arg4 * 2);
if (_arg7 != null){
setFill(_arg1, _arg7);
};
setLineStyle(_arg1, _arg8);
var _local9:Number = (360 / _arg4);
var _local10:Number = 0;
while (_local10 <= _arg4) {
_local11 = (((_local9 * _local10) / 180) * Math.PI);
_local12 = (((_local9 * (_local10 + 1)) / 180) * Math.PI);
_local13 = (_arg5 * Math.sin(_local11));
_local14 = (_arg5 * Math.cos(_local11));
_local15 = (_arg6 * Math.sin(_local12));
_local16 = (_arg6 * Math.cos(_local12));
if (_local10 == 0){
_arg1.graphics.moveTo(_local13, _local16);
_arg1.graphics.moveTo(_local15, _local16);
} else {
_arg1.graphics.lineTo(_local13, _local16);
_arg1.graphics.lineTo(_local15, _local16);
};
_local10 = (_local10 + 2);
};
if (_arg7 != null){
_arg1.graphics.endFill();
};
if (((!(isNaN(_arg2))) && (!(isNaN(_arg3))))){
_arg1.x = (_arg6 + _arg2);
_arg1.y = (_arg6 + _arg3);
};
}
public static function buildLineStyle(_arg1:Number=NaN, _arg2:uint=0, _arg3:Number=1, _arg4:Boolean=false, _arg5:String="normal", _arg6:String=null, _arg7:String=null, _arg8:Number=3):Object{
return ({thickness:_arg1, color:_arg2, alpha:_arg3, pixelHinting:_arg4, scaleMode:_arg5, caps:_arg6, joints:_arg7, miterLimit:_arg8});
}
}
}//package com.conceptualideas.utils
Section 11
//FlashVarUtil (com.conceptualideas.utils.FlashVarUtil)
package com.conceptualideas.utils {
public class FlashVarUtil {
private var currentMask;
private var params:Object;
private var _dontPickUp:Array;
private static var _instance:FlashVarUtil;
public function FlashVarUtil():void{
_dontPickUp = [];
super();
}
public function getEither(... _args):String{
var _local2:String;
for each (_local2 in _args) {
if (hasKey(_local2)){
return (getValue(_local2));
};
};
return (null);
}
public function convert(_arg1){
if (!isNaN(Number(_arg1))){
return (Number(_arg1));
};
if (_arg1 == "true"){
return (true);
};
if (_arg1 == "false"){
return (false);
};
return (_arg1);
}
public function getSinglePairKey(... _args):String{
var _local3:String;
var _local2 = "";
for each (_local3 in _args) {
if (((params[_local3]) && ((_dontPickUp.indexOf(_local3) == -1)))){
_local2 = (_local2 + (((_local3 + "=") + params[_local3]) + "&"));
};
};
return (_local2.substr(0, (_local2.length - 1)));
}
public function check(_arg1:String, ... _args){
return ((hasEither.apply(this, _args)) ? convert(getEither.apply(this, _args)) : convert(_arg1));
}
public function getGroup(_arg1=null, _arg2=null):Array{
var selectMask = _arg1;
var filterMask = _arg2;
var select_filter:Function = function (_arg1:Object, _arg2:int, _arg3:Array):Boolean{
return (!((String(_arg1).match(selectMask) == null)));
};
var remove_filter:Function = function (_arg1:Object, _arg2:int, _arg3:Array):Boolean{
return ((String(_arg1).match(filterMask) == null));
};
if (filterMask){
return (((getKeys().filter(select_filter).filter(remove_filter)) || ([])));
};
return (((getKeys().filter(select_filter)) || ([])));
}
public function containsValue(_arg1:String):Boolean{
if (hasKey(_arg1)){
return (((getValue(_arg1))!="") ? true : false);
};
return (false);
}
public function addMask(... _args):void{
_dontPickUp = _dontPickUp.concat(_args);
}
private function fitsMask(_arg1, _arg2:int, _arg3:Array):Boolean{
return ((_arg1.indexOf(currentMask) >= -1));
}
public function getPairKey():String{
var _local2:String;
var _local1 = "";
for (_local2 in params) {
if (((!((_local2 == "noCache"))) && ((_dontPickUp.indexOf(_local2) == -1)))){
_local1 = (_local1 + (((_local2 + "=") + params[_local2]) + "&"));
};
};
return (_local1.substr(0, (_local1.length - 1)));
}
public function init(_arg1:Object):void{
params = extend(_arg1.stage.loaderInfo.parameters, _arg1.root.loaderInfo.parameters);
}
public function getKeys():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in params) {
_local1.push(_local2);
};
return (_local1);
}
public function getBoolean(_arg1:String):Boolean{
return ((hasKey(_arg1)) ? (params[_arg1] == "true") : false);
}
public function hasKey(_arg1:String):Boolean{
return (((params[_arg1])!=null) ? true : false);
}
public function getKeyPairMap(... _args):Object{
var _local3:String;
var _local2:Object = {};
for each (_local3 in _args) {
if (hasKey(_local3)){
_local2[_local3] = getValue(_local3);
};
};
return (_local2);
}
public function extend(_arg1:Object, _arg2:Object=null){
var _local3:*;
var _local4:*;
var _local5:*;
if (_arg2 != null){
for (_local3 in _arg2) {
_local4 = _arg1[_local3];
_local5 = _arg2[_local3];
if (_local4 == null){
_local4 = {};
};
if (_arg1 === _local5){
} else {
if (((((((((!((_local5 == null))) && ((_local5 is Object)))) && (!((_local5 is String))))) && (!((_local5 is Boolean))))) && (!((_local5 is Number))))){
_arg1[_local3] = extend(_local4, _local5);
} else {
if (_local5 != undefined){
_arg1[_local3] = _local5;
};
};
};
};
};
return (_arg1);
}
public function getParams():Object{
var _local2:String;
var _local1:Object = {};
for (_local2 in params) {
if (((!((_local2 == "noCache"))) && ((_dontPickUp.indexOf(_local2) == -1)))){
_local1[_local2] = encodeURIComponent(params[_local2]);
};
};
return (_local1);
}
public function getValue(_arg1:String):String{
return ((hasKey(_arg1)) ? params[_arg1] : "");
}
public function hasEither(... _args):Boolean{
var _local2:String;
for each (_local2 in _args) {
if (hasKey(_local2)){
return (true);
};
};
return (false);
}
public static function instance():FlashVarUtil{
if (!_instance){
_instance = new (FlashVarUtil);
};
return (_instance);
}
}
}//package com.conceptualideas.utils
Section 12
//JS_CIDimmer (com.conceptualideas.utils.JS_CIDimmer)
package com.conceptualideas.utils {
import flash.utils.*;
public class JS_CIDimmer extends ByteArray {
}
}//package com.conceptualideas.utils
Section 13
//JS_MouseWheelManager (com.conceptualideas.utils.JS_MouseWheelManager)
package com.conceptualideas.utils {
import flash.utils.*;
public class JS_MouseWheelManager extends ByteArray {
}
}//package com.conceptualideas.utils
Section 14
//MouseWatcher (com.conceptualideas.utils.MouseWatcher)
package com.conceptualideas.utils {
import flash.events.*;
import flash.display.*;
import flash.external.*;
public class MouseWatcher {
private var setFocused:Boolean;// = false
private var REFOCUS_CODE:String;
private var mouseLeft:Boolean;// = true
private var _stage:DisplayObjectContainer;
public static const MOUSE_LEFT:String = "mouse_left";
public static const MOUSE_RETURN:String = "mouse_return";
private static var _instance:MouseWatcher;
public function MouseWatcher(_arg1:DisplayObjectContainer){
_stage = _arg1;
init();
}
private function init():void{
if (ExternalInterface.available){
REFOCUS_CODE = (("var ___=window.document[\"" + ExternalInterface.objectID) + "\"]; if(___){___.focus();}");
_stage.addEventListener(Event.MOUSE_LEAVE, onMouseOut);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
};
}
private function onMouseOut(_arg1:Event):void{
mouseLeft = true;
setFocused = false;
ExternalInterface.call("eval", "window.focus()");
}
private function onMouseMove(_arg1:MouseEvent):void{
if (((mouseLeft) && (!(setFocused)))){
trace("onMouseMove");
ExternalInterface.call("eval", REFOCUS_CODE);
setFocused = true;
mouseLeft = false;
};
}
public static function setup(_arg1:DisplayObjectContainer):void{
if (!_instance){
_instance = new MouseWatcher(_arg1);
};
}
}
}//package com.conceptualideas.utils
Section 15
//MouseWheelManager (com.conceptualideas.utils.MouseWheelManager)
package com.conceptualideas.utils {
import flash.events.*;
import flash.display.*;
import flash.external.*;
public class MouseWheelManager {
private var _currItem:InteractiveObject;
public var loadDynamically:Boolean;// = true
private var _clonedEvent:MouseEvent;
public var loadDynamicallyInterval:int;// = 0
private var _stage:Stage;
private static const EXTERNAL_MOUSE_EVENT:String = "externalMouseEvent";
private static var instance:MouseWheelManager;
public function MouseWheelManager(_arg1:SingletonEnforcer=null, _arg2:Stage=null){
if (((_arg1) && (_arg2))){
setupMouseManager(_arg2);
};
}
private function setupMouseManager(_arg1:Stage):void{
var stage = _arg1;
try {
_stage = stage;
_stage.addEventListener(MouseEvent.MOUSE_MOVE, _getItemUnderCursor);
if (ExternalInterface.available){
ExternalInterface.addCallback(EXTERNAL_MOUSE_EVENT, _externalMouseEvent);
loadScript();
ExternalInterface.call("eval", (("swfMouseWheel.addItem('" + ExternalInterface.objectID) + "')"));
};
} catch(e:Error) {
};
}
private function _externalMouseEvent(_arg1:Number):void{
var _local2:MouseEvent = new MouseEvent(MouseEvent.MOUSE_WHEEL, true, false, _clonedEvent.localX, _clonedEvent.localY, _clonedEvent.relatedObject, _clonedEvent.ctrlKey, _clonedEvent.altKey, _clonedEvent.shiftKey, _clonedEvent.buttonDown, int(_arg1));
_stage.stage.dispatchEvent(_local2);
}
private function isTransparent():Boolean{
var _local2:Array;
var _local3:String;
var _local1:String = ExternalInterface.call("eval", (("var _el=document.getElementById('" + ExternalInterface.objectID) + "'); if(typeof(_el) !='undefined'){_el.innerHTML;}"));
if (_local1){
_local2 = _local1.toLowerCase().match(/<param [\w=#\"\s>]+/ig);
for each (_local3 in _local2) {
if (((_local3.match(/wmode/i)) && (_local3.match(/transparent/i)))){
return (true);
};
};
};
return (false);
}
private function _getItemUnderCursor(_arg1:MouseEvent):void{
_currItem = InteractiveObject(_arg1.target);
_clonedEvent = MouseEvent(_arg1);
}
private function loadScript():void{
var _local1:String = new JS_MouseWheelManager().toString();
ExternalInterface.call("eval", _local1);
}
public static function setup(_arg1:Stage):void{
if (instance == null){
instance = new MouseWheelManager(new SingletonEnforcer(), _arg1);
};
}
}
}//package com.conceptualideas.utils
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 16
//Bootloader (com.conceptualideas.videoplayer.core.bootloader.Bootloader)
package com.conceptualideas.videoplayer.core.bootloader {
import com.conceptualideas.videoplayer.interfaces.*;
public class Bootloader {
private static var _callback:Function;
public static var stage:Object;
private static var _levels:Object = {pre:null, mid:null, post:null};
public static function init(_arg1:Object, _arg2:Function):void{
Bootloader.stage = _arg1;
_callback = _arg2;
_levels["pre"].run(onPreBootFinished);
}
public static function addBoot(_arg1:String, _arg2:IBootLoader):void{
_levels[_arg1] = _arg2;
}
private static function onMidBootFinished(_arg1:Object):void{
trace(Bootloader._callback, _arg1, _arg1.view, stage);
Bootloader._callback.apply(stage, [_arg1.view]);
}
private static function onPreBootFinished(_arg1:Object):void{
_levels["mid"].run(onMidBootFinished, _arg1);
}
}
}//package com.conceptualideas.videoplayer.core.bootloader
Section 17
//MidBootLoader (com.conceptualideas.videoplayer.core.bootloader.MidBootLoader)
package com.conceptualideas.videoplayer.core.bootloader {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
import flash.display.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.events.*;
import com.conceptualideas.videoplayer.models.*;
import flash.utils.*;
import com.conceptualideas.videoplayer.modules.ui.*;
import com.conceptualideas.videoplayer.modules.interfaces.*;
import com.conceptualideas.videoplayer.enhancements.*;
import com.conceptualideas.videoplayer.modules.advertisement.*;
import com.conceptualideas.videoplayer.modules.*;
import com.conceptualideas.videoplayer.modules.analytics.*;
public class MidBootLoader extends Sprite implements IBootLoader {
private var _callback:Function;
protected var view:AbstractView;
private static var _instance:MidBootLoader;
private static var _loaded:Boolean = false;
protected function loadModules():void{
view.loadModule(new Hooker());
view.loadModule(new ControlBar());
view.loadModule(new Watermark());
var settings:Settings = Settings.instance();
if (settings.dtools.vars.getGroup(/overlay\.*[\w]*|image/i).length){
view.loadModule(new ImageOverlay());
};
if (settings.hasAds()){
view.loadModule(new Ads());
};
view.loadModule(new VideoDisplay());
view.loadModule(new RightClickModule());
var modules:Array = settings.retrive("").get("modules.load");
var classPath = "com.conceptualideas.videoplayer.modules.{path}{class}";
modules.push("Javascript");
var availPaths:Array = ["ui.", "interfaces.", "advertisement.", "analytics."];
loadComponent(availPaths, classPath, modules, function (_arg1:Class):void{
view.loadModule(IComponent(new (_arg1)));
});
}
protected function initModels(_arg1:Model):void{
_arg1.addModel(new RTMPModel(_arg1), "rtmp");
_arg1.addModel(new LighttpdModel(_arg1), "lighttpd");
_arg1.addModel(new HttpModel(_arg1), "http");
_arg1.addModel(new SecureStreaming(_arg1), "cisecure");
}
protected function loadEnhancements():void{
var availPaths:Array;
var classPath = "com.conceptualideas.videoplayer.enhancements.{class}Enhancements";
var enhancements:Array = Settings.instance().retrive("").get("enhancements.load");
if (enhancements.indexOf("Video") == -1){
enhancements.push("Video");
};
if (enhancements.length){
availPaths = [""];
loadComponent(availPaths, classPath, enhancements, function (_arg1:Class):void{
trace("Load Enhancements");
view.loadModule(IComponent(new (_arg1)));
});
};
}
public function run(_arg1:Function, _arg2:Object=null):void{
var _local3:MovieClip = _arg2.skin;
Bootloader.stage.addChild(_local3);
var _local4:Object = _arg2.settings;
var _local5:BaseController = new BaseController(_local4, _local3);
var _local6:Model = new Model(_local4, _local5, _local3);
view = new BaseView(_local4, _local3, _local5, _local6);
_local5.close(_local6, view);
initModels(_local6);
loadModules();
loadEnhancements();
_arg1({view:view});
}
protected function loadComponent(_arg1:Array, _arg2:String, _arg3:Array, _arg4:Function):void{
var comp:String;
var path:String;
var modClass:Class;
var availPaths = _arg1;
var classPath = _arg2;
var components = _arg3;
var callback = _arg4;
for each (comp in components) {
if (comp == ""){
} else {
for each (path in availPaths) {
try {
path = classPath.replace("{class}", comp).replace("{path}", path);
modClass = Class(getDefinitionByName(path));
if (modClass){
try {
callback(modClass);
break;
} catch(e:Error) {
};
};
} catch(e:Error) {
};
};
};
};
}
protected function loadPlugins():void{
var _local1:Settings = Settings.instance();
var _local2:Array = _local1.retrive("").get("plugins.load");
}
private function onLoadComplete(_arg1:Event):void{
}
}
}//package com.conceptualideas.videoplayer.core.bootloader
Section 18
//PreBootLoader (com.conceptualideas.videoplayer.core.bootloader.PreBootLoader)
package com.conceptualideas.videoplayer.core.bootloader {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.models.*;
public class PreBootLoader implements IBootLoader {
private var _callback:Function;
protected var settings:Settings;
public function PreBootLoader(){
settings = Settings.instance();
super();
}
private function onSkinLoaded(_arg1:Event):void{
_callback({skin:_arg1.target.skin, settings:settings.retrive("")});
}
private function onSettingsLoaded(_arg1:Event):void{
var _local2:PlayerSkin = PlayerSkin.instance();
_local2.addEventListener(PlayerSkin.SKIN_LOADED, onSkinLoaded);
_local2.load(settings.retrive("ui.skin"));
}
public function run(_arg1:Function, _arg2:Object=null):void{
_callback = _arg1;
settings.init((Bootloader.stage as DisplayObjectContainer));
settings.addEventListener(Settings.LOADED, onSettingsLoaded);
settings.load();
}
}
}//package com.conceptualideas.videoplayer.core.bootloader
Section 19
//HookRepo (com.conceptualideas.videoplayer.core.hooks.HookRepo)
package com.conceptualideas.videoplayer.core.hooks {
import com.conceptualideas.videoplayer.interfaces.*;
import flash.utils.*;
public class HookRepo {
private var _lastResults:HookResults;
private var _dict:Dictionary;
private var pending:Array;
private var _type:String;
public function HookRepo(_arg1:String):void{
_dict = new Dictionary(true);
pending = [];
super();
_type = _arg1;
}
public function add(_arg1:ISystemHook):void{
_dict[_arg1.getHookID()] = _arg1;
}
public function run(_arg1:Function):void{
var _local2:ISystemHook;
if (((_lastResults) && (!(_lastResults.finished())))){
return;
};
if (_lastResults){
_lastResults.destroy();
};
_lastResults = new HookResults(_type, _arg1);
for each (_local2 in _dict) {
_lastResults.add(_local2);
};
_lastResults.commit();
}
public function remove(_arg1:Function, _arg2:Boolean=false):Boolean{
var _local4:String;
var _local3:int;
for (_local4 in _dict) {
if (((ISystemHook(_dict[_local4]).same(_arg1)) || (_arg2))){
_dict[_local4].destroy();
delete _dict[_local4];
_local3++;
};
};
return ((_local3) ? true : false);
}
}
}//package com.conceptualideas.videoplayer.core.hooks
Section 20
//HookResults (com.conceptualideas.videoplayer.core.hooks.HookResults)
package com.conceptualideas.videoplayer.core.hooks {
import flash.events.*;
import com.conceptualideas.videoplayer.interfaces.*;
import flash.utils.*;
public class HookResults implements IHookResults {
private var timer:Timer;
private var _finished:Boolean;// = false
private var _type:String;
private var _callback:Function;
private var _hooks:Array;
private var _id:int;
private var _hasPending:Boolean;// = false
private var _results:Object;
public function HookResults(_arg1:String, _arg2:Function){
_results = {};
timer = new Timer(500);
_hooks = [];
_id = new Date().time;
super();
_callback = _arg2;
_type = _arg1;
}
private function onCheckPendingRequest(_arg1:TimerEvent):void{
var _local2:ISystemHook;
trace("HookResults::onCheckPendingRequest", _id);
for each (_local2 in _hooks) {
if (!_local2.isSync()){
if (_local2.running()){
return;
};
};
};
timer.removeEventListener(TimerEvent.TIMER, onCheckPendingRequest);
dispatchResults();
}
public function isType(_arg1:String):Boolean{
trace("HookResults::isType", _arg1);
return (((_arg1)==_type) ? true : false);
}
public function commit():void{
if (_hasPending){
timer.addEventListener(TimerEvent.TIMER, onCheckPendingRequest, false, 0, true);
timer.start();
} else {
dispatchResults();
};
}
public function destroy():void{
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, onCheckPendingRequest);
timer = null;
_results = null;
_callback = null;
_hooks = null;
}
public function isError(_arg1):Boolean{
return (((((_arg1 is String)) && ((_arg1 == "Error")))) ? true : false);
}
public function get(_arg1:String){
trace("HookResults::get", _arg1);
if (has(_arg1)){
trace("HookResults::get::Found", _results[_arg1], typeof(_results[_arg1]));
return (_results[_arg1]);
};
return ("Error");
}
public function has(_arg1:String):Boolean{
trace("HookResults::has", _arg1);
return ((_results[_arg1]) ? true : false);
}
private function dispatchResults():void{
var _local1:ISystemHook;
trace("HookResults::dispatchResults");
for each (_local1 in _hooks) {
_results[_local1.getName()] = _local1.answer();
};
if ((_callback is Function)){
_callback.apply(null, [this]);
};
_finished = true;
}
public function add(_arg1:ISystemHook):void{
_finished = false;
if (!_arg1.isSync()){
_hasPending = true;
};
_arg1.run();
_hooks.push(_arg1);
}
public function finished():Boolean{
return (_finished);
}
}
}//package com.conceptualideas.videoplayer.core.hooks
Section 21
//Hooks (com.conceptualideas.videoplayer.core.hooks.Hooks)
package com.conceptualideas.videoplayer.core.hooks {
import com.conceptualideas.videoplayer.interfaces.*;
public class Hooks {
private static var _hooks:Object = {};
private static var _instance:Hooks;
public function Hooks(_arg1:Array, _arg2:Blocker){
init(_arg1);
}
private function init(_arg1:Array):void{
var _local2:String;
for each (_local2 in _arg1) {
_hooks[_local2] = new HookRepo(_local2);
};
}
private function run(_arg1:String, _arg2:Function, _arg3:Object=null):void{
var type = _arg1;
var callback = _arg2;
var scope = _arg3;
var f:Function = function (_arg1:IHookResults):void{
callback.apply(scope, [_arg1]);
};
trace("Hooker::run", type, _hooks[type]);
if (_hooks[type]){
HookRepo(_hooks[type]).run(f);
};
}
private function unhook(_arg1:String, _arg2:Function=null, _arg3:Boolean=false):Boolean{
if (_hooks[_arg1]){
_hooks[_arg1].remove(_arg2);
};
return (true);
}
private function hook(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null, _arg5:Boolean=true):ISystemHook{
var _local6:SystemHook = new SystemHook(_arg2, _arg3, _arg4, _arg5);
_hooks[_arg1].add(_local6);
return (_local6);
}
public static function init(_arg1:Array):void{
if (!_instance){
_instance = new Hooks(_arg1, new Blocker());
};
}
public static function hook(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null, _arg5:Boolean=true):ISystemHook{
return (_instance.hook.apply(_instance, arguments));
}
public static function run(_arg1:String, _arg2:Function, _arg3:Object=null):void{
_instance.run.apply(_instance, arguments);
}
public static function unhook(_arg1:String, _arg2:Function=null, _arg3:Boolean=false):Boolean{
return (_instance.unhook.apply(_instance, arguments));
}
}
}//package com.conceptualideas.videoplayer.core.hooks
class Blocker {
private function Blocker(){
}
}
Section 22
//SystemHook (com.conceptualideas.videoplayer.core.hooks.SystemHook)
package com.conceptualideas.videoplayer.core.hooks {
import com.conceptualideas.videoplayer.interfaces.*;
public class SystemHook implements ISystemHook {
private var _running:Boolean;// = false
private var _sync:Boolean;
private var _scope:Object;
private var _hookID:int;
private var _func:Function;
private var _answer;
private var _name:String;
public function SystemHook(_arg1:String, _arg2:Function, _arg3:Object=null, _arg4:Boolean=true){
this._hookID = new Date().time;
this._func = _arg2;
this._sync = _arg4;
this._name = _arg1;
this._scope = _arg3;
}
public function getName():String{
return (_name);
}
public function run():void{
_running = true;
this._func.apply(_scope);
}
public function assert(... _args):void{
_answer = (((((_args) && (_args["length"]))) && ((_args.length == 1)))) ? _args.shift() : _args;
trace(("SystemHook::assert::" + getName()), _answer);
_running = false;
}
public function destory():void{
}
public function isSync():Boolean{
return (this._sync);
}
public function same(_arg1:Function):Boolean{
return (true);
}
public function getHookID():int{
return (this._hookID);
}
public function answer(){
return (_answer);
}
public function running():Boolean{
return (_running);
}
}
}//package com.conceptualideas.videoplayer.core.hooks
Section 23
//ProgressiveTimer (com.conceptualideas.videoplayer.enhancements.views.ProgressiveTimer)
package com.conceptualideas.videoplayer.enhancements.views {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.events.*;
import flash.geom.*;
import flash.utils.*;
import com.dougmccune.*;
public class ProgressiveTimer extends Sprite {
private var config:Object;
private var currentItem:Object;
private var timer:MovieClip;
private var view:AbstractView;
private var bar:MovieClip;
private var showing:Boolean;// = false
private var autoHideID:Number;
public function ProgressiveTimer(_arg1:AbstractView){
config = {showHours:false};
super();
this.view = _arg1;
init();
}
private function onEnterFrame(_arg1:Event):void{
var e = _arg1;
clearTimeout(autoHideID);
if (HitTester.realHitTest(bar, new Point(mouseX, mouseY))){
updateTimeHead();
} else {
autoHideID = setTimeout(function ():void{
hide();
}, 500);
};
}
private function setupListeners():void{
bar = view.skin.controlbar;
timer = view.skin.progress_timer;
timer.time.selectable = false;
timer.mouseEnabled = false;
timer.visible = false;
if (bar){
bar.seek.addEventListener(MouseEvent.ROLL_OVER, onBarRollOverRequest, false, 0, true);
view.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
view.addControllerListener(ControllerEvent.LOAD, onLoadRequst);
};
}
private function hide():void{
view.stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
showing = false;
timer.visible = false;
bar.seek.addEventListener(MouseEvent.ROLL_OVER, onBarRollOverRequest, false, 0, true);
bar.seek.removeEventListener(MouseEvent.ROLL_OUT, onBarRollOutRequest);
}
private function init():void{
setupListeners();
}
private function onBarRollOutRequest(_arg1:MouseEvent):void{
if (showing){
hide();
};
}
private function show():void{
showing = true;
bar.seek.removeEventListener(MouseEvent.ROLL_OVER, onBarRollOverRequest);
bar.seek.addEventListener(MouseEvent.MOUSE_OUT, onBarRollOutRequest, false, 0, true);
view.stage.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
private function updateTimeHead():void{
var _local2:Number;
var _local3:String;
var _local1:Number = currentItem.duration;
if (_local1 != 0){
timer.visible = true;
_local2 = (((bar.seek.mouseX - bar.seek.bounds.x) / bar.seek.bounds.width) * _local1);
_local3 = Strings.digits(_local2, config.showHours);
timer.x = (mouseX - (timer.width / 2));
timer.time.text = _local3;
} else {
hide();
};
}
private function onBarRollOverRequest(_arg1:MouseEvent):void{
if (!showing){
show();
};
}
private function onResizeRequest(_arg1:ControllerEvent):void{
timer.y = (bar.y + (bar.height / 2));
view.skin.addChildAt(timer, (view.skin.numChildren - 1));
}
private function onLoadRequst(_arg1:ControllerEvent):void{
currentItem = view.currentItem;
}
}
}//package com.conceptualideas.videoplayer.enhancements.views
Section 24
//ControlBarEnhancements (com.conceptualideas.videoplayer.enhancements.ControlBarEnhancements)
package com.conceptualideas.videoplayer.enhancements {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import gs.*;
import flash.utils.*;
import com.conceptualideas.videoplayer.modules.ui.*;
import flash.ui.*;
import com.conceptualideas.videoplayer.enhancements.views.*;
public class ControlBarEnhancements extends BaseComponent {
private var config:Object;
private var firstPlay:Boolean;// = false
private var autohideTimer:Timer;
private var volumeHideTimer:Timer;
private var paused:Boolean;// = false
private var volumeTween:TweenLite;
public function ControlBarEnhancements(){
config = {useAutoHide:false, useProgressiveTimer:false, maxHeight:false, autoHideVolume:true, autohide:{peakDuration:1, fadeDuration:1, hide:false, peak:false, fade:false, delay:5}, seek:{mouse:false, keyboard:false, keyRatio:2, stepSeekTime:20}, extraButtons:[], definitions:{}};
super();
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
var _local2:DomainTools = DomainTools.instance();
config = _local2.extend(config, _arg1.config.get("controlbar", false, true));
addEnhancements();
}
public function getName():String{
return ("controlbarEnhancements");
}
private function onPlayerLoaded(_arg1:ViewEvent):void{
autohideTimer.start();
}
private function onVolumeShowRequest(_arg1:MouseEvent):void{
var e = _arg1;
if (volumeTween){
volumeTween.complete(true);
};
volumeHideTimer.stop();
volumeHideTimer.reset();
try {
view.skin.controlbar.volume.volume_slider.visible = true;
view.skin.controlbar.volume.addEventListener(MouseEvent.MOUSE_OUT, onMouseVolumeOut, false, 0, true);
} catch(e:Error) {
};
}
private function addExtraButtons():void{
var _local2:Object;
var _local3:String;
var _local4:Object;
var _local5:String;
var _local6:String;
trace("extraButtons");
var _local1:ControlBar = view.getModule("ControlBar");
if (_local1){
_local2 = config.definitions;
trace("extraButtons::def", config.definitions);
for each (_local3 in config.extraButtons) {
trace("extraButtons::button", _local3);
if (((_local2[_local3]) && (_local1.hasClip(_local3)))){
_local4 = {};
_local4[_local3] = {};
_local5 = _local2[_local3].split("::")[0];
_local6 = _local2[_local3].split("::")[1];
_local4[_local3][_local5] = _local6;
if (_local1.addButton(_local3, _local4)){
};
} else {
trace("extraButtons::notfound", _local3);
};
};
};
}
private function onHideControlBar(_arg1:TimerEvent):void{
if (!paused){
hideControlBar();
};
}
private function hideControlBar():void{
var bar:Sprite = view.skin.controlbar;
var callback:Function = function ():void{
view.sendEvent("CONTROLBAR_HIDE");
};
view.sendEvent("CONTROLBAR_HIDE_START");
if (config.autohide.fade){
TweenLite.to(bar, config.autohide.fadeDuration, {alpha:0, onComplete:callback});
} else {
bar.visible = false;
callback();
};
}
private function onHideVolumeRequest(_arg1:TimerEvent):void{
var e = _arg1;
try {
volumeTween = TweenLite.to(view.skin.controlbar.volume.volume_slider, 1, {alpha:0, onComplete:function ():void{
view.skin.controlbar.volume.volume_slider.visible = false;
view.skin.controlbar.volume.volume_slider.alpha = 1;
view.skin.controlbar.volume.volume_slider.removeEventListener(MouseEvent.MOUSE_OUT, onMouseVolumeOut);
}});
} catch(e:Error) {
};
}
private function onPlayRequest(_arg1:ControllerEvent):void{
firstPlay = true;
}
private function onFinishedRequest(_arg1:ControllerEvent):void{
firstPlay = false;
}
private function stepSeek(_arg1:Number):void{
if (((view.currentItem) && (firstPlay))){
view.sendEvent(ViewEvent.STEP_SEEK, {step:config.seek.stepSeekTime, delta:((_arg1)<0) ? -1 : 1});
};
}
private function onLoadRequest(_arg1:ControllerEvent):void{
firstPlay = (view.config.get("main.autoPlay")) ? true : false;
}
private function onMouseEnterStage(_arg1:MouseEvent):void{
var e = _arg1;
autohideTimer.stop();
autohideTimer.reset();
var bar:Sprite = view.skin.controlbar;
view.sendEvent("CONTROLBAR_SHOW");
var callback:Function = function ():void{
view.sendEvent("CONTROLBAR_SHOW_FINISHED");
};
if (config.autohide.fade){
TweenLite.to(bar, config.autohide.fadeDuration, {alpha:1, onComplete:callback});
} else {
bar.visible = true;
callback();
};
}
public function resume():void{
paused = false;
}
private function addEnhancements():void{
if (config.useAutoHide){
view.skin.stage.addEventListener(Event.MOUSE_LEAVE, onMouseStageLeave);
view.skin.stage.addEventListener(MouseEvent.MOUSE_OVER, onMouseEnterStage);
autohideTimer = new Timer((config.autohide.delay * 1000), 1);
autohideTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onHideControlBar);
view.addViewListener(ViewEvent.INIT, onPlayerLoaded);
};
if (((config.useProgressiveTimer) && (view.skin.progress_timer))){
new ProgressiveTimer(view);
};
if (config.seek.mouse){
MouseWheelManager.setup(view.skin.stage);
view.skin.stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
};
if (config.seek.keyboard){
view.skin.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownRequest);
};
if (((config.seek.keyboard) || (config.seek.mouse))){
view.addControllerListener(ControllerEvent.LOAD, onLoadRequest);
view.addControllerListener(ControllerEvent.FINISHED, onFinishedRequest);
view.addControllerListener(ControllerEvent.PLAY, onPlayRequest);
};
if (((((view.skin.controlbar.volume) && (view.skin.controlbar.volume.volume_show))) && (config.autoHideVolume))){
view.skin.controlbar.volume.addEventListener(MouseEvent.MOUSE_OVER, onVolumeShowRequest, false, 0, true);
volumeHideTimer = new Timer((1 * 1000), 1);
volumeHideTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onHideVolumeRequest, false, 0, true);
};
if (config.extraButtons["length"]){
addExtraButtons();
};
}
private function onKeyDownRequest(_arg1:KeyboardEvent):void{
var _local2:Number = _arg1.keyCode;
if (_local2 == Keyboard.LEFT){
stepSeek(-(config.seek.keyRatio));
} else {
if (_local2 == Keyboard.RIGHT){
stepSeek(config.seek.keyRatio);
};
};
}
private function onMouseVolumeOut(_arg1:MouseEvent):void{
volumeHideTimer.start();
}
public function pause():void{
if (autohideTimer){
autohideTimer.reset();
autohideTimer.stop();
};
paused = true;
}
private function onMouseWheel(_arg1:MouseEvent):void{
stepSeek(_arg1.delta);
}
private function onMouseStageLeave(_arg1:Event):void{
autohideTimer.start();
}
}
}//package com.conceptualideas.videoplayer.enhancements
Section 25
//PlayerEnhancements (com.conceptualideas.videoplayer.enhancements.PlayerEnhancements)
package com.conceptualideas.videoplayer.enhancements {
import flash.events.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import flash.ui.*;
public class PlayerEnhancements extends BaseComponent {
private var config:Object;
public function PlayerEnhancements(){
config = {maxWidth:0, keyboardFullScreen:true, showRelatedVideos:true, enableDimMode:false, dim:{}};
super();
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
addEnhancements();
}
private function onDimToggleRequest(_arg1:ViewEvent):void{
CIDimmer.instance().toggle();
}
private function addEnhancements():void{
var _local1:DomainTools = DomainTools.instance();
config = _local1.extend(config, view.config.get("player", false, true));
var _local2:Number = Number(_local1.vars.check(config.maxWidth, "enhancements.player.maxWidth"));
if (((!(_local2)) || (isNaN(_local2)))){
view.config.remove("player.maxWidth", true);
};
if (config.keyboardFullScreen){
view.skin.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownRequest);
};
if (config.enableDimMode){
CIDimmer.instance().init(config.dim);
view.addViewListener(ViewEvent.DIM, onDimToggleRequest);
};
}
private function onKeyDownRequest(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.F9){
view.sendEvent(ViewEvent.FULLSCREEN);
};
}
}
}//package com.conceptualideas.videoplayer.enhancements
Section 26
//VideoEnhancements (com.conceptualideas.videoplayer.enhancements.VideoEnhancements)
package com.conceptualideas.videoplayer.enhancements {
import flash.events.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
public class VideoEnhancements extends BaseComponent {
private var config:Object;
private var dtools:DomainTools;
public function VideoEnhancements(){
dtools = DomainTools.instance();
config = {displayclick:false, fullHeight:true, maxWidth:640};
super();
}
private function onMouseClick(_arg1:MouseEvent):void{
var _local2:Object = view.currentItem;
if (((_local2["link"]) && ((view.config["state"] == ModelStates.PAUSED)))){
dtools.navigate(_local2["link"], config.linktarget);
};
}
private function addEnhancements():void{
if (config.displayclick){
view.skin.display.addEventListener(MouseEvent.CLICK, onMouseClick);
view.addControllerListener(ControllerEvent.LOAD, onLoadRequest);
};
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
config = dtools.extend(config, _arg1.config.get("video", false, true));
addEnhancements();
}
private function onLoadRequest(_arg1:ControllerEvent):void{
var _local2:Object = view.currentItem;
view.skin.display.buttonMode = (view.skin.display.enabled = true);
}
}
}//package com.conceptualideas.videoplayer.enhancements
Section 27
//AbstractController (com.conceptualideas.videoplayer.events.AbstractController)
package com.conceptualideas.videoplayer.events {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
public class AbstractController extends EventDispatcher {
protected var config:Object;
public function AbstractController(_arg1:Object){
config = {};
super();
this.config = _arg1;
}
public function close(_arg1:Model, _arg2:AbstractView):void{
}
}
}//package com.conceptualideas.videoplayer.events
Section 28
//AbstractView (com.conceptualideas.videoplayer.events.AbstractView)
package com.conceptualideas.videoplayer.events {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.interfaces.*;
public class AbstractView extends EventDispatcher {
public function loadModule(_arg1:IComponent):void{
}
public function get config():Object{
return ({});
}
public function addHook(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null, _arg5:Boolean=true):ISystemHook{
return (null);
}
public function getModule(_arg1:String){
}
public function track(_arg1:String, _arg2:Object=null):void{
}
public function get currentItem():Object{
return ({});
}
public function addControllerListener(_arg1:String, _arg2:Function, _arg3:int=0):void{
}
public function get playlist():Array{
return (new Array());
}
public function removeControllerListener(_arg1:String, _arg2:Function):void{
}
public function sendEvent(_arg1:String, _arg2:Object=undefined):void{
}
public function addViewListener(_arg1:String, _arg2:Function):void{
}
public function addModelListener(_arg1:String, _arg2:Function):void{
}
public function get skin():MovieClip{
return (new MovieClip());
}
public function get stage():Stage{
return (skin.stage);
}
}
}//package com.conceptualideas.videoplayer.events
Section 29
//BaseComponent (com.conceptualideas.videoplayer.events.BaseComponent)
package com.conceptualideas.videoplayer.events {
import com.conceptualideas.videoplayer.interfaces.*;
public class BaseComponent implements IComponent {
protected var view:AbstractView;
public function initalize(_arg1:AbstractView):void{
this.view = _arg1;
}
}
}//package com.conceptualideas.videoplayer.events
Section 30
//ControllerEvent (com.conceptualideas.videoplayer.events.ControllerEvent)
package com.conceptualideas.videoplayer.events {
import flash.events.*;
public class ControllerEvent extends Event {
private var _data:Object;
public static const PRE:String = "pre";
public static const LOAD:String = "load";
public static const STOP:String = "stop";
public static const FINISHED:String = "finished";
public static const RESIZE:String = "resize";
public static const PAUSE:String = "pause";
public static const RESIZE_VIDEO:String = "resize_video";
public static const SEEK:String = "seek";
public static const PLAYLIST:String = "playlist";
public static const VOLUME:String = "volume";
public static const PLAY:String = "play";
public function ControllerEvent(_arg1:String, _arg2:Object=null){
super(_arg1, true, true);
this._data = _arg2;
}
public function get data():Object{
return (_data);
}
override public function toString():String{
return (formatToString("ControllerEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new ControllerEvent(type, data));
}
}
}//package com.conceptualideas.videoplayer.events
Section 31
//HookingEvents (com.conceptualideas.videoplayer.events.HookingEvents)
package com.conceptualideas.videoplayer.events {
public class HookingEvents {
public static const FIRST_PLAY:String = "first_play";
}
}//package com.conceptualideas.videoplayer.events
Section 32
//ModelEvent (com.conceptualideas.videoplayer.events.ModelEvent)
package com.conceptualideas.videoplayer.events {
import flash.events.*;
public class ModelEvent extends Event {
private var _data:Object;
public static const BUFFER:String = "BUFFER";
public static const META:String = "META";
public static const ERROR:String = "ERROR";
public static const LOADED:String = "LOADED";
public static const TIME:String = "TIME";
public static const STATE:String = "STATE";
public function ModelEvent(_arg1:String, _arg2:Object=null){
super(_arg1, true, true);
this._data = _arg2;
}
public function get data():Object{
return (_data);
}
public function isComplete():Boolean{
return ((((((type == ModelEvent.STATE)) && (_data["state"]))) && ((_data["state"] == "completed"))));
}
override public function toString():String{
return (formatToString("ModelEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new ModelEvent(type, data));
}
}
}//package com.conceptualideas.videoplayer.events
Section 33
//ModelStates (com.conceptualideas.videoplayer.events.ModelStates)
package com.conceptualideas.videoplayer.events {
public class ModelStates {
public static const LOADED:String = "loaded";
public static const BUFFERING:String = "buffering";
public static const COMPLETED:String = "completed";
public static const PLAYING:String = "playing";
public static const IDLE:String = "idle";
public static const PAUSED:String = "paused";
}
}//package com.conceptualideas.videoplayer.events
Section 34
//ViewEvent (com.conceptualideas.videoplayer.events.ViewEvent)
package com.conceptualideas.videoplayer.events {
import flash.events.*;
public class ViewEvent extends Event {
private var _data:Object;
public static const DIM:String = "DIM";
public static const FULLSCREEN:String = "FULLSCREEN";
public static const UPDATE:String = "UPDATE";
public static const REWIND:String = "REWIND";
public static const STEP_SEEK:String = "STEP_SEEK";
public static const SHOW_MENU:String = "SHOW_MENU";
public static const INIT:String = "INIT";
public static const STOP:String = "STOP";
public static const REDRAW_SCREEN:String = "REDRAW_SCREEN";
public static const MUTE:String = "MUTE";
public static const VOLUME:String = "VOLUME";
public static const PAUSE:String = "PAUSE";
public static const PLAY:String = "PLAY";
public static const LOAD:String = "LOAD";
public static const ORIGINAL_SCREEN:String = "ORIGINAL_SCREEN";
public static const UNMUTE:String = "UNMUTE";
public static const BUFFER_FULL:String = "BUFFER_FULL";
public static const REDRAW:String = "REDRAW";
public static const SEEK:String = "SEEK";
public static const FIT_SCREEN:String = "FIT_SCREEN";
public static const BUFFER_EMPTY:String = "BUFFER_EMPTY";
public function ViewEvent(_arg1:String, _arg2:Object=null){
_data = {};
super(_arg1, true, true);
this._data = _arg2;
}
public function get data():Object{
return (((_data) || ({})));
}
override public function toString():String{
return (formatToString("ViewEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new ViewEvent(type, data));
}
}
}//package com.conceptualideas.videoplayer.events
Section 35
//IAdView (com.conceptualideas.videoplayer.interfaces.IAdView)
package com.conceptualideas.videoplayer.interfaces {
public interface IAdView {
function hide():void;
function load(_arg1:String):void;
function get height():Number;
function get name():String;
function set width(_arg1:Number):void;
function get width():Number;
function set height(_arg1:Number):void;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void;
function set name(_arg1:String):void;
function get x():Number;
function get y():Number;
function show():void;
}
}//package com.conceptualideas.videoplayer.interfaces
Section 36
//IBootLoader (com.conceptualideas.videoplayer.interfaces.IBootLoader)
package com.conceptualideas.videoplayer.interfaces {
public interface IBootLoader {
function run(_arg1:Function, _arg2:Object=null):void;
}
}//package com.conceptualideas.videoplayer.interfaces
Section 37
//IComponent (com.conceptualideas.videoplayer.interfaces.IComponent)
package com.conceptualideas.videoplayer.interfaces {
import com.conceptualideas.videoplayer.events.*;
public interface IComponent {
function initalize(_arg1:AbstractView):void;
}
}//package com.conceptualideas.videoplayer.interfaces
Section 38
//IHookResults (com.conceptualideas.videoplayer.interfaces.IHookResults)
package com.conceptualideas.videoplayer.interfaces {
public interface IHookResults {
function add(_arg1:ISystemHook):void;
function finished():Boolean;
function isType(_arg1:String):Boolean;
function get(_arg1:String);
function commit():void;
function destroy():void;
function has(_arg1:String):Boolean;
function isError(_arg1):Boolean;
}
}//package com.conceptualideas.videoplayer.interfaces
Section 39
//ISystemHook (com.conceptualideas.videoplayer.interfaces.ISystemHook)
package com.conceptualideas.videoplayer.interfaces {
public interface ISystemHook {
function getName():String;
function destory():void;
function getHookID():int;
function isSync():Boolean;
function same(_arg1:Function):Boolean;
function run():void;
function assert(... _args):void;
function answer();
function running():Boolean;
}
}//package com.conceptualideas.videoplayer.interfaces
Section 40
//BasicModel (com.conceptualideas.videoplayer.models.BasicModel)
package com.conceptualideas.videoplayer.models {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
import flash.display.*;
import com.conceptualideas.videoplayer.events.*;
import flash.utils.*;
public class BasicModel extends Sprite {
protected var interval:Timer;
protected var model:Model;
protected var position:Number;
protected var item:Object;
public function BasicModel(_arg1:Model):void{
interval = new Timer(100);
super();
this.model = _arg1;
interval.addEventListener(TimerEvent.TIMER, onTimerTick, false, 0, true);
}
public function volume(_arg1:Number):void{
}
public function stop():void{
stopInterval();
position = 0;
model.sendEvent(ModelEvent.STATE, {state:ModelStates.IDLE});
}
private function onTimerTick(_arg1:TimerEvent):void{
positionInterval();
}
protected function stopInterval():void{
interval.stop();
interval.reset();
}
public function load(_arg1:Object):void{
item = _arg1;
item["middle"] = false;
position = 0;
stopInterval();
}
protected function positionInterval():void{
if (position < item["duration"]){
model.sendEvent(ModelEvent.TIME, {time:position, duration:item["duration"]});
} else {
if (item["duration"] > 0){
stopInterval();
model.sendEvent(ModelEvent.STATE, {state:ModelStates.COMPLETED});
};
};
}
public function resize():void{
}
public function pause():void{
stopInterval();
model.sendEvent(ModelEvent.STATE, {state:ModelStates.PAUSED});
}
public function seek(_arg1:Number):void{
stopInterval();
position = _arg1;
startInterval();
}
public function play():void{
startInterval();
model.sendEvent(ModelEvent.STATE, {state:ModelStates.PLAYING});
}
protected function startInterval():void{
stopInterval();
interval.start();
}
}
}//package com.conceptualideas.videoplayer.models
Section 41
//HttpModel (com.conceptualideas.videoplayer.models.HttpModel)
package com.conceptualideas.videoplayer.models {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.events.*;
import flash.utils.*;
import flash.net.*;
import com.conceptualideas.flvplayer.*;
import flash.media.*;
public class HttpModel extends BasicModel {
protected var stream:NetStream;
protected var video:Video;
protected var meta:Boolean;// = false
protected var timeOffset:Number;// = 0
protected var client:VideoClient;
private var fromPlay:Boolean;// = false
protected var hookAnswers:Object;
private var connection:NetConnection;
private var loadtimer:Number;// = 0
private var loadinterval:Number;
protected var currentOffset:Number;// = 0
private var iterator:Number;// = 0
protected var mp4:Boolean;// = false
protected var firstRun:Boolean;// = true
private var _soundTransform:SoundTransform;
public function HttpModel(_arg1:Model){
hookAnswers = {};
super(_arg1);
video = new Video(320, 240);
createConnection();
_soundTransform = new SoundTransform();
}
private function _hookResults(_arg1:IHookResults):void{
if (_arg1.isType(HookingEvents.FIRST_PLAY)){
_playFile();
firstRun = false;
};
}
protected function loadHandler():void{
var _local1:Number = stream.bytesLoaded;
var _local2:Number = (stream.bytesTotal + currentOffset);
var _local3:Number = currentOffset;
model.sendEvent(ModelEvent.LOADED, {loaded:_local1, total:_local2, offset:_local3});
if (((((_local1 + _local3) >= _local2)) && ((_local1 > 0)))){
clearInterval(loadinterval);
};
}
override public function stop():void{
super.stop();
stream.close();
timeOffset = (currentOffset = 0);
meta = false;
firstRun = true;
}
public function onMetaData(_arg1:Event):void{
if (!meta){
model.sendEvent(ModelEvent.META, {duration:client.duration, height:client.height, width:client.width});
mp4 = client.isMp4();
};
}
private function onNetStatus(_arg1:NetStatusEvent):void{
trace("onNetStatus::", _arg1.info.code);
switch (_arg1.info.code){
case "NetConnection.Connect.Success":
createStream();
break;
};
}
override protected function positionInterval():void{
iterator++;
if (iterator > 10){
position = (Math.round((stream.time * 10)) / 10);
if (mp4){
position = (position + timeOffset);
};
};
var _local1:Number = Math.round(((stream.bufferLength / stream.bufferTime) * 100));
if ((((_local1 < 95)) && ((position < Math.abs(((item["duration"] - stream.bufferTime) - 1)))))){
model.sendEvent(ModelEvent.BUFFER, {percentage:_local1});
if (((!((model.config["state"] == ModelStates.BUFFERING))) && ((_local1 < 25)))){
model.sendEvent(ModelEvent.STATE, {state:ModelStates.BUFFERING});
};
} else {
if ((((_local1 > 95)) && (!((model.config["state"] == ModelStates.PLAYING))))){
model.sendEvent(ModelEvent.STATE, {state:ModelStates.PLAYING});
};
};
if (position < item["duration"]){
model.sendEvent(ModelEvent.TIME, {time:position, duration:item["duration"]});
} else {
if (item["duration"] > 0){
stopInterval();
model.sendEvent(ModelEvent.STATE, {state:ModelStates.COMPLETED});
};
};
}
override public function pause():void{
super.pause();
stream.pause();
}
override public function volume(_arg1:Number):void{
super.volume(_arg1);
_soundTransform.volume = _arg1;
stream.soundTransform = _soundTransform;
}
private function onIOError(_arg1:IOErrorEvent):void{
}
private function createStream():void{
stream = new NetStream(connection);
stream.soundTransform = _soundTransform;
stream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
stream.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError, false, 0, true);
stream.bufferTime = model.config.get("main.bufferTime");
client = new VideoClient();
stream.client = client;
client.addEventListener(VideoClient.METADATA_LOADED, onMetaData, false, 0, true);
video.attachNetStream(stream);
}
override public function load(_arg1:Object):void{
super.load(_arg1);
model.placeMedia(video);
position = timeOffset;
iterator = 0;
_playFile();
}
protected function _playFile():void{
stream.play(getURL());
startInterval();
loadinterval = setInterval(loadHandler, 200);
}
private function onAsyncError(_arg1:AsyncErrorEvent):void{
}
override public function play():void{
if (position > item["duration"]){
seek(0);
};
super.play();
stream.resume();
}
protected function getURL():String{
return (item["file"]);
}
private function createConnection():void{
if (connection){
connection.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
connection.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
connection.close();
};
connection = new NetConnection();
connection.objectEncoding = ObjectEncoding.AMF3;
connection.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
connection.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
connection.connect(null);
}
override public function seek(_arg1:Number):void{
super.seek(_arg1);
stream.seek(_arg1);
}
}
}//package com.conceptualideas.videoplayer.models
Section 42
//LighttpdModel (com.conceptualideas.videoplayer.models.LighttpdModel)
package com.conceptualideas.videoplayer.models {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
import com.conceptualideas.videoplayer.events.*;
public class LighttpdModel extends HttpModel {
private var filepositions:Array;
private var times:Array;
public function LighttpdModel(_arg1:Model){
super(_arg1);
}
protected function getSeekOffset(_arg1:Number, _arg2:Boolean=false):Number{
var i:Number;
var pos = _arg1;
var time = _arg2;
var offset:Number = 0;
try {
i = 0;
while (i < (times.length - 1)) {
if ((((times[i] <= pos)) && ((times[(i + 1)] >= pos)))){
break;
};
i = (i + 1);
};
if (time == true){
offset = times[i];
} else {
offset = filepositions[i];
};
} catch(e:Error) {
};
return (offset);
}
override protected function loadHandler():void{
var _local1:Number = stream.bytesLoaded;
var _local2:Number = stream.bytesTotal;
var _local3:Number = 0;
model.sendEvent(ModelEvent.LOADED, {loaded:_local1, total:_local2, offset:_local3});
}
override public function seek(_arg1:Number):void{
var _local2:Number = getSeekOffset(_arg1);
stopInterval();
if ((((_local2 < currentOffset)) || ((_local2 >= (currentOffset + stream.bytesLoaded))))){
timeOffset = (position = getSeekOffset(_arg1, true));
currentOffset = _local2;
load(item);
} else {
position = _arg1;
if (mp4){
stream.seek(getSeekOffset((position - timeOffset), true));
} else {
stream.seek(getSeekOffset(position, true));
};
};
startInterval();
}
override protected function getURL():String{
var _local1:String = item["file"];
var _local2:String = item["seeking"];
_local1 = (_local1 + _local2);
if (mp4){
_local1 = (_local1 + timeOffset);
} else {
_local1 = (_local1 + currentOffset);
};
return (_local1);
}
override public function onMetaData(_arg1:Event):void{
if (!meta){
super.onMetaData(_arg1);
if (_arg1.target.retrive("keyframes")){
times = _arg1.target.retrive("keyframes").times;
filepositions = _arg1.target.retrive("keyframes").filepositions;
};
meta = true;
if (item["start"] > 0){
seek(item["start"]);
item["start"] = 0;
};
};
}
}
}//package com.conceptualideas.videoplayer.models
Section 43
//PlayerSkin (com.conceptualideas.videoplayer.models.PlayerSkin)
package com.conceptualideas.videoplayer.models {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.utils.*;
public class PlayerSkin extends EventDispatcher {
private var _settings:Object;
private var _skin:MovieClip;
private var loader:Loader;
public static const INVALID_SKIN:String = "invalid_skin";
public static const SKIN_LOADED:String = "skin_loaded";
private static var _instance:PlayerSkin;
private function onSkinLoaded(_arg1:Event):void{
var _local3:String;
_skin = MovieClip(_arg1.target.content);
var _local2:Array = ["timeline", "menu"];
for each (_local3 in _local2) {
if (_skin[_local3]){
_skin[_local3].visible = false;
};
};
dispatchEvent(new Event(PlayerSkin.SKIN_LOADED));
}
private function check(_arg1:Object, _arg2:Object):Boolean{
return (((_arg1) && ((_arg1 == _arg2))));
}
public function load(_arg1:Object):void{
if (((!(_arg1)) || (!(_arg1.file)))){
dispatchEvent(new Event(PlayerSkin.INVALID_SKIN));
return;
};
if (!check(_arg1.file, "empty")){
loadSwf(_arg1.file);
};
}
public function getAssetInstance(_arg1:String):Class{
if (loader.contentLoaderInfo.applicationDomain.hasDefinition(_arg1)){
return ((loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1) as Class));
};
return (null);
}
public function getObject(_arg1:String){
if (_skin[_arg1]){
return (_skin[_arg1]);
};
}
private function loadSwf(_arg1:String):void{
_arg1 = ((_arg1.indexOf(".swf"))==-1) ? (_arg1 + "_skin.swf") : _arg1;
_arg1 = DomainTools.instance().relToAbsPath(_arg1);
loader = DomainTools.instance().loadImage(_arg1, onSkinLoaded);
}
public function get skin():MovieClip{
return (_skin);
}
public static function instance():PlayerSkin{
if (!_instance){
_instance = new (PlayerSkin);
};
return (_instance);
}
}
}//package com.conceptualideas.videoplayer.models
Section 44
//RTMPModel (com.conceptualideas.videoplayer.models.RTMPModel)
package com.conceptualideas.videoplayer.models {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
import com.conceptualideas.videoplayer.events.*;
import flash.net.*;
import com.conceptualideas.flvplayer.*;
import flash.media.*;
public class RTMPModel extends BasicModel {
protected var stream:NetStream;
private var started:Boolean;// = false
private var connected:Date;
private var client:VideoClient;
private var timeOffset:Number;// = 0
protected var connection:NetConnection;
private var start:Date;
private var unpublished:Boolean;// = false
private var mp4:Boolean;// = false
private var video:Video;
private var soundtransform:SoundTransform;
public function RTMPModel(_arg1:Model){
super(_arg1);
video = new Video(320, 240);
video.smoothing = ((_arg1.config.get("video.smoothing")) || (true));
connection = new NetConnection();
connection.client = new VideoClient();
connection.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
connection.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
connection.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandler);
connection.objectEncoding = ObjectEncoding.AMF3;
soundtransform = new SoundTransform();
}
override public function pause():void{
if (started){
super.pause();
stream.pause();
if (((started) && ((item["duration"] == 0)))){
stop();
};
};
}
private function onMetaData(_arg1:Event):void{
var _local2:VideoClient = VideoClient(_arg1.target);
if (!mp4){
model.sendEvent(ModelEvent.META, {duration:_local2.duration, height:_local2.height, width:_local2.width});
mp4 = (_local2.retrive("seekpoints")) ? true : false;
};
}
override public function seek(_arg1:Number):void{
position = _arg1;
stopInterval();
stream.seek(position);
if (model.config.get("ui.video.unPauseSeek")){
stream.resume();
};
model.sendEvent(ModelEvent.STATE, {state:ModelStates.PLAYING});
}
protected function setStream():void{
stream = new NetStream(connection);
stream.checkPolicyFile = true;
stream.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
stream.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandler);
stream.bufferTime = model.config.get("main.bufferTime");
stream.client = new VideoClient();
stream.client.addEventListener(VideoClient.METADATA_LOADED, onMetaData, false, 0, true);
stream.client.addEventListener(VideoClient.VIDEO_FINISHED, onVideoFinished, false, 0, true);
video.attachNetStream(stream);
if ((model.config["mute"] == true)){
volume(0);
} else {
volume(model.config["volume"]);
};
playStream();
startInterval();
}
protected function getID(_arg1:String):String{
var _local2:String = _arg1.substr(-4);
if (_local2 == ".mp3"){
return (("mp3:" + _arg1.substr(0, (_arg1.length - 4))));
};
if ((((((((((_local2 == ".mp4")) || ((_local2 == ".mov")))) || ((_local2 == ".aac")))) || ((_local2 == ".m4a")))) || ((_local2 == ".f4v")))){
return (("mp4:" + _arg1));
};
if (_local2 == ".flv"){
return (_arg1.substr(0, (_arg1.length - 4)));
};
return (_arg1);
}
protected function playStream():void{
if (model.config.get("modules.limitplayback.enabled")){
stream.play(getID(item["file"]), 0, model.config.get("modules.limitplayback.limit"));
} else {
stream.play(getID(item["file"]));
};
}
override protected function positionInterval():void{
var _local1:Number = (Math.round((stream.time * 10)) / 10);
var _local2:Number = Math.round(((stream.bufferLength / stream.bufferTime) * 100));
if ((((_local2 < 95)) && ((position < Math.abs(((item["duration"] - stream.bufferTime) - 1)))))){
model.sendEvent(ModelEvent.BUFFER, {percentage:_local2});
if (((!((model.config["state"] == ModelStates.BUFFERING))) && ((_local2 < 25)))){
model.sendEvent(ModelEvent.STATE, {state:ModelStates.BUFFERING});
};
} else {
if ((((_local2 > 95)) && (!((model.config["state"] == ModelStates.PLAYING))))){
model.sendEvent(ModelEvent.STATE, {state:ModelStates.PLAYING});
};
};
if (_local1 < item["duration"]){
if (_local1 != position){
model.sendEvent(ModelEvent.TIME, {time:position, duration:item["duration"]});
position = _local1;
};
} else {
if (((!(isNaN(position))) && ((item["duration"] > 0)))){
pause();
if (((started) && ((item["duration"] == 0)))){
stop();
};
model.sendEvent(ModelEvent.STATE, {state:ModelStates.COMPLETED});
};
};
}
override public function volume(_arg1:Number):void{
soundtransform.volume = _arg1;
if (stream){
stream.soundTransform = soundtransform;
};
}
override public function stop():void{
if (stream){
stream.close();
};
connection.close();
started = false;
stopInterval();
position = 0;
}
override public function load(_arg1:Object):void{
super.load(_arg1);
position = 0;
model.placeMedia(video);
start = new Date();
connection.connect(_arg1["host"]);
}
protected function errorHandler(_arg1:ErrorEvent):void{
stop();
model.sendEvent(ModelEvent.ERROR, {message:_arg1.text});
}
private function onAsyncError(_arg1:AsyncErrorEvent):void{
}
private function onVideoFinished(_arg1:Event):void{
stop();
model.sendEvent(ModelEvent.STATE, {state:ModelStates.COMPLETED});
}
override public function play():void{
if (!started){
setStream();
} else {
if (position >= item["duration"]){
seek(0);
};
super.play();
stream.resume();
};
}
protected function statusHandler(_arg1:NetStatusEvent):void{
var _local2:String;
trace(_arg1.info.code);
switch (_arg1.info.code){
case "NetConnection.Connect.Success":
if (_arg1.info.secureToken != undefined){
};
setStream();
break;
case "NetStream.Play.Start":
if ((((item["start"] > 0)) && (!(started)))){
seek(item["start"]);
};
if (!started){
volume(model.config["volume"]);
};
started = true;
break;
case "NetStream.Seek.Notify":
startInterval();
break;
case "NetConnection.Connect.Rejected":
if (((_arg1.info.ex) && ((_arg1.info.ex.code == 302)))){
item["streamer"] = _arg1.info.ex.redirect;
connection.connect(item["streamer"]);
} else {
_local2 = _arg1.info.code;
if (_arg1.info["description"]){
_local2 = _arg1.info["description"];
};
trace("NetConnection.Connect.Rejected -", _local2);
};
break;
case "NetStream.Failed":
case "NetStream.Play.StreamNotFound":
if (unpublished){
unpublished = false;
} else {
stop();
model.sendEvent(ModelEvent.ERROR, {message:("Stream not found: " + item["file"])});
};
break;
case "NetConnection.Connect.Failed":
stop();
model.sendEvent(ModelEvent.ERROR, {message:("Server not found: " + item["streamer"])});
break;
case "NetStream.Play.UnpublishNotify":
unpublished = true;
break;
};
}
}
}//package com.conceptualideas.videoplayer.models
Section 45
//SecureStreaming (com.conceptualideas.videoplayer.models.SecureStreaming)
package com.conceptualideas.videoplayer.models {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
import flash.net.*;
public class SecureStreaming extends RTMPModel {
private var pendingEvent:NetStatusEvent;// = null
private var decoded:Boolean;// = false
public function SecureStreaming(_arg1:Model){
super(_arg1);
}
override protected function playStream():void{
if (model.config.get("modules.limitplayback.enabled")){
stream.play(getID(item["file"]), 0, model.config.get("modules.limitplayback.limit"));
} else {
super.playStream();
};
}
override protected function statusHandler(_arg1:NetStatusEvent):void{
if ((((_arg1.info.code == "NetConnection.Connect.Success")) && (!(decoded)))){
pendingEvent = _arg1;
connection.call("CI_DecodeStream", new Responder(onDecodeResponse), decodeURIComponent(item["file"]));
} else {
super.statusHandler(_arg1);
};
}
private function onDecodeResponse(_arg1:String):void{
item["file"] = _arg1;
super.statusHandler(pendingEvent);
pendingEvent = null;
}
}
}//package com.conceptualideas.videoplayer.models
Section 46
//Ads (com.conceptualideas.videoplayer.modules.advertisement.Ads)
package com.conceptualideas.videoplayer.modules.advertisement {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.events.*;
import com.conceptualideas.videoplayer.views.ads.*;
import flash.utils.*;
public class Ads extends BaseComponent {
private var showMiddleButton:Boolean;
private var showWaterMark:Boolean;
private var ads:Dictionary;
private var isShowing:Boolean;// = false
private var adContainer:Sprite;
public function Ads(){
ads = new Dictionary();
super();
}
private function hide():void{
var _local1:String;
var _local2:IAdView;
for (_local1 in ads) {
_local2 = ads[_local1];
_local2.hide();
if (((showWaterMark) && (view.config.getModule("watermarks")))){
view.config.getModule("watermarks").hide();
};
};
isShowing = false;
}
private function onResizeRequest(_arg1:ControllerEvent):void{
center();
}
private function getAdView(_arg1:String):IAdView{
var _local2:IAdView;
var _local3 = "";
switch (_arg1){
case "text":
_local2 = (ads[_arg1]) ? ads[_arg1] : new TextAdContainerView();
ads[_arg1] = _local2;
break;
case "image":
_local2 = (ads[_arg1]) ? ads[_arg1] : new ImageAdContainerView();
ads[_arg1] = _local2;
break;
default:
_local2 = (ads[_arg1]) ? ads[_arg1] : CustomAdContainer.retrive(_arg1);
ads[_arg1] = _local2;
break;
};
return (_local2);
}
private function onUserAction(_arg1:Event):void{
hide();
}
private function center():void{
var _local1:IAdView;
for each (_local1 in ads) {
_local1.x = ((view.stage.stageWidth - _local1.width) / 2);
_local1.y = (((view.stage.stageHeight - view.config.barHeight) - _local1.height) / 2);
};
}
private function buildAd(_arg1:String):void{
var adConfig:Object;
var adView:IAdView;
var adPlacement = _arg1;
adPlacement = String(adPlacement.split("show")[1]).toLowerCase();
if ((((adPlacement == "pre")) && (view.config.main.autoPlay))){
return;
};
adConfig = view.config.ads.display[adPlacement];
if (!adConfig){
return;
};
adView = getAdView(adConfig.type);
adView.name = ((adPlacement + "_") + adView.name);
adView.addEventListener("ad_loaded", onAdsLoaded, false, 0, true);
view.skin.addChild((adView as DisplayObject));
var func:Function = function (_arg1:ControllerEvent):void{
if (!isShowing){
isShowing = true;
if (!showMiddleButton){
view.config.getModule("display").setIcon();
};
adView.load(adConfig.url);
};
};
var eventType:String = ((adPlacement)=="post") ? "FINISHED" : adPlacement.toUpperCase();
view.addControllerListener(ControllerEvent[eventType], func);
}
override public function initalize(_arg1:AbstractView):void{
var _local3:String;
super.initalize(_arg1);
var _local2:Object = _arg1.config.ads;
showMiddleButton = (((_local2.settings) && (_local2.settings.showMiddleButton))) ? true : false;
showWaterMark = (((_local2.settings) && (_local2.settings.showWaterMark))) ? true : false;
for (_local3 in _local2) {
if (((((!((_local3 == "display"))) && ((_local2[_local3] == true)))) && (!((_local3 == "settings"))))){
buildAd(_local3);
};
};
_arg1.addControllerListener(ControllerEvent.PLAY, onUserAction);
_arg1.addControllerListener(ControllerEvent.SEEK, onUserAction);
_arg1.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
_arg1.addViewListener(ViewEvent.REWIND, onUserAction);
}
private function onAdsLoaded(_arg1:Event):void{
if (isShowing){
_arg1.target.show();
trace(view.config.getModule("watermarks"));
if (((showWaterMark) && (view.config.getModule("watermarks")))){
trace(view.config.getModule("watermarks"));
view.config.getModule("watermarks").show();
};
view.sendEvent("AD_LOADED", {ad:_arg1.target.name, target:_arg1.target});
center();
} else {
_arg1.target.hide();
};
}
}
}//package com.conceptualideas.videoplayer.modules.advertisement
Section 47
//InlineAd (com.conceptualideas.videoplayer.modules.advertisement.InlineAd)
package com.conceptualideas.videoplayer.modules.advertisement {
import flash.events.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
public class InlineAd extends BaseComponent {
private var config:Object;
private var ad:CIBannerAd;
private var reached:Boolean;// = false
private var barHeight:Number;
public function InlineAd(){
config = {occurance:1, time:0, text:{by:"Conceptual Ideas", title:"Conceptual Ideas", desc:"Check out these videos", link:"http://conceptual-ideas.com", bottom:"Check out more at cum.com"}, height:75, useExternal:false, external:{url:"", params:["id"]}, colors:{title:0xFF0000, desc:0xFF00, link:0xCC00FF, bottom:8978380}, font:"Arail"};
super();
}
private function onLoadRequest(_arg1:ControllerEvent):void{
reset();
if (!config.useExternal){
ad.clear();
ad.addAd(config.text.title, config.text.link, config.text.desc, config.text.bottom);
} else {
DomainTools.instance().loadURL(config.external.url, onAdsLoaded, null, "POST");
};
ad.hide(false);
}
private function positionAd():void{
ad.x = 0;
ad.y = ((view.stage.stageHeight - barHeight) - config.height);
}
private function reset():void{
reached = false;
}
private function onFinished(_arg1:ControllerEvent):void{
ad.hide();
}
private function onAdsLoaded(_arg1:Event):void{
var _local3:XML;
var _local4:String;
var _local2:XML = new XML(_arg1.target.data);
for each (_local3 in _local2.ads.children()) {
_local4 = ((_local3.@show)=="") ? "text" : _local3.@show;
trace(_local3.title.text());
ad.addAd(_local3.title.text(), _local3.link.text(), _local3.description.text(), _local3.bottom.text(), _local3.image.text(), _local4);
};
positionAd();
}
override public function initalize(_arg1:AbstractView):void{
var _local3:String;
var _local4:Object;
var _local5:String;
super.initalize(_arg1);
ad = new CIBannerAd();
_arg1.skin.addChild(ad);
this.view = _arg1;
barHeight = _arg1.config.get("barHeight");
config = _arg1.config.extend(config, _arg1.config.get("modules.inlinead"));
var _local2:Array = DomainTools.instance().vars.getGroup(/inlinead.[\w\W]+/i);
for each (_local3 in _local2) {
_local5 = _local3.split(".").pop();
config.text[_local5] = DomainTools.instance().vars.getValue(_local3);
};
_arg1.addModelListener(ModelEvent.TIME, onTimeRequest);
_arg1.addControllerListener(ControllerEvent.LOAD, onLoadRequest);
_arg1.addControllerListener(ControllerEvent.FINISHED, onFinished);
_arg1.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
_local4 = {colors:config.colors, by:{text:config.text.by}, width:_arg1.stage.stageWidth, height:config.height, underline:{title:false}, font:config.font};
ad.initialize(_local4);
positionAd();
reset();
ad.hide(false);
}
private function onTimeRequest(_arg1:ModelEvent):void{
if ((((((_arg1.data.time >= config.time)) && (!(reached)))) && (ad.has()))){
reached = true;
ad.show();
};
}
private function onResizeRequest(_arg1:ControllerEvent):void{
ad.setSize(_arg1.data.width, config.height);
positionAd();
}
}
}//package com.conceptualideas.videoplayer.modules.advertisement
Section 48
//JoinScreen (com.conceptualideas.videoplayer.modules.advertisement.JoinScreen)
package com.conceptualideas.videoplayer.modules.advertisement {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import gs.*;
public class JoinScreen extends BaseComponent {
private var config:Object;
private var dtools:DomainTools;
public function JoinScreen(){
config = {target:"_self"};
super();
}
private function onImageLoaded(_arg1:Event, _arg2:String):void{
var e = _arg1;
var link = _arg2;
if (view.skin.getChildByName("controlbar")){
MovieClip(view.skin.getChildByName("controlbar")).enabled = false;
};
var s:Sprite = PlayerUtils.createSpriteHolder(view.stage.stageWidth, view.stage.stageHeight, 0, 1);
view.stage.addChild(s);
s.name = "JoinScreen";
var tmp:Bitmap = (e.target.content as Bitmap);
tmp.smoothing = true;
s.addChild(tmp);
PlayerUtils.fit(tmp, view.stage.stageWidth, view.stage.stageHeight);
TweenLite.from(tmp, 1, {alpha:0});
s.buttonMode = true;
s.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
dtools.navigate(link, config.target);
});
}
private function onFinishedRequest(_arg1:ControllerEvent):void{
var _local2:String = (dtools.vars.hasKey("join.image")) ? dtools.vars.getValue("join.image") : config.image;
var _local3:String = (dtools.vars.hasKey("join.link")) ? dtools.vars.getValue("join.link") : config.link;
if (((_local2) && (_local3))){
dtools.loadImage(_local2, onImageLoaded, _local3);
};
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
dtools = DomainTools.instance();
dtools.extend(config, _arg1.config.get("modules.joinscreen"));
_arg1.addControllerListener(ControllerEvent.FINISHED, onFinishedRequest);
}
}
}//package com.conceptualideas.videoplayer.modules.advertisement
Section 49
//Detacher (com.conceptualideas.videoplayer.modules.interfaces.Detacher)
package com.conceptualideas.videoplayer.modules.interfaces {
import flash.events.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import com.conceptualideas.videoplayer.modules.ui.*;
import flash.external.*;
public class Detacher extends BaseComponent {
private var config:Object;
public function Detacher(){
config = {method:"javascript", params:["id"], url:"ci_DetachPlayer"};
super();
}
override public function initalize(_arg1:AbstractView):void{
var _local3:ControlBar;
super.initalize(_arg1);
var _local2:DomainTools = DomainTools.instance();
if (!_local2.vars.hasKey("detach")){
config = _local2.extend(config, _arg1.config.get("modules.detacher"));
_arg1.addViewListener("DETACH_PLAYER", onDetachRequest);
} else {
_local3 = _arg1.getModule("ControlBar");
if (_local3){
_local3.removeButton("detach");
};
};
}
private function onDetachRequest(_arg1:Event):void{
var _local3:Object;
var _local2:DomainTools = DomainTools.instance();
if (config.method == "javascript"){
if (ExternalInterface.available){
_local3 = ((_local2.vars.getKeyPairMap(config.params)) || ({}));
ExternalInterface.call(config.url, _local3);
AbstractView(_arg1.target).sendEvent(ViewEvent.PAUSE);
};
};
}
}
}//package com.conceptualideas.videoplayer.modules.interfaces
Section 50
//Hooker (com.conceptualideas.videoplayer.modules.interfaces.Hooker)
package com.conceptualideas.videoplayer.modules.interfaces {
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.events.*;
import flash.utils.*;
import com.conceptualideas.videoplayer.core.hooks.*;
public class Hooker extends BaseComponent {
private var _hooks:Dictionary;
public function Hooker(){
_hooks = new Dictionary();
super();
}
public function getName():String{
return ("hooker");
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
Hooks.init(Reflection.getClassConst(HookingEvents, true));
}
public function hook(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null, _arg5:Boolean=true):ISystemHook{
return (Hooks.hook(_arg1, _arg2, _arg3, _arg4, _arg5));
}
public function run(_arg1:String, _arg2:Function, _arg3:Object=null):void{
Hooks.run(_arg1, _arg2, _arg3);
}
public function unhook(_arg1:String, _arg2:Function=null, _arg3:Boolean=false):Boolean{
return (Hooks.unhook(_arg1, _arg2, _arg3));
}
}
}//package com.conceptualideas.videoplayer.modules.interfaces
Section 51
//Javascript (com.conceptualideas.videoplayer.modules.interfaces.Javascript)
package com.conceptualideas.videoplayer.modules.interfaces {
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.events.*;
import flash.utils.*;
import flash.external.*;
public class Javascript extends BaseComponent {
private const EVENTS:Object;
private var ignore:Array;
private var subscribers:Object;
private var isPlayerPaused:Boolean;// = false
public function Javascript(){
subscribers = {};
EVENTS = {Controller:{instance:ControllerEvent, uppercase:false}, Model:{instance:ModelEvent, uppercase:false}, View:{instance:ViewEvent, uppercase:true}};
ignore = ["TRACK"];
super();
}
override public function initalize(_arg1:AbstractView):void{
var _local2:Boolean;
super.initalize(_arg1);
if (ExternalInterface.available){
_local2 = Boolean(ExternalInterface.call("eval", "(typeof CIPlayer =='undefined')?false:true;"));
if (_local2){
ExternalInterface.addCallback("jsAction", onJsFunctonCall);
if (!ExternalInterface.call("CIPlayer.dontSubscribe")){
ExternalInterface.addCallback("subscribe", onSubscribeRequest);
ExternalInterface.addCallback("unsubscribe", onUnSubscribeRequest);
setupSubscription();
} else {
trace("Not Subscribing to js events");
};
};
};
}
private function onJsFunctonCall(_arg1:String, ... _args):Boolean{
var _local3:Number;
var _local4:Boolean;
var _local5:Object;
var _local6:PlaylistBuilder;
var _local7:Object;
var _local8:String;
if (view.currentItem){
switch (_arg1){
case "play":
if (_args.length){
_local5 = _args[0];
_local6 = PlaylistBuilder.instance();
_local7 = _local6.parseVideoString(_local5.file);
delete _local5.file;
for (_local8 in _local5) {
if (_local5[_local8] != null){
_local7[_local8] = _local5[_local8];
};
};
view.sendEvent(ViewEvent.LOAD, [_local7]);
} else {
view.sendEvent(ViewEvent.PLAY);
};
break;
case "pause":
view.sendEvent(ViewEvent.PAUSE);
break;
case "stop":
view.sendEvent(ViewEvent.STOP);
break;
case "togglePlayPause":
if (isPlayerPaused){
view.sendEvent(ViewEvent.PLAY);
} else {
view.sendEvent(ViewEvent.PAUSE);
};
break;
case "seek":
_local4 = (((_args[1]) && ((String(_args[1]).toLowerCase() == "true")))) ? true : false;
_local3 = (_local4) ? (Number(_args[0]) * view.currentItem["duration"]) : Number(_args[0]);
view.sendEvent(ViewEvent.SEEK, _local3);
break;
case "next":
break;
case "prev":
break;
case "enterFullScreen":
view.sendEvent(ViewEvent.FULLSCREEN);
break;
case "isFullScreen":
return ((view.stage.displayState == "fullScreen"));
};
};
return (true);
}
private function onForwardViewEvent(_arg1:ViewEvent):void{
forwardEvent("View", _arg1.type, _arg1.data);
if ((((_arg1.type == ViewEvent.PLAY)) || ((_arg1.type == ViewEvent.PAUSE)))){
isPlayerPaused = ((_arg1.type)==ViewEvent.PAUSE) ? true : false;
};
}
private function forwardEvent(_arg1:String, _arg2:String, _arg3:Object):void{
var _local5:String;
if (ignore.indexOf(_arg2) != -1){
return;
};
var _local4:String = ((_arg1 + "::") + _arg2.toUpperCase());
if (!_arg3){
_arg3 = {};
};
if ((((_arg1.toUpperCase() == "VIEW")) && ((_arg2.toUpperCase() == "INIT")))){
_arg3.playerID = ExternalInterface.objectID;
ExternalInterface.call("CIPlayer.global.broadcast", _local4, _arg3);
return;
};
for each (_local5 in subscribers[_local4]) {
ExternalInterface.call("CIPlayer.global.broadcast", _local4, _arg3, _local5);
};
}
private function onForwardModelEvent(_arg1:ModelEvent):void{
forwardEvent("Model", _arg1.type, _arg1.data);
}
private function onForwardControllerEvent(_arg1:ControllerEvent):void{
var _local2:Object = _arg1.data;
if (_arg1.type == ControllerEvent.LOAD){
isPlayerPaused = !(view.currentItem["autoplay"]);
_local2 = view.currentItem;
};
forwardEvent("Controller", _arg1.type, _local2);
}
private function setupSubscription():void{
var _local1:*;
var _local2:String;
var _local3:String;
var _local4:Array;
var _local5:String;
for (_local3 in EVENTS) {
_local1 = EVENTS[_local3].instance;
_local4 = getClassEvents(_local1);
_local2 = (("add" + _local3) + "Listener");
for each (_local5 in _local4) {
if (ignore.indexOf(_local1[_local5]) == -1){
view[_local2].apply(this, [_local1[_local5], this[(("onForward" + _local3) + "Event")]]);
};
};
};
}
private function getClassEvents(_arg1:Class):Array{
var _local4:XML;
var _local2:XML = describeType(_arg1);
var _local3:Array = [];
for each (_local4 in _local2.constant) {
_local3.push(String(_local4.@name));
};
return (_local3);
}
private function onSubscribeRequest(_arg1:String, _arg2:String):Boolean{
if (!subscribers[_arg2]){
subscribers[_arg2] = [];
};
subscribers[_arg2].push(_arg1);
return (true);
}
private function onUnSubscribeRequest(_arg1:String, _arg2:String):void{
var _local3:Number;
if (subscribers[_arg2]){
_local3 = subscribers[_arg2].indexOf(_arg1);
subscribers[_arg2].splice(_local3, 1);
};
}
}
}//package com.conceptualideas.videoplayer.modules.interfaces
Section 52
//Verify (com.conceptualideas.videoplayer.modules.interfaces.Verify)
package com.conceptualideas.videoplayer.modules.interfaces {
import flash.events.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
public class Verify extends BaseComponent {
private var config:Object;
private var hook:ISystemHook;
private var _lastAnswer;// = null
private var dtools:DomainTools;
public function Verify(){
config = {endpoint:"", redirect:"http://www.google.com", bounce:"http://www.google.com", action:"redirect"};
dtools = DomainTools.instance();
super();
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
config = dtools.extend(config, _arg1.config.get("modules.verify"));
hook = _arg1.addHook(HookingEvents.FIRST_PLAY, "verify", verify, this, false);
_arg1.addControllerListener(ControllerEvent.LOAD, onLoadRequest);
}
private function forward(_arg1:Boolean):void{
hook.assert(_arg1);
_lastAnswer = _arg1;
}
private function onVerified(_arg1:Event):void{
if (_arg1.target.data == "false"){
handleAction();
} else {
if (_arg1.target.data == "bounce"){
dtools.navigate(config.bounce);
} else {
if (_arg1.target.data == "limit"){
forward(false);
} else {
forward(true);
};
};
};
}
public function verify():void{
if (_lastAnswer == null){
if (((config.endpoint) && (!((config.endpoint == ""))))){
dtools.loadURL(config.endpoint, onVerified, null, "POST", false);
} else {
forward(true);
};
} else {
forward(_lastAnswer);
};
}
private function onLoadRequest(_arg1:ControllerEvent):void{
}
private function onPlayerRequest(_arg1:ControllerEvent):void{
if (config.verify == "block"){
view.sendEvent("STOP");
};
}
private function handleAction():void{
switch (config.action){
case "redirect":
dtools.navigate(config.redirect);
break;
case "bounce":
dtools.navigate(config.bounce);
break;
};
}
}
}//package com.conceptualideas.videoplayer.modules.interfaces
Section 53
//ControlBar (com.conceptualideas.videoplayer.modules.ui.ControlBar)
package com.conceptualideas.videoplayer.modules.ui {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.events.*;
import flash.geom.*;
import flash.utils.*;
public class ControlBar extends BaseComponent {
private var firstPlay:Boolean;// = true
private var stepSeekActive:Boolean;// = false
private var SLIDERS:Object;
private var bar:MovieClip;
private var barHeight:Number;
public var stacker:Stacker;
private var realtimeVolumeTimeout:Number;
private var progress_mask:Sprite;
private var GROUPS:Array;
private var stepSeekTimeout:Number;
private var slider:MovieClip;
private var BUTTONS:Object;
private var seeking:Boolean;// = false
private var SLIDER_GROUPS:Array;
private var skin:MovieClip;
public function ControlBar():void{
GROUPS = ["playpause", "video", "volume", "rewind", "fullscreen", "dim", "menu"];
SLIDER_GROUPS = ["seek"];
BUTTONS = {playpause:{playButton:"PLAY", pauseButton:"PAUSE"}, rewind:{rewindButton:"REWIND"}, video:{fit:"REDRAW_SCREEN", original:"REDRAW_SCREEN"}, volume:{volume_on:"MUTE", volume_off:"UNMUTE", volume_show:""}, fullscreen:{fullscreen_enter:"FULLSCREEN", fullscreen_exit:"FULLSCREEN"}};
SLIDERS = {seek:"SEEK", volume:"VOLUME", volume_slider:"VOLUME"};
super();
}
public function getName():String{
return ("ControlBar");
}
private function toggleVisible(_arg1:Object, _arg2:Boolean):void{
if (_arg1){
_arg1.visible = _arg2;
};
}
private function onScreenChanged(_arg1:ViewEvent):void{
if (_arg1.type == ViewEvent.FIT_SCREEN){
bar.video.fit.visible = false;
bar.video.original.visible = true;
} else {
bar.video.fit.visible = true;
bar.video.original.visible = false;
};
}
private function createMask():void{
progress_mask = new Sprite();
progress_mask.graphics.beginFill(1044480, 1);
progress_mask.graphics.drawRect(0, 0, 10, bar.seek.progress.height);
progress_mask.graphics.endFill();
progress_mask.y = bar.seek.progress.y;
progress_mask.x = bar.seek.progress.x;
}
private function onUpHandler(_arg1:MouseEvent):void{
var _local2:Number;
slider.dragger.stopDrag();
bar.stage.removeEventListener(MouseEvent.MOUSE_UP, onUpHandler);
if (bar.stage.hasEventListener(MouseEvent.MOUSE_MOVE)){
bar.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMoveHandler);
};
if (slider.name == "seek"){
_local2 = view.currentItem["duration"];
} else {
_local2 = 100;
};
calculateSliderValue(slider, _local2);
}
public function hasClip(_arg1:String):Boolean{
var _local4:String;
var _local2:Array = _arg1.split(".");
var _local3:Object = bar;
for each (_local4 in _local2) {
trace("hasClip", bar, _local4);
if (!_local3[_local4]){
return (false);
};
_local3 = _local3[_local4];
};
if (Boolean(_local3)){
return (true);
};
return (false);
}
private function setupButton(_arg1:MovieClip):void{
_arg1.buttonMode = true;
_arg1.mouseChildren = false;
_arg1.addEventListener(MouseEvent.CLICK, onClickHandler, false, 0, true);
_arg1.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler, false, 0, true);
_arg1.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler, false, 0, true);
}
private function onResizeRequest(_arg1:ControllerEvent):void{
var _local6:Number;
var _local7:Number;
var _local2:Number = 5;
var _local3:Object = _arg1.data;
bar.y = (_local3.height - barHeight);
bar.x = _local3.leftBounds;
stacker.rearrange(_local3.width);
trace("--Resize Width ", _local3.width);
var _local4:Object = stacker.findNext("seek");
if (_local4){
_local6 = bar.seek.scaleX;
bar.seek.scaleX = 1;
_local7 = (_local4.x - bar.seek.x);
bar.seek.rail.width = _local7;
bar.seek.bounds.width = _local7;
bar.seek.progress.width = _local7;
};
var _local5:Shape = (MovieClip(bar.seek).getChildByName("debug") as Shape);
if (!_local5){
_local5 = new Shape();
bar.seek.addChild(_local5);
};
_local5.graphics.clear();
_local5.graphics.beginFill(0xFF00, 0);
_local5.graphics.drawRect(0, 0, bar.seek.width, bar.seek.height);
_local5.graphics.endFill();
view.skin.addChildAt(bar, (view.skin.numChildren - 1));
if (((view.config["lastTime"]) && (!((view.currentItem == null))))){
updateTimeBarPosition(view.config["lastTime"], view.currentItem["duration"]);
};
}
private function toggleState(_arg1:MovieClip, _arg2:Boolean, _arg3:Boolean):void{
if (((_arg1["over"]) && (_arg1["out"]))){
_arg1["over"].visible = _arg2;
_arg1["out"].visible = _arg3;
};
}
private function setupPlayerListeners():void{
view.config.barHeight = barHeight;
view.addModelListener(ModelEvent.STATE, onStateRequest);
view.addModelListener(ModelEvent.TIME, onTimeRequest);
view.addModelListener(ModelEvent.LOADED, onLoadProgress);
view.addViewListener(ViewEvent.STEP_SEEK, onStepSeekRequest);
view.addControllerListener(ControllerEvent.LOAD, onLoadRequest);
view.addControllerListener(ControllerEvent.PLAYLIST, onLoadRequest);
view.addControllerListener(ControllerEvent.VOLUME, onVolumeRequest);
view.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
view.addControllerListener(ControllerEvent.RESIZE_VIDEO, onResizeVideo);
view.addViewListener(ViewEvent.ORIGINAL_SCREEN, onScreenChanged);
view.addViewListener(ViewEvent.FIT_SCREEN, onScreenChanged);
}
private function onTimeRequest(_arg1:ModelEvent):void{
updateTime(_arg1.data);
updateTimeBarPosition(_arg1.data.time, _arg1.data.duration);
}
private function setupColorScheme():void{
if (view.config.get("ui.skin.useColors")){
Colorer.recursiveColor(bar, view.config.get("ui.skin.colors"));
Colorer.recursiveAlpha(bar, view.config.get("ui.skin.opacity"));
};
}
private function onStepSeekRequest(_arg1:ViewEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (view.currentItem["seekable"]){
_local2 = bar.seek.bounds.width;
_local3 = view.currentItem["duration"];
if (_local3 == -1){
return;
};
_local4 = ((_local3 / 100) * _arg1.data.step);
_local5 = getValueOfSlider(bar.seek, _local3);
_local6 = (_local5 + (_local4 * _arg1.data.delta));
if (_local6 > _local3){
_local6 = _local3;
} else {
if (_local6 < 0){
_local6 = 0;
};
};
_local7 = ((_local3)==-1) ? 0 : (_local6 / _local3);
if (isNaN(_local7)){
_local7 = 1;
};
_local8 = Math.ceil((_local7 * (_local2 - bar.seek.dragger.width)));
if (_local8 < 0){
return;
};
seeking = true;
clearTimeout(stepSeekTimeout);
bar.seek.dragger.x = _local8;
bar.seek.progress.width = _local8;
stepSeekTimeout = setTimeout(calculateSliderValue, 500, bar.seek, view.currentItem["duration"]);
};
}
private function onClickHandler(_arg1:MouseEvent):void{
var _local5:String;
var _local2:Object = _arg1.target.parent;
var _local3:MovieClip = MovieClip(_arg1.target);
var _local4:Object = {fromControlBar:true};
if (_local3.name == "volume_show"){
if (((_local2.volume_on) && (_local2.volume_on.visible))){
_local3 = _local2.volume_on;
} else {
if (((_local2.volume_off) && (_local2.volume_off.visible))){
_local3 = _local2.volume_off;
};
};
};
if (_local2.name){
_local5 = BUTTONS[_local2.name][_local3.name];
switch (_local3.name){
case "fit":
bar.video.fit.visible = false;
bar.video.original.visible = true;
_local4.type = ViewEvent.FIT_SCREEN;
break;
case "original":
_local4.type = ViewEvent.ORIGINAL_SCREEN;
bar.video.fit.visible = true;
bar.video.original.visible = false;
break;
};
view.sendEvent(_local5, _local4);
};
}
private function onLoadProgress(_arg1:ModelEvent):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local2:Number = bar.seek.bounds.width;
if ((((view.currentItem["type"] == "http")) || (view.config.get("ui.downloadbar")))){
_local4 = _arg1.data.loaded;
_local5 = _arg1.data.total;
_local6 = _arg1.data.offset;
_local2 = Math.ceil((((_local6 / _local5) * bar.seek.bounds.width) + ((_local4 / _local5) * bar.seek.bounds.width)));
};
var _local3:Object = ((bar.seek["rail"]) || (bar.seek["done"]));
_local3.width = _local2;
}
public function addButton(_arg1, _arg2:Object, _arg3:Boolean=false):Boolean{
var _local6:String;
var _local7:String;
var _local8:String;
var _local4:Boolean;
var _local5:MovieClip = ((_arg1 is String)) ? bar[_arg1] : MovieClip(_arg1);
if (!_local5){
return (false);
};
for (_local6 in _arg2) {
if (BUTTONS[_local6]){
} else {
BUTTONS[_local6] = _arg2[_local6];
_local4 = true;
};
};
if (_arg3){
setupSlider(_local5);
} else {
for (_local7 in _arg2) {
for (_local8 in _arg2[_local7]) {
trace("control", _local8, _local5[_local8], _local7);
setupButton(_local5[_local8]);
};
};
};
return (_local4);
}
protected function updateTime(_arg1:Object):void{
if (bar["time"]){
bar.time.elaspedText["text"] = Strings.digits(_arg1.time);
bar.time.totalText["text"] = Strings.digits(_arg1.duration);
};
}
private function onRollOutHandler(_arg1:MouseEvent):void{
toggleState((_arg1.target as MovieClip), false, true);
}
private function onStateRequest(_arg1:ModelEvent):void{
var e = _arg1;
switch (e.data["state"]){
case ModelStates.PLAYING:
try {
if (bar.playpause.playButton.x == bar.playpause.pauseButton.x){
bar.playpause.playButton.visible = false;
bar.playpause.pauseButton.visible = true;
};
} catch(e:Error) {
trace(e);
};
if (firstPlay){
bar.enabled = true;
firstPlay = false;
if (view.currentItem["seekable"]){
bar.seek.mouseEnabled = true;
bar.seek.buttonMode = true;
};
};
break;
case ModelStates.PAUSED:
try {
if (bar.playpause.playButton.x == bar.playpause.pauseButton.x){
bar.playpause.playButton.visible = true;
bar.playpause.pauseButton.visible = false;
};
} catch(e:Error) {
trace(e);
};
break;
};
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
this.skin = _arg1.skin;
this.bar = skin["controlbar"];
if (((_arg1.config.hasEnhancement("ControlBar")) && (_arg1.config.get("enhancements.controlbar.maxHeight")))){
barHeight = _arg1.config.get("enhancements.controlbar.maxHeight");
} else {
barHeight = this.bar.back.height;
};
_arg1.config["barHeight"] = barHeight;
_arg1.config["lastTime"] = 0;
stacker = new Stacker(bar);
setupPlayerListeners();
setupRemoveButtons();
setupButtons();
createMask();
setupColorScheme();
updateTimeBarPosition(-1, -1);
bar.enabled = false;
}
private function onRollOverHandler(_arg1:MouseEvent):void{
toggleState((_arg1.target as MovieClip), true, false);
}
private function setupButtons():void{
var btn:MovieClip;
var group:String;
var slider:String;
var button:String;
if (((bar["video"]) && (bar["video"]["fit"]))){
bar["video"]["fit"]["visible"] = false;
};
if (bar.playpause.playButton.x == bar.playpause.pauseButton.x){
bar.playpause.playButton.visible = true;
bar.playpause.pauseButton.visible = false;
};
var hooked:Object = {};
var hide:Array = ["fullscreen_exit"];
for each (group in GROUPS) {
if (bar[group]){
for (button in BUTTONS[group]) {
if (bar[group][button]){
btn = MovieClip(bar[group][button]);
if (hide.indexOf(button) != -1){
btn.visible = false;
};
if (btn.over){
btn.over.visible = false;
};
setupButton(btn);
};
};
};
};
for (slider in SLIDERS) {
if (bar[slider]){
if (bar[slider][(slider + "_slider")]){
btn = bar[slider][(slider + "_slider")];
} else {
btn = bar[slider];
};
setupSlider(btn);
};
};
try {
if (bar.volume.volume_show){
bar.volume.volume_slider.visible = false;
};
} catch(e:Error) {
};
}
private function setupSlider(_arg1:MovieClip):void{
_arg1.buttonMode = true;
_arg1.mouseChildren = false;
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, onDownHandler, false, 0, true);
_arg1.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler, false, 0, true);
_arg1.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler, false, 0, true);
}
protected function updateTimeBarPosition(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (!seeking){
_local3 = bar.seek.bounds.width;
_local4 = ((_arg2)==-1) ? 0 : (_arg1 / _arg2);
if (isNaN(_local4)){
_local4 = 1;
};
_local5 = Math.ceil((_local4 * (_local3 - bar.seek.dragger.width)));
bar.seek.dragger.x = _local5;
bar.seek.progress.width = _local5;
if (_arg2 != 0){
view.config["lastTime"] = _arg1;
};
};
}
private function onResizeVideo(_arg1:ControllerEvent):void{
setVideoIcons(_arg1.data.type);
}
private function calculateSliderValue(_arg1:Object, _arg2:Number):void{
view.sendEvent(SLIDERS[_arg1.name], getValueOfSlider(_arg1, _arg2));
seeking = false;
}
public function removeButton(_arg1:String):void{
if (!bar[_arg1]){
return;
};
bar[_arg1].visible = false;
stacker.addRemove(_arg1);
}
private function onMoveHandler(_arg1:MouseEvent):void{
clearTimeout(realtimeVolumeTimeout);
realtimeVolumeTimeout = setTimeout(calculateSliderValue, 50, slider, 100);
}
private function setupRemoveButtons():void{
var _local1:Object;
var _local2:String;
if (view.config.hasEnhancement("ControlBar")){
_local1 = view.config.get("controlbar", false, true);
if ((((_local1.remove is Array)) && (_local1.remove.length))){
for each (_local2 in _local1.remove) {
if (bar[_local2]){
bar[_local2].visible = false;
stacker.addRemove(_local2);
};
};
};
};
}
private function onDownHandler(_arg1:MouseEvent):void{
slider = MovieClip(_arg1.target);
if ((((slider.name == "seek")) && (((!(view.currentItem["seekable"])) || (!(view.currentItem["duration"])))))){
return;
};
var _local2:Rectangle = new Rectangle(slider.bounds.x, slider.dragger.y, (slider.bounds.width - slider.dragger.width), 0);
slider.dragger.startDrag(true, _local2);
if (slider.name == "seek"){
seeking = true;
};
bar.stage.addEventListener(MouseEvent.MOUSE_UP, onUpHandler);
if (slider.name != "seek"){
bar.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMoveHandler);
};
}
private function onLoadRequest(_arg1:ControllerEvent):void{
trace("onLoadRequest");
firstPlay = true;
bar.seek.mouseEnabled = false;
bar.seek.buttonMode = false;
updateTimeBarPosition(0, 100);
view.config["lastTime"] = 0;
}
private function setVideoIcons(_arg1:String):void{
var videoSize = _arg1;
try {
if (videoSize == "FIT_SCREEN"){
bar.video.fit.visible = false;
bar.video.original.visible = true;
} else {
bar.video.fit.visible = true;
bar.video.original.visible = false;
};
} catch(e:Error) {
};
}
private function getValueOfSlider(_arg1:Object, _arg2:Number):Number{
return (Math.round((((_arg1.dragger.x - _arg1.bounds.x) / (_arg1.bounds.width - _arg1.dragger.width)) * _arg2)));
}
private function onVolumeRequest(_arg1:ControllerEvent):void{
if (bar.volume.volume_on){
if (_arg1.data.volume > 0){
bar.volume.volume_off.visible = false;
bar.volume.volume_on.visible = true;
} else {
bar.volume.volume_off.visible = true;
bar.volume.volume_on.visible = false;
};
};
var _local2:MovieClip = (bar.volume.volume_slider) ? bar.volume.volume_slider : bar.volume;
var _local3:Number = ((_arg1.data.volume * (_local2.bounds.width - _local2.dragger.width)) + _local2.bounds.x);
_local2.progress.width = _local3;
_local2.dragger.x = _local3;
}
private function onPlaylistRequest(_arg1:ControllerEvent):void{
}
}
}//package com.conceptualideas.videoplayer.modules.ui
Section 54
//ImageOverlay (com.conceptualideas.videoplayer.modules.ui.ImageOverlay)
package com.conceptualideas.videoplayer.modules.ui {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import gs.*;
public class ImageOverlay extends BaseComponent {
private var container:Sprite;
private var config:Object;
private var _playing:Boolean;// = false
private var dtools:DomainTools;
public function ImageOverlay(){
config = {start:null, end:null};
super();
}
private function resizeImage(_arg1:DisplayObject):void{
var _local2:Number = view.stage.stageHeight;
if (!view.config.get("ui.overlay.fullHeight")){
_local2 = (_local2 - view.config.barHeight);
};
PlayerUtils.fit(_arg1, view.stage.stageWidth, _local2);
}
private function onImageLoaded(_arg1:Event):void{
if (_playing){
return;
};
var _local2:DisplayObject = _arg1.target.content;
container.addChild(_local2);
container.visible = true;
view.skin.display.addChild(view.skin.display.icons);
resizeImage(_local2);
TweenLite.from(_local2, 1, {alpha:0});
}
private function loadOverlay(_arg1:String):void{
if (((config[_arg1]) && (!((config[_arg1] == ""))))){
_playing = false;
dtools.loadImage(config[_arg1], onImageLoaded);
};
}
private function onVideoFinished(_arg1:ControllerEvent):void{
loadOverlay("end");
}
private function onPlayerAction(_arg1:Event):void{
while (container.numChildren > 0) {
Bitmap(container.removeChildAt(0)).bitmapData.dispose();
};
_playing = true;
container.visible = false;
}
private function onPlaylistLoadRequest(_arg1:ControllerEvent):void{
if (!view.config.get("main.autoPlay")){
loadOverlay("start");
};
view.removeControllerListener(ControllerEvent.PLAYLIST, onPlaylistLoadRequest);
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
container = (_arg1.skin.display.addChild(new Sprite()) as Sprite);
dtools = DomainTools.instance();
config.start = dtools.vars.getEither("overlay.start", "overlay", "image");
config.end = dtools.vars.getValue("overlay.end");
if (((((config.start) && (!((config.start == ""))))) || (((config.end) && (!((config.end == ""))))))){
_arg1.addControllerListener(ControllerEvent.SEEK, onPlayerAction);
_arg1.addControllerListener(ControllerEvent.PLAY, onPlayerAction);
_arg1.addControllerListener(ControllerEvent.LOAD, onPlayerAction);
_arg1.addControllerListener(ControllerEvent.PLAYLIST, onPlaylistLoadRequest);
_arg1.addViewListener("REWIND", onPlayerAction);
};
_arg1.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
_arg1.addControllerListener(ControllerEvent.FINISHED, onVideoFinished);
}
private function onResizeRequest(_arg1:ControllerEvent):void{
if (container.numChildren){
resizeImage(container.getChildAt(0));
};
}
}
}//package com.conceptualideas.videoplayer.modules.ui
Section 55
//RightClickModule (com.conceptualideas.videoplayer.modules.ui.RightClickModule)
package com.conceptualideas.videoplayer.modules.ui {
import flash.display.*;
import com.conceptualideas.videoplayer.events.*;
import com.reyco1.events.*;
import flash.utils.*;
import com.reyco1.manager.*;
import flash.net.*;
public class RightClickModule extends BaseComponent {
private var managerList:Dictionary;
private var ctxManager:ContextMenuManager;
private static const REPORT_LABEL:String = "Report Bug";
public function RightClickModule(){
managerList = new Dictionary();
super();
}
override public function initalize(_arg1:AbstractView):void{
var _local2:Object;
super.initalize(_arg1);
ctxManager = new ContextMenuManager(_arg1.skin.display);
for each (_local2 in _arg1.config.ui.rightclick) {
managerList[_local2.display] = _local2;
ctxManager.addMenuItem(_local2.display, _local2.sepratorBefore);
};
ctxManager.addEventListener(ContextMenuManagerEvent.MENU_SELECTED, onContextMenuSelected);
}
private function onContextMenuSelected(_arg1:ContextMenuManagerEvent):void{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:String;
var _local2:Object = managerList[_arg1.params.label];
trace(_arg1.params.label);
if (_local2 != null){
switch (_local2.action){
case "quality":
view.skin.stage.quality = StageQuality[_local2.setting];
break;
case "url":
navigateToURL(new URLRequest(_local2.setting), _local2.target);
break;
case "bug":
break;
};
_local3 = ctxManager.arrMenuItems;
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4].label.split("> ");
trace("Check:", _local5);
_local6 = "";
if (!_local5.length){
return;
};
_local6 = ((_local5.length)==2) ? _local5[1] : _local5[0];
if (managerList[_local6].action == "quality"){
_local3[_local4].label = ((_local6)==_arg1.params.label) ? ("> " + _local6) : _local6;
};
_local4++;
};
};
}
}
}//package com.conceptualideas.videoplayer.modules.ui
Section 56
//Watermark (com.conceptualideas.videoplayer.modules.ui.Watermark)
package com.conceptualideas.videoplayer.modules.ui {
import flash.events.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import flash.utils.*;
import flash.net.*;
import com.conceptualideas.videoplayer.views.*;
public class Watermark extends BaseComponent {
private var config:Object;
private var watermarks:Dictionary;
private var defaults:Object;
public function Watermark(){
watermarks = new Dictionary(true);
defaults = {url:"", placement:"BR", link:"", target:"_self", opacity:70, paddingBottom:0, paddingTop:0, paddingRight:0, paddingLeft:0};
config = {showWatermark:true, alwaysShowWatermark:true, display:{}};
super();
}
public function getName():String{
return ("watermarks");
}
public function hide():void{
var _local1:Object;
for each (_local1 in watermarks) {
_local1.display.hide();
};
}
private function onWatermarkClicked(_arg1:Event):void{
var _local2:Object = watermarks[_arg1.target.name].config;
if (_local2.link == "nats"){
} else {
if (_local2.activePlay){
view.sendEvent(ViewEvent.PLAY);
} else {
navigateToURL(new URLRequest(_local2.link), _local2.target);
};
};
}
public function toggle():void{
var _local1:String;
for each (_local1 in config.watermarks.toggle) {
_local1[_local1].toggle();
};
}
override public function initalize(_arg1:AbstractView):void{
var _local4:DomainTools;
var _local5:Object;
var _local6:String;
var _local7:Object;
var _local8:WatermarkView;
super.initalize(_arg1);
config = _arg1.config.extend(config, _arg1.config.get("ui.watermarks"));
var _local2:Boolean = _arg1.config.get("ui.watermarks.showWatermark");
var _local3:Boolean = _arg1.config.get("ui.watermarks.alwaysShowWatermark");
if (((config.showWatermark) || (config.alwaysShowWatermark))){
if (((((config.showWatermark) && (!(config.alwaysShowWatermark)))) && (!(_arg1.config.externalSite)))){
return;
};
_local4 = DomainTools.instance();
_local5 = config.display;
for (_local6 in _local5) {
trace(_local6);
_local7 = _local4.extend(defaults, _local5[_local6]);
_local8 = new WatermarkView(_local7, _arg1.config.barHeight);
_local8.addEventListener(WatermarkView.CLICKED, onWatermarkClicked);
_local8.name = _local6;
_arg1.skin.addChild(_local8);
watermarks[_local6] = {display:_local8, config:_local7};
};
_arg1.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
};
}
private function onResizeRequest(_arg1:ControllerEvent):void{
var _local2:Object;
for each (_local2 in watermarks) {
WatermarkView(_local2.display).arrange();
};
}
public function show():void{
var _local1:Object;
for each (_local1 in watermarks) {
_local1.display.show();
};
}
}
}//package com.conceptualideas.videoplayer.modules.ui
Section 57
//VideoDisplay (com.conceptualideas.videoplayer.modules.ui.VideoDisplay)
package com.conceptualideas.videoplayer.modules.ui {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.events.*;
public class VideoDisplay extends BaseComponent {
private var config:Object;
private var icons:MovieClip;
private var overlay:Sprite;
private var ICONS:Array;
private var activeIcon:String;// = "playIcon"
public function VideoDisplay(){
ICONS = ["bufferIcon", "playIcon", "replayIcon"];
config = {align:"center"};
super();
}
public function getName():String{
return ("display");
}
private function centerIcons():void{
var _local1:Number = view.skin.display.media.x;
var _local2:Number = view.skin.display.media.y;
var _local3:Number = view.skin.display.media.width;
var _local4:Number = view.skin.display.media.height;
var _local5:Object = icons[activeIcon];
if (_local5){
switch (config.align){
case "center":
icons.x = (_local1 + ((_local3 - _local5.width) / 2));
icons.y = (_local2 + ((_local4 - _local5.height) / 2));
break;
};
};
}
private function onClickRequest(_arg1:MouseEvent):void{
if (view.config["state"] == ModelStates.IDLE){
view.sendEvent("PLAY");
} else {
if (view.config["state"] == ModelStates.PAUSED){
view.sendEvent("PLAY");
} else {
if (view.config["state"] == ModelStates.COMPLETED){
view.sendEvent("REWIND");
} else {
view.sendEvent("PAUSE");
};
};
};
}
private function onFinsihedRequest(_arg1:ControllerEvent):void{
setIcon("replayIcon");
}
private function onModelEventRequest(_arg1:ModelEvent):void{
switch (_arg1.data["state"]){
case ModelStates.PAUSED:
setIcon("playIcon");
break;
case ModelStates.PLAYING:
setIcon();
break;
case ModelStates.BUFFERING:
setIcon("bufferIcon");
break;
default:
if ((((((_arg1.type == ModelEvent.BUFFER)) && (icons["bufferIcon"]))) && (icons["bufferIcon"].percent))){
icons["bufferIcon"].percent.text = _arg1.data.percentage;
};
};
}
private function onDefaultButtonOver(_arg1:MouseEvent):void{
trace("onDefaultButtonOver");
setupPlayIconColor(DisplayObject(_arg1.target), "over");
}
private function setupPlayIconColor(_arg1:DisplayObject, _arg2:String="up"):void{
Colorer.colorPlayButton(_arg1, view.config.get("ui.skin"), _arg2);
}
private function onDefaultButtonOut(_arg1:MouseEvent):void{
setupPlayIconColor(DisplayObject(_arg1.target), "up");
}
override public function initalize(_arg1:AbstractView):void{
var _local2:String;
super.initalize(_arg1);
icons = _arg1.skin.display["icons"];
_arg1.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
_arg1.addControllerListener(ControllerEvent.RESIZE_VIDEO, onResizeRequest);
_arg1.addModelListener(ModelEvent.STATE, onModelEventRequest);
_arg1.addModelListener(ModelEvent.BUFFER, onModelEventRequest);
_arg1.addControllerListener(ControllerEvent.FINISHED, onFinsihedRequest);
overlay = new Sprite();
overlay.buttonMode = true;
overlay.name = "overlay";
overlay.useHandCursor = true;
overlay.mouseChildren = true;
_arg1.skin.display.useHandCursor = true;
onResizeRequest(null);
_arg1.skin.display.addEventListener(MouseEvent.CLICK, onClickRequest, false, 0, true);
MovieClip(_arg1.skin.display).mouseChildren = true;
if (_arg1.config.get("ui.skin.useColors")){
if (((icons["playIcon"]) && (icons["playIcon"]["icon"]))){
icons["playIcon"].addEventListener(MouseEvent.ROLL_OVER, onDefaultButtonOver, false, 0, true);
icons["playIcon"].addEventListener(MouseEvent.ROLL_OUT, onDefaultButtonOut, false, 0, true);
setupPlayIconColor(icons["playIcon"]);
};
if (((icons["replayIcon"]) && (icons["replayIcon"]["icon"]))){
icons["replayIcon"].addEventListener(MouseEvent.ROLL_OVER, onDefaultButtonOver, false, 0, true);
icons["replayIcon"].addEventListener(MouseEvent.ROLL_OUT, onDefaultButtonOut, false, 0, true);
setupPlayIconColor(icons["replayIcon"]);
};
};
for each (_local2 in ICONS) {
if (icons[_local2]){
icons[_local2].buttonMode = true;
};
};
icons.visible = true;
if (_arg1.config.get("main.autoPlay")){
setIcon("");
} else {
setIcon("playIcon");
};
}
private function onResizeRequest(_arg1:ControllerEvent):void{
view.skin.display.x = (view.skin.display.y = 0);
view.skin.graphics.clear();
view.skin.graphics.beginFill(view.config.ui.background);
view.skin.graphics.drawRect(0, 0, view.stage.stageWidth, view.stage.stageHeight);
view.skin.graphics.endFill();
overlay.graphics.clear();
overlay.graphics.beginFill(0xFF0000, 0);
overlay.graphics.drawRect(0, 0, view.stage.stageWidth, (view.stage.stageHeight - view.config.barHeight));
overlay.graphics.endFill();
view.skin.display.addChildAt(overlay, (view.skin.display.getChildIndex(icons) - 1));
centerIcons();
}
public function setIcon(_arg1:String=null):void{
var _local2:String;
activeIcon = _arg1;
if (icons[_arg1]){
icons[_arg1].visible = true;
};
for each (_local2 in ICONS) {
if (((!((_local2 == _arg1))) && (icons[_local2]))){
icons[_local2].visible = false;
};
};
centerIcons();
}
}
}//package com.conceptualideas.videoplayer.modules.ui
Section 58
//BaseController (com.conceptualideas.videoplayer.player.BaseController)
package com.conceptualideas.videoplayer.player {
import flash.display.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import com.conceptualideas.videoplayer.utils.parsers.*;
public class BaseController extends AbstractController {
private var currentIndex:Number;// = NAN
private var _skin:MovieClip;
private var _playlist:Array;
private var domainTools:DomainTools;
public function BaseController(_arg1:Object, _arg2:MovieClip){
domainTools = DomainTools.instance();
super(_arg1);
this._skin = _arg2;
}
private function onScreenRedraw(_arg1:ViewEvent):void{
var _local3:Number;
var _local4:Number;
var _local7:int;
var _local8:Number;
var _local2:Object = (_arg1) ? ((_arg1.data) || ({})) : {};
var _local5:String = (((_arg1) && (_arg1.data.type))) ? _arg1.data.type : ((config.get("ui.video.defaultSize")) || (ViewEvent.FIT_SCREEN));
var _local6:Object = getVideoSize();
if ((((_local5 == ViewEvent.ORIGINAL_SCREEN)) && (!((skin.stage.displayState == "fullScreen"))))){
_local3 = _local6.width;
_local4 = _local6.height;
} else {
_local3 = skin.stage.stageWidth;
_local4 = (skin.stage.stageHeight - config.barHeight);
if (!isNaN(currentIndex)){
_local7 = (skin.stage.stageHeight - (config.get("video.useFullHeight", false, true)) ? config.get("video.useFullHeight", false, true) : 0);
_local8 = Math.min((skin.stage.stageWidth / _local6.width), (_local7 / _local6.height));
_local3 = (_local6.width * _local8);
_local4 = (_local6.height * _local8);
};
};
resizeVideo(_local3, _local4, _local5, _local2["fromControlBar"]);
}
public function get skin():MovieClip{
return (_skin);
}
override public function close(_arg1:Model, _arg2:AbstractView):void{
_arg2.addViewListener(ViewEvent.LOAD, onLoadRequest);
_arg2.addViewListener(ViewEvent.VOLUME, onVolumeRequest);
_arg2.addViewListener(ViewEvent.PLAY, onPlayRequest);
_arg2.addViewListener(ViewEvent.SEEK, onSeekRequest);
_arg2.addViewListener(ViewEvent.FULLSCREEN, onFullScreenRequest);
_arg2.addViewListener(ViewEvent.PAUSE, onPauseRequest);
_arg2.addEventListener(ViewEvent.REDRAW, onRedrawRequest, false, 1, false);
_arg2.addViewListener(ViewEvent.REDRAW_SCREEN, onScreenRedraw);
_arg2.addViewListener(ViewEvent.MUTE, onMuteRequest);
_arg2.addViewListener(ViewEvent.UNMUTE, onUnMuteRequest);
_arg2.addViewListener(ViewEvent.REWIND, onRewindRequest);
_arg2.addViewListener(ViewEvent.STOP, onStopRequest);
_arg2.addModelListener(ModelEvent.STATE, onModelStateRequest);
_arg2.addModelListener(ModelEvent.META, onMetadata);
_arg2.addViewListener(ViewEvent.INIT, onRedrawRequest);
_arg2.sendEvent(ViewEvent.PAUSE);
_arg1.sendEvent(ModelEvent.STATE, {state:ModelStates.IDLE});
}
private function playItem(_arg1:Number=0):void{
currentIndex = _arg1;
if (currentItem["autoplay"] == null){
currentItem["autoplay"] = (((!(config.main.autoPlay)) && ((currentIndex == 0)))) ? false : true;
};
currentItem["duration"] = 0;
dispatchEvent(new ControllerEvent(ControllerEvent.LOAD, {index:_arg1}));
setVolume();
}
public function track(_arg1:String, _arg2:Object=null):void{
dispatchEvent(new ControllerEvent("TRACK", {action:_arg1, extra:_arg2}));
}
private function getModelType(_arg1:Object):String{
if (!_arg1["file"]){
return (null);
};
if (_arg1.host.substr(0, 4) == "rtmp"){
return ((config.main.useSecure) ? "cisecure" : "rtmp");
} else {
};
return (!NULL!);
}
private function onStopRequest(_arg1:ViewEvent):void{
dispatchEvent(new ControllerEvent(ControllerEvent.STOP));
}
public function get playlist():Array{
return (_playlist);
}
private function onFullScreenRequest(_arg1:ViewEvent):void{
if (skin.stage.displayState == "fullScreen"){
skin.stage.displayState = "normal";
} else {
skin.stage.displayState = "fullScreen";
track("clicks.fullscreen");
};
onRedrawRequest(null);
}
private function onMuteRequest(_arg1:ViewEvent):void{
setVolume(0);
}
private function onSeekRequest(_arg1:ViewEvent):void{
var _local2:Number;
if (currentItem["duration"] > 0){
_local2 = _arg1.data.position;
if (_local2 < 2){
_local2 = 0;
} else {
if (_local2 > (currentItem["duration"] - 2)){
_local2 = (currentItem["duration"] - 2);
};
};
dispatchEvent(new ControllerEvent(ControllerEvent.SEEK, {position:_local2}));
};
}
private function setVolume(_arg1:Number=NaN, _arg2:Boolean=true):void{
if (isNaN(_arg1)){
_arg1 = domainTools.getUsersetting("volume");
_arg1 = (isNaN(_arg1)) ? 1 : _arg1;
};
_arg1 = ((_arg1)>1) ? (_arg1 / 100) : _arg1;
if (_arg1 < 0){
_arg1 = 0;
};
config["volume"] = _arg1;
domainTools.setUserSetting("volume", _arg1);
if (_arg1 > 0){
domainTools.setUserSetting("goodvolume", _arg1);
};
dispatchEvent(new ControllerEvent(ControllerEvent.VOLUME, {volume:_arg1}));
}
private function playlistHandler(_arg1:Array):void{
var _local2:Number = 0;
while (_local2 < _arg1.length) {
if (!_arg1[_local2]["host"]){
_arg1[_local2]["host"] = "";
};
_arg1[_local2]["type"] = getModelType(_arg1[_local2]);
_arg1[_local2]["seeking"] = ((config.get("main.seekingParamater")) || (config.get("main.seekingParameter")));
_local2++;
};
_playlist = _arg1;
dispatchEvent(new ControllerEvent(ControllerEvent.PLAYLIST, {playlist:_arg1}));
if (config.main.autoPlay){
playItem();
};
}
private function onPlayRequest(_arg1:ViewEvent):void{
if (!isNaN(currentIndex)){
dispatchEvent(new ControllerEvent(ControllerEvent.PLAY));
} else {
playItem();
};
}
private function getVideoSize():Object{
return ({width:(((isNaN(currentIndex)) || (isNaN(currentItem["width"])))) ? skin.stage.stageWidth : currentItem["width"], height:(((isNaN(currentIndex)) || (isNaN(currentItem["height"])))) ? (skin.stage.stageHeight - ((config.get("barHeight")) || (0))) : currentItem["height"]});
}
private function resizeVideo(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean=false):void{
var _local5:Object = {};
_local5.type = _arg3;
_local5.resize = ((_arg3)==ViewEvent.FIT_SCREEN) ? "fill" : "uniform";
_local5.width = _arg1;
_local5.height = _arg2;
_local5.maxWidth = skin.stage.stageWidth;
_local5.fromControlBar = _arg4;
if (config.get("video.useFullHeight", false, true)){
_local5.maxHeight = skin.stage.stageHeight;
} else {
_local5.maxHeight = (skin.stage.stageHeight - config.barHeight);
};
dispatchEvent(new ControllerEvent(ControllerEvent.RESIZE_VIDEO, _local5));
}
private function onModelStateRequest(_arg1:ModelEvent):void{
if (((((!(isNaN(currentIndex))) && ((currentIndex == (playlist.length - 1))))) && (_arg1.isComplete()))){
dispatchEvent(new ControllerEvent(ControllerEvent.FINISHED));
track("video.complete");
} else {
if (_arg1.isComplete()){
playItem((currentIndex + 1));
track("video.next");
};
};
}
private function onLoadRequest(_arg1:ViewEvent):void{
var _local3:Object;
var _local2:Array = [];
if ((_arg1.data.object is Array)){
for each (_local3 in _arg1.data.object) {
_local2.push(ObjectParser.parse(_local3));
};
};
playlistHandler(_local2);
}
public function get currentItem():Object{
return ((_playlist) ? playlist[currentIndex] : null);
}
private function onRewindRequest(_arg1:ViewEvent):void{
if (((((!(isNaN(currentIndex))) && (currentItem["isad"]))) && (!((currentIndex == 0))))){
playItem((currentIndex - 1));
} else {
playItem(currentIndex);
};
}
private function onVolumeRequest(_arg1:ViewEvent):void{
setVolume(_arg1.data.volume);
}
private function onPauseRequest(_arg1:ViewEvent):void{
dispatchEvent(new ControllerEvent(ControllerEvent.PAUSE));
}
private function onRedrawRequest(_arg1:ViewEvent):void{
var _local2:Object = {width:skin.stage.stageWidth, height:skin.stage.stageHeight, x:0, y:0};
if (((((config.hasEnhancement("Player")) && (config.get("player.maxWidth", false, true)))) && (!((skin.stage.displayState == "fullScreen"))))){
_local2.width = config.get("player.maxWidth", false, true);
};
_local2.leftBounds = ((skin.stage.stageWidth - _local2.width) / 2);
_local2.topBounds = ((skin.stage.stageHeight - _local2.height) / 2);
_local2.fullScreen = ((skin.stage.displayState == "fullScreen")) ? true : false;
onScreenRedraw(null);
dispatchEvent(new ControllerEvent(ControllerEvent.RESIZE, _local2));
}
private function onMetadata(_arg1:ModelEvent):void{
if (!currentItem["duration"]){
currentItem["duration"] = ((Math.round((_arg1.data.duration * 10)) / 10) - 0.1);
currentItem["width"] = _arg1.data.width;
currentItem["height"] = _arg1.data.height;
onScreenRedraw(null);
};
}
private function onUnMuteRequest(_arg1:ViewEvent):void{
var _local2:Number = domainTools.getUsersetting("goodvolume");
if (isNaN(_local2)){
_local2 = domainTools.getUsersetting("volume");
};
if (((isNaN(_local2)) || ((_local2 == 0)))){
_local2 = 100;
};
setVolume(_local2);
}
}
}//package com.conceptualideas.videoplayer.player
Section 59
//BaseView (com.conceptualideas.videoplayer.player.BaseView)
package com.conceptualideas.videoplayer.player {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.events.*;
import com.conceptualideas.videoplayer.modules.interfaces.*;
public class BaseView extends AbstractView {
private var _trackingHash:Object;
private var _modules:Object;
private var _skin:MovieClip;
private var _plugins:Object;
private var _config:Object;
private var model:Model;
private var controller:BaseController;
public function BaseView(_arg1:Object, _arg2:MovieClip, _arg3:BaseController, _arg4:Model){
_modules = {};
_trackingHash = {};
super();
this._config = _arg1;
this._skin = _arg2;
this.controller = _arg3;
this.model = _arg4;
_skin.stage.scaleMode = "noScale";
_skin.stage.align = "TL";
_skin.stage.addEventListener(Event.RESIZE, onResizeRequest, false, 1, false);
_config.getModule = getModule;
}
public function loaded():void{
sendEvent(ViewEvent.INIT);
}
override public function track(_arg1:String, _arg2:Object=null):void{
controller.track(_arg1, _arg2);
}
override public function get config():Object{
return (_config);
}
override public function removeControllerListener(_arg1:String, _arg2:Function):void{
controller.removeEventListener(_arg1, _arg2);
}
override public function get playlist():Array{
return (controller.playlist);
}
override public function getModule(_arg1:String){
if (!_modules[_arg1]){
return (null);
};
return (_modules[_arg1]);
}
private function onResizeRequest(_arg1:Event):void{
dispatchEvent(new ViewEvent(ViewEvent.REDRAW));
}
override public function addHook(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null, _arg5:Boolean=true):ISystemHook{
return (Hooker(_modules["hooker"]).hook(_arg1, _arg2, _arg3, _arg4, _arg5));
}
override public function get currentItem():Object{
return (controller.currentItem);
}
override public function addControllerListener(_arg1:String, _arg2:Function, _arg3:int=0):void{
controller.addEventListener(_arg1, _arg2, false, _arg3);
}
override public function loadModule(_arg1:IComponent):void{
if (_modules[Object(_arg1).toString()]){
return;
};
if (Object(_arg1).hasOwnProperty("getName")){
_modules[Object(_arg1).getName()] = _arg1;
} else {
_modules[Object(_arg1).toString()] = _arg1;
};
_arg1.initalize(this);
}
override public function addModelListener(_arg1:String, _arg2:Function):void{
model.addEventListener(_arg1.toUpperCase(), _arg2);
}
override public function sendEvent(_arg1:String, _arg2:Object=undefined):void{
_arg1 = _arg1.toUpperCase();
var _local3:Object = {};
switch (_arg1){
case "LOAD":
dispatchEvent(new ViewEvent(ViewEvent.REDRAW));
dispatchEvent(new ViewEvent(ViewEvent.FIT_SCREEN));
_local3["object"] = _arg2;
break;
case "SEEK":
_local3["position"] = _arg2;
break;
case "VOLUME":
_local3["volume"] = _arg2;
break;
default:
_local3 = _arg2;
};
dispatchEvent(new ViewEvent(_arg1, _local3));
}
override public function addViewListener(_arg1:String, _arg2:Function):void{
this.addEventListener(_arg1, _arg2);
}
override public function get skin():MovieClip{
return (_skin);
}
}
}//package com.conceptualideas.videoplayer.player
Section 60
//Model (com.conceptualideas.videoplayer.player.Model)
package com.conceptualideas.videoplayer.player {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.events.*;
import com.conceptualideas.videoplayer.models.*;
public class Model extends EventDispatcher {
private var _config:Object;
private var models:Object;
private var item:Object;
private var controller:BaseController;
private var skin:MovieClip;
public function Model(_arg1:Object, _arg2:BaseController, _arg3:MovieClip){
this.controller = _arg2;
this._config = _arg1;
this.skin = _arg3;
models = {};
_arg2.addEventListener(ControllerEvent.PLAY, onPlayRequest);
_arg2.addEventListener(ControllerEvent.LOAD, onLoadRequest);
_arg2.addEventListener(ControllerEvent.PAUSE, onPauseRequest);
_arg2.addEventListener(ControllerEvent.SEEK, onSeekRequest);
_arg2.addEventListener(ControllerEvent.RESIZE_VIDEO, onResizeVideo);
_arg2.addEventListener(ControllerEvent.VOLUME, onVolumeRequest);
_arg2.addEventListener(ControllerEvent.STOP, onStopRequest);
_arg2.addEventListener(ControllerEvent.VOLUME, onVolumeRequest);
}
private function onPlayRequest(_arg1:ControllerEvent):void{
models[item["type"]].play();
}
public function placeMedia(_arg1:DisplayObject):void{
while (skin.display.media.numChildren > 0) {
skin.display.media.removeChildAt(0);
};
skin.display.media.addChildAt(_arg1, 0);
}
private function onPauseRequest(_arg1:ControllerEvent):void{
processModel("pause");
}
private function onResizeVideo(_arg1:ControllerEvent):void{
skin.display.media.width = _arg1.data.width;
skin.display.media.height = _arg1.data.height;
skin.display.media.x = ((_arg1.data.maxWidth - _arg1.data.width) / 2);
skin.display.media.y = ((_arg1.data.maxHeight - _arg1.data.height) / 2);
}
private function processModel(_arg1:String, _arg2=null):void{
var _local3:Function;
if (((item) && (models[item["type"]]))){
_local3 = models[item["type"]][_arg1];
if (_arg2 == null){
_local3.call();
} else {
_local3.call(null, _arg2);
};
};
}
private function onStopRequest(_arg1:ControllerEvent):void{
models[item["type"]].stop();
}
public function addModel(_arg1:BasicModel, _arg2:String):void{
models[_arg2] = _arg1;
}
private function onLoadRequest(_arg1:ControllerEvent):void{
if (item){
models[item["type"]].stop();
};
item = controller.playlist[_arg1.data.index];
if (models[item["type"]]){
models[item["type"]].load(item);
};
}
public function sendEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case ModelEvent.STATE:
_arg2["oldstate"] = config["state"];
config["state"] = _arg2["state"];
switch (_arg2["state"]){
case ModelStates.IDLE:
sendEvent(ModelStates.LOADED, {loaded:0, total:0, offset:0});
break;
case ModelStates.PLAYING:
break;
};
case ModelEvent.TIME:
config["time"] = _arg2.position;
break;
};
dispatchEvent(new ModelEvent(_arg1, _arg2));
}
public function runHook(_arg1:String, _arg2:Function, _arg3:Object=null):void{
_config.getModule("hooker").run(_arg1, _arg2, _arg3);
}
private function onVolumeRequest(_arg1:ControllerEvent):void{
processModel("volume", _arg1.data.volume);
}
public function get config():Object{
return (_config);
}
private function onSeekRequest(_arg1:ControllerEvent):void{
models[item["type"]].seek(_arg1.data.position);
}
}
}//package com.conceptualideas.videoplayer.player
Section 61
//ConfigParser (com.conceptualideas.videoplayer.utils.parsers.ConfigParser)
package com.conceptualideas.videoplayer.utils.parsers {
import flash.text.*;
public class ConfigParser {
private var _config:Object;
private var raw:String;
private var index:Number;// = 0
public function ConfigParser(_arg1:String){
raw = _arg1;
}
private static function convertCSSToObject(_arg1:StyleSheet):Object{
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local2:Object = new Object();
var _local3:Array = _arg1.styleNames;
var _local4:Number = 0;
while (_local4 < _local3.length) {
_local5 = {};
_local6 = _arg1.getStyle(_local3[_local4]);
for (_local7 in _local6) {
_local5[_local7] = checkType(_local6[_local7]);
};
_local3[_local4] = _local3[_local4].split(/\.|:|#/);
if (_local3[_local4][0] == ""){
_local3[_local4].shift();
};
_local3[_local4].push(_local5);
createObjectFromString(_local2, _local3[_local4], 0);
_local4++;
};
return (_local2);
}
public static function parse(_arg1:String){
var _local2:StyleSheet = new StyleSheet();
var _local3:Date = new Date();
_local2.parseCSS(_arg1);
return (convertCSSToObject(_local2));
}
private static function checkType(_arg1){
var _local2:String;
if (!isNaN(Number(_arg1))){
return (Number(_arg1));
};
if (_arg1 == "true"){
return (true);
};
if (_arg1 == "false"){
return (false);
};
if ((((_arg1.indexOf("[") == 0)) && ((_arg1.indexOf("]") == (_arg1.length - 1))))){
_arg1 = _arg1.replace("[", "").replace("]", "").split(",");
for (_local2 in _arg1) {
_arg1[_local2] = _arg1[_local2].replace(/^\s+|\s+$/g, "");
};
};
return (_arg1);
}
private static function createObjectFromString(_arg1:Object, _arg2:Array, _arg3:Number):void{
var _local4:String;
if (_arg1[_arg2[_arg3]] == undefined){
_arg1[_arg2[_arg3]] = new Object();
};
if (_arg3 < (_arg2.length - 2)){
createObjectFromString(_arg1[_arg2[_arg3]], _arg2, (_arg3 + 1));
} else {
for (_local4 in _arg2[(_arg3 + 1)]) {
_arg1[_arg2[_arg3]][_local4] = _arg2[(_arg3 + 1)][_local4];
};
};
}
}
}//package com.conceptualideas.videoplayer.utils.parsers
Section 62
//ObjectParser (com.conceptualideas.videoplayer.utils.parsers.ObjectParser)
package com.conceptualideas.videoplayer.utils.parsers {
import com.conceptualideas.videoplayer.utils.*;
public class ObjectParser {
private static var replacements:Object = {};
private static var ELEMENTS:Object = {file:undefined, host:undefined, seekingParamater:"?start=", isad:false, middle:false, site:"", link:null, seekable:true, autoplay:true, streamer:null, id:"", page:"", start:0};
public static function parse(_arg1:Object):Object{
var _local3:String;
var _local2:Object = {};
for (_local3 in ObjectParser.ELEMENTS) {
if (_arg1[_local3] != undefined){
_local2[_local3] = Strings.serialize(_arg1[_local3]);
} else {
_local2[_local3] = ObjectParser.ELEMENTS[_local3];
};
};
return (_local2);
}
public static function addReplacements(_arg1:String, _arg2:String):void{
}
}
}//package com.conceptualideas.videoplayer.utils.parsers
Section 63
//AssetManager (com.conceptualideas.videoplayer.utils.AssetManager)
package com.conceptualideas.videoplayer.utils {
import flash.display.*;
import flash.text.*;
public class AssetManager {
public static const ARIAL:Class = AssetManager_ARIAL;
public static function getFontName(_arg1:Class):String{
return ((new (_arg1) as Font).fontName);
}
public static function getSprite(_arg1:Class):Sprite{
var _local2:Sprite = new Sprite();
_local2.addChild((new (_arg1) as DisplayObject));
return (_local2);
}
}
}//package com.conceptualideas.videoplayer.utils
Section 64
//AssetManager_ARIAL (com.conceptualideas.videoplayer.utils.AssetManager_ARIAL)
package com.conceptualideas.videoplayer.utils {
import mx.core.*;
public class AssetManager_ARIAL extends FontAsset {
}
}//package com.conceptualideas.videoplayer.utils
Section 65
//Colorer (com.conceptualideas.videoplayer.utils.Colorer)
package com.conceptualideas.videoplayer.utils {
import flash.display.*;
import com.conceptualideas.utils.*;
import flash.geom.*;
public class Colorer {
protected function setGradientFill(_arg1:Sprite, _arg2:Array, _arg3:Array, _arg4:Object, _arg5:Object, _arg6:Array=null):void{
PlayerUtils.setGradientFill(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public static function recursiveColor(_arg1:DisplayObject, _arg2:Object):void{
var _local3:DisplayObject;
var _local4:String;
var _local5:String;
for (_local4 in _arg2) {
for (_local5 in _arg2[_local4]) {
if (_arg2[_local4][_local5] == "default"){
} else {
_local3 = findElement(_arg1, _local4, _local5);
if (_local3){
setColorTransForm(_local3, _arg2[_local4][_local5]);
};
};
};
};
}
private static function findElement(_arg1:Object, _arg2:String, _arg3:String):DisplayObject{
var found:DisplayObject;
var base = _arg1;
var section = _arg2;
var element = _arg3;
try {
found = base[section][element];
if (section != "time"){
if (((base[section][element]) && (base[section][element]["overlay"]))){
found = base[section][element]["overlay"];
} else {
if (((base[section][(section + "_slider")]) && (((base[section][(section + "_slider")][element]) || (base[section][(section + "_slider")][element]["overlay"]))))){
found = ((base[section][(section + "_slider")][element]["overlay"]) || (base[section][(section + "_slider")][element]));
};
};
};
} catch(e:Error) {
};
return (found);
}
protected static function setAlpha(_arg1:DisplayObject, _arg2:Number):void{
_arg2 = ((_arg2)>1) ? (_arg2 / 100) : _arg2;
_arg1.alpha = _arg2;
}
public static function colorPlayButton(_arg1:DisplayObject, _arg2:Object, _arg3:String):void{
var _local8:uint;
var _local4:ColorTransform = new ColorTransform();
var _local5:uint = _arg2.colors.icons.playicon.base;
var _local6:uint = _arg2.colors.icons.playicon.inner;
if (!_local6){
_local6 = 0;
};
var _local7:Boolean = ColorTools.isBright(_local5);
if (_arg3 == "up"){
if (_local7){
if (_arg1["background"]){
setColorTransForm(_arg1["background"], ColorTools.darkenColor(_local5, 10));
};
if (_arg1["outlineShadow"]){
setColorTransForm(_arg1["outlineShadow"], ColorTools.darkenColor(_local5, 40));
_arg1["outlineShadow"].alpha = 0.3;
};
if (_arg1["outlineBorder"]){
setColorTransForm(_arg1["outlineBorder"], ColorTools.darkenColor(_local5, 100));
};
} else {
if (_arg1["background"]){
setColorTransForm(_arg1["background"], ColorTools.lightenColor(_local5, 40));
};
if (_arg1["fill"]){
_arg1["fill"].transform.colorTransform = new ColorTransform();
_arg1["fill"].transform.colorTransform.alphaMultiplier = 0.4;
};
if (_arg1["outlineShadow"]){
setColorTransForm(_arg1["outlineShadow"], ColorTools.lightenColor(_local5, 15));
setAlpha(_arg1["outlineShadow"], 30);
};
if (_arg1["outlineBorder"]){
setColorTransForm(_arg1["outlineBorder"], ColorTools.darkenColor(_local5, 30));
};
};
setColorTransForm(_arg1["icon"], _local6);
} else {
if (_arg1["background"]){
setColorTransForm(_arg1["background"], ColorTools.lightenColor(_local5, (_local7) ? 40 : 100));
};
if (_arg1["outlineBorder"]){
_local8 = _arg1["outlineBorder"].transform.colorTransform.color;
setColorTransForm(_arg1["outlineBorder"], ColorTools.lightenColor(_local8, 20));
};
};
}
public static function setColorTransForm(_arg1:DisplayObject, _arg2:uint, _arg3:String=null):void{
if (_arg1 != null){
PlayerUtils.setColorTransForm(_arg1, _arg2);
if (_arg3){
_arg1.blendMode = _arg3;
};
};
}
public static function recursiveAlpha(_arg1:DisplayObject, _arg2:Object):void{
var _local3:DisplayObject;
var _local4:String;
var _local5:String;
for (_local4 in _arg2) {
for (_local5 in _arg2[_local4]) {
if (_arg2[_local4][_local5] == "default"){
} else {
_local3 = findElement(_arg1, _local4, _local5);
if (_local3){
setAlpha(_local3, _arg2[_local4][_local5]);
};
};
};
};
}
}
}//package com.conceptualideas.videoplayer.utils
Section 66
//PlayerUtils (com.conceptualideas.videoplayer.utils.PlayerUtils)
package com.conceptualideas.videoplayer.utils {
import flash.display.*;
import flash.text.*;
import gs.*;
import flash.geom.*;
import flash.filters.*;
import com.gskinner.geom.*;
import gs.plugins.*;
public class PlayerUtils {
private static function getTextColor(_arg1:uint):TextFormat{
var _local2:TextFormat = new TextFormat();
_local2.color = _arg1;
return (_local2);
}
public static function deg2rad(_arg1:Number):Number{
return ((_arg1 * (Math.PI / 180)));
}
public static function createGRoundedRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=NaN, _arg6:Number=2, _arg7:Number=1):Shape{
var _local8:Shape = new Shape();
var _local9:Matrix = new Matrix();
_local9.createGradientBox(_arg1, _arg2, PlayerUtils.deg2rad(90));
if (!isNaN(_arg5)){
_local8.graphics.lineStyle(_arg6, _arg5, _arg7, true);
};
_local8.graphics.beginGradientFill(GradientType.LINEAR, [_arg3, _arg4], [1, 1], [0, 0xFF], _local9);
_local8.graphics.drawRoundRect(0, 0, _arg1, _arg2, 10, 10);
_local8.graphics.endFill();
return (_local8);
}
public static function addDropShadow(_arg1:Sprite, _arg2:Boolean=true, _arg3:Boolean=false):void{
_arg1.filters = [new DropShadowFilter(2, 45, 0, 0.5, 4, 4, 1, 1, _arg3), new DropShadowFilter(2, 225, 0, 0.5, 4, 4, 1, 1, _arg3)];
}
public static function removeGlow(_arg1:Sprite):void{
TweenPlugin.activate([VisiblePlugin, GlowFilterPlugin, AutoAlphaPlugin]);
TweenLite.to(_arg1, 1, {glowFilter:{alpha:0, blurX:0, blurY:0}});
}
public static function setColorTransForm(_arg1:DisplayObject, _arg2:uint):void{
var _local3:TextField;
if ((_arg1 is TextField)){
_local3 = (_arg1 as TextField);
_local3.textColor = _arg2;
_local3.defaultTextFormat = getTextColor(_arg2);
_local3.setTextFormat(getTextColor(_arg2));
} else {
if (_arg1["transform"] != null){
_arg1.transform.colorTransform = PlayerUtils.getColorTransform(_arg2);
};
};
}
public static function createSpriteHolder(_arg1:Number, _arg2:Number, _arg3:uint=0xFF0000, _arg4:Number=0):Sprite{
var _local5:Sprite = new Sprite();
_local5.graphics.beginFill(_arg3, _arg4);
_local5.graphics.drawRect(0, 0, _arg1, _arg2);
_local5.graphics.endFill();
return (_local5);
}
public static function addGlow(_arg1:Sprite, _arg2:uint):void{
TweenPlugin.activate([VisiblePlugin, GlowFilterPlugin, AutoAlphaPlugin]);
TweenLite.to(_arg1, 1, {glowFilter:{color:_arg2, alpha:1, blurX:6, blurY:6}});
}
public static function toGreyScale(_arg1:DisplayObject):void{
var _local2:ColorMatrix = new ColorMatrix();
_local2.adjustColor(0, 0, -100, 0);
_arg1.filters = [new ColorMatrixFilter(_local2)];
}
public static function fit(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:String="uniform"):void{
var _local5:Number = (_arg2 / _arg1.width);
var _local6:Number = (_arg3 / _arg1.height);
switch (_arg4.toLowerCase()){
case "exactfit":
_arg1.width = _arg2;
_arg1.height = _arg3;
break;
case "fill":
if (_local5 > _local6){
_arg1.width = (_arg1.width * _local5);
_arg1.height = (_arg1.height * _local5);
} else {
_arg1.width = (_arg1.width * _local6);
_arg1.height = (_arg1.height * _local6);
};
break;
case "none":
break;
case "uniform":
if (_local5 > _local6){
_arg1.width = (_arg1.width * _local6);
_arg1.height = (_arg1.height * _local6);
} else {
_arg1.width = (_arg1.width * _local5);
_arg1.height = (_arg1.height * _local5);
};
break;
};
_arg1.x = Math.round(((_arg2 / 2) - (_arg1.width / 2)));
_arg1.y = Math.round(((_arg3 / 2) - (_arg1.height / 2)));
_arg1.width = Math.ceil(_arg1.width);
_arg1.height = Math.ceil(_arg1.height);
}
public static function convertPercent(_arg1:Number):Number{
return (((_arg1)>1) ? (_arg1 / 100) : _arg1);
}
public static function setGradientFill(_arg1:Sprite, _arg2:Array, _arg3:Array, _arg4:Object, _arg5:Object, _arg6:Array=null):void{
var _local7:Sprite = (_arg1.getChildByName("overlay") as Sprite);
if (_local7 == null){
_local7 = new Sprite();
_arg1.addChild(_local7);
};
_local7.graphics.clear();
var _local8:Number = _arg2.length;
if (_arg2.length != _arg3.length){
_arg3 = _arg3.splice((_arg2.length - 1));
};
var _local9:int;
while (_local9 < _arg3.length) {
_arg3[_local9] = convertPercent(_arg3[_local9]);
_local9++;
};
var _local10:Matrix = new Matrix();
_arg6 = ((_arg6)!=null) ? _arg6 : generateRatios((_local8 - 1));
var _local11:Number = ((_arg5.x)!=null) ? _arg5.x : 0;
var _local12:Number = ((_arg5.y)!=null) ? _arg5.y : 0;
_local10.createGradientBox(_arg5.width, _arg5.height, PlayerUtils.deg2rad(90), _local11, _local12);
_local7.graphics.beginGradientFill(GradientType.LINEAR, _arg2, _arg3, _arg6, _local10);
_local7.graphics.drawRect(0, 0, _arg4.width, _arg4.height);
_local7.graphics.endFill();
}
public static function _setGradientFill(_arg1:Graphics, _arg2:Array, _arg3:Array, _arg4:Object, _arg5:Object, _arg6:Array=null, _arg7:Number=0):void{
_arg1.clear();
var _local8:Number = _arg2.length;
if (_arg2.length != _arg3.length){
_arg3 = _arg3.splice((_arg2.length - 1));
};
var _local9:int;
while (_local9 < _arg3.length) {
_arg3[_local9] = convertPercent(_arg3[_local9]);
_local9++;
};
var _local10:Matrix = new Matrix();
_arg6 = ((_arg6)!=null) ? _arg6 : generateRatios((_local8 - 1));
var _local11:Number = ((_arg5.x)!=null) ? _arg5.x : 0;
var _local12:Number = ((_arg5.y)!=null) ? _arg5.y : 0;
_local10.createGradientBox(_arg5.width, _arg5.height, PlayerUtils.deg2rad(90), _local11, _local12);
_arg1.beginGradientFill(GradientType.LINEAR, _arg2, _arg3, _arg6, _local10);
if (!_arg7){
_arg1.drawRect(0, 0, _arg4.width, _arg4.height);
} else {
_arg1.drawRoundRect(0, 0, _arg4.width, _arg4.height, _arg7, _arg7);
};
_arg1.endFill();
}
public static function removeNameSpace(_arg1:String):String{
_arg1 = _arg1.replace(/xmlns[^\"]*\"[^\"]*\"/gi, "");
_arg1 = _arg1.replace(/([\w]{2,}):([\w]{2,})/g, "$2");
return (_arg1);
}
public static function createTextField(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Boolean=true, _arg5:String="", _arg6:Object=null):TextField{
var _local10:String;
var _local7:TextField = new TextField();
var _local8:TextFormat = new TextFormat();
_arg6 = ((_arg6) || ({}));
_local8.color = 0xFFFFFF;
_local8.align = _arg3;
var _local9:Boolean = (((_arg6.font) && ((_arg6.embed == false)))) ? false : true;
delete _arg6["embed"];
for (_local10 in _arg6) {
_local8[_local10] = _arg6[_local10];
};
_local7.wordWrap = _arg4;
if (_arg4){
_local7.multiline = true;
};
if ((((_arg1 == 0)) && ((_arg2 == 0)))){
_local7.autoSize = TextFieldAutoSize.LEFT;
};
_local7.antiAliasType = AntiAliasType.ADVANCED;
if (_arg5.match(/<a[^>]+href/i)){
_local7.htmlText = _arg5;
} else {
_local7.text = _arg5;
};
_local7.selectable = false;
if (_arg5 == ""){
_local7.width = _arg1;
_local7.height = _arg2;
};
if (((((_arg6) && (_arg6.font))) && (_local9))){
_local7.embedFonts = true;
};
_local7.defaultTextFormat = _local8;
_local7.setTextFormat(_local8);
if (_arg5 != ""){
_local7.height = _local7.textHeight;
_local7.width = _local7.textWidth;
};
return (_local7);
}
public static function createRoundedRect(_arg1:Number, _arg2:Number):void{
}
private static function generateRatios(_arg1:Number):Array{
var _local2:Number = (225 / _arg1);
var _local3:Array = new Array();
var _local4:int;
while (_local4 < _arg1) {
_local3.push((_local4 * _local2));
_local4++;
};
return (_local3);
}
public static function getColorTransform(_arg1:uint):ColorTransform{
var _local2:ColorTransform = new ColorTransform();
_local2.color = _arg1;
return (_local2);
}
}
}//package com.conceptualideas.videoplayer.utils
Section 67
//PlaylistBuilder (com.conceptualideas.videoplayer.utils.PlaylistBuilder)
package com.conceptualideas.videoplayer.utils {
import flash.events.*;
import com.conceptualideas.utils.*;
import flash.utils.*;
import com.conceptualideas.videoplayer.utils.parsers.*;
public class PlaylistBuilder extends EventDispatcher {
private var masks:Dictionary;
private var post_ads:Array;
private var pre_ads:Array;
private var videos:Array;
public static const LOADED:String = "LOADED";
private static var _instance:PlaylistBuilder;
public function PlaylistBuilder(){
pre_ads = [];
post_ads = [];
videos = [];
masks = new Dictionary(false);
super();
}
public function load(_arg1:String):void{
var _local2:DomainTools = DomainTools.instance();
_local2.loadURL(_arg1, onPlaylistLoaded);
}
public function addMask(_arg1:String, _arg2:String, _arg3:Object):void{
var _local4:VideoMask = new VideoMask(_arg2);
_local4.add(_arg3);
masks[_arg1] = _local4;
}
public function getPlaylist():Array{
var _local1:Array = [];
return (_local1.concat(pre_ads, videos, post_ads));
}
private function onPlaylistLoaded(_arg1:Event):void{
var _local3:XML;
var _local4:Object;
var _local2:XML = new XML(_arg1.target.data);
for each (_local3 in _local2..videos.children()) {
if (((!((_local3.@ad == ""))) && (String(_local3.@ad).match(/pre|post/i)))){
this.addRollVideo(_local3.@ad, _local3.url.text(), _local3.link.text());
} else {
_local4 = parseVideoString(_local3.url.text(), false);
_local4.link = ((_local3.link.text())=="") ? null : _local3.link.text();
_local4.seekable = ((_local3.@seekable)=="false") ? false : true;
_local4.page = (((!(_local3.page)) || ((_local3.page.text() == "")))) ? "" : encodeURIComponent(_local3.page.text());
_local4.id = ((_local3.@id)=="") ? null : _local3.@id;
_local4.streamer = ((_local3.streamer.text())!="") ? _local3.streamer.text() : null;
_local4.start = ((_local3.start.text())!="") ? Number(_local3.start.text()) : 0;
videos[videos.length] = _local4;
};
};
dispatchEvent(new Event(PlaylistBuilder.LOADED));
}
public function parseVideoString(_arg1:String, _arg2:Boolean=true):Object{
var _local4:int;
var _local5:String;
var _local3:Object = {};
if (_arg1.indexOf("rtmp") != -1){
_local4 = (_arg1.indexOf("/", 8) + 1);
_local5 = _arg1.substr(0, (_arg1.indexOf("/", _local4) + 1));
_arg1 = _arg1.substr((_arg1.indexOf("/", _local4) + 1));
_local3.host = _local5;
};
if (_arg2){
if (((!(_arg1.match(/(\.flv|\.mp4|\.mov)/i))) && (!(_local3.host)))){
if (masks.http){
_arg1 = VideoMask(masks.http).build({id:_arg1});
};
};
if (((!(_local3.host)) && (masks.rtmp))){
_local3.host = VideoMask(masks.rtmp).build();
};
};
_local3.file = _arg1;
return (ObjectParser.parse(_local3));
}
public function addVideo(_arg1:String, _arg2:String=null, _arg3:Boolean=true, _arg4:Boolean=true, _arg5:String=""):Object{
var _local6:Object = parseVideoString(_arg1, _arg3);
_local6.link = ((_arg2)=="") ? null : _arg2;
_local6.seekable = ((_arg4)=="") ? true : _arg4;
_local6.id = ((_arg5)=="") ? null : _arg5;
videos[videos.length] = _local6;
return (_local6);
}
public function addRollVideo(_arg1:String, _arg2:String, _arg3:String=null, _arg4:String="http"):void{
var _local5:Object = parseVideoString(_arg2, false);
_local5.link = ((_arg3)=="") ? null : _arg3;
_local5.seekable = false;
_local5.streamer = _arg4;
_local5.isad = true;
_local5.autoplay = true;
if (_arg1 == "pre"){
pre_ads[pre_ads.length] = _local5;
} else {
post_ads[post_ads.length] = _local5;
};
}
public static function instance():PlaylistBuilder{
if (!_instance){
_instance = new (PlaylistBuilder);
};
return (_instance);
}
}
}//package com.conceptualideas.videoplayer.utils
import flash.utils.*;
class VideoMask {
private var _base:String;
private var replacements:Dictionary;
private function VideoMask(_arg1:String):void{
replacements = new Dictionary(true);
super();
this._base = _arg1;
}
public function add(... _args):void{
var _local2:Object;
var _local3:String;
if (_args.length == 1){
_local2 = _args.shift();
for (_local3 in _local2) {
this._add(_local3, _local2[_local3]);
};
} else {
this._add(_args.shift(), _args.shift());
};
}
private function _add(_arg1:String, _arg2:String):void{
replacements[_arg1] = _arg2;
}
public function build(_arg1:Object=null):String{
return (_build(_build(_base, _arg1), replacements));
}
private function _build(_arg1:String, _arg2:Object):String{
var _local4:String;
var _local5:String;
var _local3:String = _arg1;
for (_local4 in _arg2) {
_local5 = _arg2[_local4];
_local3 = _local3.replace((("[" + _local4) + "]"), _local5);
};
return (_local3);
}
}
Section 68
//Reflection (com.conceptualideas.videoplayer.utils.Reflection)
package com.conceptualideas.videoplayer.utils {
import flash.utils.*;
public class Reflection {
public static function getClassConst(_arg1:Class, _arg2:Boolean=false):Array{
var _local5:XML;
var _local3:XML = describeType(_arg1);
var _local4:Array = [];
for each (_local5 in _local3.constant) {
if (_arg2){
_local4.push(_arg1[_local5.@name]);
} else {
_local4.push(String(_local5.@name));
};
};
return (_local4);
}
}
}//package com.conceptualideas.videoplayer.utils
Section 69
//Settings (com.conceptualideas.videoplayer.utils.Settings)
package com.conceptualideas.videoplayer.utils {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.utils.parsers.*;
public class Settings extends EventDispatcher {
private var config:Object;
private var _cleanURL:String;
private var _playlist:Array;
private var _videoLink:String;
private var _videoID:String;
private var _dtools:DomainTools;
public static const LOADED:String = "loaded";
private static var _instance:Settings;
public function Settings(){
_playlist = [];
super();
}
public function load():void{
var _local1:String = (dtools.vars.containsValue("settings")) ? dtools.vars.getValue("settings") : ((dtools.base + "/") + "settings.css");
dtools.loadURL(_local1, onSettingsLoaded);
}
public function retrive(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false){
var parts:Array;
var index:int;
var current:*;
var memeber:String;
var selector = _arg1;
var remove = _arg2;
var enhancement = _arg3;
var returnObject = _arg4;
if (selector == ""){
return (config);
};
try {
if (enhancement){
return (retrive(("enhancements." + selector), remove));
};
parts = selector.split(".");
index = 0;
current = config;
for each (memeber in parts) {
if ((((index == (parts.length - 1))) && (remove))){
delete current[memeber];
} else {
if (((returnObject) && ((index == parts.length)))){
return (current[memeber]);
};
current = current[memeber];
};
index = (index + 1);
};
return (current);
} catch(e:Error) {
};
return (null);
}
private function createVideoMasks():void{
var _local1:PlaylistBuilder = PlaylistBuilder.instance();
var _local2:Object = {domain:retrive("main.currentDomain"), site:dtools.vars.check("media", "site"), subdomain:dtools.vars.check("media", "site")};
if (retrive("main.streaming") != "rtmp"){
_local1.addMask("http", config.main.flvMask, _local2);
} else {
_local1.addMask("rtmp", config.rtmp.conn, _local2);
};
}
private function getSettingsFromVars():void{
config.ui.skin.file = dtools.vars.check(config.ui.skin.file, "skin", "styleCSS");
config.main.autoPlay = dtools.vars.check(config.main.autoPlay, "autoplay");
trace("------------", retrive("main.seekingParamater"));
if (config.get("video", false, true)){
config.enhancements.video.displayclick = dtools.vars.check(config.enhancements.video.displayclick, "displayclick");
};
var omitList:Array = ["overlay", "image", "link", "id", "file", "videoPath", "playlist"];
var filter:RegExp = new RegExp(omitList.join("|"));
var colors:Array = dtools.vars.getGroup(/colors.[\w\W]+/i);
colors.forEach(function (_arg1, _arg2:int, _arg3:Array):void{
trace(retrive(("ui.skin." + _arg1), false, false, true));
});
}
public function init(_arg1:DisplayObjectContainer):void{
_dtools = DomainTools.instance();
dtools.init(_arg1);
}
public function get playlist():Array{
return (_playlist);
}
public function hasAds():Boolean{
var _local1:String;
for (_local1 in retrive("ads")) {
if (((!((_local1 == "display"))) && ((config.ads[_local1] === true)))){
return (true);
};
};
return (false);
}
public function get dtools():DomainTools{
return (_dtools);
}
private function onSettingsLoaded(_arg1:Event):void{
var e = _arg1;
config = ConfigParser.parse(e.target.data);
config.externalSite = dtools.onExternalSite(config.main.currentDomain);
config.get = retrive;
config.isModuleLoaded = function (_arg1:String):Boolean{
var _local2:Array = ((retrive("modules.load")) || ([]));
return (!((_local2.indexOf(_arg1) == -1)));
};
config.log = dtools.log;
config.hasEnhancement = function (_arg1:String):Boolean{
var _local2:Array = ((retrive("enhancements.load")) || ([]));
return (!((_local2.indexOf(_arg1) == -1)));
};
config.center = function (_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Number=0, _arg5:Number=0):void{
if (_arg1){
_arg1.x = (_arg4 + ((_arg2 - _arg1.width) / 2));
_arg1.y = (_arg5 + ((_arg3 - _arg1.height) / 2));
};
};
config.remove = function (_arg1:String, _arg2:Boolean=false):void{
retrive(_arg1, true, _arg2);
};
config.extend = _dtools.extend;
createVideoMasks();
getSettingsFromVars();
dispatchEvent(new Event(Settings.LOADED));
}
public static function instance():Settings{
if (!_instance){
_instance = new (Settings);
};
return (_instance);
}
}
}//package com.conceptualideas.videoplayer.utils
Section 70
//Stacker (com.conceptualideas.videoplayer.utils.Stacker)
package com.conceptualideas.videoplayer.utils {
import flash.display.*;
public class Stacker {
private var _compress:Boolean;// = false
private var _remove:Array;
private var _width:Number;
private var stack:Array;
public var clip:MovieClip;
private var latest:Number;// = 0
public function Stacker(_arg1:MovieClip){
_remove = [];
super();
clip = _arg1;
analyze();
}
public function set compress(_arg1:Boolean):void{
_compress = _arg1;
}
public function addRemove(_arg1:String):void{
_remove.push(_arg1);
}
public function analyze():void{
var _local2:DisplayObject;
_width = clip.width;
stack = new Array();
var _local1:Number = 0;
while (_local1 < clip.numChildren) {
_local2 = clip.getChildAt(_local1);
stack.push({c:_local2, x:_local2.x, n:_local2.name, w:_local2.width});
_local1++;
};
stack.sortOn(["x", "n"], [Array.NUMERIC, Array.CASEINSENSITIVE]);
}
public function get width():Number{
return (_width);
}
public function rearrange(_arg1:Number=undefined):void{
var _local6:Number;
if (_arg1){
latest = _arg1;
};
var _local2:Number = (latest - width);
var _local3:Number = 0;
var _local4:Number = 0;
while (_local4 < stack.length) {
if ((((stack[_local4].x > (width / 2))) && (!(_compress)))){
stack[_local4].c.x = (stack[_local4].x + _local2);
if ((((stack[_local4].c.visible == false)) && ((overlaps(_local4) == false)))){
_local2 = (_local2 - (((stack[_local4].w + stack[_local4].x) - stack[(_local4 - 1)].x) - stack[(_local4 - 1)].w));
};
} else {
stack[_local4].c.x = (stack[_local4].x - _local3);
if ((((stack[_local4].c.visible == false)) && ((overlaps(_local4) == false)))){
if (stack[(_local4 - 1)].w > (width / 4)){
_local3 = (_local3 + (stack[_local4].w + stack[_local4].x));
} else {
_local3 = (_local3 + (((stack[_local4].w + stack[_local4].x) - stack[(_local4 - 1)].x) - stack[(_local4 - 1)].w));
};
};
};
if ((((stack[_local4].w > (width / 4))) && (!(_compress)))){
stack[_local4].c.width = Math.abs(((stack[_local4].w + _local2) + _local3));
};
_local4++;
};
var _local5:Number = ((latest - width) - _local2);
if (_local5 > 0){
_local6 = 0;
while (_local6 < stack.length) {
if (stack[_local6].x > (width / 2)){
stack[_local6].c.x = (stack[_local6].c.x + _local5);
};
if ((((stack[_local6].w > (width / 4))) && ((stack[_local6].w < width)))){
stack[_local6].c.width = (stack[_local6].c.width + _local5);
};
_local6++;
};
};
}
public function insert(_arg1:MovieClip, _arg2:MovieClip):void{
var _local3:Number = 0;
var _local4:Number = 0;
while (_local4 < stack.length) {
if (stack[_local4].w >= _width){
stack[_local4].w = (stack[_local4].w + _arg1.width);
};
if ((((stack[_local4].c == _arg2)) && (!(_local3)))){
_local3 = _local4;
stack.splice(_local4, 0, {c:_arg1, x:stack[_local4].x, n:_arg1.name, w:_arg1.width});
} else {
if (_local3){
stack[_local4].x = (stack[_local4].x + _arg1.width);
};
};
_local4++;
};
_width = (_width + _arg1.width);
rearrange();
}
private function overlaps(_arg1:Number):Boolean{
var _local2:Number = stack[_arg1].x;
var _local3:Number = (stack[_arg1].x + stack[_arg1].w);
if (_remove.indexOf(stack[_arg1].n) != -1){
return (false);
};
var _local4:Number = 0;
while (_local4 < stack.length) {
if (((((((((!((_local4 == _arg1))) && ((stack[_local4].c.visible == true)))) && ((stack[_local4].w < _width)))) && ((stack[_local4].x < _local3)))) && (((stack[_local4].x + stack[_local4].w) > _local2)))){
return (true);
};
_local4++;
};
return (false);
}
public function findNext(_arg1:String):DisplayObject{
var _local3:Object;
var _local2:Boolean;
for each (_local3 in stack) {
if (_local2){
return (_local3.c);
};
if (_local3.n == _arg1){
_local2 = true;
};
};
return (null);
}
}
}//package com.conceptualideas.videoplayer.utils
Section 71
//Strings (com.conceptualideas.videoplayer.utils.Strings)
package com.conceptualideas.videoplayer.utils {
public class Strings {
public static function serialize(_arg1:String):Object{
if (_arg1 == null){
return (null);
};
if (_arg1 == "true"){
return (true);
};
if (_arg1 == "false"){
return (false);
};
if (((isNaN(Number(_arg1))) || ((_arg1.length > 5)))){
return (Strings.decode(_arg1));
};
return (Number(_arg1));
}
public static function trim(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.replace(/^\s+|\s+$/g, ""));
}
public static function digits(_arg1:Number, _arg2:Boolean=false):String{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (_arg2){
_local5 = Math.floor((_arg1 / 3600));
_local3 = Math.floor(((_arg1 - (_local5 * 3600)) / 60));
_local4 = Math.floor(((_arg1 - (_local3 * 60)) - (_local5 * 3600)));
} else {
_local3 = Math.floor((_arg1 / 60));
_local4 = Math.floor((_arg1 % 60));
};
return (((((_arg2) ? Strings.zero(_local5) : "" + Strings.zero(_local3)) + ":") + Strings.zero(_local4)));
}
public static function decode(_arg1:String):String{
if (_arg1.indexOf("asfunction") == -1){
return (unescape(_arg1));
};
return ("");
}
public static function zero(_arg1:Number):String{
if (_arg1 < 10){
return (("0" + _arg1));
};
return (("" + _arg1));
}
}
}//package com.conceptualideas.videoplayer.utils
Section 72
//CustomAdContainer (com.conceptualideas.videoplayer.views.ads.CustomAdContainer)
package com.conceptualideas.videoplayer.views.ads {
import com.conceptualideas.videoplayer.interfaces.*;
import flash.utils.*;
public class CustomAdContainer {
private var _hash:Dictionary;
private static var _instance:CustomAdContainer;
public function CustomAdContainer(){
_hash = new Dictionary();
super();
}
private function add(_arg1:String, _arg2:IAdView):void{
_hash[_arg1] = _arg2;
}
private function retrive(_arg1:String):IAdView{
return (_hash[_arg1]);
}
public static function add(_arg1:String, _arg2:IAdView):void{
instance().add(_arg1, _arg2);
}
private static function instance():CustomAdContainer{
if (!_instance){
_instance = new (CustomAdContainer);
};
return (_instance);
}
public static function retrive(_arg1:String):IAdView{
return (instance().retrive(_arg1));
}
}
}//package com.conceptualideas.videoplayer.views.ads
Section 73
//ImageAdContainerView (com.conceptualideas.videoplayer.views.ads.ImageAdContainerView)
package com.conceptualideas.videoplayer.views.ads {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.utils.*;
import flash.text.*;
public class ImageAdContainerView extends Sprite implements IAdView {
protected var sets:Array;
protected var adsLoaded:Number;// = 0
protected var _imgGroup:Sprite;
protected var _header:TextField;
protected var _set2:ImageSet;
protected var _set1:ImageSet;
protected var dtools:DomainTools;
protected var AD_LIMIT:Number;// = 2
public static const AD_LOADED:String = "ad_loaded";
public function ImageAdContainerView():void{
dtools = DomainTools.instance();
super();
}
private function setupImageGroup():void{
_imgGroup = new Sprite();
addChild(_imgGroup);
}
public function hide():void{
this.visible = false;
removeImageSets();
}
protected function positionAds():void{
sets[0].x = 0;
var _local1 = 1;
while (_local1 < sets.length) {
sets[_local1].x = ((sets[(_local1 - 1)].x + sets[(_local1 - 1)].width) + 100);
_local1++;
};
_imgGroup.y = ((_header.y + _header.height) + 10);
_imgGroup.visible = true;
_imgGroup.x = 0;
_header.x = 0;
if (_header.width > _imgGroup.width){
_imgGroup.x = ((_header.width - _imgGroup.width) / 2);
} else {
_header.x = ((_imgGroup.width - _header.width) / 2);
};
}
private function init():void{
this.visible = false;
sets = new Array();
var _local1:Object = {size:16, font:AssetManager.getFontName(AssetManager.ARIAL)};
_header = PlayerUtils.createTextField(345, 22, "center", true, "", _local1);
addChild(_header);
setupImageGroup();
}
private function onAdLoaded(_arg1:Event):void{
var xml:XML;
var count:Number;
var currentCount:Number;
var node:XML;
var e = _arg1;
try {
xml = new XML(e.target.data);
this.removeImageSets();
count = 1;
_header.text = xml.ad.@header;
currentCount = xml.ad.image.children();
for each (node in xml.ad.image) {
if (count <= AD_LIMIT){
this.createImageSet(node.@width, node.@height, node.@src, ((node.@location + "\n") + node.@age), xml.ad.@targeturl);
count = (count + 1);
} else {
break;
};
};
} catch(e:Error) {
};
}
private function onImageLoaded(_arg1:Event):void{
adsLoaded++;
if (adsLoaded == sets.length){
this.positionAds();
adsLoaded = 0;
dispatchEvent(new Event(ImageAdContainerView.AD_LOADED));
};
}
private function createImageSet(_arg1:Number, _arg2:Number, _arg3:String, _arg4:String, _arg5:String):void{
var _local6:ImageSet = new ImageSet(_arg1, _arg2);
_local6.addEventListener(ImageSet.LOADED, onImageLoaded, false, 0, true);
_imgGroup.addChild(_local6);
sets.push(_local6);
_local6.load(_arg3, _arg4, _arg5);
}
public function load(_arg1:String):void{
init();
_imgGroup.visible = false;
adsLoaded = 0;
dtools.loadURL(_arg1, onAdLoaded, dtools.adsense);
}
private function removeImageSets():void{
var _local1:ImageSet;
for each (_local1 in sets) {
_imgGroup.removeChild(_local1);
_local1 = null;
};
sets = null;
sets = new Array();
}
public function show():void{
this.visible = true;
}
}
}//package com.conceptualideas.videoplayer.views.ads
Section 74
//ImageSet (com.conceptualideas.videoplayer.views.ads.ImageSet)
package com.conceptualideas.videoplayer.views.ads {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import flash.text.*;
import flash.net.*;
public class ImageSet extends Sprite {
protected var link:String;
private var imageHeight:Number;
private var imageWidth:Number;
protected var _info:TextField;
protected var _img:Sprite;
protected static const TEXT_HIGHT:Number = 54;
protected static const TEXT_WIDTH:Number = 100;
public static const LOADED:String = "loaded";
public function ImageSet(_arg1:Number, _arg2:Number){
imageWidth = _arg1;
imageHeight = _arg2;
init();
}
public function load(_arg1:String, _arg2:String, _arg3:String):void{
var _local4:Loader = new Loader();
var _local5:DisplayObject = _img.getChildByName("content");
if (_local5 != null){
_img.removeChild(_local5);
_local5 = null;
};
var _local6:URLRequest = new URLRequest(_arg1);
_info.width = ImageSet.TEXT_WIDTH;
_info.height = ImageSet.TEXT_HIGHT;
_info.text = _arg2;
_img.addChildAt(_local4, 0);
this.link = _arg3;
_img.addEventListener(MouseEvent.CLICK, onImageClicked, false, 0, true);
_img.buttonMode = true;
_local4.load(_local6);
_local4.contentLoaderInfo.addEventListener(Event.INIT, onAdLoaded, false, 0, true);
}
private function onAdLoaded(_arg1:Event):void{
this.visible = true;
_info.x = (_img.x + ((_img.width - _info.width) / 2));
_info.y = ((_img.y + _img.height) + 5);
dispatchEvent(new Event(ImageSet.LOADED));
}
private function update():void{
_info.x = 0;
_img.x = ((_info.width - _img.width) / 2);
_info.y = (_img.height + 10);
}
public function reset():void{
_info.x = (_info.y = 1);
_info.width = (_info.height = 1);
this.visible = false;
}
protected function init():void{
var _local1:Object = {size:12, font:AssetManager.getFontName(AssetManager.ARIAL)};
_info = PlayerUtils.createTextField(imageWidth, ImageSet.TEXT_HIGHT, "center", true, "", _local1);
_img = PlayerUtils.createSpriteHolder(imageWidth, imageHeight);
addChild(_img);
addChild(_info);
this.visible = false;
}
private function onImageClicked(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(this.link), "_blank");
}
public function close():void{
var loader:Loader;
try {
loader = (_img.getChildAt(0) as Loader);
if (loader != null){
loader.close();
};
} catch(e:Error) {
};
}
}
}//package com.conceptualideas.videoplayer.views.ads
Section 75
//TextAdContainerView (com.conceptualideas.videoplayer.views.ads.TextAdContainerView)
package com.conceptualideas.videoplayer.views.ads {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.utils.*;
import flash.text.*;
import flash.net.*;
public class TextAdContainerView extends Sprite implements IAdView {
private const SPACING:Number = 10;
private var _info1:TextField;
private var _info2:TextField;
private var dtools:DomainTools;
private static const TEXT_HEIGHT:Number = 55;
public static const AD_LOADED:String = "ad_loaded";
private static const TEXT_WIDTH:Number = 206;
public function TextAdContainerView():void{
dtools = DomainTools.instance();
super();
}
private function onTextLinkClicked(_arg1:TextEvent):void{
navigateToURL(new URLRequest(_arg1.text));
}
public function hide():void{
this.visible = false;
if (_info1 != null){
removeChild(_info1);
removeChild(_info2);
_info1 = null;
_info2 = null;
};
}
private function init():void{
var _local1:Object = {size:12, font:AssetManager.getFontName(AssetManager.ARIAL)};
_info1 = PlayerUtils.createTextField(TEXT_WIDTH, TEXT_HEIGHT, "center", true, "", _local1);
_info2 = PlayerUtils.createTextField(TEXT_WIDTH, TEXT_HEIGHT, "center", true, "", _local1);
addChild(_info1);
addChild(_info2);
_info2.x = (_info1.width + SPACING);
_info1.addEventListener(TextEvent.LINK, onTextLinkClicked, false, 0, true);
_info2.addEventListener(TextEvent.LINK, onTextLinkClicked, false, 0, true);
this.visible = false;
}
private function onXMLFeedLoaded(_arg1:Event):void{
var xml:XML;
var count:Number;
var ad:XML;
var txt:TextField;
var e = _arg1;
try {
xml = new XML(e.target.data);
count = 1;
for each (ad in xml.children()) {
txt = this[("_info" + count)];
txt.width = TEXT_WIDTH;
txt.height = TEXT_HEIGHT;
txt.htmlText = (((((("<a href='event:" + ad.@targeturl) + "'>") + ad.@title) + "\n") + ad.@description) + "</a>");
count = (count + 1);
};
if (_info1.height < _info2.height){
_info1.y = (((_info2.y + _info2.height) - _info1.height) / 2);
};
if (_info2.height < _info2.height){
_info2.y = (((_info1.y + _info1.height) - _info2.height) / 2);
};
dispatchEvent(new Event(TextAdContainerView.AD_LOADED));
} catch(e:Error) {
};
}
public function load(_arg1:String):void{
init();
dtools.loadURL(_arg1, onXMLFeedLoaded, dtools.adsense);
}
public function show():void{
this.visible = true;
}
}
}//package com.conceptualideas.videoplayer.views.ads
Section 76
//WatermarkView (com.conceptualideas.videoplayer.views.WatermarkView)
package com.conceptualideas.videoplayer.views {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class WatermarkView extends Sprite {
private var selfToggle:Boolean;
private var paddingTop:Number;// = 0
private var _height:Number;
private var opacity:Number;
private var target:String;
private var paddingRight:Number;// = 0
private var paddingBottom:Number;// = 0
private var placement:String;
private var _distanceFromBottom:Number;
private var defaults:Object;
private var _watermark:Sprite;
private var url:String;
private var link:String;
private var paddingLeft:Number;// = 0
public static const CLICKED:String = "clicked";
public function WatermarkView(_arg1:Object, _arg2:Number):void{
defaults = {url:"", placement:"BR", link:"", target:"_self", opacity:70, paddingBottom:0, paddingTop:0, paddingRight:0, paddingLeft:0, selfToggle:false};
super();
_distanceFromBottom = _arg2;
this.update(_arg1);
this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
this.mouseEnabled = false;
this.mouseChildren = true;
_watermark = new Sprite();
}
public function hide():void{
this.visible = false;
}
private function onIOError(_arg1:IOErrorEvent):void{
}
public function update(_arg1:Object):void{
url = _arg1.url;
placement = _arg1.placement;
link = (_arg1.useNats) ? "nats" : _arg1.link;
target = _arg1.target;
opacity = _arg1.opacity;
paddingBottom = _arg1.paddingBottom;
paddingTop = _arg1.paddingTop;
paddingLeft = _arg1.paddingLeft;
paddingRight = _arg1.paddingRight;
selfToggle = _arg1.selfToggle;
}
private function setMaxViewingHeight():void{
_height = (stage.stageHeight - _distanceFromBottom);
}
private function init():void{
if (((!((link == null))) && (!((link == ""))))){
_watermark.addEventListener(MouseEvent.CLICK, onWatermarkClicked, false, 0, true);
};
loadWatermark(url);
}
private function onWatermarkClicked(_arg1:MouseEvent):void{
dispatchEvent(new Event(WatermarkView.CLICKED));
}
private function setWatermarkPlacement():void{
if (_watermark != null){
switch (placement.toUpperCase()){
case "TL":
_watermark.y = paddingTop;
_watermark.x = paddingLeft;
break;
case "TR":
_watermark.x = ((stage.stageWidth - _watermark.width) - paddingRight);
_watermark.y = paddingRight;
break;
case "BL":
_watermark.x = paddingLeft;
_watermark.y = ((_height - _watermark.height) - paddingBottom);
break;
case "BR":
_watermark.x = ((stage.stageWidth - _watermark.width) - paddingRight);
_watermark.y = ((_height - _watermark.height) - paddingBottom);
break;
default:
_watermark.x = ((stage.stageWidth - _watermark.width) - paddingRight);
_watermark.y = paddingTop;
};
};
}
private function loadWatermark(_arg1:String):void{
var loader:Loader;
var request:URLRequest;
var url = _arg1;
try {
loader = new Loader();
request = new URLRequest(url);
loader.contentLoaderInfo.addEventListener(Event.INIT, onWatermarkLoaded, false, 0, true);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
loader.load(request, new LoaderContext(true));
} catch(e:Error) {
trace(e);
};
}
private function onAddedToStage(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
this.setMaxViewingHeight();
init();
}
private function onWatermarkLoaded(_arg1:Event):void{
if (_watermark.numChildren != 0){
_watermark.removeChildAt(0);
};
_watermark.addChild(LoaderInfo(_arg1.target).content);
_watermark.alpha = (opacity / 100);
_watermark.buttonMode = true;
addChild(_watermark);
arrange();
if (selfToggle){
hide();
};
}
public function arrange():void{
_height = (stage.stageHeight - _distanceFromBottom);
setWatermarkPlacement();
}
public function show():void{
this.visible = true;
}
}
}//package com.conceptualideas.videoplayer.views
Section 77
//CIVideoPlayer (com.conceptualideas.videoplayer.CIVideoPlayer)
package com.conceptualideas.videoplayer {
import flash.events.*;
import com.conceptualideas.videoplayer.player.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.utils.*;
import com.conceptualideas.videoplayer.events.*;
import com.conceptualideas.videoplayer.core.bootloader.*;
import flash.system.*;
import com.conceptualideas.videoplayer.modules.*;
public class CIVideoPlayer extends Sprite {
protected var settings:Settings;
protected var view:AbstractView;
protected var playlist:PlaylistBuilder;
protected var show_console:Boolean;// = false
private var skin:MovieClip;
public function CIVideoPlayer():void{
settings = Settings.instance();
playlist = PlaylistBuilder.instance();
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function onExternalPlayListLoaded(_arg1:Event):void{
start();
}
protected function setupBootLoader():void{
Bootloader.addBoot("pre", new PreBootLoader());
Bootloader.addBoot("mid", new MidBootLoader());
Bootloader.init(this, onBootLoaderComplete);
}
protected function overrides():void{
}
protected function addVideo(_arg1:String, _arg2:String=null):Object{
return (playlist.addVideo(_arg1, _arg2, true));
}
protected function get maxHeight():Number{
return ((conf("main.maxHeight")) ? conf("main.maxHeight") : stage.stageHeight);
}
protected function onBootLoaderComplete(_arg1:BaseView):void{
this.view = _arg1;
overrides();
BaseView(this.view).loaded();
MouseWatcher.setup(_arg1.skin.stage);
createPlaylist();
}
private function createPlaylist():void{
var _local1:String;
var _local2:Object;
if (!settings.dtools.vars.hasEither("videoPath", "playlist")){
_local1 = settings.dtools.vars.check(conf("main.defaultVideo"), "file", "id");
_local2 = this.addVideo(_local1, settings.dtools.vars.getValue("link"));
if (settings.dtools.vars.hasKey("start")){
_local2.start = Number(settings.dtools.vars.getValue("start"));
};
if (conf("ads.showPreroll")){
playlist.addRollVideo("pre", conf("ads.rolls.preroll.url"), null, conf("ads.rolls.preroll.type"));
};
if (conf("ads.showPostroll")){
playlist.addRollVideo("post", conf("ads.rolls.postroll.url"), null, conf("ads.rolls.preroll.type"));
};
start();
} else {
playlist.addEventListener(PlaylistBuilder.LOADED, onExternalPlayListLoaded, false, 0, true);
playlist.load(settings.dtools.vars.getEither("videoPath", "playlist"));
};
}
protected function start():void{
view.sendEvent("LOAD", playlist.getPlaylist());
}
private function init(_arg1:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, init);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
setupBootLoader();
}
protected function conf(_arg1:String){
return (settings.retrive(_arg1));
}
}
}//package com.conceptualideas.videoplayer
Section 78
//HitTester (com.dougmccune.HitTester)
package com.dougmccune {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class HitTester {
private static var cache:Dictionary = new Dictionary();
public static function realHitTest(_arg1:DisplayObject, _arg2:Point):Boolean{
var _local3:BitmapData;
var _local4:Boolean;
var _local5:Rectangle;
var _local6:Matrix;
if ((_arg1 is BitmapData)){
return ((_arg1 as BitmapData).hitTest(new Point(0, 0), 0, _arg1.globalToLocal(_arg2)));
};
if (!_arg1.hitTestPoint(_arg2.x, _arg2.y, true)){
return (false);
};
if (((((!(cache[_arg1])) || (!((cache[_arg1].width == _arg1.width))))) || (!((cache[_arg1].height == _arg1.height))))){
if (cache[_arg1]){
cache[_arg1].dispose();
};
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local5 = _arg1.getBounds(_arg1.parent);
_local6 = _arg1.transform.matrix;
_local6.tx = (_arg1.x - _local5.x);
_local6.ty = (_arg1.y - _local5.y);
_local3.draw(_arg1, new Matrix());
} else {
_local3 = cache[_arg1];
};
_local4 = ((_local3.getPixel32(_arg2.x, _arg2.y))<4278190080) ? true : false;
cache[_arg1] = _local3;
return (_local4);
}
}
}//package com.dougmccune
Section 79
//ColorMatrix (com.gskinner.geom.ColorMatrix)
package com.gskinner.geom {
public dynamic class ColorMatrix extends Array {
private static const IDENTITY_MATRIX:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
private static const LENGTH:Number = IDENTITY_MATRIX.length;
private static const DELTA_INDEX:Array = [0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.2, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.3, 0.32, 0.34, 0.36, 0.38, 0.4, 0.42, 0.44, 0.46, 0.48, 0.5, 0.53, 0.56, 0.59, 0.62, 0.65, 0.68, 0.71, 0.74, 0.77, 0.8, 0.83, 0.86, 0.89, 0.92, 0.95, 0.98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10];
public function ColorMatrix(_arg1:Array=null){
_arg1 = fixMatrix(_arg1);
copyMatrix(((_arg1.length)==LENGTH) ? _arg1 : IDENTITY_MATRIX);
}
public function adjustBrightness(_arg1:Number):void{
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
multiplyMatrix([1, 0, 0, 0, _arg1, 0, 1, 0, 0, _arg1, 0, 0, 1, 0, _arg1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustSaturation(_arg1:Number):void{
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
var _local2:Number = (1 + ((_arg1)>0) ? ((3 * _arg1) / 100) : (_arg1 / 100));
var _local3:Number = 0.3086;
var _local4:Number = 0.6094;
var _local5:Number = 0.082;
multiplyMatrix([((_local3 * (1 - _local2)) + _local2), (_local4 * (1 - _local2)), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), ((_local4 * (1 - _local2)) + _local2), (_local5 * (1 - _local2)), 0, 0, (_local3 * (1 - _local2)), (_local4 * (1 - _local2)), ((_local5 * (1 - _local2)) + _local2), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
protected function multiplyMatrix(_arg1:Array):void{
var _local4:uint;
var _local5:Number;
var _local6:Number;
var _local2:Array = [];
var _local3:uint;
while (_local3 < 5) {
_local4 = 0;
while (_local4 < 5) {
_local2[_local4] = this[(_local4 + (_local3 * 5))];
_local4++;
};
_local4 = 0;
while (_local4 < 5) {
_local5 = 0;
_local6 = 0;
while (_local6 < 5) {
_local5 = (_local5 + (_arg1[(_local4 + (_local6 * 5))] * _local2[_local6]));
_local6++;
};
this[(_local4 + (_local3 * 5))] = _local5;
_local4++;
};
_local3++;
};
}
protected function cleanValue(_arg1:Number, _arg2:Number):Number{
return (Math.min(_arg2, Math.max(-(_arg2), _arg1)));
}
public function adjustHue(_arg1:Number):void{
_arg1 = ((cleanValue(_arg1, 180) / 180) * Math.PI);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
var _local2:Number = Math.cos(_arg1);
var _local3:Number = Math.sin(_arg1);
var _local4:Number = 0.213;
var _local5:Number = 0.715;
var _local6:Number = 0.072;
multiplyMatrix([((_local4 + (_local2 * (1 - _local4))) + (_local3 * -(_local4))), ((_local5 + (_local2 * -(_local5))) + (_local3 * -(_local5))), ((_local6 + (_local2 * -(_local6))) + (_local3 * (1 - _local6))), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * 0.143)), ((_local5 + (_local2 * (1 - _local5))) + (_local3 * 0.14)), ((_local6 + (_local2 * -(_local6))) + (_local3 * -0.283)), 0, 0, ((_local4 + (_local2 * -(_local4))) + (_local3 * -((1 - _local4)))), ((_local5 + (_local2 * -(_local5))) + (_local3 * _local5)), ((_local6 + (_local2 * (1 - _local6))) + (_local3 * _local6)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function toString():String{
return ((("ColorMatrix [ " + this.join(" , ")) + " ]"));
}
protected function fixMatrix(_arg1:Array=null):Array{
if (_arg1 == null){
return (IDENTITY_MATRIX);
};
if ((_arg1 is _slot1)){
_arg1 = _arg1.slice(0);
};
if (_arg1.length < LENGTH){
_arg1 = _arg1.slice(0, _arg1.length).concat(IDENTITY_MATRIX.slice(_arg1.length, LENGTH));
} else {
if (_arg1.length > LENGTH){
_arg1 = _arg1.slice(0, LENGTH);
};
};
return (_arg1);
}
public function reset():void{
var _local1:uint;
while (_local1 < LENGTH) {
this[_local1] = IDENTITY_MATRIX[_local1];
_local1++;
};
}
public function adjustContrast(_arg1:Number):void{
var _local2:Number;
_arg1 = cleanValue(_arg1, 100);
if ((((_arg1 == 0)) || (isNaN(_arg1)))){
return;
};
if (_arg1 < 0){
_local2 = (127 + ((_arg1 / 100) * 127));
} else {
_local2 = (_arg1 % 1);
if (_local2 == 0){
_local2 = DELTA_INDEX[_arg1];
} else {
_local2 = ((DELTA_INDEX[(_arg1 << 0)] * (1 - _local2)) + (DELTA_INDEX[((_arg1 << 0) + 1)] * _local2));
};
_local2 = ((_local2 * 127) + 127);
};
multiplyMatrix([(_local2 / 127), 0, 0, 0, (0.5 * (127 - _local2)), 0, (_local2 / 127), 0, 0, (0.5 * (127 - _local2)), 0, 0, (_local2 / 127), 0, (0.5 * (127 - _local2)), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
}
public function adjustColor(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
adjustHue(_arg4);
adjustContrast(_arg2);
adjustBrightness(_arg1);
adjustSaturation(_arg3);
}
protected function copyMatrix(_arg1:Array):void{
var _local2:Number = LENGTH;
var _local3:uint;
while (_local3 < _local2) {
this[_local3] = _arg1[_local3];
_local3++;
};
}
public function concat(_arg1:Array):void{
_arg1 = fixMatrix(_arg1);
if (_arg1.length != LENGTH){
return;
};
multiplyMatrix(_arg1);
}
public function clone():ColorMatrix{
return (new ColorMatrix(this));
}
public function toArray():Array{
return (slice(0, 20));
}
}
}//package com.gskinner.geom
Section 80
//BaseEvent (com.reyco1.events.BaseEvent)
package com.reyco1.events {
import flash.events.*;
import com.reyco1.util.*;
public class BaseEvent extends Event {
public var params:Object;
public function BaseEvent(_arg1:String, _arg2:Object=null){
super(_arg1, true, true);
this.params = _arg2;
}
override public function toString():String{
return (ClassUtil.className(this));
}
override public function clone():Event{
return (new BaseEvent(this.type, this.params));
}
}
}//package com.reyco1.events
Section 81
//ContextMenuManagerEvent (com.reyco1.events.ContextMenuManagerEvent)
package com.reyco1.events {
public class ContextMenuManagerEvent extends BaseEvent {
public static const MENU_SELECTED:String = "ContextMenuManagerEvent.onMeuSelected";
public static const RIGHT_CLICK:String = "ContextMenuManagerEvent.onRightClik";
public function ContextMenuManagerEvent(_arg1:String, _arg2:Object){
super(_arg1, _arg2);
}
}
}//package com.reyco1.events
Section 82
//DispatchExtension (com.reyco1.extension.DispatchExtension)
package com.reyco1.extension {
import flash.events.*;
import com.reyco1.util.*;
public class DispatchExtension extends EventDispatcher {
private var strClassName:String;
private var bolOutputSilenced:Boolean;// = false
public function DispatchExtension():void{
this.strClassName = ClassUtil.displayClassName(this);
trace((this.strClassName + "constructed"));
}
override public function dispatchEvent(_arg1:Event):Boolean{
return (super.dispatchEvent(_arg1));
}
public function output(_arg1):void{
var _local2:String;
var _local3:*;
if (!this.bolOutputSilenced){
switch (typeof(_arg1)){
case "object":
_local2 = (_arg1.length) ? "Array" : "Object";
trace((this.strClassName + _local2));
trace("----------------------------------------------");
for (_local3 in _arg1) {
trace((((((" - [" + typeof(_arg1[_local3])) + "] ") + _local3) + " : ") + _arg1[_local3]));
};
break;
default:
trace((this.strClassName + _arg1));
break;
};
};
}
public function set outputSilenced(_arg1:Boolean):void{
this.bolOutputSilenced = _arg1;
}
}
}//package com.reyco1.extension
Section 83
//ContextMenuManager (com.reyco1.manager.ContextMenuManager)
package com.reyco1.manager {
import flash.events.*;
import flash.display.*;
import com.reyco1.events.*;
import com.reyco1.extension.*;
import flash.ui.*;
import com.reyco1.util.*;
public class ContextMenuManager extends DispatchExtension {
private var myContextMenu:ContextMenu;
private var objScope:DisplayObject;
private var _arrMenuItems:Array;
public function ContextMenuManager(_arg1:DisplayObject):void{
this.myContextMenu = new ContextMenu();
this.objScope = _arg1;
this._arrMenuItems = new Array();
this.removeDefaultItems();
this.myContextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, this.menuSelectHandler);
this.objScope["contextMenu"] = this.myContextMenu;
trace(this.objScope);
}
public function get arrMenuItems():Array{
return (_arrMenuItems);
}
private function removeDefaultItems():void{
this.myContextMenu.hideBuiltInItems();
this.myContextMenu.customItems = [];
}
public function removeMenuItem(_arg1:String):void{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < this._arrMenuItems.length) {
if (this._arrMenuItems[_local3].label != _arg1){
_local2.push(this._arrMenuItems[_local3]);
};
_local3++;
};
this._arrMenuItems = _local2;
this.addCustomMenuItems();
}
public function menuItemEnabled(_arg1:String, _arg2:Boolean):void{
this.removeDefaultItems();
var _local3:uint;
while (_local3 < this._arrMenuItems.length) {
if (this._arrMenuItems[_local3].label != _arg1){
this._arrMenuItems[_local3].enabled = _arg2;
};
_local3++;
};
this.addCustomMenuItems();
}
private function addSingleCustomItem(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=true):void{
var _local4:ContextMenuItem = new ContextMenuItem(_arg1, _arg2, _arg3);
this.myContextMenu.customItems.push(_local4);
_local4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, ProxyUtil.create(this.menuItemSelectHandler, _arg1));
}
private function menuSelectHandler(_arg1:ContextMenuEvent):void{
this.removeDefaultItems();
if ((((_arg1.mouseTarget == this.objScope)) || ((_arg1.mouseTarget.parent == this.objScope)))){
this.addCustomMenuItems();
};
this.dispatchEvent(new ContextMenuManagerEvent(ContextMenuManagerEvent.RIGHT_CLICK, {}));
}
private function addCustomMenuItems():void{
var _local1:uint;
if (this._arrMenuItems.length > 0){
_local1 = 0;
while (_local1 < this._arrMenuItems.length) {
this.addSingleCustomItem(this._arrMenuItems[_local1].label, this._arrMenuItems[_local1].separate, this._arrMenuItems[_local1].enabled);
_local1++;
};
};
}
public function addMenuItem(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=true):void{
this.removeDefaultItems();
this._arrMenuItems.push({label:_arg1, separate:_arg2, enabled:_arg3});
this.addCustomMenuItems();
}
private function menuItemSelectHandler(_arg1:ContextMenuEvent, _arg2:String):void{
this.dispatchEvent(new ContextMenuManagerEvent(ContextMenuManagerEvent.MENU_SELECTED, {label:_arg2, target:this.objScope}));
}
}
}//package com.reyco1.manager
Section 84
//ClassUtil (com.reyco1.util.ClassUtil)
package com.reyco1.util {
public class ClassUtil {
public static function displayClassName(_arg1:Object):String{
return ((("[" + ClassUtil.className(_arg1)) + "] : "));
}
public static function className(_arg1:Object):String{
return (_arg1.toString().substring((_arg1.toString().indexOf(" ") + 1), (_arg1.toString().length - 1)));
}
}
}//package com.reyco1.util
Section 85
//ProxyUtil (com.reyco1.util.ProxyUtil)
package com.reyco1.util {
public class ProxyUtil {
public static function create(_arg1:Function, ... _args):Function{
var $function = _arg1;
var $rest = _args;
return (function (... _args):void{
$function.apply(this, _args.concat($rest));
});
}
}
}//package com.reyco1.util
Section 86
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 87
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
}
}//package gs.plugins
Section 88
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local3:Array = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var _local7:Object = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package gs.plugins
Section 89
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 90
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package gs.plugins
Section 91
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package gs.plugins
Section 92
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 93
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
}
}//package gs.plugins
Section 94
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 95
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 96
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 97
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 98
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 99
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.plugins.*;
import gs.utils.tween.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.091;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 100
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 101
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 102
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 103
//Logger (org.osflash.thunderbolt.Logger)
package org.osflash.thunderbolt {
import flash.utils.*;
import flash.system.*;
import flash.external.*;
public class Logger {
public static const WARN:String = "warn";
private static const AUTHOR:String = "Jens Krause [www.websector.de]";
public static const FIELD_SEPERATOR:String = " :: ";
public static const LOG:String = "log";
public static const INFO:String = "info";
private static const VERSION:String = "2.2";
private static const GROUP_END:String = "groupEnd";
private static const GROUP_START:String = "group";
public static const ERROR:String = "error";
private static const MAX_DEPTH:int = 0xFF;
public static var includeTime:Boolean = true;
private static var _firstRun:Boolean = true;
private static var _hide:Boolean = false;
private static var _stopLog:Boolean = false;
private static var _firebug:Boolean = false;
private static var _depth:int;
public static var showCaller:Boolean = true;
private static var _logLevel:String;
public static function set hide(_arg1:Boolean):void{
_hide = _arg1;
}
public static function about():void{
var _local1 = (((("+++ Welcome to ThunderBolt AS3 | VERSION: " + Logger.VERSION) + " | AUTHOR: ") + Logger.AUTHOR) + " | Happy logging +++");
Logger.info(_local1);
}
public static function error(_arg1:String=null, ... _args):void{
Logger.log(Logger.ERROR, _arg1, _args);
}
public static function warn(_arg1:String=null, ... _args):void{
Logger.log(Logger.WARN, _arg1, _args);
}
private static function getCurrentTime():String{
var _local1:Date = new Date();
var _local2:String = (((((((("time " + timeToValidString(_local1.getHours())) + ":") + timeToValidString(_local1.getMinutes())) + ":") + timeToValidString(_local1.getSeconds())) + ".") + timeToValidString(_local1.getMilliseconds())) + FIELD_SEPERATOR);
return (_local2);
}
private static function logObject(_arg1, _arg2:String=null):void{
var _local3:String;
var _local4:XML;
var _local5:String;
var _local6:String;
var _local7:String;
var _local8:int;
var _local9:int;
var _local10:XMLList;
var _local11:XML;
var _local12:String;
var _local13:String;
var _local14:String;
var _local15:*;
if (_depth < Logger.MAX_DEPTH){
_depth++;
_local3 = ((_arg2) || (""));
_local4 = describeType(_arg1);
_local5 = _local4.@name;
if (primitiveType(_local5)){
_local6 = (_local3.length) ? ((((("[" + _local5) + "] ") + _local3) + " = ") + _arg1) : ((("[" + _local5) + "] ") + _arg1);
Logger.call(_local6);
} else {
if (_local5 == "Object"){
Logger.callGroupAction(GROUP_START, ("[Object] " + _local3));
for (_local7 in _arg1) {
logObject(_arg1[_local7], _local7);
};
Logger.callGroupAction(GROUP_END);
} else {
if (_local5 == "Array"){
Logger.callGroupAction(GROUP_START, ("[Array] " + _local3));
_local8 = 0;
_local9 = _arg1.length;
while (_local8 < _local9) {
logObject(_arg1[_local8]);
_local8++;
};
Logger.callGroupAction(GROUP_END);
} else {
_local10 = _local4..accessor;
if (_local10.length()){
for each (_local11 in _local10) {
_local12 = _local11.@name;
_local13 = _local11.@type;
_local14 = _local11.@access;
if (((_local14) && (!((_local14 == "writeonly"))))){
_local15 = _arg1[_local12];
Logger.logObject(_local15, _local12);
};
};
} else {
Logger.logObject(_arg1, _local5);
};
};
};
};
} else {
if (!_stopLog){
Logger.call((("STOP LOGGING: More than " + _depth) + " nested objects or properties."));
_stopLog = true;
};
};
}
public static function info(_arg1:String=null, ... _args):void{
Logger.log(Logger.INFO, _arg1, _args);
}
public static function set console(_arg1:Boolean):void{
_firstRun = false;
_firebug = !(_arg1);
}
private static function primitiveType(_arg1:String):Boolean{
var _local2:Boolean;
switch (_arg1){
case "Boolean":
case "void":
case "int":
case "uint":
case "Number":
case "String":
case "undefined":
case "null":
_local2 = true;
break;
default:
_local2 = false;
};
return (_local2);
}
public static function debug(_arg1:String=null, ... _args):void{
Logger.log(Logger.LOG, _arg1, _args);
}
private static function stackDataFromStackTrace(_arg1:String):StackData{
var _local2:Array = ((_arg1.match(/^\tat (?:(.+)::)?(.+)\/(.+)\(\)\[(?:(.+)\:(\d+))?\]$/)) || (new Array()));
var _local3:StackData = new StackData();
_local3.packageName = ((_local2[1]) || (""));
_local3.className = ((_local2[2]) || (""));
_local3.methodName = ((_local2[3]) || (""));
_local3.fileName = ((_local2[4]) || (""));
_local3.lineNumber = ((int(_local2[5])) || (0));
return (_local3);
}
private static function call(_arg1:String=""):void{
if (_firebug){
ExternalInterface.call(("console." + _logLevel), _arg1);
} else {
trace(((_logLevel + " ") + _arg1));
};
}
public static function memorySnapshot():String{
var _local1:uint = System.totalMemory;
var _local2 = (((("Memory Snapshot: " + (Math.round((((_local1 / 0x0400) / 0x0400) * 100)) / 100)) + " MB (") + Math.round((_local1 / 0x0400))) + " kb)");
return (_local2);
}
public static function log(_arg1:String, _arg2:String="", _arg3:Array=null):void{
var _local4:String;
var _local5:Boolean;
var _local6:int;
var _local7:int;
if (!_hide){
if (_firstRun){
_local5 = (((Capabilities.playerType == "ActiveX")) || ((Capabilities.playerType == "PlugIn")));
trace(("isBrowser " + _local5));
if (((_local5) && (ExternalInterface.available))){
if (ExternalInterface.call("function(){ return typeof window.console == 'object' && typeof console.firebug == 'string'}")){
_firebug = true;
};
};
_firstRun = false;
};
_depth = 0;
_logLevel = _arg1;
_local4 = "";
if (includeTime){
_local4 = (_local4 + getCurrentTime());
};
if (showCaller){
_local4 = (_local4 + logCaller());
};
_local4 = (_local4 + _arg2);
Logger.call(_local4);
if (_arg3 != null){
_local6 = 0;
_local7 = _arg3.length;
_local6 = 0;
while (_local6 < _local7) {
Logger.logObject(_arg3[_local6]);
_local6++;
};
};
};
}
private static function timeToValidString(_arg1:Number):String{
return (((_arg1 > 9)) ? _arg1.toString() : ("0" + _arg1.toString()));
}
private static function logCaller():String{
var debugError:Error;
var errorObject:Object;
var stackTrace:String;
var stacks:Array;
var stackData:StackData;
var message = "";
try {
errorObject.halli = "galli";
} catch(error:Error) {
debugError = new Error();
} finally {
stackTrace = debugError.getStackTrace();
if (stackTrace != null){
stacks = stackTrace.split("\n");
if (stacks != null){
if (stacks.length >= 5){
stackData = Logger.stackDataFromStackTrace(stacks[4]);
};
if ((((stackData.className == "AbstractTarget")) && ((stacks.length >= 9)))){
stackData = Logger.stackDataFromStackTrace(stacks[8]);
};
if (stackData != null){
message = (message + ((stackData.packageName)!="") ? (stackData.packageName + ".") : stackData.packageName);
message = (message + stackData.className);
if (stackData.lineNumber > 0){
message = (message + (((" [" + stackData.lineNumber) + "]") + Logger.FIELD_SEPERATOR));
};
};
};
};
};
return (message);
}
private static function callGroupAction(_arg1:String, _arg2:String=""):void{
if (_firebug){
if (_arg1 == GROUP_START){
ExternalInterface.call("console.group", _arg2);
} else {
if (_arg1 == GROUP_END){
ExternalInterface.call("console.groupEnd");
} else {
ExternalInterface.call(("console." + Logger.ERROR), "group type has not defined");
};
};
} else {
if (_arg1 == GROUP_START){
trace(((((_logLevel + ".") + GROUP_START) + " ") + _arg2));
} else {
if (_arg1 == GROUP_END){
trace(((((_logLevel + ".") + GROUP_END) + " ") + _arg2));
} else {
trace((ERROR + "group type has not defined"));
};
};
};
}
}
}//package org.osflash.thunderbolt
class StackData {
public var className:String;
public var fileName:String;
public var packageName:String;
public var methodName:String;
public var lineNumber:int;
private function StackData(){
}
public function toString():String{
var _local1:String = ((((((((("packageName " + packageName) + " // className ") + className) + " // methodName ") + methodName) + " // fileName ") + fileName) + "// lineNumber ") + lineNumber);
return (_local1);
}
}
Section 104
//SparkMidBootLoader (spark.core.bootloader.SparkMidBootLoader)
package spark.core.bootloader {
import com.conceptualideas.videoplayer.interfaces.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.core.bootloader.*;
import com.conceptualideas.videoplayer.modules.ui.*;
public class SparkMidBootLoader extends MidBootLoader {
override protected function loadModules():void{
super.loadModules();
var settings:Settings = Settings.instance();
var modules:Array = settings.retrive("").get("modules.load");
var classPath = "spark.modules.{path}{class}";
var availPaths:Array = ["ui."];
loadComponent(availPaths, classPath, modules, function (_arg1:Class):void{
view.loadModule(IComponent(new (_arg1)));
});
setupButtons();
}
private function setupButtons():void{
var _local1:ControlBar;
if (view.config.getModule("ControlBar")){
_local1 = view.config.getModule("ControlBar");
_local1.addButton(view.skin.controlbar.dim, {dim:{dimButton:"DIM"}});
_local1.addButton(view.skin.controlbar.menu, {menu:{menuButton:"SHOW_MENU"}});
};
}
}
}//package spark.core.bootloader
Section 105
//PlayerMenuEvent (spark.events.PlayerMenuEvent)
package spark.events {
import flash.events.*;
public class PlayerMenuEvent extends Event {
private var _data:Object;
public static const CLOSE_WINDOW:String = "close_window";
public function PlayerMenuEvent(_arg1:String, _arg2:Object=null){
super(_arg1, true);
_data = _arg2;
}
public function get data():Object{
return (_data);
}
override public function toString():String{
return (formatToString("PlayerMenuEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new PlayerMenuEvent(type, data));
}
}
}//package spark.events
Section 106
//IMenu (spark.interfaces.IMenu)
package spark.interfaces {
public interface IMenu {
function init(_arg1:Object):void;
function hide():void;
function show(_arg1:String=null, _arg2:String=null):void;
}
}//package spark.interfaces
Section 107
//PlayerMenu (spark.modules.ui.PlayerMenu)
package spark.modules.ui {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.videoplayer.events.*;
import spark.events.*;
import gs.*;
import spark.interfaces.*;
import flash.utils.*;
import spark.utils.*;
public class PlayerMenu extends BaseComponent {
private var buttons:Object;
private var config:Object;
private var pendingFunctions:Array;
private var menuY:Number;// = 0
private var menu:MovieClip;
private var bottomMenuTween:TweenLite;
private var menuClosed:Boolean;// = true
private var autoHideTimer:Timer;
private var stacker:Stacker;
private var videoTween:TweenLite;
private var currentMenu:DisplayObject;
public function PlayerMenu(){
buttons = ["email", "about", "report", "help", "close"];
config = {remove:[]};
pendingFunctions = [];
super();
}
private function onMenuItemRequest(_arg1:MouseEvent):void{
showMenuItem(_arg1.target.name);
}
private function onWindowCloseRequest(_arg1:PlayerMenuEvent):void{
var _local2:IMenu = IMenu(_arg1.target);
if (_local2){
_local2.hide();
resizeVideo(view.stage.stageWidth, view.stage.stageHeight, true);
resetTimer();
autoHideTimer.start();
};
}
private function onBottomMenuOpened():void{
menuClosed = false;
bottomMenuTween = null;
if (((currentMenu) && (!(currentMenu.visible)))){
autoHideTimer.start();
};
}
private function fitVideoAndMenu():void{
if (currentMenu){
currentMenu.x = ((view.stage.stageWidth - currentMenu.width) - 5);
};
if (((currentMenu) && (currentMenu.visible))){
resizeVideo(((view.stage.stageWidth - currentMenu.width) - 10), view.stage.stageHeight, false);
} else {
resizeVideo(view.stage.stageWidth, view.stage.stageHeight, true);
};
}
private function onBottomMenuClosed():void{
bottomMenuTween = null;
menuClosed = true;
if (currentMenu){
IMenu(currentMenu).hide();
};
resizeVideo(view.stage.stageWidth, view.stage.stageHeight, true);
finishClose();
runPendingFunctions();
}
private function resetTimer():void{
autoHideTimer.reset();
}
private function hideMenu():void{
resetTimer();
bottomMenuTween = TweenLite.to(menu, 1, {y:(menuY + menu.height), onComplete:onBottomMenuClosed});
}
private function onControlBarShow(_arg1:Event):void{
menu.visible = true;
}
private function onControlBarHide(_arg1:Event):void{
menu.visible = false;
}
private function addQueFunctions(_arg1:Function):void{
pendingFunctions.push(_arg1);
}
private function onResizeRequest(_arg1:ControllerEvent):void{
resetTimer();
var _local2:Boolean = (currentMenu) ? true : false;
if (videoTween){
videoTween.clear();
};
if (bottomMenuTween){
bottomMenuTween.complete();
if (videoTween){
videoTween.complete();
};
};
if (_local2){
if (currentMenu.name == "email"){
currentMenu.visible = (_arg1.data.fullScreen) ? false : currentMenu.visible;
};
fitVideoAndMenu();
};
menu.x = _arg1.data.leftBounds;
menuY = (menu.y = ((_arg1.data.height - view.config.barHeight) - menu.height));
menu.background.width = (_arg1.data.width - _arg1.data.leftBounds);
stacker.rearrange(_arg1.data.width);
if (menu.close){
menu.close.x = ((menu.background.width - menu.close.width) - 5);
};
arrangeMenu();
runPendingFunctions();
if (!menuClosed){
trace("menued NO CLOSED");
autoHideTimer.start();
};
}
private function onToggleMenuRequest(_arg1:ViewEvent):void{
if (view.currentItem){
if (menu.y != menuY){
showMenu();
} else {
hideMenu();
};
};
}
private function onTimerTicked(_arg1:TimerEvent):void{
trace("onTimerTick");
hideMenu();
}
private function setupListeners():void{
var _local1:String;
view.addViewListener(ViewEvent.SHOW_MENU, onToggleMenuRequest);
view.addControllerListener(ControllerEvent.RESIZE, onResizeRequest);
view.addControllerListener(ControllerEvent.RESIZE_VIDEO, onResizeVideoRequest, 1);
view.addViewListener("CONTROLBAR_HIDE_START", onControlBarHide);
view.addViewListener("CONTROLBAR_SHOW_FINISHED", onControlBarShow);
for each (_local1 in buttons) {
if (menu[_local1]){
if (config.remove.indexOf(_local1) != -1){
menu[_local1].visible = false;
stacker.addRemove(_local1);
} else {
menu[_local1].buttonMode = true;
menu[_local1].addEventListener(MouseEvent.ROLL_OVER, onRollOverRequest, false, 0, true);
menu[_local1].addEventListener(MouseEvent.ROLL_OUT, onRollOutRequest, false, 0, true);
menu[_local1].addEventListener(MouseEvent.CLICK, onMenuItemRequest, false, 0, true);
menu[_local1].alpha = 0.7;
};
};
};
}
private function onResizeVideoRequest(_arg1:ControllerEvent):void{
if (((((((currentMenu) && (currentMenu.visible))) && (_arg1.data["fromControlBar"]))) || (!((bottomMenuTween == null))))){
_arg1.stopImmediatePropagation();
};
}
private function finishClose():void{
if (view.getModule("controlbarEnhancements")){
view.getModule("controlbarEnhancements").resume();
};
}
private function resizeVideo(_arg1:Number, _arg2:Number, _arg3:Boolean=false):void{
var maxWidth = _arg1;
var maxHeight = _arg2;
var center = _arg3;
var videoDisplay:Sprite = view.skin.display;
var xsc:Number = (maxWidth / videoDisplay.width);
var ysc:Number = (maxHeight / videoDisplay.height);
var videoWidth:Number = (videoDisplay.width * ((xsc)>ysc) ? ysc : xsc);
var videoHeight:Number = (videoDisplay.height * ((xsc)>ysc) ? ysc : xsc);
var props:Object = {width:videoWidth, height:videoHeight, x:0, y:0, onComplete:function ():void{
videoTween = null;
}};
videoTween = TweenLite.to(view.skin.display, 1, props);
}
private function runPendingFunctions():void{
var _local1:Function;
for each (_local1 in pendingFunctions) {
_local1();
};
pendingFunctions = [];
}
private function arrangeMenu():void{
menu.y = menuY;
if (menuClosed){
menu.y = (menu.y + menu.height);
};
}
private function showMenuItem(_arg1:String, _arg2:Boolean=false):void{
var type = _arg1;
var overhaul = _arg2;
resetTimer();
if (type == "close"){
if (currentMenu){
view.skin.removeChild(currentMenu);
};
trace("CLOSE ME DAMIT");
hideMenu();
return;
};
if ((((((type == "email")) && (!(pendingFunctions.length)))) && ((view.stage.displayState == "fullScreen")))){
addQueFunctions(function ():void{
showMenuItem("email", true);
});
view.sendEvent(ViewEvent.FULLSCREEN);
return;
};
if (((currentMenu) && ((currentMenu.name == type)))){
IMenu(currentMenu).show();
view.skin.addChild(currentMenu);
fitVideoAndMenu();
return;
};
var menu:IMenu = MenuFactory.retriveMenu(type);
if (menu){
menu.init(config[type]);
if (currentMenu){
try {
view.skin.removeChild(currentMenu);
} catch(e:Error) {
};
};
currentMenu = DisplayObject(menu);
currentMenu.addEventListener(PlayerMenuEvent.CLOSE_WINDOW, onWindowCloseRequest, false, 0, true);
currentMenu.name = type;
view.skin.addChild(currentMenu);
menu.show(view.currentItem.id, view.currentItem.page);
fitVideoAndMenu();
if (view.getModule("controlbarEnhancements")){
view.getModule("controlbarEnhancements").pause();
};
};
}
override public function initalize(_arg1:AbstractView):void{
super.initalize(_arg1);
menu = _arg1.skin["menu"];
config = _arg1.config.extend(config, _arg1.config.get("modules.playermenu"));
if (menu){
menu.visible = true;
stacker = new Stacker(menu);
stacker.compress = true;
autoHideTimer = new Timer((5 * 1000), 1);
autoHideTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerTicked, false, 0, true);
setupListeners();
};
}
private function showMenu():void{
bottomMenuTween = TweenLite.to(menu, 1, {y:menuY, onComplete:onBottomMenuOpened});
}
private function onRollOutRequest(_arg1:MouseEvent):void{
_arg1.target.alpha = 0.7;
}
private function onRollOverRequest(_arg1:MouseEvent):void{
_arg1.target.alpha = 1;
}
}
}//package spark.modules.ui
Section 108
//MenuFactory (spark.utils.MenuFactory)
package spark.utils {
import spark.interfaces.*;
import flash.utils.*;
import spark.views.menus.*;
public class MenuFactory {
public static function retriveMenu(_arg1:String):IMenu{
var menuInstance:IMenu;
var menu = _arg1;
var fixedName:String = (menu.substr(0, 1).toUpperCase() + menu.substr(1));
var classPath = (("spark.views.menus." + fixedName) + "Menu");
try {
menuInstance = Object(getDefinitionByName(classPath)).instance();
} catch(e:Error) {
trace(e);
};
return (menuInstance);
}
}
}//package spark.utils
Section 109
//AboutMenu (spark.views.menus.AboutMenu)
package spark.views.menus {
import flash.display.*;
import flash.text.*;
import spark.interfaces.*;
public class AboutMenu extends PlayerMenuView implements IMenu {
private var _config:Object;
private static var _instance:IMenu;
public function AboutMenu(){
_config = {text:"", buttonColor:6052958, aboutFieldHeight:300, textSize:12, textColor:0xFFFFFF, width:260, height:300, linkColor:0xFF0000, buttonTextColor:0xFFFFFF, fontFace:"Arial", buttonFontSize:16};
super();
}
public function init(_arg1:Object):void{
if (!container){
config = extend(extend(config, _config), _arg1);
createChildrens();
};
}
public function show(_arg1:String=null, _arg2:String=null):void{
this.visible = true;
}
private function createChildrens():void{
var _local2:TextField;
var _local3:TextField;
var _local1:Object = {size:config.textSize, color:config.textColor, font:config.fontFace, embed:false};
container = new Sprite();
cancelButton = createCancel(config.buttonColor, {size:config.buttonFontSize, color:config.buttonTextColor, font:config.fontFace, embed:false});
var _local4:TextField = createInputField(config.width, config.height, _local1);
_local4.htmlText = config.text;
_local4.type = "dynamic";
_local4.border = false;
container.addChild(_local4);
container.addChild(cancelButton);
var _local5:StyleSheet = new StyleSheet();
_local5.setStyle("a", {textDecoration:"underline", color:("#" + config.linkColor.toString(16))});
_local4.styleSheet = _local5;
cancelButton.y = ((_local4.y + _local4.height) + 5);
cancelButton.x = (((_local4.x + _local4.width) - cancelButton.width) / 2);
addChild(container);
}
public function hide():void{
this.visible = false;
}
public static function instance():IMenu{
if (!_instance){
_instance = new (AboutMenu);
};
return (_instance);
}
}
}//package spark.views.menus
Section 110
//EmailMenu (spark.views.menus.EmailMenu)
package spark.views.menus {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.utils.*;
import flash.text.*;
import spark.interfaces.*;
import flash.utils.*;
public class EmailMenu extends PlayerMenuView implements IMenu {
private var _timeoutTimer:Timer;
private var txtMessageInput:TextField;
private var _pending:Boolean;// = false
private var sendButton:Sprite;
private var txtEmailInput:TextField;
private var _config:Object;
private var currentItemPage:String;// = ""
private var txtNameInput:TextField;
private static var _instance:IMenu;
public function EmailMenu(){
_config = {timeOutMessage:"Sorry, your email has timeout", timeOutLimit:10, nameHeading:"Your Name", emailHeading:"Friends Email (separate with commas)", messageHeading:"Message (optional)", width:260, buttonColor:6052958, textColor:0xFFFFFF, textSize:12, buttonTextColor:0xFFFFFF, fontFace:"Arial", buttonFontSize:12, windowBackgroundColor:0, errorTextColor:0xFF0000, messageTextSize:16, messageFontFace:"Arai"};
super();
}
private function onSendRequest(_arg1:MouseEvent):void{
var _local2:Object = {color:config.errorTextColor, size:config.messageTextSize, font:config.messageFontFace, embed:false};
if (trim(txtNameInput.text) == ""){
centerWindow(showMessage("Please Insert your name", _local2));
return;
};
if (trim(txtEmailInput.text) == ""){
centerWindow(showMessage("Please insert an email.", _local2));
return;
};
_pending = true;
var _local3:String = config.url;
_local3 = _local3.replace("[sender_name]", trim(txtNameInput.text));
_local3 = _local3.replace("[friends_email]", trim(txtEmailInput.text));
_local3 = _local3.replace("[message]", trim(txtMessageInput.text));
_local3 = _local3.replace("[page]", (currentItemPage) ? currentItemPage : "");
_local3 = _local3.replace("[id]", (currentItem) ? currentItem : "");
_local3 = (_local3 + ("&random=" + new Date().time));
sendButton.mouseEnabled = false;
sendButton.alpha = 0.7;
_timeoutTimer.start();
DomainTools.instance().loadURL(_local3, onEmailSent);
}
public function hide():void{
this.visible = false;
}
private function reset(_arg1:Boolean=true):void{
if (_arg1){
txtEmailInput.text = "";
txtNameInput.text = "";
};
_pending = false;
sendButton.mouseEnabled = true;
sendButton.alpha = 1;
}
public function init(_arg1:Object):void{
if (!container){
config = extend(extend(config, _config), _arg1);
_timeoutTimer = new Timer((config.timeOutLimit * 1000), 1);
_timeoutTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimeOutReached, false, 0, true);
createChildren();
};
}
private function onCancelRequest(_arg1:MouseEvent):void{
}
private function createChildren():void{
var _local1:Object = {size:config.textSize, color:config.textColor, embed:false, font:config.fontFace};
var _local2:Object = {size:config.buttonFontSize, color:config.buttonTextColor, embed:false, font:config.fontFace};
container = new Sprite();
addChild(container);
createCancel(config.buttonColor, _local2);
sendButton = createButton("Send", config.buttonColor, _local2);
var _local3:TextField = createTextField(config.nameHeading, false, _local1);
container.addChild(_local3);
txtNameInput = createInputField(config.width, 18, _local1);
txtNameInput.y = ((_local3.y + _local3.height) + 5);
container.addChild(txtNameInput);
var _local4:TextField = createTextField(config.emailHeading, false, _local1);
container.addChild(_local4);
_local4.y = ((txtNameInput.y + txtNameInput.height) + 5);
txtEmailInput = createInputField(config.width, 18, _local1);
container.addChild(txtEmailInput);
txtEmailInput.y = ((_local4.y + _local4.height) + 5);
var _local5:TextField = createTextField(config.messageHeading, false, _local1);
container.addChild(_local5);
_local5.y = ((txtEmailInput.y + txtEmailInput.height) + 10);
txtMessageInput = createInputField(config.width, 60, _local1);
container.addChild(txtMessageInput);
container.addChild(cancelButton);
container.addChild(sendButton);
txtMessageInput.y = ((_local5.y + _local5.height) + 5);
cancelButton.y = (sendButton.y = ((txtMessageInput.y + txtMessageInput.height) + 5));
sendButton.x = (((txtMessageInput.x + txtMessageInput.width) - sendButton.width) - 5);
cancelButton.x = ((sendButton.x - cancelButton.width) - 5);
sendButton.addEventListener(MouseEvent.CLICK, onSendRequest, false, 0, true);
cancelButton.addEventListener(MouseEvent.CLICK, onCancelRequest, false, 0, true);
}
private function onTimeOutReached(_arg1:TimerEvent):void{
var e = _arg1;
var textParams:Object = {color:config.errorTextColor, size:config.messageTextSize, font:config.messageFontFace, embed:false};
var message:String = config.timeOutMessage;
var callback:Function = function ():void{
closeWindow();
reset();
};
centerWindow(showMessage(message, textParams, callback));
}
private function centerWindow(_arg1:TextField):void{
_arg1.y = (cancelButton.y + cancelButton.height);
_arg1.x = 0;
}
private function onEmailSent(_arg1:Event):void{
var e = _arg1;
_timeoutTimer.stop();
_timeoutTimer.reset();
var response:XML = new XML(e.target.data);
var message:String = response.message.text();
var callback:Function;
var isError:Boolean = ((response.status.text())=="OK") ? false : true;
var textParams:Object = {color:(isError) ? config.errorTextColor : config.textColor, size:config.messageTextSize, font:config.messageFontFace, embed:false};
if (!isError){
callback = function ():void{
closeWindow();
reset();
};
} else {
callback = function ():void{
reset(false);
};
};
centerWindow(showMessage(message, textParams, callback));
}
public function show(_arg1:String=null, _arg2:String=null):void{
currentItem = _arg1;
currentItemPage = _arg2;
this.visible = true;
}
public static function instance():IMenu{
if (!_instance){
_instance = new (EmailMenu);
};
return (_instance);
}
}
}//package spark.views.menus
Section 111
//HelpMenu (spark.views.menus.HelpMenu)
package spark.views.menus {
import flash.display.*;
import flash.text.*;
import spark.interfaces.*;
public class HelpMenu extends PlayerMenuView implements IMenu {
private var _config:Object;
private static var _instance:IMenu;
public function HelpMenu(){
_config = {text:"", buttonColor:6052958, aboutFieldHeight:300, textSize:12, textColor:0xFFFFFF, width:260, height:300, linkColor:0xFF0000, fontFace:"Arial", buttonFontSize:16};
super();
}
public function init(_arg1:Object):void{
if (!container){
config = extend(extend(config, _config), _arg1);
createChildrens();
};
}
public function show(_arg1:String=null, _arg2:String=null):void{
this.visible = true;
}
private function createChildrens():void{
var _local1:Object = {size:config.textSize, color:config.textColor, embed:false, font:config.fontFace};
container = new Sprite();
cancelButton = createCancel(config.buttonColor, {size:config.buttonFontSize, color:config.buttonTextColor, embed:false, font:config.fontFace});
var _local2:StyleSheet = new StyleSheet();
_local2.setStyle("a", {textDecoration:"underline", color:("#" + config.linkColor.toString(16))});
var _local3:TextField = createInputField(config.width, config.height, _local1);
_local3.type = "dynamic";
_local3.htmlText = config.text;
_local3.border = false;
_local3.styleSheet = _local2;
container.addChild(_local3);
container.addChild(cancelButton);
cancelButton.y = ((_local3.y + _local3.height) + 5);
cancelButton.x = (((_local3.x + _local3.width) - cancelButton.width) / 2);
addChild(container);
}
public function hide():void{
this.visible = false;
}
public static function instance():IMenu{
if (!_instance){
_instance = new (HelpMenu);
};
return (_instance);
}
}
}//package spark.views.menus
Section 112
//PlayerMenuView (spark.views.menus.PlayerMenuView)
package spark.views.menus {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.videoplayer.utils.*;
import com.conceptualideas.utils.*;
import flash.text.*;
import spark.events.*;
import flash.utils.*;
import br.hellokeita.utils.*;
public class PlayerMenuView extends Sprite {
protected var container:Sprite;
protected var currentItem:String;
private var _lastButtonHeight:Number;// = 0
protected var config:Object;
protected var cancelButton:Sprite;
public function PlayerMenuView(){
config = {selectionColor:0, selectedColor:0};
super();
}
protected function createTextField(_arg1:String, _arg2:Boolean=true, _arg3:Object=null):TextField{
var _local4:TextField = PlayerUtils.createTextField(0, 0, "left", _arg2, _arg1, _arg3);
_local4.selectable = false;
_local4.mouseEnabled = false;
_local4.mouseWheelEnabled = false;
_local4.addEventListener(FocusEvent.FOCUS_IN, onTextFieldFocus, false, 1, true);
return (_local4);
}
protected function showMessage(_arg1:String, _arg2:Object=null, _arg3:Function=null):TextField{
var txt:TextField;
var ref:Object;
var message = _arg1;
var format = _arg2;
var callback = _arg3;
if (this.getChildByName("txt_message")){
return ((this.getChildByName("txt_message") as TextField));
};
format.align = TextFormatAlign.LEFT;
txt = createTextField(message, true, format);
txt.name = "txt_message";
txt.width = this.width;
txt.text = message;
txt.selectable = false;
addChild(txt);
txt.x = ((this.width - txt.width) / 2);
txt.y = ((this.height - txt.height) / 2);
ref = this;
setTimeout(function ():void{
ref.removeChild(txt);
if (callback != null){
callback();
};
}, 3000);
return (txt);
}
protected function closeWindow():void{
dispatchEvent(new PlayerMenuEvent(PlayerMenuEvent.CLOSE_WINDOW));
}
protected function trim(_arg1:String):String{
return (_arg1.replace(/^\s+|\s+$/g, ""));
}
private function onButtonOverRequest(_arg1:MouseEvent):void{
_arg1.target.alpha = 1;
}
private function onButtonOutRequest(_arg1:MouseEvent):void{
_arg1.target.alpha = 0.9;
}
protected function createButton(_arg1:String, _arg2:uint, _arg3:Object=null):Sprite{
var _local4:TextField = PlayerUtils.createTextField(0, 0, "center", false, _arg1, _arg3);
var _local5:Number = (_local4.width + 10);
var _local6:Number = (_lastButtonHeight) ? _lastButtonHeight : (_local4.textHeight + 10);
_lastButtonHeight = _local6;
var _local7:Sprite = new Sprite();
var _local8:Boolean = ColorTools.isBright(_arg2);
var _local9:uint = (_local8) ? _arg2 : ColorTools.lightenColor(_arg2, 80);
var _local10:uint = (_local8) ? ColorTools.darkenColor(_arg2, 16) : ColorTools.lightenColor(_arg2, 70);
var _local11:uint = (_local8) ? ColorTools.darkenColor(_arg2, 59) : ColorTools.lightenColor(_arg2, 27);
var _local12:uint = (_local8) ? ColorTools.darkenColor(_arg2, 84) : _arg2;
var _local13:Array = [_local9, _local10, _local11, _local12];
var _local14:Array = [1, 1, 1, 1];
var _local15:Object = {width:_local5, height:_local6};
var _local16:Object = {x:0, y:0, width:_local5, height:_local6};
var _local17:Array = [0, 126, 127, 0xFF];
PlayerUtils._setGradientFill(_local7.graphics, _local13, _local14, _local15, _local16, _local17, 5);
_local4.mouseEnabled = false;
_local7.addChild(_local4);
_local4.x = ((_local7.width - _local4.width) / 2);
_local4.y = ((_local7.height - _local4.height) / 2);
_local7.addEventListener(MouseEvent.ROLL_OVER, onButtonOverRequest, false, 0, true);
_local7.addEventListener(MouseEvent.ROLL_OUT, onButtonOutRequest, false, 0, true);
_local7.alpha = 0.9;
_local7.buttonMode = true;
return (_local7);
}
protected function createCancel(_arg1:uint, _arg2:Object=null):Sprite{
if (cancelButton){
return (cancelButton);
};
cancelButton = createButton("Cancel", _arg1, _arg2);
cancelButton.addEventListener(MouseEvent.CLICK, onCancelRequest, false, 0, true);
return (cancelButton);
}
private function onTextFieldFocus(_arg1:FocusEvent):void{
if (!TextField(_arg1.target).selectable){
_arg1.preventDefault();
_arg1.stopImmediatePropagation();
trace("onTextFieldFocus");
} else {
trace(_arg1.target);
};
}
protected function createInputField(_arg1:Number, _arg2:Number, _arg3:Object=null):TextField{
var _local4:TextField = PlayerUtils.createTextField(_arg1, _arg2, "left", true, "", _arg3);
_local4.selectable = true;
_local4.type = "input";
_local4.border = true;
_local4.borderColor = 0xFF0000;
_local4.backgroundColor = 0xFFFFFF;
new TextFieldColor(_local4, _local4.textColor, config.selectionColor, config.selectedColor);
return (_local4);
}
protected function extend(_arg1:Object, _arg2:Object):Object{
var _local3:String;
for (_local3 in _arg2) {
if (_arg2[_local3] != null){
_arg1[_local3] = _arg2[_local3];
};
};
return (_arg1);
}
private function onCancelRequest(_arg1:MouseEvent):void{
closeWindow();
}
}
}//package spark.views.menus
Section 113
//ReportMenu (spark.views.menus.ReportMenu)
package spark.views.menus {
import flash.events.*;
import flash.display.*;
import com.conceptualideas.utils.*;
import flash.text.*;
import spark.interfaces.*;
public class ReportMenu extends PlayerMenuView implements IMenu {
private var _config:Object;
private static var _instance:IMenu;
public function ReportMenu(){
_config = {text:"", buttonColor:6052958, aboutFieldHeight:300, textSize:12, textColor:0xFFFFFF, width:260, height:300, linkColor:0xFF0000, fontFace:"Arial"};
super();
}
public function init(_arg1:Object):void{
if (!container){
config = extend(extend(config, _config), _arg1);
createChildrens();
};
}
public function show(_arg1:String=null, _arg2:String=null):void{
this.visible = true;
}
private function createChildrens():void{
var _local1:Object = {size:config.textSize, color:config.textColor, embed:false, font:config.fontFace};
container = new Sprite();
cancelButton = createCancel(config.buttonColor, {size:config.buttonFontSize, color:config.buttonTextColor, embed:false, font:config.fontFace});
var _local2:StyleSheet = new StyleSheet();
_local2.setStyle("a", {textDecoration:"underline", color:("#" + config.linkColor.toString(16))});
var _local3:Sprite = createButton("Report", config.buttonColor, {size:config.buttonFontSize, color:config.buttonTextColor, embed:false, font:config.fontFace});
var _local4:TextField = createInputField(config.width, config.height, _local1);
_local4.type = "dynamic";
_local4.htmlText = config.text;
_local4.border = false;
_local4.styleSheet = _local2;
container.addChild(_local4);
container.addChild(cancelButton);
container.addChild(_local3);
_local3.y = (cancelButton.y = ((_local4.y + _local4.height) + 5));
_local3.x = (((_local4.x + _local4.width) - _local3.width) - 5);
cancelButton.x = 5;
addChild(container);
_local3.addEventListener(MouseEvent.CLICK, onReportRequest, false, 0, true);
}
public function hide():void{
this.visible = false;
}
private function onReportRequest(_arg1:MouseEvent):void{
DomainTools.instance().navigate(config.url, "_self");
}
public static function instance():IMenu{
if (!_instance){
_instance = new (ReportMenu);
};
return (_instance);
}
}
}//package spark.views.menus
Section 114
//Main (Main)
package {
import com.conceptualideas.videoplayer.*;
import com.conceptualideas.videoplayer.core.bootloader.*;
import spark.core.bootloader.*;
public class Main extends CIVideoPlayer {
public function Main():void{
}
override protected function setupBootLoader():void{
Bootloader.addBoot("pre", new PreBootLoader());
Bootloader.addBoot("mid", new SparkMidBootLoader());
Bootloader.init(this, onBootLoaderComplete);
}
}
}//package