Search code examples
flashactionscript-3filereference

How to load user's file in Flash?


I would like to load a user's file right after the app is inicialized. I have this code:

fll = new FileReference();          
fll.browse([new FileFilter("Text *.txt", "*.txt")]);

It works fine when some button is pressed, but when i just put it inside the frame's code, it doesnt work. How can i do it?


Solution

  • This function works only on user interaction (mouse click, key press etc) for security reasons, so it won't work when you paste it in regular frame script.