How to conevrt a fortran method to a Macromedia flahs method

i have a fortran method which creates random numbers.
i want to convert this method to a flash method .
I want to get numbers from this method and use them in the delay method of flash.

the fortran method is the folowing

real znew1 , zold1 ,a,m,z1,p,TIME1
a= 16807.
m=2147483647
B=2
!creates a random number

p=nint((azold1)/m)
znew1 = nint (a
zold1-(p*m))
z1=(znew1/m)
IF(Z1.LE.0) THEN
z1=z1+1.0
else
ENDIF

!creates the time which i will use in the delay method
TIME1=-B*LOG(1-Z1)