I am currently new in ActionScript and I am creating an Interface and Class where class implements Interface. I have created Interface and Class both in src/com folder. Here is the code what I did till now.
Interface
package com
{
public interface TestData
{
function getInput(str:String):void
function getOutput():String
}
}
Class
package com
{
public class EntityEL implements TestData
{
public var uname:String;
function getOutput():String
{
return uname;
}
function getInput(str:String):void
{
uname = str;
}
public function EntityEL()
{
}
}
}
mxml file
public var etn:EntityEL = new EntityEL();
public function btnClick():void
{
etn.getInput(value.text);
Alert.show(etn.getOutput());
}
<mx:Button label="Button Click" click="{btnClick();}" />
<mx:TextInput id="value" />
I am getting an error "1044: Interface method getInput in namespace com:TestData not implemented by class com:EntityEL."
Please Help me to solve this problem.
public
to implemented methods in EntityEL class. I thought they had to be public methods when a class implements interfaces. – mask8