flash进行对浏览器的拖动呢

      flash As 2005-9-1 18:11:00
可以在今天就解决了这个问题的朋友,我愿意把我的分数全部给您。
大家就帮帮忙吧。

<script language="javascript" type="text/javascript">
function init()
{
x0=document.body.scrollLeft+event.clientX;
y0=document.body.scrollTop+event.clientY;
}
function move()
{
var x=document.body.scrollLeft+event.clientX-x0;
var y=document.body.scrollTop+event.clientY-y0;
self.moveBy(x,y);
}

</script>
<a href="#" onmousedown=init() ondrag=move()>按住我拖动</a>
这一段是拖动浏览器的javascript,
应该怎样才可以用flash进行对浏览器的拖动呢?

---------------------------------------------------------------

在flash里面做一个movieClip,在上面写action 如下:
onClipEvent (load) {
this.onPress = function() {
this.mDown = true;
};
this.onRelease = function() {
this.mDown = false;
};
this.onReleaseOutside = function() {
this.onRelease();
};
}
onClipEvent (enterFrame) {
if (this.mDown) {
this.onMouseMove = function() {
getURL("javascript:init()");
getURL("javascript:move("+this._xmouse+","+this._ymouse+")");
};
} else {
delete this.onMouseMove;
}
}


------------------------------
将你javascript脚本中的 move()函数修改如下:

function move(x,y)
{
self.moveBy(x,y);
}
标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}