Skip to main content
Inspiring
Jun 11, 2023 9:31 AM UTC
Answered

AS3, TextField Auto Scroll

As a beginner, I often ask questions.


I have a textfield with over 1000 music lists,
Only about 20 lines are shown in the textfield.
Is there a way to display the randomly selected music in the center of the textfield y-coordinate (or the 10th row)?
I would appreciate it if you could post the sample code to me.

 

for (var i: uint = 0;  i < sm.length;  i++)  {
	musicList.appendText(sm[i]+"\n");
}
var n: uint = int(Math.random() * (sm.length - 1));
musicPlay(sm[n]);
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
Jun 11, 2023 1:39 PM UTC

yes,

 


musicList.scrollV = Math.max(0,n-9);

3 replies

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
Jun 11, 2023 1:39 PM UTC

yes,

 


musicList.scrollV = Math.max(0,n-9);

Translate
Inspiring
Jun 11, 2023 2:48 PM UTC

Wow... you are awesome.
Thank you so much.

Translate
kglad
Community Expert
Community Expert
Jun 11, 2023 2:49 PM UTC

you're welcome 

Translate