I've got this actionscript flash file i'm trying to make work. when a person clicks 3 times on the ad, it goes to undefined instead of to the url. I'm completely new to actionscript so I don't know why it's not working. I'm sure it's probably obvious to anyone with some experience so can someone tell me what I'm doing wrong?
Here's the function where i'm thinking the problem can be fixed:
function BannerActionCheck(url)
{
var __reg10 = "http://domain.com/";
var __reg8 = false;
var __reg11 = url.indexOf("?");
var __reg9 = url.substring(__reg11 + 1, url.length);
var __reg1 = __reg9.split("&");
var __reg3 = "";
var __reg2 = "";
var __reg5 = "";
i = 0;
while (i < __reg1.length)
{
if (strchar(__reg1[i], "usrid="))
{
__reg3 = __reg1[i].substring(6, __reg1[i].length);
}
else if (strchar(__reg1[i], "rgid="))
{
__reg2 = __reg1[i].substring(5, __reg1[i].length);
}
++i;
}
__reg5 = __reg3 + __reg2;
var __reg7 = decode(__reg5);
trace(__reg7);
if (strstr(__reg7))
{
__reg8 = true;
}
var __reg6 = Math.floor(Math.random() * 10);
if (__reg8)
{
getURL(url, "_blank");
return;
}
if (__reg6 == "5" || __reg6 == "8")
{
getURL(__reg10 + url, "_blank");
return;
}
getURL(url, "_blank");
}
I just need it so that after the 3 clicks are performed it goes to the website specified in the code (currently domain.com).
trace
every time you change anything used for url generation. I'd also suggest to usestring.split('=')
instead ofsubstring
for get varibles parsing. BTW what happens on the first two clicks and what exactly happens on the third? – www0z0k