Professional Web Applications Themes

Kiosk: Refreshing after X seconds - Macromedia Flash Actionscript

I have been searching for a while on how to make my Kiosk go to frame 1 if it is idle, and have found someting that seems helpfull, but it is from a few years ago. [L=Kiosk Link]http://www.flazoom.com/cooler/1043345201%2C45422%2C.shtml[/L] Is there a new better way to do this, and also i can't seem to get this example to work, can anyone help me please !! i am pulling my hair out trying to figure this out ! Thanks for any help !...

  1. #1

    Default Kiosk: Refreshing after X seconds

    I have been searching for a while on how to make my Kiosk go to frame 1 if it
    is idle, and have found someting that seems helpfull, but it is from a few
    years ago. [L=Kiosk
    Link]http://www.flazoom.com/cooler/1043345201%2C45422%2C.shtml[/L] Is there a
    new better way to do this, and also i can't seem to get this example to work,
    can anyone help me please !! i am pulling my hair out trying to figure this out
    ! Thanks for any help !



    College_webber Guest

  2. #2

    Default Re: Kiosk: Refreshing after X seconds

    ttt
    College_webber Guest

  3. #3

    Default Re: Kiosk: Refreshing after X seconds

    stop();
    this.onEnterFrame = function(){
    _global.mouPosition = _root._xmouse; //save mouse position to a global
    variable
    _global.mouseYPosition = _root._ymouse;
    //trace(mouseYPosition); //if you want to test it...
    updateAfterEvent(); //reset
    }
    checkMouse = setInterval(whereMouse,1000); //look at the mouse position every
    second
    function whereMouse(){
    oldMou = _global.mouPosition; // get the current mouse X position for
    this function
    oldMouseY = _global.mouseYPosition; // get the current mouse Y position for
    this function
    // trace(oldMou + ","+ oldMouseY); //just to test it
    if(_root._xmouse==oldMou && _root._ymouse==oldMouseY){ //if the mouse
    hasn't moved for a second....
    gotoAndPlay(1);
    }
    }

    If you want the mouse to be idle for a longer period of time, just change the
    1000 to 5000 (for 5 seconds). Also, if you want to delay it (like a "grace"
    period), just add a variable called "counter" in the function, and increment it
    (counter++). Then add an if statement that must be satisfied before you
    gotoAndPlay(1):
    if(counter>=20){ //a 20 second grace period
    gotoAndPlay(1);
    }

    pazzoboy Guest

  4. #4

    Default Re: Kiosk: Refreshing after X seconds

    stop();
    this.onEnterFrame = function(){
    _global.mouPosition = _root._xmouse; //save mouse position to a global
    variable
    _global.mouseYPosition = _root._ymouse;
    //trace(mouseYPosition); //if you want to test it...
    updateAfterEvent(); //reset
    }
    checkMouse = setInterval(whereMouse,1000); //look at the mouse position every
    second
    function whereMouse(){
    oldMou = _global.mouPosition; // get the current mouse X position for
    this function
    oldMouseY = _global.mouseYPosition; // get the current mouse Y position for
    this function
    // trace(oldMou + ","+ oldMouseY); //just to test it
    if(_root._xmouse==oldMou && _root._ymouse==oldMouseY){ //if the mouse
    hasn't moved for a second....
    gotoAndPlay(1);
    }
    }

    If you want the mouse to be idle for a longer period of time, just change the
    1000 to 5000 (for 5 seconds). Also, if you want to delay it (like a "grace"
    period), just add a variable called "counter" in the function, and increment it
    (counter++). Then add an if statement that must be satisfied before you
    gotoAndPlay(1):
    if(counter>=20){ //a 20 second grace period
    gotoAndPlay(1);
    }

    pazzoboy Guest

  5. #5

    Default Re: Kiosk: Refreshing after X seconds

    Thanks Pazzoboy. Very much appreciated. Been at the same thing for many hours.
    Thank you.
    GTW42 Guest

  6. #6

    Default Re: Kiosk: Refreshing after X seconds

    Thank you very much !!!!
    College_webber Guest

  7. #7

    Default Re: Kiosk: Refreshing after X seconds

    pazzoboy

    This is great man, but I got a quick question on it...

    I'm using it on an MC to remove the MC after 5 seconds...

    Now is the a ways I can add some code to another MC or button that forces the
    count back to 0 to keep the MC on the stage, or to force the count to 5000 to
    remove the MC...?

    If I'm not being clear enough, please tell me. I will clarify/

    MyFlashMXIN Guest

  8. #8

    Default Re: Kiosk: Refreshing after X seconds

    Yup, easy. On the other MC, for example, if you want a click to stop it, just
    do:
    on(release){
    clearInterval(_root.checkMouse);
    }

    To keep the MC on stage, and give the user five more seconds (if you're using
    a counter):
    on(release){
    _root.counter=0;
    }

    pazzoboy Guest

  9. #9

    Default Re: Kiosk: Refreshing after X seconds

    Hi, I found a glitch in how I am using your script from above. I have a touch
    screen kiosk with several scenes. I'm was using your script to send the
    playhead to the frame labled "Begin" if kiosk is idle for a set period of time.

    The time I have set to 20 seconds for development. In the production model it
    will be more like 3 minutes.
    I'm finding that the user of the touch screen kiosk will sometimes be sent
    back to "Begin" before it is time. Therefore I'm trying to add to your script
    to make a timer start if no mouse movement for 20 seconds. However this script
    doesn't work the way I'm intending either. Can you tell where the problem is in
    this script and if this is the correct way to solve the premature move to
    "Begin"? :)


    stop();
    this.onEnterFrame = function(){
    _global.mouPosition = _root._xmouse;
    _global.mouseYPosition = _root._ymouse;
    updateAfterEvent();
    }

    checkMouse = setInterval(whereMouse, 1000);

    function whereMouse(){
    oldMou = _global.mouPosition;
    oldMouseY = _global.mouseYPosition;
    if(_root._xmouse==oldMou && _root._ymouse==oldMouseY){
    _root.timer = getTimer();
    }
    }

    whatTime = setInterval(checkTime, 1000);

    function checkTime() {
    if (( getTimer() - _root.timer) > 1000 * 20 ) {
    _root.gotoAndStop("Begin");
    clearInterval(whatTime);
    clearInterval(checkMouse);
    }
    }

    GTW42 Guest

  10. #10

    Default Re: Kiosk: Refreshing after X seconds

    Hmmm, no time to play with it now..but try putting whatTime = setInterval......
    inside the "if" statement in the other function, just after the _root.timer =
    getTimer(); line. You're executing the whatTime interval right away, when it
    should only be called when there is no mouse movement when checkMouse runs,
    right?

    pazzoboy Guest

  11. #11

    Default Re: Kiosk: Refreshing after X seconds

    pazzoboy

    I tried the addition you posted... Thing is it has no effect...

    If a user mouses over the same or multiple buttons a few times, the Interval
    decreeses... (the result my MC disapears way before 5 sec... more like .5
    sec...)

    Maybe you can tell me what, if anything I've done wrong..?

    MyFlashMXIN Guest

  12. #12

    Default Re: Kiosk: Refreshing after X seconds

    For some reason I can't download this zip file. Please email it to me at hart_at_mail_dot_rochester_dot_edu
    Also, please save it as flashMX -- I'm shying away from 2004.
    pazzoboy Guest

  13. #13

    Default Re: Kiosk: Refreshing after X seconds

    Good Morning. Thanks for the suggestion.
    I tried putting whatTime = setInterval...... inside the "if" statement in the
    other function, just after the _root.timer = getTimer(); line. It didn't work
    when re-entering the frame the way I had it set up. I'm still working through
    the newbie learning curve. It was a tough decision to shy away from this
    script after so much time invested. Cause I really wanted it to work. :) But
    the time is becoming an issue.

    I found another script and have altered it. It appears to function the way I
    need it for the kiosk. Again thanks Pazzoboy for getting me to think. Regards

    stop();
    // Time value, in milliseconds, after which, failing any mouse movement, an
    action is to occur.
    numMouseTimeoutMS = (1000 * 10);
    // Define what is to happen should the mouse be moved.
    this.onMouseMove = function() {
    // Clear preceding setInterval ID.
    clearInterval(MouseID);
    // Set new interval.
    MouseID = setInterval(MouseCheck, numMouseTimeoutMS);
    };
    // Function run by setInterval.
    MouseCheck = function () {
    // Clear interval.
    clearInterval(MouseID);
    // Whatever action is supposed to happen on timeout (go to "Begin").
    gotoAndStop("Begin");
    };

    GTW42 Guest

  14. #14

    Default Re: Kiosk: Refreshing after X seconds

    Please post a link to the script or a copy of yours...

    Just incase anyone else runs into this issue, :-)

    Also the more script I see the more I learn about AS...

    Thanks
    MyFlashMXIN Guest

  15. #15

    Default Re: Kiosk: Refreshing after X seconds

    Thanks GTW, I greatly appreciate it!

    Thanks you again pazzboy as well.

    College Webber
    College_webber Guest

Similar Threads

  1. Interactive Kiosk
    By heikej webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 7
    Last Post: September 23rd, 10:45 PM
  2. CD-Rom vs. Kiosk
    By Bill Kearns in forum Macromedia Director Basics
    Replies: 1
    Last Post: December 18th, 09:41 PM
  3. Kiosk
    By Huw webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 1
    Last Post: November 21st, 07:06 PM
  4. DVD kiosk help
    By leanne827 webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 10
    Last Post: October 28th, 07:20 PM
  5. kiosk loop
    By rccm webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 3
    Last Post: August 25th, 09:56 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139