字体:  

Flash技巧代码:播放进度控制

smywu 发表于: 2007-4-01 14:32 来源: 学友集 社区门户

Flash技巧代码:播放进度控制
onEnterFrame = function () {
        jd_txt.text = "播放进度:"+_currentframe+"/"+_totalframes;
        _root.jd_mc.t_mc._x = int(_root._currentframe/_root._totalframes*(300-_root.jd_mc.t_mc._width));
};
_root.jd_mc.k_mc.onPress = function() {
        delete onEnterFrame;
        _root.jd_mc.t_mc._x = _root.jd_mc._xmouse;
};
_root.jd_mc.k_mc.onRelease = function() {
        gotoAndPlay(int(_root.jd_mc.t_mc._x/(300-_root.jd_mc.t_mc._width)*_root._totalframes));
        onEnterFrame = function () {
                jd_txt.text = "播放进度:"+_currentframe+"/"+_totalframes;
                _root.jd_mc.t_mc._x = int(_root._currentframe/_root._totalframes*(300-_root.jd_mc.t_mc._width));
        };
};
_root.jd_mc.t_mc.onPress = function() {
        delete onEnterFrame;
        startDrag(this, false, 0, -5, 300-this._width, -5);
        _root.jd_mc.t_mc.onEnterFrame = function() {
                gotoAndPlay(int(_root.jd_mc.t_mc._x/(300-_root.jd_mc.t_mc._width)*_root._totalframes));
                jd_txt.text = "播放进度:"+int(_root.jd_mc.t_mc._x/(300-_root.jd_mc.t_mc._width)*_root._totalframes)+"/"+_root._totalframes;
        };
};
_root.jd_mc.t_mc.onRelease = function() {
        stopDrag();
        delete _root.jd_mc.t_mc.onEnterFrame;
        gotoAndPlay(int(_root.jd_mc.t_mc._x/(300-_root.jd_mc.t_mc._width)*_root._totalframes));
        onEnterFrame = function () {
                jd_txt.text = "播放进度:"+_currentframe+"/"+_totalframes;
                _root.jd_mc.t_mc._x = int(_root._currentframe/_root._totalframes*(300-_root.jd_mc.t_mc._width));
        };
};
大家参考参考啊!!!!!好就顶啊!

最新回复

f1215 at 2007-4-17 19:03:14
好东西~~~~支持