Now that we have a shell to work with, we are going to add our custom Actionscript 2.0 classes and methods to our CustomActions file.
<?xml VERSION="1.0"?>
<customactions>
<actionspanel>
<folder VERSION="6" id="com.ahfx" index="true" name="com.ahfx" tiptext="Contains info for com.ahfx package">
<folder VERSION="6" id="[com.ahfx.ShoppingCart]" name="ShoppingCart" tiptext="ShoppingCart">
<folder VERSION="6" id="Methods" name="Methods" tiptext="Shopping Cart methods">
<string
object="[com.ahfx.ShoppingCart]"
text=".addElement(% object %)"
type="procedure"
version="6"
name="getTotal"
tiptext="Number: returns the total of the price of the Products in the Shopping Cart" />
</folder>
</folder>
</actionspanel>
</customactions>
Here is the break down of the code. First we create a folder that will show up in the actions panel.
You can see from the image that the names of the folders become the names that will show up in the actions panel. The tiptext is what will show up when someone hovers over that name in the actions panel.
Inside the Methods folder is where we get to the main methods. Notice that the object="[com.ahfx.ShoppingCart]" gives the full package name.
object-the name of the class
text-the code that will inserted after choosing from the code hints
type-the type of method
version-the version of flash player the code was written for
name-the name that will show up in the code hints
tiptext-the tip that will show up when the user hovers over the name in the actions panel.
Notice the % object % in the text for .addElement(). This is the text that will pop up to help show the parameters that this function requires.
You can add as many <string /> items as you have methods. This will add these methods to the dropdown of methods for this class. Just copy the code in the <string /> part and replace the text, name, and tiptext.
SUPPORT THIS SITE If this tutorial helped you, show your support and send me something from my wish list. Click on an item below and then choose Adam Hayes (Gift Registry Address) for the Ship to Address. It is that easy!