I. Material preparation 1. Repeater layout: horizontal distribution, 5 items per line; Background color: white and gray alternate; Inner Rectangle: Set the selected style to light blue (flashing effect during the lottery), and set the border color of the disabled style to blue (drawing effect after the lottery). Form: column **4, the column number is 12345; Text as a text field, fill in the lottery; The announcement column is used to record the selected grid (simulating the flashing effect during the lottery), and it is empty by default; Jin Yong column is used to record the drawn grid (simulating the drawing effect after the lottery is completed), and it is empty by default. 2. Lottery button: the fill color is blue by default, and it is light blue when disabled; By default, the text is white and grayed out when disabled. 3. The text label needs to add two texts, which are only used for logical processing, and the dynamic text is hidden by default: it is used to record the number of lottery flashes, and here we default to 20 times.
Random number text: used to record random numbers; Empty by default.
Second, interactive production 1. Set text interactively when loading the repeater: set the text of the inner rectangle of the repeater to Item.text, which is the value of the text column in the repeater table.
If the value of the column in the selection is 1, the selected state of the rectangle inside the repeater will be set to true, because we set the rectangle selection to blue before, so if the value of the column in the selection is 1, the corresponding rectangle will also turn blue.
If the value of Jin Yong's column is 1, then the internal rectangle of the repeater is set to be disabled, because we set the line segment color to blue when the rectangle was disabled before, so if the value of Jin Yong's column is 1, then the corresponding rectangle will have a blue outline.
2. When the mouse clicks the draw button, the button here needs to be divided into two situations. One is that the dynamic text is greater than 0, that is, it is still in the process of flashing; The other is that the dynamic text is not greater than 0, that is, the lottery has been completed. When the dynamic text is greater than 0, the interaction is: disable: disable the current button, and you can't press the button until the lottery is over, so as to prevent multiple lottery draws at the same time. Tag lines: tag all lines in the repeater; Update lines: update the marked lines in the repeater, that is, all lines, and update all the values in Xuanzhong and Jin Yong columns to 0. This step, combined with the previous step, is actually an operation to restore the original state, because if you have drawn it once before, there will be value left. Setting text: here we want to set the random number text = (math. random () * lvar1.itemcount). ToFixed (0), where math.random is a random function, representing the decimal of 0- 1, lvar 1.itemcount is the number of lines of the repeater, and it is TOfixed. Update line: the condition for updating the repeater meets the value of Item.no== random number, that is, the line corresponding to the random number just now is set to 1 in the declaration of this line. Wait: wait 200ms to set the text: dynamic text is his value-1 trigger: the event is triggered when the mouse clicks the lottery button. In fact, by controlling the value of the column in the middle of the Xuan, the flashing effect of the simulation lottery is achieved. It does not flash every 200 milliseconds, and the flashing time is determined by the dynamic text. For example, if the default value of dynamic text in the case is 20, it will blink 20 times. When the dynamic text is less than or equal to 0, the interaction is: update line: update the value that the repeater condition meets the Item.no== random number, that is, the line corresponding to the random number just now, and set the value of Jin Yong column of this line as 1. This is the result of the last lottery, so the lottery is finished here, but we still need to restore the buttons and dynamic text to their original states, so that the next lottery can be normal: Set the text: Set the value of dynamic text ==20 (initial value) Enable: Enable the lottery button here, and we have completed the whole lottery model. Here is a simple way to extract names. You can also add pictures to the repeater to become the prototype of the lucky draw. The above is the related content shared by "How to use Axure repeater", I hope it will help you! If you want to learn more Axure skills, you can click on Axure related articles, or directly follow our professional lecturer to start the learning experience of Axure self-taught video lessons ~ Professional systematic video tutorial learning will always be faster and more efficient than your sporadic graphic learning ~