CT — Turin

TW x PK

C’était hier soir, c’était à Bor­deaux, y’avait du monde… Et j’avais bien fait de m’entrainer un peu avant !

Le son n’est pas extra, l’image est un peu moyenne mais l’ambiance est là ! Merci aux organ­isa­teurs d’avoir pensé à moi, merci aux gens qui sont venus me voir après pour par­ler ornitho­rynque, merci à Céline pour avoir appuyé sur le bou­ton aux bons moments (et pour l’encodage !), merci à Renaud, à ma man­ageuse, aux tick­ets bois­son, au tram qui n’a pas accepté de nous pren­dre… Je m’arrête là, de toute façon per­sonne ne sait de quoi je parle !

Voilà donc ma ses­sion de cette 4è Pecha Kucha, hop.

Mise à jour (08/05/2010) ! Une photo et la liste des slides, avec quelques liens…

  1. No Online Friends
  2. Cahier d’enfant — Icônes
  3. Mon bureau - Play Sta­tion
  4. L’ornitho­rynque
  5. Scroll Clock
  6. Scroll Effect
  7. dribb­ble
  8. Kwot
  9. Kid Acne
  10. FFFFOUND Desk­top
  11. Erosie
  12. Buck 65/20th
  13. Eltono+Nuria
  14. Les sites morbides…
  15. Alope­cia+Alope­cia
  16. Boks
  17. Les Gens
  18. Jan Vor­mann+truth
  19. Paper
  20. No Requests

Boo­gie down!

Tarticrêpe

Went snow­board­ing this week-end… Hunger and alti­tude helped us develop a new culi­nary concept.

Drank some Bir­lou, lis­tened to Da Baby­lo­ni­anz, didn’t break any of my bones. Dope.

Two!

Wow, the blog is 2 and I almost missed it…

Gordon Magnin

Cute as fuck

Dynam.ize

Still while work­ing on this app I was talk­ing about ear­lier I real­ized I was quite used to work­ing with PHP classes’ Magic Meth­ods, and more pre­cisely the way it han­dles over­load­ing. Those lovely __get, __set and __call meth­ods are called when­ever you try to access a property/method that is not explic­itly defined, mak­ing your class dynamic. Of course you don’t need this all the time, and it might even be dan­ger­ous, but it some cases that’s sim­ply perfect.

You can do that with AS3 if you extend flash.utils.Proxy, cool. But wait, no! Not cool! What if I wanted to extend some­thing else? Nah, let’s find some­thing else…

I came up with the idea of dynam­i­cally cre­at­ing get­ter and set­ter func­tions on a class instance for pre­de­fined properties. Now those aren’t really get­ters and set­ters but let me show you what it looks like so you under­stand bet­ter… Here’s an example:

package {
	import net.tw.util.Dynam;
	// This is my class, that has to be dynamic
	public dynamic class DynClass {
		// This Array will be used to store the properties' values...
		protected var _data:Array=[];
		public function DynClass() {
			// In the constructor I call the Dynam.ize method on this, so it builds the getters and setters for the supplied properties
			Dynam.ize(this, ['abc', 'def', 'ghi'], getter, setter);
		}
		// Here are the functions that will be called when I try to get or set one of the properties I listed in Dynam.ize
		protected function getter(key:String):* {
			return _data[key];
		}
		protected function setter(key:String, v:*):void {
			_data[key]=v;
		}
	}
}

Now let’s instan­ti­ate this class and play with it:

var dc:DynClass=new DynClass();

We can call getAbc() or setAbc() on it:

dc.setAbc('my value');
trace('get abc', dc.getAbc());

Every­thing should be OK. It would work the same with get/setDef and get/setGhi… This exam­ple might not seem very use­ful but you could do any­thing within the get­ters and set­ters ; for exam­ple access Share­dOb­jects, send­ing data to a server and so on…

Find the class and a demo project on as3-bits!

Com­ing up next: my imple­men­ta­tion of this con­cept for AIR’s SQLite databases!

Thoughts?

Useful advices

Legos

Catch phrase

Just show­ing off a bit, sorry.