Flex 调用JSP页面

  1. public function button1_clickHandler(event:MouseEvent):void{   
  2.                 var url ="http://localhost:9080/sps/page/flex/sheet/myUndoSheet.jsp";   
  3.                 ExternalInterface.call("showTranView",url);   
  4.             }   
  5.   
  6.   
  7. <s:Panel title="11111111">   
  8.         <s:Label text="111" id="myLabel"/>   
  9.         <s:Button label="button" click="button1_clickHandler(event)"/>   
  10. </s:Panel>  
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页面代码:

Js代码 复制代码  收藏代码
  1. <script type="text/javascript">   
  2.         function showTranView(){   
  3.                 var url =arguments[0];   
  4.             //  alert(arguments[0]);   
  5.                 window.showModalDialog(url,[],"dialogHeight=400px; dialogWidth=800px;status=no");   
  6.         }   
  7.            
  8.         </script>  

你可能感兴趣的:(Flex)