The next step is to add the events to your control along with the logic you want to execute it.
You can consider the example of adding an onClick event to the button that executes some function holding logic about that.
Let’s break this section into adding events and adding logic.
Video version of this tutorial
Adding Events #
- Select the control you want to add an event to.
- Navigate to the sidebar at the right and select the EVENTS tab.
- Select the particular event you would like to add from the provided list. (There is a long list of them, so surely you can find all sorts of events you may require)
- Add the function name you would like to be called on that event’s trigger.
- That’s all. Simple as added. Your event has been added. Next you need to implement this function in Logic.
Adding Logic #
Time to add some logic to your code. You can consider this section to decide what goes on within that function (along with all the other code).
- Navigate to the LOGIC tab from the top left corner of your application.
- You can find an editor to write all your code.
- You need to write all functions of which names you added to events
Adding sections in the Logic #
This particular feature helps you keep your code clean and organized by dividing it among the sections. To add the sections, follow these steps:
- Click on +ADD SECTION from the left sidebar.
- Enter the name of your section.
- You can keep adding these sections by repeating steps 1 and 2.
- You can move the section up or down by clicking the three dots to the right of its name and selecting Move Up or Move Down. (It is because the sections are combined from top to bottom at the time of code execution)
- Write the implementation logic of your function.
- Viola, it’s done.