Flash Script – Load a Text File Into Flash


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.

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

No Reader comments

Comments on this post are closed.