Flash Script – Load a Text File Into Flash

Tweet


type = 'application/x-shockwave-flash'
data = 'http://sitepointstatic.com/flash/loadtext.swf'
width = '400'
height = '400'
bgcolor = 'black'
>

Download the sample files here.

1. Create two textfields. Name the first "text1", and second "text2".

2. Open notepad or any other text editing software, and enter the text below:

text1=This is text1 

And:

text2=This is text2 

3. Go to Flash, and in the current layer frame insert the action:

loadVariablesNum ("text.txt", 0); 

4. That’s it! Press ctrl+enter to test the movie.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

No Reader comments