CS2AS is a utility that converts C# 3.5 code into ActionScript 3.0 code.
CS2AS has been deprecated and replaced by
CS2HX - C# to haXe converter
. Since haXe can export to ActionScript, this accomplishes the same goals as CS2AS but gains the additional flexibility provided by the haXe compiler.
CS2AS is designed for situations where you need to share code/logic between an in-browser Flash/Flex RIA and a back-end service.
The utility will parse your raw C# source files and output raw ActionScript source files. As C# and ActionScript are very similar languages in many ways, the code that comes out looks remarkably similar to the code going in, which makes debugging and profling
How do I use CS2AS?
for a guide on how to get started.
Of course, there are limitations. C# supports a lot of features that ActionScript does not, so there are some things that won't be supported at all such as: yield, unsafe code, operator overloads, multi-threading, etc.
However, even with the limitations it's still very possible to write quality C# code that can be shared across both environments. Linq, lambda, generics and OOP are supported.
Further, CS2AS will transform your code to support some C# features that ActionScript does not support, such as partial classes, extension methods, nullable types, static constructors, and using blocks.
Please see the
for a detailed analysis of what is and is not supported.