3 Replies Latest reply on Feb 5, 2010 6:59 AM by kglad

    How do i call java in flash?

    mandana persi

      Hi, how can I run this below “java script calendar” code in my flash project? I read carefully this tutorial, this and this but I can’t do it, somebody tell me “HOW CAN I DO THIS”.

       

       

      Header 1
      <SCRIPT language="javascript">
      function showdate() {
          week= new Array("يكشنبه","دوشنبه","سه شنبه","چهارشنبه","پنج شنبه","جمعه","شنبه")
          months = new Array("فروردين","ارديبهشت","خرداد","تير","مرداد","شهريور","مهر","آبان","آذر","دی","بهمن", "اسفند");
          a = new Date();
          d= a.getDay();
          day= a.getDate();
          month = a.getMonth()+1;
          year= a.getYear();

          year = (year== 0)?2000:year;
          (year<1000)? (year += 2000):true;
         
          year -= ( (month < 3) || ((month == 3) && (day < 21)) )? 622:621;

          switch (month) {
              case 1: (day<21)? (month=10, day+=10):(month=11, day-=20); break;
              case 2: (day<20)? (month=11, day+=11):(month=12, day-=19); break;
              case 3: (day<21)? (month=12, day+=9):(month=1, day-=20);   break;
              case 4: (day<21)? (month=1, day+=11):(month=2, day-=20);   break;
              case 5:
              case 6: (day<22)? (month-=3, day+=10):(month-=2, day-=21); break;
              case 7:
              case 8:
              case 9: (day<23)? (month-=3, day+=9):(month-=2, day-=22);  break;
              case 10:(day<23)? (month=7, day+=8):(month=8, day-=22);    break;
              case 11:
              case 12:(day<22)? (month-=3, day+=9):(month-=2, day-=21);  break;
             default:      break;
          }
      document.write(week[d]+" "+day+" "+months[month-1]+" "+ year);
      }
      </SCRIPT>
      <SCRIPT>showdate()</SCRIPT>