最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash as 2.0 实现图片切换代码
时间:2009-04-01 编辑:简简单单 来源:一聚教程网
这里用as.20制作的一款图片轮换代码哦,不过这里要根mc.mov.loadMovie((((_root.root+"index_roll_")+i)+".jpg"));来实现加载目录的图片名称就OK了。
if ((_root.root == "") || (_root.root == undefined)) {
_root.root = "";
}
if ((_root.tm == "") || (_root.tm == undefined)) {
_root.tm = 100;
}
_root.tm = Number(_root.tm);
_root.sel = 1;
_root.sd = 10;
var i = 1;
var dateLocal = new Date();
var nowtime = String(dateLocal.getMilliseconds());
while (i<6) {
this["btn"+i].gotoAndStop(1);
this["btn"+i].num = i;
this["btn"+i].onRollOver = function() {
var _local1 = _root;
_local1.ss = false;
if (_local1.sel != this.num) {
_local1.mov.ttm = 0;
_local1.selp = _local1.sel;
_local1.sel = this.num;
_local1.mov["mov"+_local1.sel].swapDepths(_local1.sd++);
_local1.mov["mov"+_local1.sel]._x = 360;
}
};
this["btn"+i].onRollOut = function() {
_root.ss = true;
};
//this["btn"+i].onRelease = function() {
//getURL(("javascript:showIndexAD("+this.num)+");");
//};
mc = this.mov.createEmptyMovieClip("mov"+i, i);
mc.num = i;
mc._x = 360*(i-1);
mc.createEmptyMovieClip("mov", 1);
mc.mov.loadMovie((((_root.root+"index_roll_")+i)+".jpg"));
//mc.onRelease = function() {
//getURL(("javascript:showIndexAD("+this.num)+");");
//trace(this.num);
//};
mc.onRollOver = function() {
_root.ss = false;
};
mc.onRollOut = function() {
_root.ss = true;
};
i++;
}
_root.ss = true;
this.mov.ttm = 0;
this.mov.onEnterFrame = function() {
var _local2 = this;
var _local3 = _root;
if (_local3.ss == true) {
if ((_local2.ttm++)>_local3.tm) {
_local3.selp = _local3.sel;
if (_local3.sel == 5) {
_local3.sel = 1;
} else {
_local3.sel++;
}
_local2["mov"+_local3.sel].swapDepths(_local3.sd++);
_local2["mov"+_local3.sel]._x = 360;
_local2.ttm = 0;
}
}
_local2["mov"+_local3.sel]._x = _local2["mov"+_local3.sel]._x+(0.2*(-_local2["mov"+_local3.sel]._x));
_local2["mov"+_local3.selp]._x = _local2["mov"+_local3.selp]._x+(0.2*(-360-_local2["mov"+_local3.selp]._x));
var _local1 = 1;
while (_local1<6) {
if (_local3.sel == _local1) {
_local2._parent["btn"+_local1].nextFrame();
} else {
_local2._parent["btn"+_local1].prevFrame();
}
_local1++;
}
};
-
上一个: flash 2.0 读取xml
-
下一个: as 3.0 与 as2.0通信方法
相关文章
- flash怎么制作遮罩图片切换动画 06-19
- 怎么使用Flash遮罩制作图片切换特效 03-29
- flash 图片切换效果(拖尾模糊) 11-11
- 二款flash图片切换效果 10-20
- 两屏flash图片切换效果 10-13
- flash 图片切换效果代码 06-04