能解释以下各行的意思吗?如果做一个自动投票的程序会吗? ( 积分: 200 )

  • 主题发起人 主题发起人 lyy8848
  • 开始时间 开始时间
L

lyy8848

Unregistered / Unconfirmed
GUEST, unregistred user!
投票地址:
http://www.jjedu.net/vote/index_ok.php
flash中的语句
// Action script...
// [Action in Frame 1]
System.useCodepage = false;
myDXML = new XML();
myDXML.ignoreWhite = true;
var url1;
url1 = "0";
var alpha_num = 0;
var clInterval = true;
var CURPATH = "http://www.jjedu.net/vote/";
// [Action in Frame 2]
myDXML.load(CURPATH + "index.php");
gotoAndPlay(3);
// [Action in Frame 3]
myDXML.onLoad = function (success)
{
if (success)
{
gotoAndStop(5);
}
else
{
gotoAndPlay(4);
} // end else
if
};
// [Action in Frame 4]
gotoAndPlay(3);
// [Action in Frame 5]
function SetRowsAlpha(r, alpha)
{
r._alpha = r._alpha + alpha;
} // End of the function
function SetRowsValue(rn, d_xml, mc)
{
mc.txtID.text = d_xml[rn].attributes.id;
mc.txtLis.text = rn + 1;
mc.txtIns.text = d_xml[rn].attributes.ins;
mc.txtAddr.htmlText = &quot;<a href=/'&quot;
+ d_xml[rn].attributes.web_addr + &quot;/' target=/'_blank/'> &quot;
+ d_xml[rn].attributes.web_addr + &quot;</a>&quot;;
mc.txtVote.text = d_xml[rn].attributes.voteno;
percent = Math.round(d_xml[rn].attributes.voteno / myDXML.firstChild.attributes.XML_voteSum * 100);
mc.txtPro.text = percent + &quot;%&quot;;
mc.recBar._x = mc.txtPro._x + 1;
mc.recBar._y = mc.txtPro._y + 2;
mc.insPro._x = mc.recBar._x + 1;
mc.insPro._y = mc.recBar._y + 1;
mc.insPro._width = (mc.recBar._width - 2) * percent / 100;
} // End of the function
function cbt(r)
{
if (r._alpha > 0 &amp;&amp;
alpha_num % 2 == 0)
{
SetRowsAlpha(r, -10);
}
else
if (r._alpha <= 0 &amp;&amp;
alpha_num % 2 == 0)
{
++alpha_num;
SetRowsAlpha(r, 10);
}
else
if (r._alpha < 100 &amp;&amp;
alpha_num % 2 == 1)
{
SetRowsAlpha(r, 10);
}
else
if (r._alpha >= 100 &amp;&amp;
alpha_num % 2 == 1)
{
++alpha_num;
SetRowsAlpha(r, -10);
} // end else
if
if (alpha_num == 10)
{
clearInterval(intervalID);
clInterval = true;
trace (&quot;alphp&quot;);
} // end if
} // End of the function
e_xml = myDXML.firstChild.childNodes;
total = e_xml.length;
var rname;
var order = 0;
var intervalID;
XML_totalRows.text = String(myDXML.firstChild.attributes.XML_totalRows);
XML_voteSum.text = String(myDXML.firstChild.attributes.XML_voteSum);
rows_temp._visible = false;
rows_temp2._visible = false;
for (i = 0;
i < total;
i++)
{
var posy;
rname = &quot;row_&quot;
+ i;
if (eval(rname) == undefined)
{
if (i % 2 == 0)
{
duplicateMovieClip(rows_temp, rname, i + 1);
}
else
{
duplicateMovieClip(rows_temp2, rname, i + 1);
} // end else
if
posy = (eval(rname)._height - 1) * i + 220;
eval(rname)._y = posy;
eval(rname)._x = 0;
} // end if
SetRowsValue(i, e_xml, eval(rname));
} // end of for
var mouseListener = new Object();
mouseListener.onMouseUp = function ()
{
for (i = 0;
i < total;
i++)
{
var str = &quot;row_&quot;
+ i;
var mc_width = eval(str).btnVote._width;
var mc_height = eval(str).btnVote._height;
var m_x = eval(str).btnVote._xmouse;
var m_y = eval(str).btnVote._ymouse;
if (m_x < mc_width / 2 &amp;&amp;
m_x > -mc_width / 2 &amp;&amp;
m_y < mc_height / 2 &amp;&amp;
m_y > -mc_height / 2)
{
var voteResponse = new LoadVars();
var vote = new LoadVars();
vote.voteID = eval(str).txtID.text;
vote.sendAndLoad(CURPATH + &quot;rcs.php&quot;, voteResponse, &quot;POST&quot;);
voteResponse.onLoad = function (suc)
{
if (suc)
{
if (this.back == 1)
{
attachMovie(&quot;votesuccess&quot;, &quot;vote_success1&quot;, 61, {_x: 200, _y: 150});
alpha_num = 0;
if (clInterval)
{
intervalID = setInterval(cbt, 10, eval(str));
clInterval = false;
} // end if
trace (&quot;恭喜您投票成功,谢谢&quot;);
myDXML.load(CURPATH + &quot;index.php&quot;);
gotoAndPlay(3);
}
else
{
attachMovie(&quot;votefalse&quot;, &quot;vote_false1&quot;, 60, {_x: 200, _y: 150});
gotoAndStop(3);
trace (&quot;对不起,您已经投过一票了&quot;);
} // end else
if
}
else
{
trace (&quot;load vars failur!&quot;);
} // end else
if
};
break;
} // end if
} // end of for
};
Mouse.addListener(mouseListener);
stop ();
 
解释各行,就没必要了!
做自动投票程序,当然会!
QQ:417961930!
 
后退
顶部