SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    force refresh after idle for 10 mins?

    is there a way to force a refresh after the page has been idle for a certain period of time?

    Thanks!
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,508
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    From the SP HTML reference:

    <meta http-equiv="Refresh" content="5">
    <!— refreshes the page content every five seconds —>

  3. #3
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That will refresh the page every 5 seconds no matter what. halfasleeps, you only want to refresh if the user is idle? The first thing that comes to my mind, and this may certainly not be the best way to do this, would be to start a javascript timer when the page loads, and then add a onMouseMove=resetTimerToZero event to the <body> tag, and then in the timer function check to see if it ever gets to 10 minutes, and if so call refresh(). Like I said, though, this is just the first thing that popped into my mind, and may not be the best way to go about this.
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches

  4. #4
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you possibility I will try this and post back the results
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.

  5. #5
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep it seems to work thanks, I set the setInterval to run only once a minute and the countdown to 10 to keep from lowering porformace seems to be fine..

    Thanks
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.

  6. #6
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok I have a problem with this.

    the onmousemove does not trigger when working in flash....and the entire thing is flash, (its needs to refresh after they leave to log them out). But its still counting down while they are in it because the onmouse move doesnt work.

    I know one way would be to do all this inside flash and then use a flash-to-javascript function telling the page to refresh when its necessary but I was hoping their was an easier route?

    Thanks.
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.

  7. #7
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can call javascript from inside flash. So the same applies. You have the code as above, and then within the actionscript for the whole project, you should be able to call the javascript when the mouse moves.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •