信息之舟电脑软件应用栏目编者按:
这是我在做flash mv时做的,看下效果:
下是代码:
////////绝命时刻 2007年5月18日--2099年7月19日//////flash影片进度控制条 版本:1.1//////// ///特点:智能判断,前期无须做任何设定工作,只需把"进度控制棒全部"这个影片剪辑(mc)拖到主场景放好位置既可使用!// ///实现功能:随意拖拽,快进,快退,暂停,播放/// 拖拽 = false; onEnterFrame = function () { if (拖拽 == false) { berX = _parent._currentframe/(_parent._totalframes/jdb._width); ber._x = berX; } if (拖拽 == true) { _parent.gotoAndStop(Math.floor((Math.abs(ber._x)+1)*(_parent._totalframes/jdb._width))); } if (ber._x<=0 && 拖拽 == true) { ber._x = 0; _parent.gotoAndStop(1); } if (ber._x>=jdb._width) { 拖拽 = true; } }; ber.onPress = function() { startDrag("ber", false, 0, 0, jdb._width, 0); 拖拽 = true; }; ber.onRelease = ber.onReleaseOutside=function () { stopDrag(); 拖拽 = false; _parent.play(); }; Nmove.onPress = function() { 拖拽 = true; ber._x += 20; if (ber._x>=jdb._width) { ber._x = 0; } }; Pmove.onPress = function() { 拖拽 = true; ber._x -= 20; if (ber._x<=0) { ber._x = 0; } }; pus.onPress = function() { 拖拽 = true; ber._x = ber._x; }; playbtn.onPress = function() { if (拖拽 == true) { _parent.play(); } 拖拽 = false; }; jdb.onPress = function() { 拖拽 = true; ber._x = _xmouse; }; jdb.onRelease = jdb.onReleaseOutside=function () { 拖拽 = false; _parent.play(); };
源文件: 控制棒.rar |