User Guide

Troubleshooting 181
In some cases, helper classes are not ready by the time your component requires them. Flex
adds classes to the application in the order that they must be initialized (base classes, and then
child classes). However, if you have a static method that gets called as part of the initialization
of a class, and that static method has class dependencies, Flex does not know to place that
dependent class before the other class, because it does not know when that method is going to
be called.
One possible remedy is to add a static variable dependency to the class definition. Flex knows
that all static variable dependencies must be ready before the class is initialized, so it orders the
class loading correctly.
The following example adds a static variable to tell the linker that class A must be initialized
before class B:
public class A {
static function foo():Number {
return 5;
}
}
public class B {
static function bar():Number {
return mx.example.A.foo();
}
static var z = B.bar();
// Dependency
static var ADependency:mx.example.A = mx.example.A;
}
The component is instantiated properly but does not appear (2)
.
Verify that the
measuredWidth and measuredHeight properties are nonzero. If they are zero
or NaN, ensure that you implemented the
measure() method correctly.
You can also verify that the
visible property is set to true. If visible=false, ensure that
your component called the
invalidateDisplayList() method.
The component is instantiated properly but does not appear (3).
It is possible that there is another class or SWC file that overrides your custom class or the
symbols used in your component. Ensure that there are no naming conflicts.