RE: [Flashcoders] tracking inactivity
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 = 1; // 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* Dyson -- the cleaner that doesn't lose suction. http://www.dyson.com *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] tracking inactivity
You need 2 equal signs... if (this.time==this.stillFor) { -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Miller Sent: Wednesday, October 26, 2005 11:48 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] tracking inactivity 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 = 1; // 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* Dyson -- the cleaner that doesn't lose suction. http://www.dyson.com *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] tracking inactivity
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 = 1; // 10 seconds this.startTime = getTimer(); this.onMouseMove = function() { this.time = 0; this.startTime = getTimer(); if( blah != undefined ) { 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 = 1; // 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 > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > Dyson -- the cleaner that doesn't lose suction. > > http://www.dyson.com > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] tracking inactivity
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 = 1; // 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 = 1; // 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 > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > Dyson -- the cleaner that doesn't lose suction. > > > > http://www.dyson.com > > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders