flash set scroll
- Started
- Last post
- 15 Responses
- v3nt
is it possible to earch for a word in flash textbox and set the scroll so the found word goes to the top? looked on ultrashk and we but can't find anything. cheers.
- Engage0
you could probably do something where you add the text to a text box and with each word added save the number of lines in an array... so when you want to high-light it you scroll to the line...
nice little project for you... (there probably is a super simple command for it after all that)
- v3nt0
cheers engage. is there a find line/getline command in flash?
its basically a similar system as html anchors i'm after; http://thegoodbyeplot.com/flash/…
so when you click on the title it will scroll to that article...
- Bottlerocket0
Are the line heights constant? If so, knowing the line number the word is on will give you the depth you need to move the text box
- Engage0
a number of ways you could do it... if you set the text box to autosize... you can find the height of the textbox and if you keep track on when the height changes you can in effect know the height of the text on that line... so could make a text block with all sizes in it.
- v3nt0
that's pretty much what i'm stuck on - how do i get the line number? then i could use Mr .scroll
- v3nt0
mmm, i get it. so i create a txt box with same width and settings as the scrolling on, keep it off stage and count howmany lines it has + spacer lines - why, i think it migh, jus mt work! cheers guys - will post results.
- joyride0
how are you populating the scrollBox? You could put all the lines of the scrollBox into an object and search through the object one line at a time to get the line number. Then when you find your match in the object you can figure out the line number... right?
- Engage0
not sure you can get the line number... might be wrong?
- joyride0
errr... forget it, i reread and see its a text box not list box like i was thinking.... where's my coffee..
- Engage0
it wouldbe handy though adobromedia
- v3nt0
yeh - it seems like you can't get the line number of a word. but i\ve nearly got it!
- Engage0
or do it like this... the hard way!
- v3nt0
now you're just showing off! did you count the chars for that? pretty cool.
- Engage0
nah was all faked