• 【设为首页】
  • 【收藏闪客居】
当前位置:主页>FLASH AS 编程>AS基础篇>Load相关>文章内容
  • 自己做的一个进度控制棒
  • 来源: 作者:我为系统狂 2007-05-21 【
这是我在做flash mv时做的,看下效果:


下面是代码:
////////绝命时刻 2007年5月18日//////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();
};
源文件:
/upimg/soft/5/1_070521165417.rar




上一篇:详谈Loading[新手请看]   下一篇:进度条控制影片播放
  • 用户名:新注册) 密码: 匿名评论
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)

Copyright © 2006-2008 flashas.net All Rights Reserved.
网站内容咨询: admin#flashas.net (#为@) 联系QQ:40777822 浙ICP备06033001号
(本网站最佳浏览解析度为1024*768, 建议使用IE 6.0或以上版本浏览器。)