设为首页 加入收藏 网站搜索 繁體中文 中国建站网 — 站长资源分享平台

简单的WINAMP文字滚动效果

来源:136z.Com 作者:佚名 时间:2005-07-19 00:18:40

////创建一个文本框: my_txt
this.createTextField("my_txt", 1, 100, 100, 248.1, 20);


my_txt.border = true;
my_txt.selectable = false;
my_txt.background = true;
my_txt.text = "";
//////////////////////////////////////////
//exam是示例字符串
exam = "12345.mp3";
//inc是计数器
inc = 0;
//显示四段,好使文字的前后连接起来,不会间断
str = exam+" "+exam+" "+exam+" "+exam+" ";
//把str打散
split_str = str.split("");
n = split_str.length;
this.onEnterFrame = function() {
inc++;
//每过八帧就显示一次。也就是移动一次
if (inc%8 == 0) {
//显示
showstr(split_str);
//交换
swap(split_str);
}
};
function showstr(tempstr) {
my_txt.text = "";
//这个是将所有的字符都显示一次
for (i=0; imy_txt.text += tempstr[i];
}
}
function swap(tempstr) {
//保存第一个字符
temp = tempstr[0];
//将字符后移一位
for (i=0; itempstr[i] = tempstr[i+1];
}
tempstr[n-1] = temp;
}
//教程比较简单,不要笑我啊。
下面是源文件:
点击浏览该文件
下面是效果:
点击浏览该文件

Tags:

  • 好的评价 如果您觉得好,就请您
      0%(0)
  • 差的评价 如果您觉得差,就请您
      0%(0)
  • 相关文章
    广告赞助

    文章随便看看 设计素材 建站学院 网页模板 视频教程

    网友评论

    共有 0 位网友发表了评论,得分 0 分,平均 0 分    查看完整评论

    用户名: 查看更多评论

    分 值:100分 85分 70分 55分 40分 25分 10分 1分

    内 容:

             通知管理员 验证码: