I wrote a tutorial “Call Javascript Functions From Flash and Flex” about how flash calls javascript function. I think it is necessary to write another tutorial about how the javascript function calls actionscript function inside flash. See the example below: