有奖大转盘FLASH程序的内部代码!

本主题由 纵云 创建于 2009-10-19 12:47:58

function loadUsers()
{
var ld = new LoadVars();
var _loc2;
ld.load("./getActiveUser.action", "_root", "GET");
ld.onLoad = function (succ)
{
if (succ)
{
trace (ld.arg1);
_root.mc_users.txt_users.htmlText = ld.arg1;
_root.mc_users.txt_percent.text = ld.arg2 + "%";
}
else
{
_root.mc_users.txt_users.text = "加载数据失败";
} // end else if
};
} // End of the function

function getCellStart()
{
spdLoop = setInterval(spdRun, 60);
} // End of the function

function getCellStop()
{
clearInterval(spdLoop);
cell_mc.speed_mc.stop();
loadBingoPos();
} // End of the function

function spdRun()
{
cell_mc.speed_mc.play();
} // End of the function

function trans(v)
{
v = Math.floor((25 - Math.abs(v - 25)) / 5) + 1;
if (v == 5)
{
v = 4;
} // end if
return (v);
} // End of the function
function rollRun(v)
{
pst = v;
aoo = pst * 10;
pointerLoop = setInterval(pointerRun, 50);
} // End of the function
function pointerRun()
{
if (pst == 3)
{
preRoll(3);
}
else if (pst == 4)
{
preRoll(4);
}
else
{
pointer_mc._rotation = pointer_mc._rotation + getRollSpd();
checkFinish();
} // end else if
} // End of the function
function preRoll(time)
{
if (time == 3)
{
if (preRollFlag > 60)
{
pointer_mc._rotation = pointer_mc._rotation + getRollSpd();
checkFinish();
}
else
{
pointer_mc._rotation = pointer_mc._rotation + 36;
++preRollFlag;
} // end else if
}
else if (time == 4)
{
if (preRollFlag > 80)
{
pointer_mc._rotation = pointer_mc._rotation + getRollSpd();
checkFinish();
}
else
{
pointer_mc._rotation = pointer_mc._rotation + 45;
++preRollFlag;
} // end else if
} // end else if
} // End of the function

function getRollSpd()
{
if (bingoPos != -1)
{
return (getBingoPos());
}
else
{
return (aoo);
} // end else if
} // End of the function

function getBingoPos()
{
if (allRot < 0 && !hasCalc)
{
var _loc1 = pointer_mc._rotation >= 0 ? (pointer_mc._rotation) : (360 + pointer_mc._rotation);
allRot = 360 - _loc1 + bingoPos * 2.250000E+001;
if (allRot > 360 && pst < 3)
{
allRot = allRot - 360;
} // end if hasCalc = true;
} // end if
if (aoo > 2)
{
aoo = aoo - pst / 2;
}
else
{
aoo = 2;
} // end else if
allRot = allRot - aoo;
if (allRot > 0)
{
return (aoo);
}
else
{
return (0);
} // end else if
} // End of the function

function loadBingoPos()
{
var _loc1;
_loc1 = "./luna_roll.action?" + Math.random();
my_var.load(_loc1);
} // End of the function

function checkFinish()
{
finishLoop = setInterval(ifFinish, 500);
} // End of the function

function ifFinish()
{
if (allRot <= 0)
{
clearInterval(finishLoop);
if (_loc2 >= 0 && _loc2 % 2 == 1)
{
prize_msg._visible = true;
_root.btn_replay._visible = true;
_root.prize_msg.result_msg.text = "激活码" + active_code + ",祝游戏愉快!";
}
else
{
prize_msg._visible = true;
_root.btn_replay._visible = true;
_root.prize_msg.result_title.text = "很遗憾...";
_root.prize_msg.result_msg.text = "您没有获得激活码,请稍候再试。";
} // end else if
if (_
== -2)
{
prize_msg._visible = true;
_root.btn_replay._visible = true;
_root.prize_msg.result_title.text = "已经获得了激活码";
_root.prize_msg.result_msg.text = "同一账号不可重复获得激活码";
} // end if
succCallback();
}
else
{
++finishVar;
} // end else if
} // End of the function

function succCallback()
{
flash.external.ExternalInterface.call("showAward", bingoPos);
} // End of the function

function reInit()
{
spdSpeed = 2;
isPress = false;
bingoPos = -1;
allRot = -1;
hasCalc = false;
my_var = new LoadVars();
finishVar = 0;
preRollFlag = 0;
} // End of the function

System.useCodepage = true;
loadUsers();
stop ();
var spdLoop;
var pointerLoop;
var spdSpeed = 2;
var pst;
var isPress = false;
var bingoPos = -1;
var allRot = -1;
var aoo;
var hasCalc = false;
var my_var = new LoadVars();
var finishLoop;
var finishVar = 0;
var usrName;
var preRollFlag = 0;
var active_code = "";
var _loc2 = 0;
prize_msg._visible = false;
my_var.onLoad = function (success)
{
if (success)
{
_loc2 = my_var.arg1;
active_code = my_var.arg2;
trace (_loc2);
if (_loc2 > -1)
{
bingoPos = _loc2;
rollRun(trans(cell_mc.speed_mc._currentframe));
} // end if
if (_loc2 == -95)
{
prize_msg._visible = true;
_root.btn_replay._visible = true;
_root.prize_msg.result_title.text = "您刷的频率过快";
_root.prize_msg.result_msg.htmlText = "一分钟之内只可以玩一次,请稍候再试";
} // end if
if (_loc2 == -97)
{
prize_msg._visible = true;
_root.btn_replay._visible = true;
_root.prize_msg.result_title.text = "活动尚未开始";
_root.prize_msg.result_msg.htmlText = "更多抢号活动敬请关注<a href=\'./redirct_to_luna.html\'>www.lunajoy.com</a>";
} // end if
if (_loc2 == -98)
{
prize_msg._visible = true;
_root.btn_replay._visible = true;
_root.prize_msg.result_title.text = "活动尚未开始";
_root.prize_msg.result_msg.htmlText = "活动开放时间及其它抢号活动敬请关注<a href=\'./redirct_to_luna.html\'>www.lunajoy.com</a>";
} // end if
}
else
{
trace ("Error loading/parsing LoadVars.");
} // end else if
};
start_btn.onPress = function ()
{
if (isPress == false)
{
getCellStart();
} // end if
};
start_btn.onRelease = function ()
{
if (isPress == false)
{
var _loc1 = Math.random(10);
if (Math.floor(_loc1 * 10) % 2 == 0)
{
clearInterval(spdLoop);
cell_mc.speed_mc.stop();
bingoPos = Math.floor(_loc1 * 10);
rollRun(trans(cell_mc.speed_mc._currentframe));
}
else
{
getCellStop();
} // end else if
isPress = true;
} // end if
};
_root.btn_replay.onPress = function ()
{
_root.getURL("./luna_roll_init.action");
};

放心注册,GeeKaa不会虚耗你半点时间,你只会发现更多乐趣。 立即注册