Показать сообщение отдельно
Старый 11.11.2006, 05:35
wvxvw вне форума Посмотреть профиль Отправить личное сообщение для wvxvw Найти все сообщения от wvxvw
  № 5  
Ответить с цитированием
wvxvw
Modus ponens
 
Аватар для wvxvw

модератор форума
Регистрация: Jul 2006
Адрес: #1=(list #1#)
Сообщений: 8,049
Записей в блоге: 38
Код:
var _txt:TextField = _root.createTextField("_txt", 0, 5, 5, 200, 200);
with (_txt) {
	border = true;
	borderColor = 0;
}
var _str:String = "Test text\rTest line\r";
for (i=0; i<5; i++) {
	_str += _str+i;
}
_txt.text = _str;
// Поместить в библиотеку клип небольшого размера, присвоить идентификатор экспорта scroller
var scroller:MovieClip = _root.attachMovie("scroller", "scroller", 2, {_x:_root._txt._width+5, _y:5});
scroller.onPress = function() {
	if (this.m_y == undefined) {
		this.m_y = this._y;
		this.n_y = _root._txt._height+_root._txt._y-this._height;
		this._step = this.n_y/_root._txt.maxscroll;
	}
	this.a_y = this._ymouse;
	this.onEnterFrame = function() {
		this._y += this._ymouse-this.a_y;
		if (this._y<this.m_y) {
			this._y = this.m_y;
		}
		if (this._y>this.n_y) {
			this._y = this.n_y;
		}
		_root._txt.scroll = this._y/this._step;
	};
};
scroller.onRelease = function(){
	delete this.onEnterFrame;
}
scroller.onReleaseOutside = scroller.onRelease;
__________________
Hell is the possibility of sanity