Application Development Tips and Tricks > Coding conventions > Initializing your applications

 

Initializing your applications

Initialization of an application is used to set the starting state. It should be the first function call in the application. This function should be the only call for initialization made in your program; all other calls should be event driven.

// frame 1
this.init();
function init()
{
	if (this.inited != undefined)
		return;
	this.inited = true;
	// initialization code here
}