Link to home
Start Free TrialLog in
Avatar of rexmor
rexmorFlag for Philippines

asked on

Getting the SCROLL position(index) of a specific word/text on a scrolling textfield

hi there...

Is it possible to know what's the scroll position on a specific word/text on a scrolling textfield.

i.e.

1. Scrolling text1 goes here...
Scrolling text1 goes here...
Scrolling text1 goes here...
Scrolling text1 goes here...
Scrolling text1 goes here...

2. Scrolling text2 goes here...
 Scrolling text2 goes here...
 Scrolling text2 goes here...


etc..

What I want is to search "2." and make it scroll on top. Help me how to do it.

thanks.
Avatar of hsmtp
hsmtp

Hi rexmor,

If you will assign text to textfield by parts, then you'll know this position. For example:

pos1 = 0;

myTextField.text += "Some \n text \n here";

pos2 = myTextField.textHeight;

myTextField.text += "Some \n other \n text \n here";

pos3 = myTextField.textHeight;


This way you'll get the position of the needed part of text and will be able to scroll there.
Avatar of rexmor

ASKER

So how could I get the scroll position of a textfield, I want to get the line number...

for example.

pos1 = 0;
myTextField.text += "1. The quick brown fox jumps over the lazy dog near the river bank The quick brown fox jumps over the lazy dog near the river bank ";
pos2 = myTextField.textHeight;


myTextField.text += "2. The quick brown fox jumps over the lazy dog near the river bank The quick brown fox jumps over the lazy dog near the river bank ";
pos3 = myTextField.textHeight;

myTextField.text += "3. The quick brown fox jumps over the lazy dog near the river bank The quick brown fox jumps over the lazy dog near the river bank ";
pos4 = myTextField.textHeight;

if I want the  message3, message2 etc...  will be on top of the scroll on a text field how will I do it. Please help.


thanks.
ASKER CERTIFIED SOLUTION
Avatar of hsmtp
hsmtp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rexmor

ASKER

ok, I understand your idea, so there's no way in flash to get what line number in a scrolling text without getting the LINE HEIGHT?
rexmor,

I don't think that there will be any other solution available.