good spot Peter.  I inserted a class in my inheritance hierarchy which
does the interface specification and incorporates the concrete
implementations too through include.  This seems to work but it is
pretty inelegant.  Not that I'm complaining about that.

Thanks for the reply.


--- In flexcoders@yahoogroups.com, "Peter Farland" <[EMAIL PROTECTED]> wrote:
>
> Can you avoid using include and perhaps use MXML to extend a custom AS
> base class that implements your interface and still extends Canvas?
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of simonjpalmer
> Sent: Wednesday, April 04, 2007 4:23 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: "implements", "include", MX and AS...
> 
> 
> 
> Just tried that, doesn't appear to make any difference.
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Brian Holmes" <Brian.Holmes@>
> wrote:
> >
> > Add import pmco.interfaces.IActionOwner in your code block
> > 
> > 
> > 
> > 
> > 
> > b..
> > 
> > 
> > 
> > 
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of simonjpalmer
> > Sent: Wednesday, April 04, 2007 1:27 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] "implements", "include", MX and AS...
> > 
> > 
> > 
> > I have an interface definition and an AS include file which contains a
> > concrete implementation which I include in various places around my
> > code. For all my AS classes this is a very economical programming
> > model which I have used to great effect.
> > 
> > I just tried to use it for an MX control and I get a compilation
> > message saying that my MX component has no implementation in spite of
> > the fact that I am explicitly including it in the script portion of
> > the code.
> > 
> > Here is a snipped version of what I am doing...
> > 
> > package pmco.interfaces
> > {
> > ...
> > public interface IActionsOwner
> > {
> > ...
> > function addAction(a:Action):void;
> > ...
> > }
> > }
> > 
> > I have an include file in which I have some impementations,
> > ConcreteActionOwner.as
> > 
> > ...
> > public function addAction(a:Action):void
> > {
> > if (actions == null) actions = new ArrayCollection();
> > actions.addItem(a);
> > }
> > ...
> > 
> > In regular AS classes I can do this...
> > 
> > public class X implements IActionsOwner
> > {
> > include "ConcreteActionOwner.as"
> > }
> > 
> > and the compiler is happy. However when I do this...
> > 
> > <mx:Canvas
> > xmlns:mx="http://www.adobe.com/2006/mxml
> <http://www.adobe.com/2006/mxml> 
> > <http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> > " 
> > implements="pmco.interfaces.IActionOwner">
> > <mx:Script>
> > <![CDATA[
> > include "ConcreteActionOwner.as"
> > ]]>
> > </mx:Script>
> > 
> > I get a compiler error that my class based on Canvas does not contain
> > an implementation of IActionOwner.
> > 
> > Anyone know whether I can do this and how?
> > 
> > 
> > 
> > 
> > 
> > ***
> > The information in this e-mail is confidential and intended solely
> for the individual or entity to whom it is addressed. If you have
> received this e-mail in error please notify the sender by return
> e-mail delete this e-mail and refrain from any disclosure or action
> based on the information.
> > ***
> >
>


Reply via email to