> i've created a .txt and placed it on a webserver with the text in
> a format i
> want director to read as a list
> here is what is on my .txt document.
>
> basic = [#Model:"Basic Computer",#Processor:"Quite
> Fast",#Motherboard:"Small"]
>
> Now i don't know if this is correct but i want director to downlaod this
> file and then i want to put values into different text boxes on my stage.
>
> i am getting the text file with this lingo:
>
> on mouseUp me
> netOpID=getNetText ("http//url/data.txt")
> displaysInfo = netTextResult( netOpID )
>
> end
>
> But how do i script this so that it will put say"basic computer"
> into a text
> area on the stage and "quite fast" into another text area with just one
> click of a button.
The first thing I'd suggest is that you need to treat net ops as
asynchronous - you can't ask for a file from the web and expect it to be
there within a millisecond of requesting it. Store the netOpID like you are,
but check it against netDone() periodically - in an exitFrame/stepFrame
handler perhaps. Once the netDone returns TRUE, check netError() to make
sure it worked, then netTextResult() to get the text you downloaded.
If you rewrite the file as
[#Model:"Basic Computer",#Processor:"Quite Fast",#Motherboard:"Small"]
(without the 'basic = ' part), then you can use director's value() function
to turn the text into a property list which you can then treat as regular
name/value pairs to get the info out of it that you want. The limitation
with this is that you will only be able to put in one list per text file,
else the value() will barf.
An alternative is to structure the info in the text file by breaking it up
in a known way and checking for delimiters, line counts, or some other
offsettable character that you can scan for and retrieve the necessary info.
You might even look at xml.
HTH,
-Sean.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]