Distributing Custom Components – AS3

Hello Everyone 🙂

Recently i am  posted “Custom Components in AS3 – ScrollBar” later on , I realized that, after building custom components , i want to give them to other people, So i am decided to make the MXP custom components files for Flash.

MXP files are packages for components and are used to install extensions via the Adobe Extension Manager. If you don’t have the Extension Manager, you can get it here: http://www.adobe.com/exchange/em_download/ . Extension Manager is use to install the .mxp package files.

Before create the MXP file , we need to create 2 files one is SWC and another one is MXI.

Steps for Create SWC file:

Step 1: Download my previous custom scrollbar  and save it to your desktop.             Step2: Open CustomScrollBar.fla in Flash CS 5 or above.                                                   Step3: Open the Library (Ctrl/Cmd+L). You should see “ScrollbarAssets”  movieclip in      the library , (as shown in below Image_1). When you package your own components, be sure to use easy-to-understand names.

Step4: Right-click on the movie clip and choose Export SWC File ( as shown in Image_2).  The Export File dialog box appears.

Step5: In the dialog box, name your file scrollbar.swc and save it to your desktop.

After create the SWC file , we need to create the MXI (Macromedia Extension Information) file. The MXI file is simply a set of XML based instructions that tells the Extension Manager where to install the packaged files. It also  including its name, version number, type, add author information,description of the extension and where to put component file in the Flash installation directory.

Steps for Create MXI file:

Step1: Open a text editor. we can use Notepad or textedit for creating MXI files.           Step2: Add the following XML to a new file and save it as “scrollbar.mxi” to your desktop. make sure you should save it as “.mxi” extension.

 <macromedia-extension name="ScrollBar" version="1.0" type="Flash Component (SWC)">
<author name="Moorthy, Kutty" />
<products>
<product name="Flash" version="9" primary="true" />
</products>
<description>
<![CDATA[
Scrollbar for Flash Player 9 above.
]]>
</description>
<ui-access>
<![CDATA[
This component can be accessed from the Components panel.
]]>
</ui-access>
<files>
<file name="scrollbar.swc" destination="$flash\Components\CustomScrollbar" />
</files>
</macromedia-extension>
 

Then need to package the MXI and SWC files into the MXP file, we need to complete only a few more steps.

Steps for create MXP file:

Step1: Create a folder on your desktop named scrollbar  and drag the MXI and SWC files into it. When packaging components, it’s necessary to make sure that all the files that will be packaged are in the same place.                                                                                           Step2: Launch the Adobe  Extension Manager.                                                                       Step3: Choose File > Package Extension.                                                                                 Step4: In the Select Extension to Package dialog box, browse to the scrollbar folder on your desktop and choose the scrollbar.mxi file.                                                                                 Step5 : In the Save Extension Package As dialog box, name the file scrollbar.mxp and click OK. Save it to the desktop scrollbar folder.                                                                                Step6: When the packaging process is complete, a message appears that reads “The extension package was successfully created,” (as shown in Image_3). Click OK to close the message window.

Now MXP package file is ready , we can install the extension.

Step1: Open the scrollbar folder.Where u save the mxp file. and double-click the scrollbar.mxp file icon.                                                                                                                Step2: Choose Accept to accept the Extension Disclaimer. When you see the message that says “the scrollbar extension has successfully been  installed”,  clickOK.                       Step3: Close and restart the Flash. Choose from menubar Window — > Components. The Components panel  show the list of available components.You should now see the name CustomScrollbar in the Components panel, (as seen in Image_4).

Now you can add and use the custom components through flash components panel.

You can download my custom mxp componet file from here scrollbar.mxp

and one more pdf file link for to lean more about MXI and MXP component Click Here.

Cheers,

Kutty

This entry was posted in Custom Components, Flash and tagged , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a comment