DoubleClick Studio AS3 API Reference

class com.google.ads.studio.expanding.Expanding

Extends com.google.ads.studio:EnabledComponent

The Expanding component helps you design an expanding creative. It provides an API to expand and collapse the creative. Additionally, you can set it to run actions (control playhead and invoke functions) when an expand or collapse occurs. It may also load panels, each of which loads in an external SWF and can run its own actions. The component provides standard expanding metrics to DoubleClick Studio.

For more information, see Expanding creatives overview.

For convenience, you can always access the Expanding component through the instance name or through StudioClassAccessor. This will also minimize file size by preventing the Expanding code from being compiled into the child asset.
   import com.google.ads.studio.events.StudioEvent;
   import com.google.ads.studio.utils.StudioClassAccessor;
    
   var expandHandler:Function = function(event:StudioEvent):void {
     trace(event.panel + " Expanded!");
   };
   var collapseHandler:Function = function(event:StudioEvent):void {
     trace("Collapsed!");
   };
    
   var expanding:Object = StudioClassAccessor.
       getClass(StudioClassAccessor.CLASS_EXPANDING)["getInstance"]();
    
   expanding.addEventListener(StudioEvent.EXPAND, expandHandler);
   expanding.addEventListener(StudioEvent.COLLAPSE_COMPLETE, collapseHandler);
    
   expanding.expand();
   expanding.collapse();
   

Expand Events

Constructors

Expanding() : void

Creates an Expanding component.

Static Methods

Expanding.getInstance() : Expanding

Returns the instance of the Expanding component.

Instance Methods

Defined in: com.google.ads.studio:EnabledComponent

getEnabler() : Object
isInitialized() : Boolean

Returns whether the component has initialized.

Defined in com.google.ads.studio.expanding:Expanding

collapse() : void

Collapses the creative and the currently open panel, if one exists.

     var collapseClickHandler:Function = function(event:MouseEvent):void {
       expanding.collapse();
     };
     collapseButton.addEventListener(MouseEvent.CLICK, collapseClickHandler);
     

endAnimatedCollapse() : void

Invoke this function at the end of a collapse animation to denote that the creative is ready to be masked.

     expanding.endAnimatedCollapse();
     

Expand
expand(panelName:String=null) : void

Expands the creative with an optional child panel name to expand. Collapses any other child panels that may be expanded. We disable the button in order to allow any buttons sitting below to be clickable.

     var expandClickHandler:Function = function(event:MouseEvent):void {
       expanding.expand();
     };
     expandButton.addEventListener(MouseEvent.CLICK, expandClickHandler);
     

getExpandedDirection() : String

Returns the direction to expand.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       trace("Expanding direction is " +
           expanding.getExpandedDirection() + ".");
       // Results will be one of tr, tl, br, bl
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setBottomChild(panelName:String) : void

Sets the panel to expand in bottom direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setBottomChild("Child Bottom");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setBottomLeftChild(panelName:String) : void

Sets the panel to expand in bottom-left direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setBottomLeftChild("Child Bottom Left");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setBottomRightChild(panelName:String) : void

Sets the panel to expand in bottom-right direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setBottomRightChild("Child Bottom Right");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setCollapseOnMouseOut(collapseOnMouseOut:Boolean) : void

Sets whether or not to collapse when the user rolls out of the stage.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setCollapseOnMouseOut(true);
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setExpandOnClick(expandOnClick:Boolean) : void

Sets whether or not to expand on click.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setExpandOnClick(true);
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setExpandOnMouseOver(expandOnMouseOver:Boolean) : void

Sets whether or not to expand on mouse-over.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setExpandOnMouseOver(true);
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setLeftChild(panelName:String) : void

Sets the panel to expand in left direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setLeftChild("Child Left");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setReportLinearChange(reportLinearChange:Boolean) : void
Expand
setRightChild(panelName:String) : void

Sets the panel to expand in right direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setRightChild("Child Right");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setTopChild(panelName:String) : void

Sets the panel to expand in top direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setTopChild("Child Top");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setTopLeftChild(panelName:String) : void

Sets the panel to expand in top-left direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setTopLeftChild("Child Top Left");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
setTopRightChild(panelName:String) : void

Sets the panel to expand in top-right direction.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.setTopRightChild("Child Top Right");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Expand
startExpanded(panelName:String=null) : void

Starts the creative in an expanded state without tracking an expand event.

     var expandingInitHandler:Function = function(event:StudioEvent):void {
       expanding.startExpanded("Expanded Panel Name");
     };
     expanding.addEventListener(StudioEvent.INIT, expandingInitHandler);
     

Back to top

  1. com.google.ads.studio
    1. AssetLoader
    2. ContextualDiscovery
    3. F2fEnabler
    4. FullScreenButton
    5. HtmlEnabler
    6. ProxyEnabler
    7. VpaidEnabler
  1. com.google.ads.studio.configurable
    1. Configurable
  1. com.google.ads.studio.display
    1. StudioLoader
  1. com.google.ads.studio.events
    1. StudioEvent
    2. StudioVideoEvent
  1. com.google.ads.studio.expanding
    1. Expanding
  1. com.google.ads.studio.localconnect
    1. LocalConnectWrapper
  1. com.google.ads.studio.video
    1. ConfigurableVideoPlayer
    2. EnhancedVideoController
    3. PlayPauseButton
    4. Playlist
    5. Scrubber
    6. SoundToggleButton
    7. VideoController
    8. VideoEntry
    9. VideoPlayer
    10. VideoPlayerAdvanced
  1. com.google.ads.studio.vpaid
    1. VpaidTimer