Clay Shirky compares two social media/ data based community projects and explains in a fairly simple manner how creative subversion makes tools/projects successful.
via watch it at Fora.tv (about 10 min)
Among one of the coolest things I came across in Flash’s Actionscript 3 is the class ‘getDefinitionByName’. What it does (in short) is turning a class name in the form of a String into a class you can create an instance from. What this means is, you can create most flexible class creation built on cases.
E.g. instead of building a long switch…case list, you can add string names based on the elements an instance should have and call the specific class.
I use it for example to have a component that can call clips and bitmaps graphics from the library. The clip name can be handed over by XML and the appropriate clip can be added, without re-render or re-coding of the component.
I also build a centralized component-mediator control, that stores all possible pairs, so whenever I call for a component to be used in a mediator, it calls the right class. Which let’s me leave the display engine as is and only the content central changes from application to application.
Here is how I use it in a pureMVC environment:
var tMediatorClass:Class=getDefinitionByName(myMediatorClassName) as Class; facade.registerMediator(new myMediatorClass(myComponent.id,myComponent));
There is though, one tricky issue. As long as you don’t mention a class’ name in the code, the compiler won’t implement it, meaning that your app will throw an error. Therefore, I changed my code to this:
var tMediatorClass:Class=getDefinitionByName(myMediatorClassName) as Class; switch (myMediatorClass.NAME) { case BasicMediator.NAME : case EventMediator.NAME : facade.registerMediator(new myMediatorClass(myComponent.id,myComponent)); }
I think I am still saving quite some lines here, especially given that a project can have a fir mount of mediators and components.
Just in case someone else is having the same issues solving coding problems with PureMVC, which is some darn great core for any application, here are my musings:
Re-using Mediators
I used PureMVC to recreate my existing AS2 framework, which means my mediators don’t know in detail, when and how many are used, etc. And for re-usablity reasons, I have to re-name them to establish a unique identifier. For example: all my static components pretty much just need one mediator which initializes the component, can switch them on/off and change layout, etc.
To make it short: one mediator for any number of text components. Unique identifiers for each mediator.
PureMVC’s elements(mediators, proxies) are using two ways to identify themselves, NAME and proxy/mediatorName, the latter is changeable, so there is your way to rename it.
There is an interesting article on Gizmodo about the price drop on iPhone apps in comparison to other mobile apps that raised quite a debate.

There are the ones saying that the market will regulate itself for the better(we heard something similar for years) and others that see the quality of apps diminish as prices for development drop. I love to be on the negative side of things, that’s just my critical nature, but also because there is another big thing coming that will most surely accelerate the issue of more apps being developed, who will disappear amongst the millions of apps. As previously mention here, Flash not only launched full AS3 support for mobiles, they also included the ability to develop Flash apps for the iPhone through the appstore.
That might easily double the number of available mobile apps everywhere. Apple still has it’s restrictions on what it considers an app worthy of…, but let’s just say more iPhones will be hacked and other mobiles will become more attractive because they are open to the porn industry.
After a quick hype in doing mobile apps, developers will be expected to churn out twitter-farting apps by the wagon-load for an ever so diminished salary, because the app’s distribution concept of delivering low-priced apps but financing through assuring large number sales will fall flat on it’s face apart for companies with big marketing budgets to get the app to a high visibility in the shop and make sure enough people buy it. Which even then might not be assured.
So there is a lot to watch over the next few months. The xmas business will finally start when Orange and Vodaphone will come out with the iPhone in the UK, just like in other countries, where the iPhone-provider monopoly will end.
Ah, and congrats again to my friend Stefan from flashcomguru.com, he managed to get himself on the first list of Flash-based iPhone apps.
via gizmodo
Finally a praise from my side to Adobe. They pulled it off and are making Apple’s life both easier and harder. Flash CS5 will now support iPhone App development, sold though the app store. This, along with the fact that Adobe just launched their fully supported player on literally all mobile platforms, pretty much marks a new era for mobile apps. One for all has probably never been more true. The major hurdle for application developers were operating system and hardware differences like screen sizes, etc. Now if Adobe manages to enable all hardware feature access (GPS, etc.) then we are pretty much game…
Here some rather boring examples Adobe came up with so far: click here
I am taking this opportunity to document a few things on the way to get from AS2 to AS3.
One alarm bell is the change of the meaning of ‘private’. Essentially, ‘protected’ is the new ‘private’. ‘private’ is more restrictive now. It actually means, any ‘private’ var or function can’t be used anywhere else except the class it is defined in. That does not include extended classes. The extended class will not knwo any private elements of the base class. So be sure you use protection.
via this site
One week before the launch of project80Days, google-maps killed the open-soruce AS2 support for the map and I was without a map, project80Days being an older project that I never had bothered to update to 3.
The map being the heart of the app was more than a bummer. So I was eager somehow get this sorted. Absolutely to my surprise(or maybe not, oh holy internet), I remembered that I can have and AS2 movie running in a AS3 container, no problem, but I needed communication between those. No normally AVM1 containers are like black boxes to AS3, so what to do.
SWFBridge is a free and seemingly easy to implement solution, and it saved my behind. It uses the LocalConnection class of flash and is fairly easy to implement, yet a nightmare to debug as flash was consistently crashing when I was running the app, maybe due to the heavy activity of the AVM1 movie.
So far after using it for nearly two weeks, I would still recommend it as a quick fix, or good solution, as long as you don’t have too much communication going on between AS2 and AS3. The slight time delay restricts it’s use a bit and coding for a time delay, when you have dependencies, made me split up many of my processes.
On the top of that, I discovered, that after using it for a while (speak reloading the movie in Firefox on mac, it stopped communicating and I had to restart the browser. Same goes for the crashes, when it takes down Flash(and Flash is my top-list crasher, if not only anyways) a LocalConnection seems to keep lingering, making it unable to establish a new connection on the same movie. I had to restart the laptop everytime that happened.
So if you are in dire need, take it and it will do it’s job, for a clean job, update to AS3.
I put a copy of the class on my server: download here
or get it from where I found it at gskinner.com