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,
1-var1=right(input,2)
what this does is var1 will be equal to the last 2 number from input, how do I get the last 2 numbers
2-var1=cint(right(input,1))
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
Number(var1)

Hope you guys understand what I am trying to convey.