Add Codes To Main.lua

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:

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.