;

PDA

Click to See Complete Forum and Search --> : advisor to the king


blanius
09-03-2008, 11:04 PM
I subscribe to a cool magazine called "Make"(makezine.com) in the current issue was a simple basic program called proverbs that I thought was cute so I coverted it to flash..

http://bretlanius.com/flash/advisor.html

Very simple Actionscript

randomRange=function(Min,Max){

return Math.floor((Math.random()*Max-Min+1)+Min);

}
part1 = new Array("A bird in the hand","A friend in need","A job worth doing","A little knowledge","A stolen pleasure","A thing of beauty","Absolute power","All work and no play","Anger","Blind ambition","Charity","Crime","Curiosity","Envy","Evil","Generosity","God in his wisdom","Haste","Heaven above","Hindsight","Honesty","Impulsive behavior","Jealousy","Love","Misery","Money","Much ado about nothing","One good turn","Pride","Procrastination","Regret","Revenge","Selfishness","Success","The devil you know","The darkest hour","The early bird","The pursuit of happiness","The road less travelled","The road to hell");
part2 = new Array("breeds contempt.","brings happiness.","can work miracles.","cannot buy happiness.","comes before a fall.","comes to those who wait.","corrupts absolutely.","costs nothing.","does nobody any good.","doesn't pay.","has a silver lining.","heals all wounds.","hurts.","is a dangerous thing.","is a joy forever.","is a mixed blessing.","is bad news.","is best forgotten.","is better than nothing.","is bliss.","is cheap.","is good news.","is its own reward.","is next to godliness.","is only skin deep.","is often spoken in jest.","is sweet.","is the best medicine.","is the best policy.","is the root of all evil.","is the path to wisdom.","is a thing of beauty.","justifies the means.","kills.","lasts forever.","leads to a lifetime of regret.","makes you stronger.","pleases no one.","speaks louder than words.","will move mountains.");

btn1.onRelease=function(){
x1=randomRange(0,part1.length-1)
x2=randomRange(0,part2.length-1)
p1=part1[x1];
p2=part2[x2];
txt1.text=p1+" "+p2

}

necromanthus
09-04-2008, 04:24 AM
http://bretlanius.com/flash/advisor.html

Very nice.
Initially, I thought it's an "advisor to Bob H".
:cap:

Stoke Laurie
09-04-2008, 08:58 AM
It gave me
Anger is the best medicine!
Then
Anger speaks loder than words!:)
Wise words indeed

blanius
09-04-2008, 10:12 AM
Yeah cracked me up too.....

What I love about KM is that I threw this together in 5 minutes, clip art from Microsoft and a font I had then converting the basic code to AS1

Nightcap
09-04-2008, 02:44 PM
Success can work miracles.

and

Money is bad news.

Really nice Blanius and thanks for the code!

:cap:

blanius
09-04-2008, 06:40 PM
I like this one
Impulsive behavior makes you stronger.

Chris_Seahorn
09-04-2008, 06:53 PM
I think I found a bug. Mine said:

Love Lasts Forever

obviously a bug :)

mvivit
09-10-2008, 03:03 PM
Fun stuff! Thanks!