我有时必须编辑旧的.fla文件。问题是我更新到更新版本的Flash,现在我无法再使用actionscript1导出.swf了。代码非常简单,它只是告诉你,如果你每月支付17.99美元,而不是目前的账单,你将节省多少。因此,如果滑块的起始值为19(加载时的值),则每月节省的金额(onthly_savings.text)将在6个月内节省1.01美元&(six_months.text)将为6.06美元。如果滑块已被移动,那么这两个值的计算基于滑动率:如何将简单的Actionscript 1转换为Actionscript 3
this.onEnterFrame=function(){
curr_bill.text=mySlider.ratio+19;
ratio.text = (mySlider.ratio+17.99);
if (curr_bill.text=='19'){
six_months.text='$6.06';
monthly_savings.text='$1.01';
}else{
monthly_savings.text = '$'+(curr_bill.text-17.99);
six_months.text = '$'+((6*curr_bill.text)-107.94);
}
}
也有这个脚本是在滑块本身:
this.ratio=0 ;
dragger.onPress=function(){
this.startDrag(true,0,0,line._width,0);
this.onEnterFrame=function(){
ratio=Math.round(this._x) ;
}
}
dragger.onRelease=dragger.onreleaseOutside=stopDrag;
我怎么会重写这个使其在ActionScript 3中工作?