tags:

views:

776

answers:

2

Hi - I'd like to know if it's possible to compile an .swf file at runtime via C# (would be called via a Flex Application). I've read some articles about using fsch.exe, but nothing that gave any concrete examples.

I'm fairly certain this is possible, so a secondary question is whether it's feasible on a medium scale. I'd like to allow users to configure an swf, and then compile those settings directly into the swf for delivery rather than relying on external data storage for holding configuration details.

Thanks in advance for any assistance you can offer -

Bill

A: 

You should be able to do this fairly simply using a command line compiler.

You need to be able to setup the compiler on your server. http://www.google.com.au/search?hl=en&q=swf+command+line+compiler&btnG=Search&meta=

In your C# code you can then execute a shell command to invoke your compiler. http://www.google.com.au/search?hl=en&q=execute+command+shell+asp+.net&btnG=Search&meta=

One thing to be careful with is waiting for the compiler to finish before attempting to retrieve the compiled file. You will need to process the response from the compiler and ensure that the compilation succeeded.

I don't see why this wouldn't be feasible on a medium scale.

cbp
+1  A: 

You can try MTASC.. it's command line based ActionScript compiler so you can just use Process.Start to call it and then use the Process.WaitForExit method to wait until it finishes compiling

chakrit