MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual page 27

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

Right-click the symbol in the Flash Library and select Export SWC File.
13.
Save the new SWC file as orangecircle.swc.
14.
In a text editor, create an MXML file that contains the following code:
15.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns:myp="myPackage.*" >
<myp:orangecircle />
</mx:Application>
You must add a namespace declaration that includes the package whenever you access a
component that uses ActionScript files in packages.
You cannot name the file orangecircle.mxml. You must give it a name that is different from the
component's name, such as oc.mxml.
Save the MXML file.
16.
Copy the SWC file that you created (orangecircle.swc) to the same directory as the MXML file.
17.
This should not be the same directory in which you saved the ActionScript and FLA file. This
directory must be in the web application's directory structure, so that Flex can compile a SWF
from the MXML file.
Request the MXML file in your browser or a stand-alone Flash Player. An orange circle should
18.
appear.
Creating the Blue Button
This procedure shows you how to extend an existing Flex control. In this example, it is a button.
The button's border and text are blue. When you insert the Blue Button component into your
Flex application, it inherits all of the events, behaviors, and capabilities of a standard Button
control, but it has a customized style.
To create the Blue Button:
Set up the Flash environment by adding the Flex components and class files. For more
1.
information, see
In Flash, create a FLA file.
2.
Edit the FLA file's local classpath settings to include the following two classpath entries:
3.
$(LocalData)/Flex Classes
. (the dot)
For more information, see
Select Insert > New Symbol.
4.
The Create New Symbol dialog box appears.
Rather than convert existing graphical assets to a symbol, you create a symbol and add
dependent components to it as assets.
"Adding Flex classes and components to the Flash IDE" on page
"Changing the Flash classpath" on page
8.
10.
Creating simple components
27

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents