How to change image randomly in image component

How to change image randomly

I want to change image randomly from assets every time when screen initialise

Can any ony help me out here

There are several ways for that…

  1. you can use tinyDB for that…
    When screen initialises add +1 on tinyDB value and set a specific image for specific tinyDB value…
  2. you can use list block…
    Make a list of assets name [with .png or .jpg]
    Then everytime screen initialises set image picture to random item from the list…
    There could be other ways too

Done bro my problem solved

I used global variable to change image randomly on screen initialize

By the way thank for your reply brother :hugs:

DrJohns second point is the only one that would work.

The first option will break when you run out of images.

Here is the second options in blocks.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.