On 10/26/05, Matt Ganz <[EMAIL PROTECTED]> wrote:
> yes, big oversight on my part. thank you.
>
> i've just changed from using an onEnterFrame to a setInterval, but i'm
> not getting it to work here. i believe it might be because my
> setInterval isn't first started. does that look like the culprit to
> you? by the way, thanks for lending a hand.
>
> this.stillFor = 10000; // 10 seconds
> this.startTime = getTimer();
>
> this.onMouseMove = function()
> {
>         this.time = 0;
>     this.startTime = getTimer();
>
>     if( blah != undefined )
In this example, blah is not defined, thus this statement will never
be true, and the interval will never be set.

>         {
>                 clearInterval( blah );
>                 blah = setInterval( this.checkTime, this.stillFor, this );
>     }
> }
>
> this.checkTime = function()
> {
>          this.time = getTimer() - this.startTime;
>
>          if ( this.time>this.stillFor )
>          {
>                  trace ('mouse has been still for 10 seconds!' );
>                  clearInterval(blah);
>          }
> }
>
> On 10/26/05, Alistair Miller <[EMAIL PROTECTED]> wrote:
> > You are setting a value here rather than comparing
> >
> > if (this.time=this.stillFor) {
> >
> > change to
> >
> > if (this.time >=this.stillFor) {
> >
> > Ali
> >
> > -----Original Message-----
> > From: Matt Ganz [mailto:[EMAIL PROTECTED]
> > Sent: 26 October 2005 16:44
> > To: Flashcoders mailing list
> > Subject: [Flashcoders] tracking inactivity
> >
> > hi.
> >
> > i'm trying to record when there's been inactivity in my site. i got
> > this code from the archive but don't understand where it's going
> > wrong. for example, i set it to trace out if the mouse has been
> > inactive for 10 seconds, but instead i get this message right away.
> > does anyone see anything out of place?
> >
> > thanks. -- matt.
> >
> > this.stillFor = 10000; // 10 seconds
> > this.startTime = getTimer();
> >
> >
> > this.onMouseMove = function(){
> >           this.time = 0;
> >           this.startTime = getTimer();
> >           trace('Starting timer again');
> > }
> >
> > this.onEnterFrame  = function(){
> >           this.time = getTimer()-this.startTime;
> >
> >
> >           if (this.time=this.stillFor) {
> >                   this.time = 0;
> >                   this.startTime = getTimer();
> >                   trace('mouse has been still for 10 seconds!');
> >           }
> > }
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> > Dyson -- the cleaner that doesn't lose suction.
> >
> > http://www.dyson.com
> > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> >
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to