0 Replies Latest reply on Sep 6, 2009 10:28 PM by andreasfridholm

    change lunch menu each day...

    andreasfridholm

      First of all, BIG THANK YOU guys it works.... yet there is a problem with the days, today (monday) it should be week1_1.txt, right? It's not, it's week2_5.txt for some strange reason... anyone who knows? I used this code:

       

      __________________________________________________________________________________________ _

       

      var startDate:Date = new Date(2009, 7, 27);

      var now:Date = new Date();

      var d:Number = Math.floor((now.getTime()-startDate.getTime())/(1000*60*60*24));

       

      var week:Number = 2-Math.ceil((d+1)/7)%2;

      var day:Number = 1+(d%7);

       

      var sendLV:LoadVars=new LoadVars();

      var receiveLV:LoadVars=new LoadVars();

       

      receiveLV.onData=function(src){

      myText_txt.text = src;

      }

      sendLV.sendAndLoad("week"+week+"_"+day+".txt",receiveLV,"POST");

      __________________________________________________________________________________________ _

       

      The site is up and running on www.andreasfridholm.se/indianexpress and it's on the main page on the right.

      Saturday was 2_3, sunday 2_4.txt

       

      BIG thanks