4 Replies Latest reply on Nov 28, 2006 2:03 AM by Marghoob Suleman

    Pop-Up Code

    bcounts Level 1
      I have a movie clip in my library (not stage) named "idlepop" - I would like this movie clip to fade visable when a person sits idle on any page of my website for more than 30 minutes.

      Can anyone suggest a code or write something for me that will allow me to do this? I need the code to be fail safe and work everytime.

      Thank you for any help anyone can provide!!!!!

      Bryan
        • 1. Re: Pop-Up Code
          Marghoob Suleman Level 1
          you can use mouse listener. you may check if mouse movement is not true start your timer (make a fuction) and when goes to 30 min idle then attach your library movie.
          • 2. Re: Pop-Up Code
            bcounts Level 1
            That sounds great - however I am looking for a code to do that - not sure where to start on writing a code like that. Any help you could offer writing a code for this would be great!!!!
            • 3. Re: Pop-Up Code
              Level 7
              a simple solution might be this:
              put this 2 functions in your code:
              functin setMyInterval() {
              clearInterval(myInterval);
              myInterval = setInterval(30*60*1000,doFade);
              }
              function doFade() {
              clearInterval(myInterval);
              _root.attachMovie("idlepop","pop_mc", _root.getNextHighestDepth());
              pop_mc._alpha = 0;
              pop_mc.onEnterFrame = function() {
              if (this._alpha<100) {
              this._alpha+=20;
              } else {
              this._alpha = 100;
              delete this.onEnterFrame;
              }
              }
              }

              now place a call for 'setMyInterval' in your movie's first frame, and on
              every 'press'/'release'/'rollOver'/'rollOut' function throuhout your movie -
              that way, every time a user does something the 'timer' is reset, and the
              counting of 30 minutes begins from new - and when the counting is done (if
              it wasn't reset) your pop message fades in.
              my syntax might not be 100% accurate (wrote it directly here, without
              testing in flash environment), but i think u'll get the general idea.

              good luck,
              eRez

              "bcounts" <webforumsuser@macromedia.com> wrote in message
              news:ekgue3$n5q$1@forums.macromedia.com...
              >I have a movie clip in my library (not stage) named "idlepop" - I would
              >like
              > this movie clip to fade visable when a person sits idle on any page of my
              > website for more than 30 minutes.
              >
              > Can anyone suggest a code or write something for me that will allow me to
              > do
              > this? I need the code to be fail safe and work everytime.
              >
              > Thank you for any help anyone can provide!!!!!
              >
              > Bryan
              >
              >


              • 4. Re: Pop-Up Code
                Marghoob Suleman Level 1
                Hi,
                i just wrriten this code. hope this will help you.