Creating an Extension


 

Step 3

 

Scroll through the list of functions in the Command List and select the kernel32.Beep function. In Step 1, we opened the Win32 Programmer's Reference to the Beep Command Usage Guide.

 

Click on the "Extension Definition" Tab and enter the details as shown below:

 

 

tutorial_extensions_09

 

 

The Extension Creator allows you to specify up to 12 parameters for each DLL Function. From the reference in Step 1, we know that only 2 parameters are required for the Beep Function. Set Parameter 1 and 2 to "integer" from the drop down box and complete the Description and Sample Value for each. For the purpose of this example, set the value for each parameter to 1000.

 

You can also specify a return value at the bottom which, although not required, can help assist in debugging your custom command. In this case, we know from the DLL Function documentation that the return value should be a Boolean.

 

Click on the "Command Tester" Tab:

 

 

tutorial_extensions_10

 

 

With the parameters set and sample values provided, we can now proceed to testing our command. Upon first test, you need to Load the Library by clicking on the "Load Library" button at the bottom. Once loaded, click on the "Execute" button to test. When clicked, you should here a System Beep which lasts for approximately 1 second.

 

The exact syntax as it should be entered in your Actionscript is also generated in the Code Pane. The value "true" should also be visible in the Result Pane. If your test failed to play the beep sound, then the value "false" should be visible in the Result Pane which would mean that communication was made but a parameter or multiple parameters were incorrectly specified.

 

Once you are happy that your new Custom Command is working correctly in the Command Tester, click on FILE and Create Extension:

 

 

tutorial_extensions_11

 

 

This will allow you to specify an extension name and path to save to. The extension file format is .zincx - this is the file that you can distribute and share with other users.

 

Once you have created your Extension file, exit the Extension Creator.

 

Continue to Step 4