Reputation: 11
I'm trying to create a base class for components by extending Group in Flex 4, but I can't seem to define the layout through MXML. Any time I try to move the definition to a subclass of my base component, I get the following error:
Error: Could not resolve <s:layout> to a component implementation.
Judging by that error, it seems that some magic from the framework's side goes into assigning it for a Group and thus the compiler fails when trying to assign it for any other classes. Does anyone know how this is supposed to work? Any idea how to allow me to define it in subclasses?
Upvotes: 1
Views: 714
Reputation: 172
You have to use the namespace of the subclass
instead of
<s:layout>
if the package / namepace definition is customComp, for example use
<customComp:MyTestComponent id="aaa">
<customComp:layout>
<customComp:VerticalLayout />
</customComp:layout>
<Button id=.... />
<Button id=.... />
</customComp:MyTestComponent>
Upvotes: 8