Skins not loaded in sub-applications (in Flex)

We are trying to develop a flash engine with several levels of abstraction. This flex project contains:

application (1) β†’ load class (2) β†’ load another class (3) that initializes the Flex component (4).

The downloads use SWFLoader. The last component of Flex (4) is just a group with AdvancedDataGrid. We do not define skins, so I suppose it should use skins by default.

The problem is that an error is thrown at runtime because the default skin for components cannot be found in the Flex (4) component. In our case, for AdvancedDataGrid:

Error #1007: Instantiation attempted on a non-constructor. 

in mx.controls::AdvancedDataGridBaseEx .

Guilty team: getStyle("headerSeparatorSkin"); which returns null

At the moment, we have found two solutions:

  • the first solution is to add the headerSeparatorSkin="spark.skins.SparkSkin" attribute in the AdvancedDataGrid component of the Flex (4) component. But that means I have to manually add every skin for every part of the component, which is a pretty boring decision.

  • the second solution is to put the creation of AdvancedDataGrid in the first application (1). I believe that it adds AdvancedDataGrid to the compilation and linking process. However, this solution is not very pleasant, because application (1) needs to know which UIComponents are used by the Flex (4) component.

We tried the compiler parameter "keep-all-type-selectors = true" (for example, this ), but nothing changed.

So, is there any solution to make the compiler explicitly bind the Flex component and its skin in a sub-application?

+4
source share
2 answers

According to Flexmaniak.pl , it can be solved by adding -keep-all-styles-selectors to the flex compiler arguments.

The correct syntax for Flex 4.5.1 is -keep-all-type-selectors

+6
source

I ran into this problem when I included all my Flex libraries as shared Libararies (RSL). I changed the frame binding in my compiler options to "Code Integrated" and getStyle ("headerSeparatorSkin") no longer returns null. Not sure if this is a viable option for you, but at least it will give you a hint.

+1
source

All Articles