I found a .Net dll named SWFDotnet using which we can generate flash files on the fly. I have not tried it yet. I hope I can do something with that.