Troubleshooting - Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

private function handleChangeEvent(eventObj:Event):void {
dispatchEvent(new Event("change"));
}
// Handle events that are dispatched by the children.
private function handleClickEvent(eventObj:Event):void {
text_mc.editable = !text_mc.editable;
}
}
}

Troubleshooting

This section describes some common problems and their solutions when you create
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. Ensure that the SWC file is in a directory that Flex searches, and
ensure that your
xmlns
the same directory as the MXML file and setting the namespace to "*" as the following
example shows:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*">
For more information, see Chapter 9, "Using the Flex Compilers," in Building and Deploying
Flex 2 Applications.
I get an error "xxx is not a valid attribute..." when I try to use the component from MXML.
Ensure that the attribute is spelled correctly. Also ensure that it is not private.
I don't get any errors, but nothing appears.
Verify that the component was instantiated. One way to do this is to put a Button control and
a TextArea control in the MXML application and set the
component when the button is clicked; for example:
<!-- This verifies whether a component was instantiated. -->
<zz:mycomponent id="foo"/>
<mx:TextArea id="output"/>
<mx:Button label="Print Output" click="output.text = foo.id;"/>
The component is instantiated properly but does not appear (1)
180
Creating Advanced Visual Components in ActionScript
property is pointing to the right place. Try moving the SWC file to
property to the ID for the
text
.

Advertisement

Table of Contents
loading

Table of Contents