Home / Kwik 3 User Guide / Add External Code

Add External Code

Kwik Add External Code – Video instruction

The Add External Code window allows you to add Lua code into your project. When pressed, the following window appears:

Screen Shot 2013-12-22 at 12.49.48 PM

  • 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 a 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 page file during the Publish process).
  • Before layers, After layers, After buttons and actions and Disposal: defines where the block of code will be entered in your page. Check a previously published page to see where the blocks will be entered.
    • Before layers blocks will be added before the page layers rendering. This will be added in the scene:create part of the code.
    • After layers blocks will be rendered just after the layers and groups creation. This will be added in the scene:create part of the code.
    • After buttons and actions blocks will be rendered after the buttons and actions are process. This will be added in the scene:show part of the code.
    • Disposal: blocks will be rendered in the disposal area – scene:hide. This is used to cleanup animations, events, etc. This allows, for example, the removal of event listeners created using external code.

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.