How can I do this calculation with actionscript 3.0?

[FONT=Calibri][SIZE=3]Hi,[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]How hard would that be to calculate how many time will object “B” fit in object “A” using actionscript 3.0.[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]What I want to do is to calculate how many time rectangle “b” will fit in rectangle “a”. The dimension from rectangle “b” will be controlled (changed) by the user; dimension from rectangle “a” will not change. I also would like to see object “b” changed when user inputs its dimensions as well as to see a preview of how many will fit in object “a”. [/SIZE][/FONT]
[FONT=Calibri][SIZE=3]I know, I know I’m asking for something that may not be so easy but I know a lot people from here are very good at this type of things. Any help will be appreciated.[/SIZE][/FONT]

[FONT=Calibri][SIZE=3]Thank you very much![/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Fs_tigre[/SIZE][/FONT]