加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

FLASH脚本10

发布时间:2020-12-15 18:02:29 所属栏目:百科 来源:网络整理
导读:10、FLASH脚本-超文本标签、TextField类 二十九、超文本标签 1. 超链接标签a href和target属性 2. 粗体标签b ? ???3.斜体标签i ? ???4.换行标签br ? ???5.字体标签font ? ???color face size ? ???6.列表项标签li ? ???7.段落标签p ? ???align class ?
10、FLASH脚本-超文本标签、TextField类 二十九、超文本标签1. 超链接标签<a> href和target属性 2. 粗体标签<b> ? ???3.斜体标签<i> ? ???4.换行标签<br> ? ???5.字体标签<font> ? ???color face size ? ???6.列表项标签<li> ? ???7.段落标签<p> ? ???align class ? ???8.下划线标签<u> ? ???9.图像标签<img> ? ???src id? ?width? ?height? ? align? ? hspace? ? vspace mytxt.html = true; xin1.html = true; xin2.html = true; xin3.html = true; xin4.html = true; xin5.html = true; xin6.html = true; mytxt.htmlText = " <img src='pic/heart.jpg' id='mypic'>"; xin1.htmlText = " <img src='pic/twoheart.jpg' id='p1'>"; xin2.htmlText = " <img src='pic/twoheart.jpg' id='p2'>"; xin3.htmlText = " <img src='pic/twoheart.jpg' id='p3'>"; xin4.htmlText = " <img src='pic/twoheart.jpg' id='p4'>"; xin5.htmlText = " <img src='pic/twoheart.jpg' id='p5'>"; xin6.htmlText = " <img src='pic/twoheart.jpg' id='p6'>"; on EnterFrame = function () { mytxt.mypic._x += 8; mytxt.mypic._alpha -= 5; if ((mytxt.mypic._x)>=600) { ? ?mytxt.mypic._x = -340; } if ((mytxt.mypic._alpha)<=0) { ? ?mytxt.mypic._alpha = 100; } xin1.p1._alpha -= 6; if ((xin1.p1._alpha)<=0) { ? ?xin1.p1._alpha = 100; } xin2.p2._alpha -= 4; if ((xin2.p2._alpha)<=0) { ? ?xin2.p2._alpha = 100; } xin3.p3._alpha -= 2; if ((xin3.p3._alpha)<=0) { ? ?xin3.p3._alpha = 100; } xin4.p4._alpha -= 6; if ((xin4.p4._alpha)<=0) { ? ?xin4.p4._alpha = 100; } xin5.p5._alpha -= 4; if ((xin5.p5._alpha)<=0) { ? ?xin5.p5._alpha = 100; } xin6.p6._alpha -= 2; if ((xin6.p6._alpha)<=0) { ? ?xin6.p6._alpha = 100; } }; titletxt.html=true; titletxt.htmlText="<font color='#6600ff' face='隶书' ><i>浪漫情人节<i></font>";   三十、TextField类   1. TextField类的属性 text 文本框中显示的文本 type 文本框的类型,dynamic是动态文本框,input是输入文本框 autoSize 控制文本字段的自动大小调整和对齐 background 文本字段是否有背景填充 backgroundColor 文本字段背景的颜色 border 文本字段是否具有边框 borderColor 文本字段边框的颜色 bottomScroll 文本字段中当前可见的最后一行 hscroll 文本框的当前水平滚动位置 html 文本字段是否起用html格式 htmlText文本框包含的html形式的文本内容 length返回文本框的字符数 maxChars 文本框最多可以容纳的字符数 multiline 文本框是否显示多行文字 password 文本框输入的内容是否用*表示 scroll 返回文本框当前滚动位置 selectable 文本框是否可以选择 _url 在文本框中指定url链接 variable 返回与文本框相关联的变量名 wordWrap 指定文本框是否换行 restrict 用户输入到文本字段中的字符集 2. TextField类的方法 TextField.addListener() 注册一个对象 TextField.getFontList() 以数组的形式返回播放器的主机系统上的字体名称 TextField.getDepth() 返回文本框的深度 TextField.getNewTextFormat() 获取分配给新插入文本的默认文本格式 TextField.getTextFormat() 返回一个字符或整个文本框的文本格式 TextField.reMoveListener() 删除侦听器对象 TextField.reMoveTextField() 删除使用MovieClip.createTextField()创建的文本框 TextField.replaceSel() 替换当前所选的内容 TextField.setNewTextFormat() 设置文本格式 TextField.setTextFormat() 为文本框中指定的文本设置格式 TextField.replaceText() 替换文本框中指定的文本 mc.createTexeField(instanceName,depth,x,y,width,height);                        var i = 0;    var count = 0;    _root.on EnterFrame = function() {    ? ?count++;    ? ?count %= 5;    ? ?if (count == 0) {    ? ?? ?_root.createTextField("txt"+i,i,25+500*Math.random(),12,12);    ? ?? ?with (_root["txt"+i]) {    ? ?? ?? ?text = String.fromCharCode(Math.floor(26*Math.random())+65);    ? ?? ?? ?autoSize = "center";    ? ?? ?? ?type = "dynamic";    ? ?? ?? ?textColor = 0x0000FF;    ? ?? ?? ?border = true;    ? ?? ?? ?borderColor = 0x999999;    ? ?? ?? ?background = true;    ? ?? ?? ?backgroundColor = 0xDDDDDD;    ? ?? ?}    ? ?? ?i++;    ? ?}    ? ?for (var j in _root) {    ? ?? ?_root[j]._y += 5;    ? ?? ?if (_root[j]._y>400) {    ? ?? ?? ?_root[j].removeTextField();    ? ?? ?}    ? ?}    };    _root.on KeyDown = function() {    ? ?for (var j in _root) {    ? ?? ?if (_root[j].text == String.fromCharCode(Key.getCode())) {            ? ?? ?? ?_root[j].text = "PASS";    ? ?? ?? ?_root[j].textColor = 0xFF0000;    ? ?? ?? ?_root[j].borderColor = 0xFF0000;    ? ?? ?? ?_root[j].backgroundColor = 0xFFFF00;    ? ?? ?? ?break;    ? ?? ?}    ? ?}    };    Key.addListener(_root);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读