This is a 2010-to-2013 archive of toki-woki.net. Here's how it looks now.

Kwot JS

Remember Kwot, my Flash quote viewer? I published it back in December 2008.

It is a mix of Flash (most part of it), JS (for the add form and its communication with the main UI) and PHP (CRUD logic). Read the blog post for more details on it.

I recently started looking at JavaScript frameworks and tools, probably like most Flash developers. Not because Flash is dead, but because the more tools you master, the better you are. And because yes, everyone is asking for JS and CSS3 these days. After some investigation I decided to give Backbone.js a try. And re-writing Kwot from scratch with it seemed like a great exercising opportunity.

So here its: Kwot JS!

It should work really well on Safari, OK on Chrome, not-that-perfect on Firefox and poorly on Internet Explorer. You were looking for a reason to continue using Flash for building "experience sites"? There you have it: compatibility. Kwot JS relies on CSS3 transforms to allow this perspective view on quotes, and on property transitions to animate the quotes' colors. Of course this doesn't work in all browsers!

Now, about Backbone.js. The framework's requirements and logic are good, but coming from an AS3 world mostly everything looks odd, for better or worse. Note this is my first project with it and I might have missed some good practices or handy tips.

The good thing is its persistence layer. In Kwot, quotes are stored in a database, I simply wrote a simple RESTful API with Slim (try this PHP framework: win) and connected it to my Model classes. That's it, it just works. Underscore.js' templating system is handsome, too. Never used that before, cool stuff.

The bad things are, as far as I'm concerned:

  • No strong typing. Of course this isn't Backbone's problem, but rather JS' one. On this particular point your IDE can help, but you won't get runtime errors.
  • The "this" keyword. You always end up with plenty of lines all starting with a "this.something". It frustrates me.
  • Scope issues: when listening to events you pretty much always have to use Underscore.js' bind method in order not to lose your infamous "this" scope. I don't like that.
  • The MVC pattern. If you ask me: it sucks. I'm no integrist but I wouldn't have called what Backbone provides MVC. I was always wondering "who should do that?" and never really came up with a satisfying answer.

Overall the learning curve is pretty steep, I think it took me less time to write this version than the Flash one, but I'm a 3 year more mature developer. Also, when I wrote the Flash version I didn't really know where I was going and I kept experiencing with concepts and ideas to see what would look best.

On a side note the Flash version uses Neutra, whereas this one uses Questrial (hosted and served by Google Webfonts).

Tell me what you think, both about the app and the framework!

La Classe Américaine – Android

Hey, fellow english-reading visitor, this post is going to be in French! Hope you don't mind.

Si comme moi vous ne pouvez pas vous empêcher de dire "flim", "ouiche" ou encore "un pour l'argent, deux pour le spectacle et trois pour le caillou", cette application est pour vous.

Après une semaine de vacances avec une personne touchée par cette maladie et sans avoir accès à Internet j'ai vite réalisé qu'il me fallait une application contenant tout le script de ce magnifique flim : La Classe Américaine. Je savais qu'un fou avait déjà fait tout le sale boulot et qu'il ne me restait plus qu'à extraire ces données et créer l'interface pour les parcourir...

Grâce à Google Chrome et ses Outils de développement j'ai pu injecter MooTools dans la page. Petite astuce très simple et très pratique (script à copier/coller dans la console) :

  1. var scriptNode = document.createElement('SCRIPT');
  2. scriptNode.type = 'text/javascript';
  3. scriptNode.src = 'https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js';
  4. var headNode = document.getElementsByTagName('HEAD');
  5. if (headNode[0] != null) headNode[0].appendChild(scriptNode);

Après ça, quelques lignes pour extraire les données, les nettoyer et les stocker directement dans le presse-papier au format JSON :

  1. var data=[];
  2. var images=$$('table.script img');
  3. for (var i=0; i<images.length; i++) {
  4. var tr=images[i].getParent().getParent();
  5. var o={};
  6. var scriptTag=tr.getElements('td')[2];
  7. scriptTag.getElements('a').dispose();
  8. data.push({
  9. ts:tr.getElement('small').get('text'),
  10. script:scriptTag.get('html')
  11. .split('’').join("'")
  12. .replace(/\n/, '')
  13. .replace(/<br>\n$/, '')
  14. });
  15. }
  16. console.log(data.length);
  17. copy(JSON.encode(data));

Un petit coup de Flash Builder, saupoudré de Robotlegs et hop, une appli Android ! Pas de version iPhone pour l'instant, mais si quelqu'on m'offre de quoi me payer un certificat de développeur, je ne dis pas non !

Au revoir, Messieurs-Dames. C’est ça, la puissance intellectuelle. Bac + 2, les enfants.

Okr – Story of a failure

Some projects become real, others never see the light of day. This one is more of an abortion.

Six month ago I've been contacted by an architectural firm to provide some consulting on a project of theirs (I'm not going to name names, you'll understand why). The goal was to find ideas to make a building's front more interesting. The building being a place to help and promote Hip-Hop culture.

So I started working on it and came up with ideas and concepts. The architect I was in contact with seemed pretty happy with it and everything was looking good.

Until I no longer received any answer to my e-mails... Our last interaction is now 5 month old and I think time has come to mourn. What I came up with can be interesting and since it involves an OpenSource project, here are a few bits about it.

At that time I was discovering  GML (Graffiti Markup Language) and Evan Roth's work. Bordeaux hosted Les Grandes Traversées and all of this really inspired me. So I thought of a mash-up between GML's #000000book (black book, open archive of GML tags), a player of my own (Okr), the building itself and Twitter. Here's the document I presented to explain what I had in mind.

The steps are:

  1. Creating and sending a graffiti;
  2. Receiving data;
  3. Converting it to an image;
  4. Projecting it on the building's front;
  5. Photo-shooting of the front;
  6. Sending to Twitter;
  7. Online consultation.

After a few e-mails with Jamie Wilkinson (heads up!) I started working on the core classes writing GMLPlayer and GMLCreator. The goal was to provide both a way to display tags and to create/upload them. I then built a UI around all that (a Flex one, after noticing Minimal Comps didn't work the way I expected).

iframe: <a href="http://toki-woki.net/p/Okr/">http://toki-woki.net/p/Okr/</a>

Note: you'll also find the app on its dedicated page. Try searching for "dasp" or "hello world" for example and play with the settings (the 3 top sliders).

Unfortunately it is only after creating all this that I realized the project would never become real... So I simply stopped working on it. I am well aware that some parts of the code is a bit raw and could be optimized and I haven't built the creation/upload feature into the UI yet. Don't know if I will, but the project is OpenSource so feel free to give it a spin! I also share my initial attempt and a pixel version in case you're interested.

Pretty happy that — even if not feature complete — Okr made it to the GML project gallery, yay!

And just because a project will never see the light of day doesn't mean it doesn't need a proper logo, right?

Evnt — Custom AS3 Event File Generator

I recently started working with Robotlegs on a daily basis and I've never had to write that much custom event classes, so I felt like it was starting to be a little bit boring... That's why I wrote a pretty basic/simple app that does hard part for you!

Simply enter you custom event's class name and package, drop in some constants and properties: you're all set!

Pro-tips:

  1. Reorder the constants and properties by dragging and dropping them
  2. Use custom types for the properties, imports will be taken care of for you
  3. Hit "Copy to Clipboard" or "Save As..." for a quick export!

Project is brand new so it might require some fixes or improvements... If you have ideas, please share!

And before you ask: no, it wasn't written with Robotlegs... But it's OpenSource so if you want to take a spin and write the RL version of it, you'll be able to do so!

Hope this helps!

Dok — AS3 Doc. UI

Meet Dok, my latest and nicest AIR app to this day!

Always looking for help when writing AS3 for Flash, Flex and AIR? Think Adobe's reference is rich but browsing it sucks? Well, I did too. So I wrote this little thingy that loads, parses and caches help pages and then presents them in a slick and quick UI!

Since this app is only intended for devs and therefore may not be very interesting to others, I decided it should look good. So I tried my best and worked hard on those pixels and styles (colors and textures inspired by that sweet clock)... Jump to the project page for life-size screenshot!

This project is absolutely OpenSource, from top to bottom. AS3 classes, MXML, Illustrator and Photoshop files, PNGs and so on... Help yourself.

Kwot

A new project is online! It's called Kwot, and it allows you to share and store your favorite quotes.

The UI is quite minimalistic, with focus on simplicity. Navigate through quotes with your mouse wheel, your keyboard's left and right arrow or the mini timeline at the bottom. Add a quote by clicking on the plus button at the bottom right hand corner. If you don't pick any color they'll be automatically chosen via a magic algorithm! Another magic algorithm will rotate your quote in 3D space. But don't worry you will preview that in real-time, ha!

I might add user (login) support, language tagging, an RSS feed and stuff like that but don't expect that too soon, holidays are coming!

If you don't have the Flash plugin or if you visit the site on an iPhone the site will look quite different but everything will remain!

A few things I used in case you wonder: swfaddress (you will love deep-linking!), GTween, FlashDevelop, AMFPHP, the viewport width attribute... Oh, and by the way, the font face is called Neutra.

Add some quotes and drop feedback!

FFFFOUND AS3 API

I recently released FFFFOUND Desktop, this AIR app uses a home-made API that I'm open sourcing today. The code is hosted on Google Code and is available via SVN, I also uploaded a zip archive if you prefer.

You'll find the (asdocs) docs in the repository and in the archive.

By the way, I love feedback. If you use it: please share!

Also, if you need examples on how to use it, ask. I think the sources are self-explanatory but I might be wrong.

A few important things (also posted on the project's page):

  • For now, this API will only work in AIR projects because ffffound.com's crossdomain.xml is too restrictive. I've contacted them but at this time they don't want to change it.
  • The API relies on FFFFOUND's RSS feeds but also on the site's pages' HTML, so some functionalities might break at any time without warning. Use with caution.

Watch the comments for any update or news!