Hi, my name is Timo Ernst and I am a web expert.

Posts Tagged ‘Flash’

Instant Flash player engine in JavaScript?

Posted on: April 12th, 2010 by Timo

Note: This is not a posting about introducing Gordon. This article describes a concept of automatically porting the Flash Player to JavaScript in a generic way, based on the idea of Gordon and Adobe Alchemy.


You might know Gordon, an experimental attempt of implementing the Flash Player runtime environment, completely written in JavaScript (by Tobey Tailor).
Demos have already shown, that this is possible.

The idea itself is great: Create a Flash application as you’re used to and then compile it into a SWF file.
Then, embed it together with Gordon into your website like this:

<html>
	<head>
		<script type="text/javascript" src="/path/to/gordon.js"></script>
	</head>
	<body>
		<div id="your_stage">Replace me</div>
		<script type="text/javascript">
		var movie = new Gordon.Movie("/path/to/your.swf", {id: "your_stage", width: 480, height: 320});
		</script>
	</body>
</html>

The problem here is that I doubt that one person alone can completely re-implement the full Flash engine. This is somewhere close to impossible, since Gordon currently only supports SWF1, while the Flash Player was just released in version 10.1.
Even open-source projects like Gnash, a re-implementation of the Flash Player (written in C++), which already exists since several years, currently only support SWF7 and SWF8 partially.

Now, here comes my idea:

What, if it would be possible to automatically transform existing Flash Player implementations into JavaScript?

I know that this sounds crazy, but read the following first.

Ever heard of Alchemy? It’s a transformation tool, which converts C/C++ code into ActionScript and then build a Flash file from. Yes, you heard right. This is not an April joke. It’s real and it works. There have already been ports using the original (open) Quake2 source, transform it into ActionScript and then run the game inside Flash Player.

Now, since this is nothing new, here comes the big trick: Why not use the source code of Gnash, send it through Alchemy and achieve the ActionScript version of it.
Then, write a transformation tool, which converts ActionScript into JavaScript code. Since both languages share some syntax similarities, this should be possible (Especially if it is possible to transform C/C++ into ActionScript, which would sound even more crazy to me, if I’d hear it in the first place).
After this, the achieved JavaScript code must be cleared of anything that the Flash Player offers, but cannot be handled by JavaScript/HTML5, like for example web-cam support.
Finally, an interface must be written in order to output video and audio. Since HTML5 supports the new <canvas> and <audio> tags, this should be possible. Simply draw the content of the graphical buffer, generated by the Flash Player emulator, onto the canvas element and playback the sound using <audio>. Done.

This way, it would be possible to run (existing) Flash applications without having the Flash Player plugin installed.

I know, this still might sound crazy but it might be possible with enough man-power and the know-how. The only thing that might become a bigger problem is the file size. I wonder how big such a .js file, implementing the full(!) Flash Player, might become. Maybe it would then be necessary to package only required subsets of it.

So what do we get at the end? A JavaScript-version of the Flash Player which supports up to SWF8, thanks to Gnash.
If Adobe ever releases the Flash Player as open source, it would be easy to throw it into our C/C++-to-JavaScript transformator. Sounds great, or not?

Update: It just came to my mind that, if it’s possible to transform C/C++ into ActionScript, why shouldn’t be possible to directly cross-compile C/C++ into JavaScript?
As far as I know, Alchemy is based on LLVM, which should be able to handle this.

TwitterDiggFacebookShare

Flash-to-HTML5: A must-have!

Posted on: April 12th, 2010 by Timo

There has a lot of discussion going around in the past days about the big Adobe vs. Apple issues. All because of Flash.

Steve doesn’t like Flash. He says, it’s buggy, slow and unstable, which I, as a Flash developer, must agree to partially.

But this is only one side of the medal. While the Flash player itself isn’t that great, the development tools provided by Adobe, like Catalyst, Flash Builder or Flash Professional, are really awesome. For me, as a traditional software engineer coming from Java programming, all these tools are absolutely professional, easy to use and really enhance the development workflow.

Thus, there can be only one consequence:

The Flash Player must be eliminated from the web and Adobe should continue building their great developer tools, but target HTML5.

On the Adobe MAX 2009, it was demonstrated, that it is possible to export Flash applications into HTML5. I know that this is just an early prototype, but if Adobe wants to survive, I think this is probably the best way to go, since all sides would benefit from this:

  • The web gets rid of the Flash Player
  • Steve is happy
  • Flash Developers can continue using Adobe products to create web applications
  • Adobe will survive

This strategy totally makes sense. Adobe doesn’t make money by selling the Flash Player. They sell development tools which target the Flash Player. If these tools would instead target HTML5, no-one would get hurt.

I know, this is technically not very easy. There are Flash-features which do not exist in HTML5 (yet), like web-cam support for example. But time will fix this. As far as I know, web-cam support was already suggested as a new feature for the next HTML versions.

TwitterDiggFacebookShare

Flash + iPad: Der Druck auf Apple wächst

Posted on: April 8th, 2010 by Timo

Auf golem.de gibt es ein interessantes Interview mit Matthias Döpfner, Konzernchef des Axel-Springer Verlags, in dem das iPad als Retter der Print-Industrie gepriesen wird:

“Jeder Verleger auf der Welt sollte sich einmal am Tag niedersetzen, beten und Steve Jobs dafür danken, dass er damit die Verlagsindustrie rettet”

Gleichzeitig übt Döpfner Kritik am iPad, da dieses kein Flash unterstütze. Die Hoffnung ruht aber auf der Konkurrenz, die Adobe’s Technologie nicht ablehnt, wie zum Beispiel HP mit seinem Tablet, genannt Slate.

Döpfner äußerte aber auch Kritik am iPad und Apple. So sei er enttäuscht, dass Flash auf dem Gerät nicht läuft. Die Contentbranche solle sich zudem mit Apple zusammensetzen und die Umsatzverteilung neu verhandeln. 30 Prozent Umsatzanteil für Apple sei zu viel. Doch die Konkurrenz bei den Tablets werde sich hier positiv auswirken. Es gebe Tablets von Microsoft und Amazon und es werde ein Tablet von Google geben.

Quelle: golem.de

Ich persönlich stimme zu 100% mit dieser Meinung überein. Keine Frage, das iPad ist ein nettes Gerät und füllt ausgezeichnet die Lücke zwischen Smartphone und Notebook. Ich kann mit gut vorstellen, wie in ein paar Jahren Menschen mit Tablet statt Zeitung im Café sitzen und ihre täglichen News konsumieren. An Flash als Platform für solch reichhaltige Medien führt allerdings zur Zeit kein Weg vorbei. Wie so etwas aussehen kann zeigt ein Video auf theFlashBlog.com (Unbedingt ansehen!!).

Langfristig wünsche ich mir allerdings ein Web ohne Flash Player. Es ist ja unlängst bekannt, dass sich Flash-Anwendungen in native iPhone-Applikationen kompilieren lassen. Wäre dann nicht theoretisch eine (teilweise) Transformation nach HTML5 möglich? Schön wär’s.

TwitterDiggFacebookShare

Flash – The new Java?

Posted on: April 4th, 2010 by Timo

Update: After hearing about some misunderstandings regarding this post, I want to make sure, that the title “Flash – The new Java?” is of course targeted at front-ent software engineering, not backend. Although it’s obvious that noone would ever try to build a web application backend using Flash, I just wanted to make sure that you understand what I am talking about :-)

Flash/AIR seems to really become a serious alternative development environment if it comes up to multi-platform requirements for desktop- and mobile applications.

With one codebase (in ActionScript3), it’s possible to target:

  • Windows
  • Mac OS
  • Linux
  • iPhone, iPad
  • Android
  • Web OS

Don’t missunderstand me. If I say “desktop application”, I am not talking about ones which run inside a browser. Instead, they are being installed on the local file system and run inside a runtime environment. Think of them like Java applications running inside the Java Virtual Machine.

Check out this youtube video where Flash’s multi-platform capabilities are being demonstrated.

Note: Since both, the iPhone as well as iPad, don’t support the Flash runtime environment, it is possible to compile Flash into native iPhone applications, which behave 100% as their originals (I, personally find this unbelievable!).
On all other platforms, there is a runtime environment, called AIR (Adobe Integrated Runtime), available. On Android phones, there is even a Flash Player installed which makes it possible to run Flash apps inside the browser. – Just one of the reasons why I am gonna buy the new HTC Legend in the next days. Sorry Apple :-P

For me, Flash is the new Java, which always claimed to be the platform-independent runtime environment for front-end applications. As good as Java is for backend-development on the web, the more it failed on the desktop and mobile phones.

Flash is not an animation-tool for designers anymore. It’s a serious SDK for writing great front-end applications in half of the time one would need using Java. ActionScript3 is a great programming language based on the object-oriented principles of java with some syntax similarities with JavaScript. In AS3, the developer has everything to code robust applications in OO-style: Classes, interfaces, polymorphism, events and more. Using Eclipse as the IDE of choice, one gets all the benefits of it like great debugging tools, for example.
Check this link out for a comparison between Java and AS3 syntax. You won’t see that much of a difference.

TwitterDiggFacebookShare

Flash is dead

Posted on: March 30th, 2010 by Timo

Click here to read more.

TwitterDiggFacebookShare