Transferring variables in the query string is often desired when the user inputs some data interactively in the Flash banner, e.g. his/her e-mail or telephone number etc. This can be achieved by appending a ";cppar=1&" parameter to the clickTAG. This method to transfer these variables in the querystring is best described by an example:
ActionScript 2.0 code:
var EmailFlashVariable = "aa@aa.com";
on (release) {
getURL(_root.clickTAG+";cppar=1&EmailURLVariable="+ EmailFlashVariable, _root.landingPageTarget);
}
ActionScript 3.0 code:
var EmailFlashVariable = "aa@aa.com";
button.addEventListener(MouseEvent.CLICK, ADFclicked);
function ADFclicked(event:MouseEvent) {
AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG")
+ ";cppar=1&EmailURLVariable=" + EmailFlashVariable);
}
If the clickTAG is e.g. set to http://www.site.com the user gets redirected to http://www.site.com?EmailURLVariable= aa@aa.com when the Flash banner is clicked.
This method can be used for multiple querystring values:
ActionScript 2.0 code:
var a = 1;
var b = 2;
var c = "Hello";
on (release) {
getURL(_root.clickTAG+";cppar=1&a="+a+"&b="+b+"&c="+c, _root.landingPageTarget);
}
ActionScript 3.0 code:
var a = 1;
var b = 2;
var c = "Hello";
button.addEventListener(MouseEvent.CLICK, ADFclicked);
function ADFclicked(event:MouseEvent) {
AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG")
+ ";cppar=1&a=" + a + "&b=" + b + "&c=" + c;);
}
The corresponding target URL then becomes http://www.site.com?a=1&b=2&c=hello.
However the parameter ";cppar=1&" works only when landing page contains symbol "?". In other cases there should be used ";urlappend=" parameter:
ActionScript 2.0 code:
var DestinationVariable = "London";
on (release) {
getURL(_root.clickTAG+";urlappend=" + DestinationVariable, _root.landingPageTarget);
}
ActionScript 3.0 code:
var DestinationVariable = "London";
button.addEventListener(MouseEvent.CLICK, ADFclicked);
function ADFclicked(event:MouseEvent) {
AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG")
+ ";urlappend=" + DestinationVariable);
}