I'm trying to extend the spark.components.Application component, but I'm getting the following compiler error when I actually try to use my subclass:
Could not resolve <s:layout> to a component implementation.
I have the namespaces set up as per the default when you create a new spark component. Anyone know what I'm doing wrong? Below is the code I'm using:
In the subclass (WidgetBase.as)
public class WidgetBase extends Application
public function WidgetBase()
public function getServiceClass(name:String):*
trace("should fetch service class = "+name);
Using WidgetBase in MXML:
<?xml version="1.0" encoding="utf-8"?>
<views:ProspectInfo left="50" top="100" />
So for some reason the compiler doesn't find the s:layout implementation. It does however find other spark components, such as s:Button, s:CheckBox etc. Why, is the question?
layout is a property of your WidgetBase class (inherited from
Application, inherted from SkinnableContainer). The rules of MXML
state that a property child tag (like layout, dataProvider, etc) must
be in the same namespace as the parent tag it is associated with.
Since your tag is in the plugins: namespace, your layout tag must be
Thank you, Ely! Another lesson learned. So in case anyone else is wondering I changed this
and the problem was solved.