Sometimes, we need to run the swf in page. At that time we can view the swf debug information. So I got a idea. When the swf is running in page, use the javascript to create a print panel. And then, the swf call javascript methods to show debug information.
The easiest way to do that is creating a class just for that. When I need to show, I can create a instance of that class. But firstly, I should to know how to create a panel, print text in that panel, and drag the panel.
About dragging, I had searched a page, witch done that well.
http://blog.sina.com.cn/s/blog_4a9b5035010009se.html
But, the code it shows can’t work. Once you want to drag a object, you should set the position property of that object to “absolute”, such as:<div id=”drag” style=”position:absolute”>drag me <div>
function createDrag(dv){
if (dv.style.position != “absolute”) {
dv.style.position = “absolute”;
}
dv.onmousedown=function(e){
var d = document;
e = e || window.event;
var x= e.layerX || e.offsetX;
var y= e.layerY || e.offsetY;
//设置捕获范围
if(dv.setCapture){
dv.setCapture();
}else if(window.captureEvents){
window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
}
dv.onmousemove = function(e){
e= e || window.event;
if(!e.pageX) e.pageX=e.clientX;
if(!e.pageY) e.pageY=e.clientY;
dv.style.left = e.pageX – x;
dv.style.top = e.pageY – y;
};
dv.onmouseup = function(){
//取消捕获范围
if(dv.releaseCapture){
dv.releaseCapture();
}else if(window.captureEvents){
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
}
//清除事件
dv.onmousemove=null;
dv.onmouseup=null;
};
};
}
Спасибо за текст! Очень понравилось
Ха ха
谢谢你的文字!非常高兴 ——来自google翻译,俄语
hello. nice to find ur site.
You might want to take a look at Flash Tracer plugin in Firefox.
It can debug flash nicely.
thanks