User Guide

Table Of Contents
76 Chapter 3: Creating Advanced Components in Flash MX 2004
bTextChanged = true;
invalidate();
}
function get text():String
{
if (bTextChanged)
return __text;
return text_mc.text;
}
// Handle events that are dispatched by the children.
function handleEvent(evt:Object):Void
{
if (evt.type == "change")
{
dispatchEvent({ type: "change" });
}
else if (evt.type == "focusOut")
{
text_mc.editable = false;
}
else if (evt.type = "click")
{
text_mc.editable = !text_mc.editable;
}
}
}
The following is an example MXML file that instantiates the ModalText control and sets the
labelPlacement property to "left":
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns=”*”
width="800" height="400">
<ModalText labelPlacement="left"/>
</mx:Application>
Troubleshooting
This section describes some common problems and their solutions when creating components for
Flex in Flash.
I get an error "don't know how to parse ..." when I try to use the component from MXML.
This means that the compiler could not find the SWC file, or the contents of the SWC file did
not list the component. The MXML tag must match the
symbolName for the component. Also,
ensure that the SWC file is in a directory that Flex searches, and ensure that your
xmlns property
is pointing to the right place. Try moving the SWC file to the same directory as the MXML file
and setting the namespace to "*" as the following example shows:
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*">
For more information, see “Using SWC files” on page 18.