all groups > flash (macromedia) > january 2004 >
You're in the

flash (macromedia)

group:

Importing text MX


Importing text MX PEKA
1/11/2004 8:45:19 PM
flash (macromedia):
Hi,

I am very new to Flash and i am trying to import a .txt doc into a dynamic text box. I think i do exactly as in the manual but i still get "Error importing". I have tried to move the doc to c:\ with no success.

I have used the notepad.

1. Created a dynamic textbox, multiline and named it.
2. Created a keyframe
3. used the loadVariables in "Normal" mode and included "Info.txt"

Any idea what is wrong?

Sorry for asking such basic questions.

Cheers


Re: Importing text MX pazzoboy
1/11/2004 9:53:09 PM
1. Create dynamic textbox, multiline. Don't give it an instance name. There is an input Field in the property inspector called "var". In that Field, type myText.
2. In the first frame of your main timeline, put this actionscript:

loadVariablesNum("info.txt",0);

3. At the beginning of the first line of your info.txt file, type this:

myText=


4. Whatever follows myText= will show up in your dynamic textbox. The "var" (myText) is what flash looks for.

Oh, remember to make your dynamic textbox font color different than your movie's background color!

Re: Importing text MX PEKA
1/12/2004 10:06:10 PM
Thanks pazzoboy, it finally worked and i know what i did wrong.

Unfortunately now i have another issue with the characters.

When i write the following direct into a text field, "Båten är blå" (The boat is blue in Swedish) it is OK. When i try to import the text from the file Flash changes the "å" and "ä" characters to boxes.

Anyone have any idea what is wrong?

Cheers

Re: Importing text MX PEKA
1/14/2004 7:39:50 PM
bump

AddThis Social Bookmark Button