Chinaunix首页 | 论坛 | 博客
  • 博客访问: 64869
  • 博文数量: 17
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 245
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-19 22:12
个人简介

hello、、、、

文章分类

全部博文(17)

分类: Web开发

2013-12-07 22:01:50

            flex与jsp交互,这里主要说下从html中获取数据

           很多文章中都写得使用ExternalInterface.call。对这个方法不熟悉不知道怎么用,下来再看下。这里介绍使用callIFrameFunction
         

点击(此处)折叠或打开

  1. protected function myFunction(event:MouseEvent):void { 
  2.                    //tijiao为html页面中的js方法                   
  3.                 iFrameBySource.callIFrameFunction("tijiao",null,handleResult);
  4.             }
  5.             private function handleResult(result:Object):void
  6.             {
  7.                  //  showIframe,showDiv为Iframe.as(iframe文件自带)中的方法
  8.                 iFrameBySource.callIFrameFunction("showIframe");
  9.                 iFrameBySource.callIFrameFunction("showDiv");
  10.                 Alert.show("返回结果为: \r\n"+result.xm,"Flex的提示",Alert.OK);
  11.             
  12.             }
返回的值为对象result,alert对象的xm属性。就可以显示出信息。
 
参考博文:
具体代码:http://blog.chinaunix.net/uid-29198626-id-4028246.html
           
阅读(1279) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~