一个可以控制mc播放次数的函数

      flash学习 2004-8-10 11:43
function mc_p(mc:MovieClip, n:Number) {
    var i:Number = 0;
    var Tot:Number = mc._totalframes;
    var Cur:Number = mc._currentframe;
    function myF() {
        Tot = mc._totalframes;
        Cur = mc._currentframe;
        if (Cur == Tot) {
            i++;
            trace(i);
        }
        if (i>=n) {
            mc.stop();
            mc._visible = false;
            mc.swapDepths(0);
            mc.removeMovieClip();
            clearInterval(id);
        }
    }
    var id = setInterval(myF, 100);
}
mc_p(mc_mc, 3);
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}
}