Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
From the author of

The Component

There's not much further to go now. We just need to do some component definition and export a .swc file. To do this:

  1. Open the library for The_Loader.fla.

  2. In the library, right-click The_Loader and choose Component Definition from the menu.

  3. In the Component Definition dialog box (shown in Figure 2), click the small + symbol to add a parameter.

  4. Figure 2Figure 2 Component definition at its finest.

  5. In the Name field, enter Load this. In the Variable field, enter loadThis, which is the variable we used earlier in the loadClip() method. You can leave the Value field blank if you want, but I added my.jpg to it just to have an example asset name there by default. For Type, choose String.

  6. Repeat Steps 3 and 4 to add a second parameter, using Load it here for the Name, loadItHere for the Variable, _parent.clip_mc for the Value, and String as the Type.

  7. In the Options section of the dialog box, check Parameters are locked in instances and Display in Components panel.

  8. Click OK to close the dialog box.

The two parameters we defined here allow us to assign values to the loadThis and loadItHere variables using the Property inspector. You'll see how this works in a moment.

To finish up the component:

  1. Right-click The_Loader in the library once more and choose Export SWC file.

  2. In the Export File dialog box, name the file The_Loader.swc and navigate to the Components folder of your Flash install directory. Add a folder there called Custom (or anything you like).

  3. Click OK to save the .swc file into your Components/Custom folder.

The component is done. Let's test it out.

  • + Share This
  • 🔖 Save To Your Account