Section 1
//NumberUtils (com.doubleclick.adslot.common.NumberUtils)
package com.doubleclick.adslot.common {
public class NumberUtils {
public static function generateOrdinal():String{
return ((Math.floor((Math.random() * 100000)) + ""));
}
}
}//package com.doubleclick.adslot.common
Section 2
//RuntimeDefinitions (com.doubleclick.adslot.common.RuntimeDefinitions)
package com.doubleclick.adslot.common {
import flash.system.*;
public class RuntimeDefinitions {
private static function getDefinition(_arg1:String):Object{
var appDomain:ApplicationDomain;
var fullyQualifiedName = _arg1;
appDomain = ApplicationDomain.currentDomain;
while (appDomain) {
if (appDomain.hasDefinition(fullyQualifiedName)){
try {
return (appDomain.getDefinition(fullyQualifiedName));
} catch(error:Error) {
};
};
appDomain = appDomain.parentDomain;
};
return (null);
}
public static function getFLVPlaybackNamespace():Namespace{
return ((getDefinition("fl.video.flvplayback_internal") as Namespace));
}
}
}//package com.doubleclick.adslot.common
Section 3
//StringUtils (com.doubleclick.adslot.common.StringUtils)
package com.doubleclick.adslot.common {
public class StringUtils {
public static function nullIfEmpty(_arg1:String):String{
if (isNullOrEmpty(_arg1)){
return (null);
};
return (_arg1);
}
public static function trim(_arg1:String):String{
return (ltrim(rtrim(_arg1)));
}
public static function getValueForKey(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Array;
var _local5:String;
var _local6:uint;
_local3 = (_arg2 + "=");
_local4 = _arg1.split(";");
_local5 = null;
_local6 = 0;
while (_local6 < _local4.length) {
if (_local4[_local6].indexOf(_local3) != -1){
_local5 = _local4[_local6].substring((_local4[_local6].indexOf(_local3) + _local3.length), _local4[_local6].length);
};
_local6++;
};
return (_local5);
}
public static function rtrim(_arg1:String):String{
var _local2:int;
_local2 = _arg1.length;
while (_local2--) {
if (_arg1.charCodeAt(_local2) > 32){
return (_arg1.substring(0, (_local2 + 1)));
};
};
return ("");
}
public static function startsWith(_arg1:String, _arg2:String):Boolean{
return ((_arg1.indexOf(_arg2) == 0));
}
public static function injectNewValueForKey(_arg1:String, _arg2:String, _arg3:String, _arg4:String):String{
var _local5:String;
var _local6:Array;
var _local7:String;
var _local8:int;
var _local9:Number;
_local5 = (_arg2 + "=");
_local6 = _arg1.split(_local5);
if (_local6.length > 0){
_local7 = ((_arg2 + "=") + _arg3);
_local8 = 1;
while (_local8 < _local6.length) {
_local9 = _local6[_local8].indexOf(_arg4);
if (_local9 != -1){
_local6[_local8] = (_arg3 + _local6[_local8].substring(_local9, _local6[_local8].length));
} else {
_local6[_local8] = _arg3;
};
_local8++;
};
return (_local6.join(_local5));
};
return (null);
}
public static function isNullOrEmpty(_arg1:String):Boolean{
if (((_arg1) && (Boolean(StringUtils.trim(_arg1))))){
return (false);
};
return (true);
}
public static function trimEndingQuote(_arg1:String):String{
var _local2:int;
var _local3:String;
var _local4:int;
_local2 = (_arg1.length - 1);
var _temp1 = _local2;
_local2 = (_local2 - 1);
_local3 = _arg1.charAt(_temp1);
_local4 = 0;
while ((((_local3 == "\"")) || ((_local3 == "'")))) {
_local4++;
var _temp2 = _local2;
_local2 = (_local2 - 1);
_local3 = _arg1.charAt(_temp2);
};
return (_arg1.substring(0, (_arg1.length - _local4)));
}
public static function replace(_arg1:String, _arg2:String, _arg3:String):String{
var _local4:Array;
_local4 = _arg1.split(_arg2);
if (_local4.length > 0){
return (_local4.join(_arg3));
};
return (null);
}
public static function ltrim(_arg1:String):String{
var _local2:int;
var _local3:Number;
_local2 = -1;
_local3 = _arg1.length;
while (_local2++ < _local3) {
if (_arg1.charCodeAt(_local2) > 32){
return (_arg1.substring(_local2));
};
};
return ("");
}
}
}//package com.doubleclick.adslot.common
Section 4
//URLUtils (com.doubleclick.adslot.common.URLUtils)
package com.doubleclick.adslot.common {
import flash.net.*;
public class URLUtils {
private static const SIZE_KEY:String = "sz";
private static const DCMT_KEY:String = "dcmt";
private static const ORDINAL_KEY:String = "ord";
private static const TILE_KEY:String = "tile";
private static const PTILE_KEY:String = "ptile";
public static function getAdServerHost(_arg1:String):String{
var _local2:Number;
var _local3:Number;
_local2 = (getProtocol(_arg1).length + 3);
_local3 = _arg1.indexOf("/", _local2);
if (_local3 != -1){
return (_arg1.substring(_local2, _local3));
};
return (_arg1.substring(_local2, _arg1.length));
}
public static function getExtraTargettingKeyValues(_arg1:String):Object{
var _local2:Array;
var _local3:Object;
var _local4:uint;
var _local5:String;
_local2 = _arg1.split(";");
_local3 = new Object();
_local4 = 1;
while (_local4 < _local2.length) {
_local5 = _local2[_local4].split("=")[0];
if ((((((((((_local5 == SIZE_KEY)) || ((_local5 == ORDINAL_KEY)))) || ((_local5 == DCMT_KEY)))) || ((_local5 == TILE_KEY)))) || ((_local5 == PTILE_KEY)))){
} else {
_local3[(("" + _local5) + "")] = _local2[_local4].split("=")[1];
};
_local4++;
};
return (_local3);
}
public static function removeKeyAndValue(_arg1:String, _arg2:String, _arg3:String=";"):String{
var _local4:String;
var _local5:String;
var _local6:int;
_local4 = (_arg2 + "=");
_local5 = null;
_local5 = _arg1.split(_local4)[0];
_local6 = 1;
while (_local6 < _arg1.split(_local4)[1].split(_arg3).length) {
_local5 = (_local5 + (_arg1.split(_local4)[1].split(_arg3)[_local6] + _arg3));
_local6++;
};
return (_local5);
}
public static function getProtocol(_arg1:String):String{
return (_arg1.substring(0, (_arg1.indexOf("//") - 1)));
}
public static function ping(_arg1:String):void{
var requestUrl:URLRequest;
var url = _arg1;
requestUrl = new URLRequest(url);
try {
sendToURL(requestUrl);
} catch(error:Error) {
};
}
public static function getSize(_arg1:String):String{
return (StringUtils.getValueForKey(_arg1, SIZE_KEY));
}
public static function getOrdinal(_arg1:String):String{
return (StringUtils.getValueForKey(_arg1, ORDINAL_KEY));
}
public static function getSite(_arg1:String):String{
var _local2:String;
var _local3:Number;
_local2 = _arg1.split(";")[0];
_local3 = (_local2.lastIndexOf("/") + 1);
return (_arg1.substring(_local3, _local2.length));
}
}
}//package com.doubleclick.adslot.common
Section 5
//EventsSuppressor (com.doubleclick.adslot.flvplayback.EventsSuppressor)
package com.doubleclick.adslot.flvplayback {
import com.doubleclick.adslot.logging.*;
import flash.events.*;
public class EventsSuppressor extends EventDispatcher {
private var flvplayback:Object;
private var uiManagerAccess:UIManagerAccess;
public static const SUPPRESSOR_LISTENER_PRIORITY:int = int((int.MAX_VALUE / 2));
private static const AD_EVENTS_TO_SUPPRESS:Array = ["close", "complete", "cuePoint", "metadataReceived", "playingStateEntered", "playheadUpdate", "progress", "ready", "stopped", "stateChange"];
public function EventsSuppressor(_arg1:Object){
this.flvplayback = _arg1;
uiManagerAccess = new UIManagerAccess(_arg1);
}
public function onEvent(_arg1:Event):void{
_arg1.stopImmediatePropagation();
uiManagerAccess.handleIVPEvent(_arg1);
if (_arg1.type == "complete"){
flvplayback.removeEventListener(_arg1.type, onEvent);
debug("complete event is firing in suppressor");
};
}
public function stopSuppressing():void{
var _local1:String;
debug("suppress is OFF");
for each (_local1 in AD_EVENTS_TO_SUPPRESS) {
if (_local1 != "complete"){
flvplayback.removeEventListener(_local1, onEvent);
};
};
}
public function suppress(_arg1:String=null):void{
var _local2:String;
debug("suppress is ON");
if (!_arg1){
for each (_local2 in AD_EVENTS_TO_SUPPRESS) {
flvplayback.addEventListener(_local2, onEvent, false, SUPPRESSOR_LISTENER_PRIORITY);
};
} else {
flvplayback.addEventListener(_arg1, onContentEvent, false, getLowerListenerPriority());
};
}
public function onContentEvent(_arg1:Event):void{
_arg1.stopImmediatePropagation();
flvplayback.removeEventListener(_arg1.type, onContentEvent);
dispatchEvent(_arg1);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public static function getLowerListenerPriority():int{
return ((SUPPRESSOR_LISTENER_PRIORITY - 1));
}
public static function getHigherListenerPriority():int{
return ((SUPPRESSOR_LISTENER_PRIORITY + 1));
}
}
}//package com.doubleclick.adslot.flvplayback
Section 6
//FLVPlaybackClickArea (com.doubleclick.adslot.flvplayback.FLVPlaybackClickArea)
package com.doubleclick.adslot.flvplayback {
import flash.display.*;
import com.doubleclick.adslot.*;
import flash.events.*;
import flash.utils.*;
public class FLVPlaybackClickArea extends ClickArea {
private var skinFailedToLoad:Boolean;// = false
private var controlsBar:DisplayObject;// = null
private var uiManagerAccess:FLVPlaybackUIManagerAccess;// = null
private var delayedResizeTimer:Timer;// = null
private static var DELAYED_RESIZE_INTERVAL:Number = 200;
public function FLVPlaybackClickArea(){
skinFailedToLoad = false;
controlsBar = null;
uiManagerAccess = null;
delayedResizeTimer = null;
super();
}
private function resize(_arg1:Event):void{
if (delayedResizeTimer == null){
delayedResizeTimer = new Timer(DELAYED_RESIZE_INTERVAL, 1);
delayedResizeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, delayedResize);
delayedResizeTimer.start();
};
}
override protected function computeHeight():Number{
var _local1:Number;
_local1 = playback.height;
if (skinFailedToLoad){
return (_local1);
};
if (controlsOutsideVideo()){
return (_local1);
};
if (controlsBar){
return ((controlsBar.y - 0.1));
};
return (_local1);
}
private function delayedResize(_arg1:Event):void{
delayedResizeTimer.stop();
delayedResizeTimer = null;
initClickArea();
}
private function controlsOutsideVideo():Boolean{
return ((controlsBar) ? (controlsBar.y >= playback.height) : true);
}
override public function setPlayback(_arg1:Object):void{
debug("setPlayback");
super.setPlayback(_arg1);
uiManagerAccess = new FLVPlaybackUIManagerAccess(_arg1);
if (isSkinReady()){
skinLoaded();
} else {
_arg1.addEventListener("skinLoaded", skinLoaded);
_arg1.addEventListener("skinError", skinError);
};
_arg1.addEventListener("resize", resize);
}
private function skinLoaded(_arg1:Event=null):void{
controlsBar = uiManagerAccess.getControlsBar();
initClickArea();
}
private function isSkinReady():Boolean{
return (uiManagerAccess.skinReady);
}
public function position():void{
}
private function skinError(_arg1:Event):void{
skinFailedToLoad = true;
initClickArea();
}
override public function destroy():void{
debug("destroy");
super.destroy();
playback.removeEventListener("skinLoaded", skinLoaded);
playback.removeEventListener("skinError", skinError);
playback.removeEventListener("resize", resize);
}
override protected function getAreaContainer():DisplayObjectContainer{
return (playback.getVideoPlayer(playback.activeVideoPlayerIndex).parent);
}
}
}//package com.doubleclick.adslot.flvplayback
Section 7
//FLVPlaybackManager (com.doubleclick.adslot.flvplayback.FLVPlaybackManager)
package com.doubleclick.adslot.flvplayback {
import com.doubleclick.adslot.*;
public interface FLVPlaybackManager extends VideoPlaybackManager {
function activateAdVideoPlayer(_arg1:String=null, _arg2:Number=-1):void;
}
}//package com.doubleclick.adslot.flvplayback
Section 8
//FLVPlaybackManagerImpl (com.doubleclick.adslot.flvplayback.FLVPlaybackManagerImpl)
package com.doubleclick.adslot.flvplayback {
import flash.display.*;
import com.doubleclick.adslot.*;
import com.doubleclick.adslot.logging.*;
import flash.events.*;
public class FLVPlaybackManagerImpl extends AbstractVideoPlaybackManager implements FLVPlaybackManager {
private var contentCompleteEvent:Event;
private var playback:Object;
private var contentAutoPlay:Boolean;
private var recordedClickToStartPlayingContent:Boolean;
private var contentPlayerAutoRewind:Boolean;
private var adVideoPlayerIndex:int;
private var originalAutoPlay:Boolean;
private var playButtonClicked:Boolean;
private var contentVideoVolume:Number;
private var adVideoVolume:Number;
private var contentReplayed:Boolean;
private var contentVideoPlayerIndexBeforeAdDisplay:int;
private var eventsSuppressor:EventsSuppressor;
public function FLVPlaybackManagerImpl(_arg1:Object, _arg2:EventsSuppressor){
this.playback = _arg1;
trackPlayButtonClick();
this.eventsSuppressor = _arg2;
contentVideoPlayerIndexBeforeAdDisplay = -1;
adVideoPlayerIndex = -1;
this.playback.addEventListener("stateChange", onStateChange);
this.playback.addEventListener("ready", onVideoPlayerReady);
this.eventsSuppressor.addEventListener("complete", onContentComplete);
this.eventsSuppressor.suppress("complete");
this.playback.addEventListener("scrubStart", onScrubStart);
this.playback.addEventListener("scrubFinish", onScrubFinish);
}
private function deactivateAdVideoPlayer():void{
playback.closeVideoPlayer(playback.activeVideoPlayerIndex);
}
override public function isAdPlaying():Boolean{
return ((adVideoPlayerIndex == playback.activeVideoPlayerIndex));
}
private function onScrubFinish(_arg1:Object):void{
debug("onScrubFinish");
if (!isAdPlaying()){
setSeekedTo(_arg1.playheadTime);
};
setSeeking(false);
}
private function onContentComplete(_arg1:Object):void{
debug(("onContentComplete event.vp = " + _arg1.vp));
if (_arg1.vp == contentVideoPlayerIndexBeforeAdDisplay){
contentCompleteEvent = (_arg1 as Event);
dispatchEvent(new VideoPlaybackEvent(VideoPlaybackEvent.CONTENT_COMPLETE));
};
}
override public function resumeContent():void{
debug("resumeContent");
playContent();
}
override public function setVideoOutput(_arg1:Object):void{
super.setVideoOutput(new FLVPlaybackProxy(_arg1));
}
override public function activateContent():void{
debug("activateContent");
eventsSuppressor.stopSuppressing();
deactivateAdVideoPlayer();
setPlaybackProperties(contentVideoPlayerIndexBeforeAdDisplay, adVideoVolume, contentPlayerAutoRewind, contentAutoPlay);
}
override public function pauseContent():void{
debug("pauseContent");
playback.pause();
}
override public function resetContentPlayheadPosition():void{
var _local1:Object;
debug("resetContentPlayheadPositionForReset");
_local1 = (isAdPlaying()) ? contentVideoPlayerIndexBeforeAdDisplay : playback.activeVideoPlayerIndex;
playback.getVideoPlayer(_local1).playheadTime = 0;
}
override public function playContent():void{
debug("playContent");
if (isAdPlaying()){
adVideoVolume = playback.getVideoPlayer(adVideoPlayerIndex).volume;
adVideoPlayerIndex = -1;
activateContent();
} else {
setPlaybackProperties(contentVideoPlayerIndexBeforeAdDisplay, contentVideoVolume, contentPlayerAutoRewind, contentAutoPlay);
};
debug(((("playback.autoPlay:" + playback.autoPlay) + " playButtonClicked:") + playButtonClicked));
if (((playback.autoPlay) || (playButtonClicked))){
debug("autoplay on content is true");
playback.play();
};
}
private function saveContentVideoPropertiesBeforeAdPlay():void{
contentVideoPlayerIndexBeforeAdDisplay = playback.activeVideoPlayerIndex;
contentVideoVolume = playback.getVideoPlayer(playback.activeVideoPlayerIndex).volume;
contentPlayerAutoRewind = playback.autoRewind;
contentAutoPlay = playback.autoPlay;
}
override public function isAutoPlay():Boolean{
return (playback.autoPlay);
}
private function onScrubStart(_arg1:Object):void{
debug("onScrubStart");
setSeeking(true);
}
private function setPlaybackProperties(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Boolean):void{
playback.activeVideoPlayerIndex = _arg1;
playback.visibleVideoPlayerIndex = _arg1;
playback.getVideoPlayer(_arg1).volume = _arg2;
playback.autoRewind = _arg3;
playback.autoPlay = _arg4;
}
private function onStateChange(_arg1:Object):void{
if (_arg1.state == "loading"){
playback.removeEventListener("stateChange", onStateChange);
createEmptyVideoPlayer();
};
}
private function onVideoPlayerReady(_arg1:Event):void{
debug("onVideoPlayerReady");
playback.removeEventListener("ready", onVideoPlayerReady);
playback.pause();
saveContentVideoPropertiesBeforeAdPlay();
dispatchEvent(new VideoPlaybackEvent(VideoPlaybackEvent.BEFORE_CONTENT_PLAY));
}
private function createEmptyVideoPlayer():void{
var _local1:uint;
_local1 = 1;
while (playback.getVideoPlayer(_local1) != undefined) {
_local1++;
};
playback.visibleVideoPlayerIndex = _local1;
}
override public function getContentPlayheadPosition():Number{
var _local1:Object;
_local1 = (isAdPlaying()) ? contentVideoPlayerIndexBeforeAdDisplay : playback.activeVideoPlayerIndex;
return (playback.getVideoPlayer(_local1).playheadTime);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
private function trackPlayButtonClick():void{
debug("trackPlayButtonClick");
debug(("playback.playButton:" + playback.playButton));
if (playback.playButton){
playback.playButton.addEventListener(MouseEvent.CLICK, onPlayButtonClick);
} else {
playback.addEventListener("skinLoaded", skinLoaded);
};
}
private function skinLoaded(_arg1:Event):void{
debug("skinLoaded");
playback.removeEventListener("skinLoaded", skinLoaded);
trackPlayButtonClick();
}
private function onPlayForResetAd(_arg1:Event):void{
debug("onPlayForResetAd");
playback.playButton.removeEventListener(MouseEvent.CLICK, onPlayForResetAd);
dispatchEvent(new VideoPlaybackEvent(VideoPlaybackEvent.BEFORE_CONTENT_PLAY));
playButtonClicked = true;
dispatchEvent(new Event("onPlay"));
}
override public function hitTestObject(_arg1:AdSlot):Boolean{
return (_arg1.hitTestObject((playback as DisplayObject)));
}
public function activateAdVideoPlayer(_arg1:String=null, _arg2:Number=-1):void{
debug("activateAdVideoPlayer");
eventsSuppressor.suppress();
saveContentVideoPropertiesBeforeAdPlay();
playback.getVideoPlayer(contentVideoPlayerIndexBeforeAdDisplay).pause();
adVideoPlayerIndex = 1;
while (playback.getVideoPlayer(adVideoPlayerIndex) != undefined) {
adVideoPlayerIndex++;
};
setPlaybackProperties(adVideoPlayerIndex, contentVideoVolume, true, contentAutoPlay);
if (((((!(contentAutoPlay)) || (contentReplayed))) && ((_arg2 == AdTiming.ON_PREROLL)))){
playback.source = _arg1;
};
debug(("created ad video player at index:" + adVideoPlayerIndex));
}
override public function resetIfContentReplayed(_arg1:uint=0):void{
debug(("resetIfContentReplayed = " + _arg1));
playButtonClicked = false;
contentReplayed = true;
eventsSuppressor.suppress("complete");
if (((_arg1) && ((_arg1 == AdTiming.ON_PREROLL)))){
originalAutoPlay = playback.autoPlay;
playback.autoPlay = false;
dispatchEvent(new VideoPlaybackEvent(VideoPlaybackEvent.BEFORE_CONTENT_PLAY));
playback.playButton.addEventListener(MouseEvent.CLICK, onPlayButtonClick);
} else {
playback.playButton.addEventListener(MouseEvent.CLICK, onPlayForResetAd);
};
saveContentVideoPropertiesBeforeAdPlay();
}
public function onPlayButtonClick(_arg1:Event):void{
playback.playButton.removeEventListener(MouseEvent.CLICK, onPlayButtonClick);
playButtonClicked = true;
if (contentReplayed){
playback.autoPlay = originalAutoPlay;
};
dispatchEvent(new Event("onPlay"));
}
override public function dispatchContentComplete():void{
debug("dispatchContentComplete");
playback.dispatchEvent(contentCompleteEvent);
setSeekedTo(0);
}
}
}//package com.doubleclick.adslot.flvplayback
Section 9
//FLVPlaybackProxy (com.doubleclick.adslot.flvplayback.FLVPlaybackProxy)
package com.doubleclick.adslot.flvplayback {
import flash.utils.*;
public dynamic class FLVPlaybackProxy extends Proxy {
private var flvplayback:Object;// = null
public function FLVPlaybackProxy(_arg1:Object){
flvplayback = null;
super();
this.flvplayback = _arg1;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (flvplayback[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
return (flvplayback.hasOwnProperty(_arg1.toString()));
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function callProperty(_arg1, ... _args){
var results:*;
var type:String;
var listener:Function;
var useCapture:Boolean;
var priority:int;
var useWeakReference:Boolean;
var methodName = _arg1;
var args = _args;
try {
switch (methodName.toString()){
case "addEventListener":
type = args[0];
listener = args[1];
useCapture = ((args.length > 2)) ? args[2] : false;
priority = EventsSuppressor.getHigherListenerPriority();
useWeakReference = ((args.length > 4)) ? args[4] : false;
flvplayback[methodName].apply(flvplayback, [type, listener, useCapture, priority, useWeakReference]);
break;
default:
results = flvplayback[methodName].apply(flvplayback, args);
break;
};
return (results);
} catch(error:Error) {
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
flvplayback[_arg1] = _arg2;
}
}
}//package com.doubleclick.adslot.flvplayback
Section 10
//FLVPlaybackUIManagerAccess (com.doubleclick.adslot.flvplayback.FLVPlaybackUIManagerAccess)
package com.doubleclick.adslot.flvplayback {
import flash.display.*;
import com.doubleclick.adslot.common.*;
public class FLVPlaybackUIManagerAccess {
private var uiManager:Object;// = null
private static var namespace:Namespace = RuntimeDefinitions.getFLVPlaybackNamespace();
public function FLVPlaybackUIManagerAccess(_arg1:Object):void{
var _local2:QName;
uiManager = null;
super();
_local2 = new QName(namespace, "uiMgr");
uiManager = _arg1[_local2];
}
public function get skinReady():Boolean{
return (uiManager.skinReady);
}
private function debug(_arg1:String):void{
}
private function getProperty(_arg1:String):Object{
return (uiManager[new QName(namespace, _arg1)]);
}
public function getControlsBar():DisplayObject{
var _local1:DisplayObjectContainer;
_local1 = (getProperty("skin_mc") as DisplayObjectContainer);
if (((_local1) && ((_local1.numChildren > 3)))){
return (_local1.getChildAt(3));
};
return (null);
}
}
}//package com.doubleclick.adslot.flvplayback
Section 11
//UIManagerAccess (com.doubleclick.adslot.flvplayback.UIManagerAccess)
package com.doubleclick.adslot.flvplayback {
import com.doubleclick.adslot.*;
import com.doubleclick.adslot.logging.*;
import flash.events.*;
public class UIManagerAccess {
private var uiManager:Object;// = null
private var handleEventFunction:Function;// = null
private static var namespace:Namespace = RuntimeDefinitions.getFLVPlaybackNamespace();
public function UIManagerAccess(_arg1:Object):void{
var _local2:QName;
uiManager = null;
handleEventFunction = null;
super();
if (namespace){
_local2 = new QName(namespace, "uiMgr");
uiManager = _arg1[_local2];
handleEventFunction = uiManager[new QName(namespace, "handleIVPEvent")];
debug(("ui manager:" + uiManager));
debug(("handle event:" + handleEventFunction));
};
}
public function handleIVPEvent(_arg1:Event):void{
handleEventFunction.call(uiManager, _arg1);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
}
}//package com.doubleclick.adslot.flvplayback
Section 12
//Appender (com.doubleclick.adslot.logging.Appender)
package com.doubleclick.adslot.logging {
public interface Appender {
function get type():String;
function append(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:String="", _arg5:int=0):void;
}
}//package com.doubleclick.adslot.logging
Section 13
//FirebugConsoleAppender (com.doubleclick.adslot.logging.FirebugConsoleAppender)
package com.doubleclick.adslot.logging {
import flash.external.*;
public class FirebugConsoleAppender implements Appender {
public static const TYPE:String = "firebug";
public function append(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:String="", _arg5:int=0):void{
var firebugLogFunctionCall:String;
var safeForJs:String;
var loggingLevel = _arg1;
var message = _arg2;
var source = _arg3;
var method = _arg4;
var lineNumber = _arg5;
if (ExternalInterface.available){
firebugLogFunctionCall = (("function() {" + "if (typeof console != 'undefined' && ") + "typeof console.firebug != 'undefined') console.log('");
safeForJs = Message.format(loggingLevel, message, source, method, lineNumber).replace("\\", "\\\\").replace("\n", "\\n").replace("'", "\\'");
firebugLogFunctionCall = (firebugLogFunctionCall + (safeForJs + "');}"));
try {
ExternalInterface.call(firebugLogFunctionCall);
} catch(error:Error) {
};
};
}
public function get type():String{
return (TYPE);
}
}
}//package com.doubleclick.adslot.logging
Section 14
//FlashTraceAppender (com.doubleclick.adslot.logging.FlashTraceAppender)
package com.doubleclick.adslot.logging {
public class FlashTraceAppender implements Appender {
public static const TYPE:String = "flashTrace";
public function append(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:String="", _arg5:int=0):void{
trace(Message.format(_arg1, _arg2, _arg3, _arg4, _arg5));
}
public function get type():String{
return (TYPE);
}
}
}//package com.doubleclick.adslot.logging
Section 15
//Logger (com.doubleclick.adslot.logging.Logger)
package com.doubleclick.adslot.logging {
public class Logger {
private var logLevel:int;// = 0
private var loggingEnabled:Boolean;// = true
private var appenders:Array;
private static const LOGGING_LEVEL_NAMES:Array = ["DEBUG", "INFO", "WARNING", "ERROR", "FATAL"];
public static const FATAL:int = 4;
public static const ERROR:int = 3;
public static const INFO:int = 1;
public static const DEBUG:int = 0;
public static const WARNING:int = 2;
private static var instance:Logger = null;
public function Logger(_arg1:ForceSingleton){
logLevel = DEBUG;
loggingEnabled = true;
appenders = [];
super();
}
public static function set logLevel(_arg1:int):void{
Logger.getLogger().logLevel = _arg1;
}
public static function fatal(_arg1:String, _arg2:Object=null, _arg3:String="", _arg4:int=0):void{
Logger.log(FATAL, _arg1, _arg2, _arg3, _arg4);
}
private static function getLogger():Logger{
if (instance == null){
instance = new Logger(new ForceSingleton());
};
return (instance);
}
private static function log(_arg1:int, _arg2:String, _arg3:Object=null, _arg4:String="", _arg5:int=0):void{
var _local6:int;
var _local7:Appender;
if (Logger.getLogger().loggingEnabled){
if (Logger.getLogger().logLevel <= _arg1){
_local6 = 0;
while (_local6 < Logger.getLogger().appenders.length) {
_local7 = Logger.getLogger().appenders[_local6];
_local7.append(Logger.logLevelToString(_arg1), _arg2, _arg3, _arg4, _arg5);
_local6++;
};
};
};
}
public static function error(_arg1:String, _arg2:Object=null, _arg3:String="", _arg4:int=0):void{
Logger.log(ERROR, _arg1, _arg2, _arg3, _arg4);
}
public static function debug(_arg1:String, _arg2:Object=null, _arg3:String="", _arg4:int=0):void{
Logger.log(DEBUG, _arg1, _arg2, _arg3, _arg4);
}
public static function addAppender(_arg1:Appender):void{
Logger.getLogger().appenders.push(_arg1);
}
public static function warning(_arg1:String, _arg2:Object=null, _arg3:String="", _arg4:int=0):void{
Logger.log(WARNING, _arg1, _arg2, _arg3, _arg4);
}
private static function logLevelToString(_arg1:int):String{
if ((((_arg1 >= 0)) && ((_arg1 < LOGGING_LEVEL_NAMES.length)))){
return (LOGGING_LEVEL_NAMES[_arg1]);
};
return (null);
}
public static function configure(_arg1:Object):void{
var _local2:String;
var _local3:String;
for (_local2 in _arg1) {
if (_local2 == "logLevel"){
Logger.getLogger().logLevel = parseInt(_arg1[_local2]);
};
if (_local2 == "appender"){
_local3 = _arg1[_local2];
if (_local3 == FirebugConsoleAppender.TYPE){
Logger.addAppender(new FirebugConsoleAppender());
};
};
if (_local2 == "log"){
Logger.logEnabled = Boolean(_arg1[_local2]);
};
};
}
public static function info(_arg1:String, _arg2:Object=null, _arg3:String="", _arg4:int=0):void{
Logger.log(INFO, _arg1, _arg2, _arg3, _arg4);
}
public static function set logEnabled(_arg1:Boolean):void{
Logger.getLogger().loggingEnabled = _arg1;
}
public static function configureDefault():void{
Logger.getLogger().logLevel = DEBUG;
Logger.addAppender(new FirebugConsoleAppender());
Logger.addAppender(new FlashTraceAppender());
Logger.logEnabled = true;
}
}
}//package com.doubleclick.adslot.logging
class ForceSingleton {
private function ForceSingleton(){
}
}
Section 16
//Message (com.doubleclick.adslot.logging.Message)
package com.doubleclick.adslot.logging {
import flash.utils.*;
public class Message {
public static function format(_arg1:String, _arg2:String, _arg3:Object, _arg4:String="", _arg5:int=0):String{
var _local6:String;
var _local7:XML;
var _local8:String;
var _local9:Array;
_local6 = "";
if (_arg3){
_local7 = describeType(_arg3);
_local8 = _local7..@name[0].toString();
_local9 = _local8.split("::");
if (_local9.length > 1){
_local6 = _local9[1];
} else {
_local6 = _local9[0];
};
};
return (((((((_arg1 + ">") + _local6) + ":") + _arg4) + ":") + _arg2));
}
}
}//package com.doubleclick.adslot.logging
Section 17
//InterceptedNetStream (com.doubleclick.adslot.netstream.InterceptedNetStream)
package com.doubleclick.adslot.netstream {
import flash.media.*;
public interface InterceptedNetStream {
function nativeSetSoundTransform(_arg1:SoundTransform):void;
function nativeClose():void;
function nativeTogglePause():void;
function nativeResume():void;
function nativePlay(... _args):void;
function nativePause():void;
function nativeSeek(_arg1:Number):void;
}
}//package com.doubleclick.adslot.netstream
Section 18
//NetStreamVideoClickArea (com.doubleclick.adslot.netstream.NetStreamVideoClickArea)
package com.doubleclick.adslot.netstream {
import flash.display.*;
import com.doubleclick.adslot.*;
public class NetStreamVideoClickArea extends ClickArea {
override protected function computeHeight():Number{
return (playback.height);
}
override protected function positionJustAboveVideo():void{
var _local1:int;
_local1 = 0;
while (_local1 < getAreaContainer().numChildren) {
if (getAreaContainer().getChildAt(_local1) == playback){
getAreaContainer().setChildIndex(area, (_local1 + 1));
break;
};
_local1++;
};
}
override protected function get x():Number{
return (playback.x);
}
override protected function get y():Number{
return (playback.y);
}
override protected function getAreaContainer():DisplayObjectContainer{
return (playback.parent);
}
}
}//package com.doubleclick.adslot.netstream
Section 19
//NetStreamVideoPlaybackManager (com.doubleclick.adslot.netstream.NetStreamVideoPlaybackManager)
package com.doubleclick.adslot.netstream {
import com.doubleclick.adslot.*;
import flash.media.*;
public interface NetStreamVideoPlaybackManager extends VideoPlaybackManager {
function togglePause():void;
function close():void;
function activateNetStream(_arg1:Object):void;
function play(... _args):void;
function setSoundTransform(_arg1:SoundTransform):void;
function activateAdNetStream(_arg1:Object):void;
function resume():void;
function pause():void;
function seek(_arg1:Number):void;
}
}//package com.doubleclick.adslot.netstream
Section 20
//NetStreamVideoPlaybackManagerImpl (com.doubleclick.adslot.netstream.NetStreamVideoPlaybackManagerImpl)
package com.doubleclick.adslot.netstream {
import flash.display.*;
import com.doubleclick.adslot.*;
import com.doubleclick.adslot.logging.*;
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class NetStreamVideoPlaybackManagerImpl extends AbstractVideoPlaybackManager implements NetStreamVideoPlaybackManager {
private var contentNetStream:NetStream;
private var activeNetStream:Object;
private var publisherVideoCompleted:Boolean;
private var paused:Boolean;
private var contentCompleteFired:Boolean;
private var contentNSEmptyFired:Boolean;
private var timer:Timer;
private var contentStopEvent:Event;
private var jwPlayerInstance:Object;
private var playInvokedAtLeastOnce:Boolean;
private var firedOnceForStreamingContentStart:Boolean;
private var streamingContentPlayed:Boolean;
private var video:Video;
private var contentEmptyEvent:Event;
private var adNetStream:Object;
private var streamingContent:Boolean;
private var contentNSStopFired:Boolean;
private var contentPlayArgs:Array;
private static const SUPPRESSOR_LISTENER_PRIORITY:int = int((int.MAX_VALUE / 2));
public function togglePause():void{
debug("togglePause");
if (!isAdPlaying()){
activeNetStream.nativeTogglePause();
} else {
activeNetStream.togglePause();
};
paused = !(paused);
}
private function onContentComplete():void{
var _local1:VideoPlaybackEvent;
debug("removing listeners");
contentNetStream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStreamStatusChange);
contentCompleteFired = true;
contentNSEmptyFired = false;
contentNSStopFired = false;
_local1 = new VideoPlaybackEvent(VideoPlaybackEvent.CONTENT_COMPLETE);
dispatchEvent(_local1);
}
override public function activateContent():void{
adNetStream = null;
activeNetStream = contentNetStream;
getVideoOutput().attachNetStream(activeNetStream);
}
public function close():void{
debug("close");
if (!isAdPlaying()){
debug("Inside no ad playing");
activeNetStream.nativeClose();
} else {
debug("Inside ad playing");
activeNetStream.close();
};
paused = false;
}
public function setSoundTransform(_arg1:SoundTransform):void{
if (adNetStream){
adNetStream.soundTransform = _arg1;
};
}
override public function getNetStreamTime():Number{
if (jwPlayerInstance){
if (!isAdPlaying()){
return ((activeNetStream.nativeTime() - 0.05));
};
return (0.001);
};
if (!isAdPlaying()){
return (activeNetStream.nativeTime());
};
return (activeNetStream.time);
}
public function resume():void{
debug("resume");
if (!isAdPlaying()){
debug("resuming content");
activeNetStream.nativeResume();
} else {
debug(("resuming ad" + activeNetStream));
activeNetStream.resume();
};
paused = false;
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
override public function getNetStreamBufferTime():Number{
if (!isAdPlaying()){
return (activeNetStream.nativeBufferTime());
};
return (activeNetStream.bufferTime);
}
public function play(... _args):void{
var _local2:VideoPlaybackEvent;
debug(("play..." + isAdPlaying()));
if (!playInvokedAtLeastOnce){
playInvokedAtLeastOnce = true;
contentNetStream.seek(0);
};
debug(("jwPlayerInstance = " + jwPlayerInstance));
if (paused){
resume();
} else {
debug("play invoked and video was not paused");
_local2 = null;
if (!isAdPlaying()){
debug("ad is not playing");
contentPlayArgs = _args;
if ((((contentPlayArgs[0].indexOf("http://") > -1)) || ((contentPlayArgs[0].indexOf("https://") > -1)))){
contentNetStream.nativePause();
_local2 = new VideoPlaybackEvent(VideoPlaybackEvent.BEFORE_CONTENT_PLAY);
dispatchEvent(_local2);
} else {
contentNetStream.nativePlay.apply(contentNetStream, contentPlayArgs);
streamingContentPlayed = true;
streamingContent = true;
};
} else {
_local2 = new VideoPlaybackEvent(VideoPlaybackEvent.BEFORE_AD_PLAY);
dispatchEvent(_local2);
};
};
}
override public function hitTestObject(_arg1:AdSlot):Boolean{
return (_arg1.hitTestObject((getVideoOutput() as DisplayObject)));
}
public function seek(_arg1:Number):void{
debug("seek is called");
if (!isAdPlaying()){
setSeekedTo(_arg1);
activeNetStream.nativeSeek(_arg1);
};
}
override public function isAdPlaying():Boolean{
return (((!((activeNetStream == null))) && ((activeNetStream === adNetStream))));
}
override public function resumeContent():void{
activateContent();
activeNetStream.nativeResume();
paused = false;
}
override public function pauseContent():void{
contentNetStream.nativePause();
paused = true;
}
override public function resetContentPlayheadPosition():void{
}
override public function playContent():void{
debug("playContent");
if (playInvokedAtLeastOnce){
activateContent();
debug(((("activeNetStream = " + activeNetStream) + " contentPlayArgs = ") + contentPlayArgs));
if (!streamingContentPlayed){
activeNetStream.nativePlay.apply(activeNetStream, contentPlayArgs);
activeNetStream.nativePlay(contentPlayArgs);
} else {
debug("Resuming content");
activeNetStream.resume();
};
paused = false;
};
}
override public function getNetStreamBufferLength():Number{
if (!isAdPlaying()){
return (activeNetStream.nativeBufferLength());
};
return (activeNetStream.bufferLength);
}
override public function isNetStreamPlayback():Boolean{
return (true);
}
public function activateAdNetStream(_arg1:Object):void{
adNetStream = _arg1;
activeNetStream = adNetStream;
applyContentVolumeToAd();
}
override public function getContentPlayheadPosition():Number{
return (contentNetStream.nativeTime());
}
private function applyContentVolumeToAd():void{
adNetStream.soundTransform = contentNetStream.soundTransform;
}
override public function isAutoPlay():Boolean{
return (true);
}
private function onNetStreamStatusChange(_arg1:NetStatusEvent):void{
debug(("Listening for NetStreamStatusChange = " + _arg1.info.code));
if ((((((_arg1.info.code == "NetStream.Play.Start")) && (streamingContent))) && (!(firedOnceForStreamingContentStart)))){
debug("Inside...");
firedOnceForStreamingContentStart = true;
activeNetStream.nativePause();
dispatchEvent(new VideoPlaybackEvent(VideoPlaybackEvent.BEFORE_CONTENT_PLAY));
};
if (((contentNSStopFired) && ((_arg1.info.code == "NetStream.Buffer.Empty")))){
contentEmptyEvent = _arg1;
_arg1.stopImmediatePropagation();
contentNSEmptyFired = true;
};
if (_arg1.info.code == "NetStream.Play.Stop"){
contentStopEvent = _arg1;
_arg1.stopImmediatePropagation();
contentNSStopFired = true;
};
if (((((((streamingContent) && (contentNSEmptyFired))) && (contentNSStopFired))) && (!(contentCompleteFired)))){
onContentComplete();
} else {
if (((((!(streamingContent)) && (contentNSStopFired))) && (!(contentCompleteFired)))){
debug("calling contentComplete");
onContentComplete();
};
};
}
public function activateNetStream(_arg1:Object):void{
debug("activateNetStream");
contentNetStream = (_arg1 as NetStream);
if (!contentCompleteFired){
contentNetStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStreamStatusChange, false, SUPPRESSOR_LISTENER_PRIORITY);
};
if (!isAdPlaying()){
debug("publisher netstream is about to play, saving it");
activeNetStream = contentNetStream;
};
}
override public function isSeeking():Boolean{
return (false);
}
override public function setJWPlayer(_arg1:Object):void{
this.jwPlayerInstance = _arg1;
}
override public function resetIfContentReplayed(_arg1:uint=0):void{
debug("resetIfContentReplayed");
contentCompleteFired = false;
playInvokedAtLeastOnce = false;
}
public function pause():void{
debug(("pause = " + (activeNetStream == adNetStream)));
if (!isAdPlaying()){
activeNetStream.nativePause();
} else {
activeNetStream.pause();
};
paused = true;
}
override public function dispatchContentComplete():void{
debug("dispatchContentComplete");
contentNetStream.dispatchEvent((contentStopEvent as NetStatusEvent));
}
}
}//package com.doubleclick.adslot.netstream
Section 21
//AdUnitValidator (com.doubleclick.adslot.validation.AdUnitValidator)
package com.doubleclick.adslot.validation {
import com.doubleclick.adslot.*;
public class AdUnitValidator {
private var startTimeConflictMap:Object;// = null
public function AdUnitValidator(){
startTimeConflictMap = null;
super();
this.startTimeConflictMap = {};
}
public function isValid(_arg1:Number, _arg2:Object):Boolean{
var _local3:Boolean;
_local3 = true;
if (_arg1 == AdTiming.ON_MIDROLL){
_local3 = NumberValidator.isPositiveNumber(_arg2.startTime);
};
return (((((UrlValidator.isHttpUrl(_arg2.url)) && (!(hasStartTimeConflict(_arg2.startTime))))) && (_local3)));
}
public function validateDependantInputs(_arg1:Object, _arg2:Array, _arg3:Object):Object{
var validPreroll:Object;
var validMidrolls:Array;
var i:int;
var comparator:Function;
var validPostroll:Object;
var midroll:Object;
var preroll = _arg1;
var midrolls = _arg2;
var postroll = _arg3;
validateMasterCompanions(preroll, midrolls, postroll);
validPreroll = null;
if (((preroll) && (preroll.valid))){
validPreroll = preroll;
};
validMidrolls = [];
i = 0;
while (i < midrolls.length) {
midroll = midrolls[i];
if (midroll.valid){
validMidrolls.push(midroll);
};
i = (i + 1);
};
comparator = function (_arg1:Object, _arg2:Object):Number{
var _local3:Number;
var _local4:Number;
_local3 = _arg1.startTime;
_local4 = _arg2.startTime;
if (_local3 < _local4){
return (-1);
};
if (_local3 > _local4){
return (1);
};
return (0);
};
validMidrolls = validMidrolls.sort(comparator);
validPostroll = null;
if (((postroll) && (postroll.valid))){
validPostroll = postroll;
};
validateDurationInputs(validPreroll, validMidrolls, validPostroll);
validateMasterCompanions(validPreroll, validMidrolls, validPostroll);
return ({preroll:validPreroll, midrolls:validMidrolls, postroll:validPostroll});
}
public function validateDurationInputs(_arg1:Object, _arg2:Array, _arg3:Object):void{
var _local4:Number;
var _local5:int;
var _local6:Object;
_local4 = 0;
if (((_arg1) && (_arg1.overlay))){
_local4 = _arg1.duration;
};
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (_local4 >= _local6.startTime){
_local6.valid = false;
};
if (_local6.overlay){
_local4 = Math.max(_local4, (_local6.startTime + _local6.duration));
};
_local5++;
};
}
public function validateMasterCompanions(_arg1:Object, _arg2:Array, _arg3:Object):void{
var _local4:Array;
var _local5:int;
var _local6:Object;
var _local7:int;
var _local8:Object;
_local4 = RoadblocksManager.relateMastersAndCompanions(_arg1, _arg2, _arg3);
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5];
if (!_local6.valid){
_local7 = 0;
while (_local7 < _local6.companions.length) {
_local8 = _local6.companions[_local7];
_local8.valid = false;
_local7++;
};
};
_local5++;
};
}
private function hasStartTimeConflict(_arg1:Number):Boolean{
var _local2:String;
_local2 = (_arg1 + "");
if (startTimeConflictMap[_local2]){
return (true);
};
startTimeConflictMap[_local2] = _local2;
return (false);
}
}
}//package com.doubleclick.adslot.validation
Section 22
//NumberValidator (com.doubleclick.adslot.validation.NumberValidator)
package com.doubleclick.adslot.validation {
public class NumberValidator {
public static function isNumberGreaterThan(_arg1:Object, _arg2:Number):Boolean{
return (((isNumber(_arg1)) && ((_arg1 > _arg2))));
}
public static function isNumber(_arg1:Object):Boolean{
var _local2:Number;
_local2 = (_arg1 as Number);
return (((_local2 | 0) === _local2));
}
public static function isPositiveNumber(_arg1:Object):Boolean{
return (((isNumber(_arg1)) && ((_arg1 > 0))));
}
}
}//package com.doubleclick.adslot.validation
Section 23
//StringValidator (com.doubleclick.adslot.validation.StringValidator)
package com.doubleclick.adslot.validation {
public class StringValidator {
public static function isNonEmpty(_arg1:Object):Boolean{
return (((Boolean(_arg1)) && (!((_arg1 == "undefined")))));
}
}
}//package com.doubleclick.adslot.validation
Section 24
//UrlValidator (com.doubleclick.adslot.validation.UrlValidator)
package com.doubleclick.adslot.validation {
public class UrlValidator {
public static function isHttpUrl(_arg1:Object):Boolean{
return (((StringValidator.isNonEmpty(_arg1)) && ((_arg1.indexOf("http://") == 0))));
}
}
}//package com.doubleclick.adslot.validation
Section 25
//AbstractAdDisplay (com.doubleclick.adslot.AbstractAdDisplay)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
public class AbstractAdDisplay extends EventDispatcher implements AdDisplay {
private var videoPlaybackManager:VideoPlaybackManager;// = null
private var overlayExpected:Boolean;// = false
private var companionSlot:Boolean;// = false
private var currentlyDisplayed:Boolean;// = false
private var adUnit:AdUnit;// = null
private var maskControl:MaskControl;// = null
private var adsManager:AdsManager;// = null
protected var displayObjectContainer:Sprite;// = null
public function AbstractAdDisplay(_arg1:AdsManager, _arg2:VideoPlaybackManager, _arg3:Sprite=null){
adsManager = null;
currentlyDisplayed = false;
maskControl = null;
videoPlaybackManager = null;
overlayExpected = false;
companionSlot = false;
displayObjectContainer = null;
adUnit = null;
super();
this.adsManager = _arg1;
this.videoPlaybackManager = _arg2;
this.displayObjectContainer = _arg3;
}
public function displayAd(_arg1:Number):void{
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function setIsCurrentSlotCompanion(_arg1:Boolean):void{
this.companionSlot = _arg1;
}
public function getVideoPlaybackManager():VideoPlaybackManager{
return (videoPlaybackManager);
}
public function setMaskControl(_arg1:MaskControl):void{
this.maskControl = _arg1;
}
public function setVideoPlaybackManager(_arg1:VideoPlaybackManager):void{
this.videoPlaybackManager = _arg1;
}
public function isCurrentlyDisplayed():Boolean{
return (currentlyDisplayed);
}
public function clearDisplay():void{
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function getMaskControl():MaskControl{
return (maskControl);
}
public function setCurrentlyDisplayed(_arg1:Boolean):void{
this.currentlyDisplayed = _arg1;
}
public function setAdUnit(_arg1:AdUnit):void{
this.adUnit = _arg1;
}
public function playPreroll():void{
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function getAdsManager():AdsManager{
return (adsManager);
}
public function getAdUnit():AdUnit{
return (adUnit);
}
public function getDisplayObjectContainer():Sprite{
return (displayObjectContainer);
}
public function requiresContentPausing():Boolean{
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function isAutoPlay(_arg1:Number):Boolean{
if ((((videoPlaybackManager.isAutoPlay() == false)) && ((_arg1 == AdTiming.ON_PREROLL)))){
return (false);
};
return (true);
}
public function setIsOverlayExpected(_arg1:Boolean):void{
this.overlayExpected = _arg1;
}
protected function notifyAboutAdDisplayStart():void{
var _local1:AdUnitEvent;
_local1 = new AdUnitEvent(AdUnitEvent.AD_DISPLAY_START);
dispatchEvent(_local1);
}
public function getIsOverlayExpected():Boolean{
return (overlayExpected);
}
public function isImage():Boolean{
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function isStaticResource():Boolean{
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function getIsCurrentSlotCompanion():Boolean{
return (companionSlot);
}
}
}//package com.doubleclick.adslot
Section 26
//AbstractDisplayModel (com.doubleclick.adslot.AbstractDisplayModel)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
public class AbstractDisplayModel extends EventDispatcher {
private var adsManager:AdsManager;// = null
public function AbstractDisplayModel(_arg1:AdsManager){
adsManager = null;
super();
this.adsManager = _arg1;
}
public function getAdsManager():AdsManager{
return (adsManager);
}
public function isTimeBased():Boolean{
return (false);
}
public function start():void{
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function clearDisplay():void{
}
public function onModelConversion():void{
}
}
}//package com.doubleclick.adslot
Section 27
//AbstractVideoPlaybackManager (com.doubleclick.adslot.AbstractVideoPlaybackManager)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import flash.events.*;
public class AbstractVideoPlaybackManager extends EventDispatcher implements VideoPlaybackManager {
private var videoOutput:Object;// = null
private var seeking:Boolean;// = false
private var seekedTo:Number;// = 0
public function AbstractVideoPlaybackManager(){
seekedTo = 0;
seeking = false;
videoOutput = null;
super();
}
public function resetIfContentReplayed(_arg1:uint=0):void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function isAdPlaying():Boolean{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function resumeContent():void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function setSeekedTo(_arg1:Number):void{
this.seekedTo = _arg1;
}
public function setVideoOutput(_arg1:Object):void{
this.videoOutput = _arg1;
}
public function activateContent():void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function pauseContent():void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function getVideoOutput():Object{
return (videoOutput);
}
public function resetContentPlayheadPosition():void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function setSeeking(_arg1:Boolean):void{
this.seeking = _arg1;
}
public function playContent():void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function getNetStreamBufferLength():Number{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function isNetStreamPlayback():Boolean{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function getNetStreamTime():Number{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function getContentPlayheadPosition():Number{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function getNetStreamBufferTime():Number{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function isSeeking():Boolean{
return (seeking);
}
public function getSeekedTo():Number{
return (seekedTo);
}
public function hitTestObject(_arg1:AdSlot):Boolean{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function setJWPlayer(_arg1:Object):void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function isAutoPlay():Boolean{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
public function dispatchContentComplete():void{
trace("Method not implemented in child class. It should be overriden.");
throw (new Error(("Method not implemented in child class. It should be " + "overriden.")));
}
}
}//package com.doubleclick.adslot
Section 28
//AdDisplay (com.doubleclick.adslot.AdDisplay)
package com.doubleclick.adslot {
import flash.events.*;
public interface AdDisplay extends IEventDispatcher {
function setIsOverlayExpected(_arg1:Boolean):void;
function getIsCurrentSlotCompanion():Boolean;
function displayAd(_arg1:Number):void;
function requiresContentPausing():Boolean;
function setAdUnit(_arg1:AdUnit):void;
function isCurrentlyDisplayed():Boolean;
function setIsCurrentSlotCompanion(_arg1:Boolean):void;
function isImage():Boolean;
function isStaticResource():Boolean;
function setMaskControl(_arg1:MaskControl):void;
function getIsOverlayExpected():Boolean;
function getMaskControl():MaskControl;
function clearDisplay():void;
}
}//package com.doubleclick.adslot
Section 29
//AdLoadCompleteEvent (com.doubleclick.adslot.AdLoadCompleteEvent)
package com.doubleclick.adslot {
import com.google.ads.instream.api.*;
import flash.events.*;
public class AdLoadCompleteEvent extends Event {
private var adsManager:AdsManager;// = null
public static const F2F_ADS_LOADED:String = "f2fAdsLoaded";
public static const CUSTOM_ADS_LOADED:String = "customAdsLoaded";
public static const VIDEO_ADS_LOADED:String = "videoAdsLoaded";
public function AdLoadCompleteEvent(_arg1:String, _arg2:AdsManager){
adsManager = null;
super(_arg1);
this.adsManager = _arg2;
}
public function getAdsManager():AdsManager{
return (adsManager);
}
override public function clone():Event{
return (new AdLoadCompleteEvent(type, adsManager));
}
}
}//package com.doubleclick.adslot
Section 30
//AdLoader (com.doubleclick.adslot.AdLoader)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import com.doubleclick.adslot.common.*;
public class AdLoader extends EventDispatcher {
private var adRequested:Boolean;// = false
private var adLoading:Boolean;// = false
private var adsManager:AdsManager;// = null
private var sdkLoaded:Boolean;// = false
private var adsLoader:AdsLoader;// = null
private var delayImpression:Boolean;// = true
private var adsRequest:AdsRequest;// = null
public function AdLoader(_arg1:AdsRequest){
adsLoader = null;
adsRequest = null;
adRequested = false;
adLoading = false;
sdkLoaded = false;
delayImpression = true;
adsManager = null;
super();
this.adsRequest = _arg1;
initializeAdTag(_arg1.adTagUrl);
}
public function setAdTagURL(_arg1:String):void{
if (!adLoading){
initializeAdTag(_arg1);
};
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function setAlignmentForAdsRequest(_arg1:VideoPlaybackManager):void{
adsRequest.adSlotHorizontalAlignment = AdSlotAlignment.getHorizontalAlignment(AdSlot.getInstance(), _arg1);
adsRequest.adSlotVerticalAlignment = AdSlotAlignment.getVerticalAlignment(AdSlot.getInstance(), _arg1);
}
private function attachAdLoadListeners():void{
adsLoader.addEventListener(AdsLoadedEvent.ADS_LOADED, onAdsLoaded);
adsLoader.addEventListener(AdErrorEvent.AD_ERROR, onError);
}
public function setAdsLoader(_arg1:AdsLoader):void{
debug("setAdsLoader");
this.adsLoader = _arg1;
if (adRequested){
debug("ad was requested");
adRequested = false;
loadAd();
};
}
public function set delayedImpression(_arg1:Boolean):void{
delayImpression = _arg1;
}
private function initializeAdTag(_arg1:String):void{
if (_arg1.indexOf("ord=") == -1){
if (_arg1.lastIndexOf(";") != (_arg1.length - 1)){
_arg1 = (_arg1 + ";");
};
_arg1 = (_arg1 + ("ord=" + NumberUtils.generateOrdinal()));
};
this.adsRequest.adTagUrl = _arg1;
}
private function onAdLoaded(_arg1:AdsLoadedEvent, _arg2:String):void{
removeAdLoadListeners();
adLoading = false;
debug(("redispatching " + _arg2));
dispatchEvent(new AdLoadCompleteEvent(_arg2, adsManager));
}
public function getOrd():String{
return (RoadblocksManager.getOrd(adsRequest.adTagUrl));
}
public function getAdTagURL():String{
return (adsRequest.adTagUrl);
}
public function loadAd():void{
debug(("loadAd adsRequest.adTagUrl = " + adsRequest.adTagUrl));
if (adsLoader){
attachAdLoadListeners();
adLoading = true;
debug("Requesting ads using the request object");
adsLoader.requestAds(adsRequest, this);
} else {
adRequested = true;
};
}
private function onAdsLoaded(_arg1:AdsLoadedEvent):void{
if (_arg1.userRequestContext == this){
debug(("event.adsManager.type = " + _arg1.adsManager.type));
debug(("event.adsManager.type = " + _arg1.adsManager.ads[0].type));
adsManager = _arg1.adsManager;
if (adsManager.type == AdsManagerTypes.FLASH){
onAdLoaded(_arg1, AdLoadCompleteEvent.F2F_ADS_LOADED);
} else {
if (adsManager.type == AdsManagerTypes.VIDEO){
onAdLoaded(_arg1, AdLoadCompleteEvent.VIDEO_ADS_LOADED);
} else {
if (adsManager.type == AdsManagerTypes.CUSTOM_CONTENT){
onAdLoaded(_arg1, AdLoadCompleteEvent.CUSTOM_ADS_LOADED);
};
};
};
};
}
private function onError(_arg1:AdErrorEvent):void{
var _local2:AdSlotError;
var _local3:AdSlotErrorEvent;
if (_arg1.userRequestContext == this){
debug(("onError error = " + _arg1.error));
adLoading = false;
removeAdLoadListeners();
_local2 = new AdSlotError(_arg1.error.errorMessage);
_local3 = new AdSlotErrorEvent(_local2);
dispatchEvent(_local3);
};
}
private function removeAdLoadListeners():void{
adsLoader.removeEventListener(AdsLoadedEvent.ADS_LOADED, onAdsLoaded);
}
}
}//package com.doubleclick.adslot
Section 31
//AdSlot (com.doubleclick.adslot.AdSlot)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.net.*;
import com.doubleclick.adslot.validation.*;
import com.doubleclick.adslot.netstream.*;
import com.doubleclick.adslot.flvplayback.*;
public class AdSlot extends Sprite {
public var isMidrollPresent:Boolean;// = false
public var midrollAdTags:Array;
public var postrollChannels:String;// = ""
public var midrollCompanionOfPreviousAd:Array;
public var googleInStreamSDKVersion:Number;// = 2
public var asVersion:String;// = "as3"
public var isPostrollPresent:Boolean;// = false
private var clickTrackingManager:ClickTrackingManager;
public var isPrerollOverlay:Boolean;// = false
public var midrollCompanionAdTypes:Array;
public var midrollNumAds:Array;
public var midrollAdDurations:Array;
public var prerollDynamicallyAllocated:Boolean;// = false
public var prerollAdDuration:Number;// = 0
public var postrollCompanionAdTypes:Array;
public var prerollAdTag:String;// = ""
public var isMidrollAdOverlay:Array;
public var isPrerollPresent:Boolean;// = false
public var postrollCompanionOfPreviousAd:Boolean;// = false
public var postrollNumAds:Number;// = 0
private var maskControl:MaskControl;
public var videoInstanceName:String;// = ""
private var adsLoader:AdsLoader;
public var prerollMaxTotalAdDuration:Number;// = 0
public var prerollNumAds:Number;// = 1
private var adUnits:AdUnitsImpl;
public var midrollMaxTotalAdDurations:Array;
public var componentVersion:String;// = "1.0.0"
private var videoPlaybackManager:VideoPlaybackManager;
public var prerollCompanionAdTypes:Array;
public var postrollMaxTotalAdDuration:Number;// = 0
public var midrollDynamicallyAllocated:Array;
private var adSlotHeight:Number;
public var midrollAdOffsets:Array;
public var postrollAdTag:String;// = ""
public var numberOfMidrolls:Number;// = 0
public var postrollAdType:String;// = ""
private var adSlotWidth:Number;
public var prerollChannels:String;// = ""
public var midrollAdTypes:Array;
public var postrollDynamicallyAllocated:Boolean;// = false
private var clickTrackingElement:InteractiveObject;
public var midrollChannels:Array;
public var prerollAdType:String;// = ""
public var postrollAdDuration:Number;// = 0
public var shellParams:String;// = ""
private var nativeVideoPlaybackFinder:NativeVideoPlaybackFinder;
public var isPostrollOverlay:Boolean;// = false
private var adsScheduler:AdsScheduler;
public static const VERSION:String = "2.0.0";
private static var instance:AdSlot;
public function AdSlot(){
videoInstanceName = "";
componentVersion = "1.0.0";
asVersion = "as3";
isPrerollPresent = false;
isMidrollPresent = false;
numberOfMidrolls = 0;
isPostrollPresent = false;
prerollAdTag = "";
isPrerollOverlay = false;
prerollAdDuration = 0;
prerollCompanionAdTypes = [];
prerollDynamicallyAllocated = false;
prerollAdType = "";
prerollNumAds = 1;
prerollMaxTotalAdDuration = 0;
prerollChannels = "";
midrollAdTags = [];
isMidrollAdOverlay = [];
midrollAdOffsets = [];
midrollAdDurations = [];
midrollCompanionAdTypes = [];
midrollCompanionOfPreviousAd = [true, false];
midrollDynamicallyAllocated = [];
midrollAdTypes = [];
midrollNumAds = [];
midrollMaxTotalAdDurations = [];
midrollChannels = [];
postrollAdTag = "";
isPostrollOverlay = false;
postrollAdDuration = 0;
postrollCompanionAdTypes = [];
postrollCompanionOfPreviousAd = false;
postrollDynamicallyAllocated = false;
postrollAdType = "";
postrollNumAds = 0;
postrollMaxTotalAdDuration = 0;
postrollChannels = "";
shellParams = "";
googleInStreamSDKVersion = 2;
super();
initializeAdSlot();
}
private function initializeVideoPlayback(_arg1:Event=null):void{
debug("initializeVideoPlayback");
if (_arg1){
removeEventListener(Event.REMOVED, initializeVideoPlayback);
};
nativeVideoPlaybackFinder = new NativeVideoPlaybackFinder(stage, videoInstanceName);
nativeVideoPlaybackFinder.findNativeVideoPlayback();
nativeVideoPlaybackFinder.findJWPlayer();
initializeVideoPlaybackManager();
if (!videoPlaybackManager){
nativeVideoPlaybackFinder.addEventListener(Event.ADDED_TO_STAGE, onNativeVideoPlaybackObjectAdded);
debug(("Could not find Video or FLVPlayback, listening to " + "ADDED_TO_STAGE"));
};
}
public function getAdsLoader():AdsLoader{
return (adsLoader);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
private function onNativeVideoPlaybackObjectAdded(_arg1:Event):void{
var _local2:Object;
var _local3:AdSlotError;
debug("onNativeVideoPlaybackObjectAdded");
_local2 = nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance();
if (videoPlaybackManager){
_local3 = null;
if (videoPlaybackManager.isNetStreamPlayback()){
if (nativeVideoPlaybackFinder.isVideoUsed()){
videoPlaybackManager.setVideoOutput(_local2);
debug(("nativeVideoPlaybackFinder.getJWPlayerInstance(): " + nativeVideoPlaybackFinder.getJWPlayerInstance()));
if (nativeVideoPlaybackFinder.getJWPlayerInstance()){
videoPlaybackManager.setJWPlayer(nativeVideoPlaybackFinder.getJWPlayerInstance());
};
} else {
_local3 = new AdSlotError((("Switch from " + "netstream/Video to FLVPlayback based video playback is not") + "supported"));
};
} else {
if (nativeVideoPlaybackFinder.isFLVPlaybackUsed()){
videoPlaybackManager.setVideoOutput(_local2);
} else {
_local3 = new AdSlotError((("Switch from " + "FLVPlayback to netstream/Video based video playback is not") + "supported"));
};
};
if (_local3){
dispatchEvent(new AdSlotErrorEvent(_local3));
};
} else {
debug("video playback was not initialized");
initializeVideoPlaybackManager();
};
}
public function initializeAdSlot():void{
adSlotWidth = this.width;
adSlotHeight = this.height;
initializeLogging();
if (initializeSelf()){
adsScheduler = new AdsScheduler();
adsScheduler.addEventListener(AdUnitEvent.MASTER_AD_START, onMasterAdStart);
adsScheduler.addEventListener(AdSlotEvent.AD_START, onAdStart);
adsScheduler.addEventListener(AdSlotEvent.AD_COMPLETE, onAdComplete);
addEventListener(Event.ENTER_FRAME, onUIValuesAvailable);
maskControl = new MaskControl(this.width, this.height, this);
maskControl.turnOn();
debug(("maskcontrol is : " + maskControl));
doNotScale();
initializeNetStreamIntercept();
};
}
private function enableMasking():void{
maskControl.turnOn();
}
public function getAdSlotWidth():Number{
return (adSlotWidth);
}
private function onUIValuesAvailable(_arg1:Event):void{
debug("onUIValuesAvailable");
removeEventListener(Event.ENTER_FRAME, onUIValuesAvailable);
initializeVideoPlayback();
initializeAds();
initializeAdsLoader();
dispatchEvent(new AdSlotEvent(AdSlotEvent.ADS_READY, adUnits));
intializeAdUnits();
}
public function getVersion():String{
return (AdSlot.VERSION);
}
private function getClickTrackingManager():ClickTrackingManager{
return (clickTrackingManager);
}
private function initializeVideoPlaybackManager():void{
var _local1:Object;
debug("initializeVideoPlaybackManager");
_local1 = null;
if (nativeVideoPlaybackFinder.isVideoUsed()){
debug("Found video object, will do netstream hijack");
videoPlaybackManager = new NetStreamVideoPlaybackManagerImpl();
_local1 = nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance();
debug(("VideoOutput: " + _local1));
videoPlaybackManager.setVideoOutput(_local1);
debug(("nativeVideoPlaybackFinder.getJWPlayerInstance(): " + nativeVideoPlaybackFinder.getJWPlayerInstance()));
if (nativeVideoPlaybackFinder.getJWPlayerInstance()){
videoPlaybackManager.setJWPlayer(nativeVideoPlaybackFinder.getJWPlayerInstance());
};
} else {
if (nativeVideoPlaybackFinder.isFLVPlaybackUsed()){
debug("found FLVPlayback object, will do FLVPlayback hijack");
videoPlaybackManager = new FLVPlaybackManagerImpl(nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance(), new EventsSuppressor(nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance()));
_local1 = nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance();
debug(("videoOutput:" + _local1));
videoPlaybackManager.setVideoOutput(_local1);
};
};
if (videoPlaybackManager){
adsScheduler.setVideoPlaybackManager(videoPlaybackManager);
initializeClickTrackingManager();
if (adUnits){
adUnits.setVideoPlaybackManager(videoPlaybackManager);
};
};
}
private function intializeAdUnits():void{
adUnits.setupAds(this);
adUnits.setVideoPlaybackManager(videoPlaybackManager);
if (adsLoader){
adUnits.setAdsLoader(adsLoader);
};
adsScheduler.setAdUnits(adUnits);
}
public function resetAds():void{
initializeAds();
dispatchEvent(new AdSlotEvent(AdSlotEvent.ADS_READY, adUnits));
intializeAdUnits();
}
private function initializeAds():void{
debug("initializeAds");
adUnits = new AdUnitsImpl();
adUnits.addEventListener(AdSlotErrorEvent.ERROR, onError);
adUnits.validator = new AdUnitValidator();
adUnits.setMaskControl(maskControl);
DynamicSettingsUtil.initialize(this);
}
private function initializeSelf():Boolean{
debug("initializeSelf");
if (!instance){
instance = this;
return (true);
};
trace(("There are more than one instance of DARTAdSlot component on" + "the stage. This is not supported."));
return (false);
}
public function setClickTrackingElement(_arg1:InteractiveObject):void{
debug(("setClickTrackingElement: clickTrackingElement = " + _arg1.width));
this.clickTrackingElement = _arg1;
if (getClickTrackingManager()){
getClickTrackingManager().setClickableElement(_arg1);
};
}
private function initializeAdsLoader():void{
if (adsLoader == null){
adsLoader = new AdsLoader();
stage.addChild(adsLoader);
};
}
private function onAdStart(_arg1:AdSlotEvent):void{
debug("onAdStart");
dispatchEvent(_arg1);
}
private function onError(_arg1:AdSlotErrorEvent):void{
dispatchEvent(_arg1);
}
private function initializeNetStreamIntercept():void{
var _local1:NetConnection;
debug("initializeNetStreamIntercept");
_local1 = new NetConnection();
_local1.connect(null);
new NetStream(_local1);
}
private function disableMasking():void{
maskControl.turnOff();
}
private function onMasterAdStart(_arg1:AdUnitEvent):void{
debug("onMasterAdStart");
_arg1.setVideoPlayer((nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance() as DisplayObject));
dispatchEvent(_arg1);
}
private function initializeLogging():void{
}
public function getVideoPlaybackManager():VideoPlaybackManager{
return (videoPlaybackManager);
}
private function onAdComplete(_arg1:AdSlotEvent):void{
debug("onAdCompleteEvent");
dispatchEvent(_arg1);
}
public function getAdSlotHeight():Number{
return (adSlotHeight);
}
private function doNotScale():void{
scaleX = 1;
scaleY = 1;
}
private function isOverlayMasked():Boolean{
return (maskControl.isOn());
}
private function initializeClickTrackingManager():void{
if (nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance()){
clickTrackingManager = new ClickTrackingManager(nativeVideoPlaybackFinder.getNativeVideoPlaybackInstance());
if (clickTrackingElement){
debug(("clickTrackingElement = " + clickTrackingElement.width));
clickTrackingManager.setClickableElement(clickTrackingElement);
};
};
}
public static function setInstance(_arg1:AdSlot):void{
instance = _arg1;
}
public static function getInstance():AdSlot{
return (instance);
}
public static function getStage():Stage{
return (AdSlot.getInstance().stage);
}
}
}//package com.doubleclick.adslot
Section 32
//AdSlotAlignment (com.doubleclick.adslot.AdSlotAlignment)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
public class AdSlotAlignment {
private static const CENTER_ALIGNMENT_PLAYER_OVERLAP:Number = 0.3;
private static const CENTER_ALIGNMENT_RANGE_FOR_EDGE_DISTANCES:Number = 0.2;
private static const EDGE_ALIGNMENT_RANGE:Number = 0.25;
private static function adSlotHeightPercentOfDisplayObjectHeight(_arg1:Number, _arg2:Number):Number{
return ((_arg1 / _arg2));
}
private static function getTopDistance(_arg1:AdSlot, _arg2:Object):Number{
return (Math.abs((_arg1.y - _arg2.y)));
}
private static function calculateVerticalAlignment(_arg1:AdSlot, _arg2:Object):String{
var _local3:Number;
var _local4:Number;
_local3 = getTopDistance(_arg1, _arg2);
_local4 = getBottomDistance(_arg1, _arg2);
if (isAdSlotTopEdgeWithinDisplayObject(_arg1, _arg2)){
if (isAdSlotBottomEdgeWithinDisplayObject(_arg1, _arg2)){
if (adSlotHeightPercentOfDisplayObjectHeight(_arg1.getAdSlotHeight(), _arg2.height) > CENTER_ALIGNMENT_PLAYER_OVERLAP){
return (HorizontalAlignment.CENTER);
};
if (isCenterAligned(_local3, _local4, _arg2.height)){
return (VerticalAlignment.CENTER);
};
if (_local3 > _local4){
return (VerticalAlignment.BOTTOM);
};
return (VerticalAlignment.TOP);
} else {
if (_local3 >= (_arg2.height * EDGE_ALIGNMENT_RANGE)){
return (VerticalAlignment.BOTTOM);
};
return (VerticalAlignment.CENTER);
};
//unresolved jump
};
if (isAdSlotBottomEdgeWithinDisplayObject(_arg1, _arg2)){
if (_local4 >= (_arg2.height * EDGE_ALIGNMENT_RANGE)){
return (VerticalAlignment.TOP);
};
return (VerticalAlignment.CENTER);
//unresolved jump
};
return (VerticalAlignment.CENTER);
}
private static function isAdSlotRightEdgeWithinDisplayObject(_arg1:AdSlot, _arg2:Object):Boolean{
return (((_arg1.x + _arg1.getAdSlotWidth()) <= (_arg2.x + _arg2.width)));
}
public static function getHorizontalAlignment(_arg1:AdSlot, _arg2:VideoPlaybackManager):String{
var _local3:String;
_local3 = null;
if (_arg2.hitTestObject(_arg1)){
_local3 = calculateHorizontalAlignment(_arg1, _arg2.getVideoOutput());
} else {
_local3 = calculateHorizontalAlignment(_arg1, _arg1.stage);
};
return (_local3);
}
private static function isAdSlotBottomEdgeWithinDisplayObject(_arg1:AdSlot, _arg2:Object):Boolean{
return (((_arg1.y + _arg1.getAdSlotHeight()) <= (_arg2.y + _arg2.height)));
}
private static function isCenterAligned(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (Math.abs((_arg1 - _arg2)) <= (_arg3 * CENTER_ALIGNMENT_RANGE_FOR_EDGE_DISTANCES)){
return (true);
};
return (false);
}
private static function isAdSlotLeftEdgeWithinDisplayObject(_arg1:AdSlot, _arg2:Object):Boolean{
return ((_arg1.x >= _arg2.x));
}
private static function isAdSlotTopEdgeWithinDisplayObject(_arg1:AdSlot, _arg2:Object):Boolean{
return ((_arg1.y >= _arg2.y));
}
private static function getLeftDistance(_arg1:AdSlot, _arg2:Object):Number{
return (Math.abs((_arg1.x - _arg2.x)));
}
private static function debug(_arg1:String):void{
Logger.debug(_arg1, "AdSlotAlignment");
}
private static function getBottomDistance(_arg1:AdSlot, _arg2:Object):Number{
return (Math.abs(((_arg1.y + _arg1.getAdSlotHeight()) - (_arg2.y + _arg2.height))));
}
public static function getVerticalAlignment(_arg1:AdSlot, _arg2:VideoPlaybackManager):String{
var _local3:String;
_local3 = null;
if (_arg2.hitTestObject(_arg1)){
_local3 = calculateVerticalAlignment(_arg1, _arg2.getVideoOutput());
} else {
_local3 = calculateVerticalAlignment(_arg1, _arg1.stage);
};
return (_local3);
}
private static function calculateHorizontalAlignment(_arg1:AdSlot, _arg2:Object):String{
var _local3:Number;
var _local4:Number;
_local3 = getLeftDistance(_arg1, _arg2);
_local4 = getRightDistance(_arg1, _arg2);
if (isAdSlotLeftEdgeWithinDisplayObject(_arg1, _arg2)){
if (isAdSlotRightEdgeWithinDisplayObject(_arg1, _arg2)){
if (adSlotWidthPercentOfDisplayObjectWidth(_arg1.getAdSlotWidth(), _arg2.width) > CENTER_ALIGNMENT_PLAYER_OVERLAP){
return (HorizontalAlignment.CENTER);
};
if (isCenterAligned(_local3, _local4, _arg2.width)){
return (HorizontalAlignment.CENTER);
};
if (_local3 > _local4){
return (HorizontalAlignment.RIGHT);
};
return (HorizontalAlignment.LEFT);
} else {
if (_local3 >= (_arg2.width * EDGE_ALIGNMENT_RANGE)){
return (HorizontalAlignment.RIGHT);
};
return (HorizontalAlignment.CENTER);
};
//unresolved jump
};
if (isAdSlotRightEdgeWithinDisplayObject(_arg1, _arg2)){
if (_local4 >= (_arg2.width * EDGE_ALIGNMENT_RANGE)){
return (HorizontalAlignment.LEFT);
};
return (HorizontalAlignment.CENTER);
//unresolved jump
};
return (HorizontalAlignment.CENTER);
}
private static function getRightDistance(_arg1:AdSlot, _arg2:Object):Number{
return (Math.abs(((_arg1.x + _arg1.getAdSlotWidth()) - (_arg2.x + _arg2.width))));
}
private static function adSlotWidthPercentOfDisplayObjectWidth(_arg1:Number, _arg2:Number):Number{
return ((_arg1 / _arg2));
}
}
}//package com.doubleclick.adslot
Section 33
//AdSlotError (com.doubleclick.adslot.AdSlotError)
package com.doubleclick.adslot {
public class AdSlotError extends Error {
private var flashError:Error;// = null
public function AdSlotError(_arg1:String="", _arg2:int=0){
flashError = null;
super(_arg1, _arg2);
}
public function set innerError(_arg1:Error):void{
this.flashError = _arg1;
}
public function get innerError():Error{
return (flashError);
}
}
}//package com.doubleclick.adslot
Section 34
//AdSlotErrorEvent (com.doubleclick.adslot.AdSlotErrorEvent)
package com.doubleclick.adslot {
import flash.events.*;
public class AdSlotErrorEvent extends ErrorEvent {
private var adUnit:AdUnit;// = null
private var error:AdSlotError;
public static const ERROR:String = "error";
public function AdSlotErrorEvent(_arg1:AdSlotError){
adUnit = null;
super(ERROR);
this.error = _arg1;
}
public function getAdUnit():AdUnit{
return (adUnit);
}
public function getError():AdSlotError{
return (error);
}
public function setAdUnit(_arg1:AdUnit):void{
this.adUnit = _arg1;
}
override public function clone():Event{
var _local1:AdSlotErrorEvent;
_local1 = new AdSlotErrorEvent(error);
_local1.setAdUnit(adUnit);
return (_local1);
}
}
}//package com.doubleclick.adslot
Section 35
//AdSlotEvent (com.doubleclick.adslot.AdSlotEvent)
package com.doubleclick.adslot {
import flash.events.*;
public class AdSlotEvent extends Event {
private var ads:AdUnits;
public static const ADS_READY:String = "adsReady";
public static const AD_COMPLETE:String = "adComplete";
public static const AD_START:String = "adStart";
public function AdSlotEvent(_arg1:String, _arg2:AdUnits=null){
super(_arg1);
this.ads = _arg2;
}
public function getAds():AdUnits{
return (ads);
}
override public function clone():Event{
return (new AdSlotEvent(type, ads));
}
}
}//package com.doubleclick.adslot
Section 36
//AdsRequestCreator (com.doubleclick.adslot.AdsRequestCreator)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
public class AdsRequestCreator {
private static const COMPANION_TYPE_HTML:String = "HTML";
private static function debug(_arg1:String):void{
Logger.debug(_arg1, "AdsRequestCreator");
}
public static function getAdsRequestObject(_arg1:Object):AdsRequest{
var _local2:AdsRequest;
var _local3:Array;
_local2 = new AdsRequest();
_local2.adTagUrl = _arg1.url;
_local2.adSlotWidth = _arg1.adSlotWidth;
_local2.adSlotHeight = _arg1.adSlotHeight;
_local2.adType = _arg1.adType;
_local2.maxTotalAdDuration = (_arg1.maxTotalAdDuration * 1000);
_local2.disableCompanionAds = !(htmlCompanionPresent(_arg1));
_local3 = _arg1.channels.split(",");
_local2.channels = _local3;
if (_arg1.dynamicallyAllocated){
_local2.contentId = "123";
};
debug(("adsRequest.adTagUrl = " + _local2.adTagUrl));
debug(("adsRequest.adSlotWidth = " + _local2.adSlotWidth));
debug(("adsRequest.adSlotHeight = " + _local2.adSlotHeight));
debug(("adsRequest.adType = " + _local2.adType));
debug(("adsRequest.disableCompanionAds = " + _local2.disableCompanionAds));
debug(("adsRequest.maxTotalAdDuration = " + _local2.maxTotalAdDuration));
debug(("adsRequest.channels = " + _local2.channels));
return (_local2);
}
private static function htmlCompanionPresent(_arg1:Object):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1.companionTypes.length) {
if (_arg1.companionTypes[_local2] == COMPANION_TYPE_HTML){
return (true);
};
_local2++;
};
return (false);
}
}
}//package com.doubleclick.adslot
Section 37
//AdsScheduler (com.doubleclick.adslot.AdsScheduler)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import flash.events.*;
import flash.utils.*;
public class AdsScheduler extends EventDispatcher {
private var adUnits:AdUnitsImpl;
private var postrollAdDisplayRequested:Boolean;
private var videoPlaybackManager:VideoPlaybackManager;
private var midrollAdDisplayRequested:Boolean;
private var prerollAdDisplayRequested:Boolean;
private var contentPlayheadMonitorTimer:Timer;
private var shouldDisplayPrerollBeforeContent:Boolean;
private var activeAdUnit:AdUnit;
private var onBeforeContentPlayFired:Boolean;
private function isActiveAdUnitPresent():Boolean{
return (!((activeAdUnit == null)));
}
private function displayAd():void{
if (activeAdUnit){
activeAdUnit.display();
};
}
private function handleContentComplete():void{
debug("handleContentComplete");
adUnits.onContentComplete();
videoPlaybackManager.dispatchContentComplete();
}
private function onOverlayAdDisplayComplete(_arg1:AdUnitEvent):void{
onAdDisplayComplete(_arg1);
}
private function shouldDisplayPreroll():Boolean{
return (((((adUnits.hasPreroll()) && (!(adUnits.getPreroll().wasDisplayed())))) && (!(adUnits.getPreroll().isInErrorState()))));
}
private function displayPreroll():void{
debug("displayPreroll");
activateAdUnit(adUnits.getPreroll());
displayAd();
}
public function setVideoPlaybackManager(_arg1:VideoPlaybackManager):void{
debug("setVideoPlaybackManager");
this.videoPlaybackManager = _arg1;
this.videoPlaybackManager.addEventListener(VideoPlaybackEvent.BEFORE_AD_PLAY, onBeforeVideoAdPlay);
this.videoPlaybackManager.addEventListener(VideoPlaybackEvent.BEFORE_CONTENT_PLAY, onBeforeContentPlay);
this.videoPlaybackManager.addEventListener(VideoPlaybackEvent.CONTENT_COMPLETE, onContentComplete);
this.videoPlaybackManager.addEventListener("playClickedForPrerollAutoPlayFalse", playClickedForPrerollAutoPlayFalse);
}
private function activateAdUnit(_arg1:AdUnit):void{
debug(("activateAdUnit timing: " + _arg1.getAdTiming()));
if (isActiveAdUnitPresent()){
activeAdUnit.destroy();
};
activeAdUnit = _arg1;
}
private function loadNextAdUnit(_arg1:AdUnit):void{
var _local2:AdUnit;
_local2 = adUnits.getNextAdUnitInPlaySequence(_arg1);
if (_local2){
if (!_local2.isRoadblockUserSessionTrigger()){
_local2.loadAd();
};
};
}
private function displayPostroll():void{
debug("displayPostroll");
activateAdUnit(adUnits.getPostroll());
if (!activeAdUnit.isDisplayReady()){
postrollAdDisplayRequested = true;
activeAdUnit.loadAd();
} else {
displayAd();
};
}
private function onAdDisplayLoaded(_arg1:AdUnitEvent):void{
var _local2:AdUnit;
debug("onAdDisplayLoaded");
_local2 = _arg1.getAdUnit();
switch (_local2.getAdTiming()){
case AdTiming.ON_PREROLL:
if (prerollAdDisplayRequested){
prerollAdDisplayRequested = false;
if (!_local2.getAdDisplay().requiresContentPausing()){
videoPlaybackManager.playContent();
};
if (onBeforeContentPlayFired){
displayPreroll();
} else {
shouldDisplayPrerollBeforeContent = true;
};
};
break;
case AdTiming.ON_MIDROLL:
if (midrollAdDisplayRequested){
if (_local2.getAdDisplay().requiresContentPausing()){
videoPlaybackManager.pauseContent();
};
midrollAdDisplayRequested = false;
displayAd();
};
break;
case AdTiming.ON_POSTROLL:
if (postrollAdDisplayRequested){
postrollAdDisplayRequested = false;
displayAd();
};
break;
};
}
private function handlePossiblePreroll():void{
var _local1:AdUnit;
debug("handlePossiblePreroll");
if (shouldDisplayPreroll()){
debug(("shouldDisplayPreroll: " + shouldDisplayPreroll()));
_local1 = adUnits.getPreroll();
if (_local1.isDisplayReady()){
if (_local1.getAdDisplay().requiresContentPausing()){
videoPlaybackManager.pauseContent();
};
shouldDisplayPrerollBeforeContent = true;
} else {
videoPlaybackManager.pauseContent();
prerollAdDisplayRequested = true;
};
};
}
private function onBeforeContentPlay(_arg1:VideoPlaybackEvent):void{
var _local2:AdUnit;
debug("onBeforeContentPlay");
handlePossiblePreroll();
if (adUnits.hasMidrollAdsToDisplay()){
startContentMonitorTimer();
};
onBeforeContentPlayFired = true;
if (shouldDisplayPrerollBeforeContent){
debug("shouldDisplayPrerollBeforeContent is true");
shouldDisplayPrerollBeforeContent = false;
_local2 = adUnits.getPreroll();
if (!_local2.getAdDisplay().requiresContentPausing()){
videoPlaybackManager.playContent();
};
displayPreroll();
} else {
if (prerollAdDisplayRequested){
debug("prerollAdDisplayRequested is true");
adUnits.getPreroll().loadAd();
} else {
debug("No preroll, play content");
videoPlaybackManager.playContent();
};
};
}
private function playClickedForPrerollAutoPlayFalse(_arg1:Event):void{
activeAdUnit.playPrerollVideoAd();
}
private function onBeforeVideoAdPlay(_arg1:Object):void{
displayAd();
}
private function processCompanions():void{
var _local1:AdUnitEvent;
if (activeAdUnit.hasFlashCompanions()){
debug("process Flash Companions");
_local1 = new AdUnitEvent(AdUnitEvent.MASTER_AD_START);
_local1.setAdUnit(activeAdUnit);
dispatchEvent(_local1);
};
}
private function onAdDisplayStart(_arg1:AdUnitEvent):void{
processCompanions();
dispatchEvent(new AdSlotEvent(AdSlotEvent.AD_START));
}
private function loadFirstAdUnit():void{
var _local1:AdUnit;
debug("loadFirstAdUnit");
_local1 = adUnits.getFirstAdUnitInPlaySequence();
if (_local1){
if (!_local1.isRoadblockUserSessionTrigger()){
_local1.loadAd();
};
};
}
private function stopContentMonitorTimer():void{
if (contentPlayheadMonitorTimer != null){
contentPlayheadMonitorTimer.stop();
};
contentPlayheadMonitorTimer = null;
}
private function shouldDisplayPostroll():Boolean{
return (((((adUnits.hasPostroll()) && (!(adUnits.getPostroll().wasDisplayed())))) && (!(adUnits.getPostroll().isInErrorState()))));
}
private function onContentPlayheadMonitorEvent(_arg1:TimerEvent):void{
var _local2:Number;
if (contentPlayheadMonitorTimer != null){
if (!videoPlaybackManager.isSeeking()){
_local2 = videoPlaybackManager.getContentPlayheadPosition();
adUnits.processMidrollAdUnits(_local2, videoPlaybackManager.getSeekedTo());
if (!adUnits.hasMidrollAdsToDisplay()){
stopContentMonitorTimer();
};
};
};
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function setAdUnits(_arg1:AdUnitsImpl):void{
var _local2:AdUnit;
this.adUnits = _arg1;
this.adUnits.addEventListener(AdUnitEvent.MIDROLL_READY, onMidrollAdUnitScheduled);
for each (_local2 in adUnits.getPlaySequence()) {
_local2.addEventListener(AdSlotErrorEvent.ERROR, onAdDisplayError);
_local2.addEventListener(AdUnitEvent.AD_DISPLAY_LOADED, onAdDisplayLoaded);
_local2.addEventListener(AdUnitEvent.AD_DISPLAY_START, onAdDisplayStart);
_local2.addEventListener(AdUnitEvent.VIDEO_AD_DISPLAY_COMPLETE, onVideoAdDisplayComplete);
_local2.addEventListener(AdUnitEvent.OVERLAY_AD_DISPLAY_COMPLETE, onOverlayAdDisplayComplete);
};
loadFirstAdUnit();
}
private function deactivateAdUnit():void{
activeAdUnit = null;
}
private function onAdDisplayComplete(_arg1:AdUnitEvent):void{
var _local2:AdUnit;
debug("onAdDisplayComplete");
deactivateAdUnit();
_local2 = _arg1.getAdUnit();
loadNextAdUnit(_local2);
dispatchEvent(new AdSlotEvent(AdSlotEvent.AD_COMPLETE));
if (_arg1.getAdUnit().getAdTiming() == AdTiming.ON_POSTROLL){
debug("Postroll ad complete, fire complete for the content");
handleContentComplete();
};
}
private function startContentMonitorTimer():void{
stopContentMonitorTimer();
contentPlayheadMonitorTimer = new Timer(100);
contentPlayheadMonitorTimer.addEventListener(TimerEvent.TIMER, onContentPlayheadMonitorEvent);
contentPlayheadMonitorTimer.start();
}
private function onMidrollAdUnitScheduled(_arg1:AdUnitEvent):void{
activateAdUnit(_arg1.getAdUnit());
if (!activeAdUnit.isInErrorState()){
if (activeAdUnit.isDisplayReady()){
if (activeAdUnit.getAdDisplay().requiresContentPausing()){
debug("Midroll is NOT overlay, will pause content");
videoPlaybackManager.pauseContent();
};
displayAd();
} else {
activeAdUnit.loadAd();
midrollAdDisplayRequested = true;
};
};
}
private function onAdDisplayError(_arg1:AdSlotErrorEvent):void{
var _local2:AdUnit;
debug("AdDisplayError");
_local2 = _arg1.getAdUnit();
switch (_local2.getAdTiming()){
case AdTiming.ON_PREROLL:
debug("Error with preroll, play content");
prerollAdDisplayRequested = false;
videoPlaybackManager.playContent();
break;
case AdTiming.ON_MIDROLL:
midrollAdDisplayRequested = false;
break;
case AdTiming.ON_POSTROLL:
postrollAdDisplayRequested = false;
break;
};
loadNextAdUnit(_local2);
}
private function onContentComplete(_arg1:Event):void{
handlePossiblePostroll();
}
private function handlePossiblePostroll():void{
if (shouldDisplayPostroll()){
displayPostroll();
} else {
debug("No Postroll ad present. Fire complete event for content");
handleContentComplete();
};
}
private function onVideoAdDisplayComplete(_arg1:AdUnitEvent):void{
var _local2:AdUnit;
debug("onVideoAdDisplayComplete");
_local2 = _arg1.getAdUnit();
switch (_local2.getAdTiming()){
case AdTiming.ON_PREROLL:
debug("Preroll video ad complete, playing content");
videoPlaybackManager.playContent();
break;
case AdTiming.ON_MIDROLL:
debug("Midroll video ad complete, resuming content");
videoPlaybackManager.resumeContent();
break;
case AdTiming.ON_POSTROLL:
videoPlaybackManager.activateContent();
break;
};
onAdDisplayComplete(_arg1);
}
}
}//package com.doubleclick.adslot
Section 38
//AdTiming (com.doubleclick.adslot.AdTiming)
package com.doubleclick.adslot {
public class AdTiming {
public static const ON_PREROLL:uint = 1;
public static const ON_MIDROLL:uint = 2;
public static const ON_POSTROLL:uint = 3;
}
}//package com.doubleclick.adslot
Section 39
//AdUnit (com.doubleclick.adslot.AdUnit)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
public class AdUnit extends EventDispatcher {
private var adLoader:AdLoader;// = null
public var videoPlaybackManager:VideoPlaybackManager;// = null
private var ad:Object;// = null
private var loadingDisplayImpl:Boolean;// = false
private var roadblocksManager:RoadblocksManager;// = null
private var displayStartTime:Number;// = -1
private var displayCap:Number;// = -1
private var myMaster:AdUnit;// = null
private var expectsOverlay:Boolean;// = false
private var displayRequested:Boolean;// = false
private var maskControl:MaskControl;// = null
private var adTiming:Number;// = -1
private var adsManager:AdsManager;// = null
private var adDisplayImpl:AbstractAdDisplay;// = null
private var companionTypes:Array;// = null
private var companionAdUnits:Array;// = null
private var errorState:Boolean;// = false
private var displayCount:Number;// = 0
private var displayDuration:Number;// = -1
public function AdUnit(_arg1:Boolean, _arg2:Number, _arg3:Number, _arg4:Array){
videoPlaybackManager = null;
adLoader = null;
adDisplayImpl = null;
displayDuration = -1;
displayStartTime = -1;
displayCount = 0;
displayCap = -1;
adTiming = -1;
displayRequested = false;
loadingDisplayImpl = false;
errorState = false;
companionTypes = null;
roadblocksManager = null;
expectsOverlay = false;
myMaster = null;
companionAdUnits = null;
maskControl = null;
ad = null;
adsManager = null;
super();
this.expectsOverlay = _arg1;
this.adTiming = _arg2;
this.displayCap = 1;
this.displayDuration = _arg3;
this.companionTypes = _arg4;
this.companionAdUnits = [];
}
private function swapInCompanionUrl():void{
var _local1:Array;
var _local2:String;
if (myMaster.isDisplayReady()){
_local1 = RoadblocksManager.getDimensions(adLoader.getAdTagURL());
_local2 = getRoadblocksManager().getCompanionURL(_local1[0], _local1[1]);
adLoader.setAdTagURL(_local2);
};
}
public function hasFlashCompanions():Boolean{
return (hasCompanionType("Flash"));
}
public function onCustomAdsLoaded(_arg1:AdLoadCompleteEvent):void{
removeAdLoadListeners(adLoader);
if (((((_arg1.getAdsManager().ads) && (_arg1.getAdsManager().ads[0]))) && (AvailabilityForecastAdDisplay.isAvailabilityForecastAd((_arg1.getAdsManager().ads[0] as CustomContentAd))))){
adDisplayImpl = new AvailabilityForecastAdDisplay(_arg1.getAdsManager(), videoPlaybackManager);
adDisplayImpl.addEventListener(AdSlotErrorEvent.ERROR, onAdDisplayError);
onAdDisplayImplCreated();
if (displayRequested){
adDisplayImpl.displayAd(adTiming);
};
} else {
handleError("Custom xml ads are not supported in the self-service video ads component");
};
}
private function onAdDisplayImplCreated():void{
var _local1:AdUnitEvent;
adDisplayImpl.addEventListener(AdUnitEvent.AD_DISPLAY_START, onAdDisplayStart);
_local1 = new AdUnitEvent(AdUnitEvent.AD_DISPLAY_LOADED);
_local1.setAdUnit(this);
dispatchEvent(_local1);
}
public function onError(_arg1:AdSlotErrorEvent):void{
debug("onError");
removeAdLoadListeners(adLoader);
handleError(_arg1.getError().message);
}
public function getAdLoader():AdLoader{
return (adLoader);
}
private function hasCompanionType(_arg1:String):Boolean{
var _local2:Number;
if (companionTypes){
_local2 = 0;
while (_local2 < companionTypes.length) {
if (companionTypes[_local2] == _arg1){
return (true);
};
_local2++;
};
};
return (false);
}
private function attachAdLoadListeners(_arg1:IEventDispatcher):void{
_arg1.addEventListener(AdLoadCompleteEvent.VIDEO_ADS_LOADED, onVideoAdsLoaded);
_arg1.addEventListener(AdLoadCompleteEvent.F2F_ADS_LOADED, onF2FAdsLoaded);
_arg1.addEventListener(AdLoadCompleteEvent.CUSTOM_ADS_LOADED, onCustomAdsLoaded);
_arg1.addEventListener(AdSlotErrorEvent.ERROR, onError);
}
public function playPrerollVideoAd():void{
if (adDisplayImpl){
adDisplayImpl.playPreroll();
};
}
public function registerMasterAdSlotCompanionAdUnit(_arg1:AdUnit):void{
if (!roadblocksManager){
roadblocksManager = new RoadblocksManager(adLoader.getAdTagURL());
};
companionAdUnits.push(_arg1);
}
public function setVideoPlaybackManager(_arg1:VideoPlaybackManager):void{
this.videoPlaybackManager = _arg1;
adLoader.setAlignmentForAdsRequest(_arg1);
}
public function hasMaster():Boolean{
return (!((myMaster == null)));
}
public function isOverlayExpected():Boolean{
return (expectsOverlay);
}
public function setAdLoader(_arg1:AdLoader):void{
this.adLoader = _arg1;
attachAdLoadListeners(_arg1);
}
public function getMyMaster():AdUnit{
return (myMaster);
}
public function setAdsLoader(_arg1:AdsLoader):void{
adLoader.setAdsLoader(_arg1);
}
public function loadAd():void{
debug("loading the ad");
if (((!(adDisplayImpl)) && (!(loadingDisplayImpl)))){
loadingDisplayImpl = true;
if (hasMaster()){
swapInCompanionUrl();
};
adLoader.loadAd();
};
}
public function getDisplayStartTime():Number{
switch (adTiming){
case AdTiming.ON_PREROLL:
return (0);
case AdTiming.ON_MIDROLL:
return (displayStartTime);
};
return (-1);
}
public function setDisplayStartTime(_arg1:int):void{
this.displayStartTime = _arg1;
}
public function setMaskControl(_arg1:MaskControl):void{
this.maskControl = _arg1;
}
public function isReadyForDisplay(_arg1:Number):Boolean{
return ((_arg1 >= displayStartTime));
}
private function onOverlayAdDisplayComplete(_arg1:AdUnitEvent):void{
debug("onOverlayAdDisplayComplete");
adDisplayImpl.removeEventListener(AdUnitEvent.OVERLAY_AD_DISPLAY_COMPLETE, onOverlayAdDisplayComplete);
adDisplayImpl.removeEventListener(AdSlotErrorEvent.ERROR, onAdDisplayError);
dispatchEvent(_arg1);
}
public function isRoadblockUserSessionTrigger():Boolean{
return (((!((adLoader.getAdTagURL().indexOf("ptile=") == -1))) || (!((adLoader.getAdTagURL().indexOf("tile=") == -1)))));
}
public function isInErrorState():Boolean{
return (errorState);
}
private function updateMasterAdTag():void{
if (roadblocksManager){
roadblocksManager.setMasterAdTag(adLoader.getAdTagURL());
};
}
public function setMyMaster(_arg1:AdUnit):void{
this.myMaster = _arg1;
}
public function onF2FAdsLoaded(_arg1:AdLoadCompleteEvent):void{
debug("onF2FAdLoaded");
updateMasterAdTag();
removeAdLoadListeners(adLoader);
setAdsManager(_arg1.getAdsManager());
adDisplayImpl = new OverlayAdDisplay(_arg1.getAdsManager(), displayDuration, videoPlaybackManager);
adDisplayImpl.setAdUnit(this);
adDisplayImpl.setIsOverlayExpected(isOverlayExpected());
adDisplayImpl.setMaskControl(maskControl);
adDisplayImpl.addEventListener(AdUnitEvent.OVERLAY_AD_DISPLAY_COMPLETE, onOverlayAdDisplayComplete);
adDisplayImpl.addEventListener(AdSlotErrorEvent.ERROR, onAdDisplayError);
onAdDisplayImplCreated();
if (displayRequested){
adDisplayImpl.displayAd(adTiming);
};
}
public function display():void{
debug("display");
if (adDisplayImpl){
if (adDisplayImpl.getVideoPlaybackManager() == null){
adDisplayImpl.setVideoPlaybackManager(videoPlaybackManager);
};
if (adDisplayImpl.isCurrentlyDisplayed()){
adDisplayImpl.displayAd(adTiming);
} else {
if (!wasDisplayed()){
adDisplayImpl.displayAd(adTiming);
displayCount++;
debug("incrementing display count");
};
};
} else {
displayRequested = true;
};
}
public function getAdTiming():Number{
return (adTiming);
}
private function onAdDisplayStart(_arg1:AdUnitEvent):void{
dispatchEvent(_arg1);
}
public function isDisplayReady():Boolean{
if (adDisplayImpl){
return (true);
};
return (false);
}
public function onVideoAdsLoaded(_arg1:AdLoadCompleteEvent):void{
updateMasterAdTag();
removeAdLoadListeners(adLoader);
if (isOverlayExpected()){
handleError("Expected overlay ad, but loaded video ad.");
return;
};
setAdsManager(_arg1.getAdsManager());
adDisplayImpl = new VideoAdDisplay(_arg1.getAdsManager(), videoPlaybackManager);
debug("VideoAdDisplay created");
adDisplayImpl.setAdUnit(this);
adDisplayImpl.addEventListener(AdUnitEvent.VIDEO_AD_DISPLAY_COMPLETE, onVideoAdDisplayComplete);
adDisplayImpl.addEventListener(AdSlotErrorEvent.ERROR, onAdDisplayError);
onAdDisplayImplCreated();
if (displayRequested){
adDisplayImpl.displayAd(adTiming);
};
}
public function getDisplayDuration():Number{
return (displayDuration);
}
public function setAdsManager(_arg1:AdsManager):void{
this.adsManager = _arg1;
if (roadblocksManager){
roadblocksManager.updateMasterAdsManager(_arg1);
};
}
private function onAdDisplayError(_arg1:AdSlotErrorEvent):void{
if ((adDisplayImpl is VideoAdDisplay)){
adDisplayImpl.removeEventListener(AdUnitEvent.VIDEO_AD_DISPLAY_COMPLETE, onVideoAdDisplayComplete);
} else {
if ((adDisplayImpl is OverlayAdDisplay)){
adDisplayImpl.removeEventListener(AdUnitEvent.OVERLAY_AD_DISPLAY_COMPLETE, onOverlayAdDisplayComplete);
};
};
adDisplayImpl.removeEventListener(AdSlotErrorEvent.ERROR, onAdDisplayError);
_arg1.setAdUnit(this);
dispatchEvent(_arg1);
}
public function getAdsManager():AdsManager{
return (adsManager);
}
public function getAdDisplay():AbstractAdDisplay{
return (adDisplayImpl);
}
public function getRoadblocksManager():RoadblocksManager{
return ((hasMaster()) ? myMaster.getRoadblocksManager() : roadblocksManager);
}
private function removeAdLoadListeners(_arg1:IEventDispatcher):void{
_arg1.removeEventListener(AdLoadCompleteEvent.VIDEO_ADS_LOADED, onVideoAdsLoaded);
_arg1.removeEventListener(AdLoadCompleteEvent.F2F_ADS_LOADED, onF2FAdsLoaded);
_arg1.removeEventListener(AdLoadCompleteEvent.CUSTOM_ADS_LOADED, onCustomAdsLoaded);
_arg1.removeEventListener(AdSlotErrorEvent.ERROR, onError);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function wasDisplayed():Boolean{
return ((displayCount > 0));
}
private function handleError(_arg1:String):void{
var _local2:AdSlotError;
var _local3:AdSlotErrorEvent;
errorState = true;
_local2 = new AdSlotError(_arg1);
_local3 = new AdSlotErrorEvent(_local2);
_local3.setAdUnit(this);
dispatchEvent(_local3);
}
public function destroy():void{
if (adDisplayImpl){
adDisplayImpl.clearDisplay();
};
}
private function onVideoAdDisplayComplete(_arg1:AdUnitEvent):void{
debug("onVideoAdDisplayComplete");
adDisplayImpl.removeEventListener(AdUnitEvent.VIDEO_AD_DISPLAY_COMPLETE, onVideoAdDisplayComplete);
adDisplayImpl.removeEventListener(AdSlotErrorEvent.ERROR, onAdDisplayError);
dispatchEvent(_arg1);
}
public function setRoadblocksManager(_arg1:RoadblocksManager):void{
this.roadblocksManager = _arg1;
}
}
}//package com.doubleclick.adslot
Section 40
//AdUnitEvent (com.doubleclick.adslot.AdUnitEvent)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
public class AdUnitEvent extends Event {
private var adUnit:AdUnit;
private var videoPlayer:DisplayObject;// = null
public static const MASTER_AD_START:String = "masterAdStart";
public static const MIDROLL_READY:String = "midrollReady";
public static const OVERLAY_AD_DISPLAY_COMPLETE:String = "overlayAdDisplayComplete";
public static const VIDEO_AD_DISPLAY_COMPLETE:String = "videoAdDisplayComplete";
public static const AD_DISPLAY_START:String = "adDisplayStart";
public static const AD_DISPLAY_LOADED:String = "adDisplayLoaded";
public function AdUnitEvent(_arg1:String){
videoPlayer = null;
super(_arg1);
}
public function getAdUnit():AdUnit{
return (adUnit);
}
public function getVideoPlayer():DisplayObject{
return (videoPlayer);
}
public function setAdUnit(_arg1:AdUnit):void{
this.adUnit = _arg1;
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function getAdsManager():AdsManager{
return (adUnit.getAdsManager());
}
override public function clone():Event{
var _local1:AdUnitEvent;
_local1 = new AdUnitEvent(type);
_local1.setAdUnit(adUnit);
_local1.setVideoPlayer(videoPlayer);
return (_local1);
}
public function setVideoPlayer(_arg1:DisplayObject):void{
this.videoPlayer = _arg1;
}
}
}//package com.doubleclick.adslot
Section 41
//AdUnits (com.doubleclick.adslot.AdUnits)
package com.doubleclick.adslot {
public interface AdUnits {
function resetAds():void;
}
}//package com.doubleclick.adslot
Section 42
//AdUnitsFactory (com.doubleclick.adslot.AdUnitsFactory)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import com.doubleclick.adslot.validation.*;
public class AdUnitsFactory {
public static function createMidrollAdUnit(_arg1:Number, _arg2:Object):AdUnit{
var _local3:Number;
var _local4:AdUnit;
_local3 = _arg2.startTime;
_local4 = createAdUnit(_arg1, _arg2);
if (NumberValidator.isPositiveNumber(_local3)){
_local4.setDisplayStartTime(_local3);
};
return (_local4);
}
public static function createAdUnit(_arg1:Number, _arg2:Object):AdUnit{
var _local3:MaskControl;
var _local4:String;
var _local5:Number;
var _local6:Array;
var _local7:Boolean;
var _local8:Boolean;
var _local9:AdsRequest;
var _local10:AdUnit;
var _local11:AdLoader;
_local3 = _arg2.maskControl;
_local4 = _arg2.url;
_local5 = _arg2.duration;
_local6 = _arg2.companionTypes;
_local7 = _arg2.overlay;
_local8 = _arg2.companionOfPreviousAd;
_local9 = AdsRequestCreator.getAdsRequestObject(_arg2);
_local10 = new AdUnit(_local7, _arg1, _local5, _local6);
if (_local10.hasFlashCompanions()){
_local10.setRoadblocksManager(new RoadblocksManager(_local4));
};
_local11 = new AdLoader(_local9);
_local10.setMaskControl(_local3);
_local10.setAdLoader(_local11);
return (_local10);
}
private static function debug(_arg1:String):void{
Logger.debug(_arg1, "AdUnitsFactory");
}
}
}//package com.doubleclick.adslot
Section 43
//AdUnitsImpl (com.doubleclick.adslot.AdUnitsImpl)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import com.doubleclick.adslot.validation.*;
import com.doubleclick.adslot.common.*;
public class AdUnitsImpl extends EventDispatcher implements AdUnits {
private var playSequence:Array;
private var videoPlaybackManager:VideoPlaybackManager;
private var postroll:AdUnit;
private var preroll:AdUnit;
private var adUnitsReset:Boolean;
private var midrollUnits:Array;
private var clickTrackingElement:Object;
private var undisplayedMidrollUnits:Array;
private var unorderedAdUnits:Array;
private var resetAdsCalled:Boolean;
private var adUnitValidator:AdUnitValidator;
private var contentComplete:Boolean;
private var maskControl:MaskControl;
private var adsData:Object;
private static const PREROLL:String = "Preroll";
private static const MIDROLL:String = "Midroll";
private static const POSTROLL:String = "Postroll";
public function AdUnitsImpl(){
this.unorderedAdUnits = [];
this.midrollUnits = [];
this.undisplayedMidrollUnits = [];
this.playSequence = [];
}
public function setupAds(_arg1:Object):void{
var _local2:String;
var _local3:Number;
var _local4:Object;
var _local5:Array;
var _local6:int;
var _local7:String;
var _local8:Number;
var _local9:Object;
var _local10:Object;
var _local11:Object;
this.adsData = _arg1;
validateAdSlotSettings();
_local2 = AdSlotSettings.prerollAdTag;
_local3 = _arg1.prerollAdDuration;
debug(("adsData.prerollDynamicallyAllocated = " + _arg1.prerollDynamicallyAllocated));
debug(("adsData.prerollAdType = " + _arg1.prerollAdType));
debug(("adsData.prerollMaxTotalAdDuration = " + _arg1.prerollMaxTotalAdDuration));
debug(("AdSlotSettings.prerollChannels = " + AdSlotSettings.prerollChannels));
_local4 = {maskControl:maskControl, url:_local2, adSlotWidth:AdSlot.getInstance().getAdSlotWidth(), adSlotHeight:AdSlot.getInstance().getAdSlotHeight(), overlay:_arg1.isPrerollOverlay, duration:_local3, startTime:0, companionTypes:_arg1.prerollCompanionAdTypes, companionOfPreviousAd:false, dynamicallyAllocated:_arg1.prerollDynamicallyAllocated, adType:_arg1.prerollAdType, maxTotalAdDuration:_arg1.prerollMaxTotalAdDuration, channels:AdSlotSettings.prerollChannels};
_local4.valid = adUnitValidator.isValid(AdTiming.ON_PREROLL, _local4);
_local5 = [];
_local6 = 0;
while (_local6 < _arg1.midrollAdTags.length) {
_local11 = {};
if (_local6 < DynamicSettingsUtil.MAX_DYNAMIC_MIDROLL_ADS){
_local11.url = AdSlotSettings[DynamicSettingsUtil.getMidrollAdTagName((_local6 + 1))];
_local11.channels = AdSlotSettings[DynamicSettingsUtil.getMidrollChannelsName((_local6 + 1))];
} else {
_local11.url = _arg1.midrollAdTags[_local6];
_local11.channels = ((_local6 < _arg1.midrollChannels.length)) ? _arg1.midrollChannels[_local6] : "";
};
_local11.maskControl = maskControl;
_local11.adSlotWidth = AdSlot.getInstance().getAdSlotWidth();
_local11.adSlotHeight = AdSlot.getInstance().getAdSlotHeight();
_local11.overlay = _arg1.isMidrollAdOverlay[_local6];
_local11.duration = ((_local6 < _arg1.midrollAdDurations.length)) ? _arg1.midrollAdDurations[_local6] : "";
_local11.startTime = ((_local6 < _arg1.midrollAdOffsets.length)) ? _arg1.midrollAdOffsets[_local6] : "";
_local11.companionTypes = ((_local6 < _arg1.midrollCompanionAdTypes.length)) ? _arg1.midrollCompanionAdTypes[_local6].split(",") : [];
_local11.companionOfPreviousAd = ((_local6 < _arg1.midrollCompanionOfPreviousAd.length)) ? _arg1.midrollCompanionOfPreviousAd[_local6] : "";
_local11.dynamicallyAllocated = ((_local6 < _arg1.midrollDynamicallyAllocated.length)) ? _arg1.midrollDynamicallyAllocated[_local6] : false;
_local11.adType = ((_local6 < _arg1.midrollAdTypes.length)) ? _arg1.midrollAdTypes[_local6] : "";
_local11.maxTotalAdDuration = ((_local6 < _arg1.midrollMaxTotalAdDurations.length)) ? _arg1.midrollMaxTotalAdDurations[_local6] : "";
_local11.valid = adUnitValidator.isValid(AdTiming.ON_MIDROLL, _local11);
_local5.push(_local11);
_local6++;
};
_local7 = AdSlotSettings.postrollAdTag;
_local8 = _arg1.postrollAdDuration;
_local9 = {maskControl:maskControl, url:_local7, adSlotWidth:AdSlot.getInstance().getAdSlotWidth(), adSlotHeight:AdSlot.getInstance().getAdSlotHeight(), overlay:_arg1.isPostrollOverlay, duration:_local8, companionTypes:_arg1.postrollCompanionAdTypes, companionOfPreviousAd:_arg1.postrollCompanionOfPreviousAd, dynamicallyAllocated:_arg1.postrollDynamicallyAllocated, adType:_arg1.postrollAdType, maxTotalAdDuration:_arg1.postrollMaxTotalAdDuration, channels:AdSlotSettings.postrollChannels};
_local9.valid = adUnitValidator.isValid(AdTiming.ON_POSTROLL, _local9);
_local10 = adUnitValidator.validateDependantInputs(_local4, _local5, _local9);
createAdUnits(_local10.preroll, _local10.midrolls, _local10.postroll);
}
public function hasMidrolls():Boolean{
return (((midrollUnits) && ((midrollUnits.length > 0))));
}
public function getNextAdUnitInPlaySequence(_arg1:AdUnit):AdUnit{
var _local2:Number;
_local2 = 0;
while (_local2 < playSequence.length) {
if (playSequence[_local2] == _arg1){
if ((_local2 + 1) < playSequence.length){
return (playSequence[(_local2 + 1)]);
};
};
_local2++;
};
return (null);
}
public function getPlaySequence():Array{
return (playSequence);
}
public function getPostroll():AdUnit{
return (postroll);
}
public function setVideoPlaybackManager(_arg1:VideoPlaybackManager):void{
var _local2:Number;
this.videoPlaybackManager = _arg1;
_local2 = 0;
while (_local2 < unorderedAdUnits.length) {
unorderedAdUnits[_local2].setVideoPlaybackManager(_arg1);
_local2++;
};
}
public function getFirstAdUnitInPlaySequence():AdUnit{
if (playSequence.length > 0){
return (playSequence[0]);
};
return (null);
}
public function getAdUnitValidator():AdUnitValidator{
return (adUnitValidator);
}
public function setMaskControl(_arg1:MaskControl):void{
this.maskControl = _arg1;
}
public function setClickTrackingElement(_arg1:Object):void{
var _local2:Number;
this.clickTrackingElement = _arg1;
_local2 = 0;
while (_local2 < unorderedAdUnits.length) {
unorderedAdUnits[_local2].setClickTrackingElement(_arg1);
_local2++;
};
}
public function setAdsLoader(_arg1:AdsLoader):void{
var _local2:Number;
debug("setAdsLoader");
_local2 = 0;
while (_local2 < unorderedAdUnits.length) {
unorderedAdUnits[_local2].setAdsLoader(_arg1);
_local2++;
};
}
public function set validator(_arg1:AdUnitValidator):void{
this.adUnitValidator = new AdUnitValidator();
}
public function setPostroll(_arg1:AdUnit):void{
postroll = _arg1;
addUnit(_arg1);
}
private function dispatchAdSlotSettingsInvalidError(_arg1:String):void{
var _local2:AdSlotErrorEvent;
_local2 = new AdSlotErrorEvent(new AdSlotError((_arg1 + ErrorMessages.AD_TAG_CANNOT_BE_SET_IN_ADSLOTSETTINGS)));
dispatchEvent(_local2);
}
public function hasPreroll():Boolean{
if (preroll){
return (true);
};
return (false);
}
public function getContentComplete():Boolean{
return (contentComplete);
}
public function onContentComplete():void{
debug("onContentComplete");
contentComplete = true;
if (resetAdsCalled){
resetAds();
};
}
public function getResetAdsCalled():Boolean{
return (resetAdsCalled);
}
private function allAdUnitsCreated():void{
sortByPlayOrder();
setMidrollsByPlayOrder();
adUnitsReset = false;
}
private function isCompanionAdUnitData(_arg1:Object):Boolean{
return (Boolean(_arg1.master));
}
public function getMidrolls():Array{
return (midrollUnits);
}
private function addUnit(_arg1:AdUnit):void{
if (((!(videoPlaybackManager)) || (adUnitsReset))){
unorderedAdUnits.push(_arg1);
} else {
throw (new Error(("Code bug: can not add ad units after playback" + "manager has been set.")));
};
}
private function validateAdSlotSettings():void{
var _local1:int;
if (((StringUtils.isNullOrEmpty(adsData.prerollAdTag)) && (AdSlotSettings.prerollAdTag))){
AdSlotSettings.prerollAdTag = null;
dispatchAdSlotSettingsInvalidError(PREROLL);
};
_local1 = adsData.midrollAdTags.length;
while (_local1 < DynamicSettingsUtil.MAX_DYNAMIC_MIDROLL_ADS) {
if (AdSlotSettings[DynamicSettingsUtil.getMidrollAdTagName((_local1 + 1))]){
AdSlotSettings[DynamicSettingsUtil.getMidrollAdTagName((_local1 + 1))] = null;
dispatchAdSlotSettingsInvalidError((MIDROLL + (_local1 + 1)));
};
_local1++;
};
if (((StringUtils.isNullOrEmpty(adsData.postrollAdTag)) && (AdSlotSettings.postrollAdTag))){
AdSlotSettings.postrollAdTag = null;
dispatchAdSlotSettingsInvalidError(POSTROLL);
};
}
private function setAdUnitMasterForCompanions(_arg1:Object, _arg2:AdUnit):void{
var _local3:int;
var _local4:Object;
_local3 = 0;
while (_local3 < _arg1.companions.length) {
_local4 = _arg1.companions[_local3];
_local4.masterAdUnit = _arg2;
_local3++;
};
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function processMidrollAdUnits(_arg1:Number, _arg2:Number):void{
var _local3:Number;
var _local4:AdUnit;
var _local5:AdUnitEvent;
_local3 = 0;
while (_local3 < undisplayedMidrollUnits.length) {
_local4 = undisplayedMidrollUnits[_local3];
if (((_local4.isReadyForDisplay(_arg1)) && ((_local4.getDisplayStartTime() > _arg2)))){
undisplayedMidrollUnits.splice(_local3, 1);
_local5 = new AdUnitEvent(AdUnitEvent.MIDROLL_READY);
_local5.setAdUnit(_local4);
dispatchEvent(_local5);
break;
};
_local3++;
};
}
public function hasPostroll():Boolean{
if (postroll){
return (true);
};
return (false);
}
public function addMidrollAdUnit(_arg1:AdUnit):void{
midrollUnits.push(_arg1);
undisplayedMidrollUnits.push(_arg1);
addUnit(_arg1);
_arg1.addEventListener("onAdDisplayError", onAdDisplayError);
}
private function isMasterAdUnitData(_arg1:Object):Boolean{
return (((_arg1.companions) && ((_arg1.companions.length > 0))));
}
public function setPreroll(_arg1:AdUnit):void{
preroll = _arg1;
addUnit(_arg1);
}
public function resetAds():void{
debug(("contentComplete = " + contentComplete));
if (contentComplete){
resetAdsCalled = false;
contentComplete = false;
debug("resetAds");
AdSlot.getInstance().resetAds();
videoPlaybackManager.resetContentPlayheadPosition();
adUnitsReset = true;
if (hasPreroll()){
videoPlaybackManager.resetIfContentReplayed(AdTiming.ON_PREROLL);
} else {
videoPlaybackManager.resetIfContentReplayed();
};
} else {
resetAdsCalled = true;
};
}
public function hasMidrollAdsToDisplay():Boolean{
return ((undisplayedMidrollUnits.length > 0));
}
private function processMidrollAdUnitError(_arg1:AdUnit):void{
var _local2:Number;
var _local3:AdUnit;
_local2 = 0;
while (_local2 < undisplayedMidrollUnits.length) {
_local3 = undisplayedMidrollUnits[_local2];
if (_local3 === _arg1){
undisplayedMidrollUnits.splice(_local2, 1);
return;
};
_local2++;
};
}
private function sortByPlayOrder():void{
var comparator:Function;
if (preroll){
playSequence.push(preroll);
};
comparator = function (_arg1:AdUnit, _arg2:AdUnit):Number{
var _local3:Number;
var _local4:Number;
_local3 = _arg1.getDisplayStartTime();
_local4 = _arg2.getDisplayStartTime();
if (_local3 < _local4){
return (-1);
};
if (_local3 > _local4){
return (1);
};
return (0);
};
playSequence = playSequence.concat(midrollUnits.sort(comparator));
if (postroll){
playSequence.push(postroll);
};
}
private function onAdDisplayError(_arg1:Object):void{
var _local2:AdUnit;
_local2 = _arg1.target;
switch (_local2.getAdTiming()){
case AdTiming.ON_MIDROLL:
processMidrollAdUnitError(_local2);
break;
};
}
public function getPreroll():AdUnit{
return (preroll);
}
private function setMidrollsByPlayOrder():void{
var _local1:int;
var _local2:int;
_local1 = 0;
if (hasPreroll()){
_local1 = 1;
};
_local2 = playSequence.length;
if (hasPostroll()){
_local2 = (playSequence.length - 1);
};
midrollUnits = playSequence.slice(_local1, _local2);
}
public function createAdUnits(_arg1:Object, _arg2:Array, _arg3:Object):void{
var _local4:int;
var _local5:AdUnit;
var _local6:Object;
var _local7:AdUnit;
var _local8:AdUnit;
if (_arg1){
_local5 = AdUnitsFactory.createAdUnit(AdTiming.ON_PREROLL, _arg1);
setPreroll(_local5);
if (isMasterAdUnitData(_arg1)){
setAdUnitMasterForCompanions(_arg1, _local5);
};
};
_local4 = 0;
while (_local4 < _arg2.length) {
_local6 = _arg2[_local4];
if (_local6){
_local7 = AdUnitsFactory.createMidrollAdUnit(AdTiming.ON_MIDROLL, _local6);
addMidrollAdUnit(_local7);
if (isMasterAdUnitData(_local6)){
setAdUnitMasterForCompanions(_local6, _local7);
} else {
if (isCompanionAdUnitData(_local6)){
_local7.setMyMaster(_local6.masterAdUnit);
_local7.getMyMaster().registerMasterAdSlotCompanionAdUnit(_local7);
};
};
};
_local4++;
};
if (_arg3){
_local8 = AdUnitsFactory.createAdUnit(AdTiming.ON_POSTROLL, _arg3);
setPostroll(_local8);
if (isMasterAdUnitData(_arg3)){
setAdUnitMasterForCompanions(_arg3, _local8);
} else {
if (isCompanionAdUnitData(_arg3)){
_local8.setMyMaster(_arg3.masterAdUnit);
_local8.getMyMaster().registerMasterAdSlotCompanionAdUnit(_local8);
};
};
};
allAdUnitsCreated();
}
}
}//package com.doubleclick.adslot
Section 44
//AvailabilityForecastAdDisplay (com.doubleclick.adslot.AvailabilityForecastAdDisplay)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import com.doubleclick.adslot.common.*;
public class AvailabilityForecastAdDisplay extends AbstractAdDisplay {
private static const US_CUSTOM_ROOT_NODE:String = "richMedia";
private static const EMEA_CUSTOM_ROOT_NODE:String = "xml";
public function AvailabilityForecastAdDisplay(_arg1:AdsManager, _arg2:VideoPlaybackManager=null){
super(_arg1, _arg2, null);
}
override public function displayAd(_arg1:Number):void{
if (!getIsCurrentSlotCompanion()){
if (isAutoPlay(_arg1)){
display();
} else {
getVideoPlaybackManager().addEventListener("onPlay", onPlay);
};
} else {
display();
};
}
private function logImpression():void{
var _local1:XML;
var _local2:String;
_local1 = new XML((getAdsManager().ads[0] as CustomContentAd).content);
_local2 = _local1.fullImpression.text();
debug(("impressionUrl = " + _local2));
if (_local2){
URLUtils.ping(_local2);
};
}
override public function clearDisplay():void{
}
private function onPlay(_arg1:Event):void{
debug("onPlay");
getVideoPlaybackManager().removeEventListener("onPlay", onPlay);
if (((getAdsManager()) && (!(isCurrentlyDisplayed())))){
display();
};
}
private function display():void{
setCurrentlyDisplayed(true);
logImpression();
}
override public function requiresContentPausing():Boolean{
return (false);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public static function isAvailabilityForecastAd(_arg1:CustomContentAd):Boolean{
var _local2:String;
var _local3:XML;
var _local4:String;
_local2 = _arg1.content;
_local3 = new XML(_local2);
if (isValidRootNode(_local3)){
_local4 = _local3.fullImpression.text();
if (_local4){
return (true);
};
};
return (false);
}
private static function isValidRootNode(_arg1:XML):Boolean{
if ((((_arg1.localName() == US_CUSTOM_ROOT_NODE)) || ((_arg1.localName() == EMEA_CUSTOM_ROOT_NODE)))){
return (true);
};
return (false);
}
}
}//package com.doubleclick.adslot
Section 45
//ClickArea (com.doubleclick.adslot.ClickArea)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import flash.events.*;
public class ClickArea extends EventDispatcher {
protected var area:Sprite;// = null
protected var playback:Object;// = null
public function ClickArea(){
playback = null;
area = null;
super();
}
protected function getAreaContainer():DisplayObjectContainer{
return (null);
}
private function drawRectangle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
debug(((((((("drawRectangle at x:" + _arg1) + " y:") + _arg2) + " ") + _arg3) + "x") + _arg4));
area = new Sprite();
area.graphics.beginFill(120);
area.graphics.drawRect(_arg1, _arg2, _arg3, _arg4);
area.alpha = 0;
area.graphics.endFill();
}
protected function initClickArea():void{
debug(("initClickArea:" + getAreaContainer()));
destroyArea();
drawRectangle(x, y, width, height);
getAreaContainer().addChild(area);
positionJustAboveVideo();
dispatchEvent(new Event("clickAreaCreated"));
}
protected function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function setPlayback(_arg1:Object):void{
debug("setPlayback");
this.playback = _arg1;
}
protected function get width():Number{
return (playback.width);
}
private function destroyArea():void{
if (area){
getAreaContainer().removeChild(area);
area = null;
};
}
protected function get height():Number{
return (computeHeight());
}
protected function positionJustAboveVideo():void{
}
protected function get x():Number{
return (-1);
}
protected function get y():Number{
return (-1);
}
public function destroy():void{
debug("destroy");
destroyArea();
}
public function create():Sprite{
debug("create");
initClickArea();
return (area);
}
protected function computeHeight():Number{
return (-1);
}
}
}//package com.doubleclick.adslot
Section 46
//ClickTrackingManager (com.doubleclick.adslot.ClickTrackingManager)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import flash.media.*;
public class ClickTrackingManager {
private var clickable:InteractiveObject;// = null
private var addedToStage:Boolean;// = false
private var graphics:Graphics;// = null
private var scaleMode:String;// = null
private var playbackInstance:Object;// = null
private var videoInstance:Object;// = null
public function ClickTrackingManager(_arg1:Object){
playbackInstance = null;
clickable = null;
addedToStage = false;
graphics = null;
videoInstance = null;
scaleMode = null;
super();
this.playbackInstance = _arg1;
init();
}
private function init():void{
if ((playbackInstance is Video)){
videoInstance = (playbackInstance as Video);
} else {
scaleMode = playbackInstance.scaleMode;
if (scaleMode != "exactFit"){
playbackInstance.scaleMode = "exactFit";
};
videoInstance = playbackInstance.getChildAt(playbackInstance.visibleVideoPlayerIndex);
};
clickable = new Sprite();
graphics = (clickable as Sprite).graphics;
graphics.beginFill(120);
graphics.drawRect(videoInstance.x, videoInstance.y, videoInstance.width, videoInstance.height);
clickable.alpha = 0;
graphics.endFill();
}
public function display():void{
AdSlot.getStage().addChild(clickable);
addedToStage = true;
}
public function remove():void{
if (addedToStage){
AdSlot.getStage().removeChild(clickable);
addedToStage = false;
if ((playbackInstance is Video)){
} else {
resetFLVPlaybackScaleMode();
};
};
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function setClickableElement(_arg1:InteractiveObject):void{
this.clickable = _arg1;
}
private function resetFLVPlaybackScaleMode():void{
playbackInstance.scaleMode = scaleMode;
}
public function getClickableElement():InteractiveObject{
return (clickable);
}
}
}//package com.doubleclick.adslot
Section 47
//CompanionRetrievalMethods (com.doubleclick.adslot.CompanionRetrievalMethods)
package com.doubleclick.adslot {
public class CompanionRetrievalMethods {
public static var SAME_ORD:String = "sameOrd";
public static var DC_SEED:String = "dcSeed";
}
}//package com.doubleclick.adslot
Section 48
//DynamicSettingsUtil (com.doubleclick.adslot.DynamicSettingsUtil)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import flash.utils.*;
import com.doubleclick.adslot.common.*;
public class DynamicSettingsUtil {
private static const MIDROLL:String = "midroll";
private static const CHANNELS:String = "Channels";
public static const MAX_DYNAMIC_MIDROLL_ADS:Number = 5;
private static const AD_TAG:String = "AdTag";
private static function isAdUnitPresentInUI(_arg1:String):Boolean{
return (!(StringUtils.isNullOrEmpty(_arg1)));
}
public static function setValuesFromUI(_arg1:AdSlot):void{
var _local2:int;
AdSlotSettings.prerollAdTag = _arg1.prerollAdTag;
AdSlotSettings.prerollChannels = _arg1.prerollChannels;
_local2 = 0;
while ((((_local2 < _arg1.midrollAdTags.length)) && ((_local2 < MAX_DYNAMIC_MIDROLL_ADS)))) {
AdSlotSettings[getMidrollAdTagName((_local2 + 1))] = _arg1.midrollAdTags[_local2];
AdSlotSettings[getMidrollChannelsName((_local2 + 1))] = _arg1.midrollChannels[_local2];
_local2++;
};
AdSlotSettings.postrollAdTag = _arg1.postrollAdTag;
AdSlotSettings.postrollChannels = _arg1.postrollChannels;
}
public static function setValuesFromFlashVars(_arg1:Object):void{
var _local2:String;
var _local3:XML;
var _local4:XMLList;
var _local5:String;
for (_local2 in _arg1) {
_local3 = describeType(AdSlotSettings);
_local4 = _local3..accessor.@name;
for each (_local5 in _local4) {
if (_local2 == _local5){
if (_local2.indexOf(AD_TAG) != -1){
if (isAdUnitPresentInUI(AdSlotSettings[_local5])){
AdSlotSettings[_local5] = String(_arg1[_local2]);
};
} else {
AdSlotSettings[_local5] = String(_arg1[_local2]);
};
};
};
};
}
public static function getMidrollChannelsName(_arg1:int):String{
return (((MIDROLL + _arg1) + CHANNELS));
}
public static function getMidrollAdTagName(_arg1:int):String{
return (((MIDROLL + _arg1) + AD_TAG));
}
public static function initialize(_arg1:AdSlot):void{
setValuesFromUI(_arg1);
setValuesFromFlashVars(_arg1.root.loaderInfo.parameters);
}
private static function debug(_arg1:String):void{
Logger.debug(_arg1, "DynamicSettingsUtil");
}
}
}//package com.doubleclick.adslot
Section 49
//ErrorMessages (com.doubleclick.adslot.ErrorMessages)
package com.doubleclick.adslot {
public class ErrorMessages {
public static const AD_TAG_CANNOT_BE_SET_IN_ADSLOTSETTINGS:String = " is not present in the UI. Hence its values cannot be set through AdSlotSettings.";
public static const MEDIA_URL_NOT_PRESENT:String = "Media url is not present in the Video ad.";
public static const RESET_ADS_CANNOT_BE_CALLED_CONTENT_NOT_COMPLETE:String = "Content has not completed. Ads can be reset only after the content has finished playing.";
}
}//package com.doubleclick.adslot
Section 50
//EventBasedDisplayModel (com.doubleclick.adslot.EventBasedDisplayModel)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
public class EventBasedDisplayModel extends AbstractDisplayModel {
public function EventBasedDisplayModel(_arg1:AdsManager){
super(_arg1);
_arg1.addEventListener(AdEvent.CONTENT_RESUME_REQUESTED, onContentResumeRequested);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
override public function clearDisplay():void{
var _local1:Event;
debug("clearDisplay");
_local1 = new Event("onEventBasedDisplayModelComplete", false, false);
dispatchEvent(_local1);
}
private function onContentResumeRequested(_arg1:Object):void{
debug("onContentResumeRequested");
getAdsManager().removeEventListener(AdEvent.CONTENT_RESUME_REQUESTED, onContentResumeRequested);
clearDisplay();
}
}
}//package com.doubleclick.adslot
Section 51
//MaskControl (com.doubleclick.adslot.MaskControl)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
public class MaskControl {
private var objectToBeMasked:DisplayObjectContainer;// = null
private var maskHeight:Number;// = 0
private var masking:Boolean;// = false
private var masker:Sprite;// = null
private var maskWidth:Number;// = 0
public function MaskControl(_arg1:Number, _arg2:Number, _arg3:DisplayObjectContainer){
masking = false;
maskWidth = 0;
maskHeight = 0;
masker = null;
objectToBeMasked = null;
super();
this.maskWidth = _arg1;
this.maskHeight = _arg2;
this.objectToBeMasked = _arg3;
masker = new Sprite();
masker.graphics.beginFill(0xFF0000);
masker.graphics.drawRect(0, 0, _arg1, _arg2);
}
public function unmask():void{
if (objectToBeMasked.contains(masker)){
objectToBeMasked.removeChild(masker);
};
objectToBeMasked.mask = null;
}
public function isOn():Boolean{
return (masking);
}
public function turnOff():void{
masking = false;
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function mask():void{
if (!objectToBeMasked.contains(masker)){
objectToBeMasked.addChild(masker);
};
objectToBeMasked.mask = masker;
}
public function turnOn():void{
debug("mask on");
masking = true;
}
}
}//package com.doubleclick.adslot
Section 52
//NativeVideoPlaybackFinder (com.doubleclick.adslot.NativeVideoPlaybackFinder)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import flash.media.*;
import flash.events.*;
import flash.utils.*;
public class NativeVideoPlaybackFinder extends EventDispatcher {
private var jwPlayerInstance:Object;// = null
private var nativeVideoPlaybackInstance:Object;// = null
private var videoInstanceName:String;// = null
private var stage:Stage;// = null
public function NativeVideoPlaybackFinder(_arg1:Stage, _arg2:String){
nativeVideoPlaybackInstance = null;
stage = null;
videoInstanceName = null;
jwPlayerInstance = null;
super();
this.stage = _arg1;
this.videoInstanceName = _arg2;
_arg1.addEventListener(Event.ADDED_TO_STAGE, onDisplayObjectAddedToStage, true);
debug((("NativeVideoPlaybackFinder:videoInstanceName {" + _arg2) + "}"));
}
private function isVideoPlayback(_arg1:Object):Boolean{
if (videoInstanceName){
if (videoInstanceName != _arg1.name){
return (false);
};
};
return (((((isFLVPlaybackInstance(_arg1)) || (isVideoInstance(_arg1)))) && (!(isVideoPlayerInstance(_arg1)))));
}
private function onDisplayObjectAddedToStage(_arg1:Event):void{
var _local2:Object;
_local2 = _arg1.target;
if (isVideoPlayback(_local2)){
nativeVideoPlaybackInstance = _local2;
dispatchEvent(new Event(Event.ADDED_TO_STAGE));
debug(("notified about:" + _arg1.target));
};
}
public function findJWPlayerInstance(_arg1:DisplayObjectContainer):Object{
var _local2:DisplayObject;
var _local3:uint;
var _local4:Object;
_local2 = null;
if (getQualifiedClassName(_arg1) == "com.jeroenwijering.player::Player"){
debug("FOUND THE JW PLAYER...YEAH!!!");
return (_arg1);
};
_local3 = 0;
while (_local3 < _arg1.numChildren) {
_local2 = _arg1.getChildAt(_local3);
_local4 = null;
if ((_local2 is DisplayObjectContainer)){
_local4 = findJWPlayerInstance((_local2 as DisplayObjectContainer));
};
if (_local4){
return (_local4);
};
_local3++;
};
return (null);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function isFLVPlaybackUsed():Boolean{
return (isFLVPlaybackInstance(nativeVideoPlaybackInstance));
}
public function getJWPlayerInstance():Object{
return (jwPlayerInstance);
}
public function isVideoUsed():Boolean{
return (isVideoInstance(nativeVideoPlaybackInstance));
}
public function findJWPlayer():void{
jwPlayerInstance = findJWPlayerInstance(stage);
debug(("jwPlayerInstance = " + jwPlayerInstance));
}
public function findNativeVideoPlaybackInstance(_arg1:DisplayObjectContainer):Object{
var _local2:DisplayObject;
var _local3:uint;
var _local4:Object;
_local2 = null;
_local3 = 0;
while (_local3 < _arg1.numChildren) {
_local2 = _arg1.getChildAt(_local3);
if (((_local2) && (isVideoPlayback(_local2)))){
return (_local2);
};
_local4 = null;
if ((_local2 is DisplayObjectContainer)){
_local4 = findNativeVideoPlaybackInstance((_local2 as DisplayObjectContainer));
};
if (((_local4) && (isVideoPlayback(_local4)))){
return (_local4);
};
_local3++;
};
return (null);
}
public function getNativeVideoPlaybackInstance():Object{
return (nativeVideoPlaybackInstance);
}
private function isVideoInstance(_arg1:Object):Boolean{
return ((_arg1 is Video));
}
private function isVideoPlayerInstance(_arg1:Object):Boolean{
var _local2:Class;
_local2 = RuntimeDefinitions.getVideoPlayerClass();
if (_local2){
return ((_arg1 is _local2));
};
return (false);
}
public function findNativeVideoPlayback():void{
nativeVideoPlaybackInstance = findNativeVideoPlaybackInstance(stage);
}
private function isFLVPlaybackInstance(_arg1:Object):Boolean{
var _local2:Class;
_local2 = RuntimeDefinitions.getFLVPlaybackClass();
if (_local2){
return ((_arg1 is _local2));
};
return (false);
}
}
}//package com.doubleclick.adslot
Section 53
//OverlayAdDisplay (com.doubleclick.adslot.OverlayAdDisplay)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
public class OverlayAdDisplay extends AbstractAdDisplay {
private var displayModel:AbstractDisplayModel;// = null
private var adAsset:Object;// = null
private var masker:DisplayObject;// = null
private var ad:Object;// = null
private var displayDuration:Number;// = -1
private static const DEFAULT_DISPLAY_DURATION:int = 15;
public function OverlayAdDisplay(_arg1:AdsManager, _arg2:Number, _arg3:VideoPlaybackManager=null, _arg4:Sprite=null){
displayDuration = -1;
ad = null;
adAsset = null;
displayModel = null;
masker = null;
super(_arg1, _arg3, _arg4);
this.displayDuration = _arg2;
}
override public function displayAd(_arg1:Number):void{
debug("displayAd");
if (!isCurrentlyDisplayed()){
if (!getIsCurrentSlotCompanion()){
getAdsManager().addEventListener(AdEvent.CONTENT_PAUSE_REQUESTED, onContentPauseRequested);
setAdsManagerDisplayProperties(AdSlot.getInstance());
createDisplayModel();
if (isAutoPlay(_arg1)){
displayMasterAd();
} else {
getVideoPlaybackManager().addEventListener("onPlay", onPlay);
};
} else {
setAdsManagerDisplayProperties(getDisplayObjectContainer());
getAdsManager().load();
getAdsManager().play();
setCurrentlyDisplayed(true);
};
};
}
private function displayMasterAd():void{
debug(("displayMasterAd getAdsManager() = " + getAdsManager()));
getAdsManager().load();
getAdsManager().play();
displayModel.start();
notifyAboutAdDisplayStart();
setCurrentlyDisplayed(true);
}
public function onOverlayAdDisplayComplete():void{
var _local1:AdUnitEvent;
debug("onOverlayAdDisplayComplete");
if (!getIsCurrentSlotCompanion()){
getAdsManager().removeEventListener(AdEvent.CONTENT_PAUSE_REQUESTED, onContentPauseRequested);
};
debug(("unloading the ad " + getAdsManager()));
getAdsManager().unload();
if (getMaskControl().isOn()){
getMaskControl().mask();
};
setCurrentlyDisplayed(false);
_local1 = new AdUnitEvent(AdUnitEvent.OVERLAY_AD_DISPLAY_COMPLETE);
_local1.setAdUnit(getAdUnit());
dispatchEvent(_local1);
}
private function createDisplayModel():void{
debug("createDisplayModel");
if (displayDuration == 0){
displayDuration = DEFAULT_DISPLAY_DURATION;
};
assignTimeBasedDisplayModel();
}
private function assignEventBasedDisplayModel():void{
debug("assignEventBasedDisplayModel");
displayModel = new EventBasedDisplayModel(getAdsManager());
displayModel.addEventListener("onEventBasedDisplayModelComplete", onEventBasedDisplayModelComplete);
}
override public function clearDisplay():void{
if (getAdsManager()){
if (displayModel){
displayModel.removeEventListener("onTimeBasedDisplayModelComplete", onTimeBasedDisplayModelComplete);
displayModel.removeEventListener("onEventBasedDisplayModelComplete", onEventBasedDisplayModelComplete);
};
getAdsManager().unload();
setCurrentlyDisplayed(false);
};
}
private function getFlashAdsManager():FlashAdsManager{
return ((getAdsManager() as FlashAdsManager));
}
private function onPlay(_arg1:Event):void{
debug("onPlay");
getVideoPlaybackManager().removeEventListener("onPlay", onPlay);
if (((getAdsManager()) && (!(isCurrentlyDisplayed())))){
displayMasterAd();
};
}
public function onTimeBasedDisplayModelComplete(_arg1:Event):void{
debug("onTimeBasedDisplayModelComplete");
displayModel.removeEventListener("onTimeBasedDisplayModelComplete", onTimeBasedDisplayModelComplete);
onOverlayAdDisplayComplete();
}
override public function requiresContentPausing():Boolean{
return (false);
}
private function onContentPauseRequested(_arg1:Object):void{
debug("onContentPauseRequested");
displayModel.removeEventListener("onTimeBasedDisplayModelComplete", onTimeBasedDisplayModelComplete);
displayModel.onModelConversion();
freezeContent();
assignEventBasedDisplayModel();
}
override public function isImage():Boolean{
return (false);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
private function assignTimeBasedDisplayModel():void{
debug("assignTimeBasedDisplayModel");
displayModel = new TimeBasedDisplayModel(getAdsManager(), displayDuration);
displayModel.addEventListener("onTimeBasedDisplayModelComplete", onTimeBasedDisplayModelComplete);
debug("after assignTimeBasedDisplayModel");
}
override public function isStaticResource():Boolean{
return (false);
}
private function freezeContent():void{
if (getVideoPlaybackManager()){
getVideoPlaybackManager().pauseContent();
};
}
public function onEventBasedDisplayModelComplete(_arg1:Event):void{
debug("onEventBasedDisplayModelComplete");
displayModel.removeEventListener("onEventBasedDisplayModelComplete", onEventBasedDisplayModelComplete);
onOverlayAdDisplayComplete();
if (getAdUnit().getAdTiming() != AdTiming.ON_POSTROLL){
getVideoPlaybackManager().resumeContent();
};
}
private function setAdsManagerDisplayProperties(_arg1:Object):void{
getFlashAdsManager().x = _arg1.x;
getFlashAdsManager().y = _arg1.y;
debug(("getFlashAdsManager().x = " + getFlashAdsManager().x));
debug(("getFlashAdsManager().y = " + getFlashAdsManager().y));
}
}
}//package com.doubleclick.adslot
Section 54
//RoadblocksManager (com.doubleclick.adslot.RoadblocksManager)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.doubleclick.adslot.validation.*;
public class RoadblocksManager {
private var tileInjector:TileInjector;// = null
private var masterHasTile:Boolean;// = false
private var tileType:String;// = null
private var companionRetrievalMethod:String;
private var instanceId:String;// = null
private var masterAdTag:String;// = null
private var adsManager:Object;// = null
private static var roadblocksManagers:Array = new Array();
public static var instancesCounter:Number = 0;
public function RoadblocksManager(_arg1:String){
instanceId = null;
masterAdTag = null;
tileType = null;
tileInjector = null;
companionRetrievalMethod = CompanionRetrievalMethods.DC_SEED;
adsManager = null;
masterHasTile = false;
super();
setMasterAdTag(_arg1);
this.instanceId = ("id_" + instancesCounter);
instancesCounter++;
}
public function setMasterAdTag(_arg1:String):void{
this.masterAdTag = _arg1;
initializeTileInjector(_arg1);
}
public function updateMasterAdsManager(_arg1:Object):void{
this.adsManager = _arg1;
}
public function getCompanionURL(_arg1:String, _arg2:String):String{
var _local3:String;
debug("getCompanionURL");
_local3 = null;
if (((adsManager.ads) && (adsManager.ads[0]))){
_local3 = adsManager.ads[0].getCompanionAdUrl("flash", ((_arg1 + "x") + _arg2));
};
debug(("companionBaseUrl = " + _local3));
return (_local3);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
private function initializeTileInjector(_arg1:String):void{
if (((!((_arg1.indexOf(TileTypes.PTILE) == -1))) || (!((_arg1.indexOf(TileTypes.TILE) == -1))))){
masterHasTile = true;
} else {
tileType = TileTypes.TILE;
tileInjector = new TileInjector(tileType, masterAdTag);
};
}
public function generateOrd():String{
return ((Math.floor((Math.random() * 100000)) + ""));
}
public function getTileType():String{
return (tileType);
}
private static function debug(_arg1:String):void{
Logger.debug(_arg1, "RoadblocksManager");
}
public static function relateMastersAndCompanions(_arg1:Object, _arg2:Array, _arg3:Object):Array{
var _local4:Array;
var _local5:Array;
var _local6:Object;
var _local7:int;
var _local8:Object;
_local4 = [];
_local5 = [];
if (_arg1){
_local5.push(_arg1);
};
if (_arg2){
_local5 = _local5.concat(_arg2);
};
if (_arg3){
_local5.push(_arg3);
};
if (_local5.length > 0){
_local6 = _local5[0];
_local6.companions = [];
_local7 = 1;
while (_local7 < _local5.length) {
_local8 = _local5[_local7];
if (_local8.companionOfPreviousAd){
_local6.companions.push(_local8);
_local8.master = _local6;
} else {
if (_local6.companions.length > 0){
_local4.push(_local6);
};
_local6 = _local8;
_local6.companions = [];
};
_local7++;
};
if (_local6.companions.length > 0){
_local4.push(_local6);
};
};
return (_local4);
}
public static function getDimensions(_arg1:String):Array{
var _local2:int;
var _local3:int;
var _local4:Number;
if (StringValidator.isNonEmpty(_arg1)){
_local2 = _arg1.lastIndexOf("sz");
_local3 = _arg1.indexOf(";", _local2);
if (_local3 == -1){
_local3 = _arg1.length;
};
if ((((_local2 > 0)) && ((_local3 > 0)))){
_local4 = (_local2 + 3);
return (_arg1.slice(_local4, _local3).split("x"));
};
};
return (null);
}
public static function getOrd(_arg1:String):String{
var _local2:Number;
var _local3:int;
var _local4:int;
_local2 = _arg1.lastIndexOf("ord");
if (_local2 != -1){
_local3 = _arg1.indexOf("ord");
_local4 = _arg1.indexOf(";", _local3);
if (_local4 == -1){
_local4 = _arg1.indexOf("?", _local3);
};
if (_local4 == -1){
_local4 = _arg1.length;
};
return (_arg1.slice((_local3 + 4), _local4));
};
return (null);
}
}
}//package com.doubleclick.adslot
Section 55
//RuntimeDefinitions (com.doubleclick.adslot.RuntimeDefinitions)
package com.doubleclick.adslot {
import flash.system.*;
public class RuntimeDefinitions {
private static function getDefinition(_arg1:String):Object{
var fullyQualifiedName = _arg1;
if (ApplicationDomain.currentDomain.hasDefinition(fullyQualifiedName)){
try {
return (ApplicationDomain.currentDomain.getDefinition(fullyQualifiedName));
} catch(error:Error) {
};
};
return (null);
}
public static function getVideoPlayerClass():Class{
return ((getDefinition("fl.video.VideoPlayer") as Class));
}
public static function getFLVPlaybackClass():Class{
return ((getDefinition("fl.video.FLVPlayback") as Class));
}
public static function getFLVPlaybackNamespace():Namespace{
return ((getDefinition("fl.video.flvplayback_internal") as Namespace));
}
}
}//package com.doubleclick.adslot
Section 56
//TileInjector (com.doubleclick.adslot.TileInjector)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.doubleclick.adslot.common.*;
public class TileInjector {
private var tileType:String;// = null
private var tileNumber:uint;// = 1
public static var MAX_TILE:uint = 16;
public function TileInjector(_arg1:String, _arg2:String){
tileNumber = 1;
tileType = null;
super();
this.tileType = _arg1;
}
public function getNextTileNumber():uint{
tileNumber++;
if (tileNumber > 16){
tileNumber = MAX_TILE;
};
return (tileNumber);
}
public function incrementTileNumber(_arg1:uint):void{
this.tileNumber = (this.tileNumber + _arg1);
}
public function getTileNumber():uint{
return (tileNumber);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function injectTile(_arg1:String):String{
var _local2:Number;
_local2 = getTileNumber();
trace(("tileType = " + tileType));
if (_arg1.indexOf((tileType + "=")) == -1){
if (_arg1.lastIndexOf(";") != (_arg1.length - 1)){
_arg1 = (_arg1 + ";");
};
_arg1 = (_arg1 + ((tileType + "=") + _local2));
} else {
_arg1 = StringUtils.injectNewValueForKey(_arg1, tileType, (_local2 + ""), ";");
};
incrementTileNumber(1);
return (_arg1);
}
}
}//package com.doubleclick.adslot
Section 57
//TileTypes (com.doubleclick.adslot.TileTypes)
package com.doubleclick.adslot {
public class TileTypes {
public static var PTILE:String = "ptile";
public static var TILE:String = "tile";
}
}//package com.doubleclick.adslot
Section 58
//TimeBasedDisplayModel (com.doubleclick.adslot.TimeBasedDisplayModel)
package com.doubleclick.adslot {
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
public class TimeBasedDisplayModel extends AbstractDisplayModel {
private var displayTimer:Timer;// = null
private var displayDuration:Number;// = -1
public function TimeBasedDisplayModel(_arg1:AdsManager, _arg2:Number){
displayDuration = -1;
displayTimer = null;
super(_arg1);
this.displayDuration = _arg2;
}
private function stopDisplayTimer():void{
displayTimer.stop();
displayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimeEnd);
}
override public function onModelConversion():void{
stopDisplayTimer();
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
override public function isTimeBased():Boolean{
return (true);
}
override public function start():void{
debug("start");
startDisplayTimer();
}
private function startDisplayTimer():void{
displayTimer = new Timer((displayDuration * 1000));
displayTimer.addEventListener(TimerEvent.TIMER, onTimeEnd);
displayTimer.start();
}
private function onTimeEnd(_arg1:TimerEvent):void{
debug("onTimeEnd");
stopDisplayTimer();
clearDisplay();
}
override public function clearDisplay():void{
var _local1:Event;
debug("clearDisplay");
_local1 = new Event("onTimeBasedDisplayModelComplete", false, false);
dispatchEvent(_local1);
}
}
}//package com.doubleclick.adslot
Section 59
//VideoAdDisplay (com.doubleclick.adslot.VideoAdDisplay)
package com.doubleclick.adslot {
import flash.display.*;
import com.doubleclick.adslot.logging.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import com.doubleclick.adslot.netstream.*;
import com.doubleclick.adslot.flvplayback.*;
public class VideoAdDisplay extends AbstractAdDisplay {
private var clickTrackingElement:InteractiveObject;// = null
private var clickArea:ClickArea;// = null
private var adPlayback:Object;// = null
private var adTiming:Number;// = -1
public function VideoAdDisplay(_arg1:AdsManager, _arg2:VideoPlaybackManager){
adPlayback = null;
adTiming = -1;
clickArea = null;
clickTrackingElement = null;
super(_arg1, _arg2);
}
private function getVideoAdsManager():VideoAdsManager{
return ((getAdsManager() as VideoAdsManager));
}
override public function displayAd(_arg1:Number):void{
this.adTiming = _arg1;
playVideo();
}
private function onAdLoaded(_arg1:AdLoadedEvent):void{
if (((_arg1.netStream) && ((getVideoPlaybackManager() is NetStreamVideoPlaybackManager)))){
(getVideoPlaybackManager() as NetStreamVideoPlaybackManager).activateAdNetStream(_arg1.netStream);
};
}
public function setClickTrackingElement(_arg1:InteractiveObject):void{
this.clickTrackingElement = _arg1;
(_arg1 as Sprite).mouseChildren = false;
getVideoAdsManager().clickTrackingElement = (_arg1 as Sprite);
debug(((("set on ad " + _arg1) + " button mode:") + _arg1["buttonMode"]));
}
private function playVideo():void{
debug("playVideo");
if (!isCurrentlyDisplayed()){
startVideo();
} else {
restartVideo();
};
}
private function restartVideo():void{
debug("restartVideo");
getAdsManager().play(getVideoPlaybackManager().getVideoOutput());
}
private function onVideoPlay(_arg1:AdEvent):void{
debug("onVideoPlay");
removeEventListener("started", onVideoPlay);
notifyAboutAdDisplayStart();
}
override public function clearDisplay():void{
}
private function startVideo():void{
debug("startVideo");
getAdsManager().addEventListener(AdErrorEvent.AD_ERROR, onAdError);
getAdsManager().addEventListener(AdLoadedEvent.LOADED, onAdLoaded);
getAdsManager().addEventListener(AdEvent.STARTED, onVideoPlay);
getVideoAdsManager().addEventListener(AdEvent.COMPLETE, onVideoComplete);
if ((getVideoPlaybackManager() is FLVPlaybackManager)){
if (((((getAdsManager().ads) && (getAdsManager().ads[0]))) && (getAdsManager().ads[0].mediaUrl))){
(getVideoPlaybackManager() as FLVPlaybackManager).activateAdVideoPlayer(getAdsManager().ads[0].mediaUrl, adTiming);
} else {
dispatchAdError(ErrorMessages.MEDIA_URL_NOT_PRESENT);
};
};
if (isAutoPlay(adTiming)){
playAd();
} else {
getVideoPlaybackManager().addEventListener("onPlay", onPlay);
};
}
private function onPlay(_arg1:Event):void{
debug("onPlay");
getVideoPlaybackManager().removeEventListener("onPlay", onPlay);
playAd();
}
private function onAdError(_arg1:AdErrorEvent):void{
debug(("onAdError " + _arg1.error.errorMessage));
dispatchAdError(_arg1.error.errorMessage);
}
private function dispatchAdError(_arg1:String):void{
var _local2:AdSlotError;
_local2 = new AdSlotError(_arg1);
dispatchEvent(new AdSlotErrorEvent(_local2));
}
override public function playPreroll():void{
}
override public function requiresContentPausing():Boolean{
return (true);
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
override public function isStaticResource():Boolean{
return (false);
}
private function onVideoComplete(_arg1:AdEvent):void{
var _local2:AdUnitEvent;
debug("onVideoComplete");
clickArea.destroy();
setCurrentlyDisplayed(false);
_local2 = new AdUnitEvent(AdUnitEvent.VIDEO_AD_DISPLAY_COMPLETE);
_local2.setAdUnit(getAdUnit());
dispatchEvent(_local2);
}
private function setupClickTracking():void{
if ((getVideoPlaybackManager() is NetStreamVideoPlaybackManager)){
clickArea = new NetStreamVideoClickArea();
} else {
clickArea = new FLVPlaybackClickArea();
};
clickArea.setPlayback(getVideoPlaybackManager().getVideoOutput());
clickArea.addEventListener("clickAreaCreated", clickAreaCreated);
setClickTrackingElement(clickArea.create());
}
private function clickAreaCreated(_arg1:Event):void{
}
private function playAd():void{
setupClickTracking();
setCurrentlyDisplayed(true);
debug("calling play on AdsManager");
getAdsManager().play(getVideoPlaybackManager().getVideoOutput());
}
}
}//package com.doubleclick.adslot
Section 60
//VideoPlaybackEvent (com.doubleclick.adslot.VideoPlaybackEvent)
package com.doubleclick.adslot {
import flash.events.*;
public class VideoPlaybackEvent extends Event {
public static const BEFORE_AD_PLAY:String = "beforeAdPlay";
public static const CONTENT_COMPLETE_DISPATCHED:String = "contentCompleteDispatched";
public static const BEFORE_CONTENT_PLAY:String = "beforeContentPlay";
public static const CONTENT_COMPLETE:String = "contentComplete";
public function VideoPlaybackEvent(_arg1:String){
super(_arg1);
}
override public function clone():Event{
return (new VideoPlaybackEvent(type));
}
}
}//package com.doubleclick.adslot
Section 61
//VideoPlaybackManager (com.doubleclick.adslot.VideoPlaybackManager)
package com.doubleclick.adslot {
import flash.events.*;
public interface VideoPlaybackManager extends IEventDispatcher {
function getNetStreamTime():Number;
function isAdPlaying():Boolean;
function resumeContent():void;
function isAutoPlay():Boolean;
function getContentPlayheadPosition():Number;
function getNetStreamBufferTime():Number;
function activateContent():void;
function setVideoOutput(_arg1:Object):void;
function isSeeking():Boolean;
function pauseContent():void;
function hitTestObject(_arg1:AdSlot):Boolean;
function playContent():void;
function getVideoOutput():Object;
function resetContentPlayheadPosition():void;
function getSeekedTo():Number;
function getNetStreamBufferLength():Number;
function isNetStreamPlayback():Boolean;
function setJWPlayer(_arg1:Object):void;
function resetIfContentReplayed(_arg1:uint=0):void;
function dispatchContentComplete():void;
function setSeekedTo(_arg1:Number):void;
}
}//package com.doubleclick.adslot
Section 62
//Ad (com.google.ads.instream.api.Ad)
package com.google.ads.instream.api {
public interface Ad {
function get type():String;
function get surveyUrl():String;
function getCompanionAdUrl(_arg1:String, _arg2:String=null):String;
function getCompanionAds(_arg1:String, _arg2:Number, _arg3:Number, _arg4:CompanionAdSelectionSettings=null):Array;
function get id():String;
function get traffickingParameters():Object;
}
}//package com.google.ads.instream.api
Section 63
//AdError (com.google.ads.instream.api.AdError)
package com.google.ads.instream.api {
public interface AdError {
function get errorType():String;
function get innerError():Error;
function get errorCode():int;
function get errorMessage():String;
}
}//package com.google.ads.instream.api
Section 64
//AdErrorCodes (com.google.ads.instream.api.AdErrorCodes)
package com.google.ads.instream.api {
public class AdErrorCodes {
public static const LEGACY_FORMAT_ADS_NOT_FOUND:int = 4001;
public static const COMPANION_AD_LOADING_FAILED:int = 3102;
public static const INVALID_ARGUMENTS:int = 3101;
public static const VAST_LOAD_TIMEOUT:int = 3001;
public static const VAST_TOO_MANY_REDIRECTS:int = 3005;
public static const VAST_ASSET_MISMATCH:int = 3006;
public static const VAST_MALFORMED_RESPONSE:int = 3003;
public static const VAST_MEDIA_ERROR:int = 3004;
public static const VAST_INVALID_URL:int = 3002;
}
}//package com.google.ads.instream.api
Section 65
//AdErrorEvent (com.google.ads.instream.api.AdErrorEvent)
package com.google.ads.instream.api {
import flash.events.*;
import flash.system.*;
public class AdErrorEvent extends ErrorEvent {
private var adError:AdError;
private var userRequestContextObject:Object;// = null
private static const DEBUG_PLAYER_RECOMMENDED:String = "Use Flash debug player to see stack trace for the error.";
public static const AD_ERROR:String = "adError";
public function AdErrorEvent(_arg1:AdError, _arg2:Object=null){
super(AD_ERROR);
this.adError = _arg1;
if (_arg1){
this.text = _arg1.errorMessage;
if (_arg1.innerError){
if (_arg1.innerError.getStackTrace()){
this.text = (this.text + ("\n" + _arg1.innerError.getStackTrace()));
} else {
if (!Capabilities.isDebugger){
this.text = (this.text + ("\n" + DEBUG_PLAYER_RECOMMENDED));
};
};
};
};
this.userRequestContextObject = _arg2;
}
public function get error():AdError{
return (adError);
}
public function get userRequestContext():Object{
return (userRequestContextObject);
}
override public function clone():Event{
return (new AdErrorEvent(adError, userRequestContextObject));
}
}
}//package com.google.ads.instream.api
Section 66
//AdErrorTypes (com.google.ads.instream.api.AdErrorTypes)
package com.google.ads.instream.api {
public class AdErrorTypes {
public static const AD_PLAY_ERROR:String = "adPlayError";
public static const AD_LOAD_ERROR:String = "adLoadError";
}
}//package com.google.ads.instream.api
Section 67
//AdEvent (com.google.ads.instream.api.AdEvent)
package com.google.ads.instream.api {
import flash.events.*;
public class AdEvent extends Event {
private var adInstance:Ad;// = null
public static const ALL_ADS_COMPLETE:String = "allAdsComplete";
public static const RESTARTED:String = "restarted";
public static const MIDPOINT:String = "midpoint";
public static const FIRST_QUARTILE:String = "firstQuartile";
public static const STARTED:String = "started";
public static const USER_CLOSE:String = "userClose";
public static const VOLUME_MUTED:String = "volumeMuted";
public static const CLICK:String = "click";
public static const STOPPED:String = "stopped";
public static const PAUSED:String = "paused";
public static const CONTENT_RESUME_REQUESTED:String = "contentResumeRequested";
public static const VOLUME_UNMUTED:String = "volumeUnmuted";
public static const COMPLETE:String = "complete";
public static const THIRD_QUARTILE:String = "thirdQuartile";
public static const CONTENT_PAUSE_REQUESTED:String = "contentPauseRequested";
public function AdEvent(_arg1:String, _arg2:Ad){
super(_arg1);
this.adInstance = _arg2;
}
public function get ad():Ad{
return (adInstance);
}
override public function clone():Event{
return (new AdEvent(this.type, adInstance));
}
}
}//package com.google.ads.instream.api
Section 68
//AdLoadedEvent (com.google.ads.instream.api.AdLoadedEvent)
package com.google.ads.instream.api {
import flash.events.*;
import flash.net.*;
public class AdLoadedEvent extends Event {
private var netStreamInstance:NetStream;// = null
private var adInstance:Ad;// = null
private var adTypeValue:String;// = null
public static const LOADED:String = "loaded";
public function AdLoadedEvent(_arg1:Ad, _arg2:String, _arg3:NetStream=null){
super(LOADED);
this.adInstance = _arg1;
this.adTypeValue = _arg2;
this.netStreamInstance = _arg3;
}
override public function clone():Event{
return (new AdLoadedEvent(ad, adType, netStream));
}
public function get ad():Ad{
return (adInstance);
}
public function get adType():String{
return (adTypeValue);
}
public function get netStream():NetStream{
return (netStreamInstance);
}
}
}//package com.google.ads.instream.api
Section 69
//AdMenuEvent (com.google.ads.instream.api.AdMenuEvent)
package com.google.ads.instream.api {
import flash.events.*;
public class AdMenuEvent extends Event {
private var adsManagerValue:AdsManager;// = null
public static const SELECT:String = "select";
public static const DISMISSED:String = "dismissed";
public static const CLOSED:String = "closed";
public function AdMenuEvent(_arg1:String, _arg2:AdsManager=null){
super(_arg1);
adsManagerValue = _arg2;
}
public function get adsManager():AdsManager{
return (adsManagerValue);
}
override public function clone():Event{
return (new AdMenuEvent(this.type, adsManagerValue));
}
}
}//package com.google.ads.instream.api
Section 70
//AdRule (com.google.ads.instream.api.AdRule)
package com.google.ads.instream.api {
public interface AdRule {
function get adBreaks():Array;
}
}//package com.google.ads.instream.api
Section 71
//AdRuleAdBreak (com.google.ads.instream.api.AdRuleAdBreak)
package com.google.ads.instream.api {
public interface AdRuleAdBreak {
function get duration():int;
function get adBreakType():String;
function get adTagUrl():String;
function get adType():String;
function get startTime():int;
}
}//package com.google.ads.instream.api
Section 72
//AdSizeChangedEvent (com.google.ads.instream.api.AdSizeChangedEvent)
package com.google.ads.instream.api {
import flash.events.*;
public class AdSizeChangedEvent extends Event {
private var adWidth:Number;// = 0
private var adState:String;// = "regular"
private var adHeight:Number;// = 0
private var adInstance:Ad;// = null
private var adTypeValue:String;// = null
public static const REGULAR_SIZE_STATE:String = "regular";
public static const EXPANDED_SIZE_STATE:String = "expanded";
public static const MINIMIZED_SIZE_STATE:String = "minimized";
public static const SIZE_CHANGED:String = "sizeChanged";
public static const CLOSED_STATE:String = "closed";
public function AdSizeChangedEvent(_arg1:Ad, _arg2:String, _arg3:String, _arg4:Number, _arg5:Number){
super(SIZE_CHANGED);
this.adInstance = _arg1;
this.adTypeValue = _arg2;
this.adState = _arg3;
this.adWidth = _arg4;
this.adHeight = _arg5;
}
public function get state():String{
return (adState);
}
override public function clone():Event{
return (new AdSizeChangedEvent(ad, adType, state, width, height));
}
public function get height():Number{
return (adHeight);
}
public function get ad():Ad{
return (adInstance);
}
public function get width():Number{
return (adWidth);
}
public function get adType():String{
return (adTypeValue);
}
}
}//package com.google.ads.instream.api
Section 73
//AdsLoadedEvent (com.google.ads.instream.api.AdsLoadedEvent)
package com.google.ads.instream.api {
import flash.events.*;
public class AdsLoadedEvent extends Event {
private var userRequestContextObject:Object;// = null
private var adsListManager:AdsManager;// = null
public static const ADS_LOADED:String = "adsLoaded";
public function AdsLoadedEvent(_arg1:AdsManager, _arg2:Object){
super(ADS_LOADED);
this.adsListManager = _arg1;
this.userRequestContextObject = _arg2;
}
public function get userRequestContext():Object{
return (userRequestContextObject);
}
override public function clone():Event{
return (new AdsLoadedEvent(adsListManager, userRequestContext));
}
public function get adsManager():AdsManager{
return (adsListManager);
}
}
}//package com.google.ads.instream.api
Section 74
//AdsLoader (com.google.ads.instream.api.AdsLoader)
package com.google.ads.instream.api {
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.apidependency.*;
import com.google.ads.instream.wrappers.*;
public class AdsLoader extends BaseLoader {
private static const REQUEST_ADS_METHOD:String = "requestAds";
public function requestAds(_arg1:AdsRequest, _arg2:Object=null):void{
SdkStatisticsLoggerImpl.instance.reportApi(LogIds.AdsLoader_requestAds);
super.invokeRemoteMethod(REQUEST_ADS_METHOD, _arg1, _arg2);
}
override protected function dispatchSdkLoadError(_arg1:String):void{
var _local2:Dictionary = new Dictionary();
_local2["errMsg"] = _arg1;
SdkStatisticsLoggerImpl.instance.reportError(LogIds.AdsLoader_dispatchSdkLoadError, null, _local2);
var _local3:AdsLoaderError = new AdsLoaderError(_arg1);
_local3.errorType = AdErrorTypes.AD_LOAD_ERROR;
var _local4:AdErrorEvent = new AdErrorEvent(_local3);
dispatchEvent(_local4);
}
override protected function isLocallyDispatchedEvent(_arg1:String):Boolean{
return ((_arg1 == AdErrorEvent.AD_ERROR));
}
override protected function createWrapper(_arg1:Object):IEventDispatcher{
return (new AdsLoaderWrapper(_arg1));
}
}
}//package com.google.ads.instream.api
Section 75
//AdsLoaderError (com.google.ads.instream.api.AdsLoaderError)
package com.google.ads.instream.api {
import com.google.ads.instream.api.*;
class AdsLoaderError extends Error implements AdError {
private var flashError:Error;// = null
private var type:String;// = null
function AdsLoaderError(_arg1:String="", _arg2:int=0){
super(_arg1, _arg2);
}
public function get errorType():String{
return (type);
}
public function set innerError(_arg1:Error):void{
this.flashError = _arg1;
}
public function set errorType(_arg1:String):void{
this.type = _arg1;
}
public function get innerError():Error{
return (flashError);
}
public function get errorCode():int{
return (super.errorID);
}
public function get errorMessage():String{
return (super.message);
}
}
}//package com.google.ads.instream.api
Section 76
//AdsLoaderInterface (com.google.ads.instream.api.AdsLoaderInterface)
package com.google.ads.instream.api {
import flash.events.*;
public interface AdsLoaderInterface extends IEventDispatcher {
function requestAds(_arg1:AdsRequest, _arg2:Object=null):void;
function unload():void;
}
}//package com.google.ads.instream.api
Section 77
//AdSlot (com.google.ads.instream.api.AdSlot)
package com.google.ads.instream.api {
public class AdSlot {
private var heightValue:int;// = 0
private var widthValue:int;// = 0
public var verticalAlignment:String;
public var horizontalAlignment:String;
public function AdSlot(_arg1:int, _arg2:int){
horizontalAlignment = HorizontalAlignment.CENTER;
verticalAlignment = VerticalAlignment.BOTTOM;
super();
this.widthValue = _arg1;
this.heightValue = _arg2;
}
public function get width():int{
return (widthValue);
}
public function get height():int{
return (heightValue);
}
}
}//package com.google.ads.instream.api
Section 78
//AdsManager (com.google.ads.instream.api.AdsManager)
package com.google.ads.instream.api {
import flash.events.*;
public interface AdsManager extends IEventDispatcher {
function get ads():Array;
function set adSlotWidth(_arg1:Number):void;
function play(_arg1:Object=null):void;
function get adSlotWidth():Number;
function load(_arg1:Object=null):void;
function set adSlotHeight(_arg1:Number):void;
function get adSlotHeight():Number;
function get type():String;
function unload():void;
}
}//package com.google.ads.instream.api
Section 79
//AdsManagerTypes (com.google.ads.instream.api.AdsManagerTypes)
package com.google.ads.instream.api {
public class AdsManagerTypes {
public static const FLASH:String = "flash";
public static const CUSTOM_CONTENT:String = "customContent";
public static const VIDEO:String = "video";
}
}//package com.google.ads.instream.api
Section 80
//AdsRequest (com.google.ads.instream.api.AdsRequest)
package com.google.ads.instream.api {
public class AdsRequest {
public var size:String;// = null
public var adSlotWidth:Number;// = 0
public var minTotalAdDuration:int;// = 0
public var disableCompanionAds:Boolean;// = false
public var adServerHost:String;// = "ad.doubleclick.net"
public var adSlotHorizontalAlignment:String;// = "center"
public var protocol:String;// = "http"
public var adCommand:String;// = "pfadx"
public var adsResponse:String;
public var zone:String;// = null
public var uniqueAds:Boolean;// = false
public var numRedirects:uint;// = 4
public var maxTotalAdDuration:int;// = 100000
public var hostChannels:Array;
public var publisherId:String;// = null
public var gender:uint;
public var cmsId:String;
public var site:String;// = null
public var adSlotHeight:Number;// = 0
public var host:String;
public var adSlotVerticalAlignment:String;// = "bottom"
public var adUnit:String;
public var descriptionUrl:String;// = null
public var adTest:String;// = "off"
public var channels:Array;// = null
public var adTimePosition:int;// = 1
public var adSafe:String;// = "high"
public var extraTargetingKeyValues:Object;// = null
public var hostTierId:Number;
public var language:String;
public var mediaUrl:String;// = null
public var ordinal:String;
public var contentId:String;// = null
public var adTagUrl:String;// = null
public var adType:String;// = "video"
public var age:uint;
public function AdsRequest(){
ordinal = new Date().getTime().toString();
super();
}
}
}//package com.google.ads.instream.api
Section 81
//AdsRequestType (com.google.ads.instream.api.AdsRequestType)
package com.google.ads.instream.api {
public class AdsRequestType {
public static const USER_CHOICE:String = "user_choice";
public static const VIDEO:String = "video";
public static const TEXT_FULL_SLOT:String = "text_full_slot";
public static const ALL_VIDEO:String = "all_video";
public static const TEXT_OVERLAY:String = "text_overlay";
public static const GRAPHICAL_OVERLAY:String = "graphical_overlay";
public static const SKIPPABLE_VIDEO:String = "skippable_video";
public static const GRAPHICAL_FULL_SLOT:String = "graphical_full_slot";
public static const TEXT:String = "text";
public static const FULL_SLOT:String = "full_slot";
public static const TEXT_OR_GRAPHICAL:String = "text_or_graphical";
public static const GRAPHICAL:String = "graphical";
public static const OVERLAY:String = "overlay";
public static const AUDIO:String = "audio";
}
}//package com.google.ads.instream.api
Section 82
//AdTypes (com.google.ads.instream.api.AdTypes)
package com.google.ads.instream.api {
public class AdTypes {
public static const FLASH:String = "flash";
public static const CUSTOM_CONTENT:String = "customContent";
public static const VIDEO:String = "video";
public static const VAST:String = "VAST";
}
}//package com.google.ads.instream.api
Section 83
//BaseLoader (com.google.ads.instream.api.BaseLoader)
package com.google.ads.instream.api {
import flash.display.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.apidependency.*;
import flash.net.*;
import flash.system.*;
import com.google.ads.instream.common.*;
import com.google.ads.instream.wrappers.*;
class BaseLoader extends Sprite {
private var queuedListeners:Array;
private var loader:Loader;
private var queuedRequests:Array;
private var wrapper:IEventDispatcher;
var sdkLoaderFactory:Function;
private static const SHALLOW_SDK_INTEGRATION:String = "shallow";
private static const SDK_FULL_VERSION:String = ImaConstants.IMA_FULL_VERSION_VALUE;
private static const SDK_INTEGRATION:String = "deep";
private static const LOGGER_DISABLE_REQUESTED_EVENT_TYPE:String = "loggerDisableRequested";
private static const SHALLOW_SDK_HOST:String = "pagead2.googlesyndication.com";
private static const SHALLOW_SDK_LOCATION:String = (("http://" + SHALLOW_SDK_HOST) + "/pagead/adsapi_");
private static const DOUBLECLICK_MEDIA_SERVER:String = "m1.2mdn.net";
private static const UNLOAD_METHOD:String = "unload";
private static const SDK_HOST:String = "s0.2mdn.net";
private static const loggerConfig:XML = new XML((("<Logger p=\"0.001\">\n " + (("<All>\n " + (("<Ids>" + ??esc_xelem
) + "</Ids>")) + "\n </All>")) + "\n </Logger>"));
;
private static const SDK_MAJOR_VERSION:String = SDK_FULL_VERSION.split(".")[0];
private static const SDK_LOCATION:String = (("http://" + SDK_HOST) + "/instream/adsapi_");
private static const SDK_LOADER_CLASSNAME:String = "com.google.ads.loader.instream::VersionedSdkLoader";
function BaseLoader(){
queuedRequests = [];
queuedListeners = [];
sdkLoaderFactory = createSdkLoader;
super();
var _local1:SdkStatisticsLoggerImpl = new SdkStatisticsLoggerImpl(new SdkStatisticsLoggerConfig(loggerConfig));
SdkStatisticsLoggerImpl.instance = _local1;
_local1.setPersistentProperty(SdkStatisticsLoggerImpl.REPORT_KEY_SOURCE, SdkStatisticsLoggerImpl.SWC_SOURCE);
_local1.setPersistentProperty(SdkStatisticsLoggerImpl.REPORT_KEY_YOUTUBE, SdkStatisticsLoggerImpl.isYoutubeHost(publisherUrl));
allowTrustedDomains();
}
protected function dispatchSdkLoadError(_arg1:String):void{
throw (new Error("Method must be overridden in a subclass"));
}
private function removeSdkLoadListeners():void{
loader.removeEventListener(Event.COMPLETE, sdkLoadedHandler);
loader.removeEventListener(ErrorEvent.ERROR, onSdkLoadError);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onSdkLoadError);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSdkLoadError);
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
var _local4:Object;
if (isLocallyDispatchedEvent(_arg1)){
super.removeEventListener(_arg1, _arg2);
};
if (wrapper != null){
wrapper.removeEventListener(_arg1, _arg2, _arg3);
} else {
for each (_local4 in queuedListeners) {
if ((((_arg1 == _local4.type)) && ((_arg2 == _local4.listener)))){
queuedListeners.splice(queuedListeners.indexOf(_local4), 1);
break;
};
};
};
}
protected function isLocallyDispatchedEvent(_arg1:String):Boolean{
throw (new Error("Method must be overridden in a subclass"));
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (isLocallyDispatchedEvent(_arg1)){
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
};
if (wrapper != null){
wrapper.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
} else {
queuedListeners.push({type:_arg1, listener:_arg2, useCapture:_arg3, priority:_arg4, useWeakReference:_arg5});
};
}
private function createSdkLoader():Loader{
return (new SdkSwfLoader(ApplicationDomain.currentDomain));
}
private function get sdkUrl():String{
var _local1 = (SDK_MAJOR_VERSION + ".swf");
if (SDK_INTEGRATION == SHALLOW_SDK_INTEGRATION){
return ((SHALLOW_SDK_LOCATION + _local1));
};
return ((SDK_LOCATION + _local1));
}
private function loggerDisableRequestedHandler(_arg1:Event):void{
SdkStatisticsLoggerImpl.instance.loggingEnabled = false;
}
protected function invokeRemoteMethod(_arg1:String, ... _args):void{
if (wrapper != null){
invokeWrapperMethod(_arg1, _args);
} else {
queuedRequests.push({method:_arg1, args:_args});
load();
};
}
private function addSdkLoadListeners():void{
loader.addEventListener(Event.COMPLETE, sdkLoadedHandler);
loader.addEventListener(ErrorEvent.ERROR, onSdkLoadError);
loader.addEventListener(ErrorEvent.ERROR, onSdkLoadError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, sdkLoaderSwfLoadCompleteHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onSdkLoadError);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSdkLoadError);
}
private function allowTrustedDomains():void{
if (SDK_INTEGRATION == SHALLOW_SDK_INTEGRATION){
Security.allowDomain(SHALLOW_SDK_HOST);
Security.allowInsecureDomain(SHALLOW_SDK_HOST);
} else {
Security.allowDomain(SDK_HOST);
Security.allowInsecureDomain(SDK_HOST);
};
Security.allowDomain(DOUBLECLICK_MEDIA_SERVER);
Security.allowInsecureDomain(DOUBLECLICK_MEDIA_SERVER);
}
private function get publisherUrl():String{
return (new Loader().contentLoaderInfo.loaderURL);
}
private function processQueuedListeners():void{
var _local1:Object;
for each (_local1 in queuedListeners) {
wrapper.addEventListener(_local1.type, _local1.listener, _local1.useCapture, _local1.priority, _local1.useWeakReference);
};
queuedListeners = [];
}
private function onSdkLoadError(_arg1:ErrorEvent):void{
handleSdkLoadError(_arg1.text);
}
private function sdkLoadedHandler(_arg1:Event):void{
SdkStatisticsLoggerImpl.instance.reportApi(LogIds.BaseLoader_sdkLoadedHandler);
removeSdkLoadListeners();
var _local2:Object = _arg1;
AdsLoaderWrapper.remoteApplicationDomainProxy = _local2.remoteApplicationDomainProxy;
wrapper = createWrapper(_local2.adsLoader);
if (wrapper != null){
processQueuedListeners();
processQueuedRequests();
} else {
dispatchSdkLoadError("Internal error: remote wrapper is null");
};
}
private function handleSdkLoadError(_arg1:String):void{
removeSdkLoadListeners();
dispatchSdkLoadError(_arg1);
}
private function onRemovedFromStage(_arg1:Event):void{
super.removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
unload();
}
private function load():void{
var _local1:URLRequest;
if (loader == null){
super.addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
loader = sdkLoaderFactory();
loader.addEventListener(LOGGER_DISABLE_REQUESTED_EVENT_TYPE, loggerDisableRequestedHandler);
addSdkLoadListeners();
if (stage != null){
addChild(loader);
};
_local1 = new URLRequest(sdkUrl);
loader.load(_local1);
};
}
private function sdkLoaderSwfLoadCompleteHandler(_arg1:Event):void{
var loadedClassName:String;
var event = _arg1;
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, sdkLoaderSwfLoadCompleteHandler);
SdkStatisticsLoggerImpl.instance.reportApi(LogIds.BaseLoader_sdkLoaderSwfLoadCompleteHandler);
try {
loadedClassName = getQualifiedClassName(loader.content);
if (loadedClassName != SDK_LOADER_CLASSNAME){
handleSdkLoadError(("SDK could not be loaded from " + sdkUrl));
};
} catch(error:SecurityError) {
handleSdkLoadError(("SDK could not be loaded from " + sdkUrl));
};
}
protected function createWrapper(_arg1:Object):IEventDispatcher{
throw (new Error("Method must be overridden in a subclass"));
}
private function invokeWrapperMethod(_arg1:String, _arg2:Array):void{
var _local3:Function = wrapper[_arg1];
if (_local3 != null){
_local3.apply(wrapper, _arg2);
} else {
dispatchSdkLoadError(("Internal error: No such method: " + _arg1));
};
}
private function processQueuedRequests():void{
var _local1:Object;
for each (_local1 in queuedRequests) {
invokeWrapperMethod(_local1.method, _local1.args);
};
queuedRequests = [];
}
public function unload():void{
if (loader != null){
invokeRemoteMethod(UNLOAD_METHOD);
loader.removeEventListener(LOGGER_DISABLE_REQUESTED_EVENT_TYPE, loggerDisableRequestedHandler);
removeSdkLoadListeners();
if (loader.parent != null){
loader.parent.removeChild(loader);
};
if (loader.hasOwnProperty("unloadAndStop")){
var _local1 = loader;
_local1["unloadAndStop"]();
} else {
loader.unload();
};
loader = null;
queuedRequests = [];
queuedListeners = [];
};
SdkStatisticsLoggerImpl.instance = null;
}
private static function getLogIds():String{
return (((((((LogIds.AdsLoader_requestAds + ",") + LogIds.AdsLoader_dispatchSdkLoadError) + ",") + LogIds.BaseLoader_sdkLoaderSwfLoadCompleteHandler) + ",") + LogIds.BaseLoader_sdkLoadedHandler));
}
}
}//package com.google.ads.instream.api
Section 84
//CompanionAd (com.google.ads.instream.api.CompanionAd)
package com.google.ads.instream.api {
public interface CompanionAd {
function get environment():String;
}
}//package com.google.ads.instream.api
Section 85
//CompanionAdEnvironments (com.google.ads.instream.api.CompanionAdEnvironments)
package com.google.ads.instream.api {
public class CompanionAdEnvironments {
public static const FLASH:String = "flash";
public static const VIDEO:String = "video";
public static const HTML:String = "html";
}
}//package com.google.ads.instream.api
Section 86
//CompanionAdSelectionSettings (com.google.ads.instream.api.CompanionAdSelectionSettings)
package com.google.ads.instream.api {
public class CompanionAdSelectionSettings {
public var sizeCriteria:String;// = "CompanionSize_ExactFit"
public var resourceType:String;// = "VASTResourceType_All"
public var creativeType:String;// = "VASTCreativeType_All"
public var nearFitPercent:Number;// = 90
public static const VAST_RESOURCE_TYPE_HTML:String = "VASTResourceType_HTML";
public static const COMPANION_SIZE_NEAR_FIT:String = "CompanionSize_NearFit";
public static const VAST_CREATIVE_TYPE_FLASH:String = "VASTCreativeType_Flash";
public static const VAST_RESOURCE_TYPE_IFRAME:String = "VASTResourceType_IFrame";
public static const COMPANION_SIZE_EXACT_FIT:String = "CompanionSize_ExactFit";
public static const VAST_CREATIVE_TYPE_IMAGE:String = "VASTCreativeType_Image";
public static const VAST_RESOURCE_TYPE_STATIC:String = "VASTResourceType_Static";
public static const VAST_CREATIVE_TYPE_ALL:String = "VASTCreativeType_All";
public static const VAST_RESOURCE_TYPE_ALL:String = "VASTResourceType_All";
public static const COMPANION_SIZE_IGNORE:String = "CompanionSize_Ignore";
}
}//package com.google.ads.instream.api
Section 87
//CustomContentAd (com.google.ads.instream.api.CustomContentAd)
package com.google.ads.instream.api {
public interface CustomContentAd extends Ad {
function get content():String;
}
}//package com.google.ads.instream.api
Section 88
//Demographics (com.google.ads.instream.api.Demographics)
package com.google.ads.instream.api {
public class Demographics {
public static const AGE_55_TO_64:uint = 1005;
public static const AGE_45_TO_54:uint = 1004;
public static const AGE_35_TO_44:uint = 1003;
public static const AGE_25_TO_34:uint = 1002;
public static const GENDER_FEMALE:uint = 2;
public static const GENDER_MALE:uint = 1;
public static const AGE_18_TO_24:uint = 1001;
public static const AGE_17_AND_UNDER:uint = 1000;
public static const AGE_65_AND_OVER:uint = 1006;
}
}//package com.google.ads.instream.api
Section 89
//DoubleClickStudioFlashAsset (com.google.ads.instream.api.DoubleClickStudioFlashAsset)
package com.google.ads.instream.api {
public interface DoubleClickStudioFlashAsset extends FlashAsset {
function call(_arg1:String, ... _args):void;
}
}//package com.google.ads.instream.api
Section 90
//FlashAd (com.google.ads.instream.api.FlashAd)
package com.google.ads.instream.api {
import flash.utils.*;
public interface FlashAd extends Ad {
function get asset():FlashAsset;
function enableManualEventsReporting():void;
function reportEvents():void;
function reportCustomKeysAndValues(_arg1:Dictionary):void;
}
}//package com.google.ads.instream.api
Section 91
//FlashAdCustomEvent (com.google.ads.instream.api.FlashAdCustomEvent)
package com.google.ads.instream.api {
import flash.events.*;
public class FlashAdCustomEvent extends AdEvent {
private var customEventContext:Object;// = null
public static const CUSTOM_EVENT:String = "customEvent";
public function FlashAdCustomEvent(_arg1:FlashAd, _arg2:Object){
super(CUSTOM_EVENT, _arg1);
this.customEventContext = _arg2;
}
override public function clone():Event{
return (new FlashAdCustomEvent((ad as FlashAd), customEventContext));
}
public function get eventContext():Object{
return (customEventContext.eventObject);
}
public function get eventName():String{
return (customEventContext.eventName);
}
}
}//package com.google.ads.instream.api
Section 92
//FlashAdsManager (com.google.ads.instream.api.FlashAdsManager)
package com.google.ads.instream.api {
public interface FlashAdsManager extends AdsManager {
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function set decoratedAd(_arg1:Boolean):void;
function get x():Number;
function get y():Number;
function set volumeAd(_arg1:Number):void;
function get volumeAd():Number;
}
}//package com.google.ads.instream.api
Section 93
//FlashAsset (com.google.ads.instream.api.FlashAsset)
package com.google.ads.instream.api {
import flash.events.*;
public interface FlashAsset extends IEventDispatcher {
function get expandedHeight():Number;
function set y(_arg1:Number):void;
function get expandedWidth():Number;
function get width():Number;
function get height():Number;
function get x():Number;
function get y():Number;
function get type():String;
function get frameRate():Number;
function set x(_arg1:Number):void;
}
}//package com.google.ads.instream.api
Section 94
//FlashAssetTypes (com.google.ads.instream.api.FlashAssetTypes)
package com.google.ads.instream.api {
public class FlashAssetTypes {
public static const FLOATING:String = "Floating";
public static const EXPANDING:String = "Expanding";
public static const IN_PAGE:String = "In-Page";
public static const STATIC_IMAGE:String = "Static-Image";
public static const TEXT:String = "Text";
public static const STATIC_SWF:String = "Static-Swf";
public static const AUDIO:String = "Audio";
}
}//package com.google.ads.instream.api
Section 95
//FlashCompanionAd (com.google.ads.instream.api.FlashCompanionAd)
package com.google.ads.instream.api {
import flash.display.*;
public interface FlashCompanionAd extends CompanionAd {
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function play(_arg1:DisplayObjectContainer):void;
function load():void;
function get x():Number;
function get y():Number;
function unload():void;
}
}//package com.google.ads.instream.api
Section 96
//HorizontalAlignment (com.google.ads.instream.api.HorizontalAlignment)
package com.google.ads.instream.api {
public class HorizontalAlignment {
public static const CENTER:String = "center";
public static const LEFT:String = "left";
public static const RIGHT:String = "right";
}
}//package com.google.ads.instream.api
Section 97
//HtmlCompanionAd (com.google.ads.instream.api.HtmlCompanionAd)
package com.google.ads.instream.api {
public interface HtmlCompanionAd extends CompanionAd {
function get content():String;
}
}//package com.google.ads.instream.api
Section 98
//MediaSelectionSettings (com.google.ads.instream.api.MediaSelectionSettings)
package com.google.ads.instream.api {
public class MediaSelectionSettings {
public var bandwidth:String;
public var delivery:String;
public var mimeTypes:Array;
public function MediaSelectionSettings(){
mimeTypes = VideoMimeTypes.DEFAULT_MIMETYPES;
delivery = VideoDeliveryTypes.DEFAULT;
super();
}
}
}//package com.google.ads.instream.api
Section 99
//PlayList (com.google.ads.instream.api.PlayList)
package com.google.ads.instream.api {
public interface PlayList {
function get content():PlayListContent;
function get adRule():AdRule;
}
}//package com.google.ads.instream.api
Section 100
//PlayListContent (com.google.ads.instream.api.PlayListContent)
package com.google.ads.instream.api {
public interface PlayListContent {
function set url(_arg1:String):void;
function get url():String;
}
}//package com.google.ads.instream.api
Section 101
//PlayListErrorEvent (com.google.ads.instream.api.PlayListErrorEvent)
package com.google.ads.instream.api {
import flash.events.*;
public class PlayListErrorEvent extends ErrorEvent {
private var userRequestContextObject:Object;// = null
public static const PLAY_LIST_ERROR:String = "playListError";
public function PlayListErrorEvent(_arg1:String, _arg2:Object=null){
super(PLAY_LIST_ERROR, false, false, _arg1);
this.userRequestContextObject = _arg2;
}
public function get userRequestContext():Object{
return (userRequestContextObject);
}
override public function clone():Event{
return (new PlayListErrorEvent(text, userRequestContextObject));
}
}
}//package com.google.ads.instream.api
Section 102
//PlayListEvent (com.google.ads.instream.api.PlayListEvent)
package com.google.ads.instream.api {
import flash.events.*;
import flash.net.*;
public class PlayListEvent extends Event {
private var netStreamValue:NetStream;
public static const AD_STARTED:String = "playListAdStarted";
public static const PLAY_LIST_STARTED:String = "playListStarted";
public static const PLAY_LIST_COMPLETE:String = "playListComplete";
public static const CONTENT_PAUSED:String = "playListContentPaused";
public static const AD_COMPLETE:String = "playListAdComplete";
public static const CONTENT_RESUMED:String = "playListContentResumed";
public static const CONTENT_STARTED:String = "playListContentStarted";
public static const CONTENT_COMPLETE:String = "playListContentComplete";
public function PlayListEvent(_arg1:String, _arg2:NetStream=null){
super(_arg1);
this.netStreamValue = _arg2;
}
public function get netStream():NetStream{
return (netStreamValue);
}
override public function clone():Event{
return (new PlayListEvent(this.type, this.netStreamValue));
}
}
}//package com.google.ads.instream.api
Section 103
//PlayListLoadedEvent (com.google.ads.instream.api.PlayListLoadedEvent)
package com.google.ads.instream.api {
import flash.events.*;
public class PlayListLoadedEvent extends Event {
private var playListManagerValue:PlayListManager;
private var userRequestContextObject:Object;
public static const PLAY_LIST_LOADED:String = "playListLoaded";
public function PlayListLoadedEvent(_arg1:PlayListManager, _arg2:Object){
super(PLAY_LIST_LOADED);
this.playListManagerValue = _arg1;
this.userRequestContextObject = _arg2;
}
public function get userRequestContext():Object{
return (userRequestContextObject);
}
public function get playListManager():PlayListManager{
return (this.playListManagerValue);
}
override public function clone():Event{
return (new PlayListLoadedEvent(this.playListManagerValue, this.userRequestContextObject));
}
}
}//package com.google.ads.instream.api
Section 104
//PlayListLoader (com.google.ads.instream.api.PlayListLoader)
package com.google.ads.instream.api {
import flash.events.*;
import com.google.ads.instream.wrappers.*;
public class PlayListLoader extends BaseLoader {
private static const REQUEST_PLAY_LIST_METHOD:String = "requestPlayList";
public function requestPlayList(_arg1:PlayListRequest, _arg2:Object=null):void{
super.invokeRemoteMethod(REQUEST_PLAY_LIST_METHOD, _arg1, _arg2);
}
override protected function dispatchSdkLoadError(_arg1:String):void{
dispatchEvent(new PlayListErrorEvent(PlayListErrorEvent.PLAY_LIST_ERROR, _arg1));
}
override protected function isLocallyDispatchedEvent(_arg1:String):Boolean{
return ((_arg1 == PlayListErrorEvent.PLAY_LIST_ERROR));
}
override protected function createWrapper(_arg1:Object):IEventDispatcher{
return (new PlayListLoaderWrapper(_arg1));
}
}
}//package com.google.ads.instream.api
Section 105
//PlayListLoaderInterface (com.google.ads.instream.api.PlayListLoaderInterface)
package com.google.ads.instream.api {
import flash.events.*;
public interface PlayListLoaderInterface extends IEventDispatcher {
function requestPlayList(_arg1:PlayListRequest, _arg2:Object=null):void;
}
}//package com.google.ads.instream.api
Section 106
//PlayListManager (com.google.ads.instream.api.PlayListManager)
package com.google.ads.instream.api {
import flash.display.*;
import flash.events.*;
public interface PlayListManager extends IEventDispatcher {
function set adSlotY(_arg1:Number):void;
function get playList():PlayList;
function play(_arg1:Object):void;
function load(_arg1:Object):void;
function get adSlotX():Number;
function get adSlotY():Number;
function set clickTrackingElement(_arg1:InteractiveObject):void;
function get clickTrackingElement():InteractiveObject;
function set adSlotX(_arg1:Number):void;
}
}//package com.google.ads.instream.api
Section 107
//PlayListRequest (com.google.ads.instream.api.PlayListRequest)
package com.google.ads.instream.api {
public class PlayListRequest {
public var targetingCriteria:Object;// = null
public var adSlot:AdSlot;// = null
public var playListResponse:String;// = null
public var distributorCode:String;// = null
public var contentCode:String;// = null
}
}//package com.google.ads.instream.api
Section 108
//SdkSwfLoader (com.google.ads.instream.api.SdkSwfLoader)
package com.google.ads.instream.api {
import com.google.ads.instream.apidependency.*;
import flash.system.*;
class SdkSwfLoader extends TimedLoader {
private var publisherApplicationDomainValue:ApplicationDomain;
function SdkSwfLoader(_arg1:ApplicationDomain){
publisherApplicationDomainValue = _arg1;
}
public function get publisherApplicationDomain():ApplicationDomain{
return (publisherApplicationDomainValue);
}
}
}//package com.google.ads.instream.api
Section 109
//UserChoiceAdsManager (com.google.ads.instream.api.UserChoiceAdsManager)
package com.google.ads.instream.api {
public interface UserChoiceAdsManager extends FlashAdsManager {
function set alternateAdsCount(_arg1:int):void;
}
}//package com.google.ads.instream.api
Section 110
//VastCustomClick (com.google.ads.instream.api.VastCustomClick)
package com.google.ads.instream.api {
public interface VastCustomClick {
function get id():String;
function get url():String;
}
}//package com.google.ads.instream.api
Section 111
//VastVideoAd (com.google.ads.instream.api.VastVideoAd)
package com.google.ads.instream.api {
public interface VastVideoAd extends VideoAd {
function get nonLinearAdXMLList():XMLList;
function get adSystem():String;
function get description():String;
function get companionAdXMLList():XMLList;
function get wrappers():Array;
function get customClicks():Array;
}
}//package com.google.ads.instream.api
Section 112
//VastWrapper (com.google.ads.instream.api.VastWrapper)
package com.google.ads.instream.api {
public interface VastWrapper {
function get adSystem():String;
function get customClicks():Array;
}
}//package com.google.ads.instream.api
Section 113
//VerticalAlignment (com.google.ads.instream.api.VerticalAlignment)
package com.google.ads.instream.api {
public class VerticalAlignment {
public static const CENTER:String = "center";
public static const BOTTOM:String = "bottom";
public static const TOP:String = "top";
}
}//package com.google.ads.instream.api
Section 114
//VideoAd (com.google.ads.instream.api.VideoAd)
package com.google.ads.instream.api {
import flash.net.*;
public interface VideoAd extends Ad {
function get ISCI():String;
function set netStream(_arg1:NetStream):void;
function get author():String;
function get duration():Number;
function get currentTime():Number;
function get title():String;
function get skippable():Boolean;
function get mediaUrl():String;
function get deliveryType():String;
}
}//package com.google.ads.instream.api
Section 115
//VideoAdBandwidth (com.google.ads.instream.api.VideoAdBandwidth)
package com.google.ads.instream.api {
public class VideoAdBandwidth {
public static const LOW:String = "low";
public static const MEDIUM:String = "medium";
public static const HIGH:String = "high";
public static var DEFAULT:String = "low";
}
}//package com.google.ads.instream.api
Section 116
//VideoAdsManager (com.google.ads.instream.api.VideoAdsManager)
package com.google.ads.instream.api {
import flash.display.*;
public interface VideoAdsManager extends AdsManager {
function set mediaSelectionSettings(_arg1:MediaSelectionSettings):void;
function set clickTrackingElement(_arg1:InteractiveObject):void;
function get mediaSelectionSettings():MediaSelectionSettings;
function set skipUiContainer(_arg1:DisplayObjectContainer):void;
function get clickTrackingElement():InteractiveObject;
function get skipUiContainer():DisplayObjectContainer;
}
}//package com.google.ads.instream.api
Section 117
//VideoDeliveryTypes (com.google.ads.instream.api.VideoDeliveryTypes)
package com.google.ads.instream.api {
public class VideoDeliveryTypes {
public static const STREAMING:String = "streaming";
public static const PROGRESSIVE:String = "progressive";
public static var DEFAULT:String = "progressive";
}
}//package com.google.ads.instream.api
Section 118
//VideoMimeTypes (com.google.ads.instream.api.VideoMimeTypes)
package com.google.ads.instream.api {
public class VideoMimeTypes {
public static const FLV:String = "video/x-flv";
public static const MP4:String = "video/x-mp4";
public static var DEFAULT_MIMETYPES:Array = [VideoMimeTypes.FLV, VideoMimeTypes.MP4];
}
}//package com.google.ads.instream.api
Section 119
//YoutubeAdsRequest (com.google.ads.instream.api.YoutubeAdsRequest)
package com.google.ads.instream.api {
public class YoutubeAdsRequest extends AdsRequest {
public var referrerUrl:String;
public var targeting:String;
public var allowUnrelatedCompanion:Boolean;
public var allowCompanionBeforeMaster:Boolean;
public var cafeExperimentId:int;
}
}//package com.google.ads.instream.api
Section 120
//BufferedSdkStatisticsLoggerImpl (com.google.ads.instream.apidependency.BufferedSdkStatisticsLoggerImpl)
package com.google.ads.instream.apidependency {
import com.google.ads.instream.api.*;
import flash.utils.*;
public class BufferedSdkStatisticsLoggerImpl implements SdkStatisticsLogger {
private var methodCallsAndArguments:Array;
public function BufferedSdkStatisticsLoggerImpl(){
methodCallsAndArguments = [];
}
public function get loggingEnabled():Boolean{
throw (new Error("Dummy method to satisfy API contract, do not use it."));
}
public function set loggingEnabled(_arg1:Boolean):void{
throw (new Error("Dummy method to satisfy API contract, do not use it."));
}
public function get logPercent():uint{
throw (new Error("Dummy method to satisfy API contract, do not use it."));
}
public function reportApi(_arg1:uint, _arg2:Dictionary=null):void{
store("reportApi", arguments);
}
public function setPersistentProperty(_arg1:String, _arg2:Object):void{
store("setPersistentProperty", arguments);
}
private function store(_arg1:String, _arg2:Object):void{
methodCallsAndArguments.push({methodName:_arg1, args:_arg2});
}
public function reportAdError(_arg1:uint, _arg2:String, _arg3:AdError, _arg4:Dictionary=null):void{
store("reportAdError", arguments);
}
public function reportError(_arg1:uint, _arg2:String, _arg3:Dictionary=null):void{
store("reportError", arguments);
}
public function executeStoredMethodsOn(_arg1:SdkStatisticsLogger):void{
var _local2:Object;
for each (_local2 in methodCallsAndArguments) {
_arg1[_local2.methodName].apply(_arg1, _local2.args);
};
methodCallsAndArguments = [];
}
public function report(_arg1:uint, _arg2:String=null, _arg3:Dictionary=null):void{
store("report", arguments);
}
}
}//package com.google.ads.instream.apidependency
Section 121
//LoggablePoint (com.google.ads.instream.apidependency.LoggablePoint)
package com.google.ads.instream.apidependency {
public class LoggablePoint {
private var youtubeValue:Boolean;
private var idValue:uint;
private var experimentIdValue:String;
private var logAlwaysValue:Boolean;
public function LoggablePoint(_arg1:uint, _arg2:Boolean, _arg3:Boolean, _arg4:String=null){
this.idValue = _arg1;
this.youtubeValue = _arg2;
this.logAlwaysValue = _arg3;
this.experimentIdValue = ((_arg4 == "")) ? null : _arg4;
}
public function toString():String{
return (((((((("id:" + id) + " youtube:") + logForYoutubeOnly) + " logAlways:") + logAlways) + " experimentId:") + experimentId));
}
public function get logForYoutubeOnly():Boolean{
return (youtubeValue);
}
public function get logAlways():Boolean{
return (logAlwaysValue);
}
public function get experimentId():String{
return (experimentIdValue);
}
public function get id():uint{
return (idValue);
}
public function equals(_arg1:LoggablePoint):Boolean{
return ((((((((id == _arg1.id)) && ((logForYoutubeOnly == _arg1.logForYoutubeOnly)))) && ((logAlways == _arg1.logAlways)))) && ((experimentId == _arg1.experimentId))));
}
}
}//package com.google.ads.instream.apidependency
Section 122
//LogIds (com.google.ads.instream.apidependency.LogIds)
package com.google.ads.instream.apidependency {
public class LogIds {
public static const VastLinearAdTracker_videoStop:uint = 40;
public static const DoubleclickInStreamSDK_onFlashInFlashAdLoaded:uint = 11;
public static const VastLinearAdTracker_videoClick:uint = 37;
public static const AdsLoaderImpl_adsResponseReceivedHandler:uint = 6;
public static const DoubleclickVastVideoAdImpl_videoMute:uint = 34;
public static const VastLinearAdTracker_videoMute:uint = 43;
public static const BaseLoader_sdkLoaderSwfLoadCompleteHandler:uint = 3;
public static const ResourceLoadLogger_errorHandler:uint = 21;
public static const DoubleclickInStreamSDK_createAd:uint = 22;
public static const DoubleclickInStreamSDK_onVastAdLoaded:uint = 12;
public static const AdsLoader_requestAds:uint = 1;
public static const DoubleclickInStreamSDK_onVastWrapperAdLoaded:uint = 13;
public static const DoubleclickVastVideoAdImpl_videoComplete:uint = 27;
public static const ErrorUtils_dispatchAdError:uint = 19;
public static const ResourceLoadLogger_logTimeout:uint = 20;
public static const DoubleclickInStreamSDK_onCustomAdLoaded:uint = 15;
public static const DoubleclickInStreamSDK_dispatchAdsLoaded:uint = 16;
public static const AdsLoader_dispatchSdkLoadError:uint = 2;
public static const DoubleclickInStreamSDK_onSdkLoaded:uint = 8;
public static const AdsManagerImpl_onAdError:uint = 18;
public static const DoubleclickInStreamSDK_onAdLoadError:uint = 17;
public static const DoubleclickVastVideoAdImpl_firstQuartile:uint = 32;
public static const DoubleclickInStreamSDK_onSdkLoadError:uint = 9;
public static const DoubleclickVastVideoAdImpl_videoStart:uint = 26;
public static const DoubleclickVastVideoAdImpl_videoMidpoint:uint = 29;
public static const VastLinearAdTracker_videoMidpoint:uint = 38;
public static const VastLinearAdTracker_firstQuartile:uint = 41;
public static const VastLinearAdTracker_videoComplete:uint = 36;
public static const UserChoiceAdTracker_sendLogEvent:uint = 23;
public static const DoubleclickVastVideoAdImpl_getCompanionAds:uint = 24;
public static const AdsLoaderImpl_requestAds:uint = 5;
public static const DoubleclickVastVideoAdImpl_videoPause:uint = 30;
public static const BaseLoader_sdkLoadedHandler:uint = 4;
public static const VastLinearAdTracker_videoStart:uint = 35;
public static const DoubleclickInStreamSDK_onDartInStreamAdLoaded:uint = 10;
public static const DoubleclickInStreamSDK_onVastNonLinearAdLoaded:uint = 14;
public static const VastLinearAdTracker_thirdQuartile:uint = 42;
public static const DoubleclickVastVideoAdImpl_videoClick:uint = 28;
public static const DoubleclickInStreamSDK_loadSdk:uint = 7;
public static const DoubleclickVastVideoAdImpl_thirdQuartile:uint = 33;
public static const VastLinearAdTracker_videoPause:uint = 39;
public static const DoubleclickVastVideoAdImpl_videoStop:uint = 31;
}
}//package com.google.ads.instream.apidependency
Section 123
//ResourceLoadLogger (com.google.ads.instream.apidependency.ResourceLoadLogger)
package com.google.ads.instream.apidependency {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class ResourceLoadLogger extends EventDispatcher {
private var timeoutMaxLogCountValue:int;
private var timeoutCurrentLogCountValue:int;// = 1
private var request:URLRequest;
private var receivedEvents:Array;
public var loadTimeout:int;// = 5000
private var resourceLoaderValue:EventDispatcher;
private var loadTimer:Timer;
public static const LOAD_TIMEOUT_EVENT:String = "loadTimeoutEvent";
private static const LOAD_TIMEOUT_MS:int = 5000;
private static var MAX_REPORTED_URL_LENGTH:int = 100;
public function ResourceLoadLogger(_arg1:EventDispatcher){
receivedEvents = [];
super();
resourceLoaderValue = _arg1;
}
private function startLoadTimer(_arg1:int):void{
destroyLoadTimer();
loadTimer = new Timer(_arg1, 1);
timeoutCurrentLogCountValue++;
loadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, loadTimeoutHandler);
loadTimer.start();
}
private function httpStatusEventHandler(_arg1:HTTPStatusEvent):void{
var _local2:Array = [];
_local2.push(_arg1.status);
recordReceivedEvent(_arg1.type, _local2);
}
private function addEventListeners():void{
resourceLoaderValue.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusEventHandler);
resourceLoaderValue.addEventListener(Event.OPEN, openEventHandler);
resourceLoaderValue.addEventListener(ProgressEvent.PROGRESS, progressEventHandler);
resourceLoaderValue.addEventListener(Event.COMPLETE, completeHandler);
resourceLoaderValue.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
resourceLoaderValue.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
}
private function completeHandler(_arg1:Event):void{
releaseResources();
}
private function getReceivedEvent(_arg1:String):Object{
var _local2:Object;
for each (_local2 in receivedEvents) {
if (_local2.eventType == _arg1){
return (_local2);
};
};
return (null);
}
private function progressEventHandler(_arg1:ProgressEvent):void{
recordReceivedEvent(_arg1.type);
}
private function errorHandler(_arg1:ErrorEvent):void{
var _local2:Dictionary = createCommonReportableValues();
_local2[SdkStatisticsLoggerImpl.REPORT_KEY_ERROR_EVENT_TEXT] = _arg1.text;
SdkStatisticsLoggerImpl.instance.reportError(LogIds.ResourceLoadLogger_errorHandler, null, _local2);
releaseResources();
}
private function destroyLoadTimer():void{
if (loadTimer != null){
loadTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, loadTimeoutHandler);
loadTimer.stop();
loadTimer = null;
};
}
private function recordReceivedEvent(_arg1:String, _arg2:Array=null):void{
if (_arg2 == null){
_arg2 = [];
};
var _local3:Object = getReceivedEvent(_arg1);
if (_local3 == null){
receivedEvents.push({eventType:_arg1, eventData:_arg2});
} else {
_local3.eventData = _local3.eventData.concat(_arg2);
};
}
private function removeEventListeners():void{
resourceLoaderValue.removeEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusEventHandler);
resourceLoaderValue.removeEventListener(Event.OPEN, openEventHandler);
resourceLoaderValue.removeEventListener(ProgressEvent.PROGRESS, progressEventHandler);
resourceLoaderValue.removeEventListener(Event.COMPLETE, completeHandler);
resourceLoaderValue.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
resourceLoaderValue.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
}
private function releaseResources():void{
receivedEvents = [];
timeoutCurrentLogCountValue = 1;
removeEventListeners();
destroyLoadTimer();
}
public function aboutToLoad(_arg1:URLRequest, _arg2:uint=1):void{
this.request = _arg1;
if (_arg2 <= 0){
_arg2 = 1;
};
timeoutMaxLogCountValue = _arg2;
releaseResources();
addEventListeners();
startLoadTimer(loadTimeout);
}
private function loadTimeoutHandler(_arg1:TimerEvent):void{
logTimeout();
if (timeoutCurrentLogCountValue <= timeoutMaxLogCountValue){
startLoadTimer(loadTimeout);
} else {
dispatchEvent(new Event(LOAD_TIMEOUT_EVENT));
releaseResources();
};
}
private function createCommonReportableValues():Dictionary{
var _local3:Object;
var _local1:Dictionary = new Dictionary();
var _local2 = "";
for each (_local3 in receivedEvents) {
_local2 = (_local2 + formatEventsData(_local3.eventType, _local3.eventData));
};
if (_local2 != ""){
_local1[SdkStatisticsLoggerImpl.REPORT_KEY_EVENTS] = _local2;
};
_local1[SdkStatisticsLoggerImpl.REPORT_KEY_ERROR_URL] = request.url.substr(0, MAX_REPORTED_URL_LENGTH);
return (_local1);
}
private function openEventHandler(_arg1:Event):void{
recordReceivedEvent(_arg1.type);
}
private function logTimeout():void{
var _local1:Dictionary = createCommonReportableValues();
if (timeoutMaxLogCountValue > 1){
_local1[SdkStatisticsLoggerImpl.REPORT_KEY_TIMEOUT_COUNT] = (timeoutCurrentLogCountValue - 1);
};
SdkStatisticsLoggerImpl.instance.reportError(LogIds.ResourceLoadLogger_logTimeout, null, _local1);
}
public static function formatEventsData(_arg1:String, _arg2:Array):String{
var _local3:String = _arg1;
if (_arg2.length > 0){
_local3 = (_local3 + ("_" + _arg2.join(",")));
};
return ((_local3 + ";"));
}
}
}//package com.google.ads.instream.apidependency
Section 124
//SdkStatisticsLogger (com.google.ads.instream.apidependency.SdkStatisticsLogger)
package com.google.ads.instream.apidependency {
import com.google.ads.instream.api.*;
import flash.utils.*;
public interface SdkStatisticsLogger {
function reportAdError(_arg1:uint, _arg2:String, _arg3:AdError, _arg4:Dictionary=null):void;
function get loggingEnabled():Boolean;
function reportError(_arg1:uint, _arg2:String, _arg3:Dictionary=null):void;
function report(_arg1:uint, _arg2:String=null, _arg3:Dictionary=null):void;
function reportApi(_arg1:uint, _arg2:Dictionary=null):void;
function get logPercent():uint;
function set loggingEnabled(_arg1:Boolean):void;
function setPersistentProperty(_arg1:String, _arg2:Object):void;
}
}//package com.google.ads.instream.apidependency
Section 125
//SdkStatisticsLoggerConfig (com.google.ads.instream.apidependency.SdkStatisticsLoggerConfig)
package com.google.ads.instream.apidependency {
import flash.utils.*;
public class SdkStatisticsLoggerConfig {
private var logPercentValue:Number;
private var loggablePointsValue:Dictionary;
public function SdkStatisticsLoggerConfig(_arg1:XML){
loggablePointsValue = new Dictionary();
parse(_arg1);
}
private function parseIds(_arg1:XMLList, _arg2:Boolean):void{
var _local3:XML;
var _local4:Array;
var _local5:String;
var _local6:uint;
var _local7:LoggablePoint;
for each (_local3 in _arg1) {
_local4 = _local3.toString().split(",");
if (_local4.length > 0){
for each (_local5 in _local4) {
_local6 = parseInt(_local5);
if (loggablePoints[_local6] == null){
_local7 = new LoggablePoint(_local6, _arg2, (_local3.@logAlways == "true"), _local3.@cexp);
loggablePoints[_local6] = _local7;
};
};
};
};
}
public function get loggablePoints():Dictionary{
return (loggablePointsValue);
}
public function get logPercent():Number{
return (logPercentValue);
}
private function parse(_arg1:XML):void{
var logConfig = _arg1;
try {
logPercentValue = parseFloat(logConfig.@p);
parseIds(logConfig.Youtube.Ids, true);
parseIds(logConfig.All.Ids, false);
} catch(error:Error) {
};
}
}
}//package com.google.ads.instream.apidependency
Section 126
//SdkStatisticsLoggerImpl (com.google.ads.instream.apidependency.SdkStatisticsLoggerImpl)
package com.google.ads.instream.apidependency {
import com.google.ads.instream.api.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
import com.google.ads.instream.common.*;
public class SdkStatisticsLoggerImpl implements SdkStatisticsLogger {
private var config:SdkStatisticsLoggerConfig;
private var logPercentValue:uint;
private var persistentProperties:Dictionary;
private var loggingEnabledValue:Boolean;
public static const REPORT_KEY_USER_CHOICE_CLICKED_UI_ID:String = "uccui";
public static const REPORT_KEY_LOG_ID:String = "lid";
private static const REPORT_KEY_LANGUAGE:String = "l";
public static const REPORT_KEY_EVENTS:String = "evts";
public static const REPORT_KEY_ID:String = "id";
public static const REPORT_KEY_SDK_VERSION:String = "sv";
public static const REPORT_VALUE_FALSE:String = "f";
public static const REPORT_KEY_SOURCE:String = "src";
public static const REPORT_KEY_VIDEO_AD_DURATION:String = "vdur";
public static const LOGGING_ID:String = "ima_sdk";
public static const REPORT_KEY_AD_EVENT:String = "aevt";
public static const REPORT_KEY_AD_SERVER:String = "adsrv";
public static const REPORT_KEY_TIMEOUT_COUNT:String = "tc";
public static const REPORT_VALUE_TRUE:String = "t";
public static const REPORT_KEY_ERROR_URL:String = "url";
public static const REPORT_KEY_YOUTUBE_VIDEO_AD_ID:String = "ytvid";
public static const ERROR_TYPE:String = "ima_error";
public static const REPORT_KEY_ERROR_EVENT_TEXT:String = "eet";
public static const REPORT_KEY_ADS_MANAGER_TYPE:String = "mt";
public static const REPORT_KEY_ADS_MANAGER_CONTEXT_ID:String = "amcid";
public static const REPORT_KEY_USER_CHOICE_ADS_COUNT:String = "ucac";
public static const REPORT_KEY_SHORT_MESSAGE:String = "msg";
public static const REPORT_KEY_AFV_PUBLISHER_ID:String = "pid";
public static const REPORT_KEY_USER_CHOICE_EVENT_TIME:String = "ucevtt";
public static const REPORT_KEY_USER_CHOICE_RENDERING_STYLE:String = "ucrs";
public static const REPORT_KEY_AD_TYPE:String = "adt";
public static const REPORT_KEY_ADS_MANAGER_VERSION:String = "mv";
private static const REPORT_KEY_PLAYER_TYPE:String = "pt";
private static const REPORT_KEY_OS:String = "os";
public static const REPORT_KEY_EXPERIMENT_ID:String = "exp";
public static const ADS_LOADER_SOURCE:String = "adsldr";
public static const REPORT_KEY_USER_CHOICE_ALTERNATIVE_ADS_COUNT:String = "ucalt_ads";
public static const API_TYPE:String = "ima_api";
public static const SDK_LOADER_SOURCE:String = "sdkldr";
public static const REPORT_KEY_AD_SLOT_ID:String = "slot";
public static const REPORT_KEY_VALUE_SEPARATOR:String = "|";
public static const REPORT_KEY_TYPE:String = "type";
public static const REPORT_URL_PREFIX:String = "http://pagead2.googlesyndication.com/pagead/gen_204";
private static const youtubeHosts:Array = ["youtube.com", "ytimg.com"];
public static const REPORT_KEY_YOUTUBE:String = "yt";
private static const REPORT_KEY_DEBUGGER:String = "d";
public static const SWC_SOURCE:String = "swc";
private static const REPORT_KEY_MANUFACTURER:String = "m";
private static const REPORT_KEY_FLASH_VERSION:String = "fv";
private static var instanceValue:SdkStatisticsLogger;
public function SdkStatisticsLoggerImpl(_arg1:SdkStatisticsLoggerConfig){
persistentProperties = new Dictionary();
super();
this.config = _arg1;
loggingEnabled = decideToLog(_arg1.logPercent);
}
public function decideToLog(_arg1:Number):Boolean{
return (MathUtils.isRandomlySelected(_arg1));
}
public function reportApi(_arg1:uint, _arg2:Dictionary=null):void{
if (_arg2 == null){
_arg2 = new Dictionary();
};
_arg2[REPORT_KEY_TYPE] = API_TYPE;
report(_arg1, null, _arg2);
}
private function shouldReportData(_arg1:Dictionary, _arg2:LoggablePoint):Boolean{
if (_arg2.logForYoutubeOnly){
return ((_arg1[SdkStatisticsLoggerImpl.REPORT_KEY_YOUTUBE] == SdkStatisticsLoggerImpl.REPORT_VALUE_TRUE));
};
return (true);
}
public function report(_arg1:uint, _arg2:String=null, _arg3:Dictionary=null):void{
var _local5:URLRequest;
if (!shouldLog(_arg1)){
return;
};
if (_arg3 == null){
_arg3 = new Dictionary();
};
if (_arg2 != null){
_arg3[REPORT_KEY_SHORT_MESSAGE] = _arg2;
};
_arg3[REPORT_KEY_LOG_ID] = _arg1;
var _local4:Dictionary = proccessQueryParams(_arg3);
if (shouldReportData(_local4, config.loggablePoints[_arg1])){
_local5 = createReportingUrl(_local4);
sendToURL(_local5);
};
}
public function setPersistentProperty(_arg1:String, _arg2:Object):void{
persistentProperties[_arg1] = getParamValue(_arg2);
}
private function mergeProperties(_arg1:Dictionary, _arg2:Dictionary):void{
var _local3:String;
for (_local3 in _arg1) {
_arg2[_local3] = _arg1[_local3];
};
}
public function set loggingEnabled(_arg1:Boolean):void{
loggingEnabledValue = _arg1;
}
public function reportAdError(_arg1:uint, _arg2:String, _arg3:AdError, _arg4:Dictionary=null):void{
if (_arg4 == null){
_arg4 = new Dictionary();
};
if (_arg3.errorType != null){
_arg4["errType"] = _arg3.errorType;
};
if (_arg3.errorMessage != null){
_arg4["errMsg"] = _arg3.errorMessage;
};
if (_arg3.errorCode > 0){
_arg4["errCode"] = _arg3.errorCode;
};
if (_arg3.innerError != null){
_arg4["innerCode"] = _arg3.innerError.errorID;
};
reportError(_arg1, _arg2, _arg4);
}
private function getParamValue(_arg1:Object):String{
if ((_arg1 is String)){
return ((_arg1 as String));
};
if ((_arg1 is Boolean)){
return ((_arg1) ? REPORT_VALUE_TRUE : REPORT_VALUE_FALSE);
//unresolved jump
};
return (((_arg1)==null) ? "null" : _arg1.toString());
}
protected function sendToURL(_arg1:URLRequest):void{
sendToURL(_arg1);
}
public function get logPercent():uint{
return (logPercentValue);
}
public function get loggingEnabled():Boolean{
return (loggingEnabledValue);
}
private function proccessQueryParams(_arg1:Dictionary):Dictionary{
var _local3:String;
var _local2:Dictionary = new Dictionary();
mergeProperties(persistentProperties, _arg1);
for (_local3 in _arg1) {
_local2[_local3] = getParamValue(_arg1[_local3]);
};
_local2[REPORT_KEY_ID] = getParamValue(LOGGING_ID);
_local2[REPORT_KEY_DEBUGGER] = getParamValue((Capabilities.isDebugger) ? REPORT_VALUE_TRUE : REPORT_VALUE_FALSE);
_local2[REPORT_KEY_LANGUAGE] = getParamValue(Capabilities.language);
_local2[REPORT_KEY_MANUFACTURER] = getParamValue(Capabilities.manufacturer);
_local2[REPORT_KEY_OS] = getParamValue(Capabilities.os);
_local2[REPORT_KEY_PLAYER_TYPE] = getParamValue(Capabilities.playerType);
_local2[REPORT_KEY_FLASH_VERSION] = getParamValue(Capabilities.version);
return (_local2);
}
public function reportError(_arg1:uint, _arg2:String, _arg3:Dictionary=null):void{
if (_arg3 == null){
_arg3 = new Dictionary();
};
_arg3[REPORT_KEY_TYPE] = ERROR_TYPE;
report(_arg1, _arg2, _arg3);
}
private function createReportingUrl(_arg1:Dictionary):URLRequest{
var _local4:String;
var _local2:URLRequest = new URLRequest();
_local2.url = (REPORT_URL_PREFIX + "?");
var _local3:Boolean;
for (_local4 in _arg1) {
if (_local3){
_local2.url = (_local2.url + ("&" + createQueryParam(_local4, _arg1[_local4])));
} else {
_local2.url = (_local2.url + createQueryParam(_local4, _arg1[_local4]));
_local3 = true;
};
};
return (_local2);
}
private function shouldLog(_arg1:uint):Boolean{
var _local2:LoggablePoint;
if ((((_arg1 > 0)) && (!((config.loggablePoints[_arg1] == null))))){
_local2 = config.loggablePoints[_arg1];
if (loggingEnabled){
return (true);
};
return (_local2.logAlways);
};
return (false);
}
public static function get instance():SdkStatisticsLogger{
if (instanceValue == null){
instanceValue = new BufferedSdkStatisticsLoggerImpl();
};
return (instanceValue);
}
private static function matchesHostname(_arg1:String, _arg2:String):Boolean{
_arg2 = _arg2.toLowerCase();
if (_arg2.substr(0, 2) == "*."){
_arg2 = _arg2.slice(2);
if (_arg2.length > _arg1.length){
return (false);
};
return ((((_arg1.slice(-(_arg2.length)) == _arg2)) && ((((_arg1.length == _arg2.length)) || ((_arg1.charAt(((_arg1.length - _arg2.length) - 1)) == "."))))));
//unresolved jump
};
return ((_arg2 == _arg1));
}
private static function createQueryParam(_arg1:String, _arg2:String):String{
return (((encodeURIComponent(_arg1) + "=") + encodeURIComponent(_arg2)));
}
public static function set instance(_arg1:SdkStatisticsLogger):void{
var _local2:BufferedSdkStatisticsLoggerImpl;
if ((instanceValue is BufferedSdkStatisticsLoggerImpl)){
_local2 = (instanceValue as BufferedSdkStatisticsLoggerImpl);
_local2.executeStoredMethodsOn(_arg1);
};
instanceValue = _arg1;
}
public static function isYoutubeHost(_arg1:String):Boolean{
var hostName:String;
var domain:String;
var subdomain:String;
var publisherUrl = _arg1;
try {
hostName = publisherUrl.split("/")[2];
for each (domain in youtubeHosts) {
subdomain = ("*." + domain);
if (((matchesHostname(hostName, domain)) || (matchesHostname(hostName, subdomain)))){
return (true);
};
};
} catch(error:Error) {
};
return (false);
}
}
}//package com.google.ads.instream.apidependency
Section 127
//TimedLoader (com.google.ads.instream.apidependency.TimedLoader)
package com.google.ads.instream.apidependency {
import flash.net.*;
import flash.system.*;
import com.google.utils.*;
public class TimedLoader extends SafeLoader {
private var resourceLoadLogger:ResourceLoadLogger;
public function TimedLoader(_arg1:ResourceLoadLogger=null){
if (_arg1 == null){
_arg1 = new ResourceLoadLogger(contentLoaderInfo);
};
this.resourceLoadLogger = _arg1;
}
override public function load(_arg1:URLRequest, _arg2:LoaderContext=null):void{
resourceLoadLogger.aboutToLoad(_arg1);
doActualLoad(_arg1, _arg2);
}
protected function doActualLoad(_arg1:URLRequest, _arg2:LoaderContext=null):void{
super.load(_arg1, _arg2);
}
}
}//package com.google.ads.instream.apidependency
Section 128
//ImaConstants (com.google.ads.instream.common.ImaConstants)
package com.google.ads.instream.common {
public class ImaConstants {
public static const HOST_PATH:String = "http://s0.2mdn.net/instream/";
public static const IMA_INTEGRATION_VALUE:String = "deep";
public static const IMA_VERSION_INFO:Object = [{version:"1", minor:{version:"0.17", dclk_sdk:"14.43.0"}}, {version:"2", minor:{version:"9.4", afv_audio:"1.23", afv_template:"1.27", afv_text:"1.23", afv_userchoice:"1.9", vast:"1.2", dclk_sdk:"14.68.0", playlist:"1.9"}}];
public static const IMA_FULL_VERSION_VALUE:String = ((IMA_VERSION_INFO[1].version + ".") + IMA_VERSION_INFO[1].minor.version);
}
}//package com.google.ads.instream.common
Section 129
//MathUtils (com.google.ads.instream.common.MathUtils)
package com.google.ads.instream.common {
public class MathUtils {
public static function isRandomlySelected(_arg1:Number):Boolean{
if (_arg1 <= 0){
return (false);
};
if (_arg1 >= 1){
return (true);
};
return ((Math.random() <= _arg1));
}
}
}//package com.google.ads.instream.common
Section 130
//AdErrorEventWrapper (com.google.ads.instream.wrappers.AdErrorEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class AdErrorEventWrapper extends AdErrorEvent {
private var localInstance:Object;// = null
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;// = null
function AdErrorEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super((Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.error, localInstance) as AdError), _arg1.userRequestContext);
}
override public function clone():Event{
return (new AdErrorEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 131
//AdErrorWrapper (com.google.ads.instream.wrappers.AdErrorWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.utils.*;
public class AdErrorWrapper extends Error implements AdError {
private var remoteMethodResultsDictionary:Dictionary;
private var localInstanceReference:Object;
private var remoteInstanceReference:Object;
public function AdErrorWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsDictionary = new Dictionary();
this.remoteInstanceReference = _arg1;
this.localInstanceReference = _arg2;
}
protected function get remoteMethodResultsStore():Dictionary{
return (remoteMethodResultsDictionary);
}
public function get errorType():String{
return (remoteInstance.errorType);
}
public function get localInstance():Object{
return (localInstanceReference);
}
public function get innerError():Error{
return (remoteInstance.innerError);
}
public function get errorCode():int{
return (remoteInstance.errorCode);
}
public function get remoteInstance():Object{
return (remoteInstanceReference);
}
public function get errorMessage():String{
return (remoteInstance.errorMessage);
}
}
}//package com.google.ads.instream.wrappers
Section 132
//AdEventWrapper (com.google.ads.instream.wrappers.AdEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class AdEventWrapper extends AdEvent {
private var localInstance:Object;// = null
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;// = null
function AdEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super(_arg1.type, (Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.ad, localInstance) as Ad));
}
override public function clone():Event{
return (new AdEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 133
//AdLoadedEventWrapper (com.google.ads.instream.wrappers.AdLoadedEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class AdLoadedEventWrapper extends AdLoadedEvent {
private var localInstance:Object;// = null
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;// = null
function AdLoadedEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super((Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.ad, localInstance) as Ad), _arg1.type, _arg1.netStream);
}
override public function clone():Event{
return (new AdLoadedEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 134
//AdMenuEventWrapper (com.google.ads.instream.wrappers.AdMenuEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class AdMenuEventWrapper extends AdMenuEvent {
private var localInstance:Object;
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;
function AdMenuEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super(_arg1.type, (Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.adsManager, _arg2) as AdsManager));
}
override public function clone():Event{
return (new AdMenuEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 135
//AdRuleAdBreakWrapper (com.google.ads.instream.wrappers.AdRuleAdBreakWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class AdRuleAdBreakWrapper extends Wrapper implements AdRuleAdBreak {
function AdRuleAdBreakWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get adType():String{
return (remoteInstance.adType);
}
public function get adBreakType():String{
return (remoteInstance.adBreakType);
}
public function get adTagUrl():String{
return (remoteInstance.adTagUrl);
}
public function get duration():int{
return (remoteInstance.duration);
}
public function get startTime():int{
return (remoteInstance.startTime);
}
}
}//package com.google.ads.instream.wrappers
Section 136
//AdRuleWrapper (com.google.ads.instream.wrappers.AdRuleWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class AdRuleWrapper extends Wrapper implements AdRule {
function AdRuleWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get adBreaks():Array{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.adBreaks, localInstance) as Array));
}
}
}//package com.google.ads.instream.wrappers
Section 137
//AdSizeChangedEventWrapper (com.google.ads.instream.wrappers.AdSizeChangedEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class AdSizeChangedEventWrapper extends AdSizeChangedEvent {
private var localInstance:Object;// = null
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;// = null
function AdSizeChangedEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super((Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.ad, localInstance) as Ad), _arg1.type, _arg1.state, _arg1.width, _arg1.height);
}
override public function clone():Event{
return (new AdSizeChangedEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 138
//AdsLoadedEventWrapper (com.google.ads.instream.wrappers.AdsLoadedEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class AdsLoadedEventWrapper extends AdsLoadedEvent {
private var localInstance:Object;// = null
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;// = null
function AdsLoadedEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super((Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.adsManager, localInstance) as AdsManager), _arg1.userRequestContext);
}
override public function clone():Event{
return (new AdsLoadedEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 139
//AdsLoaderWrapper (com.google.ads.instream.wrappers.AdsLoaderWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
public class AdsLoaderWrapper extends EventDispatcherWrapper implements AdsLoaderInterface {
public function AdsLoaderWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function requestAds(_arg1:AdsRequest, _arg2:Object=null):void{
remoteInstance.requestAds(Wrappers.localToRemote(_arg1), _arg2);
}
public function unload():void{
remoteInstance.unload();
}
public static function set remoteApplicationDomainProxy(_arg1:Object):void{
Wrappers.remoteApplicationDomainProxy = _arg1;
}
}
}//package com.google.ads.instream.wrappers
Section 140
//AdsManagerWrapper (com.google.ads.instream.wrappers.AdsManagerWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class AdsManagerWrapper extends EventDispatcherWrapper implements AdsManager {
function AdsManagerWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get adSlotWidth():Number{
return (remoteInstance.adSlotWidth);
}
public function get adSlotHeight():Number{
return (remoteInstance.adSlotHeight);
}
public function set adSlotWidth(_arg1:Number):void{
remoteInstance.adSlotWidth = _arg1;
}
public function load(_arg1:Object=null):void{
remoteInstance.load(_arg1);
}
public function unload():void{
remoteInstance.unload();
}
public function get ads():Array{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.ads, localInstance) as Array));
}
public function set adSlotHeight(_arg1:Number):void{
remoteInstance.adSlotHeight = _arg1;
}
public function play(_arg1:Object=null):void{
remoteInstance.play(_arg1);
}
public function get type():String{
return (remoteInstance.type);
}
}
}//package com.google.ads.instream.wrappers
Section 141
//AdWrapper (com.google.ads.instream.wrappers.AdWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class AdWrapper extends Wrapper implements Ad {
function AdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function getCompanionAds(_arg1:String, _arg2:Number, _arg3:Number, _arg4:CompanionAdSelectionSettings=null):Array{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.getCompanionAds(_arg1, _arg2, _arg3, Wrappers.localToRemote(_arg4)), localInstance) as Array));
}
public function get traffickingParameters():Object{
return (remoteInstance.traffickingParameters);
}
public function getCompanionAdUrl(_arg1:String, _arg2:String=null):String{
return (remoteInstance.getCompanionAdUrl(_arg1, _arg2));
}
public function get type():String{
return (remoteInstance.type);
}
public function get id():String{
return (remoteInstance.id);
}
public function get surveyUrl():String{
return (remoteInstance.surveyUrl);
}
}
}//package com.google.ads.instream.wrappers
Section 142
//CompanionAdWrapper (com.google.ads.instream.wrappers.CompanionAdWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class CompanionAdWrapper extends Wrapper implements CompanionAd {
function CompanionAdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get environment():String{
return (remoteInstance.environment);
}
}
}//package com.google.ads.instream.wrappers
Section 143
//CustomContentAdWrapper (com.google.ads.instream.wrappers.CustomContentAdWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class CustomContentAdWrapper extends AdWrapper implements CustomContentAd {
function CustomContentAdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get content():String{
return (remoteInstance.content);
}
}
}//package com.google.ads.instream.wrappers
Section 144
//DoubleClickStudioFlashAssetWrapper (com.google.ads.instream.wrappers.DoubleClickStudioFlashAssetWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class DoubleClickStudioFlashAssetWrapper extends FlashAssetWrapper implements DoubleClickStudioFlashAsset {
function DoubleClickStudioFlashAssetWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function call(_arg1:String, ... _args):void{
_args.unshift(_arg1);
remoteInstance.call.apply(remoteInstance, _args);
}
}
}//package com.google.ads.instream.wrappers
Section 145
//EventDispatcherWrapper (com.google.ads.instream.wrappers.EventDispatcherWrapper)
package com.google.ads.instream.wrappers {
import flash.events.*;
import flash.utils.*;
public class EventDispatcherWrapper extends EventDispatcher {
private var remoteMethodResultsDictionary:Dictionary;
private var localInstanceReference:Object;
private var remoteInstanceReference:Object;
private var listenersMap:Object;
public function EventDispatcherWrapper(_arg1:Object, _arg2:Object=null){
listenersMap = {};
super();
remoteMethodResultsDictionary = new Dictionary();
this.remoteInstanceReference = _arg1;
this.localInstanceReference = _arg2;
}
private function listenerRemoved(_arg1:String):void{
if (listenersMap[_arg1]){
listenersMap[_arg1].count--;
if (listenersMap[_arg1].count == 0){
remoteInstance.removeEventListener(_arg1, listenersMap[_arg1].listener);
listenersMap[_arg1] = null;
};
};
}
public function get localInstance():Object{
return (localInstanceReference);
}
private function listenerAdded(_arg1:String):void{
var type = _arg1;
if (!listenersMap[type]){
listenersMap[type] = {};
listenersMap[type].count = 0;
listenersMap[type].listener = function (_arg1:Event):void{
dispatchEvent((Wrappers.unwrappedRemoteToLocal(remoteMethodResultsStore, _arg1) as Event));
delete remoteMethodResultsStore[_arg1];
};
remoteInstance.addEventListener(type, listenersMap[type].listener);
};
listenersMap[type].count++;
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
listenerAdded(_arg1);
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
super.removeEventListener(_arg1, _arg2, _arg3);
listenerRemoved(_arg1);
}
protected function get remoteMethodResultsStore():Dictionary{
return (remoteMethodResultsDictionary);
}
public function get remoteInstance():Object{
return (remoteInstanceReference);
}
}
}//package com.google.ads.instream.wrappers
Section 146
//FlashAdCustomEventWrapper (com.google.ads.instream.wrappers.FlashAdCustomEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class FlashAdCustomEventWrapper extends FlashAdCustomEvent {
private var localInstance:Object;// = null
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;// = null
function FlashAdCustomEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super((Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.ad, localInstance) as FlashAd), {eventObject:_arg1.eventContext, eventName:_arg1.eventName});
}
override public function clone():Event{
return (new FlashAdCustomEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 147
//FlashAdsManagerWrapper (com.google.ads.instream.wrappers.FlashAdsManagerWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class FlashAdsManagerWrapper extends AdsManagerWrapper implements FlashAdsManager {
function FlashAdsManagerWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function set x(_arg1:Number):void{
remoteInstance.x = _arg1;
}
public function set y(_arg1:Number):void{
remoteInstance.y = _arg1;
}
public function set decoratedAd(_arg1:Boolean):void{
remoteInstance.decoratedAd = _arg1;
}
public function get x():Number{
return (remoteInstance.x);
}
public function get y():Number{
return (remoteInstance.y);
}
public function set volumeAd(_arg1:Number):void{
remoteInstance.volumeAd = _arg1;
}
public function get volumeAd():Number{
return (remoteInstance.volumeAd);
}
}
}//package com.google.ads.instream.wrappers
Section 148
//FlashAdWrapper (com.google.ads.instream.wrappers.FlashAdWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class FlashAdWrapper extends AdWrapper implements FlashAd {
function FlashAdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get asset():FlashAsset{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.asset, localInstance) as FlashAsset));
}
public function reportCustomKeysAndValues(_arg1:Dictionary):void{
remoteInstance.reportCustomKeysAndValues(_arg1);
}
public function enableManualEventsReporting():void{
remoteInstance.enableManualEventsReporting();
}
public function reportEvents():void{
remoteInstance.reportEvents();
}
}
}//package com.google.ads.instream.wrappers
Section 149
//FlashAssetWrapper (com.google.ads.instream.wrappers.FlashAssetWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class FlashAssetWrapper extends Wrapper implements FlashAsset {
function FlashAssetWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get expandedHeight():Number{
return (remoteInstance.expandedHeight);
}
public function get expandedWidth():Number{
return (remoteInstance.expandedWidth);
}
public function get width():Number{
return (remoteInstance.width);
}
public function get y():Number{
return (remoteInstance.y);
}
public function get height():Number{
return (remoteInstance.height);
}
public function set x(_arg1:Number):void{
remoteInstance.x = _arg1;
}
public function set y(_arg1:Number):void{
remoteInstance.y = _arg1;
}
public function get x():Number{
return (remoteInstance.x);
}
public function get type():String{
return (remoteInstance.type);
}
public function get frameRate():Number{
return (remoteInstance.frameRate);
}
}
}//package com.google.ads.instream.wrappers
Section 150
//FlashCompanionAdWrapper (com.google.ads.instream.wrappers.FlashCompanionAdWrapper)
package com.google.ads.instream.wrappers {
import flash.display.*;
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class FlashCompanionAdWrapper extends Wrapper implements FlashCompanionAd {
function FlashCompanionAdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function load():void{
remoteInstance.load();
}
public function set x(_arg1:Number):void{
remoteInstance.x = _arg1;
}
public function set y(_arg1:Number):void{
remoteInstance.y = _arg1;
}
public function play(_arg1:DisplayObjectContainer):void{
remoteInstance.play(_arg1);
}
public function unload():void{
remoteInstance.unload();
}
public function get y():Number{
return (remoteInstance.y);
}
public function get environment():String{
return (remoteInstance.environment);
}
public function get x():Number{
return (remoteInstance.x);
}
}
}//package com.google.ads.instream.wrappers
Section 151
//HtmlCompanionAdWrapper (com.google.ads.instream.wrappers.HtmlCompanionAdWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class HtmlCompanionAdWrapper extends Wrapper implements HtmlCompanionAd {
function HtmlCompanionAdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get content():String{
return (remoteInstance.content);
}
public function get environment():String{
return (remoteInstance.environment);
}
}
}//package com.google.ads.instream.wrappers
Section 152
//MediaSelectionSettingsWrapper (com.google.ads.instream.wrappers.MediaSelectionSettingsWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
class MediaSelectionSettingsWrapper extends MediaSelectionSettings {
}
}//package com.google.ads.instream.wrappers
Section 153
//PlayListContentWrapper (com.google.ads.instream.wrappers.PlayListContentWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class PlayListContentWrapper extends Wrapper implements PlayListContent {
function PlayListContentWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function set url(_arg1:String):void{
remoteInstance.url = _arg1;
}
public function get url():String{
return (remoteInstance.url);
}
}
}//package com.google.ads.instream.wrappers
Section 154
//PlayListErrorEventWrapper (com.google.ads.instream.wrappers.PlayListErrorEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import com.google.ads.instream.wrappers.*;
class PlayListErrorEventWrapper extends PlayListErrorEvent {
private var localInstance:Object;
private var remoteInstance:Object;
function PlayListErrorEventWrapper(_arg1:Object, _arg2:Object=null){
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super(_arg1.text, _arg1.userRequestContext);
}
override public function clone():Event{
return (new PlayListErrorEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 155
//PlayListEventWrapper (com.google.ads.instream.wrappers.PlayListEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import com.google.ads.instream.wrappers.*;
class PlayListEventWrapper extends PlayListEvent {
private var localInstance:Object;
private var remoteInstance:Object;
function PlayListEventWrapper(_arg1:Object, _arg2:Object=null){
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super(_arg1.type, _arg1.netStream);
}
override public function clone():Event{
return (new PlayListEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 156
//PlayListLoadedEventWrapper (com.google.ads.instream.wrappers.PlayListLoadedEventWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.utils.*;
import com.google.ads.instream.wrappers.*;
class PlayListLoadedEventWrapper extends PlayListLoadedEvent {
private var localInstance:Object;
private var remoteMethodResultsStore:Dictionary;
private var remoteInstance:Object;
function PlayListLoadedEventWrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsStore = new Dictionary();
this.remoteInstance = _arg1;
this.localInstance = _arg2;
super((Wrappers.remoteToLocal(remoteMethodResultsStore, _arg1.playListManager, localInstance) as PlayListManager), _arg1.userRequestContext);
}
override public function clone():Event{
return (new PlayListLoadedEventWrapper(remoteInstance, localInstance));
}
}
}//package com.google.ads.instream.wrappers
Section 157
//PlayListLoaderWrapper (com.google.ads.instream.wrappers.PlayListLoaderWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
public class PlayListLoaderWrapper extends EventDispatcherWrapper implements PlayListLoaderInterface {
public function PlayListLoaderWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function requestPlayList(_arg1:PlayListRequest, _arg2:Object=null):void{
remoteInstance.requestPlayList(Wrappers.localToRemote(_arg1), _arg2);
}
}
}//package com.google.ads.instream.wrappers
Section 158
//PlayListManagerWrapper (com.google.ads.instream.wrappers.PlayListManagerWrapper)
package com.google.ads.instream.wrappers {
import flash.display.*;
import com.google.ads.instream.api.*;
import flash.system.*;
import com.google.ads.instream.wrappers.*;
class PlayListManagerWrapper extends EventDispatcherWrapper implements PlayListManager {
function PlayListManagerWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
remoteInstance.publisherApplicationDomain = ApplicationDomain.currentDomain;
}
public function load(_arg1:Object):void{
remoteInstance.load(_arg1);
}
public function set adSlotX(_arg1:Number):void{
remoteInstance.adSlotX = _arg1;
}
public function set adSlotY(_arg1:Number):void{
remoteInstance.adSlotY = _arg1;
}
public function get playList():PlayList{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.playList, localInstance) as PlayList));
}
public function play(_arg1:Object):void{
remoteInstance.play(_arg1);
}
public function get adSlotX():Number{
return (remoteInstance.adSlotX);
}
public function get adSlotY():Number{
return (remoteInstance.adSlotY);
}
public function set clickTrackingElement(_arg1:InteractiveObject):void{
remoteInstance.clickTrackingElement = _arg1;
}
public function get clickTrackingElement():InteractiveObject{
return (remoteInstance.clickTrackingElement);
}
}
}//package com.google.ads.instream.wrappers
Section 159
//PlayListWrapper (com.google.ads.instream.wrappers.PlayListWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class PlayListWrapper extends Wrapper implements PlayList {
function PlayListWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get content():PlayListContent{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.content, localInstance) as PlayListContent));
}
public function get adRule():AdRule{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.adRule, localInstance) as AdRule));
}
}
}//package com.google.ads.instream.wrappers
Section 160
//UserChoiceAdsManagerWrapper (com.google.ads.instream.wrappers.UserChoiceAdsManagerWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class UserChoiceAdsManagerWrapper extends FlashAdsManagerWrapper implements UserChoiceAdsManager {
function UserChoiceAdsManagerWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function set alternateAdsCount(_arg1:int):void{
remoteInstance.alternateAdsCount = _arg1;
}
}
}//package com.google.ads.instream.wrappers
Section 161
//VastCustomClickWrapper (com.google.ads.instream.wrappers.VastCustomClickWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class VastCustomClickWrapper extends Wrapper implements VastCustomClick {
function VastCustomClickWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get id():String{
return (remoteInstance.id);
}
public function get url():String{
return (remoteInstance.url);
}
}
}//package com.google.ads.instream.wrappers
Section 162
//VastVideoAdWrapper (com.google.ads.instream.wrappers.VastVideoAdWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class VastVideoAdWrapper extends VideoAdWrapper implements VastVideoAd {
function VastVideoAdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get wrappers():Array{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.wrappers, localInstance) as Array));
}
public function get customClicks():Array{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.customClicks, localInstance) as Array));
}
public function get companionAdXMLList():XMLList{
return (remoteInstance.companionAdXMLList);
}
public function get description():String{
return (remoteInstance.description);
}
public function get nonLinearAdXMLList():XMLList{
return (remoteInstance.nonLinearAdXMLList);
}
public function get adSystem():String{
return (remoteInstance.adSystem);
}
}
}//package com.google.ads.instream.wrappers
Section 163
//VastWrapperWrapper (com.google.ads.instream.wrappers.VastWrapperWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class VastWrapperWrapper extends Wrapper implements VastWrapper {
function VastWrapperWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get adSystem():String{
return (remoteInstance.adSystem);
}
public function get customClicks():Array{
return ((Wrappers.remoteToLocal(remoteMethodResultsStore, remoteInstance.customClicks, localInstance) as Array));
}
}
}//package com.google.ads.instream.wrappers
Section 164
//VideoAdsManagerWrapper (com.google.ads.instream.wrappers.VideoAdsManagerWrapper)
package com.google.ads.instream.wrappers {
import flash.display.*;
import com.google.ads.instream.api.*;
import com.google.ads.instream.wrappers.*;
class VideoAdsManagerWrapper extends AdsManagerWrapper implements VideoAdsManager {
private var localMediaSelectionSettings:MediaSelectionSettings;
function VideoAdsManagerWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function get y():Number{
return (remoteInstance.y);
}
public function set mediaSelectionSettings(_arg1:MediaSelectionSettings):void{
localMediaSelectionSettings = _arg1;
remoteInstance.mediaSelectionSettings = Wrappers.localToRemote(_arg1);
}
public function set x(_arg1:Number):void{
remoteInstance.x = _arg1;
}
public function get mediaSelectionSettings():MediaSelectionSettings{
if (localMediaSelectionSettings == null){
localMediaSelectionSettings = new MediaSelectionSettings();
};
if (remoteInstance.mediaSelectionSettings != null){
Wrappers.copy(remoteInstance.mediaSelectionSettings, localMediaSelectionSettings);
};
return (localMediaSelectionSettings);
}
public function get skipUiContainer():DisplayObjectContainer{
return (remoteInstance.skipUiContainer);
}
public function get x():Number{
return (remoteInstance.x);
}
public function set y(_arg1:Number):void{
remoteInstance.y = _arg1;
}
public function set clickTrackingElement(_arg1:InteractiveObject):void{
remoteInstance.clickTrackingElement = _arg1;
}
public function set skipUiContainer(_arg1:DisplayObjectContainer):void{
remoteInstance.skipUiContainer = _arg1;
}
public function get clickTrackingElement():InteractiveObject{
return (remoteInstance.clickTrackingElement);
}
public function get isRenderedAsOverlay():Boolean{
return (remoteInstance.isRenderedAsOverlay);
}
}
}//package com.google.ads.instream.wrappers
Section 165
//VideoAdWrapper (com.google.ads.instream.wrappers.VideoAdWrapper)
package com.google.ads.instream.wrappers {
import com.google.ads.instream.api.*;
import flash.net.*;
import com.google.ads.instream.wrappers.*;
class VideoAdWrapper extends AdWrapper implements VideoAd {
function VideoAdWrapper(_arg1:Object, _arg2:Object=null){
super(_arg1, _arg2);
}
public function set netStream(_arg1:NetStream):void{
remoteInstance.netStream = _arg1;
}
public function get skippable():Boolean{
return (remoteInstance.skippable);
}
public function get currentTime():Number{
return (remoteInstance.currentTime);
}
public function get deliveryType():String{
return (remoteInstance.deliveryType);
}
public function get ISCI():String{
return (remoteInstance.ISCI);
}
public function get mediaUrl():String{
return (remoteInstance.mediaUrl);
}
public function get duration():Number{
return (remoteInstance.duration);
}
public function get title():String{
return (remoteInstance.title);
}
public function get author():String{
return (remoteInstance.author);
}
}
}//package com.google.ads.instream.wrappers
Section 166
//Wrapper (com.google.ads.instream.wrappers.Wrapper)
package com.google.ads.instream.wrappers {
import flash.events.*;
import flash.utils.*;
class Wrapper extends EventDispatcher {
private var remoteInstanceReference:Object;
private var remoteMethodResultsDictionary:Dictionary;
private var localInstanceReference:Object;
function Wrapper(_arg1:Object, _arg2:Object=null){
remoteMethodResultsDictionary = new Dictionary();
super();
remoteMethodResultsDictionary = new Dictionary();
this.remoteInstanceReference = _arg1;
this.localInstanceReference = _arg2;
}
public function get remoteInstance():Object{
return (remoteInstanceReference);
}
protected function get remoteMethodResultsStore():Dictionary{
return (remoteMethodResultsDictionary);
}
public function get localInstance():Object{
return (localInstanceReference);
}
}
}//package com.google.ads.instream.wrappers
Section 167
//Wrappers (com.google.ads.instream.wrappers.Wrappers)
package com.google.ads.instream.wrappers {
import flash.utils.*;
import flash.system.*;
import com.google.ads.instream.wrappers.*;
class Wrappers {
private static const INTERFACE_IMPLEMENTS_NUM_OF_INTERFACES:Object = {};
private static const LOCAL_TO_REMOTE_CLASSES:Object = {AdSlot:adSlotRemoteInstanceFactory, AdsRequest:defaultRemoteInstanceFactory, CompanionAdSelectionSettings:defaultRemoteInstanceFactory, MediaSelectionSettings:defaultRemoteInstanceFactory, PlayListRequest:defaultRemoteInstanceFactory, YoutubeAdsRequest:defaultRemoteInstanceFactory};
private static const WRAPPED_CLASSES:Object = {AdEvent:AdEventWrapper, AdErrorEvent:AdErrorEventWrapper, AdLoadedEvent:AdLoadedEventWrapper, AdMenuEvent:AdMenuEventWrapper, AdsLoadedEvent:AdsLoadedEventWrapper, AdSizeChangedEvent:AdSizeChangedEventWrapper, FlashAdCustomEvent:FlashAdCustomEventWrapper, MediaSelectionSettings:MediaSelectionSettingsWrapper};
private static const WRAPPED_INTERFACES:Object = {Ad:AdWrapper, AdError:AdErrorWrapper, AdsManager:AdsManagerWrapper, CustomContentAd:CustomContentAdWrapper, CompanionAd:CompanionAdWrapper, DoubleClickStudioFlashAsset:DoubleClickStudioFlashAssetWrapper, FlashAd:FlashAdWrapper, FlashAdsManager:FlashAdsManagerWrapper, UserChoiceAdsManager:UserChoiceAdsManagerWrapper, FlashAsset:FlashAssetWrapper, FlashCompanionAd:FlashCompanionAdWrapper, HtmlCompanionAd:HtmlCompanionAdWrapper, VastCustomClick:VastCustomClickWrapper, VastVideoAd:VastVideoAdWrapper, VastWrapper:VastWrapperWrapper, VideoAd:VideoAdWrapper, VideoAdsManager:VideoAdsManagerWrapper};
private static const API_NAMESPACE:String = "com.google.ads.instream.api";
private static var remoteApplicationDomainProxyValue:Object;
private static var remoteAppDomainProxyCreateInstanceArgumentsCount:int;
private static function isProxyObject(_arg1:Object):Boolean{
return (remoteApplicationDomainProxy.isProxyObject(_arg1));
}
private static function filterByNamespace(_arg1:XML, _arg2:String):Boolean{
return ((_arg1.@type.indexOf(_arg2) == 0));
}
private static function countProxyCreateInstanceArguments():int{
var remoteApplicationDomainProxyInstanceXml:XML;
if (remoteAppDomainProxyCreateInstanceArgumentsCount == 0){
remoteApplicationDomainProxyInstanceXml = describeType(remoteApplicationDomainProxy);
remoteAppDomainProxyCreateInstanceArgumentsCount = remoteApplicationDomainProxyInstanceXml..method.(@name == "createInstance").parameter.length();
};
return (remoteAppDomainProxyCreateInstanceArgumentsCount);
}
public static function remoteToLocal(_arg1:Dictionary, _arg2:Object, _arg3:Object=null):Object{
var _local4:XML;
var _local5:String;
var _local6:Object;
var _local7:Class;
var _local8:Object;
var _local9:Object;
if (_arg2 == null){
return (null);
};
if (!_arg1[_arg2]){
_local4 = (isProxyObject(_arg2)) ? remoteDescribeType(_arg2) : describeType(_arg2);
_local5 = getTypeName(_arg2);
_local6 = getWrapperType(_local4, _local5);
if (_local6 != null){
_arg1[_arg2] = new _local6(_arg2, _arg3);
} else {
_local7 = (getLocalDefinition(getQualifiedClassName(_arg2)) as Class);
if (_local7 === Array){
_local8 = new (_local7);
for each (_local9 in _arg2) {
_local8.push(remoteToLocal(_arg1, _local9, _arg3));
};
_arg1[_arg2] = _local8;
} else {
_arg1[_arg2] = _arg2;
};
};
};
return (_arg1[_arg2]);
}
private static function remoteDescribeType(_arg1:Object):XML{
return (remoteApplicationDomainProxy.describeTypeOfProxyObject(_arg1));
}
private static function getWrapperTypeByInterface(_arg1:XML):Object{
var _local4:XML;
var _local5:Object;
var _local6:uint;
var _local7:String;
var _local8:String;
var _local9:String;
var _local10:Object;
var _local11:uint;
var _local2:Array = [];
var _local3:XMLList = getApiInterfaces(_arg1);
for each (_local4 in _local3) {
_local8 = getTypeNameFromFullyQualifiedName(_local4);
if (WRAPPED_INTERFACES[_local8]){
_local2.push(_local8);
};
};
_local5 = null;
_local6 = 0;
for each (_local7 in _local2) {
_local9 = ((API_NAMESPACE + ".") + _local7);
_local10 = getLocalDefinition(_local9);
_local11 = getImplementedInterfacesCount(_local10);
if (((!(_local5)) || ((_local11 > _local6)))){
_local5 = _local10;
_local6 = _local11;
};
};
if (_local5){
return (WRAPPED_INTERFACES[getTypeName(_local5)]);
};
return (null);
}
private static function adSlotRemoteInstanceFactory(_arg1:Object, _arg2:Object):Object{
return (new _arg1(_arg2.width, _arg2.height));
}
public static function get remoteApplicationDomainProxy():Object{
return (remoteApplicationDomainProxyValue);
}
private static function defaultRemoteInstanceFactory(_arg1:Object, _arg2:Object):Object{
return (new (_arg1));
}
public static function set remoteApplicationDomainProxy(_arg1:Object):void{
remoteApplicationDomainProxyValue = _arg1;
}
private static function getRemoteInstanceFactoryForType(_arg1:String, _arg2:Object):Function{
var typeName = _arg1;
var localInstance = _arg2;
var factory:Object = (LOCAL_TO_REMOTE_CLASSES[typeName] as Function);
if (factory != null){
return (function (_arg1:Object):Object{
return (factory(_arg1, localInstance));
});
};
return (null);
}
private static function getTypeName(_arg1:Object):String{
var _local2:String = getQualifiedClassNameHelper(_arg1);
return (getTypeNameFromFullyQualifiedName(_local2));
}
public static function unwrappedRemoteToLocal(_arg1:Dictionary, _arg2:Object, _arg3:Object=null):Object{
return (remoteToLocal(_arg1, remoteApplicationDomainProxy.wrapRemoteObject(_arg2), _arg3));
}
private static function getApiInterfaces(_arg1:Object):XMLList{
var interfacesSource = _arg1;
return (interfacesSource.implementsInterface.(filterByNamespace(valueOf(), API_NAMESPACE)).@type);
}
private static function getTypeNameFromFullyQualifiedName(_arg1:String):String{
var _local2:Array = _arg1.split("::");
var _local3:String;
if (_local2.length == 2){
_local3 = _local2[1];
} else {
_local3 = _local2[0];
};
return (_local3);
}
private static function getWrapperTypeByClass(_arg1:String):Object{
return (WRAPPED_CLASSES[_arg1]);
}
private static function getQualifiedClassNameHelper(_arg1):String{
var _local2:String = getQualifiedClassName(_arg1);
if (_local2 == "com.google.ads.loader::ProxyObject"){
return (remoteApplicationDomainProxy.getQualifiedClassNameOfProxyObject(_arg1));
};
return (_local2);
}
private static function getInstanceProperties(_arg1:Object):Array{
var node:XML;
var instance = _arg1;
var typeXml:XML = describeType(instance);
var propertyNames:Array = [];
for each (node in typeXml..variable) {
propertyNames.push(node.@name);
};
for each (node in typeXml..accessor.(@access == "readwrite")) {
propertyNames.push(node.@name);
};
return (propertyNames);
}
public static function getLocalDefinition(_arg1:String):Object{
var fullyQualifiedName = _arg1;
var applicationDomain:ApplicationDomain = ApplicationDomain.currentDomain;
if (applicationDomain.hasDefinition(fullyQualifiedName)){
try {
return (applicationDomain.getDefinition(fullyQualifiedName));
} catch(error:Error) {
};
};
return (null);
}
private static function getImplementedInterfacesCount(_arg1:Object):uint{
var _local2:XML;
var _local3:XMLList;
if (!INTERFACE_IMPLEMENTS_NUM_OF_INTERFACES[_arg1]){
_local2 = describeType(_arg1);
_local3 = getApiInterfaces(_local2.factory);
INTERFACE_IMPLEMENTS_NUM_OF_INTERFACES[_arg1] = _local3.length();
};
return (INTERFACE_IMPLEMENTS_NUM_OF_INTERFACES[_arg1]);
}
public static function copy(_arg1:Object, _arg2:Object):void{
var _local3:String;
for each (_local3 in getInstanceProperties(_arg1)) {
if (_arg2.hasOwnProperty(_local3)){
_arg2[_local3] = localToRemote(_arg1[_local3]);
} else {
trace("warning: mismatch between swc code and implementation swfs.");
};
};
}
private static function getWrapperType(_arg1:XML, _arg2:String):Object{
var _local3:Object = getWrapperTypeByClass(_arg2);
if (!_local3){
_local3 = getWrapperTypeByInterface(_arg1);
};
return (_local3);
}
public static function localToRemote(_arg1:Object):Object{
var _local3:Function;
var _local4:Object;
var _local2:String = getTypeName(_arg1);
if (LOCAL_TO_REMOTE_CLASSES[_local2] != null){
_local3 = getRemoteInstanceFactoryForType(_local2, _arg1);
if (countProxyCreateInstanceArguments() == 2){
_local4 = remoteApplicationDomainProxy.createInstance(((API_NAMESPACE + ".") + _local2), _local3);
} else {
if (countProxyCreateInstanceArguments() == 1){
_local4 = remoteApplicationDomainProxy.createInstance(((API_NAMESPACE + ".") + _local2));
};
};
Wrappers.copy(_arg1, _local4);
return (_local4);
//unresolved jump
};
return (_arg1);
}
WRAPPED_CLASSES["PlayListEvent"] = PlayListEventWrapper;
WRAPPED_CLASSES["PlayListErrorEvent"] = PlayListErrorEventWrapper;
WRAPPED_CLASSES["PlayListLoadedEvent"] = PlayListLoadedEventWrapper;
WRAPPED_INTERFACES["AdRule"] = AdRuleWrapper;
WRAPPED_INTERFACES["AdRuleAdBreak"] = AdRuleAdBreakWrapper;
WRAPPED_INTERFACES["PlayList"] = PlayListWrapper;
WRAPPED_INTERFACES["PlayListContent"] = PlayListContentWrapper;
WRAPPED_INTERFACES["PlayListManager"] = PlayListManagerWrapper;
}
}//package com.google.ads.instream.wrappers
Section 168
//InStreamApi (com.google.ads.instream.InStreamApi)
package com.google.ads.instream {
import flash.display.*;
public final class InStreamApi extends Sprite {
}
}//package com.google.ads.instream
Section 169
//SafeLoader (com.google.utils.SafeLoader)
package com.google.utils {
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class SafeLoader extends Loader {
override public function loadBytes(_arg1:ByteArray, _arg2:LoaderContext=null):void{
throw (new SecurityError());
}
}
}//package com.google.utils
Section 170
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var background:DisplayObject;
protected var mouseState:String;
protected var _selected:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
protected var pressTimer:Timer;
private var _mouseStateLocked:Boolean;// = false
private var unlockedMouseState:String;
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
mouseEnabled = value;
}
public function get selected():Boolean{
return (_selected);
}
public function set selected(value:Boolean):void{
if (_selected == value){
return;
};
_selected = value;
invalidate(InvalidationType.STATE);
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(value:Boolean):void{
_autoRepeat = value;
}
public function set mouseStateLocked(value:Boolean):void{
_mouseStateLocked = value;
if (value == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function setMouseState(state:String):void{
if (_mouseStateLocked){
unlockedMouseState = state;
return;
};
if (mouseState == state){
return;
};
mouseState = state;
invalidate(InvalidationType.STATE);
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function mouseEventHandler(event:MouseEvent):void{
if (event.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((event.type == MouseEvent.ROLL_OVER)) || ((event.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (event.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(event:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function endPress():void{
pressTimer.reset();
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function drawBackground():void{
var styleName:String = (enabled) ? mouseState : "disabled";
if (selected){
styleName = (("selected" + styleName.substr(0, 1).toUpperCase()) + styleName.substr(1));
};
styleName = (styleName + "Skin");
var bg:DisplayObject = background;
background = getDisplayObjectInstance(getStyleValue(styleName));
addChildAt(background, 0);
if (((!((bg == null))) && (!((bg == background))))){
removeChild(bg);
};
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 171
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var _emphasized:Boolean;// = false
protected var emphasizedBorder:DisplayObject;
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
super();
}
public function get emphasized():Boolean{
return (_emphasized);
}
public function set emphasized(value:Boolean):void{
_emphasized = value;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
protected function drawEmphasized():void{
var padding:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
var emphasizedStyle:Object = getStyleValue("emphasizedSkin");
if (emphasizedStyle != null){
emphasizedBorder = getDisplayObjectInstance(emphasizedStyle);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
padding = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(padding));
emphasizedBorder.width = (width + (padding * 2));
emphasizedBorder.height = (height + (padding * 2));
};
}
override public function drawFocus(focused:Boolean):void{
var emphasizedPadding:Number;
var focusPadding:*;
super.drawFocus(focused);
if (focused){
emphasizedPadding = Number(getStyleValue("emphasizedPadding"));
if ((((emphasizedPadding < 0)) || (!(_emphasized)))){
emphasizedPadding = 0;
};
focusPadding = getStyleValue("focusRectPadding");
focusPadding = ((focusPadding)==null) ? 2 : focusPadding;
focusPadding = (focusPadding + emphasizedPadding);
uiFocusRect.x = -(focusPadding);
uiFocusRect.y = -(focusPadding);
uiFocusRect.width = (width + (focusPadding * 2));
uiFocusRect.height = (height + (focusPadding * 2));
};
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 172
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const BOTTOM:String = "bottom";
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 173
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
public var textField:TextField;
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var _label:String;// = "Label"
protected var mode:String;// = "center"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
super();
}
public function get label():String{
return (_label);
}
public function set label(value:String):void{
_label = value;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
public function get labelPlacement():String{
return (_labelPlacement);
}
public function set labelPlacement(value:String):void{
_labelPlacement = value;
invalidate(InvalidationType.SIZE);
}
public function get toggle():Boolean{
return (_toggle);
}
public function set toggle(value:Boolean):void{
if (((!(value)) && (super.selected))){
selected = false;
};
_toggle = value;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
protected function toggleSelected(event:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
override public function set selected(value:Boolean):void{
_selected = value;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function drawIcon():void{
var oldIcon:DisplayObject = icon;
var styleName:String = (enabled) ? mouseState : "disabled";
if (selected){
styleName = (("selected" + styleName.substr(0, 1).toUpperCase()) + styleName.substr(1));
};
styleName = (styleName + "Icon");
var iconStyle:Object = getStyleValue(styleName);
if (iconStyle == null){
iconStyle = getStyleValue("icon");
};
if (iconStyle != null){
icon = getDisplayObjectInstance(iconStyle);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((oldIcon == null))) && (!((oldIcon == icon))))){
removeChild(oldIcon);
};
}
protected function drawTextFormat():void{
var uiStyles:Object = UIComponent.getStyleDefinition();
var defaultTF:TextFormat = (enabled) ? (uiStyles.defaultTextFormat as TextFormat) : (uiStyles.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(defaultTF);
var tf:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (tf != null){
textField.setTextFormat(tf);
} else {
tf = defaultTF;
};
textField.defaultTextFormat = tf;
setEmbedFont();
}
protected function setEmbedFont(){
var embed:Object = getStyleValue("embedFonts");
if (embed != null){
textField.embedFonts = embed;
};
}
override protected function drawLayout():void{
var tmpWidth:Number;
var tmpHeight:Number;
var txtPad:Number = Number(getStyleValue("textPadding"));
var placement:String = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
var txtW:Number = (textField.textWidth + 4);
var txtH:Number = (textField.textHeight + 4);
var paddedIconW:Number = ((icon)==null) ? 0 : (icon.width + txtPad);
var paddedIconH:Number = ((icon)==null) ? 0 : (icon.height + txtPad);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((placement == ButtonLabelPlacement.BOTTOM)) || ((placement == ButtonLabelPlacement.TOP)))){
tmpWidth = Math.max(0, Math.min(txtW, (width - (2 * txtPad))));
if ((height - 2) > txtH){
tmpHeight = txtH;
} else {
tmpHeight = (height - 2);
};
txtW = tmpWidth;
textField.width = txtW;
txtH = tmpHeight;
textField.height = txtH;
textField.x = Math.round(((width - txtW) / 2));
textField.y = Math.round(((((height - textField.height) - paddedIconH) / 2) + ((placement)==ButtonLabelPlacement.BOTTOM) ? paddedIconH : 0));
if (icon != null){
icon.y = Math.round(((placement)==ButtonLabelPlacement.BOTTOM) ? (textField.y - paddedIconH) : ((textField.y + textField.height) + txtPad));
};
} else {
tmpWidth = Math.max(0, Math.min(txtW, ((width - paddedIconW) - (2 * txtPad))));
txtW = tmpWidth;
textField.width = txtW;
textField.x = Math.round(((((width - txtW) - paddedIconW) / 2) + ((placement)!=ButtonLabelPlacement.LEFT) ? paddedIconW : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((placement)!=ButtonLabelPlacement.LEFT) ? (textField.x - paddedIconW) : ((textField.x + txtW) + txtPad));
};
};
};
super.drawLayout();
}
override protected function keyDownHandler(event:KeyboardEvent):void{
if (!enabled){
return;
};
if (event.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
override protected function keyUpHandler(event:KeyboardEvent):void{
if (!enabled){
return;
};
if (event.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 174
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _pageSize:Number;// = 10
private var _pageScrollSize:Number;// = 0
private var _lineScrollSize:Number;// = 1
private var _minScrollPosition:Number;// = 0
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
private var _direction:String;// = "vertical"
private var thumbScrollOffset:Number;
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
protected var downArrow:BaseButton;
protected var thumb:LabelButton;
protected var track:BaseButton;
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
super();
setStyles();
focusEnabled = false;
}
override public function setSize(width:Number, height:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(height, width);
} else {
super.setSize(width, height);
};
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
public function setScrollProperties(pageSize:Number, minScrollPosition:Number, maxScrollPosition:Number, pageScrollSize:Number=0):void{
this.pageSize = pageSize;
_minScrollPosition = minScrollPosition;
_maxScrollPosition = maxScrollPosition;
if (pageScrollSize >= 0){
_pageScrollSize = pageScrollSize;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
public function set scrollPosition(newScrollPosition:Number):void{
setScrollPosition(newScrollPosition, true);
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(value:Number):void{
setScrollProperties(_pageSize, value, _maxScrollPosition);
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
public function set maxScrollPosition(value:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, value);
}
public function get pageSize():Number{
return (_pageSize);
}
public function set pageSize(value:Number):void{
if (value > 0){
_pageSize = value;
};
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageScrollSize(value:Number):void{
if (value >= 0){
_pageScrollSize = value;
};
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
public function set lineScrollSize(value:Number):void{
if (value > 0){
_lineScrollSize = value;
};
}
public function get direction():String{
return (_direction);
}
public function set direction(value:String):void{
if (_direction == value){
return;
};
_direction = value;
if (isLivePreview){
return;
};
setScaleY(1);
var horizontal = (_direction == ScrollBarDirection.HORIZONTAL);
if (((horizontal) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((horizontal) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(horizontal)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
override protected function draw():void{
var h:Number;
if (isInvalid(InvalidationType.SIZE)){
h = super.height;
downArrow.move(0, Math.max(upArrow.height, (h - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (h - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
protected function scrollPressHandler(event:ComponentEvent):void{
var mousePosition:Number;
var pgScroll:Number;
event.stopImmediatePropagation();
if (event.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (event.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
mousePosition = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
pgScroll = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < mousePosition){
setScrollPosition(Math.min(mousePosition, (_scrollPosition + pgScroll)));
} else {
if (_scrollPosition > mousePosition){
setScrollPosition(Math.max(mousePosition, (_scrollPosition - pgScroll)));
};
};
};
};
}
protected function thumbPressHandler(event:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function handleThumbDrag(event:MouseEvent):void{
var pos:Number = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((pos / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
protected function thumbReleaseHandler(event:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function setScrollPosition(newScrollPosition:Number, fireEvent:Boolean=true):void{
var oldPosition:Number = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, newScrollPosition));
if (oldPosition == _scrollPosition){
return;
};
if (fireEvent){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - oldPosition), scrollPosition));
};
updateThumb();
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
protected function updateThumb():void{
var per:Number = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((per == 0)) || (isNaN(per)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / per) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 175
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const VERTICAL:String = "vertical";
public static const HORIZONTAL:String = "horizontal";
}
}//package fl.controls
Section 176
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const ON:String = "on";
public static const AUTO:String = "auto";
public static const OFF:String = "off";
}
}//package fl.controls
Section 177
//TextArea (fl.controls.TextArea)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.managers.*;
import flash.system.*;
import flash.text.*;
import fl.events.*;
import flash.ui.*;
public class TextArea extends UIComponent implements IFocusManagerComponent {
public var textField:TextField;
protected var _editable:Boolean;// = true
protected var _wordWrap:Boolean;// = true
protected var _horizontalScrollPolicy:String;// = "auto"
protected var _verticalScrollPolicy:String;// = "auto"
protected var _horizontalScrollBar:UIScrollBar;
protected var _verticalScrollBar:UIScrollBar;
protected var background:DisplayObject;
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var textHasChanged:Boolean;// = false
protected static const SCROLL_BAR_STYLES:Object = {downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {upSkin:"TextArea_upSkin", disabledSkin:"TextArea_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextArea(){
super();
}
public function get horizontalScrollBar():UIScrollBar{
return (_horizontalScrollBar);
}
public function get verticalScrollBar():UIScrollBar{
return (_verticalScrollBar);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override public function set enabled(value:Boolean):void{
super.enabled = value;
mouseChildren = enabled;
invalidate(InvalidationType.STATE);
}
public function get text():String{
return (textField.text);
}
public function set text(value:String):void{
if (((componentInspectorSetting) && ((value == "")))){
return;
};
textField.text = value;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
textHasChanged = true;
}
public function get htmlText():String{
return (textField.htmlText);
}
public function set htmlText(value:String):void{
if (((componentInspectorSetting) && ((value == "")))){
return;
};
if (value == ""){
text = "";
return;
};
_html = true;
_savedHTML = value;
textField.htmlText = value;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
textHasChanged = true;
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function set condenseWhite(value:Boolean):void{
textField.condenseWhite = value;
invalidate(InvalidationType.DATA);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
public function set horizontalScrollPolicy(value:String):void{
_horizontalScrollPolicy = value;
invalidate(InvalidationType.SIZE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
public function set verticalScrollPolicy(value:String):void{
_verticalScrollPolicy = value;
invalidate(InvalidationType.SIZE);
}
public function get horizontalScrollPosition():Number{
return (textField.scrollH);
}
public function set horizontalScrollPosition(value:Number):void{
drawNow();
textField.scrollH = value;
}
public function get verticalScrollPosition():Number{
return (textField.scrollV);
}
public function set verticalScrollPosition(value:Number):void{
drawNow();
textField.scrollV = value;
}
public function get textWidth():Number{
drawNow();
return (textField.textWidth);
}
public function get textHeight():Number{
drawNow();
return (textField.textHeight);
}
public function get length():Number{
return (textField.text.length);
}
public function get restrict():String{
return (textField.restrict);
}
public function set restrict(value:String):void{
if (((componentInspectorSetting) && ((value == "")))){
value = null;
};
textField.restrict = value;
}
public function get maxChars():int{
return (textField.maxChars);
}
public function set maxChars(value:int):void{
textField.maxChars = value;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
public function get maxVerticalScrollPosition():int{
return (textField.maxScrollV);
}
public function get wordWrap():Boolean{
return (_wordWrap);
}
public function set wordWrap(value:Boolean):void{
_wordWrap = value;
invalidate(InvalidationType.STATE);
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function set displayAsPassword(value:Boolean):void{
textField.displayAsPassword = value;
}
public function get editable():Boolean{
return (_editable);
}
public function set editable(value:Boolean):void{
_editable = value;
invalidate(InvalidationType.STATE);
}
public function get imeMode():String{
return (IME.conversionMode);
}
public function set imeMode(value:String):void{
_imeMode = value;
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
public function set alwaysShowSelection(value:Boolean):void{
textField.alwaysShowSelection = value;
}
override public function drawFocus(draw:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(draw);
return;
};
super.drawFocus(draw);
}
public function getLineMetrics(lineIndex:int):TextLineMetrics{
return (textField.getLineMetrics(lineIndex));
}
public function setSelection(setSelection:int, endIndex:int):void{
textField.setSelection(setSelection, endIndex);
}
public function appendText(text:String):void{
textField.appendText(text);
invalidate(InvalidationType.DATA);
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
_verticalScrollBar = new UIScrollBar();
_verticalScrollBar.name = "V";
_verticalScrollBar.visible = false;
_verticalScrollBar.focusEnabled = false;
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
addChild(_verticalScrollBar);
_horizontalScrollBar = new UIScrollBar();
_horizontalScrollBar.name = "H";
_horizontalScrollBar.visible = false;
_horizontalScrollBar.focusEnabled = false;
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
addChild(_horizontalScrollBar);
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
_horizontalScrollBar.scrollTarget = textField;
_verticalScrollBar.scrollTarget = textField;
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (_editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
textField.wordWrap = _wordWrap;
textField.multiline = true;
}
protected function handleKeyDown(event:KeyboardEvent):void{
if (event.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
protected function handleChange(event:Event):void{
event.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
invalidate(InvalidationType.DATA);
}
protected function handleTextInput(event:TextEvent):void{
event.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, event.text));
}
protected function handleScroll(event:ScrollEvent):void{
dispatchEvent(event);
}
protected function handleWheel(event:MouseEvent):void{
if (((!(enabled)) || (!(_verticalScrollBar.visible)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (event.delta * _verticalScrollBar.lineScrollSize));
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, (event.delta * _verticalScrollBar.lineScrollSize), _verticalScrollBar.scrollPosition));
}
protected function setEmbedFont(){
var embed:Object = getStyleValue("embedFonts");
if (embed != null){
textField.embedFonts = embed;
};
}
override protected function draw():void{
if (isInvalid(InvalidationType.STATE)){
updateTextFieldType();
};
if (isInvalid(InvalidationType.STYLES)){
setStyles();
setEmbedFont();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA)){
drawLayout();
};
super.draw();
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function drawTextFormat():void{
var uiStyles:Object = UIComponent.getStyleDefinition();
var defaultTF:TextFormat = (enabled) ? (uiStyles.defaultTextFormat as TextFormat) : (uiStyles.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(defaultTF);
var tf:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (tf != null){
textField.setTextFormat(tf);
} else {
tf = defaultTF;
};
textField.defaultTextFormat = tf;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
protected function drawBackground():void{
var bg:DisplayObject = background;
var styleName:String = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(styleName));
if (background != null){
addChildAt(background, 0);
};
if (((((!((bg == null))) && (!((bg == background))))) && (contains(bg)))){
removeChild(bg);
};
}
protected function drawLayout():void{
var txtPad:Number = Number(getStyleValue("textPadding"));
textField.x = (textField.y = txtPad);
background.width = width;
background.height = height;
var availHeight:Number = height;
var vScrollBar:Boolean = needVScroll();
var availWidth:Number = (width - (vScrollBar) ? _verticalScrollBar.width : 0);
var hScrollBar:Boolean = needHScroll();
if (hScrollBar){
availHeight = (availHeight - _horizontalScrollBar.height);
};
setTextSize(availWidth, availHeight, txtPad);
if (((((hScrollBar) && (!(vScrollBar)))) && (needVScroll()))){
vScrollBar = true;
availWidth = (availWidth - _verticalScrollBar.width);
setTextSize(availWidth, availHeight, txtPad);
};
if (vScrollBar){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = (width - _verticalScrollBar.width);
_verticalScrollBar.height = availHeight;
_verticalScrollBar.visible = true;
_verticalScrollBar.enabled = enabled;
} else {
_verticalScrollBar.visible = false;
};
if (hScrollBar){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.y = (height - _horizontalScrollBar.height);
_horizontalScrollBar.width = availWidth;
_horizontalScrollBar.visible = true;
_horizontalScrollBar.enabled = enabled;
} else {
_horizontalScrollBar.visible = false;
};
updateScrollBars();
addEventListener(Event.ENTER_FRAME, delayedLayoutUpdate, false, 0, true);
}
protected function delayedLayoutUpdate(event:Event):void{
if (textHasChanged){
textHasChanged = false;
drawLayout();
return;
};
removeEventListener(Event.ENTER_FRAME, delayedLayoutUpdate);
}
protected function updateScrollBars(){
_horizontalScrollBar.update();
_verticalScrollBar.update();
_verticalScrollBar.enabled = enabled;
_horizontalScrollBar.enabled = enabled;
_horizontalScrollBar.drawNow();
_verticalScrollBar.drawNow();
}
protected function needVScroll():Boolean{
if (_verticalScrollPolicy == ScrollPolicy.OFF){
return (false);
};
if (_verticalScrollPolicy == ScrollPolicy.ON){
return (true);
};
return ((textField.maxScrollV > 1));
}
protected function needHScroll():Boolean{
if (_horizontalScrollPolicy == ScrollPolicy.OFF){
return (false);
};
if (_horizontalScrollPolicy == ScrollPolicy.ON){
return (true);
};
return ((textField.maxScrollH > 0));
}
protected function setTextSize(width:Number, height:Number, padding:Number):void{
var w:Number = (width - (padding * 2));
var h:Number = (height - (padding * 2));
if (w != textField.width){
textField.width = w;
};
if (h != textField.height){
textField.height = h;
};
}
override protected function isOurFocus(target:DisplayObject):Boolean{
return ((((target == textField)) || (super.isOurFocus(target))));
}
override protected function focusInHandler(event:FocusEvent):void{
setIMEMode(true);
if (event.target == this){
stage.focus = textField;
};
var fm:IFocusManager = focusManager;
if (fm){
if (editable){
fm.showFocusIndicator = true;
};
fm.defaultButtonEnabled = false;
};
super.focusInHandler(event);
if (editable){
setIMEMode(true);
};
}
override protected function focusOutHandler(event:FocusEvent):void{
var fm:IFocusManager = focusManager;
if (fm){
fm.defaultButtonEnabled = true;
};
setSelection(0, 0);
super.focusOutHandler(event);
if (editable){
setIMEMode(false);
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 178
//UIScrollBar (fl.controls.UIScrollBar)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class UIScrollBar extends ScrollBar {
protected var _scrollTarget:DisplayObject;
protected var inEdit:Boolean;// = false
protected var inScroll:Boolean;// = false
protected var _targetScrollProperty:String;
protected var _targetMaxScrollProperty:String;
private static var defaultStyles:Object = {};
public function UIScrollBar(){
super();
}
override public function set minScrollPosition(minScrollPosition:Number):void{
super.minScrollPosition = ((minScrollPosition)<0) ? 0 : minScrollPosition;
}
override public function set maxScrollPosition(maxScrollPosition:Number):void{
var maxScrollPos:Number = maxScrollPosition;
if (_scrollTarget != null){
maxScrollPos = Math.min(maxScrollPos, _scrollTarget[_targetMaxScrollProperty]);
};
super.maxScrollPosition = maxScrollPos;
}
public function get scrollTarget():DisplayObject{
return (_scrollTarget);
}
public function set scrollTarget(target:DisplayObject):void{
var target = target;
if (_scrollTarget != null){
_scrollTarget.removeEventListener(Event.CHANGE, handleTargetChange, false);
_scrollTarget.removeEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false);
_scrollTarget.removeEventListener(Event.SCROLL, handleTargetScroll, false);
};
_scrollTarget = target;
var blockProg:String;
var textDir:String;
if (_scrollTarget != null){
if (_scrollTarget.hasOwnProperty("blockProgression")){
blockProg = _scrollTarget["blockProgression"];
};
if (_scrollTarget.hasOwnProperty("direction")){
textDir = _scrollTarget["direction"];
};
//unresolved jump
var _slot1 = e;
blockProg = null;
textDir = null;
};
var scrollHoriz = (this.direction == ScrollBarDirection.HORIZONTAL);
var rot:Number = Math.abs(this.rotation);
if (((scrollHoriz) && ((((blockProg == "rl")) || ((textDir == "rtl")))))){
if ((((getScaleY() > 0)) && ((rotation == 90)))){
x = (x + width);
};
setScaleY(-1);
} else {
if (((((!(scrollHoriz)) && ((blockProg == "rl")))) && ((textDir == "rtl")))){
if ((((getScaleY() > 0)) && (!((rotation == 90))))){
y = (y + height);
};
setScaleY(-1);
} else {
if (getScaleY() < 0){
if (scrollHoriz){
if (rotation == 90){
x = (x - width);
};
} else {
if (rotation != 90){
y = (y - height);
};
};
};
setScaleY(1);
};
};
setTargetScrollProperties(scrollHoriz, blockProg);
if (_scrollTarget != null){
_scrollTarget.addEventListener(Event.CHANGE, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(Event.SCROLL, handleTargetScroll, false, 0, true);
};
invalidate(InvalidationType.DATA);
}
public function get scrollTargetName():String{
return (_scrollTarget.name);
}
public function set scrollTargetName(target:String):void{
var target = target;
scrollTarget = parent.getChildByName(target);
//unresolved jump
var _slot1 = error;
throw (new Error("ScrollTarget not found, or is not a valid target"));
}
override public function get direction():String{
return (super.direction);
}
override public function set direction(dir:String):void{
var cacheScrollTarget:DisplayObject;
if (isLivePreview){
return;
};
if (((!(componentInspectorSetting)) && (!((_scrollTarget == null))))){
cacheScrollTarget = _scrollTarget;
scrollTarget = null;
};
super.direction = dir;
if (cacheScrollTarget != null){
scrollTarget = cacheScrollTarget;
} else {
updateScrollTargetProperties();
};
}
public function update():void{
inEdit = true;
updateScrollTargetProperties();
inEdit = false;
}
override protected function draw():void{
if (isInvalid(InvalidationType.DATA)){
updateScrollTargetProperties();
};
super.draw();
}
protected function updateScrollTargetProperties():void{
var blockProg:String;
var pageSize:Number;
var minScroll:Number;
var minScrollVValue:*;
if (_scrollTarget == null){
setScrollProperties(pageSize, minScrollPosition, maxScrollPosition);
scrollPosition = 0;
} else {
blockProg = null;
if (_scrollTarget.hasOwnProperty("blockProgression")){
blockProg = _scrollTarget["blockProgression"];
};
//unresolved jump
var _slot1 = e1;
setTargetScrollProperties((this.direction == ScrollBarDirection.HORIZONTAL), blockProg);
if (_targetScrollProperty == "scrollH"){
minScroll = 0;
if (((_scrollTarget.hasOwnProperty("controller")) && (_scrollTarget["controller"].hasOwnProperty("compositionWidth")))){
pageSize = _scrollTarget["controller"]["compositionWidth"];
} else {
pageSize = _scrollTarget.width;
};
//unresolved jump
var _slot1 = e2;
pageSize = _scrollTarget.width;
} else {
if (blockProg != null){
minScrollVValue = _scrollTarget["minScrollV"];
if ((minScrollVValue is int)){
minScroll = minScrollVValue;
} else {
minScroll = 1;
};
} else {
minScroll = 1;
};
//unresolved jump
var _slot1 = e3;
minScroll = 1;
pageSize = 10;
};
setScrollProperties(pageSize, minScroll, scrollTarget[_targetMaxScrollProperty]);
scrollPosition = _scrollTarget[_targetScrollProperty];
};
}
override public function setScrollProperties(pageSize:Number, minScrollPosition:Number, maxScrollPosition:Number, pageScrollSize:Number=0):void{
var maxScrollPos:Number = maxScrollPosition;
var minScrollPos:Number = ((minScrollPosition)<0) ? 0 : minScrollPosition;
if (_scrollTarget != null){
maxScrollPos = Math.min(maxScrollPosition, _scrollTarget[_targetMaxScrollProperty]);
};
super.setScrollProperties(pageSize, minScrollPos, maxScrollPos, pageScrollSize);
}
override public function setScrollPosition(scrollPosition:Number, fireEvent:Boolean=true):void{
super.setScrollPosition(scrollPosition, fireEvent);
if (!_scrollTarget){
inScroll = false;
return;
};
updateTargetScroll();
}
protected function updateTargetScroll(event:ScrollEvent=null):void{
if (inEdit){
return;
};
_scrollTarget[_targetScrollProperty] = scrollPosition;
}
protected function handleTargetChange(event:Event):void{
inEdit = true;
setScrollPosition(_scrollTarget[_targetScrollProperty], true);
updateScrollTargetProperties();
inEdit = false;
}
protected function handleTargetScroll(event:Event):void{
if (inDrag){
return;
};
if (!enabled){
return;
};
inEdit = true;
updateScrollTargetProperties();
scrollPosition = _scrollTarget[_targetScrollProperty];
inEdit = false;
}
private function setTargetScrollProperties(scrollHoriz:Boolean, blockProg:String):void{
if (blockProg == "rl"){
if (scrollHoriz){
_targetScrollProperty = "scrollV";
_targetMaxScrollProperty = "maxScrollV";
} else {
_targetScrollProperty = "scrollH";
_targetMaxScrollProperty = "maxScrollH";
};
} else {
if (scrollHoriz){
_targetScrollProperty = "scrollH";
_targetMaxScrollProperty = "maxScrollH";
} else {
_targetScrollProperty = "scrollV";
_targetMaxScrollProperty = "maxScrollV";
};
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 179
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 180
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const ALL:String = "all";
public static const SIZE:String = "size";
public static const STYLES:String = "styles";
public static const RENDERER_STYLES:String = "rendererStyles";
public static const STATE:String = "state";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const SELECTED:String = "selected";
}
}//package fl.core
Section 181
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.managers.*;
import flash.system.*;
import flash.text.*;
import fl.events.*;
public class UIComponent extends Sprite {
public const version:String = "3.0.2.3";
public var focusTarget:IFocusManagerComponent;
protected var isLivePreview:Boolean;// = false
private var tempText:TextField;
protected var instanceStyles:Object;
protected var sharedStyles:Object;
protected var callLaterMethods:Dictionary;
protected var invalidateFlag:Boolean;// = false
protected var _enabled:Boolean;// = true
protected var invalidHash:Object;
protected var uiFocusRect:DisplayObject;
protected var isFocused:Boolean;// = false
private var _focusEnabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var _width:Number;
protected var _height:Number;
protected var _x:Number;
protected var _y:Number;
protected var startWidth:Number;
protected var startHeight:Number;
protected var _imeMode:String;// = null
protected var _oldIMEMode:String;// = null
protected var errorCaught:Boolean;// = false
protected var _inspector:Boolean;// = false
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
private static var focusManagers:Dictionary = new Dictionary(true);
private static var focusManagerUsers:Dictionary = new Dictionary(true);
public static var createAccessibilityImplementation:Function;
public function UIComponent(){
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
public function set componentInspectorSetting(value:Boolean):void{
_inspector = value;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
protected function beforeComponentParameters():void{
}
protected function afterComponentParameters():void{
}
public function get enabled():Boolean{
return (_enabled);
}
public function set enabled(value:Boolean):void{
if (value == _enabled){
return;
};
_enabled = value;
invalidate(InvalidationType.STATE);
}
public function setSize(width:Number, height:Number):void{
_width = width;
_height = height;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function get width():Number{
return (_width);
}
override public function set width(value:Number):void{
if (_width == value){
return;
};
setSize(value, height);
}
override public function get height():Number{
return (_height);
}
override public function set height(value:Number):void{
if (_height == value){
return;
};
setSize(width, value);
}
public function setStyle(style:String, value:Object):void{
if ((((instanceStyles[style] === value)) && (!((value is TextFormat))))){
return;
};
instanceStyles[style] = value;
invalidate(InvalidationType.STYLES);
}
public function clearStyle(style:String):void{
setStyle(style, null);
}
public function getStyle(style:String):Object{
return (instanceStyles[style]);
}
public function move(x:Number, y:Number):void{
_x = x;
_y = y;
super.x = Math.round(x);
super.y = Math.round(y);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function set x(value:Number):void{
move(value, _y);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
override public function set y(value:Number):void{
move(_x, value);
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function set scaleX(value:Number):void{
setSize((startWidth * value), height);
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set scaleY(value:Number):void{
setSize(width, (startHeight * value));
}
protected function getScaleY():Number{
return (super.scaleY);
}
protected function setScaleY(value:Number):void{
super.scaleY = value;
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function setScaleX(value:Number):void{
super.scaleX = value;
}
override public function get visible():Boolean{
return (super.visible);
}
override public function set visible(value:Boolean):void{
if (super.visible == value){
return;
};
super.visible = value;
var t:String = (value) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(t, true));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function invalidate(property:String="all", callLater:Boolean=true):void{
invalidHash[property] = true;
if (callLater){
this.callLater(draw);
};
}
public function setSharedStyle(name:String, style:Object):void{
if ((((sharedStyles[name] === style)) && (!((style is TextFormat))))){
return;
};
sharedStyles[name] = style;
if (instanceStyles[name] == null){
invalidate(InvalidationType.STYLES);
};
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
public function set focusEnabled(b:Boolean):void{
_focusEnabled = b;
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
public function set mouseFocusEnabled(b:Boolean):void{
_mouseFocusEnabled = b;
}
public function get focusManager():IFocusManager{
var o:DisplayObject = this;
while (o) {
if (UIComponent.focusManagers[o] != null){
return (IFocusManager(UIComponent.focusManagers[o]));
};
o = o.parent;
};
return (null);
}
public function set focusManager(f:IFocusManager):void{
UIComponent.focusManagers[this] = f;
}
public function drawFocus(focused:Boolean):void{
var focusPadding:Number;
isFocused = focused;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (focused){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
focusPadding = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(focusPadding);
uiFocusRect.y = -(focusPadding);
uiFocusRect.width = (width + (focusPadding * 2));
uiFocusRect.height = (height + (focusPadding * 2));
addChildAt(uiFocusRect, 0);
};
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function setIMEMode(enabled:Boolean){
var enabled = enabled;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
//unresolved jump
var _slot1 = e;
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function drawNow():void{
draw();
}
protected function configUI():void{
isLivePreview = checkLivePreview();
var r:Number = rotation;
rotation = 0;
var w:Number = super.width;
var h:Number = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(w, h);
move(super.x, super.y);
rotation = r;
startWidth = w;
startHeight = h;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
className = getQualifiedClassName(parent);
//unresolved jump
var _slot1 = e;
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function isInvalid(property:String, ... _args):Boolean{
if (((invalidHash[property]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
protected function validate():void{
invalidHash = {};
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function getDisplayObjectInstance(skin:Object):DisplayObject{
var skin = skin;
var classDef:Object;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
classDef = getDefinitionByName(skin.toString());
//unresolved jump
var _slot1 = e;
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
//unresolved jump
var _slot1 = e;
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function getStyleValue(name:String):Object{
return (((instanceStyles[name])==null) ? sharedStyles[name] : instanceStyles[name]);
}
protected function copyStylesToChild(child:UIComponent, styleMap:Object):void{
var n:String;
for (n in styleMap) {
child.setStyle(n, getStyleValue(styleMap[n]));
};
}
protected function callLater(fn:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[fn] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
private function callLaterDispatcher(event:Event):void{
var method:Object;
if (event.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
event.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
var methods:Dictionary = callLaterMethods;
for (method in methods) {
method();
delete methods[method];
};
inCallLaterPhase = false;
}
private function initializeFocusManager():void{
var fm:IFocusManager;
var fmUserDict:Dictionary;
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
fm = focusManager;
if (fm != null){
fmUserDict = focusManagerUsers[fm];
if (fmUserDict == null){
fmUserDict = new Dictionary(true);
focusManagerUsers[fm] = fmUserDict;
};
fmUserDict[this] = true;
};
};
addEventListener(Event.REMOVED_FROM_STAGE, removedHandler);
}
private function addedHandler(evt:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, addedHandler);
initializeFocusManager();
}
private function removedHandler(evt:Event):void{
var fmUserDict:Dictionary;
var dictEmpty:Boolean;
var key:*;
var key2:*;
var compFM:IFocusManager;
removeEventListener(Event.REMOVED_FROM_STAGE, removedHandler);
addEventListener(Event.ADDED_TO_STAGE, addedHandler);
var fm:IFocusManager = focusManager;
if (fm != null){
fmUserDict = focusManagerUsers[fm];
if (fmUserDict != null){
delete fmUserDict[this];
dictEmpty = true;
for (key in fmUserDict) {
dictEmpty = false;
break;
};
if (dictEmpty){
delete focusManagerUsers[fm];
fmUserDict = null;
};
};
if (fmUserDict == null){
fm.deactivate();
for (key2 in focusManagers) {
compFM = focusManagers[key2];
if (fm == compFM){
delete focusManagers[key2];
};
};
};
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
protected function isOurFocus(target:DisplayObject):Boolean{
return ((target == this));
}
protected function focusInHandler(event:FocusEvent):void{
var fm:IFocusManager;
if (isOurFocus((event.target as DisplayObject))){
fm = focusManager;
if (((fm) && (fm.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
protected function focusOutHandler(event:FocusEvent):void{
if (isOurFocus((event.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
protected function keyDownHandler(event:KeyboardEvent):void{
}
protected function keyUpHandler(event:KeyboardEvent):void{
}
protected function hookAccessibility(event:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var styleList:Object;
var n:String;
var styles:Object = {};
var l:uint = _args.length;
var i:uint;
while (i < l) {
styleList = _args[i];
for (n in styleList) {
if (styles[n] != null){
} else {
styles[n] = _args[i][n];
};
};
i++;
};
return (styles);
}
}
}//package fl.core
Section 182
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const BUTTON_DOWN:String = "buttonDown";
public static const LABEL_CHANGE:String = "labelChange";
public static const HIDE:String = "hide";
public static const SHOW:String = "show";
public static const RESIZE:String = "resize";
public static const MOVE:String = "move";
public static const ENTER:String = "enter";
public function ComponentEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 183
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _direction:String;
private var _delta:Number;
private var _position:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(direction:String, delta:Number, position:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = direction;
_delta = delta;
_position = position;
}
public function get direction():String{
return (_direction);
}
public function get delta():Number{
return (_delta);
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
}
}//package fl.events
Section 184
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import flash.display.*;
import fl.controls.*;
import fl.core.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var _form:DisplayObjectContainer;
private var focusableObjects:Dictionary;
private var focusableCandidates:Array;
private var activated:Boolean;// = false
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var _showFocusIndicator:Boolean;// = true
private var lastAction:String;
private var defButton:Button;
private var _defaultButton:Button;
private var _defaultButtonEnabled:Boolean;// = true
public function FocusManager(container:DisplayObjectContainer){
super();
focusableObjects = new Dictionary(true);
if (container != null){
_form = container;
activate();
};
}
private function addedHandler(event:Event):void{
var target:DisplayObject = DisplayObject(event.target);
if (target.stage){
addFocusables(DisplayObject(event.target));
};
}
private function removedHandler(event:Event):void{
var i:int;
var io:InteractiveObject;
var o:DisplayObject = DisplayObject(event.target);
if ((((o is IFocusManagerComponent)) && ((focusableObjects[o] == true)))){
if (o == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
o.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler, false);
delete focusableObjects[o];
calculateCandidates = true;
} else {
if ((((o is InteractiveObject)) && ((focusableObjects[o] == true)))){
io = (o as InteractiveObject);
if (io){
if (io == lastFocus){
lastFocus = null;
};
delete focusableObjects[io];
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler, false, 0, true);
};
};
removeFocusables(o);
}
private function addFocusables(o:DisplayObject, skipTopLevel:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = o;
var skipTopLevel = skipTopLevel;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler, false, 0, true);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler, false, 0, true);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler, false, 0, true);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler, false, 0, true);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler, false, 0, true);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
for (;i < doc.numChildren;(i = (i + 1))) {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
continue;
var _slot1 = error;
};
};
};
}
private function removeFocusables(o:DisplayObject):void{
var p:Object;
var dob:DisplayObject;
if ((o is DisplayObjectContainer)){
o.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler, false);
o.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler, false);
for (p in focusableObjects) {
dob = DisplayObject(p);
if (DisplayObjectContainer(o).contains(dob)){
if (dob == lastFocus){
lastFocus = null;
};
dob.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler, false);
delete focusableObjects[p];
calculateCandidates = true;
};
};
};
}
private function isTabVisible(o:DisplayObject):Boolean{
var p:DisplayObjectContainer = o.parent;
while (((((p) && (!((p is Stage))))) && (!(((p.parent) && ((p.parent is Stage))))))) {
if (!p.tabChildren){
return (false);
};
p = p.parent;
};
return (true);
}
private function isValidFocusCandidate(o:DisplayObject, groupName:String):Boolean{
var tg:IFocusManagerGroup;
if (!isEnabledAndVisible(o)){
return (false);
};
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
if (groupName == tg.groupName){
return (false);
};
};
return (true);
}
private function isEnabledAndVisible(o:DisplayObject):Boolean{
var tf:TextField;
var sb:SimpleButton;
var formParent:DisplayObjectContainer = DisplayObject(form).parent;
while (o != formParent) {
if ((o is UIComponent)){
if (!UIComponent(o).enabled){
return (false);
};
} else {
if ((o is TextField)){
tf = TextField(o);
if ((((tf.type == TextFieldType.DYNAMIC)) || (!(tf.selectable)))){
return (false);
};
} else {
if ((o is SimpleButton)){
sb = SimpleButton(o);
if (!sb.enabled){
return (false);
};
};
};
};
if (!o.visible){
return (false);
};
o = o.parent;
};
return (true);
}
private function tabEnabledChangeHandler(event:Event):void{
calculateCandidates = true;
var o:InteractiveObject = InteractiveObject(event.target);
var registeredFocusableObject = (focusableObjects[o] == true);
if (o.tabEnabled){
if (((!(registeredFocusableObject)) && (isTabVisible(o)))){
if (!(o is IFocusManagerComponent)){
o.focusRect = false;
};
focusableObjects[o] = true;
};
} else {
if (registeredFocusableObject){
delete focusableObjects[o];
};
};
}
private function tabIndexChangeHandler(event:Event):void{
calculateCandidates = true;
}
private function tabChildrenChangeHandler(event:Event):void{
if (event.target != event.currentTarget){
return;
};
calculateCandidates = true;
var o:DisplayObjectContainer = DisplayObjectContainer(event.target);
if (o.tabChildren){
addFocusables(o, true);
} else {
removeFocusables(o);
};
}
public function activate():void{
if (activated){
return;
};
addFocusables(form);
form.addEventListener(Event.ADDED, addedHandler, false, 0, true);
form.addEventListener(Event.REMOVED, removedHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true, 0, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true, 0, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true, 0, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
if (!activated){
return;
};
focusableObjects = new Dictionary(true);
focusableCandidates = null;
lastFocus = null;
defButton = null;
form.removeEventListener(Event.ADDED, addedHandler, false);
form.removeEventListener(Event.REMOVED, removedHandler, false);
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler, false);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler, false);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler, false);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
private function focusInHandler(event:FocusEvent):void{
var x:Button;
if (!activated){
return;
};
var target:InteractiveObject = InteractiveObject(event.target);
if (form.contains(target)){
lastFocus = findFocusManagerComponent(InteractiveObject(target));
if ((lastFocus is Button)){
x = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = x;
x.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function focusOutHandler(event:FocusEvent):void{
if (!activated){
return;
};
var target:InteractiveObject = (event.target as InteractiveObject);
}
private function activateHandler(event:Event):void{
if (!activated){
return;
};
var target:InteractiveObject = InteractiveObject(event.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
private function deactivateHandler(event:Event):void{
if (!activated){
return;
};
var target:InteractiveObject = InteractiveObject(event.target);
}
private function mouseFocusChangeHandler(event:FocusEvent):void{
if (!activated){
return;
};
if ((event.relatedObject is TextField)){
return;
};
event.preventDefault();
}
private function keyFocusChangeHandler(event:FocusEvent):void{
if (!activated){
return;
};
showFocusIndicator = true;
if ((((((event.keyCode == Keyboard.TAB)) || ((event.keyCode == 0)))) && (!(event.isDefaultPrevented())))){
setFocusToNextObject(event);
event.preventDefault();
};
}
private function keyDownHandler(event:KeyboardEvent):void{
if (!activated){
return;
};
if (event.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((event.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function mouseDownHandler(event:MouseEvent):void{
if (!activated){
return;
};
if (event.isDefaultPrevented()){
return;
};
var o:InteractiveObject = getTopLevelFocusTarget(InteractiveObject(event.target));
if (!o){
return;
};
showFocusIndicator = false;
if (((((!((o == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((o is TextField))))){
setFocus(o);
};
lastAction = "MOUSEDOWN";
}
public function get defaultButton():Button{
return (_defaultButton);
}
public function set defaultButton(value:Button):void{
var button:Button = (value) ? Button(value) : null;
if (button != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = button;
defButton = button;
if (button){
button.emphasized = true;
};
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
private function setFocusToNextObject(event:FocusEvent):void{
if (!hasFocusableObjects()){
return;
};
var o:InteractiveObject = getNextFocusManagerComponent(event.shiftKey);
if (o){
setFocus(o);
};
}
private function hasFocusableObjects():Boolean{
var o:Object;
for (o in focusableObjects) {
return (true);
};
return (false);
}
public function getNextFocusManagerComponent(backward:Boolean=false):InteractiveObject{
var tg:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var o:DisplayObject = form.stage.focus;
o = DisplayObject(findFocusManagerComponent(InteractiveObject(o)));
var g:String = "";
if ((o is IFocusManagerGroup)){
tg = IFocusManagerGroup(o);
g = tg.groupName;
};
var i:int = getIndexOfFocusedObject(o);
var bSearchAll:Boolean;
var start:int = i;
if (i == -1){
if (backward){
i = focusableCandidates.length;
};
bSearchAll = true;
};
var j:int = getIndexOfNextObject(i, backward, bSearchAll, g);
return (findFocusManagerComponent(focusableCandidates[j]));
}
private function getIndexOfFocusedObject(o:DisplayObject):int{
var n:int = focusableCandidates.length;
var i:int;
i = 0;
while (i < n) {
if (focusableCandidates[i] == o){
return (i);
};
i++;
};
return (-1);
}
private function getIndexOfNextObject(i:int, shiftKey:Boolean, bSearchAll:Boolean, groupName:String):int{
var o:DisplayObject;
var tg1:IFocusManagerGroup;
var j:int;
var obj:DisplayObject;
var tg2:IFocusManagerGroup;
var n:int = focusableCandidates.length;
var start:int = i;
while (true) {
if (shiftKey){
i--;
} else {
i++;
};
if (bSearchAll){
if (((shiftKey) && ((i < 0)))){
break;
};
if (((!(shiftKey)) && ((i == n)))){
break;
};
} else {
i = ((i + n) % n);
if (start == i){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[i], groupName)){
o = DisplayObject(findFocusManagerComponent(focusableCandidates[i]));
if ((o is IFocusManagerGroup)){
tg1 = IFocusManagerGroup(o);
j = 0;
while (j < focusableCandidates.length) {
obj = focusableCandidates[j];
if ((obj is IFocusManagerGroup)){
tg2 = IFocusManagerGroup(obj);
if ((((tg2.groupName == tg1.groupName)) && (tg2.selected))){
i = j;
break;
};
};
j++;
};
};
return (i);
};
};
return (i);
}
private function sortFocusableObjects():void{
var o:Object;
var c:InteractiveObject;
focusableCandidates = [];
for (o in focusableObjects) {
c = InteractiveObject(o);
if (((((c.tabIndex) && (!(isNaN(Number(c.tabIndex)))))) && ((c.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(c);
};
focusableCandidates.sort(sortByDepth);
}
private function sortFocusableObjectsTabIndex():void{
var o:Object;
var c:InteractiveObject;
focusableCandidates = [];
for (o in focusableObjects) {
c = InteractiveObject(o);
if (((c.tabIndex) && (!(isNaN(Number(c.tabIndex)))))){
focusableCandidates.push(c);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function sortByDepth(aa:InteractiveObject, bb:InteractiveObject):Number{
var index:int;
var tmp:String;
var tmp2:String;
var val1:String = "";
var val2:String = "";
var zeros:String = "0000";
var a:DisplayObject = DisplayObject(aa);
var b:DisplayObject = DisplayObject(bb);
while (((!((a == DisplayObject(form)))) && (a.parent))) {
index = getChildIndex(a.parent, a);
tmp = index.toString(16);
if (tmp.length < 4){
tmp2 = (zeros.substring(0, (4 - tmp.length)) + tmp);
};
val1 = (tmp2 + val1);
a = a.parent;
};
while (((!((b == DisplayObject(form)))) && (b.parent))) {
index = getChildIndex(b.parent, b);
tmp = index.toString(16);
if (tmp.length < 4){
tmp2 = (zeros.substring(0, (4 - tmp.length)) + tmp);
};
val2 = (tmp2 + val2);
b = b.parent;
};
return (((val1 > val2)) ? 1 : ((val1 < val2)) ? -1 : 0);
}
private function getChildIndex(parent:DisplayObjectContainer, child:DisplayObject):int{
return (parent.getChildIndex(child));
}
private function sortByTabIndex(a:InteractiveObject, b:InteractiveObject):int{
return (((a.tabIndex > b.tabIndex)) ? 1 : ((a.tabIndex < b.tabIndex)) ? -1 : sortByDepth(a, b));
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
public function set defaultButtonEnabled(value:Boolean):void{
_defaultButtonEnabled = value;
}
public function get nextTabIndex():int{
return (0);
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
public function set showFocusIndicator(value:Boolean):void{
_showFocusIndicator = value;
}
public function get form():DisplayObjectContainer{
return (_form);
}
public function set form(value:DisplayObjectContainer):void{
_form = value;
}
public function getFocus():InteractiveObject{
var o:InteractiveObject = form.stage.focus;
return (findFocusManagerComponent(o));
}
public function setFocus(component:InteractiveObject):void{
if ((component is IFocusManagerComponent)){
IFocusManagerComponent(component).setFocus();
} else {
form.stage.focus = component;
};
}
public function showFocus():void{
}
public function hideFocus():void{
}
public function findFocusManagerComponent(component:InteractiveObject):InteractiveObject{
var p:InteractiveObject = component;
while (component) {
if ((((component is IFocusManagerComponent)) && (IFocusManagerComponent(component).focusEnabled))){
return (component);
};
component = component.parent;
};
return (p);
}
private function getTopLevelFocusTarget(o:InteractiveObject):InteractiveObject{
while (o != InteractiveObject(form)) {
if ((((((((o is IFocusManagerComponent)) && (IFocusManagerComponent(o).focusEnabled))) && (IFocusManagerComponent(o).mouseFocusEnabled))) && (UIComponent(o).enabled))){
return (o);
};
o = o.parent;
if (o == null){
break;
};
};
return (null);
}
}
}//package fl.managers
Section 185
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import flash.display.*;
import fl.controls.*;
public interface IFocusManager {
function get defaultButton():Button;
function set defaultButton(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManager.as:Button):void;
function get defaultButtonEnabled():Boolean;
function set defaultButtonEnabled(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManager.as:Boolean):void;
function get nextTabIndex():int;
function get showFocusIndicator():Boolean;
function set showFocusIndicator(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManager.as:Boolean):void;
function getFocus():InteractiveObject;
function setFocus(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManager.as:InteractiveObject):void;
function showFocus():void;
function hideFocus():void;
function activate():void;
function deactivate():void;
function findFocusManagerComponent(Button:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(Button:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 186
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function get focusEnabled():Boolean;
function set focusEnabled(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManagerComponent.as:Boolean):void;
function get mouseFocusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function setFocus():void;
function drawFocus(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManagerComponent.as:Boolean):void;
}
}//package fl.managers
Section 187
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function get groupName():String;
function set groupName(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManagerGroup.as:String):void;
function get selected():Boolean;
function set selected(C:\Program Files (x86)\Adobe\Adobe Flash CS5\Common\Configuration\Component Source\ActionScript 3.0\User Interface;fl\managers;IFocusManagerGroup.as:Boolean):void;
}
}//package fl.managers
Section 188
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var styleToClassesHash:Object;
private var classToInstancesDict:Dictionary;
private var classToStylesDict:Dictionary;
private var classToDefaultStylesDict:Dictionary;
private var globalStyles:Object;
private static var _instance:StyleManager;
public function StyleManager(){
super();
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
public static function registerInstance(instance:UIComponent):void{
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = instance;
var inst:StyleManager = getInstance();
var classDef:Class = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
continue;
var _slot1 = err;
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
//unresolved jump
var _slot1 = e;
defaultStyles = UIComponent.getStyleDefinition();
break;
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
if (inst.classToStylesDict[classDef] == null){
inst.classToStylesDict[classDef] = {};
};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
private static function setSharedStyles(instance:UIComponent):void{
var n:String;
var inst:StyleManager = getInstance();
var classDef:Class = getClassDef(instance);
var styles:Object = inst.classToDefaultStylesDict[classDef];
for (n in styles) {
instance.setSharedStyle(n, getSharedStyle(instance, n));
};
}
private static function getSharedStyle(instance:UIComponent, name:String):Object{
var classDef:Class = getClassDef(instance);
var inst:StyleManager = getInstance();
var style:Object = inst.classToStylesDict[classDef][name];
if (style != null){
return (style);
};
style = inst.globalStyles[name];
if (style != null){
return (style);
};
return (inst.classToDefaultStylesDict[classDef][name]);
}
public static function getComponentStyle(component:Object, name:String):Object{
var classDef:Class = getClassDef(component);
var styleHash:Object = getInstance().classToStylesDict[classDef];
return (((styleHash)==null) ? null : styleHash[name]);
}
public static function clearComponentStyle(component:Object, name:String):void{
var classDef:Class = getClassDef(component);
var styleHash:Object = getInstance().classToStylesDict[classDef];
if (((!((styleHash == null))) && (!((styleHash[name] == null))))){
delete styleHash[name];
invalidateComponentStyle(classDef, name);
};
}
public static function setComponentStyle(component:Object, name:String, style:Object):void{
var classDef:Class = getClassDef(component);
var styleHash:Object = getInstance().classToStylesDict[classDef];
if (styleHash == null){
styleHash = (getInstance().classToStylesDict[classDef] = {});
};
if (styleHash == style){
return;
};
styleHash[name] = style;
invalidateComponentStyle(classDef, name);
}
private static function getClassDef(component:Object):Class{
var component = component;
if ((component is Class)){
return ((component as Class));
};
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
//unresolved jump
var _slot1 = e;
if ((component is UIComponent)){
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
//unresolved jump
var _slot1 = e;
};
return (null);
}
private static function invalidateStyle(name:String):void{
var classRef:Object;
var classes:Dictionary = getInstance().styleToClassesHash[name];
if (classes == null){
return;
};
for (classRef in classes) {
invalidateComponentStyle(Class(classRef), name);
};
}
private static function invalidateComponentStyle(componentClass:Class, name:String):void{
var obj:Object;
var instance:UIComponent;
var instances:Dictionary = getInstance().classToInstancesDict[componentClass];
if (instances == null){
return;
};
for (obj in instances) {
instance = (obj as UIComponent);
if (instance == null){
} else {
instance.setSharedStyle(name, getSharedStyle(instance, name));
};
};
}
public static function setStyle(name:String, style:Object):void{
var styles:Object = getInstance().globalStyles;
if ((((styles[name] === style)) && (!((style is TextFormat))))){
return;
};
styles[name] = style;
invalidateStyle(name);
}
public static function clearStyle(name:String):void{
setStyle(name, null);
}
public static function getStyle(name:String):Object{
return (getInstance().globalStyles[name]);
}
}
}//package fl.managers
Section 189
//AdSlotSettings (AdSlotSettings)
package {
public class AdSlotSettings {
private static var _midroll3AdTag:String = null;
private static var _prerollAdTag:String = null;
private static var _midroll4AdTag:String = null;
private static var _midroll5AdTag:String = null;
private static var _midroll1AdTag:String = null;
private static var _prerollChannels:String = null;
private static var _midroll1Channels:String = null;
private static var _midroll2Channels:String = null;
private static var _midroll3Channels:String = null;
private static var _midroll4Channels:String = null;
private static var _midroll5Channels:String = null;
private static var _postrollAdTag:String = null;
private static var _midroll2AdTag:String = null;
private static var _postrollChannels:String = null;
public static function get midroll5Channels():String{
return (_midroll5Channels);
}
public static function get midroll1Channels():String{
return (_midroll1Channels);
}
public static function set midroll4Channels(_arg1:String):void{
_midroll4Channels = _arg1;
}
public static function set midroll5Channels(_arg1:String):void{
_midroll5Channels = _arg1;
}
public static function get midroll3AdTag():String{
return (_midroll3AdTag);
}
public static function get postrollChannels():String{
return (_postrollChannels);
}
public static function set midroll5AdTag(_arg1:String):void{
_midroll5AdTag = _arg1;
}
public static function set midroll3AdTag(_arg1:String):void{
_midroll3AdTag = _arg1;
}
public static function set midroll1AdTag(_arg1:String):void{
_midroll1AdTag = _arg1;
}
public static function get prerollChannels():String{
return (_prerollChannels);
}
public static function set postrollChannels(_arg1:String):void{
_postrollChannels = _arg1;
}
public static function set prerollChannels(_arg1:String):void{
_prerollChannels = _arg1;
}
public static function get midroll4AdTag():String{
return (_midroll4AdTag);
}
public static function set postrollAdTag(_arg1:String):void{
_postrollAdTag = _arg1;
}
public static function get prerollAdTag():String{
return (_prerollAdTag);
}
public static function get midroll5AdTag():String{
return (_midroll5AdTag);
}
public static function get midroll1AdTag():String{
return (_midroll1AdTag);
}
public static function set midroll4AdTag(_arg1:String):void{
_midroll4AdTag = _arg1;
}
public static function set midroll2AdTag(_arg1:String):void{
_midroll2AdTag = _arg1;
}
public static function get postrollAdTag():String{
return (_postrollAdTag);
}
public static function get midroll2AdTag():String{
return (_midroll2AdTag);
}
public static function set prerollAdTag(_arg1:String):void{
_prerollAdTag = _arg1;
}
public static function set midroll1Channels(_arg1:String):void{
_midroll1Channels = _arg1;
}
public static function set midroll2Channels(_arg1:String):void{
_midroll2Channels = _arg1;
}
public static function set midroll3Channels(_arg1:String):void{
_midroll3Channels = _arg1;
}
public static function get midroll2Channels():String{
return (_midroll2Channels);
}
public static function get midroll3Channels():String{
return (_midroll3Channels);
}
public static function get midroll4Channels():String{
return (_midroll4Channels);
}
}
}//package
Section 190
//Button_disabledSkin (Button_disabledSkin)
package {
import flash.display.*;
public dynamic class Button_disabledSkin extends MovieClip {
}
}//package
Section 191
//Button_downSkin (Button_downSkin)
package {
import flash.display.*;
public dynamic class Button_downSkin extends MovieClip {
}
}//package
Section 192
//Button_emphasizedSkin (Button_emphasizedSkin)
package {
import flash.display.*;
public dynamic class Button_emphasizedSkin extends MovieClip {
}
}//package
Section 193
//Button_overSkin (Button_overSkin)
package {
import flash.display.*;
public dynamic class Button_overSkin extends MovieClip {
}
}//package
Section 194
//Button_selectedDisabledSkin (Button_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDisabledSkin extends MovieClip {
}
}//package
Section 195
//Button_selectedDownSkin (Button_selectedDownSkin)
package {
import flash.display.*;
public dynamic class Button_selectedDownSkin extends MovieClip {
}
}//package
Section 196
//Button_selectedOverSkin (Button_selectedOverSkin)
package {
import flash.display.*;
public dynamic class Button_selectedOverSkin extends MovieClip {
}
}//package
Section 197
//Button_selectedUpSkin (Button_selectedUpSkin)
package {
import flash.display.*;
public dynamic class Button_selectedUpSkin extends MovieClip {
}
}//package
Section 198
//Button_upSkin (Button_upSkin)
package {
import flash.display.*;
public dynamic class Button_upSkin extends MovieClip {
}
}//package
Section 199
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 200
//maze (maze)
package {
import flash.display.*;
import com.google.ads.instream.api.*;
import flash.events.*;
import flash.net.*;
import flash.ui.*;
public class maze extends MovieClip {
public var Wall13:SimpleButton;
public var Wall22:SimpleButton;
public var Wall23:SimpleButton;
public var Wall24:SimpleButton;
public var Wall15:SimpleButton;
public var Wall1:SimpleButton;
public var Level1:SimpleButton;
public var bar_mc:MovieClip;
public var Wall16:SimpleButton;
public var Wall25:SimpleButton;
public var Level2:SimpleButton;
public var Wall2:SimpleButton;
public var Wall17:SimpleButton;
public var Wall26:SimpleButton;
public var Level3:SimpleButton;
public var Wall3:SimpleButton;
public var Wall18:SimpleButton;
public var Wall4:SimpleButton;
public var btnReplay:SimpleButton;
public var Wall19:SimpleButton;
public var Wall5:SimpleButton;
public var Wall6:SimpleButton;
public var btnTextPlay:SimpleButton;
public var Wall7:SimpleButton;
public var btnEnd:SimpleButton;
public var Wall8:SimpleButton;
public var Wall9:SimpleButton;
public var Dot:MovieClip;
public var btnWebsite:SimpleButton;
public var btnPlayMaze:SimpleButton;
public var Wall:SimpleButton;
public var Wall10:SimpleButton;
public var btnEmail:SimpleButton;
public var btn_Website:SimpleButton;
public var Wall11:SimpleButton;
public var Wall20:SimpleButton;
public var btnPlay:SimpleButton;
public var btnTwitter:SimpleButton;
public var btnFacebook:SimpleButton;
public var Wall21:SimpleButton;
public var Wall12:SimpleButton;
public var btnCopyRightLink:SimpleButton;
var themaze:MovieClip;
var adsManager:AdsManager;
var adsLoader:AdsLoader;
var currentNetStream:NetStream;
var contentNetStream:NetStream;
var flashVars:Object;
var useGUT:Boolean;
var counter:uint;// = 0
public function maze(){
adsLoader = new AdsLoader();
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 163, frame164);
if (stage != null){
initialize();
} else {
addEventListener(Event.ADDED_TO_STAGE, initialize);
};
}
public function loading(e:Event):void{
var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;
bar_mc.scaleX = (loaded / total);
if (total == loaded){
this.play();
removeEventListener(Event.ENTER_FRAME, loading);
};
}
public function fl_MouseClickHandler(event:MouseEvent):void{
this.play();
}
public function fl_ClickToGoToWebPage(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.winterrowd.com"), "_blank");
}
public function fl_ClickToGoToAndPlayFromFrame(event:MouseEvent):void{
this.play();
}
public function fl_CustomMouseCursor(event:Event){
Dot.x = this.stage.mouseX;
Dot.y = this.stage.mouseY;
}
public function Level1_MouseOverHandler(event:MouseEvent):void{
this.play();
}
public function Level1Wall_MouseOverHandler(event:MouseEvent):void{
Dot.removeEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
this.stage.removeChild(Dot);
this.gotoAndPlay(3);
}
public function Level2_MouseOverHandler(event:MouseEvent):void{
this.play();
}
public function Level2Wall_MouseOverHandler(event:MouseEvent):void{
Dot.removeEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
this.stage.removeChild(Dot);
this.gotoAndPlay(3);
}
public function Level3_MouseOverHandler(event:MouseEvent):void{
this.play();
}
public function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void{
this.gotoAndPlay(7);
}
public function Level3Wall_MouseOverHandler(event:MouseEvent):void{
Dot.removeEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
this.stage.removeChild(Dot);
this.gotoAndPlay(3);
}
public function fl_ClickToGoToWebPage_3(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.winterrowd.com"), "_blank");
}
public function fl_ClickToGoToWebPage_7(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.winterrowd.com"), "_blank");
}
public function fl_ClickToGoToWebPage_2(event:MouseEvent):void{
navigateToURL(new URLRequest("mailto:winterrowd@gmail.com?subject=The Maze"));
}
public function fl_ClickToGoToWebPage_4(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.winterrowd.com/maze"), "_top");
}
public function fl_ClickToGoToWebPage_5(event:MouseEvent):void{
navigateToURL(new URLRequest("http://www.facebook.com/sharer.php?u=http://www.winterrowd.com/maze&t=The+Maze"), "_blank");
}
public function fl_ClickToGoToWebPage_6(event:MouseEvent):void{
navigateToURL(new URLRequest("http://twitter.com/home?status=Currently+playing+The+Maze!+http://www.winterrowd.com/maze+The+best+games+via+@Winterrowd"), "_blank");
}
private function initialize(event:Event=null):void{
removeEventListener(Event.ADDED_TO_STAGE, initialize);
onLoadAdFunc();
}
private function onLoadAdButtonClick(event:Event):void{
cleanup();
loadAd();
}
private function onLoadAdFunc():void{
cleanup();
loadAd();
}
private function loadAd():void{
adsLoader = new AdsLoader();
stage.addChild(adsLoader);
adsLoader.addEventListener(AdsLoadedEvent.ADS_LOADED, onAdsLoaded);
adsLoader.addEventListener(AdErrorEvent.AD_ERROR, onAdError);
adsLoader.addEventListener(Event.ENTER_FRAME, loading);
adsLoader.requestAds(createAdsRequest());
log("Ad requested");
}
private function cleanup():void{
onUnloadAdButtonClick();
log("cleanup");
}
private function onUnloadAdButtonClick(event:Event=null):void{
unloadAd();
log("unLoadAdButtonClick");
}
private function unloadAd():void{
if (adsManager){
removeListeners();
removeAdsManagerListeners();
adsManager.unload();
adsManager = null;
stage.removeChild(adsLoader);
log("Ad unloaded");
};
//unresolved jump
var _slot1 = e;
log(("Error occured during unload : " + _slot1.message));
}
private function removeAdsManagerListeners():void{
adsManager.removeEventListener(AdErrorEvent.AD_ERROR, onAdError);
adsManager.removeEventListener(AdEvent.CLICK, onAdClicked);
}
private function onAdClicked(event:AdEvent):void{
logEvent(event.type);
}
private function onContentPauseRequested(event:AdEvent):void{
logEvent(event.type);
if (contentNetStream){
contentNetStream.pause();
};
}
private function createAdsRequest():AdsRequest{
var adsRequest:AdsRequest = new AdsRequest();
adsRequest.adSlotWidth = 550;
adsRequest.adSlotHeight = 400;
adsRequest.publisherId = "ca-games-pub-3611966219536430";
adsRequest.adType = AdsRequestType.GRAPHICAL_OVERLAY;
adsRequest.channels = ["games", "pranks", "scary", "maze"];
adsRequest.descriptionUrl = "http://www.winterrowd.com/maze/";
adsRequest.contentId = "1";
adsRequest.disableCompanionAds = false;
adsRequest.maxTotalAdDuration = 10;
flashVars = loaderInfo.parameters;
useGUT = (((!((flashVars == null))) && ((flashVars.useGUT == false)))) ? false : true;
if (!useGUT){
adsRequest.disableCompanionAds = true;
};
return (adsRequest);
}
private function onAdsLoaded(adsLoadedEvent:AdsLoadedEvent):void{
var adsManager:AdsManager = adsLoadedEvent.adsManager;
adsManager.addEventListener(AdErrorEvent.AD_ERROR, onAdError);
adsManager.addEventListener(AdEvent.COMPLETE, onVideoAdComplete);
var flashAdsManager:FlashAdsManager = (adsManager as FlashAdsManager);
flashAdsManager.x = 0;
flashAdsManager.y = 10;
flashAdsManager.load();
flashAdsManager.play();
}
private function onAdError(adErrorEvent:AdErrorEvent):void{
log(("Ad Error: " + adErrorEvent.error));
}
private function onVideoAdComplete(event:AdEvent):void{
logEvent(event.type);
removeListeners();
if (adsManager.type == AdsManagerTypes.VIDEO){
(adsManager as VideoAdsManager).clickTrackingElement = null;
};
}
private function metaDataHandler(infoObject:Object):void{
log("content metadata");
}
private function log(message:Object, overwrite:Boolean=false):void{
}
private function onAdLoaded(event:AdLoadedEvent):void{
logEvent(event.type);
if (event.netStream){
};
}
private function logEvent(eventType:String):void{
log((eventType + " event raised"));
}
private function removeListeners():void{
adsManager.removeEventListener(AdLoadedEvent.LOADED, onAdLoaded);
adsManager.removeEventListener(AdEvent.STARTED, onAdStarted);
var flashAdsManager:FlashAdsManager = (adsManager as FlashAdsManager);
flashAdsManager.removeEventListener(AdSizeChangedEvent.SIZE_CHANGED, onFlashAdSizeChanged);
flashAdsManager.removeEventListener(FlashAdCustomEvent.CUSTOM_EVENT, onFlashAdCustomEvent);
}
private function onAdStarted(event:AdEvent):void{
logEvent(event.type);
}
private function onFlashAdSizeChanged(event:AdSizeChangedEvent):void{
logEvent(event.type);
}
private function onFlashAdCustomEvent(event:FlashAdCustomEvent):void{
logEvent(event.type);
}
private function onVideoAdStopped(event:AdEvent):void{
logEvent(event.type);
}
private function onVideoAdPaused(event:AdEvent):void{
logEvent(event.type);
}
private function onVideoAdMidpoint(event:AdEvent):void{
logEvent(event.type);
}
private function onVideoAdFirstQuartile(event:AdEvent):void{
logEvent(event.type);
}
private function onVideoAdThirdQuartile(event:AdEvent):void{
logEvent(event.type);
}
private function onVideoAdClicked(event:AdEvent):void{
logEvent(event.type);
}
private function onVideoAdRestarted(event:AdEvent):void{
logEvent(event.type);
}
private function onVideoAdVolumeMuted(event:AdEvent):void{
logEvent(event.type);
}
function frame1(){
this.addEventListener(Event.ENTER_FRAME, loading);
this.stop();
}
function frame2(){
btnTextPlay.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
btnPlay.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
btnCopyRightLink.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
this.stop();
}
function frame3(){
this.stop();
Mouse.show();
btnPlayMaze.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);
}
function frame4(){
this.stage.showDefaultContextMenu = false;
this.stage.addChild(Dot);
Dot.mouseEnabled = false;
Dot.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
Mouse.hide();
Level1.addEventListener(MouseEvent.MOUSE_OVER, Level1_MouseOverHandler);
Wall.addEventListener(MouseEvent.MOUSE_OVER, Level1Wall_MouseOverHandler);
Wall1.addEventListener(MouseEvent.MOUSE_OVER, Level1Wall_MouseOverHandler);
Wall2.addEventListener(MouseEvent.MOUSE_OVER, Level1Wall_MouseOverHandler);
Wall3.addEventListener(MouseEvent.MOUSE_OVER, Level1Wall_MouseOverHandler);
this.stop();
}
function frame5(){
Level2.addEventListener(MouseEvent.MOUSE_OVER, Level2_MouseOverHandler);
Wall.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall1.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall2.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall4.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall5.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall6.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall7.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall8.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
Wall9.addEventListener(MouseEvent.MOUSE_OVER, Level2Wall_MouseOverHandler);
this.stop();
}
function frame6(){
Level3.addEventListener(MouseEvent.MOUSE_OVER, Level3_MouseOverHandler);
btnEnd.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToGoToAndPlayFromFrame_2);
Wall10.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall11.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall12.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall13.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall15.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall16.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall17.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall18.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall19.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall20.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall21.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall22.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall23.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall24.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall25.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
Wall26.addEventListener(MouseEvent.MOUSE_OVER, Level3Wall_MouseOverHandler);
this.stop();
}
function frame7(){
Dot.removeEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor);
this.stage.removeChild(Dot);
Mouse.hide();
}
function frame164(){
btnWebsite.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_3);
btn_Website.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_7);
btnEmail.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_2);
btnReplay.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_4);
btnFacebook.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_5);
btnTwitter.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_6);
Mouse.show();
this.stop();
}
}
}//package
Section 201
//NetStream (NetStream)
package {
import com.doubleclick.adslot.*;
import com.doubleclick.adslot.logging.*;
import flash.media.*;
import flash.events.*;
import flash.net.*;
import com.doubleclick.adslot.netstream.*;
public class NetStream extends NetStream implements InterceptedNetStream {
private var enterFrameExecuted:Boolean;// = false
private var commandsQueue:Array;
public function NetStream(_arg1:NetConnection){
commandsQueue = [];
enterFrameExecuted = false;
super(_arg1);
AdSlot.getInstance().addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function togglePause():void{
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
getVideoPlaybackManager().togglePause();
} else {
nativeTogglePause.apply(this, null);
};
} else {
commandsQueue.push({functionDef:this.togglePause, args:null});
};
}
public function nativeTime():Number{
return (super.time);
}
public function nativeBufferLength():Number{
return (super.bufferLength);
}
private function getVideoPlaybackManager():NetStreamVideoPlaybackManager{
return ((AdSlot.getInstance().getVideoPlaybackManager() as NetStreamVideoPlaybackManager));
}
private function processCommands():void{
var _local1:int;
var _local2:Function;
var _local3:Array;
_local1 = 0;
while (_local1 < commandsQueue.length) {
_local2 = commandsQueue[_local1].functionDef;
_local3 = commandsQueue[_local1].args;
_local2.apply(this, _local3);
_local1++;
};
}
public function nativePause():void{
super.pause();
}
public function nativeClose():void{
super.close();
}
public function nativeResume():void{
super.resume();
}
override public function get bufferTime():Number{
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
return (getVideoPlaybackManager().getNetStreamBufferTime());
};
return (nativeBufferTime());
} else {
commandsQueue.push({functionDef:this.bufferTime, args:null});
};
return (0);
}
public function nativeSeek(_arg1:Number):void{
super.seek(_arg1);
}
private function onEnterFrame(_arg1:Event):void{
debug("onEnterFrame");
AdSlot.getInstance().removeEventListener(Event.ENTER_FRAME, onEnterFrame);
enterFrameExecuted = true;
processCommands();
}
override public function play(... _args):void{
debug("play");
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
getVideoPlaybackManager().activateNetStream(this);
getVideoPlaybackManager().play.apply(getVideoPlaybackManager(), _args);
} else {
nativePlay.apply(this, _args);
};
} else {
commandsQueue.push({functionDef:this.play, args:_args});
};
}
override public function resume():void{
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
getVideoPlaybackManager().resume();
} else {
nativeResume.apply(this, null);
};
} else {
commandsQueue.push({functionDef:this.resume, args:null});
};
}
override public function set soundTransform(_arg1:SoundTransform):void{
var self:Object;
var closure:Function;
var value = _arg1;
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
getVideoPlaybackManager().setSoundTransform(value);
};
nativeSetSoundTransform(value);
} else {
self = this;
closure = function ():void{
self.soundTransform = value;
};
commandsQueue.push({functionDef:closure, args:null});
};
}
override public function get bufferLength():Number{
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
return (getVideoPlaybackManager().getNetStreamBufferLength());
};
return (nativeBufferLength());
} else {
commandsQueue.push({functionDef:this.bufferLength, args:null});
};
return (0);
}
override public function get time():Number{
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
return (getVideoPlaybackManager().getNetStreamTime());
};
return (nativeTime());
} else {
commandsQueue.push({functionDef:this.time, args:null});
};
return (0);
}
public function nativeSetSoundTransform(_arg1:SoundTransform):void{
super.soundTransform = _arg1;
}
private function debug(_arg1:String):void{
Logger.debug(_arg1, this);
}
public function nativeBufferTime():Number{
return (super.bufferTime);
}
public function nativePlay(... _args):void{
super.play.apply(this, _args);
}
override public function pause():void{
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
getVideoPlaybackManager().pause();
} else {
nativePause.apply(this, null);
};
} else {
commandsQueue.push({functionDef:this.pause, args:null});
};
}
override public function close():void{
if (enterFrameExecuted){
if (getVideoPlaybackManager()){
getVideoPlaybackManager().close();
} else {
nativeClose.apply(this, null);
};
} else {
commandsQueue.push({functionDef:this.close, args:null});
};
}
public function nativeTogglePause():void{
super.togglePause();
}
override public function seek(_arg1:Number):void{
debug("seek");
if (enterFrameExecuted){
debug("enterFrameExecuted");
if (getVideoPlaybackManager()){
getVideoPlaybackManager().seek(_arg1);
} else {
debug("nativeSeek");
nativeSeek.apply(this, _arg1);
};
} else {
debug("pushing seek on command queue");
commandsQueue.push({functionDef:this.seek, args:_arg1});
};
}
}
}//package
Section 202
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 203
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 204
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 205
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 206
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 207
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 208
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 209
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 210
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 211
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 212
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 213
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 214
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 215
//TextArea_disabledSkin (TextArea_disabledSkin)
package {
import flash.display.*;
public dynamic class TextArea_disabledSkin extends MovieClip {
}
}//package
Section 216
//TextArea_upSkin (TextArea_upSkin)
package {
import flash.display.*;
public dynamic class TextArea_upSkin extends MovieClip {
}
}//package