A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Automatically go back...

  1. #1
    theSWEEN thesween's Avatar
    Join Date
    Nov 2005
    Location
    Hertfordshire, England
    Posts
    305

    Automatically go back...

    Hello again everyone

    Imagine this... clicking on a button which takes you to a different page in a KM website... then.. say 10 secs later, the website automatically goes back to the first/home page.. Does anyone know how this would be done?

    Thanks
    Steve

  2. #2
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I know I say this a lot but it's true. This is just one of many ways to do it.

    Place this in any movie on frame 1 and you can send your page back after 10 seconds (adjustable of course )


    Code:
    startTime = getTimer();
    var total;
    onEnterFrame = function () {
    if(total==10){
    getURL("http://www.something.com","_self");
    delete this.onEnterFrame;
    
    }
    
       elapsedTime = getTimer() - startTime;
       elapsedHours = Math.floor(elapsedTime / 3600000);
       remaining = elapsedTime - elapsedHours * 3600000;
       elapsed = Math.floor(remaining / 1000);
       remaining = remaining - elapsed * 1000;  
       if (elapsed < 10) {
          seconds = "0" + elapsed.toString();
       }
       else {
          seconds = elapsed.toString();
       } // end if
    total=seconds;
    
    };
    Last edited by Chris_Seahorn; 04-23-2006 at 09:01 AM.

  3. #3
    theSWEEN thesween's Avatar
    Join Date
    Nov 2005
    Location
    Hertfordshire, England
    Posts
    305
    Perfect!! Again, thankyou very much for your help Chris It's much appreciated!

    Steve

  4. #4
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Anytime Steve.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center