Показать сообщение отдельно
Старый 17.03.2009, 15:44
Kalabania вне форума Посмотреть профиль Отправить личное сообщение для Kalabania Найти все сообщения от Kalabania
  № 7  
Kalabania

Регистрация: Jan 2009
Сообщений: 129
Код:
Aligner.register(bg, { hStretch: true, hSize: 1, hSizeMargin: 2 });
Aligner.register(bgborder, { hStretch: true, hSize: 1, hSizeMargin: 0 });
Aligner.register(hit, { hStretch: true, hSize: 1, hSizeMargin: 0 });

loadedborder._width = 3;
loadedbar._width = 1;

opening = function () {
	delete maxTime;
}

progress = loaded = resize = function () {
	if (maxTime == undefined || maxTime < display.time) maxTime = display.time;
	var downloaded:Number = Math.max(display.preloadingBL/display.preloadingBT, display.duration != undefined ? (maxTime != undefined ? maxTime : 0)/display.duration : 0);
	if (isNaN(downloaded)) {
		loadedbar._width = 1;
	}
	else {
		loadedbar._width = Math.round((width-2) * downloaded + 3 * (1 - downloaded));
	}
	loadedborder._width = loadedbar._width + 2;
	change();
}

function change() {
	if (!dragging) {
		if (isNaN(display.duration)) {
			posbg._width = 3;
		}
		else {
			posbg._width = 3 + Math.round(display.time/display.duration * (width - 3));
		}
		pos._width = posbg._width - 2;
	}
}

hit.onPress = function () {
	wasPlaying = false;
	if (display.started) {
		dragging = true;
		onMouseMove = _onMouseMove;
		wasPlaying = display.playing;
		display.disablePlayingEvents = true;
		display.pause(true);
		display.disablePlayingEvents = false;
		onMouseMove();
	}
}

_onMouseMove = function () {
	display.time = Math.min(Math.max((_xmouse-2)/(width-3)*display.duration, 0), display.duration);
	handle._x = Math.round(Math.min(Math.max(_xmouse, 0), pbar._width - 1));
	posbg._width = 3 + Math.round(Math.min(Math.max(_xmouse-2, 0), loadedbar._width - 2));
	pos._width = posbg._width - 2;
	updateAfterEvent();
}

hit.onRelease = function () {
	dragging = false;
	delete onMouseMove;
	if (wasPlaying) {
		display.time = display.time;
		display.pause(false);
	}
}

hit.onReleaseOutside = function () {
	hit.onRelease()
	hit.onRollOut();
}

import xm.util.miniTweener;

hit.onRollOver = function () {
	miniTweener.addTween(_parent.r.time.current, { _white: 255, time: 0.1, transition: "linear" });
}

hit.onRollOut = function () {
	miniTweener.addTween(_parent.r.time.current, { _white: 0, time: 0.1, transition: "linear" });
}

resize();
а где в этом коде сам таймлайн, кто-то видит?