Adding frames in actionscript?

I am new to actionscript, but have a fairly strong programming background, but I am still having a hard time with this problem.

My company wants to create an online test of sorts, and they are wondering if flash will work for them. The tests would be dynamically created, including the questions, answers, and number of questions. All of this data will most likely be passed to the movie via flashvars, but that’s not the tough part.

Being that i want to create almost the entire movie on the fly, is there a way to add frames via actionscript method calls?

Thanks in advance for any help