我们有三个弹出式窗口
下面是引起问题的Popup1上的两个方法。在这些中,如果注释了ExternalInterface.call,鼠标事件就会在警报上工作。有什么办法解决这个问题吗?
private function onCreationComplete( event:Event ):void
{
positionHandler(event);
changeHandler(event);
this.addEventListener(ResizeEvent.RESIZE, positionHandler);
this.addEventListener(MoveEvent.MOVE, positionHandler);
this.parent.addEventListener(ResizeEvent.RESIZE, positionHandler);
txtMsgDesc.addEventListener(MoveEvent.MOVE, positionHandler);
}
private function positionHandler(event:Event):void
{
var position:Point = new Point(txtMsgDesc.x + this.borderMetrics.left + 10, txtMsgDesc.y + this.borderMetrics.top);
position = this.localToGlobal(position);
position = Application.application.globalToLocal(position);
var width:int = txtMsgDesc.width;
var height:int = txtMsgDesc.height;
ExternalInterface.call("moveHtml", position.y, position.x, width-5, height-5);
}而外部接口调用javascription来设置宽度、高度等无法显示,就会遇到这个函数的问题。
function moveHtml(top, left, width, height)
{
htmlTextArea.style.top = parseFloat(top);
htmlTextArea.style.left = parseFloat (left);
htmlTextArea.style.width = parseFloat (width);
htmlTextArea.style.height = parseFloat (height);
}更新
在javascript函数中,如果我硬编码值,它的工作方式如下所示--我怀疑parseFloat存在一些问题,并试图检查值是否不是isNaN,但仍然不工作:(
function moveHtml(top, left, width, height)
{
htmlTextArea.style.top = 200;
htmlTextArea.style.left = 300;
htmlTextArea.style.width = 100;
htmlTextArea.style.height = 200;
}发布于 2015-09-25 02:23:26
我终于解决了这个问题。它是html,div,交叠的flex文本区域,正在阻止鼠标在警报窗口上的交互。
我们有一个JSP页面,它加载swf文件,这个JSP包含一个div。在Flex屏幕上,一些电子邮件类型的flex文本区域显示电子邮件内容,而对于其他类型,flex文本区域是隐藏的,并将内容设置为div (使用div.innerHTML)。
当警报在html div之上打开时,鼠标事件在警报上不起作用。作为解决办法,我将警报移到左边,这样它就不会出现在解决问题的html文本区域之上。
https://stackoverflow.com/questions/32715147
复制相似问题