Add Codes To Main.lua

The Add Main.lua External Code window allows you to add code directly in the main.lua file (this is the first file called when your application starts). Code entered in the main.lua file will be rendered, and processed, before the first page of the project starts. When pressed, the following window appears:

All previously entered external code will appear in the list. To delete a code not desired anymore, select it in the list and press the trash button. To add new ones, just press the + (plus) button. Doing so, the following window appears:

  • Name: enter a name to your block of code (this is needed in the case you need to edit the code later). Kwik auto create an name but it is always a good idea to enter your own names for easy access later;

  • From file (use the Browse button to point to the external code file): gets the file containing the external code (it will be copied into the main.lua file during the Publish process).

Old projects with direct external code entry (previously done via a Flash editor) will automatically be converted to external code files, when they are edited – CREATE button must be pressed in these scenarios.

Accessing Variables

Kwik4 ‘s global table is _K

local _K = require “Application”

Local variable made with Create Variable is stored in UI table.

UI.YOUR_VARIABLE = 1

results matching ""

    No results matching ""