-
simple load text question, i hope
I am loading random quotes into a text field by aplying the following code onto Frame 1 of my movie:
//
stop();
var word = new Array("quotes here",
"quotes here",
"quotes here");
var randomWord = Math.floor(Math.random()*36);
_root.text = _root.word[randomWord];
//
I would like to know how to load the random quotes from an external text file. And how do you set up the arrays in the text file?
I'd also like to know if you can apply HTML tags to the text.
***I'd like a page break between the quote and the author's name.
If you can help, I'll love you for it.
-
for page breaks you can just use this : "\n"
as for dynamically loading text:
this is what your file will look like:
quote0=blahblah blah&;quote1=blah blah blah&;quote2=blah blah blah
minus the semicolon....sorry
so, you can load them like this
loadVariablesNum("data.txt", 0);
and call them like this:
var randomWord = Math.floor(Math.random()*36);
_root.text = _root["quote" + randomWord];
Last edited by norie40; 07-02-2003 at 12:47 PM.
-
I'm still getting a blank text box. Is there a problem with my .txt file?
This is an example of the first two entries I have in the .txt file:
quote0=Quote is written here.&
quote1=Second quote goes here.
Last edited by lell69; 07-02-2003 at 03:39 PM.
-
I'm still getting a blank text box. Is there a problem with my .txt file?
This is an example of the first two entries I have in the .txt file:
quote0=Quote is written here.&
quote1=Second quote goes here.
-
Hi,
your text file should look like
"e0=there is always a flash around
"e1=never lose your keys outside and lock yourself into the car
"e3=
Also, make sure to call the random thing only after the textfile has really loaded
Musicman
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
|