In-page build guide

Add the Enabler

What is the DoubleClick Enabler?

This article applies to Flash creatives. To learn how to add the Enabler to HTML5 creatives, see Add the HTML5 Enabler.

The Enabler is the core code library of DoubleClick Studio. Think of it as the brain of the creative. All Rich Media components and API calls must go through the Enabler.

Enabler symbol of 2 intersecting dark green and light green circles with a right-pointing arrow to the right of the symbol

Tracking

Functionality

Complexity

Why do I have to add the DoubleClick Enabler?

The Enabler component is required for all Rich Media creatives. By adding the Enabler component, you automatically ensure that your creative:

  • includes standard tracking functionality for metrics like display time, number of impressions, interactive time, and other standard metrics
  • can handle more complex features like video and expand functionality

For creatives served in an HTML page, the Enabler is referenced in ActionScript as HtmlEnabler, the name of the Enabler class. The Enabler icon is a graphical representation of the HTMLEnabler class in a creative.

How do I set up the Enabler?

The HtmlEnabler class enables creatives to be served in an HTML environment in AS2 and AS3.

  • In AS2, you include the Enabler in a file by adding an instance of the Enabler component to the stage of the parent file. You don't need to add it to the child file.
  • In AS3, you add the Enabler to your files using ActionScript, and you must also have an instance of the Enabler component in your Flash library.
Add the Enabler in AS2

Add the Enabler to the parent file of your creative and not to the child files. If you add it to the child files, then, when you upload assets in the Studio Web UI, you'll get this error: "The number of primary Flash assets in the creative cannot exceed 1."

To add the Enabler, choose one of these options:

  • Option 1: Go to the Flash menu Commands > DoubleClick Studio v2 > and select Insert v2 Studio Enabler. This automatically adds the Enabler component to your library.
     
  • Option 2: Drag the Enabler icon  onto the first frame of the root timeline of the parent file, just off the stage.

After you've added the Enabler to your creative, you can always access the HtmlEnabler class in the ActionScript through the global reference Enabler.

Add the Enabler in AS3

In AS3, you must include the Enabler in your files using ActionScript and add an instance of the Enabler component in your Flash library. You include the Enabler in your files by adding the HtmlEnabler to the parent file and the ProxyEnabler to all child files.

The ProxyEnabler is required in all child assets that make Enabler API calls. This class proxies all APIs to the concrete parent Enabler. Unlike the parent Enabler, the child Enabler doesn't require initialization and helps save file size in your creative. You simply import it before making an Enabler API call. When used, the ProxyEnabler appears to dispatch the same events as the parent Enabler.

To add the Enabler, choose one of these options:

  • Option 1: To insert the Enabler in each FLA file in your creative, go to the Flash menu Commands > DoubleClick Studio v2 and select Insert v2 Studio Enabler.
    1. For a parent file, select OK when asked if it's the parent movie.
    2. For a child file, select Cancel.
    This automatically imports the HtmlEnabler class into the parent creative and the ProxyEnabler into the child creatives. It also adds the Enabler component to your Flash library.

  • Option 2: As another option, drag the Enabler icon  to the Library of both your parent and child files and add this code to the parent:

    import com.google.ads.studio.HtmlEnabler;

    // Get a reference to the HtmlEnabler;
    var enabler:HtmlEnabler = HtmlEnabler.getInstance();

    // Initialize the HtmlEnabler. The "this" keyword refers to the stage.
    enabler.init(this);

...and this code to the child:

import com.google.ads.studio.ProxyEnabler;

// Get a reference to the ProxyEnabler;
var enabler:ProxyEnabler = ProxyEnabler.getInstance();

Using either of these options to set up your Enabler, you can always access the HtmlEnabler class through the variable enabler.

Try it!

Add the HtmlEnabler to the parent file and the ProxyEnabler to the child file(s).