控制MC循环、后倒放的函数,上次做一片头的时候写的,有兴趣的拿去用。效果可参看
arthas.icpcn.com/flash.htm
//author:hellheaven
function loop(TargetMC, T) {
tc = eval(TargetMC);
var normal = true;
function SLoop() {
if (tc._currentframe == undefined) {
clearInterval(TargetMC);
}
if (normal) {
var cf = tc._currentframe+1;
tc.gotoAndStop(cf);
if (tc._currentframe == tc._totalframes) {
normal = false;
}
} else {
var cf = tc._currentframe-1;
tc.gotoAndStop(cf);
if (tc._currentframe == 1) {
normal = true;
}
}
}
if (T != undefined) {
TargetMC = setInterval(SLoop, T);
} else {
clearInterval(TargetMC);
}
}
function back(TargetMC, T) {
var TargetMC = String(TargetMC);
var tc = eval(TargetMC);
tc.stop();
function run() {
if (tc._currentframe == undefined) {
clearInterval(TargetMC);
}
if (tc._currentframe>1) {
var k = tc._currentframe-1;
tc.gotoAndStop(k);
} else {
tc.gotoAndStop(tc._totalframes);
}
}
if (T != undefined) {
TargetMC = setInterval(run, T);
trace(TargetMC);
} else {
clearInterval(TargetMC);
}
}