-
[RESOLVED] Counting characters or lines in text fields..
I have an area of my website where there is a persons name, which is pulled from a variable into a dynamic text box.
Under that name, i have a list of links.
The problem that i'm having, is that if the persons name is very long, and the dynamic text box wraps the last name to the second line. This is fine, except that the text now is on top of the links that are below it.
Is there any way that I can count the number of letters in a variable? or any way that flash can detect how many lines there are after the wrapping is done?
I want to do something like this, given that a name with more than 20 character would cause it to wrap..
Code:
if(Number of characters>20){
linklist._y = (linklist._y +40);
}
.. or the same thing for the number of lines after wrapping is done in the text box.
This would let the links move themselves if the text ends up wrapping.
Can anybody help me?
-
Ximensions.com
You can get the number of characters by using the string.length property.
So
code:
name = "char"
numchar = name.length //returns 4
You could set the text field not to wrap, alternatively.
Last edited by Sul; 01-02-2007 at 07:22 PM.
-
Thanks a bunch!
Yet another hurdle overcome 8)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|