|
|
1
5
尽管AS3不支持抽象类,为什么不定义一个类作为抽象类使用,并让它实现该接口并在该类中定义非公共方法呢。 interface IThing {
function thisMethodIsPublic():void;
}
public class ThingAbstract implements IThing
{
//throw an Error to avoid calling the class directly,
//this class needs to be subclassed
//and this method overridden
protected function thisMethodShouldOnlyBeVisibleToCertainClasses():void
{
throw new IllegalOperationError
('this method should be overriden in a subclass');
}
public function thisMethodIsPublic():void
{
}
}
|
|
|
nabster023 · 拉伸和旋转电影剪辑而不失真 7 年前 |
|
|
BadmintonCat · 获取数组排序的索引 7 年前 |
|
|
Dimentio · 无限循环(动作脚本3) 7 年前 |
|
|
steph45 · 它们是一种在数组中找到最接近0的数字的方法吗? 7 年前 |
|
|
AeroKLiam · AS3-使用组合框进行真/假测验 7 年前 |