AS3.0 TextField Mouse Scroll
This is a question about textfield mouse scrolling
I have multiple lines of text in a textfield of constant size.
If the number of lines of text exceeds the range of the text field
I can not scroll above the text title, but only I can scroll in the empty space next to the text title
Can you please tell me how to make the text scrollable above the title?
Thank you so much
completed => Music Played List
sm => Music List
n => Muic List Array Number
indexNo => Music Played Title Array Number
playedList => textField (Dynamic)
completedList();
var tHeight: Number;
function completedList(): void {
if (completed.length == 0) return;
var tx: String;
var addTx: String;
tHeight = playedList.textHeight;
var t2: Number = tHeight / 2;
var lines: uint = Math.floor((playedList.height - t2) / tHeight);
for (var i: uint = 0; i < completed.length; i++) {
tx = (i < 9) ? String(" " + (i + 1)) : String(i + 1);
tx = (i == 0) ? String(" " + (i + 1)) : tx;
addTx = tx + " - " + completed[i] + "\n";
playedList.appendText(addTx);
if (playedList.numLines > lines) {
playedList.scrollV++;
}
}
if (playedList.numLines > lines) {
playedList.border = true;
playedList.borderColor = 0x003366;
}
playedList.addEventListener(MouseEvent.CLICK, selectTextFieldLine);
this.addChild(playedList);
}
function selectTextFieldLine(e: MouseEvent): void {
var index: uint = playedList.getLineIndexAtPoint(e.localX, e.localY - (tHeight / 2 / 2));
if (index >= (playedList.numLines - 1)) return;
if ((index != -1) && (indexNo[index] != n)) {
n = indexNo[index];
musicPlay(sm[n]);
}
}
