Run a javascript function from Flash

I have a search form in my swf that consists of an input box and btn. Maybe this is more complicated than I think. Please excuse my ignorance.

I have a javascript search function that works with a html form button, but I would like to run that function with my flash btn and use the text input box that searches for that string (don’t want to use the Atomz search cause the free one comes with ads, I think).

To run a simple javascript (say, myFunction()) from a flash btn, you just do:

getURL(“javascript:myFunction()”); and that works just fine for those types, but if they have vars in them, such as myFunction(myVars), then

getURL(“javascript:myFunction(myVars)”) won’t work.

So, what is the correct way to run that function from flash, or am I just totally off?

Or, where can I get a tutorial to run a site search from a flash btn and input box?