adding action after completion of loop (or how to select a listbox item after filling the listbox)

0 favourites
  • 3 posts
From the Asset Store
An educational game for Fill in the Blanks. An easy to use template for developers to build larger games
  • Hello,

    I have a for loop that via a sub event / actions fills a listbox with values. During the filling, the listbox does not trigger any changed selection event.

    I want to select the first item in the listbox after the for loop completes and all values are filled in, so that the selection triggers additional processing in filling in items in the UI -- for depending items.

    I cant figure out how to add an action after a loop completed -- since the loop is within a subevent. and there is no way to add actions after the subevent at the level of the parent event.

    any thoughts how this could be done are much appreciated,

    thank you,

    Dan

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey grossd

    Since loops are usually done in a tick (as long as no 'wait' is used), the next parent event under the loop can be used as if your listbox is already filled. But without seeing your code, it's difficult to tell if another method is needed.

    Maybe this is an option:

  • Thank you.

    In my case (with the way JsonManager looping works), there is a sub-event under the loop to test for conditions within the loop, and a parent event, that for the loop itself.

    Placing an empty event underneave the jsonManager loop doesn't seem possible, but i can place it as a "sibling" underleave the top parent.

    Will try this out once google sheets api comes online again -- for some reason, the google sheets api suddently stops responding to ajax calls, and after some wait (30 min? an hour?) it suddenly works again.

    anyway, thanks, will give it a try

    Dan

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)