ReQui3M
February 11, 2024, 1:54pm
1
I need to do a project with using random color picker from a list to paste in to the Canvas . And when i press Start button (BT_Start). It shows this error. How do I solve it and is there any explanation?
P.S.: the other part of the code may be incorrect.
TIMAI2
February 11, 2024, 2:01pm
2
ReQui3M:
It shows this error
What error ?
You are setting the variable Color_List to an item from the list Color_List?
Set your random selection to another variable.
ReQui3M
February 11, 2024, 2:03pm
3
I dont understand what you are trying to say
Taifun
February 11, 2024, 2:13pm
4
Please provide the complete error message
And
Taifun
ReQui3M
February 11, 2024, 2:26pm
6
The operation pick random item cannot accept the arguments: , ["Blue.png"]
ReQui3M
February 11, 2024, 3:15pm
7
what it should be like. if im gonna change color_list to a color, it writes:
The operation pick random item cannot accept the arguments: , [0]
Taifun
February 11, 2024, 8:20pm
8
It might be you found a bug with the helper blocks
Unfortunately I can't check this currently, because I'm on mobile...
As test, use text blocks together with the image names and let us know, if the pick a random item block then works
Also as already mentioned earlier, you should use another global variable to store the result, for example your variable RandomSelection
Taifun
The first time you click the BT_Start
button, Color_List
is set to a random item of itself.
Event
Value of Color_List
Data type
Screen initializes
["Red.png", "Green.png", "Blue.png", "Yellow.png"]
List
BT_Start clicked for first time
"Blue.png"
Text
By the second time you click the button, you are instructing App Inventor to pick a random item from a text string!