PDA

View Full Version : interfaces in *.mxml


nirth
05-26-2006, 04:20 AM
Hello conf, i'm currently working on problem with implementing interfaces in mxml, i found some workaround:
some interface:

package{
interface A {
function doSomething():void;
}
}

class which implement interface, and used as base class for mxml

package{
public class B extends VBox implements A {
public function doSomething():void {};
}
}

and finally our mxml

<?xml version="1.0" encoding="utf-8"?>
<B xmlns:mx="http://www.adobe.com/2006/mxml">
<!-- some stuff goes here -->
</B>

but i dont really like this way, is there any way to implement interface directly?

nirth
05-27-2006, 05:00 AM
damn i had to read docs more carefully
answer is here http://livedocs.macromedia.com/labs/1/flex20beta3/00001407.html


<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" implements="my.packages.IInterface">