views:

73

answers:

1

Hello,

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?