Flash block (test version)

This type of ad block is intended for flash applications on social networks as well as for games and sites built with Flash. Ads within this block are placed in one line and dynamically replace each other. The maximum number of ads in this type of block is nine. They are all selected based on behavioral targeting.

The Flash block is still undergoing testing and for the time being is not accessible through the ad code designer. To begin using the Flash block, download the library, add it to your project and insert your desired settings into the ad code.

You must also specify your yandex_partner_id in the code. You can simply copy it from your ad code in the partner interface.


Your yandex_partner_id from the ad code and the id number of your ad platform in the interface have different values.

You can modify the design and position of the block. To do this, in the flash block code specify one of the seven accessible colors (colors from the ColorTheme class), and set the desired width and position coordinates as well. You can also configure various responses to clicks on ads (for example, stopping an application when clicked).

Example flash block code

import flash.events.ErrorEvent;
import flash.system.Security;

import ru.yandex.direct.ColorTheme;
import ru.yandex.direct.Gender;
import ru.yandex.direct.YandexDirectWrapper;
import ru.yandex.direct.events.YandexDirectEvent;


private function init():void {
    var code:String = /*specify your yandex_partner_id here*/
    var colorTheme:String = ColorTheme.BLACK; 
    /*you can specify any other ColorTheme color instead of ColorTheme.BLACK*/
    var wrapper:YandexDirectWrapper = new YandexDirectWrapper(code, colorTheme);

    /*your statistics cross section id will be displayed here. 
   Please note that you cannot specify the id of cross-sections that already exist*/

    wrapper.addEventListener(YandexDirectEvent.CLICKED, wrapper_clickedHandler);
    wrapper.addEventListener(ErrorEvent.Error, wrapper_errorHandler);


private function wrapper_clickedHandler(event:YandexDirectEvent):void {
    /*here you assign a response to banner click-throughs*/

private function wrapper_errorHandler(event:ErrorEvent):void {
    /*here you assign a response to an error (for example, if an ad block cannot be uploaded)*/

You cannot use a flash block to place ads in video players.