Flash banner

1. Banner summary

ID Number: 15H032.
Short description: simple flash-banner.
Code type: IFrame, Poster, Ajax, JavaScript, Extension, Redirect.
Examples: SimpleFlash on Ajax-code, SimpleFlash on IFrame-code.
Third party tracking: flash banner preparation for further AdRiver pixel insertion.
Specification: Flash banners attract user’s attention, have individual design, and good animation. They come in different sizes.

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. Banner preparation

You should prepare two banner variations: a flash movie (in .swf format) and an image file (in .gif or .jpeg format) which will be shown to those users who do not have a compatible version of flash player installed.

2.1 Flash-movie made with ActionScript 2

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


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.

2.3. Third party click tracking

In ActionScript 2 for third party click tracking, attach the following ActionScript to the button element:


on(release){
	 if (_root.ar_pass){
		var temp_mc = _root.createEmptyMovieClip("temp_mc", _root.getNextHighestDepth());
		temp_mc._x = -10000;
		var mcLoader = new MovieClipLoader();
		mcLoader.addListener({onLoadInit:function(mc:MovieClip){
			mcLoader.unloadClip(mc);
		}});
		mcLoader.loadClip(_root.ar_pass, temp_mc);
	}

	getURL(_root.link1, _root.target)
}

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


function callLink(event:MouseEvent):void {
	var pass:String = LoaderInfo(this.root.loaderInfo).parameters['ar_pass'];	
	if(pass&&pass!="undefined") (new Loader()).load(new URLRequest(pass));	
	
	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);

3. Downloading a flash-banner on Ajax code

  • Prepare a banner according to step 2 of the instruction
  • Add a banner special —> special —> Flash-AjaxJS
  • Click on «Загрузить баннер» button.
  • Download a flash-movie and an image, enter the banner width and height, and other options.
  • Press the button «Загрузить» button.

4. 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. Size of the flash banner and the image should be the same.

5. 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 for each one component.

For downloading banner files with extra-limit sizes you can use the box «Расположение на стороннем сервере», in which you should enter the full pathname to a file on external server.

For 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 the sales and support departments.

6. Simple flash-banners validation

Use validator.

Last modified on 29.03.2016