【游客模式】——注册会员,加入11RIA 闪客社区吧!一起见证Flash的再次辉煌……
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
少废话!上代码!!
[Actionscript3] 纯文本查看 复制代码 //班级类
package classpackage.son
{
public class Teacher
{
private var gr:String = "我是七年级:";
private var cla:uint = 0;
public var getclatimes:uint = 0;
public var setclatimes:uint = 0;
public var setprtimes:uint = 0;
public function Teacher()
{
// constructor code
}
private function pr(e:uint)
{
cla = e;
trace(gr+cla+"班");
}
public function get getgr():String
{
return gr;
}
public function get getcla():uint
{
getclatimes++;
return cla;
}
public function set setcla(e:uint)
{
setclatimes++;
cla = e;
}
public function set setpr(e:uint)
{
setprtimes++;
pr(e);
}
}
}
[Actionscript3] 纯文本查看 复制代码 //文档类
package classpackage
{
import flash.display.Sprite;
import classpackage.son.Teacher;
public class doc extends Sprite
{
var T1:Teacher=new Teacher();
public function doc()
{
trace("我是文档类!!");
init();
// constructor code
}
private function init()
{
//T1.pr(2);
trace(T1.getgr);
for (; ; )
{
if (T1.setprtimes < 5)
{
T1.setcla=T1.setclatimes
trace(T1.getcla);
T1.setpr = T1.getcla;
}
else
{
trace("对不起,您最多只能查看5次!!!");
break;
}
}
}
}
}
|