forked from ad3002/Adriver-Loader
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
130 lines (101 loc) · 4.16 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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.width,
height: stage.height
},
// 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