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: 
No, not usually. The languages are similar but different. Case-sensitivity of identifiers is one big one (for old versions of ActionScript).
There are AS2 and AS3 languages and they are based on different versions of ECMA script and not compatible. Application code on AS2 without flash API is quite similar to js.