Reputation: 81
We try to develop a flash game engine with several abstraction layers. This flex project contains:
an Application (1)-> loading a class (2)-> loading another class (3) which instanciates a Flex component (4).
The loadings uses SWFLoader. The last Flex component (4) is just a Group with AdvancedDataGrid. We do not define skins so I suppose it must take default skin.
The problem is that during execution, an error is throwed because default skin for components cannot be found in the Flex component (4). In our case, for the AdvancedDataGrid:
Error #1007: Instantiation attempted on a non-constructor.
in mx.controls::AdvancedDataGridBaseEx
.
The guilty command is: getStyle("headerSeparatorSkin");
which returns null
For the moment, we found two solutions :
the first solution is to add the attribute headerSeparatorSkin="spark.skins.SparkSkin"
into the AdvancedDataGrid of the Flex component (4). But it means I must manually add each skin for each part of component which is a quite boring solution.
the second solution is to put a create an AdvancedDataGrid into the first Application (1). I suppose that it adds the AdvancedDataGrid into the compilation and linking process. However, this solution is not nice because the Application (1) must know which UIComponents are used by the Flex component (4).
We tried the compiler option "keep-all-type-selectors=true" (like this) but nothing changed.
So, has someone a solution to force the compiler to explicitly link a Flex component and his skin in a sub-application?
Upvotes: 4
Views: 2493
Reputation: 22308
According to Flexmaniak.pl, it can be solved by adding the -keep-all-styles-selectors
to the flex compiler arguments.
The Correct syntax for Flex 4.5.1 is -keep-all-type-selectors
Upvotes: 6
Reputation: 11
I experienced this problem when including all of my Flex libraries as Runtime Shared Libararies (RSLs). I Changed the framework linkage in my compiler options to "Merged into code" and getStyle("headerSeparatorSkin") no longer returned null. Not sure if this a viable option for you, but at least it'll give you a hint.
Upvotes: 1