C++ has a concept of Friend classes. If I recall (been a LONG time since college), it was a way that you could share one objects functionality with another class and only that other class. Other classes that were not declaired as friends could not access functionality. I was wondering if Actionscript had a similar concept.
I have public methods on some of my classes which exposes potential pitfalls of clients of my SWF files. So, I'm looking for a way to better bullet proof my code such that users of my classes/swf files use them in the proper way, proper context. I don't want them calling the wrong public methods when a given public method was intended to be used by some other class.
Hope this makes since.
Nope, not an interface. It was a keyword in C++ that allowed two different classes to be friends of each other... Basically allowed object B to call private methods on object A.
Thanks Paul for the heads up.
There is not direct equivalent of friend. There is the concept of namespaces. In certain cases you can use namespaces to reduce discoverability of APIs. They are unrestricted (friend restricts access to a pre-declared set of friends) and can’t be used in interfaces, but it is an option.
Look at the way that the framework code puts certain properties and methods in the mx_internal namespace. To use them, you have to do
use namespace mx_internal;
Gordon Smith, Adobe