-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEB.as
executable file
·510 lines (458 loc) · 11.8 KB
/
EB.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
//****************************************************************************
// EB class
//---------------------------
//
//ALL RIGHTS RESERVED TO MEDIAMIND INC. (C)
//****************************************************************************
package
{
import flash.display.DisplayObjectContainer;
import flash.display.DisplayObject;
import flash.events.*;
import eyeblaster.core.Tracer;
import flash.utils.getDefinitionByName;
/**
* This class combines APIs from several classes into a single API. This class doesn't have any internal logic implementation other than calling other classe APIs.
*
* <p>The following classes contain the APIs which are used by the <code>EB</code> class:</p>:
* <ul>
* <li>EBBase</li>
* <li>EBContentMgr</li>
* <li>EBPanel</li>
* <li>EBVideoMgr</li>
* </ul>
*
* @author Mehari
* @see EBBase
* @see EBContentMgr
* @see EBPanel
* @see EBVideoMgr
*/
public class EB
{
/**
* References to EBVideoMgr Class.
* Reference is acquired at runtime.
*/
private static var VideoMgr:Class;
/**
* @copy EBBase#urlParams
* @see EBBase#urlParams
*/
public static function get urlParams():Object
{
return EBBase.urlParams;
}
/**
* @copy EBBase#flashId
* @see EBBase#flashId
*/
public static function get flashId():String
{
return EBBase.flashId;
}
/**
* @copy EBBase#clickTag
* @see clickTAG
* @see EBBase#clickTag
*/
public static function get clickTag():String
{
return EBBase.clickTag;
}
/**
* @copy EBBase#clickTAG
* @see clickTag
* @see EBBase#clickTAG
*/
public static function get clickTAG():String
{
return EBBase.clickTAG;
}
/**
* @copy EBBase#clickTARGET
* @see EBBase#clickTARGET
*/
public static function get clickTARGET():String
{
return EBBase.clickTARGET;
}
/**
* @copy EBPanel#CustomVars
* @see EBPanel#CustomVars
*/
public static function get CustomVars():Object
{
return EBBase.CustomVars;
}
/**
* Creates EB object.
* <p>All <code>EB</code> class methods and attributes are static. Class shouldn't be instantiated.</p>
* @param objRef reference to creative
*/
public function EB(objRef:DisplayObjectContainer):void
{
Tracer.debugTrace("EB constructor", 3);
Init(objRef);
}
/**
* Performs initialization routine.
* @param objRef reference to an object that uses EB services.
*/
public static function Init(objRef:DisplayObjectContainer, stateHandler:Boolean = false):void
{
Tracer.debugTrace("EB.Init new", 3);
// attempt to acquire reference to EBVideoMgr
try
{
VideoMgr = getDefinitionByName("EBVideoMgr") as Class;
}
catch (err:Error)
{
}
EBBase.Init(objRef, stateHandler);
}
/**
* @copy EBPanel#OpenJumpURL()
* @see EBPanel#OpenJumpURL()
*/
public static function OpenJumpURL(url:String, window:String = null):Boolean
{
return EBBase.OpenJumpURL(url, window);
}
/**
* @copy EBPanel#CallJSFunction()
* @see EBPanel#CallJSFunction()
*/
public static function CallJSFunction(functionName:String, ... args:Array):Object
{
return EBBase.CallJSFunction(functionName, args);
}
/**
* @copy EBBase#GetVars()
* @see EBBase#GetVars()
*/
public static function GetVars(strVar:String):Number
{
return EBBase.GetVars(strVar);
}
/**
* @copy EBBase#Clickthrough()
* @see EBBase#Clickthrough()
*/
public static function Clickthrough(name:String = ""):void
{
EBBase.Clickthrough(name);
}
/**
* @copy EBBase#UserActionCounter()
* @see EBBase#UserActionCounter()
*/
public static function UserActionCounter(name:String):void
{
EBBase.UserActionCounter(name);
}
/**
* @copy EBBase#AutomaticEventCounter()
* @see EBBase#AutomaticEventCounter()
*/
public static function AutomaticEventCounter(name:String):void
{
EBBase.AutomaticEventCounter(name);
}
/**
* @copy EBBase#StartTimer()
* @see EBBase#StartTimer()
*/
public static function StartTimer(name:String):void
{
EBBase.StartTimer(name);
}
/**
* @copy EBBase#StopTimer()
* @see EBBase#StopTimer()
*/
public static function StopTimer(name:String):void
{
EBBase.StopTimer(name);
}
/**
* @copy EBBase#CloseAd()
* @see EBBase#CloseAd()
*/
public static function CloseAd(type:String = "User", kill:Boolean = false):void
{
EBBase.CloseAd(type, kill);
}
/**
* @copy EBBase#ReplayAd()
* @see EBBase#ReplayAd()
*/
public static function ReplayAd(type:String = "User"):void
{
EBBase.ReplayAd(type)
}
/**
* @copy EBBase#HideIntro()
* @see EBBase#HideIntro()
*/
public static function HideIntro():void
{
EBBase.HideIntro();
}
/**
* @copy EBPanel#CollapsePanel()
* @see EBPanel#CollapsePanel()
*/
public static function CollapsePanel(panelName:String, type:String = "User", kill:Boolean = false):void
{
EBPanel.CollapsePanel(panelName, type, kill);
}
/**
* @copy EBPanel#ExpandPanel()
* @see EBPanel#ExpandPanel()
*/
public static function ExpandPanel(panelName:String, type:String = "User"):void
{
EBPanel.ExpandPanel(panelName, type);
}
/**
* @copy EBBase#IntroFullPlay()
* @see EBBase#IntroFullPlay()
*/
public static function IntroFullPlay():void
{
EBBase.IntroFullPlay();
}
/**
* @copy EBBase#KeepAdOpen()
* @see EBBase#KeepAdOpen()
*/
public static function KeepAdOpen():void
{
EBBase.KeepAdOpen();
}
/**
* @copy EBBase#GoToMiniSite()
* @see EBBase#GoToMiniSite()
*/
public static function GoToMiniSite():void
{
EBBase.GoToMiniSite();
}
/**
* @copy EBBase#LoadRichBanner()
* @see EBBase#LoadRichBanner()
*/
public static function LoadRichBanner():void
{
EBBase.LoadRichBanner();
}
/**
* @copy EBBase#ShowRichBanner()
* @see EBBase#ShowRichBanner()
*/
public static function ShowRichBanner():void
{
EBBase.ShowRichBanner();
}
/**
* @copy EBBase#GetVar()
* @see EBBase#GetVar()
*/
public static function GetVar(varName:String):*
{
return EBBase.GetVar(varName);
}
/**
* @copy EBBase#GetAllVars()
* @see EBBase#GetAllVars()
*/
public static function GetAllVars():Object
{
return EBBase.GetAllVars();
}
/**
* @copy EBBase#SetVar()
* @see EBBase#SetVar()
*/
public static function SetVar(name:String, val:*):void
{
EBBase.SetVar(name, val);
}
/**
* @copy EBBase#addEventListener()
* @see EBBase#addEventListener()
*/
public static function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
{
EBBase.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public static function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void {
EBBase.removeEventListener(type, listener, useCapture);
}
/**
* @copy EBBase#CallHandler()
* @see EBBase#CallHandler()
*/
public static function CallHandler(handlerName:String, ...args):void
{
var functionArgs:Array = args;
functionArgs.unshift(handlerName);
EBBase.CallHandler.apply(null, functionArgs);
}
/**
* @copy EBBase#AddHandler()
* @see EBBase#AddHandler()
*/
public static function AddHandler(handlerName:String, callback:Function):void
{
EBBase.AddHandler(handlerName, callback);
}
/**
* @copy EBVideoMgr#RegisterVideo()
* @see EBVideoMgr#RegisterVideo()
*/
public static function RegisterVideo(compRef:*):void
{
if (VideoMgr)
Class(VideoMgr).RegisterVideo(compRef);
}
/**
* @copy EBVideoMgr#StopAll()
* @see EBVideoMgr#StopAll()
*/
public static function StopAll():void
{
if (VideoMgr)
Class(VideoMgr).StopAll();
}
/**
* @copy EBVideoMgr#SetAdVolume()
* @see EBVideoMgr#SetAdVolume()
*/
public static function SetAdVolume(volume:Number):void
{
if (VideoMgr)
Class(VideoMgr).SetAdVolume(volume);
}
/**
* @copy EBVideoMgr#ToggleAdAudio()
* @see EBVideoMgr#ToggleAdAudio()
*/
public static function ToggleAdAudio(value:Number = 2, isAuto:Number = 0):void
{
if (VideoMgr)
Class(VideoMgr).ToggleAdAudio(value, isAuto);
}
// TODO: what are possible datatypes for asset attribute? If possible typeas are swf and bitmaps - it should be DisplayObject.
// TODO: looks like targetClip will be an object extending Sprite.
/**
* @copy EBContentMgr#LoadContent()
* @see EBContentMgr#LoadContent()
*/
public static function LoadContent(targetClip:DisplayObjectContainer, asset:*, callback:Function = null):void
{
EBContentMgr.LoadContent(targetClip, asset, callback);
}
/**
* @copy EBContentMgr#UnloadContent()
* @see EBContentMgr#UnloadContent()
*/
public static function UnloadContent(targetClip:DisplayObjectContainer):void
{
EBContentMgr.UnloadContent(targetClip);
}
/**
* @copy EBContentMgr#Download()
* @see EBContentMgr#Download()
*/
public static function Download(asset:*):void
{
EBContentMgr.Download(asset);
}
/**
* @copy EBContentMgr#NUM_ADDITIONAL_ASSETS
* @see #EBContentMgr.NUM_ADDITIONAL_ASSETS
*/
public static function get NUM_ADDITIONAL_ASSETS():int
{
return EBContentMgr.NUM_ADDITIONAL_ASSETS;
}
/**
* @copy EBContentMgr#GetAdditionalAsset()
* @see EBContentMgr#GetAdditionalAsset()
*/
public static function GetAdditionalAsset(index:int):String
{
return EBContentMgr.GetAssetURL(String(index));
}
/**
* @copy EBContentMgr#GetAssetURL()
* @see EBContentMgr#GetAssetURL()
*/
public static function GetAssetURL(asset:String):String
{
return EBContentMgr.GetAssetURL(asset);
}
/**
* @copy EBContentMgr#GetAssetOrdinal()
* @see EBContentMgr#GetAssetOrdinal()
*/
public static function GetAssetOrdinal(assetURL:String):int
{
return EBContentMgr.GetAssetOrdinal(assetURL);
}
/**
* @copy EBBase#dispatchEvent()
* @see EBBase#dispatchEvent()
*/
public static function dispatchEvent(e:Event):void
{
EBBase.dispatchEvent(e);
}
/**
* @copy EBPanel#modifyPanel()
* @see EBPanel#modifyPanel()
*/
public static function ModifyPanel(panelId:Number, x:Number, y:Number, w:Number, h:Number):void
{
EBPanel.ModifyPanel(String(panelId), x, y, w, h);
}
/**
* @copy EBPanel#modifyPanelRelToOrig()
* @see EBPanel#modifyPanelRelToOrig()
*/
public static function ModifyPanelRelToOrig(panelId:Number, x:Number, y:Number, w:Number, h:Number):void
{
EBPanel.ModifyPanelRelToOrig(String(panelId), x, y, w, h);
}
/**
* @copy EBPanel#animatePanel()
* @see EBPanel#animatePanel()
*/
public static function AnimatePanel(panelId:Number, x:Number, y:Number, w:Number, h:Number, duration:Number, append:Boolean = false):void
{
EBPanel.AnimatePanel(String(panelId), x, y, w, h, duration, append);
}
/**
* @copy EBPanel#sendPing()
* @see EBPanel#sendPing()
*/
public static function SendPing(ping:String):void
{
EBBase.SendPing(ping);
}
/**
* @copy EBBase#handleCommand()
* @see EBBase#handleCommand()
*/
public static function handleCommand(cmd:String,args:String):Object
{
return EBBase.handleCommand(cmd,args);
}
public static function ebSetComponentName(name:String):void
{
}
}
}