flash doc怎么嵌套doc

评论-1246&
trackbacks-0
在flex组件中嵌入html代码,可以利用flex iframe。这个在很多时候会用到的,有时候flex必须得这样做,如果你不这样做还真不行……
flex而且可以和html进行JavaScript交互操作,flex调用到html中的JavaScript方法以及获取调用后的返回值。
1、flex iframe下载地址:
下载完成后目录如下
asdoc就是文档doc了
bin有需要用到的flex库 swc
examples就是示例
sources源代码
欢迎关注我的博客:
2、将bin目录中的swc引入到你的flex工程中,并加入代码片段如下
&?xml version=&1.0& encoding=&utf-8&?&
&mx:Application xmlns:mx=&/2006/mxml&
xmlns:flexiframe=&/p/flex-iframe/&
horizontalAlign=&center& verticalAlign=&middle& xmlns:s=&library:///flex/spark&&
&mx:Script&
import mx.controls.A
protected function sayHelloHandler(event:MouseEvent):void {
// 调用当前iframe嵌入页面中的sayHello 的JavaScript方法
iFrameBySource.callIFrameFunction(&sayHello&);
protected function sayHandler(event:MouseEvent):void {
// 调用当前iframe嵌入页面中的say的JavaScript方法,并传入一个参数
iFrameBySource.callIFrameFunction(&say&, [&hello world!&]);
protected function sayHiHandler(event:MouseEvent):void {
// 调用当前iframe嵌入页面中的sayHi的JavaScript方法,并传入2个参数。sayHi方法会返回一个字符串,最后一个回调就是输出值的函数
iFrameBySource.callIFrameFunction(&sayHi&, [&hello world&, &李四&], function (data:*): void {
Alert.show(data);
&/mx:Script&
&!-- HTML content stored in a String --&
&mx:String id=&iFrameHTMLContent&&
&title&About&/title&
&div&About&/div&
&p&Simple HTML Test application. This test app loads a page of html locally.&/p&
&div&Credits&/div&
&p&IFrame.as is based on the work of&/p&
&li&&a href=&http://coenraets.org/& target=&_top&&Christophe Coenraets&/a&&/li&
&li&&a href=&/& target=&_top&&Brian Deitte&/a&&/li&
&/mx:String&
&mx:Panel width=&80%& height=&80%& title=&使用source本地远程页面&&
&flexiframe:IFrame id=&iFrameBySource& width=&100%& height=&100%& source=&frame.html&/&
&s:Button label=&sayHello& click=&sayHelloHandler(event)&/&
&s:Button label=&say-param& click=&sayHandler(event)&/&
&s:Button label=&sayHi& click=&sayHiHandler(event)&/&
&/mx:Panel&
&mx:Panel width=&80%& height=&80%& title=&使用source加载远程页面&&
&flexiframe:IFrame id=&iFrameByRemoteSource& width=&100%& height=&100%& source=&& visible=&true&
overlayDetection=&true& /&
&/mx:Panel&
&mx:Panel width=&80%& height=&80%& title=&使用content属性 加载本地html文本内容&&
&flexiframe:IFrame id=&iFrameByContent& width=&100%& height=&100%& content=&{iFrameHTMLContent}&/&
&/mx:Panel&
&/mx:Application&
frame.html 页面内容
&!DOCTYPE HTML PUBLIC &-//W3C//DTD HTML 4.01 Transitional//EN&&
&title&frame.html&/title&
&meta http-equiv=&pragma& content=&no-cache&&
&meta http-equiv=&cache-control& content=&no-cache&&
&meta http-equiv=&expires& content=&0&&
&script type=&text/javascript&&
function sayHello() {
alert(&hello......&);
// 1个参数
function say(message) {
alert(&your say: & + message);
// 多个参数 并返回值
function sayHi(message, name) {
alert(&your say: & + message + &, name: & + name);
return &your say: & + message + &, name: & +
flex frame example html page!
&input type=&button& value=&say& onclick=&sayHello()&/&
要注意的是:你的flex项目工程需要发表到http的应用服务器(如tomcat、jboss、iis)这些服务器中,用http请求方式才能调用到页面内容和JavaScript方法。如果不发布到应用服务器中,那样只能在iframe中嵌套远程的http请求的页面,本地静态页面是无法显示的。
阅读(...) 评论()flash软件元件不能嵌套是怎么回事_百度知道全Flash动画网站实现的基础教学_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
全Flash动画网站实现的基础教学
上传于||文档简介
&&全​F​l​a​s​h​动​画​网​站​实​现​的​基​础​教​学
阅读已结束,如果下载本文需要使用1下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩19页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢Flash菜单的制作_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
Flash菜单的制作
上传于||暂无简介
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩1页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢君,已阅读到文档的结尾了呢~~
《神奇的影片剪辑——动画嵌套》,影片剪辑软件,影片剪辑,影片剪辑元件,flash影片剪辑,影片剪辑软件下载,童玲影片剪辑,动画剪辑,flash中影片剪辑,flash 停止剪辑影片
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
《神奇的影片剪辑——动画嵌套》
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口}

我要回帖

更多关于 flash doc 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信