Skip to content

Special function vs Event Handlers

Special Functions vs Event Handlers

Special Function and Event Handlers are two very useful features in Aliveforms. They might provide same functionality but they have different use cases.

Differences in Special Functions and Event Handlers.

  • In Aliveforms, on different occasion, system checks if a special function is defined. If it is defined, it executes the special function.

  • On the other side, on several occasions, Aliveforms dispatches the event. And Event Handlers registered with $.Handle handle that event.

  • There can be only 1 special function for 1 screen. e.g. window.screen_0_on_enter, but there can be multiple event handlers. So that is benefit of event handlers.

When to use Special Functions

If you are sure you work will be done inside one block of code, in special function, use special function.

When to use event handlers?

If you are use multiple logic modules, each needs to handle for example screen_0_on_enter, use event handlers.