hyperPad 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 Posts 1 Posters 405 Views 1 Watching
    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 Offline
      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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post