I'm surprised no one has addressed your question earlier. ActionScript is a scripting language based on ECMAScript (Javascript). For more info on actionscript check out the wiki:
http://en.wikipedia.org/wiki/Actionscript
As far as communication between flash and javascript, this has been greatly improved since flash 8 with the introduction of the ExternalInterface class which allows for easy communication between flash events to javascript functions and the other way around. This site is also a great resource for particular questions you might have on your project. Check out either the actionscript 2 or actionscript 3 sections for specific questions depending on the technology you decide to use.
Happy coding.
Jason