最近做的项目需要动态创建弹出窗口,动态创建flex弹出窗口的功能没有摸索出来,倒让我摸索出了在flex界面弹出jsp窗口的方法,所有问题迎刃而解。下面上代码:
public function button1_clickHandler(event:MouseEvent):void{ var url ="http://localhost:9080/sps/page/flex/sheet/myUndoSheet.jsp"; ExternalInterface.call("showTranView",url); } <s:Panel title="11111111"> <s:Label text="111" id="myLabel"/> <s:Button label="button" click="button1_clickHandler(event)"/> </s:Panel>
上面的url可以为action或其他类型的url,call()里面的参数可以跟多个,在下面的js代码中依次获取即可
镶嵌swf文件的jsp页面代码:
<script type="text/javascript"> function showTranView(){ var url =arguments[0]; // alert(arguments[0]); window.showModalDialog(url,[],"dialogHeight=400px; dialogWidth=800px;status=no"); } </script>