all groups > flash actionscript > february 2007 >
You're in the

flash actionscript

group:

Loading from a text file


Re: Loading from a text file DMennenoh **AdobeCommunityExpert**
2/21/2007 3:34:13 PM
flash actionscript:
[quoted text, click to view]

This would be much better handled by using a database vs a simple text file.


--
Dave -
Head Developer
www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

Loading from a text file rc3rdmd
2/21/2007 6:24:21 PM
Is there a way I can load part of a text file - using keywords or even by line number ?

Thanks.


Re: Loading from a text file SymTsb
2/21/2007 6:31:09 PM
The only thing I can think of would be to load the text and then pull apart
that text file into multiple arrays. Then you could set the text of the
textfield to an array element and increment it the same way.
Re: Loading from a text file Rothrock
2/21/2007 6:57:47 PM
So the answer is no, not with Flash itself.

You could have some kind of server side database that would provide only the
parts of text you need in response to a query.

If you need to pull things apart or use just parts you might want to look into
the XML class.

In general, text loading is pretty quick. If the text is so big that you don't
want to load all of it, you should rethink whatever strategy you are
contemplating.
Re: Loading from a text file rc3rdmd
2/21/2007 7:24:43 PM
I'm trying to create a glossary, when the user clicks on a certain word, the definition is loaded from a text file that contains all the definitions.

Thanks.

Re: Loading from a text file rc3rdmd
2/22/2007 3:16:28 PM
Is there a sample file or documentation showing how Flash interacts with a database ?

Or better yet, any examples of glossaries built with Flash ?

Thanks.


Re: Loading from a text file Rothrock
2/22/2007 5:42:42 PM
It also really depends upon how large this glossary is. I'm jut guessing, but
it is definitions for maybe less than 100 words and maybe in the 100-200k range
it could be just fine to load the whole thing.

Of course it also depends upon how often it will be accessed and what kind of
delivery/bandwidth you are planning.

But it all really depends upon what you are trying to accomplish.
Re: Loading from a text file SymTsb
2/22/2007 7:52:46 PM
Re: Loading from a text file SymTsb
2/23/2007 12:00:00 AM
To do it as you specify it would require 26 folders. each folder is obviously
one letter. one file for each word to hold the definition and then another
file that would hold the list. That's the simplest way to do it the way you
desire.
Re: Loading from a text file rc3rdmd
2/23/2007 12:00:00 AM
I might as well just hard-code it - put all the info. in the Flash file !

In Authorware I would just read in the file and do something like << myText =
(LineX, externalFile).

There's nothing like that in Flash ?


Re: Loading from a text file rc3rdmd
2/23/2007 12:17:00 AM
I am trying to create a glossary in Flash. About 300 words. The user can
click on a letter of the alphabet and words starting with that letter will
appear. Then the user clicks on a word and the definition appears.

I just wanted the words and definitions read from an external file.


Re: Loading from a text file Rothrock
2/23/2007 5:46:58 AM
I don't know. For the simplicity, I would probably be tempted to just go with
it as one file. Have you put it all together to see how big the file is?

Also I would definitely recommend doing it with XML.
Re: Loading from a text file rc3rdmd
2/23/2007 5:03:31 PM
I can load a file with the "A" words into an html.text field and using the
asFunction I can click on each word and pass a unique variable to a function.

But how do I retrieve the correct definition from say an .xml file ?

I have studied the .xml tutorial on gotoAndLearn.

Rob Childress
AddThis Social Bookmark Button