Answering Mike's Challenge

| 5 Comments

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? :-)

5 Comments

Leave a comment

Flex.org - The Directory for Flex

Archives