4 Replies Latest reply on Nov 19, 2013 11:00 AM by Ned Murphy

    Displaying 3 different movieclips in Flash AS2 depending on the date

    fakierock

      Hi all,

       

      I'm having major difficulties trying to get my banner ad to work in AS2. I have 3 movieclips:

       

      1. Display clip 1 if the date is before 31.11.13

      2. Display clip 2 if the date is between 02.12.13 - 05.12.13

      3. Display clip 3 if the date is after 06.12.13

       

      Below is the code I have and I'm struggling with how to do it, as Clip 1 and 3 are coliding with each other as It isn't recognising the different month. Any help on this would be greatly appreciated.

       

      var PreRelease = new Date(2013, 11, 31);

      var OutNow = new Date(2013, 12, 06);

      // set up a variable for todays date

      var Today = new Date();

       

      if (Today <= PreRelease){

                trace("Pre release");

      } else if (Today < OutNow) {

                trace("Out Friday");

      } else {

                trace("Out Now");

      }