精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>电脑技术>>Flash闪客>>≈Flash教程≈>>flash6 AS 部分解釋(完结篇)

主题:flash6 AS 部分解釋(完结篇)
发信人: aeoluszan(呢隻貓仔)
整理人: lyongmei1977(2002-05-29 00:10:35), 站内信件
 完结篇 
onSetFocus() 
listenerObject.onSetFocus(oldFocus, newFocus) 
listenerObject监听者,oldFocus失去焦点的对象,newFocus得到焦点的对象 
listenerObject用Selection.addListener()方法注册,必须用于反馈方法onSetFocus 

Selection.addListener() 
作用如上所表 

Selection.removeListener() 
有add当然有remove,特性和其他removeListener()相同 

onKillFocus() 
object.onKillFocus(newFocus) 
object为失去焦点的对象,newFocus为得到焦点的对象 
当一个mc失去焦点时,如果定义了onKillFocus()则调用他 

setInterval() 
setInterval( function, interval[, arg1, arg2, ..., argn] ) 
setInterval( object, methodName, interval[, arg1, arg2, ..., argn] ) 
一个多态的方法,用于每隔一定时间使用指定的参数执行一个函数或一个对象的方法 
具体在clearInterval中已经讲过 

Sound.length 
属性,用毫秒数表示声音的长度 

Sound.onSoundComplete() 
mySoundObject.onSoundComplete = callbackFunction 
当声音对象加载完数据后执行 
感觉flash6的action script越发显出面向对象的特点,事件驱动模型 
用Java来描述就是 
class Sound extends Object implements SoundListener{ 
... 
this.addListener(this); 
onSoundComplete(){ 



Sound.position 
属性,表示当前播放的声音的毫秒数 

_soundbuftime 
_soundbuftime = integer 
虽然flash4中就开始支持,不过还是要说一下 
设定在声音开始加载到prebuffer的秒数,默认5 sec 
比较短的声音是不会用到prebuffer,所以是即时的 

Stage (object) 
新增对象,用以访问和维护flash电影的边界 

Stage.height 场景的高度 
当Stage.scaleOnResize为真时,为flash播放器的高度 
当Stage.scaleOnResize为假时,为flash电影的高度 

Stage.onResize() 
Stage.onResize() = function() {...} 
事件驱动,调整大小时被触发 

Stage.scaleOnResize 
属性,见Stage.height中的描述 

Stage.width 
类似Stage.height 

super 
不能忍啊,连super也有了 
this指向当前对象,super为他的父类 
可以用来调用父类的方法和构造器 

switch 和大部分程序设计语言中的switch语法一致 
虽然不是必需的,但可以简化if else if 

tabChildren 
object.tabChildren 
属性,默认为undefined. 
如果一个mc的这一属性为真或undefined,则她的子mc会包含tab ording 
如果为false则子mc不会包含tab ording 
tab ording是指当按下tab键后,焦点会移到下一个组件上去 
当你做一个列表框时,里面的各个项目或许都是按钮 
这时按下tab应该会移到这个列表框而不需要移到里面的按钮 
这时你就应该设tabChildren为false 
另外,如果你自己定义了Tab Ording那么无效 

tabEnabled 
属性。若为真,则包含上面提到的tab ording 

tabeIndex 
属性。用来自定义tab Ording 

TextField 一种新的内置对象 
他的方法有 
scroll() 当前的移动量 
maxscroll() 总的移动量 
onChanged() 事件驱动,当改变内容时 
onScroller() 事件驱动,当移动时 
属性有 
_alpha 
_currentframe 
_droptarget 
_framedsloaded 
_height 
_name 
_parent 
_rotation 
_target 
_totalframes 
_url 
_width 
_xscale 
_y 
_ymouse 
_yscale 
由于他是继承了Object类,所以也用一般Object的成员变量 

TextField.type 
显示文本框的类型,只有两种,dynamic(动态的,用户不可编辑) input(用户可编辑) 

TextField.password 
表示文本框是否为password框,echo的字符为"*"或“.”(win xp) 

TextField.multiline 
是否多行 

TextField.wordwrap 
是否自动换行 

TextField.html 
是否为html文本 

TextField.embedFonts 
若为真,文字被渲染成内嵌的字体外形,反之,使用设备相关的字体 

TextField.variable 
可以把一个文本框和一个变量联系起来 

TextField.maxChars 
最大字符量 

TextField.restrict 
指定文本框中的字符集 
若为null,则允许任何字符,若为""则不允许任何字符,否则只有字符串中的字符才允许键入 

TextField.autoSize 
可以为空(并不自动改变大小或自动对齐)left(左对齐并自动调整大小)center,right类似 

TextField.hscroll 
当前的横向移动值 

TextField.maxhscroll 
最大横向移动值 

TextField.border 
是否有边界 

TextField.background 
是否有背景色 

TextField.backgroundColor 
背景色,默认为白色 

TextField.text 
当前文本,换行被替换成\r(ASCII 13),且忽略html标签 

TextField.htmlText 
当前文本,不忽略html标签 

TextField.length 
文本长度 

TextField.replaceSel(text) 
替换被选中的文本 

TextField.getBeginIndex() 
得到文本选区的首索引值,如果没有选中任何文本,则返回-1 

TextField.getEndIndex() 
得到文本选区的首索引值,如果没有选中任何文本,则返回-1 

TextField.setSelection (beginIndex, endIndex) 
设定文本选区 

TextField.getTextFormat() 
TextField.getTextFormat (index) 
多态的方法,返回一个TextFormat对象 

TextField.setTextFormat (textFormat) 
TextField.setTextFormat (index, textFormat) 
TextField.setTextFormat (beginIndex, endIndex, textFormat) 
多态的方法,用以向指定位置设置textFormat 

TextField.getFontList() 
是TextField类的静态方法,返回一个包含所有播放器所在电脑字体名字的数组 

TextFormat 对象 
必须用new TextFormat()来生成一个新的实例 
myTextFormat = new TextFormat(); 
myTextFormat.bold = true; 
myTextField.setTextFormat(myTextFormat); 
new TextFormat(font, size, textColor, bold, italic, underline, url, window, 

align, leftMargin, rightMargin, indent, leading) 

TextFormat.font 
字体名 

TextFormat.language 
字体语言,使用ISO 639 标准。如zh jo jp cn en 

TextFormat.size 
像素值 

TextFormat.color 
颜色 

TextFormat.bold 
TextFormat.italic 
TextFormat.underline 
布尔值,不同外观 

TextFormat.url 
指向的超联接 

TextFormat.window 
联接显示的frame名 _self _left ... 

TextFormat.leftMargin 
TextFormat.rightMargin 
左右留白 

TextFormat.align 
对齐方式,left center right 

TextFormat.indent 
缩进数 

TextFormat.leading 
垂直方向行间距 

TextFormat.ascent 
TextFormat.descent 
上下偏移 

TextFormat.hasDeviceFont 
是否使用设备字体,只读 

TextFormat.hasOutlineFont 
是否使用字体外观,只读 

TextFormat.realFont 
实际使用的字体名 

TextFormat.getTextExtent (text) 
返回使用该字体格式的字符串的大小 


==========end==============






----
Nothing_Here           

[关闭][返回]