YouTube Masthead: Custom Flash build guide

YouTube Close Button

A YouTube Close Button is mandatory on all YouTube mastheads and is available as a special component outside the DoubleClick Studio MXP. You can download a copy of it from the AS3 YouTube Close Button API Reference.

What does the YouTube Close Button do?

The YouTube "Close Ad X" button component has one main function: to collapse 100% of the masthead on the YouTube homepage. When a user clicks "Close Ad X," the ad disappears, page content pushes up, and a "Show Ad" button remains. When a user clicks "Show Ad," the ad reappears, the page content pushes down again, and the component displays a "Close Ad X" button again on the masthead.

The YouTube Close Button component ensures that the masthead works directly  with the code on the YouTube homepage to push down and retract the YouTube page content.

How do I add the YouTube Close Button?

Add it to the stage of your parent file by either copying the button from an existing template or, if you’ve downloaded the component’s MXP, by dragging it to the stage. Add this component to the top right corner of the parent file, on the top-most layer of the creative. This ensures that the close button isn't hidden by any subsequent SWF loads in the masthead.

Padding between the "Close Ad X" button and the top and right sides of the masthead must be no less than five pixels and no greater than 10 pixels.

How do I customize the YouTube Close Button?

The YouTube Close Button component has three property settings that you can access in the Flash properties panel:

  • Color
    • Grey (default)
    • White
    • Black
  • Language
    • English (default)
    • Chinese
    • Czech
    • Dutch
    • French
    • German
    • Hebrew
    • Italian
    • Japanese
    • Korean
    • Norwegian
    • Polish
    • Portuguese
    • Russian
    • Spanish
    • Swedish
  • Shadow
    • None (default)
    • Black
    • White
Android-style image of the author of this page

Sarah is a DoubleClick Studio expert and author of this help page. Help her improve this article by leaving feedback below.

Was this article helpful?