Hello. Here we have a rather awkward question…

I have found a javascript code that allows anyone to find the day of the week in which they were born. However, I am looking for a code that can be used in a “.fla” document.

The export settings have to be “flash 9” and “action script 2.0”. This is simply because the rest of the .fla document has already been produced to that standard.

So, having those 2 barriers in mind, does anyone know how to “translate” the javascript code into an operational ActionScript 2.0 that can be used inside a .fla document?

Thank you very much in advance!

The code follows:

<script LANGUAGE=“JavaScript”>

<!–

function cala_day(form) {

var nSwitch = 0

var nMonth = parseInt(form.month.value)

var nDay = parseInt(form.day.value)

var nYear = parseInt(form.year.value)

if(!(nYear % 4) && (nMonth > 2)) {

nSwitch = 1

}

var nDayOfWeek = cala_weekday(nMonth, nDay, nYear)

if(nSwitch) {

nDayOfWeek++

nSwitch = 0

}

day_display(form, nDayOfWeek)

}

function cala_weekday( x_nMonth, x_nDay, x_nYear) {

if(x_nMonth >= 3){

x_nMonth -= 2

}

else {

x_nMonth += 10

}

if( (x_nMonth == 11) || (x_nMonth == 12) ){

x_nYear–

}

var nCentNum = parseInt(x_nYear / 100)

var nDYearNum = x_nYear % 100

var nPart1 = parseInt(2.6 * x_nMonth - .2)

var nZeller = (parseInt(nPart1 + x_nDay + nDYearNum + (nDYearNum / 4) + (nCentNum / 4) - 2 * nCentNum)) % 7

if(nZeller < 0){

nZeller += 7

}

return nZeller

}

function day_display(form, x_nDayOfWeek) {

if(x_nDayOfWeek == 0) {

form.birthday.value = “Saturday”

return

}

if(x_nDayOfWeek == 1) {

form.birthday.value = “Sunday”

return

}

if(x_nDayOfWeek == 2) {

form.birthday.value = “Monday”

return

}

if(x_nDayOfWeek == 3) {

form.birthday.value = “Tuesday”

return

}

if(x_nDayOfWeek == 4) {

form.birthday.value = “Wednesday”

return

}

if(x_nDayOfWeek == 5) {

form.birthday.value = “Thursday”

return

}

if(x_nDayOfWeek == 6) {

form.birthday.value = “Friday”

return

}

form.birthday.value = “Invalid Date!”

}

–>

</script>