AS3.0简单的继承
package{importflash.display.MovieClip;importflash.events.Event;publicclassZDSJ2Sexten...
package {
import flash.display.MovieClip;
import flash.events.Event;
public class ZDSJ2S extends MovieClip {
public var stopFrame:uint=48;
public var playcondition:Boolean=false;
public function ZDSJ3S() {
init();
}
public function init():void {
addEventListener(Event.ENTER_FRAME,ef);
}
public function ef(e:Event):void {
if (this.currentFrame==stopFrame) {
playcondition=false;
stop();
}
if (playcondition==true) {
play();
}
}
}
}
package {
import flash.display.MovieClip;
import flash.events.Event;
public class ZDSJ3S extends MovieClip {
public var stopFrame:uint=72;
public var playcondition:Boolean=false;
public function ZDSJ3S() {
init();
}
public function init():void {
addEventListener(Event.ENTER_FRAME,ef);
}
public function ef(e:Event):void {
if (this.currentFrame==stopFrame) {
playcondition=false;
stop();
}
if (playcondition==true) {
play();
}
}
}
}
package {
import flash.display.MovieClip;
import flash.events.Event;
public class ZDSJ1S extends MovieClip {
public var stopFrame:uint=24;
public var playcondition:Boolean=false;
public function ZDSJ3S() {
init();
}
public function init():void {
addEventListener(Event.ENTER_FRAME,ef);
}
public function ef(e:Event):void {
if (this.currentFrame==stopFrame) {
playcondition=false;
stop();
}
if (playcondition==true) {
play();
}
}
}
}
可以看出来吧 这3个类除了一个 公用变量不同 其他都一样 我想让后面的2个继承 前面的那个类 并有相同的方法 怎么写 想看下标准的格式 展开
import flash.display.MovieClip;
import flash.events.Event;
public class ZDSJ2S extends MovieClip {
public var stopFrame:uint=48;
public var playcondition:Boolean=false;
public function ZDSJ3S() {
init();
}
public function init():void {
addEventListener(Event.ENTER_FRAME,ef);
}
public function ef(e:Event):void {
if (this.currentFrame==stopFrame) {
playcondition=false;
stop();
}
if (playcondition==true) {
play();
}
}
}
}
package {
import flash.display.MovieClip;
import flash.events.Event;
public class ZDSJ3S extends MovieClip {
public var stopFrame:uint=72;
public var playcondition:Boolean=false;
public function ZDSJ3S() {
init();
}
public function init():void {
addEventListener(Event.ENTER_FRAME,ef);
}
public function ef(e:Event):void {
if (this.currentFrame==stopFrame) {
playcondition=false;
stop();
}
if (playcondition==true) {
play();
}
}
}
}
package {
import flash.display.MovieClip;
import flash.events.Event;
public class ZDSJ1S extends MovieClip {
public var stopFrame:uint=24;
public var playcondition:Boolean=false;
public function ZDSJ3S() {
init();
}
public function init():void {
addEventListener(Event.ENTER_FRAME,ef);
}
public function ef(e:Event):void {
if (this.currentFrame==stopFrame) {
playcondition=false;
stop();
}
if (playcondition==true) {
play();
}
}
}
}
可以看出来吧 这3个类除了一个 公用变量不同 其他都一样 我想让后面的2个继承 前面的那个类 并有相同的方法 怎么写 想看下标准的格式 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询