Add import pmco.interfaces.IActionOwner in  your code block

 

 

b..

 

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of simonjpalmer
Sent: Wednesday, April 04, 2007 1:27 PM
To: flexcoders@yahoogroups.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> " 
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