Using Flash CS5: AS 3.0

So I need to know how to use a snippet of code I got off of the website. I want to use they're API to do searches in my group forum. What I have is the following code:

How do I apply this to an action on my search button. I think the "q=cats" part of the URL represents what the users query is so how do I capture what the user types and code that into the string?

I'm totally lost on this.