I'm with the guy who said don't worry about javascript. Ultimately, js is only dynamic within the given page. If you want your site to have a database backend, or be truly dynamic, you'll need a server side language like Rails or PHP. If you are interested in that, then I heartily suggest a little framework called Sinatra (http://www.sinatrarb.com/) that code on the front page works, and if you run it, will set up a server that catches a http get request to the url '/hi', and returns the string "hello world" So it is very easy to get started with Sinatra, and the majority of what you learn doing Sinatra will prepare you for Ruby on Rails, which is a lot to learn when you first get started (Agile Web Development With Rails was way over my head when I first started). If you are interested, there is a wonderful hour long screencast by Peepcode for $9, at http://peepcode.com/products/sinatra And they cover a lot of ground. They also have RoR screencasts, but I'm not sure how up to date they are. If you're really interested in rails, guides.rubyonrails.org is probably the best online resource I've ever seen (better than Java API, even, IMO).
Anyway, since you're interested mostly in flash games, you probably don't need to go all out on a back-end language, so Sinatra would make a lot of sense, something simple and dynamic that you know how to work with, and will serve as a nice framework to serve up your flash programs. You can always take it further later, and honestly, you can learn the basics of Sinatra with that screencast with a week or two of playing around, then jump into Flash.
It is also possible to do the entire thing in ActionScript, but this is usually frowned upon these days. That was exciting and common when WEB2.0 started out, but now people realize that too much animation, sound, etc, make for an annoying site, and Flash doesn't talk well with the browser, which can cause navigation misunderstandings. But, gotta do what's right for you :) And maybe ActionScript right away is that.
As far as Javascript, I'd not worry about it for now. AJAX is, as one of the other guy said, just a fancy way of making a request (it can talk to the server without reloading a page) and the javascript libraries seem like the kind of thing you should wait to learn until after you know some sort of server-side language. Otherwise, they don't seem like they'll be all that useful.