eonil
eonil

Reputation: 86085

ActionScript3 interface implementation without public accessor?

In C#, it's possible implementing interface methods without making implementing method as public. For example,

void ITest.SomeMethod() 
{
    // ... 
}

Is there equivalent for ActionScript3?

Upvotes: 0

Views: 63

Answers (2)

hurrymaplelad
hurrymaplelad

Reputation: 27785

Nope. From the AS3 Language Spec:

Classes that implement an interface method must use the public attribute to implement all interface methods.

Upvotes: 1

Jason Sturges
Jason Sturges

Reputation: 15955

In ActionScript, there is no way to add access level qualifiers; however, this question has been asked here, leveraging inheritance of interfaces:

How to expose a method in an interface without making it public to all classes

Perhaps an internal class may be another approach; although, not recommended.

But directly no, all members of ActionScript interfaces are public.

Upvotes: 1

Related Questions