mensonge
mensonge

Reputation: 81

Skins not loaded in sub-applications (in Flex)

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 :

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

Answers (2)

Riduidel
Riduidel

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

Leon
Leon

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

Related Questions