Skip to content

zont/Adriver-Loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Adriver-Loader (as3) version 1.97
https://github.com/randuev/Adriver-Loader/

* supports:
    
    single adriver for site and network 
    renders image/swf/flv content
    uses vkontakte api to retrieve demographics
    skip button
    callbacks for all events
    duration limit
    third party pixel audit

* how to use:

// copy adriver and vkontakte directories into your project root

// in your application, first add imports:

    import adriver.*;
    import adriver.events.*;
    
// set up parameters:

    parameters = {
        // user information, can be left blank if you use AdriverVK to load user info
        user: {
            // sex of user. 2 is male. 1 is female
            // mandatory
            sex: 2,
            // birth date in "YYYY-MM-DD" format
            // mandatory
            bdate: "1917-01-09",
            // unique user identificator
            uid: 1,
            // city name. lowercase
            city_name: "st.petersburg",
            // country name. lowercase
            country_name: "russia"
        },            
            
        // adriver parameters
        adriver: {
            // user info if specified manually
            user: user_info,
            // your site id in adriver
            // mandatory
            sid: YOUR_SITE_ID_IN_ADRIVER
            // custom parameters to provide extra targeting information
            custom: {
                // these constants allow specification of vkontakte demographics
                10: adriverLoaderDefaults.CITY_NAME,
                11: adriverLoaderDefaults.COUNTRY_NAME,
                12: adriverLoaderDefaults.UID,
                // you can put anything else in custom
                13: "9001"
                }
        },
        
        // what social network to query for user data. 
        // currently only vkontakte is supported. 
        // can be commented out if you don't want module to perform query or 
        // want to supply information yourself (fill user module)
        // 
        social_network: "vkontakte",
        
        // when debugging vkontakte application locally, use test mode
        // api_test_mode: 1,
    
        // type of advertisement 
        // currently only "pregame" 
        ad_type: "pregame",
    
        // skip button settings
        // either "true" to use standard button
        // or points to actual Button in application        
        // default: true, which means create vkontakte button
        
        skip_button: true,
        // skip_button: mySkip,
        
        // label
        skip_button_label: "Skip",
        
        // how quickly it can be activated (in seconds) 
        // default: 0 which means button is active straight away
        skip_button_timeout: 0,
        
        // advertisement duration limit in seconds
        // it auto-skips the ad when timer is reached
        // default: 0, which means no limit
        max_duration: 0,

        // if you want to capture clicks before they are passed to flash banner, set it to true
        // default: true, which means we don't let flash banners handle own clicks		
        catch_clicks: true,

        // style parameters
        style: {
            width: stage.stageWidth,
            height: stage.stageHeight
        },                
        
        // debug function
        debug: debug
        };
    
// when you are ready to display advertisement, initialize adriverLoader

    var ad:adriverLoader = new adriverLoader(mc_with_ad, parameters);
    
// you might want to catch adriver events (make sure these functions exist)
    
    ad.addEventListener(AdriverEvent.STARTED, onAdStarted);
    ad.addEventListener(AdriverEvent.CLICKED, onAdClicked);			
    ad.addEventListener(AdriverEvent.FINISHED, onAdFinished);
    ad.addEventListener(AdriverEvent.FAILED, onAdFailed);
    ad.addEventListener(AdriverEvent.LOADED, onAdLoaded);
    ad.addEventListener(AdriverEvent.SKIPPED, onAdSkipped);
    ad.addEventListener(AdriverEvent.PROGRESS, onAdProgress);
    ad.addEventListener(AdriverEvent.LIMITED, onAdLimited);

// load and display advertisement

    ad.loadAd();

* Please see site.as and site.fla for compelte sample application

* Fork, fix and send pull requests, please

About

Adriver-Loader for as3 applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ActionScript 99.9%
  • Shell 0.1%