Site icon

Flash to Silverlight: Zamboozal #2 : C#-,gt;AS2 Horrors: Don’t Do it!

Advertisements

In the past couple years I have done my share of AS3 work, but since I have so many unfinished game engines in AS2, I have maintained a good amount of work in that version of ActionScript because I already had a ton of work complete. However, my last Zamboozal project have changed my attitude.

For the recently finished Zamboozal Silverlight/Flash project, I decided to write the game in Silverlight/C# and then convert it back to ActionScript 2 in Flash. I thought this would take no longer than a few hours. At first, I was right. Because I had planned out my Silverlight object model to closely match how AS2 works, it was fairly easy to covert the C# code to AS2 and get a set of code that would compile. About 4 hours into the conversion process that was complete, and I was a happy boy.

Here are both games.

First, the Silverlight One:



 

…and the Flash version…

http://games.mochiads.com/c/g/8bitrocket-zamboozal-poker-dice/zamboozal_flash.swf

 

Getting to final Flash version was not easy. The problems arose when I tried to play the game for the first time. ActionScript 2 is so loosely-goosey with the language, that compilable code did not mean I had an application that worked at all. Coming from a Silverlight 2 C# project, which is both strongly typed and very strict about the code, this was a shock. In short, I can’t believe that I was living with while developing in AS2! Here are some of the major headaches that occurred while trying to convert the Silverlight App the Flash AS2:

There were many more issues with converting C# to AS2, but I think they would just get redundant. My real point here is this:t C#->AS2 conversions are too much of a headache to undertake, especially when AS3 is so much closer to C#. If you want to make projects that work in both Flash and Silverlight, AS3 is the only way to go.

Exit mobile version