作者funcy (科技绝缘体)
看板Flash
标题Re: [问题] 随滑鼠移动的跑马灯?
时间Tue Mar 25 17:18:04 2008
※ 引述《chigayaptt (牧枫蝶)》之铭言:
大大~~可以教一下这整段程式的设计逻辑吗@@?
我看了下面推文连结的影片说明还是没办法理解大大的这段程式
不能老是拿现成的复制贴上来用阿~"~
: 原始码
: 把按钮影片命名成strip,就是存成同一个按钮长条那个
: 然後拉到场景上 ,点选f9之後把这段贴上就好了
: onClipEvent (load) {
: percent_increment = .08;
: addstrip2 = false;
: }
: onClipEvent (enterFrame) {
: this._x += (_root._xmouse-320)*percent_increment;
: if (this._x<=0 && this._x>=-this._width) {
: if (addstrip2 == false) {
: this.duplicateMovieClip("strip2", 1);
: addstrip = true;
: }
: _root.strip2._x = this._x+this._width-1;
: _root.strip2._y = this._y;
: }
: if (this._x<=-this._width) {
: this._x = _root.strip2._x+this._width-1;
: }
: if (this._x>0 && this._x<this._width) {
: if (addstrip2 == false) {
: this.duplicateMovieClip("strip2", 1);
: addstrip = true;
: }
: _root.strip2._x = this._x-this._width+1;
: _root.strip2._y = this._y;
: }
: if (this._x>=this._width) {
: this._x = _root.strip2._x-this._width+1;
: }
: }
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 210.60.29.254