Photos from Abobe Flex Camp Timisoara, Romania

Yesterday I was in Timisoara attending to a conferenceΒ hosted by Adobe Romania. I saw a lot of great things and some interesting projects done by romanian developers. Here I have uploaded some pictures from this event πŸ˜‰

After this event we (Me, Costi, Biro and his girlfriend) got out for a walk in Timisoara so we can make see the city and take some pictures. Thank you Biro for being our guide! πŸ˜‰

Odd or Even number in ActionScript

I was making a project for a client of mine where I had to make a list with two different colors for the items (like the iTunes list) so I started to think of a possible way to make this. It was clear enough I need to know the odd or the even number in order to do that. So I started to do some google search and I got over this blogpost by Keith Peters. I have to say, this is a very interesting way of thinking πŸ˜€

iseven = ((num & 1) == 0)

Makes sense when you look at binary numbers:

001 = 1
010 = 2
011 = 3
100 = 4
101 = 5

Each of the odd numbers has a 1 in the far right column. The even numbers have 0 there. Mask it with β€œ& 1β€³ and you can see which it is.

So I made a for loop and used this code. It works exactly how it was intended to work!!
Thanks Keith Peters for your blogpost πŸ˜€

Turntable

Yesterday I took this shot and today it got accepted on iStock.
The image is done with my Canon 400D and my 50mm lens with Canon 430EX flash.

Drawing app

Right now I’m still reading “Learning ActionScript 3.0” book so I can improve my AS 3 skills. In the “Draving with pixels” chapter there is a great example of a little drawing application that I like. Here you can see the code for that little application:

var mouseIsDown:Boolean;
var erasing:Boolean;
 
var canvas:Sprite = new Sprite();
addChild(canvas);
 
var w:Number = stage.stageWidth;
var h:Number = stage.stageHeight;
var bmd:BitmapData = new BitmapData(w, h, false, 0xffffffff);
var bm:Bitmap = new Bitmap(bmd);
canvas.addChild(bm);
 
var brush:Sprite = createBrush(0x66cc00);
var eraser:Sprite = createBrush(0xffffff);
 
function createBrush(col:uint):Sprite{
	var sp:Sprite = new Sprite();
	sp.graphics.beginFill(col, 1);
	sp.graphics.drawCircle(0, 0, 30);
	sp.graphics.endFill();
	return sp;
}
 
canvas.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
canvas.addEventListener(MouseEvent.MOUSE_UP, onUp);
this.addEventListener(Event.ENTER_FRAME, onLoop);
 
function onDown(e:MouseEvent):void{
	mouseIsDown = true;
	if(e.shiftKey)
		erasing = true;
}
 
function onUp(e:MouseEvent):void{
	mouseIsDown = false;
	erasing = false;
}
 
function onLoop(e:Event):void{
	if(mouseIsDown && erasing){
		eraser.x = mouseX;
		eraser.y = mouseY;
		bmd.draw(eraser, eraser.transform.matrix);
	}else if(mouseIsDown){
		brush.x = mouseX;
		brush.y = mouseY;
		bmd.draw(brush, brush.transform.matrix);
	}
}

And if you click here you can see the result (click to draw and hold the shift key + click to erase)
This book has a lot of good examples and it’s very easy to understand. I recommend it to anyone how wants to start with ActionScript 3.0 πŸ˜‰

The best TED ever – Lennart Green: Close-up card magic

This is a very funny episode and one of the best TED episodes I’ve seen πŸ˜€

Canon EF-S 17-55 f/2.8

At work playing with Canon EF-S 17-55 f/2.8 lens πŸ˜€