Flash in Ruby on Rails making a AJAX request

I’m trying to solve a problem where I have a nice Flash button and when
a user presses that button I need an Ajax request to be sent to the
server in order to process some RJS code.
I’ve tried googling, but cannot find any solution to my problem.
I am using ActionScript3 to do URL handling logic of my Flash button.
Has anyone done anything similar?

Am I thinking about this the wrong
way? Can Flash even call Ajax like requests?

Thanks for your help!