Flash MX 2004 组件事件简单调试器,Flash MX 2004 组件事件简单调试器
【 tulaoshi.com - Flash 】
Mx 2004 的发布,特别是改为V2 components以后, components的功能得到了极大的强化。而对于普通编程者来说,首先要了解的就是如何合理的使用这些components来完成期望的工作,也就是这个components能实现什么功能,会响应哪些事件,响应事件的过程是如何的,如何编写事件响应函数。 为此,我编写了一个简单的components事件调试器,用来调试components的事件响应过程(具体每个components的实现功能,请查阅Macromedia的help文档)
form = new Object();
form = function (evt) {
trace("Begin");
for (var i in evt) {
trace(i add ":" add typeof (eval("evt." add i)) add " = " add eval("evt." add i));
}
trace("End");
};
function Init(obj){
obj.addEventListener("click", form);
obj.addEventListener("focusIn", form);
obj.addEventListener("focusOut", form);
obj.addEventListener("keyDown", form);
obj.addEventListener("keyUp", form);
obj.addEventListener("resize", form);
obj.addEventListener("move", form);
obj.addEventListener("draw", form);
obj.addEventListener("load", form);
obj.addEventListener("unload", form);
}
Init(_root.but);
stop();
Begin
target:movieclip = _level0.but
type:string = load
End
Begin
target:movieclip = _level0.but
type:string = draw
End
Begin
target:movieclip = _level0.but
type:string = focusIn
End
Begin
target:movieclip = _level0.but
type:string = click
End
Begin
target:movieclip = _level0.but
type:string = keyDown
code:number = 65
ascii:number = 97
shiftKey:boolean = false
ctrlKey:boolean = false
End
Begin
target:movieclip = _level0.but
type:string = keyUp
code:number = 65
ascii:number = 97
shiftKey:boolean = false
ctrlKey:boolean = false
End
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/flash/) [next]
load 参数(target,type)
draw 参数(target,type)
(mouse事件)
focusIn 参数(target,type)
click 参数(target,type)
focusOut 参数(target,type)
(key事件)
keyDown 参数(target,type,code,ascii,shiftKey,ctrlKey)
keyUp 参数(target,type,code,ascii,shiftKey,ctrlKey)
move 参数(target,type,oldX,oldY)
resize 参数(target,type,oldWidth,oldHeight)
unload 参数(target,type)
来源:http://www.tulaoshi.com/n/20160129/1492422.html
看过《Flash MX 2004 组件事件简单调试器》的人还看了以下文章 更多>>