查看完整版本: Flash教程:AS代码打造漂亮的螺旋上升效果

爱你不要你 2008-10-9 10:16

Flash教程:AS代码打造漂亮的螺旋上升效果

作者:wytan(老顽童)  来源:中国教程网论坛

效果演示:

[swf]http://www.jcwcn.com/uploadfile/article/uploadfile/200810/20081008110407177.swf[/swf]

制作方法:

1、新建Flash文档,背景色青色。
2、新建一个电影剪辑,命名为MC。第一层插入一个关键帧,第一帧画母鸡,全居中;第二帧画蛋,全居中。新一个层插入一个空白关键帧,两个关键帧都加上帧动作stop(); 。
3、回到主场景,从库中把MC拖到舞台,放在靠左的位置,选中MC,打开“动作-电影剪辑”面板,输入脚本:[code]on (press) {
startDrag(this);
var newdepth = this._parent.getNextHighestDepth();
var newname = "copy" + newdepth;
var prevname = "copy" + (newdepth-1);
if (this._parent[prevname] == undefined) this._parent[prevname] = this;
this.duplicateMovieClip(newname,newdepth);
this._parent[newname]._x = this._parent[prevname]._x + 0;
this._parent[newname]._y = this._parent[prevname]._y + 0;
}
on (release) {
stopDrag();
}
on (dragOut) {
this.gotoAndStop("2");
}
on (releaseOutside) {
stopDrag();
}[/code]4、加上自己喜欢的文字或装饰,测试,存盘。

异工同曲的:

[swf]http://www.jcwcn.com/uploadfile/article/uploadfile/200810/20081008110518159.swf[/swf]
页: [1]
查看完整版本: Flash教程:AS代码打造漂亮的螺旋上升效果