all groups > flash actionscript > july 2004 >
You're in the

flash actionscript

group:

Count line number of txt file???


Count line number of txt file??? ivan ooze
7/18/2004 7:53:46 PM
flash actionscript:
hi everybody, i used flash mx 2004 and i got a problem.
I have two dynamic text, where the variables are: "dial" and "line" .
I had this code in frame 1:
loadVariablesNum("text.txt", 0, "GET");
var line = Number(dial.scroll)
But the line text is NaN, So I need your help.
What should i put in my code to count line number of "text.txt". I thank you
very much
Re: Count line number of txt file??? kglad
7/18/2004 8:23:52 PM
scroll is a textfield property, not a variable's property. and you won't get a
meaningful answer unless you wait until your text file has completed loading.
to remedy use:

loadVariablesNum("text.txt",0,"GET");
_level0.onData=function(){
tbox.text=_level0.yourVar; // where tbox is your textfield's instance name
and yourVar is your variable in text.txt
line=tbox.scroll; // is this what you want or maxscroll?
}
Re: Count line number of txt file??? Laiverd.COM
7/18/2004 10:07:38 PM
Dunno if you're trying to do something with the value of a variable in the
textfile, but if so, you have to wait for the variables to arrive before you
can deal with them in actions script. Just made a similar setup to what you
described (except for the textfile part) and it's working okay here. Maybe
elaborate a little.

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

Re: Count line number of txt file??? ivan ooze
7/19/2004 3:12:39 PM
thanks for your request, but i need more information, when you said:
tbox.text=_level0.yourVar; // where tbox is your textfield's instance name and
yourVar is your variable in text.txt
my variable in text.txt countained that dial=blabla so i remplaced yourVar
by "dial"
but my source don t work.
The line textfield write "undefined".
Re: Count line number of txt file??? ivan ooze
7/19/2004 11:25:42 PM
Re: Count line number of txt file??? kglad
7/20/2004 2:13:23 AM
attached to a frame you should have:

loadVariablesNum("text.txt",0,"GET");
_level0.onData=function(){
tbox.text=_level0.dial; // where tbox is your textfield's instance name and
dial is your variable in text.txt
line=tbox.scroll; // is this what you want or maxscroll?
}

if this isn't working you need to check that your textfield has instance name
(not variable) tbox.
Re: Count line number of txt file??? ivan ooze
7/20/2004 4:07:11 PM
hi kglad, I do what you said, now the "line" textfield show normally the
text.txt 's line number. But "line" textfield show 1 whereas my text file
countain more 5 lines.
What do i do?
(If you want and if you have the time i can send you the fla and the txt to
correct that :-) )

I thank you very much
just to refresh topic ivan ooze
7/20/2004 10:02:36 PM
Re: just to refresh topic kglad
7/21/2004 12:57:20 AM
well, tbox.scroll is going to be 1 when your text is assigned to your text. that's why i asked if you really wanted:

line=tbox.scroll

or did you really want

Re: just to refresh topic Dtads
7/21/2004 8:53:48 AM
Just wondering what is the purpose of this code, and what outcome are you expecting, i think that would help a little in trying solve your problem.
answer ivan ooze
7/21/2004 6:23:08 PM
I want "line=tbox.scroll" kglad.
Re: answer kglad
7/21/2004 9:08:25 PM
Re: answer ivan ooze
7/21/2004 10:49:20 PM
you don t understand I want to see how many line have text.txt in a dynamic text.
Re: answer kglad
7/22/2004 2:10:46 AM
AddThis Social Bookmark Button