Following code loops through the form and creates an associative array of form elements:
frmElmts = new Array();
for(i=0; i<document.formName.elements.length; i++)
frmElmts[document.formName.elements[i].name] = document.formName.elements[i].value;
Here flash.external is a package where the class ExternalInterface is found.
alert("Hi from flash");