Archive for the 'Flash' Category

My two cents on Static Typing

Wednesday, May 16th, 2007

While I was wondering if using haXe or Java with my server, I’ve stumbled upon some discussion on Static Typing (Java) vs. Dynamic Typing (Ruby, Php).
In a really interesting blog post (read the comments too) I found this touching phrase:

“Static typing is Communist Bureaucracy”.

In short: since we (should) have pervasive testing, Static Typing is only more testing. However, a comment is enlighting:

I’m finding this logic hard to follow. Testing is good, coverage is good. Static typing is, among other things, a way to have the compiler test your code for type issues. Since we like testing, this makes static typing good, right?

But Static Typing not only prevent you to do mistakes, like typos, it allows your IDE to know what you are doing:

Dynamic Static Typing speeds up development because there is physically less to type since ctrl+space and ctrl+2 write the declarations for you.

Its seems obvious to me that Dynamic Typing is worth the catch only for a quick start or for learning.
Since almost all of the dynamically typed languages (like Actionscript, Perl, Php) have migrated to some kind of Static Typing (eg: Type Inference), there should be a reason.

Periodically, a new Dynamically Typed language spawn, attracting junior/tired programmers with the mirage of the simplicity and the less-to-type-ing, riding the hype until his young audience grows and start doing large projects hoping not to call a function with the wrong arguments.

Only then they realize the big truth: Static Typing is just more informations in the source code.
And more information means less wondering-what-object-was or what-was-the-method-name-and-parameters or who-instantiate-this-object, not to mention static analysis.

And hey, they have invented Javadoc-like documentation and Annotations just to add some more information, why remove one of the most important?

Flyer – Python framework for Flash Lite

Tuesday, May 8th, 2007

Flyer is a open source framwork for symbian phones written in python.

From the site:

Flyer is based on the Flash Lite 2.1 integration with Python for S60 and contains the following features:

- Take photos with device camera from Flash Lite
- Take device screenshots from Flash Lite
- Send files over a bluetooth connection from Flash Lite
- Get the contact entries in the default device database
- Text To Speech
- Sound recording and playback

Moreover: 60% of all donations to Flyer Project will be for Brazilian Children

Some thougths on Actionscript in the serverside

Friday, May 4th, 2007

I’ve been always fascinated by the capabilities of Flash, especially in making networked applications (and games) that can run everywhere.

Flash is the only tool that can bring to the maximum audience with the minimum effort a full fledged application/media player/real time network client.
Yes, low-latency, bi-directional, real time messaging. (using XmlSocket connections)

But, even if Flash is such amazing stuff, why there isn’t so much real time, synchronized, networked Flash applications out there?

After some thoughts, some non-blocking servers and a thesis (jira), I think I’ve found the answer: the lack of a server.

Yes, there are many, like the promising Red5, the full-fledged (non-free) SmartFox, Oregano, and others, but no one seems to reach a decent level of notoriety and support.

The chosen one seems to be Red5, with SmartFox coming next with his maturity but the lack of streaming, but there is another one that can won the race with a large margin: haXe.

For those who doesn’t know, haXe is a compiler/language written by the authors of MTASC (Motion-Twin). His main feature is that it can output running code (or bytecode) for Javascript, Flash 8-9 and the Neko VM, with the same language.
But the most interesting features are coming form the Neko VM: the ability to run as a Apache module and the non-blocking sockets support.

What does it mean?

This mean that with only one language and a common set of libraries it is possible not only to build the client, but even the server side of a web application.
And for server side, I mean all kind of server: ‘classic’ webserver serving html from a database, Flash Remoting or a massive chat/multiplayer non-blocking server.

Whats the catch? It’s a C/C++ stuff and the lack of a large community/hype. However, the capabilities are already exciting.

I hope to find the time to take a better look to haXe. In the meantime, I’ll monitor the Java scripting languages support waiting for the ActionScript 3 (Tamarin) ScriptEngine.

Flex 2 components in papervision

Friday, May 4th, 2007

Yes, its really wonderful: fully working Flex 2 components in a 3D enviroment (via Gianfranco Torlone)

Cross-site javascript vulnerability re-discovered

Tuesday, April 3rd, 2007

Richar Leggett wrote on his blog that someone seems to have (re)discovered a new AJAX applications vulnerability and published a paper about that.

However, this type of vulnerability is already known:

when you do a request with Javascript you can only do that to the same domain of your script, but this doesn’t apply to img and script tags

So if you browse a malicious site, this can do a request to any site trough your browser (with your cookies and credentials).

In Flash this isn’t possible thanks to the crossdomain.xml.
However ever this can lead to vulnerabilities if misconfigured or because of the new loadPolicyFile Flash function.

Benchmark time

Saturday, March 31st, 2007

I’ve stumbled upon a good Flash 9/8/7/Javascript speed test.
Its interesting how Flash 7 was somewhat quicker than 8.

Another useful test is this one from Ted Patrick.
I’ve ever wondered if with Flash 9, Firefox was still so much slower than IE: seems not (with Firefox 2 and IE 7).

The hype is over: Apollo

Monday, March 19th, 2007

Finally, Apollo is out:
grab it from the Adobe Lab

To start with it:
Building your first Flex-based Apollo application

Flash socket server + MiceTalk

Sunday, March 18th, 2007

How promised, here my little perl Flash socket server.

This is a simple prototype that I've made to explore the power of non-blocking sockets.
I've tested it with a thousand connections and it should handle some more.
This can be used for a multiplayer flash game or a community chat, but since it isn't "production ready", use it at your own risk :)
It can be also useful to who want to implement his own server.

Features:

  • >=1000 connections
  • anonymous nick, free nick (free to choose you own) and registered nick with mysql/postgre/sqlite/dbo compatible
  • Can run in some web hosts like Dreamhost Update: It violates their policy

Download: Perl Flash socket server

To run:

CODE:
  1. ./creaTestDb.pl
  2. ./flashserve.pl

Here are also a bunch of AS classes to interact with the server and an example application like the "mouse chat" in my website. Update: my hosting (Dreamhost) doesn't allow FlashServe, the party is over
Sadly, since these was made 4 years ago with an italian friend, all the comments are in italian, if someone is interested, I can translate it.

Download: MiceTalk socket server example + Classes

You can use my server at dev.madarco.net:7777 but only in the Flash IDE (no crossdomain.xml)

Red Agency – ff0000.com

Friday, March 9th, 2007

Red Agency Universe

Flash buzz-site of the moment:
Red Universe is an interactive avatar chat in Flash, where you can explore the good-looking world while talking with others.

Little advertisement:
If you'd like to do something similar, look at www.madarco.net. If there aren't other users connected (likely), open it in two tabs and move the mouse to interact, type to talk.
I'll release my quick-and-dirty flash socketserver soon, it is written in perl and run on every Dreamhost hosting.

I have a website

Thursday, February 22nd, 2007

Finally!
Since I'm looking for a job I realized that I need a personal website, so I've quickly made a simple one.
Nothing special, apart that you can see the mouse of the others guests and talk with them (just write, then press enter).
Enjoy!