ASP to FlashMX

I need some help…
I am converting a small app from ASP/Html to FlashMX, there is a few codes that I could not find that is similar in Flash,
what this does is var1 will be equal to the last 2 number from input, how do I get the last 2 numbers
once that I have seperated the last 2 numbers and select one of them to do a math function, do I need to convert them to numeric or I can leave it as it is and use

Hope you guys understand what I am trying to convey.