The book of inspiration

December 29, 2009

OrcasMetaWebService

Filed under: jsc — Tags: , , , , — zproxy @ 2:11 pm

Let’s build some muscle on jsc.

OrcasMetaWebService. Crosscompiled from C# to Java for Google App Engine and PHP.

The idea is that your little cute Web Service will be running on PHP and Google App Engine. See the C# source code used in this example over here.

  • See live example running on PHP.
  • See live example running on Google App Engine java

There are features missing. But you sure can see where it is going 🙂

PS. Video parameters “&w=800&h=500&fmt=18″

Update:

I had this idea to publish the web services via WSDL with HTTP Protocol. But it seems this scenario isn’t exactly supported by the big old Microsoft just yet. So the next step would be to implement xml-soap?

See also:

May 29, 2009

Using FLINT particle system from jsc

Filed under: jsc — Tags: , , , , , , — zproxy @ 6:00 pm
FLINT particle system

Moristar asked how to use an external libray from within a c# flash project. The short answer is yes you can, but you’d have to define stubs.

The long anwser…

In .net when you are talking to COM an interop assembly is used. The interop assembly defines types which represent the actual types to be used. That assembly is generated automatically at the time you reference the COM assembly.

It would be nice to be able to simply add a reference to a SWC file and use the features it defines, but currently it is not supported. A tool could be created which would read the SWC file and create the stub library. Currently this needs to be done manually.

Previous example

A year ago I did exactly this to get to use Google Maps with jsc. Today I updated its source to the latest Google Maps API version.

FlashGoogleMapsExample[source:svn]

In this post I am going to do this to demonstrate the same techniques for Flint and also comment on what I am doing.

(more…)

April 6, 2009

C# To ActionScript and Alchemy

Filed under: jsc — Tags: , , , — zproxy @ 7:14 pm

Some years ago I added some minimal C source code generation support to my jsc compiler. This time I decided to polish it up a little bit and see what would it look like to develop a flash application with alchemy in c#.

This example is a port from this Alchemy plasma experiment. I made it in c#, changed the color and added the jsc logo.

Overview

Writing code in c#? That’s plain crazy. To make it easier to comprehend – here is an overview diagram of what is really happening.

flashalchemy1

Hand written C# sourcecode

As you can see, there are multiple compilers doing the hard work so you could have that final flash binary file. The C# code that will be converted by jsc compiler looks like this:

   14 static int width;
   15     static int height;
   16
   17     static uint[] palette;
   18     static uint[] plasma;
   19     static uint[] newPlasma;
   20
   21
   22     static AS3_Val generatePlasma(object self, AS3_Val args)
   23     {
   24       AS3_h.AS3_ArrayValue(args, "IntType, IntType", __arglist(ref width, ref height));
   25
   26       palette = new uint[256];
   27       plasma = new uint[width * height];
   28       newPlasma = new uint[width * height];
   29
   30       for (var x = 0; x < 256; x++)
   31       {
   32         var b = (int)(128.0 + 128 * Math.Sin(Math.PI * x / 16.0));
   33         var g = (int)(128.0 + 128 * Math.Sin(Math.PI * x / 128.0));
   34         var r = 0;
   35
   36         uint color = (uint)(r << 16 | g << 8 | b);
   37
   38         color |= 0xff000000u;
   39
   40         palette[x] = color;
   41       }
   42
   43       int index = 0;
   44
   45       for (var x = 0; x < width; x++)
   46       {
   47         for (var y = 0; y < height; y++)
   48         {
   49           uint color = (uint)((
   50             128.0 + (128.0 * Math.Sin(x / 16.0)) +
   51             128.0 + (128.0 * Math.Sin(y / 8.0)) +
   52             128.0 + (128.0 * Math.Sin((x + y) / 16.0)) +
   53             128.0 + (128.0 * Math.Sin(math_h.sqrt(x * x + y * y) / 8.0))
   54           ) / 4);
   55
   56
   57           color |= 0xff000000u;
   58
   59           plasma[index++] = color;
   60         }
   61       }
   62
   63
   64       return AS3_h.AS3_Ptr(plasma);
   65     }
   66
   67     static AS3_Val shiftPlasma(object self, AS3_Val args)
   68     {
   69       var shift = 0;
   70       var index = 0;
   71
   72       AS3_h.AS3_ArrayValue(args, "IntType", __arglist( ref shift));
   73
   74       for (var x = 0; x < width; x++)
   75       {
   76         for (var y = 0; y < height; y++)
   77         {
   78           var paletteIndex = (int)( (uint)(plasma[index] + shift) % 256);
   79           newPlasma[index] = palette[paletteIndex];
   80           index++;
   81         }
   82       }
   83
   84       return AS3_h.AS3_Ptr(newPlasma);
   85     }

Generated C source code for Alchemy

After jsc compiler has converted it to asni c it will look like this:

   30
   31 int FlashPlasma_Alchemy_Program_width;
   32 int FlashPlasma_Alchemy_Program_height;
   33 unsigned int* FlashPlasma_Alchemy_Program_palette;
   34 unsigned int* FlashPlasma_Alchemy_Program_plasma;
   35 unsigned int* FlashPlasma_Alchemy_Program_newPlasma;
   36
   37 AS3_Val FlashPlasma_Alchemy_Program_generatePlasma(void* self, AS3_Val args)
   38 {
   39     int x;
   40     int b;
   41     int g;
   42     int r;
   43     unsigned int color;
   44     int index;
   45     int y;
   46
   47     AS3_ArrayValue((AS3_Val)args, (char*)"IntType, IntType", &FlashPlasma_Alchemy_Program_width, &FlashPlasma_Alchemy_Program_height);
   48     FlashPlasma_Alchemy_Program_palette = (unsigned int*) malloc(sizeof(unsigned int) * 256);
   49     FlashPlasma_Alchemy_Program_plasma = (unsigned int*) malloc(sizeof(unsigned int) * (FlashPlasma_Alchemy_Program_width * FlashPlasma_Alchemy_Program_height));
   50     FlashPlasma_Alchemy_Program_newPlasma = (unsigned int*) malloc(sizeof(unsigned int) * (FlashPlasma_Alchemy_Program_width * FlashPlasma_Alchemy_Program_height));
   51
   52     for (x = ((int)0); (x < 256); x++)
   53     {
   54         b = ((int)((signed int)((128 + (128 * FlashPlasma_Alchemy_BCLImplementation_System___Math_Sin((double)((3.14159265358979 * ((double)(x))) / 16)))))));
   55         g = ((int)((signed int)((128 + (128 * FlashPlasma_Alchemy_BCLImplementation_System___Math_Sin((double)((3.14159265358979 * ((double)(x))) / 128)))))));
   56         r = ((int)0);
   57         color = ((unsigned int)(((r << 16) | (g << 8)) | b));
   58         color = ((unsigned int)(color | -16777216));
   59         FlashPlasma_Alchemy_Program_palette[x] = color;
   60     }
   61
   62     index = ((int)0);
   63
   64     for (x = ((int)0); (x < FlashPlasma_Alchemy_Program_width); x++)
   65     {
   66
   67         for (y = ((int)0); (y < FlashPlasma_Alchemy_Program_height); y++)
   68         {
   69             color = ((unsigned int)((unsigned int)(((((((((128 + (128 * FlashPlasma_Alchemy_BCLImplementation_System___Math_Sin((double)(((double)(x)) / 16)))) + 128) + (128 * FlashPlasma_Alchemy_BCLImplementation_System___Math_Sin((double)(((double)(y)) / 8)))) + 128) + (128 * FlashPlasma_Alchemy_BCLImplementation_System___Math_Sin((double)(((double)((x + y))) / 16)))) + 128) + (128 * FlashPlasma_Alchemy_BCLImplementation_System___Math_Sin((double)(sqrt((double)((double)(((x * x) + (y * y))))) / 8)))) / 4))));
   70             color = ((unsigned int)(color | -16777216));
   71             FlashPlasma_Alchemy_Program_plasma[index++] = color;
   72         }
   73
   74     }
   75
   76     return  (AS3_Val)AS3_Ptr((void*)FlashPlasma_Alchemy_Program_plasma);
   77 }
   78
   79 AS3_Val FlashPlasma_Alchemy_Program_shiftPlasma(void* self, AS3_Val args)
   80 {
   81     int shift;
   82     int index;
   83     int x;
   84     int y;
   85     int paletteIndex;
   86
   87     shift = ((int)0);
   88     index = ((int)0);
   89     AS3_ArrayValue((AS3_Val)args, (char*)"IntType", &shift);
   90
   91     for (x = ((int)0); (x < FlashPlasma_Alchemy_Program_width); x++)
   92     {
   93
   94         for (y = ((int)0); (y < FlashPlasma_Alchemy_Program_height); y++)
   95         {
   96             paletteIndex = ((int)(((unsigned int)((((unsigned long)(FlashPlasma_Alchemy_Program_plasma[index])) + ((signed long)(shift))))) % 256));
   97             FlashPlasma_Alchemy_Program_newPlasma[index] = FlashPlasma_Alchemy_Program_palette[paletteIndex];
   98             index++;
   99         }
  100
  101     }
  102
  103     return  (AS3_Val)AS3_Ptr((void*)FlashPlasma_Alchemy_Program_newPlasma);
  104 }

Generated ActionScript by Alchemy

Now that was the basic ansi C source code. Alchemy will convert it to special actionscript which will look like good old assambler:

 9002 i0 =  ((__xasm<int>(push((mstate.ebp+8)), op(0x37))))
 9003 i1 =  ((__xasm<int>(push((mstate.ebp+12)), op(0x37))))
 9004 i2 =  ((__xasm<int>(push((i0+16)), op(0x37))))
 9005 i3 =  ((__xasm<int>(push((i1+16)), op(0x37))))

Summary

At this time it is quite hard to set up such an environment due to cygwin quirks, but it does enable some interesting scenarios. If you would like to know more about writing for flash alchemy in C# just let me know.

December 3, 2008

One cannot have multiple configuration files

Filed under: c# — Tags: , , — zproxy @ 3:33 pm

You really cannot have multiple configuration files, for example each per referenced assembly.

.NET configuration subsystem always uses a single configuration file per AppDomain, and it is very much .exe centric.

What this means is that even though you created separate config file for your library assembly, it will never be picked up — .NET config subsystem will always look at your .exe configuration file for settings.

What you should do is simply put all your configuration options, including Coherence configuration, into your main application’s App.config and remove library configuration file from your solution, as it will never be used.

If you really need to have separate configuration file for the library and want to specify Coherence configuration options there (and there are very few reasons why you would want to do that), you will need to load your class library into a separate AppDomain and specify the config file to use. Take a look at MSDN documentation for AppDomainSetup.ConfigurationFile property for an example on how to do that, but again, that’s probably not what you want to do.

Read more about the architecture over here.

November 19, 2008

C To ActionScript via Alchemy

Filed under: jsc — Tags: , , , — zproxy @ 6:54 am

News by BrokenBlog:

Alchemy to compile your C to ActionScript.

How does Alchemy work?

Alchemy works by converting LLVM bytecode to ActionScript 3.0 (AS3) source through an Adobe-authored LLVM back-end. This AS3 source is then compiled using a special version of the ActionScript Compiler to ActionScript bytecode (ABC). This ABC output is then bundled into either a SWF or a SWC depending on your compile options. The resulting SWFs can be executed using Flash Player or bundled into an AIR app. The resulting SWCs can be built into a larger Flash, Flex or AIR application just like any other SWC.

It looks like my jsc project could benefit from this project as jsc also generates actionscript sourcecode. All I need to do is to find out those special version actionscript keywords (not there yet?) and invoke the special version as3 compiler. There isn’t much in the forums yet.

November 5, 2008

Avalon FreeCell

Filed under: jsc — Tags: , , , , , , , , , , — zproxy @ 7:41 pm

The next game powered by jsc has been released. This game works on .net, on javascript and on flash player.

The game is also available at Newgrounds over here and at WidgetBox.

Use Internet Explorer to open the Windows Presentation Foundation (XBAP) version.

Use Internet Explorer or Safari to open the JavaScript version.

The sourcecode is at google code.

November 4, 2008

When EventLog.WriteEntry fails on Windows Vista

Filed under: microsoft — Tags: , , — zproxy @ 1:18 pm

The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.

A project that worked before now throws the System.Security.SecurityException. Why is that?

It looks like we need to explicitly create a log source now.

How to detect that a source has not been created on vista?

try
{
return EventLog.SourceExists(Source, Server);
}
catch (SecurityException)
{
//Vista goes here if log doesn’t exists!
return false;
}

At this point you will know if the source does not exist and yet you will be unable to create it unless you run as administrator.

November 3, 2008

Python to C

Filed under: life — Tags: , , , — zproxy @ 6:07 am

I have found yet another source code generator. Is it me or the generators are the new hype.

Cython generates C code by reading your Python code.

October 25, 2008

AvalonExampleGallery via jsc:php

Filed under: jsc — Tags: , , , , — zproxy @ 6:53 pm

Years ago sourceforge.net did not provide support for php5 – until now. The next release for jsc will finally include a php project template.

For now you can have a look at the example show below, where the php will generate a correct html view of the application and the javascript will make it interactive. Nice huh?

Known bugs: There seems to be some issues with IE7 tho…

October 22, 2008

jsc October Refresh

Filed under: jsc — Tags: , , , , , , — zproxy @ 8:24 pm

Some updates to the compiler and the framework.

Download jsc here. (Others already have!) Older releases are here.

Visit our google groups and the google site.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

OrcasAvalonApplicationWPF Application, C# to JavaScript, C# to ActionScript

OrcasAppletApplication – C# to Java Applet
OrcasFlashApplication – C# to ActionScript
OrcasScriptApplication – C# to JavaScript
OrcasVisualBasicFlashApplication – VB.NET to ActionScript
OrcasVisualBasicScriptApplication – VB.NET to JavaScript
OrcasWebApplication – C# to JavaScript as Microsoft Web Application
OrcasWebSite – C# to JavaScript as Microsoft ASP.NET Web Site
OrcasJavaConsoleApplication – C# to Java as Console Application
OrcasNativeJavaConsoleApplication – C# to Java as Console Application with JNI bindings

Have a look at some old screencasts:

Have a look at the Avalon Gallery, note that it is actually a WPF Application.






September 30, 2008

WPF subset powered by Flash and DHTML Part 2

Filed under: jsc — Tags: , , , , , , — zproxy @ 12:41 pm

Today I released another example project which demonstrates that you could develop an application for WPF but have it running as XBAP and additionally on flash player and javascript enabled browsers aswell.

  1. XBAP version (IE)
  2. ActionScript version
  3. JavaScript Preloader version Via Coral Cache
  4. JavaScript ClickOnce version
  5. JavaScript version

The javascript version has been tested with the following browsers:

  • FireFox 3.0.1
  • IE 7.0.6
  • Safari 3.1.2

You can look at the published files here or you can look at the source code here and here.

Other posts in this series:

  1. WPF subset powered by Flash and DHTML

September 4, 2008

jsc september 2008 refresh

Filed under: jsc — Tags: , , , , , , , — zproxy @ 7:04 am

Some updates to the compiler and the framework.

Download jsc here. (Others already have!)

Added a WPF template.

Visit our google groups and the google site.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

OrcasAvalonApplication – WPF Application, C# to JavaScript, C# to ActionScript

OrcasAppletApplication – C# to Java Applet
OrcasFlashApplication – C# to ActionScript
OrcasScriptApplication – C# to JavaScript
OrcasVisualBasicFlashApplication – VB.NET to ActionScript
OrcasVisualBasicScriptApplication – VB.NET to JavaScript
OrcasWebApplication – C# to JavaScript as Microsoft Web Application
OrcasWebSite – C# to JavaScript as Microsoft ASP.NET Web Site
OrcasJavaConsoleApplication – C# to Java as Console Application
OrcasNativeJavaConsoleApplication – C# to Java as Console Application with JNI bindings. (missing)

Have a look at some old screencasts:

FlashAvalonQueryExample

This is a WPF application based on the new OrcasAvalonApplication template. In debug mode jsc is not invoked and you can develop and debug the application as a regular one yet in release mode, the jsc is invoked at the post build event effectivly creating a javascript and an actionscript version for you. This example uses LINQ. See it in SVN here.

What does this example do? Based on a list of flickr images and a filter that defines a part of the image to be matched it returns a list of images and loads them over the network.

While developing with jsc, one must keep in mind the limits as only a minimum featureset is supported.

August 16, 2008

WPF subset powered by Flash and DHTML

Filed under: jsc — Tags: , , , , , , — zproxy @ 9:43 pm

Today I released an example project which demonstrates that you could develop an application for WPF but have it running as XBAP and additionally on flash player and javascript enabled browsers aswell. Isn’t this more like WPF Everywhere 🙂 ?

  1. XBAP version (IE)
  2. ActionScript version
  3. JavaScript Preloader version
  4. JavaScript ClickOnce version
  5. JavaScript version

The javascript version has been tested with the following browsers:

  • FireFox 3.0.1
  • IE 7.0.6
  • Safari 3.1.2

You can look at the published files here or you can look at the source code here and here.

Some currently by ScriptCoreLib.Avalon library supported features are:

  1. Canvas
  2. TextBox
  3. Rectangle
  4. Image
  5. Cursor.None
  6. DispatcherTimer

Neat huh?

Update: Chris is working on silverlayout – wpf inside as3.

June 29, 2008

FlashTowerDefense1:MP Version 9

Filed under: jsc — Tags: , , , , , , , , — zproxy @ 2:18 am

Yet another screencast of my sheep rampage. This time you can kill coplayers, and we can change weapons. GTA style 🙂 Do you remmeber the keys? Oh, and I had to drop the wave by days feature for this version…

And look what happened when I submitted this game to Newgrounds 🙂

http://nonoba.com/zproxy/flashtowerdefense1mp

Play at Googlepages.

Game published on Newgrounds.

Embed it as Google Gadget here or here or here. View all videos of this game.

Add to Google

View source. Remember this is still flash, but the application is written in C#.

June 15, 2008

FlashTowerDefense1 v6.1

Filed under: examples, games, jsc — Tags: , , , , , , — zproxy @ 9:55 pm
Game updated to version 6. Player can now exit the machinegun and chase those sheep with a shotgun.

FlashTowerDefense1

You are in the command of a machine gun tower and you are raided by mad sheep and enemy warriors. Your mission is to shoot them down.

  • Size: 800×600
  • Category: Shooting
  • Tags: machinegun, sheep, blood
  • Content Rating: Everyone

Instructions: Aim at the enemy unit and hold down the mouse until the unit is terminated by gunfire.

Game published on Nonoba.
Game published on Multigames.
Game published on Newgrounds.

View older blog post or video post..

June 12, 2008

Jsc June Refresh 2

Filed under: jsc — Tags: , , , , , , , , , , — zproxy @ 4:29 pm

Some updates to the compiler and the framework: Download jsc here. (Others already have!)

Added two Java project templates.

Visit our google groups.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

OrcasAppletApplication – C# to Java Applet
OrcasFlashApplication – C# to ActionScript
OrcasScriptApplication – C# to JavaScript
OrcasVisualBasicFlashApplication – VB.NET to ActionScript
OrcasVisualBasicScriptApplication – VB.NET to JavaScript
OrcasWebApplication – C# to JavaScript as Microsoft Web Application
OrcasWebSite – C# to JavaScript as Microsoft ASP.NET Web Site
OrcasJavaConsoleApplication – C# to Java as Console Application
OrcasNativeJavaConsoleApplication – C# to Java as Console Application with JNI bindings.

Have a look at some old screencasts:

June 7, 2008

FlashTowerDefense On YouTube

Filed under: jsc — Tags: , , , , , , — zproxy @ 2:29 pm

June 6, 2008

Jsc June Refresh

Filed under: jsc — Tags: , , , , , , , , , , — zproxy @ 2:43 pm

Some updates to the compiler and the framework: Download jsc here.

Most important update was fixing the virtual + override semantics for jsc:actionscript. It’ did not allow to combine multiple events for example.

Visit our google groups.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

OrcasAppletApplication – C# to Java Applet
OrcasFlashApplication – C# to ActionScript
OrcasScriptApplication – C# To JavaScript
OrcasVisualBasicFlashApplication – VB.NET to ActionScript
OrcasVisualBasicScriptApplication – VB.NET to JavaScript
OrcasWebApplication – C# to JavaScript as Microsoft Web Application
OrcasWebSite – C# to JavaScript as Microsoft ASP.NET Web Site

Writing code in VB.NET for flash looks like this:

June 4, 2008

FlashTowerDefense1 v2.1

Filed under: actionscript, examples, games, jsc — Tags: , , , , , , — zproxy @ 1:16 pm

A month has passed and $0.20 money has been made. I published this project to try this new trend to monetize your flash game I’ve read about on Emanuel’s blog. My idea is simple – use c# (view source) for coding, translate the project to a actionscript equivalent via jsc and draw yourself some graphics for the game. So far so good. I am now a member of GameBalance, MochiAds and Newsground where you can even visit my profile.

FlashTowerDefense1

You are in the command of a machine gun tower and you are raided by mad sheep and enemy warriors. Your mission is to shoot them down.

  • Size: 640×480
  • Category: Shooting
  • Tags: machinegun, sheep, blood
  • Content Rating: Everyone

Instructions: Aim at the enemy unit and hold down the mouse until the unit is terminated by gunfire.

You can see the stats for MochiAds and Newsground below:


What do you think I should add as a next feature? I’ve already read some of the suggestions and am considering adding them.

  • enemies come as waves
  • powerups
  • building multiple cannons
  • more doodads like trees and bushes

Visit older blog post here.

Update: Game published on Nonoba. View my profile.

Update: Game published on Multigames. View my profile.

May 2, 2008

Shoot that sheep!

Filed under: jsc — Tags: , , , , , , — zproxy @ 3:04 pm

This is a simple game written with in c# with jsc for flash. It includes Mochiads. Developers can download this example project here (includes .dll and generated .as files) or just browse the source here.

FlashTowerDefense1

You are in the command of a machine gun tower and you are raided by mad sheep and enemy warriors. Your mission is to shoot them down.

  • Size: 320×240
  • Category: Shooting
  • Tags: machingun, sheep, blood
  • Content Rating: Everyone

Instructions: Aim at the enemy unit and hold down the mouse until the unit is terminated by gunfire.

April 30, 2008

jsc april refresh 4

Filed under: jsc — Tags: , , , — zproxy @ 2:30 pm

Some minor updates to the compiler and the framework: Download jsc here.

Visit our google groups.

Previous releases contained a serious bug when jsc was being used on a machine without the DIA SDK. It comes with the Visual Studio retail version and I did not realized it before. Now jsc wont crash when the DIA SDK is not installed and method variable names will be autogenerated instead of beeing looked up in the pdb file.

Tutorials to read when just starting with jsc:

How things releate:
jsc

This is how it looks like when writing c# instead of actionscript:
flash

April 20, 2008

jsc april refresh 3

Filed under: jsc — Tags: , , , , — zproxy @ 11:35 am

Some minor updates to the compiler: Download here.

There is a new example for actionscript, where I ported the LightsOut game from its javascript version.

Actionscript Version



Javascript Version



I got the idea originally from this blog post, and made the javascript version almost a year ago.

April 6, 2008

jsc april 2008 refresh

Filed under: jsc — Tags: , , , — zproxy @ 2:45 pm

First some minor updates to the compiler: Download here.

Additionally two new example actionscript projects:





March 16, 2008

javascript minesweeper remake

Filed under: jsc — Tags: , , , , — zproxy @ 11:23 am

You can now play the classic minesweeper game in your browser.



February 10, 2008

C# To ActionScript, Initial LINQ Support

Filed under: jsc — Tags: , , , , , — zproxy @ 5:18 pm

I am introducing LINQ for ActionScript – you can now start writing your flash applications in c# using linq and convert it to actionscript via jsc compiler.

How does the generated code compare to the original

In c# the code looks like this:

foreach (var v in from i in __users

where i.Trim().ToLower().Contains(user_filter)

select i.Trim())

{

result.text += “result: “ + v + “\n”;

}

The generated ActionScript looks like this:

enumerator_15 = __Enumerable.Select_100663437(__Enumerable.Where_100663439(SZArrayEnumerator_1.op_Implicit_100664110(__users), new __Func_2(CS___8__locals15, __IntPtr.op_Explicit_100665307(“__ctor_b__8_100663306”))), FlashLinqToObjects___c__DisplayClassf.CS___9__CachedAnonymousMethodDelegate13).GetEnumerator_100664907();

try

{

while (enumerator_15.MoveNext_100665359())

{

v = enumerator_15.get_Current_100665499();

this.result.text = this.result.text+ “result: “+ v+ “\x0a”;

}

}

finally

{

if (!(enumerator_15 == null))

{

enumerator_15.Dispose_100665605();

}

}

New example project:



Download latest the jsc version here.

January 20, 2008

C# to ActionScript, initial delegate support

Filed under: jsc — Tags: , , , , — zproxy @ 3:59 pm

The compiler has been modified to support delegates with actionscript.

For example you can now write this, plain and simple, just like in jsc:javascript. The sound demo 2 has been updated with a rotating image and the a text field that is now tracks the mouse.

front.mouseOver += ev => front.textColor = 0x00ff0000;
 


January 6, 2008

Example Gallery

Filed under: jsc — Tags: , , , — zproxy @ 3:17 pm
This is a collection of projects developed with jsc. They were coded in c# and translated to javascript with jsc. Click on the pictures to load the applications or on the names to open them in a new window. You might need to press refresh to come back to this index. Enoy! 🙂

    January 5, 2008

    C# to x86

    Filed under: c#, life — Tags: , , , — zproxy @ 12:16 am

    There is singularity (wiki) and there is sharpOS at sourceforge. I do not know in what exactly do they differ, but this page might. Both projects are working on a kernel that has been written entirely in C# or its derivate. Neat huh. Someday in the future your application can be run on a computer exclusively with the kernel all alone or inside a browser virtually – all a matter of a few check boxes available under project settings dialog… this sure looks the way it is going… And when will we see routers written in c#? 😀

    Andrew shared on OSnews:

    Except that Singularity and SharpOS are not that similar. The only thing they have in common are the CLR and C# except Singularity is written in Singh# which is C# with extensions that make writing OS’s in C# possible.

    The architecture is different. The three things that stand out are:

    – Software Isolated Processes (SIP)
    – Contract based Channels
    – Manifest Based programs

    January 1, 2008

    tutorial: NatureBoyTestPad

    Filed under: jsc — Tags: , , , , — zproxy @ 7:54 pm


    A tutorial how to create such an application can be found here.

    Create a free website or blog at WordPress.com.