1 Reply Latest reply on Dec 10, 2006 5:17 PM by Newsgroup_User

    Swf Saving

    joesmoes
      Hello all,

      ok this is my problem!

      I have a timer that stops people to look at my ad for about 5 seconds.
      ok i have another area for people what have all ready came thus only letting them wait 2.5 seconds.
      Is that a way to just have one and when the same person has enterd that swf then they will only wait for 2.5 insted of 5 seconds.

      Also i only want the 5 second timer to restart once every week.
      it is not that important if this could not be done.

      Here is what my sight lookes like. http://members.cox.net/blocked7/main.swf

        • 1. Re: Swf Saving
          Level 7


          joesmoes wrote:
          > Hello all,
          >
          > ok this is my problem!
          >
          > I have a timer that stops people to look at my ad for about 5 seconds.
          > ok i have another area for people what have all ready came thus only letting
          > them wait 2.5 seconds.
          > Is that a way to just have one and when the same person has enterd that swf
          > then they will only wait for 2.5 insted of 5 seconds.

          Could be done easily using SharedObject.
          Shared Object is Flash's native form of cookies which sames files in form of *.sol
          to user temporary folders. You can make visit record, on first play 5 sec. on second
          play 2.5 sec.

          function visit() {
          var myLocalSO = SharedObject.getLocal("joesmoes_cookie");
          if (myLocalSO.data.visited == null) {
          myLocalSO.data.visited = 1;
          trace("visit 1")
          //do action for 5 sec banner
          } else {
          trace("visit 2")
          //do action for 2.5 sec banner
          }
          }
          visit();

          Take Note! to clear the record for testing purpose, search drive for
          "joesmoes_cookie.sol" and delete it. You might need to extend the search
          to Hiden Files.

          > Also i only want the 5 second timer to restart once every week.
          > it is not that important if this could not be done.

          You could incorproate the Date.getDate method to compare dates and based on result use
          the myLocalSO.flush(); to remove the store Shared Object automatically resetting the
          display time from 2.5 to 5 sec.


          --
          Best Regards

          Urami


          --


          <urami>
          If you want to mail me - DO NOT LAUGH AT MY ADDRESS
          </urami>