Показать сообщение отдельно
Старый 18.08.2004, 19:09
Iv вне форума Посмотреть профиль Отправить личное сообщение для Iv Посетить домашнюю страницу Iv Найти все сообщения от Iv
  № 1  
Iv
 
Аватар для Iv

Регистрация: Apr 2001
Адрес: Moscow
Сообщений: 1,475
По умолчанию новая жизнь Motion Tween

Код:
import com.sharedfonts.Path
// source http://www.sharedfonts.com/Path.as
_root.createEmptyMovieClip("mc", 0);
_root.mc.lineStyle(5, 0xFF0000, 100);
_root.mc.lineTo(.2, 0);
_root.mc.p0 = 100;
_root.mc.p1 = 100;
_root.mc.speed = _root.mc.path_position=0;
_root.mc.dir = 0.1;
_root.mc.onEnterFrame = function() {
_root.mc.tween_path = new Path(400, 0,
this.p1, 0, 100, 100, 100, 200, 450, 380, 0, this.p0);
// show path
_root.clear(), _root.lineStyle(0, 0, 30);
_root.moveTo(400, 0);
_root.curveTo(this.p1, 0, 100, 100);
_root.curveTo(100, 200, 450, 380);
_root.curveTo(0, this.p0, 400, 0);
//
this.p1 += 1, this.p0 += 1;
this.path_position += this.speed += this.dir;
if (random(100) == 1) {
this.dir = -this.dir;
}
var poz = this.tween_path.getPointByPosition(this.path_position);
this._x=poz._x, this._y=poz._y;
};