some idea about ruby on rails plz

i want to create a free loterie on line and i have some question plz help me i want an idea about how to do this 10 free ticket per day?
how to have information from action script 3?