Learn Actionscript - AHFX

Intermediate Actionscript - Custom Actions Code Hints 

ahfx actionscript learning actionscript

AHFX Actionscript Home
Basic Actionscript
Intermediate Actionscript
Advanced Actionscript
About AHFX
Contact AHFX
Great Actionscript Links

Flash MX 2004 CustomActions

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"?>
   <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">
            text=".addElement(% object %)"
            tiptext="Number: returns the total of the price of the Products in the Shopping Cart" />


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.

Continue to page 3

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!


Featured Tutorials

Flash Shopping Cart Tutorial
Create a custom Flash Shopping Cart that will add, update, and show products.

Flash MX 2004 Custom Actions
Take your custom classes to the next level and have Flash treat them as built in classes.

Pass Variables to Flash
Quick and dirty way of passing variables to your flash animations.

Affordable Web Design and Hosting
Find out how you can cut your overhead by hosting with AHFX.net

Affordable Custom Art
Get your pictures custom framed. Amazing Prices. Outstanding Quality.

AH Digital FX Studios
Disclaimer | Site Map | Idaho Web Design