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);
}
Sunday, November 28, 2010
Thursday, November 11, 2010
Thursday, June 10, 2010
Friday, November 6, 2009
Saturday, October 17, 2009
Monday, June 29, 2009
Wednesday, April 29, 2009
AS2/3 stage height & width
AS2 Stage.height and Stage.width
AS3 stage.stageWidth and stage.stageHeight
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");
}
var coffee:Number = 5;
switch (coffee){
case 5:
trace("coffee yeah");
case 5:
trace("no coffee");
default:
trace("nothing");
}
Friday, April 17, 2009
Thursday, March 26, 2009
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;
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);
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;i if (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;i aThumbs[i].addEventListener(MouseEvent.ROLL_OVER, btnOver);
aThumbs[i].addEventListener(MouseEvent.ROLL_OUT, btnOut);
aThumbs[i].addEventListener(MouseEvent.CLICK, thumbClick);
aThumbs[i].mouseChildren = false;
}
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;i
index = i;
}
}
aPhotos[index].visible = true;
}
function clearPhotos():Void{
mPhoto0.visible = false;
mPhoto1.visible = false;
mPhoto2.visible = false;
}
for (var i:Number = 0;i
aThumbs[i].addEventListener(MouseEvent.ROLL_OUT, btnOut);
aThumbs[i].addEventListener(MouseEvent.CLICK, thumbClick);
aThumbs[i].mouseChildren = false;
}
Sunday, March 22, 2009
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);
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);
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
Monday, December 1, 2008
coffee
Sunday, November 30, 2008
Friday, November 28, 2008
Tuesday, November 25, 2008
Subscribe to:
Posts (Atom)