PDA

View Full Version : Import Text Into Flash


figidigi
12-10-2003, 02:54 PM
Hi There,

__________________________________________________ _

I work with flash 5, know the basics of flash and studying actionscript right now.

I need a step by step tutorial on how to import a text-file into flash and displaying it with the font and colours I want.
I know I need action script to do it; ---- loadVariablesNum ("info.txt", 0); ---- and so on...
but I can't get it to work so I miss a few things.

extra; I only need 1 textfield for display, no difficult things.

Hope somebody can help me out?
[and remember, I am only beginning with actionscript... have just bought 2 books though)

Thanx.
__________________________________________________ _
Figidigi

pellepiano
12-10-2003, 03:00 PM
The code you have..
loadVariablesNum ("info.txt", 0);
....willm oa the contents of your textfile into _level0 of the Flash player ( where the main swf is loaded.

The textfile should contain a variable(s) and its value ( text in this case ) like....

news=This is todays news bla bla&news2=Tomorrow is another day...

If you have given your dynamic textfield the variable name of news ( and if its present in the main timeline it would display what is in the variable news.

To combine the textfiles two variables into the single textfield you can for instance have this code on a button ...

on(release){
news=news+news2
}
}

figidigi
12-11-2003, 05:09 AM
Hi PellPiano,

.... and it WORKS!!!
I printed your notes, then took my book to read and see the
info on variables and text + values.
I filled it in and it worked in 1 time! Never did before. Most of the time the things people write as tips they left out a few steps, so it still doensn't work. But using my book and your notes it worked great.
Thanx!

ps:
with the last phrase "To combine the textfiles" do you mean to combine 2 textfiles into 1 FlashTextArea????
So next to the flash-coding, I have news.txt + news2.txt ???

davidgarrett
10-13-2008, 12:01 AM
Hi - I have about 100 pages of text I need to import into a Flash file. The end product is kind of like karaoke - or like super subtitles.

I need a script to import the text, keeping all the formatting (font, color & size). The script needs to be able to create new Key Frames at specified places, and put text in 4 distinct layers in each key frame. Each layer needs to put the text i a specific place within the frame.

If anyone is interested in developing this for me, or can point me in the right direction, I'd appreciate it. Email me at davidgarrett shift+2 gmail.com.

Thanks,
Dave