I am trying to replace the blocks. They were under a timer which is always running. What I am trying to do is change the visibility of vertical arrangements using checkboxes.
Don’t mind the “!” mark in the block it is due to it is removed from timer block
The combo used , along with this is
These are there for each of Vertical arrangements. Can loops be used for these?
To a loop , It is some of my old works when I wasn’t aware the loops would work here.
This is what I have tried
The problem with this is , The loop when placed under timer , it causes the selected vertical arrangement to flash for a moment and disappear.
the blocks in the are still there.
Thanks for help!
What I usually do:
Create a procedure that hides all the arangements (sets each arrangement visible to false)
Run that before looping over the checkboxes to find which arrangements need to be visible, and make them so…
I have made default CheckBox to false , and vertical arrangement.visible to false
So what you are telling sounds like
and running
under the timer
Try this example:
checkboxArrangements.aia (2.9 KB)
(There is probably a better way but this seems to do what you want…)
You could also write the hideArrangements procedure like this:
I want to make the VerticalArrangements.Visible = false
so this suits more
Okay now I have tried placing these blocks under clock1.timer
the error lies in here itself in the index part , I cannot understand why is index coming = 0
the screen shot of error
lists are in the post before this one
Link just in case of confusion
TIMAI2
June 13, 2020, 10:03pm
9
In what way are you running it in a clock timer?
under the When Clock1.timer
I am running
and
clock1.timerEnabled = true
is under
screen1.initialise
P.S. Do Not worry of the cross beside When Clock1.timer
Taifun
June 17, 2020, 6:38pm
11
according to the documentation MIT App Inventor List Blocks
the index in list block
Returns the position of the thing in the list. If not in the list, returns 0.
let me suggest to use a counter variable to increment the index...
Taifun
Trying to push the limits! Snippets , Tutorials and Extensions from Pura Vida Apps by Taifun.
ABG
June 17, 2020, 8:37pm
12
Here is a sample of how to tie visibility to checkbox states .
The checkboxes control the visibility of the matching buttons, you could use arrangements instead of buttons.
Checkbox_visibility.aia (2.8 KB)
The place where you failed was where you tried to init a global variable for something dynamic instead of using a value procedure.