Tutorial: Plugins

About Using Plugins:

Extra features are available via plugins. You can determine which plugins are available by calling the following code:

var myPlugins = $wat.plugins.pluginList(); // Returns a list of available plugins.
for (var i=0;i<myPlugins.length;i++) // Iterate through plugins.
    alert(myPlugins[i]); // Creates an alert for each available plugin.

Any available plugins can be accessed as properties of the plugins object by their returned name as follows:

// In this case, "flnet" is an available plugin and can be accessed this way

You can also determine relevant information regarding each plugin as follows:

var plugin = $wat.plugin.flnet;
plugin.name;      // The name of the plugin.
plugin.desc;      // A description of the plugin.
plugin.available; // Determines whether the plugin is loaded.
plugin.licensed;  // Determines whether the plugin is licensed.
plugin.loaded;    // Determines whether the plugin is loaded.

In addition, should the plugin fail to load, a function has been provided that will provide further information regarding the cause of the failure.

if($wat.plugins.flnet.loadFailed); // If the plugin failed to load.
    alert($wat.plugins.flnet.error()); // Alert the most recent error message.