User Guide

Table Of Contents
78 Chapter 3: Creating Advanced Components in Flash MX 2004
static function bar():Number
{
return mx.example.A.foo();
}
static var z = B.bar();
// Dependency
static var ADependency = mx.example.A;
}
The component is instantiated properly but does not show up (#2)
Verify that the _measuredPreferredWidth and _measuredPreferredHeight properties are
nonzero. If they are zero, ensure that you implemented the
measure() method correctly.
Sometimes you have to ensure that subobjects are created in order to get the correct
measurements.
You can also check the values of the
preferredWidth and preferredHeight properties. Other
code might have set those values to 0. If so, set a breakpoint in the setters for the
width, height,
preferredWidth, and preferredHeight properties to see what is setting them.
You can also verify that the
visible property and the _visible property are set to true. The
_visible property is an internal property used by Flash Player. If visible=true and
_visible=false, ensure that your component called the invalidate() method in its
measure() or layoutChildren() methods.
The system does not call the
invalidate() method unless you explicitly do so. All components
must call the
invalidate() method at least once, because their layout changes as they are given
their correct size during the layout process.
The component is instantiated properly but does not show up (#3)
It is possible that there is another class or SWC file that overrides your custom class or the
symbols used in your component. Check the ActionScript classes and SWC files in the
flex_app_root/WEB-INF/flex/user_classes directory to ensure that there are no naming conflicts.