Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   Скроллинг Textfield в который подгружается html (http://www.flasher.ru/forum/showthread.php?t=112108)

chocoorchid 18.05.2008 21:36

Скроллинг Textfield в который подгружается html
 
Здравствуйте! Возможно ли сделать прокрутку текстового поля, в который подгружается из файла текст?
Я пробовала использовать вот этот код, с мувиклипом он отлично работает, но вот с текстовым полем никак (( Может быть что-то надо добавить либо изменить или вообще использовать другой код? помогите пожалуйста!:rolleyes::
P.S. Стандартный скролл работает, но он ну совсем не подходит под дизайн ((
Код:

this.scrollbar2.polzunok2._height = scrollbar2._height/(this.textfield1._height/this.scrollbar2._height);
koef = this.scrollbar2._height*(this.textfield1._height-this.scrollbar2._height)/(this.scrollbar2._height-this.scrollbar2.polzunok2._height);
textfield1Start = this.textfield1._y;
textfield1Amplitude = this.textfield1._y-(this.textfield1._height-this.scrollbar2._height);
this.scrollbar2.polzunok2.onPress = function() {

startDrag(this, false, 0, 0, 0, this._parent._height-this._height);//это функция "перетаскивания"

this.onEnterFrame = function() {/
 percent = (this._y/(this._parent._height-this._height));
 this._parent._parent.textfield1._y = ((1-(Math.round(percent)*100)/100)*textfield1Start+(Math.round(percent*100)/100)*textfield1Amplitude);
};
};

this.scrollbar2.polzunok2.onRelease=this.scrollbar2.polzunok2.onReleaseOutside=function(){
delete this.scrollbar2.polzunok2.onEnterFrame;
stopDrag();
}
var scroller2:Object = this.scrollbar2.polzunok2;
scroller2._height = scrollbar2._height/(this.textfield1._height/this.scrollbar2._height);
textfield1Start = this.textfield1._y;
textfield1Amplitude = this.textfield1._y-(this.textfield1._height-this.scrollbar2._height);
scroller2Amplitude = this.scrollbar2._height;
relation = (this.textfield1._height-scroller2Amplitude)/(scroller2Amplitude-scroller2._height);

koef = this.scrollbar2._height*(this.textfield1._height-this.scrollbar2._height)/(this.scrollbar2._height-scroller2._height);

scroller2.onPress = function() {
startDrag(this, false, 0, 0, 0, this._parent._height-this._height);
this.onEnterFrame = function() {
 percent = (this._y/(this._parent._height-this._height));
 this._parent._parent.textfield1._y = ((1-(Math.round(percent)*100)/100)*textfield1Start+(Math.round(percent*100)/100)*textfield1Amplitude);
};
};
scroller2.onRelease = scroller2.onReleaseOutside=function () {
delete scroller2.onEnterFrame;
stopDrag();
};

Mouse.addListener(this);

onMouseWheel = function (delta) {
this.textfield1._y += delta*relation;

scroller2._y += -delta;

if (scroller2._y<0) {
 scroller2._y = 0;
}
if (this.textfield1._y>this.maskArea._y) {
 this.textfield1._y = this.maskArea._y;
}
if (scroller2._y>scroller2Amplitude-scroller2._height) {
 scroller2._y = scroller2Amplitude-scroller2._height;
}
if (this.textfield1._y<textfield1Amplitude) {
 this.textfield1._y = textfield1Amplitude;
}
};



Часовой пояс GMT +4, время: 13:34.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.