1 三 APIs 2 3 1.HtmlEnabler: 4 com.google.ads.studio.HtmlEnabler;Extends com.google.ads.studio:AbstractEnabler; 5 import com.google.ads.studio.HtmlEnabler; 6 com.google.ads.studio.events.StudioEvent; 7 var enabler:HtmlEnabler = HtmlEnabler.getInstance(); 8 enabler.init(this); 9 var pageLoadedHandler:Function = function(event:StudioEvent):void { trace(event.type);};enabler.addEventListener(StudioEvent.PAGE_LOADED, pageLoadedHandler); 10 方法: 11 init(this); 12 expand(); 13 collapse(); 14 exit("exitTargetURL",url:String=null);//用 HtmlEnabler.getInstance().exit("");才有用 15 reportManualClose();//关闭的时候必需的 16 counter(eventId:String, isCumulative:Boolean=false) : void//用于计数,第二个参数表示是否累加 17 stopAllVideos() ;//链接出去时候使用 18 19 2 Expanding 20 com.google.ads.studio.expanding.Expanding ;Extends com.google.ads.studio:EnabledComponent; 21 有两种方法取得Expanding 一是通过组件 二是 StudioClassAccesso类 22 只能有一个Expanding组件 23 import com.google.ads.studio.events.StudioEvent; 24 import com.google.ads.studio.utils.StudioClassAccessor; 25 var expanding:Object = StudioClassAccessor. getClass(StudioClassAccessor.CLASS_EXPANDING)["getInstance"](); 26 27 expanding.addEventListener(StudioEvent.EXPAND, expandHandler); 28 expanding.addEventListener(StudioEvent.COLLAPSE_COMPLETE, collapseHandler); 29 var expandHandler:Function = function(event:StudioEvent):void { trace(event.panel + " Expanded!");}; 30 var collapseHandler:Function = function(event:StudioEvent):void { trace("Collapsed!");}; 31 方法 expand.expand(panelName:String=null);//面板里child SWF的名字 根据panelName来分辨加载哪个swf 32 expand.collapse(); 33 34 3 VideoPlayer 35 VideoPlayer->VideoController->NetStream 36 不管collapse还是expand都必须要有enabler,才能正常工作,但collapse中不要初始化ProxyEnabler.init(this);否则报错。 37 4 AdvancedVideoPlayer 38 VideoPlayerAdvanced->PlayList->EnhancedVideoController->NetStream