Is there any way to dynamically generate an swf file?
Or insert variables after it's "compiled" to swf?
Or insert variables to the fla and then compile it to swf?
(I'm using flash lite 1.1 (and the flash is set to background) so i can't read anything from outside the swf file, that's why i need this)
(I'd like to do this using java (but any other programming language is ok).)
There are a couple of libraries out there, but as I stated in the comment above, you'll need to be very careful to only use features that are supported in Flash Lite 1.1 (which is a very limited subset of what these libraries can do). However, they do target the correct virtual machine version (AVM1) - so some basic ActionScript manipulation will work.
Java/SWF Older, looks abandoned, but seems to be highly linked to.
TransformSWF More modern, support FP7 so you'll have to be careful with which features you use.