Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Total Number Of Lines In Textfield?



Hi there,
Is there a way to get the total number of lines from a textfield? (including the ones that are not visible and need to be scrolled)



Ultrashock Forums > Flash > ActionScript
Posted on: 2004-04-02


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

How To Find Number Of Lines Of Dynamic Text...and How Many Lines In Textfield
is there any way of finding out how many characters will fit in a dynamic textfield?

I have a textfield that is dynamically loaded with text. Sometimes the text is long and i need scroll buttons, but when the text is short i would like not display the scroll buttons.

How can i figure out if text is short enough not to display the scroll buttons?

oh..to make it even more complicated; the font of the text is not always the same. I use textformatting to display header-like lines in the textfield.

Get Total Lines In Dynamic Textfield?
hey everyone...
I've created a scroller for a dynamic text field... I'd like to set it's visibility to true or false depending on whether or not there is a certain number of lines...
something like:

if( totalLines < x){
scroller._visibile=false;
}

how do I get the total number of lines?

As always... thanks for any help.

Total Amount Of Lines In Textfield?
Im i being a spoon here?is there a way you can find out how many lines of text there are in a dynamic textfield?I would like to display some buttons to scroll up and down but only if there is an overflow on my textfield.Is this pos?
Thanks

TextField - Number Of Lines, Number Of Characters
Hello,

I'm trying to get some insight on the textField object in flash.

I know how to get the textfield length and number of characters. But I need to know more.

Is there a way to get the number of characters on a line in a multiline textfield?

Thank you in advance.

Number Of Lines In A Textfield
Hi all

Seem to have gone a bit dumb tonight. Anyone know how to get the number of lines in a textfield?

Cheers

Dan

Get Number Of Lines In Dynamic Textfield
Hi there guys,

I made a textfield which loads it's content from a textfile, this text can vary in length. Below this textfield I'd like to display a button in a movieclip that always has the same distance from the bottomline of the text.

Can I detect over how many lines the text is wrapped in a dynamic textfield?

Greets

Count Number Of Lines In Textfield?
Is it possible to count the number of lines in a textfield? This because I want to change the border I made around the textfield and give it the same height (1 line -> graphic of 20px, 2 lines, graphic of 40px )

Limit Number Of Lines In A Textfield
Hi there!

i need to limit the number of lines in a text field... Can any one help?

I know how to limit the number of characters, but that's no good. I need to limit the text field so that it prints in 2 pages. First I just counted the number of chars, but someone could insert several returns, the max number of chars would not be reached but it would still not fit in the printed page.

Thanx!!

Textfield Number Of Visible Lines
Hey all,

short question: is there a way to easily find the number of visible lines in a multiline Textfield?

Thanks for any help!
Jay

TextField Maximum Number Of Lines
My AS class is creating dynamic TextFields that word-wrap with multiline. Some of the text that goes in these TextFields is rather long, so I'd like to limit the maximum number of lines that the TextField can have. Is there an easy way to do this?

Best Way To Count The Number Of Lines In A TextField
I have a TextField being created and populated at runtime. How can I go about getting the number of lines of text it contains? I have wrapping turned off if that helps.

Detect Number Of Lines In Dynamic Textfield
I've been trying to detect the number of lines used in a dynamic textfield without any luck. I have tried using the scroll property of a field which didn't work (Find my attempt attached) Does anyone have any suggestions?

Thanks.

Detect Number Of Lines In Dynamic Textfield
I've been trying to detect the number of lines used in a dynamic textfield without any luck. I have tried using the scroll property of a field which didn't work (Find my attempt attached) Does anyone have any suggestions?

Thanks.

Determining The Number Of Lines Of Text In A Dynamic Textfield?
Hi folks,

Is it possible to determine the number of lines in a dynamic textfield?

I'm importing xml on the fly and want to be able to determine the size of the textfield or number of lines of text imported. If Flash can determine .scroll and .maxscroll then it must know the number of lines of text. How do I access this?

Any ideas?
Thanking you

DM

Dynamicaly Setting Number Of Lines / Height Of A Textfield?
Hi,

is there a way to dynamicaly set the number of lines in a textbox. I've made a scrolling function that scrolls the clip the text is in and not the textbox itself. Thsi way the scrolling is much smoother. Now ofcourse, I have to set the number of lines (or height) of the textbox dynamicaly.

Is there a way tro do this?

cYa

Ivo

Determine Number Of Lines In A Textfield Before 'maxscroll' Has Changed ?
Hi there,

I'm trying to determine the number of lines of text in the (dynamic)textfield before the 'maxscroll' value has changed or the textfield is full.
Normaly you would determine the lines of text by adding up the 'maxscroll' value with the number of ('possible') lines in the textfield, right?
But how to determine the number of lines any time? Character width is variable so... Any suggestions?

ThanX, cYa.

If Between Total Number
i'm having a syntax issue with:

CODEif (_root.total >== 125 AND _root.total < 200) {
    message = "Congradulations, you won a sleeve of golf balls";
} else if (_root.total >== 200 AND _root.total < 400) {
    message = "Congradulations, you won a t-shirt.";
} else if (_root.total >== 400) {
    message = "Congradulations, you won a golf shirt";
}

Get Total Number Of Frames In Mc
I know I have seen the code for this but I can never find what I want when it becomes relevent .
I need to, in ActionScript, get the number of the frame that a running movieclip is on so that I can compare it with total frames. Thanks for posting if you know this code.

Total Number Of Children
Can anyone please help me find the total number of children in an AS2.0 movie clip?

I can do this in AS3.0 like so:

Code:
for(var i:uint=0;i<mc.numChildren;i++){
trace("instance: " + i + " named " + mc.getChildAt(i).name );
trace("instance: " + i + " total frames" + mc.getChildAt(i).totalFrames );
}
I don't know the instance names of the children b/c i will not have access to the swf i am loading (user uploaded)

So i need to be able to loop through all mcs at the root level and poll each for totalframe property

any help would be so awesome!
thanking you

Combobox: Get Number Of Total Items
hi there,

i need how to get the total number of items in a combobox. already tried it with
Code:
combobox.length;
but it doesn't work.

i use MX prof. 2004, but need it to work for FP 6, AS 1.

anybody got an idea?

cu
eve

Count The Total Number Of Children
I recently made a post similar to this one with little response or help so maybe someone can tell me this:

How do you count number of children in a AS2.0 movie clip?

in AS3 ==> var totalChildren = mc.numChildren;

i would like to be able to target each child but if you could at least tell me how to find the total number of children, that would be one step closer

thanks

Total Number Of MovieClips On Stage
How can I find out the total number of MovieClips on stage at any one time?

I've just had to optimise a tile based scrolling game by ripping clips off and on the stage as it scrolls. I could have used gotoAndStop scrolling but I was hoping I could try clip ripping first (reorganising my entire library wouldn't keep me on schedule) - so far the overhead has been drastically reduced.

But I want to be double sure there aren't any MCs lurking (implementing this is producing rarely occuring bugs), how can I get the number of clips attached?

Find Total Number Of File In A Folder
Is there any way for flash to find out the total number of file in a specific folder?

Something like i have a folder with many jpeg file, i wanna my flash movie to know how many jpeg are there in total, possible?

chup

Using Flash To Get The Total Number Of File In Ext Folder
I understand that is is possible for php (or any other server script) to get the total number of file in a specific folder.

But is it possible to do this in flash alone?
I'm trying to make a standalone exe in a non-server enviroment. Any work around on this?

Thanks
chup

Generating A Random Number Between 1-20 And Keeping A Total
I'm trying to make a kids score board where there are 20 icons all with scores behind them between 1 and 20 and a kid chooses an icon, clicks on it to reveal their score, thenthe score is added to their teams running total at the bottom of the window. (There are 2 teams)

The thing i have a problem with is generating the random numbers and also where exactly to drop in the actionscript in the timeline.
I've tried different variations of the Math.Floor(Math.Random) but i cant seem to get it to produce the numbers i want!!!!

Unfortunatly i cant upload what i have been working on as i dont have net access on my work pc.

Can anyone help? I'm really confused on this one.

Finding Total Number Of Frames In A Movie Clip
im loading random movieclips from an external folder into an emptymc,
i need a way to get flash to tell me the number of frames in the random clip that has been loaded.

this is what i'm trying to use now to give me a random #, within the # of frames loaded
Code:

Code:
var rNum = Math.round(Math.random(emptymc1,_totalframes))
the clips im using have 90-100 frames, but the number im getting is either 1 or 0

does anyone have any idea what's wrong?

Count The Total Number Of Children At The Root Level
Can anyone please help me find the total number of children in an AS2.0 movie clip?

I don't know the instance names of the children b/c i will not have access to the swf i am loading (user uploaded)

So i need to be able to loop through all mcs at the root level and poll each for totalframe property

any help would be so awesome!
thanking you

Current And Number Of Total Frames In Dynamic Text
At the moment I'm making a presentation for school in Flash MX 2004. I want some kind of progression bar in the presentation. This is how I have it in my mind:

2/15

2 is the current frame and 15 is the total number of frames. I know I have to do this with the use of ActionScript in combination with dynamic text labels. How can I read out the current frame number and the total number of frames?

The names of the dynamic text labels are:

"cFrame" and "tFrames"

Current And Number Of Total Frames In Dynamic Text
At the moment I'm making a presentation for school in Flash MX 2004. I want some kind of progression bar in the presentation. This is how I have it in my mind:

2/15

2 is the current frame and 15 is the total number of frames. I know I have to do this with the use of ActionScript in combination with dynamic text labels. How can I read out the current frame number and the total number of frames?

The names of the dynamic text labels are:

"cFrame" and "tFrames"

Trying To Click A Button And Make The Number Variables I Assigned Add Up In The Total
Hello all,

I received help with this when I coded it in 2.0 but need to move it to 3.0. Would appreciate any help at all. I am trying to click a button and make the number variables I assigned add up in the total txt field.

The 2.0 file delivers correctly but my 3.0 tells me I am not returning anything. Extremely new to AS3.0 but a complete believer.

Thanks everyone find files attached.

Number Of Lines
Hi
is it posible to get the number of lines from a dynamic or input text field?

thank's

Che

Working Out Number Of Lines
Hi,

I am trying to work out number of lines of text various HTML text takes as I need to position the screen accordingly.

So I have a plain html textbox postioned of screen one line in size and multiline property also using the same width and the correct font. This box is called text_max.


In the code I assign this box the text I wish to work out


Code:

text_max = eval("question_"+text_count);
text_max.scroll = "999999";
var line_count = text_max.scroll;




which works great however when question has some italic tags in it calculates the number of lines incorrectly usually adds 1 but this is not consistent.

Does anyone know a fix????

Counting No. Number Of Lines
Flash MX 2004
Actionscript 2

Hi I've got a dynamic text box. The content may sometimes exceed the size of the text box so it needs to become scrollable when the number of characters or lines exceeds a certain amount. When there is too much content it will send the timeline to a frame which has a scrollable text box. This is because most of the pages will not be scrolling and i dont want a scrollbar when its not required.

So, I was thinking of just counting the number of characters in the dynamic variable and if this was greater than a certain number it would perform a function. But what if the user inputs line breaks? This wont add any more characters but will affect the number of lines. So my question is how do I calculate whether or not my text box has more lines than it can hold?

1 - Do i do this by a character count from the variable? Problem with this is how do i recognise line breaks?
2 - Is there a way to calculate how many lines there are from the variable? If the text box can hold 15 lines for example then if there are more than 16 lines it needs to send the timeline to a different frame. But wouldnt I have to set an average character count for each line. This is never exact is it because some letters are wider than others.
3 - Is there a way to calculate how many lines are being used once the variable has loaded into the text box?

Many thanks

M

Number Of Lines In A Text Box
can you read the amount of lines of text in a dynamic text box when the the amount of lines is less than the hight the of the text box in lines

Limit Number Of Lines
I know how to limit the number of characters that a user can input, but is there a way to limit the number of lines that a user can input into a textbox.

Number Of Text Lines?
Hi,

I'm loading a few bits of text into a dynamic textbox and I want to know if it's possible to find out the number of lines its taking up. Using the height of the textbox isn't an option as the text varies all the time.

Any ideas?

Getting The Number Of Lines In A Textbox With Actionscript
i need to know wether it's possible to get the number of lines in a textbox with actionscript. i am hoping that there is a property similar to .scroll or .maxscroll, that returns a number.

please anybody help me
thanks in advance

-marco treven

Number Of Lines In Dynamic Text
I want to have a dynamic text box that is sized to the length of the text.

Since I know that the font is 12 pixels and by default has 14 pixel line spacing, I can take the number of lines and multiply by 14 to get the height in pixels.

myBox._height = numLines * 14;

What I need to know is how to find out the number of lines that are imported in the dynamic text.

I found out that on average, a full line of text contains 47 characters, BUT not every line is full so I end up not getting the right number of lines when I devide the length of the string by 47.

numLines = length(myString) / 47;

I need a new numLines equation! :P

Thanks!

Number Of Lines In A Text Field
Is there a way to get the number of lines a multi line text field has? It is a dynamic text field, and I need the number of lines of text has been outputted to it. I assumed it would be a property of textfield, but it's not. Thanks.

Count Number Of Lines In A Text Box
Hi, i have a tet boxy dynamically populated from an xml file with html
I need to know how many lines of text there are so that i can make the text box resize to fit all in

Thanks

How To Revers A Number Of Lines From Down2up ?
hi

if i have this text


Code:
this text have
a four line
and i want to
revers it.


i want the text show like this


Code:
revers it.
and i want to
a four line
this text have


thanx

InputText - Way To Limit Number Of Lines
Is there a way to limit the number of lines that a user can type into in a input text field -if multiline is selected then the user can pretty much type for ever - can this be limited to let's say 3 lines. Also can the letting (the space between the lines of text) be changed to tighten up the text that's input.
Thanks.

Counting The Number Of Lines From Txt File
Can you please help me with a problem?
I need to count the number of lines that exists in a txt file, from wich I load some content. I think I need to escape the content of the txt to be able to read the "/n", to count them and to have them displayed as variable (for example t_linenumber=...?)

Maximum Number Of Actionscript Lines
Hey guys.
Does anyone know what the maximum number of lines of actionscript possible in one frame is? Ive got around 1274 and every time I run flash it crashes. When I remove a few lines of script, it works fine. Even if the script in question isnt run at all.

The only possibility i can think of is flash doesnt like lots of lines of script.

help appriciated
~TheWaste

edit: also, could be a maximum number of if statements or something... im not sure

How Do I Extract X Number Of Lines From A Text Box?
I have a text box with text in.

Can someone tell me how I extract X number of lines?
I've been through the help files and can't see how this can be done.

Thanks.


OM

Maximum Number Of Lines Of Code
Hello all,

I've been creating a huge code for something I've been working on and somewhere between 1000 and 10000 (I did a "copy/paste" so I'm not sure of the limit) the code just stopped working (and there's no error on it)

Does actionscript 2.0 has a limit of code lines? Does actionscript 3.0 has it as well?

Tnx in advance
Keish

Number Of Text Field Lines
I am loading some text into a multiline size defined text field. How can I, after I load the text, get the number of lines that the text field has ?

Limit Number Of Lines In An Input Box
This might go in actionscript, but its a question I have about input text boxes. I need to limit the text to 2 lines, not characters.

Thanks in advance
Eric

PS I have looked a little, and used my very tiny bit of actionscript knowlege but I have no idea where to even start.

Copyright © 2005-08 www.BigResource.com, All rights reserved