logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    ASYNCH LOOPS (or how to flash a light?)

    Scheduled Pinned Locked Moved
    Help and Support
    1
    1
    106
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AcebossA
      Aceboss
      last edited by

      Let’s say I have an object that I want to flash off and on a certain number of times (like a strobe light) which I will do by cycling the visibility of the object.

      The normal logic would be to loop x number of times, turning the visibility of the object off, waiting some time, and turning it back on again, and waiting again for a time before proceeding through the next iteration of the loop (as in the example below on the right, which doesn’t work). Instead I get to see just a single iteration of the light turning off and back on again. I am guessing this is due to asynch behaviour.

      So instead, I need to resort to a convoluted behaviour as seen on the left in the example below (and that’s just representative of flashing 3 times) - so the example on the left achieves what I want but is convoluted. The example on the right is the approach I would prefer to take, but doesn’t give me the result I want. Any suggestions?

      8316d49a-c903-4166-b668-d8dcfae856d9-image.jpeg

      1 Reply Last reply Reply Quote 0
      • First post
        Last post