Archive for the 'Flash' Category

Adobe Wave

Thursday, July 23rd, 2009

Another cool product form Adobe: Adobe Wave

Adobe® Wave™ is an Adobe AIR® application and Adobe hosted service that work together to enable desktop notifications for web publishers, large and small.

Simply speaking it is an Air application that receive notifications from the Adobe free Publisher Service.
With Wave site owners can use a simple REST api to send notifications, while desktop users can use a single application to receive notifications from multiple sources.

Wave flowchart

Wave flowchart

Wonderfl – Collaboratively build flash demos

Sunday, June 7th, 2009

Simply Wonderfl, that site allows to write as3 code directly from the browser and compile the result, while other users are able to see it and fork it to create a new version. Like a flash demo scene on steroid.
Inestimable for finding nice effects for flash.

Some interesting examples:
Clouds rendering
“Dune” like desert generator
Retro avatars generator
Water ripple effect

Wonderfl - Build flash online

Wonderfl - Build flash online

First Flash10 P2P application unveiled

Sunday, May 31st, 2009

Today I’ve found FilesOverMiles: a website that allows the exchange of files between two users with a P2P connection using Flash.
This is possible thanks to the new Flash 10 P2P capability.

However, this P2P feature needs an initial handshake between the clients to start the connection, and it is done through a “rendezvous service”.
Since I didn’t know that Adobe publicly released a rendezvous service or specification, have the folks at FilesOverMiles reverse engineered the protocol?

Useful links:
Stratus: a rendezvous service from Adobe (beta)
Flash Collaboration Serivice: Adobe hosting service for RTMP/RTMFP
Real-Time Media Flow Protocol FAQ

rtmfp

RTMFP

RegExr – Write and share regular expressions

Wednesday, May 27th, 2009

Grant Skinner has just released RegExr: a wonderful tool for writing and sharing regular expressions.

Its main features are: show results as you type, contextual help, save and share your regexps.
It also runs as an Air application or directly from the website.

RegExr

RegExr

Haxe on the iPhone

Friday, May 22nd, 2009

Great news for all the Haxe enthusiasts!

Haxe is powerful language similar to ActionScript 2, that can compile itself to Flash6/7/8/9/10 and translated to other languages like JavaScript, Php, NekoVM, C++.
This allows it to run virtually in every environment and client.

And now the good news: from today its possible to run Haxe programs on the iPhone!

Beware that this is only an early beta, but it’s already promising: thanks to the NME library, you’ll be able to use the Flash 9 drawing api on the iPhone, leveraging your Flash skills to make great iPhone games.

Haxe on the iPhone simulator

Haxe on the iPhone simulator

Must see: 3D desktop application

Monday, February 18th, 2008

Today I’ve stumbled upon this wonderful 3d desktop application:
3d desktop portfolio
WHITEvoid portfolio application

Remembered me of the 3D desktop concept video “Bumptop”:

Bumptop

haxeVideo

Sunday, December 16th, 2007

Only a day after the release of BlazeDS, Nicolas Cannasse (Motion-Twin) has just released haxeVideo:

haxeVideo is an opensource video streaming server entirely written in haXe
Features include :

* FLV streaming using RTMP protocol
* Webcam and Microphone recording to FLV file
* Live streaming for web conferencing
* light and fast scalable server
* only 50 KB of server source code : modify whatever you need !

Finally the multiuser/conferencing thing is taking place?
We will ever see affordable (T)RTMP hosting services?

PS: This can be the right answer to those interested in a web-radio solution

A dream come true: AMF3 specs and BlazeDS

Friday, December 14th, 2007

This week were released:
AMF3 specification

Action Message Format (AMF) is a compact binary format that is used to
ActionScript object graphs. Once serialized an AMF encoded object graph
to persist and retrieve the public state of an application across sessions or
endpoints to communicate through the exchange of strongly typed data.

And Java-Remoting BlazeDS Beta

BlazeDS is the server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time to Adobe Flex and Adobe AIR applications for more responsive rich Internet application (RIA) experiences.

Previously available only as part of Adobe LiveCycle Data Services ES, Adobe is announcing its plans to contribute the proven BlazeDS technologies to the community under the LGPL v3. BlazeDS gives the rapidly growing Adobe developer community free access to the powerful remoting and messaging technologies developed by Adobe.

The source code will be available for download in early 2008.

In short: more AMF servers for free, other than RED5

The Doom game in Flash

Saturday, August 4th, 2007

The Doom game in flash:

This uses the original Doom shareware wad file and gets all content from it at runtime.

See it here: Flash Doom game

Continuations are the new threads

Friday, June 1st, 2007

I've always thought that continuations are the right answer to many if no all the network-programming problems.

What are continuations?

A continuation represent the state of execution of a function: all the local variables and the instruction pointer (the last line executed).
(Update: At least: there can be many kind of continuations. Other than the local variables, it's possible to store the state of the entire thread/process/stack)

What are them used for?

You can interrupt the execution of a function and resume it later.
This can be useful to create "generators": iterators made simple.

A generator looks like this:

JavaScript:
  1. function next() {
  2.   for(x=0; x <arr.lenght; x++) {
  3.      yield arr[x];
  4.   }
  5. }

The function next return the next element in the arr array every time is called.

When you call the function you resume the continuation, so the execution will resume from the yield.
If you want to implement an iterator like that without generators you'll have to explicitly unroll the for loop.

The resulting code will be surely less readabe.
Like:

JavaScript:
  1. function next() {
  2.   if(this.current == null) this.current = 0;
  3.   this.current++;
  4.   if(this.current> arr.lenght) {
  5.      this.current = 0;
  6.      return null;
  7.   }
  8.   retrun arr[x];

This can get really worse for every non-trivial iterator (eg: tree traversal).

Another nice use of continuations is to generate cooperative threads.
They are different from standard threads because they can't be stopped, they should cooperatively stop.

For example you can do:

CODE:
  1. function process() {
  2.   sendConnectRequest();
  3.   yield;
  4.   if(!this.connected) return false;
  5.   sendLoginRequest();
  6.   yield;
  7.   sendMessage();
  8.   yield;
  9.   trace("msg received: " + this.response);
  10. }

The process function return the control to the calling function every time it has to do an asynchronous operation.
Without continuations you'll have to do:

CODE:
  1. function process(onComplete) {
  2.   connect(function (connected) {
  3.       sendLoginRequest( function(logged) {
  4.           sendMessage( function (response) {
  5.               trace("msg received: " + response);
  6.               onComplete();
  7.           }
  8.       }
  9.   }
  10. }

As you can see we have used closures in a Continuation Passing Style:
Every time you have to do an asynchronous operation, you'll have to pass a function (a callback) that will be called when the operation is done.

Without closures the code will look even worst, this is why recently there is a great buzz about closures in the java world.

But, what have in common continuations and threads?

A continuations-like style of programming (but without continuations) is possible only using threads.
However, threads are the heavier and most problematic way to handle the I/O waitings. (see: 10Kproblem)
You have not only to deal with concurrency problems with read/write variables, but you have to block an entire thread for every I/O operation.
A better way is to use asynchronous events, like in the last two example. But of the two, which one do you prefer?

If your answer is like mine, take a look to:

  • Jetty servlet engine, it support a limited form of one shot continuations: the function is re-executed from the beginning, what is restored is only the HTTP connection state.
  • RIFE continuations, it's a bytecode-level implementation in Java, these are real continuations
  • NarrativeJS, a precompiler that create a simple form of continuations in Javascript: using the -> operator the execution can be resumed from that point.
  • Update: Torsten Curdt suggest Javaflow, a continuation implementation that seems really interesting, he offers some tutorials on his blog too

Jetty scratched only the surface of what is possible with continuations, while with RIFE it's possible to develop highly concurrent servers using cooperative sessions instead of threads (some >10000 connections instead of 1000). See: Mina Java-NIO library, Perl POE, Mina-Mule.

A server that uses continuations, will allow the simple and linear programming style of blocking-synchronous operations while using non-blocking ones. With a huge increment in performance.

In the client side, the most interesting is NarrativeJs, that use an approach that can be adapted to every language:
it unroll loops and transform all local variables in object variables to generate his quasi-continuations.

JavaScript:
  1. function boo(){   
  2.   alert("start");
  3.   sleep->(30);
  4.   alert("end");
  5. }

became:

JavaScript:
  1. function boo(){var njf1=njen(this,arguments);nj:while(1){switch(njf1.cp){case 0:
  2. alert("start");njf1.pc(1,null,
  3. sleep,[30]);case 1:with(njf1)if((rv1=f.apply(c,a))==NJSUS){return fh;}
  4. alert("end");break nj;}}}

The code looks ugly but it is so to preserve line numbers.
With narrativeJs you can do complex animations in a simple, linear way:

JavaScript:
  1. waitForClick->(theButton);
  2. animate->(theButton, "left", 200, 1000, 20);
  3.            
  4. theButton.innerHTML = "go left";
  5.    
  6. // move the button to the left (again note the blocking operations)
  7. waitForClick->(theButton);
  8. animate->(theButton, "left", 0, 1000, 20);

or:

JavaScript:
  1. document.getElementById("myElem").innerHTML = fetch->("http://www.url.com/");

Really interesting now that Flash and Ajax are pushing asynchronous operations to the masses.
Will we say goodbye to events, and maybe to threads as we know now?