Add the ExternalInterface Callback

Add the ExternalInterface callback to make it available in JavaScript.

You can copy this code from this page or download the source file here.

/**
 * Register all the functions available from JavaScript
 * @return  true if the functions were properly registered, false otherwise
 */
private function registerTestCallbacks():Boolean {
  var retval:Boolean = false;
  if(ExternalInterface.available==true) {
      ExternalInterface.addCallback("selectByLabel", selectByLabel);
      ExternalInterface.addCallback("clickButton", clickButton);
      ExternalInterface.addCallback("setInputText", setInputText);
      ExternalInterface.addCallback("getLabelText", getLabelText);
      retval = true;
  }
  return retval;
}