> public interface TestInterface {
> function test(obj:Object):Boolean;
> }

From AS3 spec:-

1) Interface methods are not public by default, but are added to the public namespace by the implementing method definition.

2) Classes that implement an interface method must use the public attribute to implement all interface methods that have the same identifier name.

3) Interface methods are visible when referenced through a property of the corresponding interface type or through a reference to the implementing class or subclass.

Example:-
interface I 
{
function f()
}
interface J
{
function g()
}

class A implements I
{
public function f() {}
public function g() {}
}

var a : A = new A
a.f() // okay, f is visible through an A as {public}::f
a.g() // okay, g is visible through an A as {public}::g

var i : I = b
i.f() // okay, f is still visible through an I as {I}::f
i.g() // error, g is not visible through an I as {I}::g


Does it make sense?

-abdul


On 6/10/06, karthikeyanik < [EMAIL PROTECTED]> wrote:




Hi,

1) When compiling an .as interface, we get the following error -

Error Code 1157:
Interface members may not be
declared 'public', 'private', 'protected', or 'internal'

Eg: Interface

public interface TestInterface {
public function test(obj:Object):Boolean;
}

If the interface definition is changed as follows, the error 1157
does not occur.

public interface TestInterface {
function test(obj:Object):Boolean;
}

But if the interface function is not defined as public, it wont
be visible outside. It would be great, if someone can provide
suggestions on how to resolve this error.

Thanks,
Karthi


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to