-
/**
-
* by Saulo Brito
-
* http://www.weka.com.br
-
* http://creativecommons.org/licenses/by/2.5/br/
-
*/
-
-
// TextField dynamicField;
-
// MovieClip upArrow;
-
// MovieClip downArrow;
-
-
// dynamicField refers to a dynamic textfield placed on Stage
-
// upArrow and downArrow are the instance names of the scroll arrows
-
-
// if selectable property is set to true, the wheel button can scroll without aditional code
-
//dynamicField.selectable = false;
-
-
updateArrows();
-
-
Mouse.addListener(this);
-
function onMouseWheel(delta:Number,scrollTarget:Object) {
-
if(scrollTarget == dynamicField) {
-
if (!dynamicField.selectable) { // "manual" scrolling to non selectable texts
-
dynamicField.scroll -= delta;
-
}
-
updateArrows();
-
}
-
}
-
-
function updateArrows() {
-
if (dynamicField.scroll == 1) {
-
upArrow._visible = false;
-
}
-
else {
-
upArrow._visible = true;
-
}
-
if (dynamicField.scroll == dynamicField.maxscroll) {
-
downArrow._visible = false;
-
}
-
else {
-
downArrow._visible = true;
-
}
-
-
}
-
-
upArrow.onRelease = function() {
-
dynamicField.scroll–;
-
updateArrows();
-
}
-
downArrow.onRelease = function() {
-
dynamicField.scroll++;
-
updateArrows();
-
}