in a script started on “Position Changed” event.. how to do some actions when the position isn’t changing anymore ?

in a script started on “Position Changed” event.. how to do some actions when the position isn’t changing anymore ?

]]>

11 Commentsto in a script started on “Position Changed” event.. how to do some actions when the position isn’t changing anymore ?

  1. Anonymous says:

    < ![CDATA[

    using a timer


    see setTimeout

    ]]>

  2. Anonymous says:

    < ![CDATA[

    but it doesn’t know when the touch input will end…. we can’t hard code a duration

    ]]>

  3. Anonymous says:

    < ![CDATA[

    we can. i did

    ]]>

  4. Anonymous says:

    < ![CDATA[

    You are not helping me…. how?

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Have a look at this. I wrote that some time ago.



    var e=LL.getEvent();


    var c=e.getContainer();



    var sessiontoken;


    do{


    sessiontoken=Math.random();


    }while(TOKEN!==”undefined”&&sessiontoken===TOKEN);


    TOKEN=sessiontoken;


    setTimeout(f,50);



    function f()


    {


    if(TOKEN===sessiontoken)


    {


    //do something when events finished


    }

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Thanks, can you do a pastebin, because here the indentation are… **_**

    ]]>

  7. Anonymous says:

    < ![CDATA[

    I just simplified it now…


    If you want indentation either use my Autoformat tool or do it manually, because I don’t use it.

    ]]>

  8. Anonymous says:

    < ![CDATA[

    By the way, clearTimeout is finally available, it will help the implementation of this kind of stuff.

    ]]>

  9. Anonymous says:

    < ![CDATA[

    Don’t know how, but thanks ^^

    ]]>

  10. Anonymous says:

    < ![CDATA[

    The idea is to set a timeout on each position change event, and clear it on next event. This way (not tested):


    if(id in self) clearTimeout(id);


    id = setTimeout(do_something, 200);

    ]]>

  11. Anonymous says:

    < ![CDATA[

    aaah ok,thanks !

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *