Sunday, November 28, 2010

future endeavour algorithm

Idea FindGoodProductIdea()
{
Idea candidateIdea = null;
while (true)
{
candidateIdea = new Idea();
if ( candidateIdea.IsGood() )
{
break;
}
}
return candidateIdea;
}

or this one

Idea FindGoodProductIdea()
{
ArrayList candidateList = BrainstormLotsOfIdeas();
return ChooseTheBestIdea(candidateList);
}

Thursday, November 11, 2010

qml variable

property int varName: 10
anchors.horizontalCenter: parent.varName

Friday, November 6, 2009

pour


pour
Originally uploaded by joakim christoffersson
I'm quite happy with this pour

Saturday, October 17, 2009

Rijl logo

Monday, June 29, 2009

Random colors in AS3

http://www.kirupa.com/developer/as3/random_colors_as3.htm

Wednesday, April 29, 2009

AS2/3 stage height & width

AS2 Stage.height and Stage.width
AS3 stage.stageWidth and stage.stageHeight

AS2 switch

Actuallt didn't know about the switch command that works like an if statement.

var coffee:Number = 5;

switch (coffee){
case 5:
trace("coffee yeah");
case 5:
trace("no coffee");
default:
trace("nothing");
}

babycard


made a little baby card for a co-worker

Friday, April 17, 2009

Giraff

Thursday, March 26, 2009

dog



I just had a couple glassed of wine, nuf said.

Tuesday, March 24, 2009

simple set up of video

// hook up a flv in the same folder
flvMyVideo.source = "myVideo.flv";

// skin need to be in same folder
flvMyVideo.skin = "SkinUnderAll.swf";
//set skin color (rmember to replace # with 0 x
flvMyVideo.skinBackgroundColor = 0xFFFFFF;
//set bg alpha
flvMyVideo.skinBackgroundAlpha = 0.5;

flvMyVideo.autoPlay = false;

Monday, March 23, 2009

how to set up a sound

// set up a url request and link it to a sound
var musicURL:URLRequest = new URLRequest("xxx.mp3");
var sndMusic:Sound = new Sound(musicURL);
var channel1:SoundChannel;

// event handlers starts with a function, this one is to check that the sound load correct
function errorMsg(evt:IOErrorEvent):void{
trace("the sound could not be loaded");
}
sndMusic.addEventListener(IOErrorEvent.IO_ERROR, errorMsg);
function soundLoaded(evt:Event):void{
trace("music is loaded");
channel1 = sndMusic.play();
}
sndMusic.addEventListener(Event.COMPLETE, soundLoaded);

simple image site based on arrays

ok code is quite stripped down so some pieces missing. But it's easy to understand how to put it together.

var aPhotos:Array = new Array(mPhoto0,mPhoto1,mPhoto2);
var aThumbs:Array = new Array(mThumb0,mThumb1,mThumb2);

function thumbClick(evt:Event):void {
trace(evt.target.name);
clearPhotos();
var count:Number = aThumbs.length;
var index:Index:
for(var i:Number = 0;iif (evt.target.name == aThumbs[i].name){
index = i;
}
}
aPhotos[index].visible = true;
}

function clearPhotos():Void{
mPhoto0.visible = false;
mPhoto1.visible = false;
mPhoto2.visible = false;
}
for (var i:Number = 0;iaThumbs[i].addEventListener(MouseEvent.ROLL_OVER, btnOver);
aThumbs[i].addEventListener(MouseEvent.ROLL_OUT, btnOut);
aThumbs[i].addEventListener(MouseEvent.CLICK, thumbClick);
aThumbs[i].mouseChildren = false;
}

Caveman watching TV

Sunday, March 22, 2009

AS3 simple visible control

mClip.visible = false;

AS3 How to use one function for several buttons

function btnOver(evt:Event):void{
trace(evt.target.name);
evt.target.gotoAndPlay("rollOver");
}
mClip1.addEventListener(MouseEvent.ROLL_OVER,btnOver);
mClip2.addEventListener(MouseEvent.ROLL_OVER,btnOver);
mClip3.addEventListener(MouseEvent.ROLL_OVER,btnOver);

Saturday, March 21, 2009

Making a basic button in AS3

It don't get much more basic than this but it's quite a big difference making a button in AS3 then in AS2.

function clickButton(evt:Event):void{
trace("the mClip button is pressed");
}
mClip.addEventListener(MouseEvent.CLICK,clickButton);

Friday, March 6, 2009

Desk crap

No postings sinse forever, I know. In the lack of samething good here is a desk doodle from a meeting today.

Sunday, February 1, 2009

Thoughs about this blog

I was just reading "The Long Tail" about very narrow consumption and from now on I will both widen and narrow this blog. It will be a weird combo of sketching, video effects, AS scripting and other creative shit. Go figure!

Sunday, December 7, 2008

old guy


Made a digital sketch of an old dude. Sometimes is'n nice using the wacom but the downside is the result can get too smooth and this guy is missing some ruggedness.

Monday, December 1, 2008

coffee


This is a true doodle (2min I think). I have been playing a bit with just making pictures from shadows without starting with any lines. It is actually more tricky than you might think, especially to get the perspective and composition right.

Sunday, November 30, 2008

Friday, November 28, 2008

Fish





I had a little fish theme going on tonight.

Tuesday, November 25, 2008

mechanism