« MXDU, Sydney... farewell! Enumerated Types in ActionScript »

March 01, 2004

Answering Mike's Challenge

Did you see the challenge Mike Chambers posted for created a search engine in 4 lines of ActionScript? Well.. I've done it, and I'm pretty sure this is the best solution given thus far. Are you ready?

I'm using 2 components from the v2 framework, a Button and a TextInput. Drag them both onto the stage, name the Button "search_btn" and the TextInput "search_txt" and then add the following code to the timeline:

function click() {
 	search_txt.text = "No results found for " + search_txt.text + "!";
}
search_btn.addEventListener("click", this);

Pretty slick, right? Of course, you'll never find any results no matter what you search for.. but the specification didn't say that it had to actually return useful information! What do I win? :-)

Comments

  • haha....funny...

  • Hey, this would run pretty fast too!

    Best regards,

  • Note to self: Need to qualify success parameters more completely in the future.... ;-)

    jd/mm

  • heh, the most functional script I've ever seen :D

  • Que bueno!
    Un toque de humor sienta muy bien!
    ;)