AS Text 滚动文字
原创
©著作权归作者所有:来自51CTO博客作者ch_kexin的原创作品,请联系作者获取转载授权,否则将追究法律责任
【一】
nameTxt.addEventListener(Event.ENTER_FRAME, onEnterFrameHander);
var num:int=0;
function onEnterFrameHander(evt:Event):void {
num++;
var sm:Number=_nameTxt.maxScrollH;
nameTxt.scrollH=num;
trace(num);
if (nameTxt.scrollH==sm) {
num = -sm;
}
}
【二】
var text:String = "welcom to makenna’s ITeye !";
for(var i:int = 0;i<int(_nameTxt.width/3);i++){
text=" "+text+" ";
}
nameTxt.htmlText = text;
nameTxt.addEventListener(Event.ENTER_FRAME, onEnterFrameHander);
var num:int=0;
function onEnterFrameHander(evt:Event):void {
num++;
var sm:Number=_nameTxt.maxScrollH;
nameTxt.scrollH=num;
if (nameTxt.scrollH==sm) {
num = 0;
}
}