c# to javascript, actionscript

September 1, 2009

Windows Forms inside Opera Widget

Filed under: jsc — Tags: , , , , — zproxy @ 1:57 pm

Opera SoftwareIf you are like me then you probably have had a look at the new opera 10 browser. I liked the widget API so much that I just had to make a widget of my own.

>> Open my Windows Forms javascript example as opera widget!

Widget1

Cool huh? Note that this widget will only show on your primary display if you are one of the multi display citizen. Note that this widget needs a right click to close.

You may see the following warning when opening my widget:

jsc.sourceforge.net

You are installing a file which can alter the way Opera behaves. Opera may become unstable or less secure as a result.

You should only download setup and widgets from sources you know and trust. Do you want to proceed?

jsc.sourceforge.net
You are installing a file which can alter the way Opera behaves. Opera may become unstable or less secure as a result.
You should only download setup and widgets from sources you know and trust. Do you want to proceed?

July 13, 2009

Nobody likes the records that I play

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

It is time to make yet another release of my jsc compiler. This time around you can finally use anonymous non generic delegates with java. Coolness! Subscribing to events and threading is now much easier. For applets you’d need to write a delegate to interface wrapper tho…

In the release you have a project template at C:\util\jsc\templates\OrcasJavaConsoleApplication.zip

At this time I modified it to show off the anonymous delegate support. In debug build mode this project can be debugged using F5 in Visual Studio on .net. If release build was selected the jsc compiler will be invoked as a post build event to generate java source code then javac and jar will be invoked. To run the new java package you need to start the tools/run.jar.bat.

javaevents by you.

How will that delegate keyword work out in java source code you ask? Here is the Program.java for you to inspect.

javaevents2 by you.

As you can see there is some magic involved, where magic is the compile time code generation. While jsc has been around for years – it took just that long to actually implement the delegate support. It is running via reflection and as such not really that performant, but at this time we cannot take a function pointer in java can we.

PS. It seems sourceforge is not showing statistics for me anymore – whats up with that?

June 29, 2009

Avalon Tycoon Mansion

Filed under: games — Tags: , , , , — zproxy @ 5:11 am

Yet another WPF powered flash game is ready for you to play. The game is written in C#. Let me know if you’d also want to see the source.

AvalonTycoonMansion by dadeval.
Let me know if you are interested in writing a game yourself in c# instead of actionscript.
Update:
Here are the Impressions the game has made. As you can see it had reached 30k players in its best days. The sourcecode can be found here at google code.
avalontycoonmansion

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

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…)

May 1, 2009

Mandelbrot

Filed under: jsc — Tags: , , , , , , , — zproxy @ 9:46 am

One single static C# class implementation to rule them all.

The other day I found an example of Mandelbrot implementation for Silverlight. I have created this example solution to serve as a reference implementation.

This single Mandelbrot implementation is reachable for these platforms:

  1. Windows Forms
  2. Windows Presentation Foundation
  3. Silverlight (3.0 beta)
  4. Java Applet
  5. Flash
  6. Javascript (Firefox, Safari)

For those of you who are new, jsc compiler is going to generate source code for you. While you write your algorithm in C# in current case it can be retranslated to java, actionscript, c and javascript to enable other platforms. Do leave a comment if you would like to know more about it.

April 26, 2009

Scenarios for jsc

Filed under: jsc — Tags: , , , , — zproxy @ 8:31 am

This was my first anwser at  Stack Overflow.

The jsc compiler project enables these scenarios:

  • C# to MSIL to JavaScript for browser
  • C# to MSIL to JavaScript for AppJet
  • C# to MSIL to PHP5 for hosting solutions
  • C# to MSIL to Java for browser applets
  • C# to MSIL to Java for applications
  • C# to MSIL to Java for JavaCard
  • C# to MSIL to C99 for native stub applications
  • C# to MSIL to ActionScript3 for Flash 9
  • C# to MSIL to Adobe Alchemy C for Flash 9
  • C# to MSIL to C# 2.0

With some effort Visual Basic could also be used as a source language. The jsc compiler never reads your source code even if GWT and Script# do that. My compiler reads your IL.

jsc compiler is

  • an experimental project
  • one mans effort yet
  • rather useful already.
  • 3 years old.
  • awaiting donations to optimize compilation time and output itself

The latest example is a plasma animation where a single implementation can be used between those platforms:

April 23, 2009

movieposters

Filed under: life — Tags: , , , , , — zproxy @ 7:56 am

I present you text to movie poster converter.

http://movieposter.appjet.net/

usage:

http://movieposter.appjet.net/matrix

where matrix is the name of the movie you are looking for

http://movieposter.appjet.net/matrix
http://movieposter.appjet.net/hulk
http://movieposter.appjet.net/lost
http://movieposter.appjet.net/dexter

See the original post in the forums. If you are interested in writing applications in C# for appjet.net let me know.

April 3, 2009

Awesomium

Filed under: life — Tags: , , , , — zproxy @ 12:28 pm

Today I learned, that there is a 3D internet explorer renderer out there.

This is what it looks like if you would be playing my treasure hunt multiplayer flash game.

What did I do to make it work?

  • Download Awesomium v1.0 demo
  • Add a link to the game in media\demo.html
  • Select Direct3D9 renderer

I guess there is room for more 3d browsers… and don’t forget Cooliris.

November 21, 2008

Steps to export your Avalon Application to XBAP

Filed under: jsc — Tags: , , , , — zproxy @ 8:32 am

This post is for you if you are developing your Avalon Application with jsc intending to release it as following:

  1. Native .NET WPF Application
  2. Flash Player Application
  3. JavaScript Application
  4. WPF Browser Application (XBAP)

There comes a point in time when you would like to release it for testing. Releasing it as XBAP is somewhat more work. Here is what you will need to do:

  1. Create new WPF Browser Application project in your solution and name it as “~.XBAP” project where ~ is your original project name.
  2. Remove App.xaml
  3. Remove Page1.xaml
  4. Go to the ~ project properties, select Application tab, find Icon and manifest section and choose “Create application without a manifest”. This will allow you to reference an exe from your XBAP.
  5. Add a reference of ~ to ~.XBAP
  6. Add a reference of ScriptCoreLib.Avalon.dll to ~.XBAP
  7. Add Program.cs and the startup code. For me it looks like this:
    using global::ScriptCoreLib.CSharp.Avalon.Extensions;
    using global::AvalonUgh.Labs.Shared;
    class Program
    {
        [STAThread]
        public static void Main()
        {
            AvalonExtensions.ToApplication<LabsCanvas>();
        }
    }
  8. Now you may need to tweak your security settings. I needed to add FileIOPermisson to enable loading the assets.  Actually if you want users to be able to use it you need to obey the Partial Trust Policy. That policy will not allow you to create FileInfo objects nor will it let you call the Assembly.Name property.
  9. As the last thing before sending it in for testing you need to publish it and you are done.

You can use this tool to copy your source code as HTML like I did.

Update:

If you are running apache then you wiill probably need to add a new mime type. Keep in mind – some low-cost web host wont let you do that.

.htaccess

AddType application/x-ms-xbap xbap

November 20, 2008

AvalonWebApplication with PHP backend

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

I have created a new project template that demonstrates most of what jsc is capable of. Soon I will publish it on the sourceforge with a tutorial how to get started using it.

Long story short – Here is an application which demonstrates the following features all written in C#:

  1. PHP Backend
  2. JavaScript (WPF)
  3. ActionScript (WPF)
  4. Java Applet

Update: Moved the example to sourceforge and removed the querystring switch.

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.

October 26, 2008

AvalonExampleGallery Carousel

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

AvalonGalleryExample project demonstrates how jsc compiler can be used in software development.

The entire project was written in c# and here are it’s versions for the web:

PHP + JavaScript Version – renders a static view for the user and uses javascript to gain interactivity.

XBAP Version – runs as a .net application via ClickOnce
Flash Version – runs as a flash application
JavaScript Version – runs as javascript application

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.






October 4, 2008

Feedback for jsc

Filed under: jsc — Tags: , , — zproxy @ 8:56 am

Which one is better ? My heart goes to JSC as I’m fond of LINQ, it’s anonymous delegates syntax and extension methods, even if Script# seems better documented.
I’ve successfully created my first Flash application using JSC and I’m very proud ! So it really works ! Even if there are syntax tricks and the needs to know basic flash programming to make it work.

Read a post “Script# or JSC ?” by SoftLion

Update: JSC has been mentioned on Diary of the GX999.

Update: JSC has been mentioned back in April at Hide-Takata.

Update: JSC has been mentioned on livedoor.

Update: JSC has been mentioned by sanjay.

Update: JSC has been mentioned by steve at joelonsoftware.

September 25, 2008

jsc september 2008 refresh 2

Filed under: jsc — Tags: — zproxy @ 8:10 am

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:

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

Have a look at some old screencasts:

Older Posts »

Blog at WordPress.com.