Question: I recently realised that Actionscript and Javascript are both implementations of ECMA script. Now I'm wondering what this means in practice.

I have a Flex application written in Actionscript and I'm looking at porting parts of it to Javascript for use in AJAX apps. I have had virtually no exposure to JS so far (not counting occasional onClick handlers in my HTML), so maybe the question is silly. But can I just take my Actionscript classes and use them in JS code?

Naturally, I can't use any of the Flash Player APIs in JS and no DOM in my Flash movie, this much is obvious. Are there other important libraries on either side that can't be used on the other?

Answer: 
AS3 is an ECMA-script dialect at best. It is an implementation of a ECMA-script draft that has been completely dropped. JS is a subset of AS3. However the ActionScript compiler included in the Flex SDK will complain about any untyped variable or function, so you'll have an awfull lot of warnings when you compile.

You should definitely have a look at [Jangaroo](http://www.jangaroo.net/home/).

And, as always, my personal advice is for you to slowly migrate (at least the logical parts of your application) to [Haxe](http://haxe.org/doc/intro) for obvious reasons. You can use [as3tohaxe](http://groups.google.com/group/as3tohaxe/web/about-as3tohaxe), to facilitate porting.
No, not usually. The languages are similar but different. Case-sensitivity of identifiers is one big one (for old versions of ActionScript).