how to clear a listbox "manually" with a loop (v 334)

0 favourites
  • 3 posts
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • A listbox has a clear method, however, due to a possible odd bug I am about to report, I want to clear the listbox manually -- by removing each item in a loop.

    However, creating such a loop fails to remove all -- one keep in there.

    I tried a zerobased loop going all the way to itemcount-1 and, to be on the safe side to itemcount as well, but the listbox, when repopulated with the values, keeps having three values - one left over -- not removed -- from before.

    I wonder what I am doing wrong ...

    https://u.pcloud.link/publink/show?code=XZgPpxVZHTY6xFRl60V6DoVOgJ6lk5vOHoyk

    In the attached linked C3 game (using current general available version), a listbox is pre-populated with three items.

    Upon pressing a button, a loop removes all items.

    However, one item keeps staying in the listbox -- the indexed remove doesn't seem to work

    Dan

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try running the loop in reverse - from itemcount-1 to 0

  • Perfect!

    Thank you.

    Dan

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