Expandable

1. Banner summary

ID Number: 40H053.
Short description: when a user opens a webpage, banner expands covering site content. After the specified timeout banner decreases.
Code type: Ajax, Poster, Extension.
Examples: Infiniti.
Third party tracking: Flash banner preparation for further AdRiver pixel insertion.
Specification: banner consists of two flash-movies with different width or height. Initially, the first flash-movie is shown (it covers the whole webpage content). It is displayed for some specified seconds and then it is replaced by the second banner, which is smaller and does not cover the content. The banner does not have limitations on showing to unique users. It is displayed every time a user loads the particular webpage.

It is recommended to use Poster code if a banner should be displayed only after a user scrolls to its placement. On this code banner is displayed after complete loading of the webpage. In other cases it is strongly recommended to use Extension code.

2. Flash-movie preparation

You should prepare two flash-movies: the big one and the small one. For the small movie you should also prepare a .gif or .jpeg image of proper width and height, which will be shown to those users who do not have a compatible version of flash player installed. The width and height of the image and of the flash-movie should be the same.

2.1 Flash-movie made with ActionScript 2

The first frame of flash-movie should contain the following ActionScript:


if(ar_init == undefined){
 ar_init = true;
 System.security.allowDomain('*');
}

System.security.allowDomain(‘*’) allows the downloader to access banner variables and properly initialize click variable link1. It is not necessary to specially permit access in a downloader to those movies which are being downloaded.

To record the “click” event create a button element in your flash-movie. To redirect a user after the click getURL function is used. It takes two parameters: where a user should be redirected – variable link 1 (1st parameter), and value _blank of the target variable to open a banner link in a new window (2nd parameter).


on (release) {
       getURL(_root.link1, "_blank");
}

You should obligatorily use the link1 variable, it is used for counting clicks.

If it is necessary to open a banner link in a current window you can use the value _top of a target variable.


on (release) {
       getURL(_root.link1, "_top");
}

If you client is using AdRiver as a main system for online-advertising management on his site you can use the following code:


on (release) {
       getURL(_root.link1, _root.target);
}

This code allows to open banner link either in a current window or in a new window according to the option that was choosen in AdRiver interface.

You can use several button elements. Each element can contain different URL. In this case you can evidently set URL address. You should encode URL with escape() function. Example:


on (release) {
       getURL(_root.link1+escape("http://alternative.url.to.go/path?search#hash"),_root.target);
}

To download in a flash-movie additional banner parts (flv, swf, xml -files) you should add the name of that additional part to a _root.ar_comppath variable. In this case in AdRiver interface additional parts are downloaded with “Дополнительная компонента” special field. To access the additional downloaded file from a flash-movie you can write the following line:


_root.ar_comppath + 'flash_name.swf'

To access additional downloaded .swf file you can also use the following code:


on (release){
loadMovieNum(_root.ar_comppath + 'flash_name.swf', 500);
}

To access additional downloaded .xml file you can use the following code:


myXML = new XML();
myXML.load(_root.ar_comppath + 'имя загруженного файла');

To access additional downloaded .flv file you can use Netsream or FLVPlayBack:


var nс:NetConnection = new NetConnection();
nс.connect(null);
var ns:NetStream = new NetStream(nс);
videoContainer.attachVideo(ns); //videoContainer is an object which allows to play video files in a flash-movie
ns.play(_root.ar_comppath + 'имя загруженного файла');

or


var myVideo:FLVPlayback = new FLVPlayback();
myVideo.source = _root.ar_comppath + 'имя загруженного файла';

You can also use a special tool to prepare banners according AdRiver specifications.

2.2. Flash-movie made with ActionScript 3

In ActionScript 3 a button element should contain the following ActionScript:


function callLink(event:MouseEvent):void {	
	var url:String = LoaderInfo(this.root.loaderInfo).parameters['link1'];
	try {
		var ie:String = ExternalInterface.call("function(){return !!window.ActiveXObject}");
		if (ie == "true") ExternalInterface.call('window.open',url);
		else navigateToURL(new URLRequest(url), '_blank');
	}catch (e:Error){
		navigateToURL(new URLRequest(url), '_blank');
	}
}
click_btn.addEventListener(MouseEvent.CLICK, callLink);

You can use several button elements. Each element can contain different URL. In this case you can evidently set URL address. You should encode URL with escape() function. Example:


function callLink(event:MouseEvent):void {
    var url:String = LoaderInfo(this.root.loaderInfo).parameters['link1'];
    var alt_url= escape("http://alternative.url.to.go/path?search#hash");
    try {
        var ie:String = ExternalInterface.call("function(){return !!window.ActiveXObject}");
         if (ie == "true") ExternalInterface.call('window.open',url+alt_url);
        else navigateToURL(new URLRequest(url+alt_url), '_blank');
    }catch (e:Error){
        navigateToURL(new URLRequest(url+alt_url), '_blank');
    }
}
 click_btn.addEventListener(MouseEvent.CLICK, callLink);

You can also use a special tool to prepare banners according AdRiver specifications.

3. Requirements

Names of the files can consist of numbers, Latin letters or underscore symbols only and can’t contain any Russian letters, space symbols, quotes or other special symbols. The width and height of the image and of the flash-movie should be the same.

4. File size limits for banners in AdRiver

  • gif, jpeg, png-files (img width x height banners on AdRiver) — 600К;
  • swf-files (flash width x height banners on AdRiver) — 600K;
  • other file types — 600K;
  • for multicomponent banners the limits are checked separately for each component.

For downloading banner files with extra-limit sizes you can use the box “Расположение на стороннем сервере”, where you should enter the full pathname to the banner on an external server.

For the banners that can’t be loaded from an external server it is possible to increase the limits of the file sizes. It must be agreed with sales and support departments.

Last modified on 29.03.2016