加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex接收flashvars参数

发布时间:2020-12-15 04:29:15 所属栏目:百科 来源:网络整理
导读:Flex代码 [java] ? view plain copy ?xml?version= "1.0" ?encoding= "utf-8" ??? !--?http: //blog.flexexamples.com/2007/08/07/grabbing-flashvars-from-the-embedding-html-template/?-- ?? mx:Application?xmlns:mx= "http://www.adobe.com/2006/mxml"

Flex代码

[java]? view plain copy
  1. <?xml?version="1.0"?encoding="utf-8"?>??
  2. <!--?http://blog.flexexamples.com/2007/08/07/grabbing-flashvars-from-the-embedding-html-template/?-->??
  3. <mx:Application?xmlns:mx="http://www.adobe.com/2006/mxml"??
  4. ????????????????layout="vertical"??
  5. ????????????????verticalAlign="middle"??
  6. ????????????????backgroundColor="white"??
  7. ????????????????creationComplete="init()"?viewSourceURL="srcview/index.html">??
  8. ??????
  9. ????<mx:Script>??
  10. ????????<!--[CDATA[??
  11. ????????????private?function?init():void?{??
  12. ????????????????//?The?FlashVars??
  13. ????????????????var?obj:Object?=?Application.application.parameters;??
  14. ????????????????var?item:String;??
  15. ??????????????????
  16. ????????????????arrColl?=?new?ArrayCollection();??
  17. /*?Populate?the?ArrayCollection?object?with?the?FlashVars.?*/??
  18. ????????????????for?(item?in?obj)?{??
  19. ????????????????????arrColl.addItem({key:item,?value:obj[item]});??
  20. ????????????????}??
  21. ??????????????????
  22. ????????????????dataGrid.dataProvider?=?arrColl;??
  23. ????????????}??
  24. ????????]]-->??
  25. ????</mx:Script>??
  26. ??????
  27. ????<mx:ArrayCollection?id="arrColl"?/>??
  28. ????<mx:DataGrid?id="dataGrid"?/>??
  29. </mx:Application>??

?

Html代码

[xhtml]? copy
    <html?xmlns="http://www.w3.org/1999/xhtml"?xml:lang="en"?lang="en">???
  1. head>???
  2. meta?http-equiv="Content-Type"?content="text/html;?charset=iso-8859-1"?/>???
  3. title>loaderInfoExample</body?bgcolor="#ffffff" ??
  4. ????div/>?flashvars?>??
  5. ????object?classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"???
  6. ????codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0"???
  7. ????width="400"???
  8. ????height="250"???
  9. ????id="loaderInfoExample"???
  10. ????align="middle"param?name="allowScriptAccess"?value="sameDomain"?param?name="allowFullScreen"?value="false"?/>???
  11. PARAM?NAME="flashvars"?VALUE="userName=permadi"param?name="movie"?value="loaderInfoExample.swf"?/>??
  12. param?name="quality"?value="high"?/>??
  13. param?name="bgcolor"?value="#ffffff"?/>????
  14. embed?src="FlashVar_Test.swf"?mce_src="FlashVar_Test.swf"???
  15. ????????flashvars="userName=permadi"???
  16. ????????quality="high"???
  17. ????????bgcolor="#ffffff"???
  18. ????????width="400"???
  19. ????????height="250"???
  20. ????????name="loaderInfoExample"???
  21. ????????align="middle"???
  22. ????????allowScriptAccess="sameDomain"???
  23. ????????allowFullScreen="false"???
  24. ????????type="application/x-shockwave-flash"???
  25. ????????pluginspage="http://www.macromedia.com/go/getflashplayer"?objectbodyhtml>???

?

?

使用javascript,如swfobject.js嵌入时

copy
    script?type="text/javascript"?src="swfobject.js">script>??
  1. ????????script?type="text/javascript" ????????????<!--?For?version?detection,?set?to?min.?required?Flash?Player?version,?or?0?(or?0.0.0),?for?no?version?detection.?-->???
  2. ????????????var?swfVersionStr?=?"10.0.0";??
  3. <!--?To?use?express?install,?set?to?playerProductInstall.swf,?otherwise?the?empty?string.?-->??
  4. ????????????var?xiSwfUrlStr?=?"playerProductInstall.swf";??
  5. ????????????var?FlashVars?=?{bridgeName:"flash"};??
  6. ????????????var?params?=?{};??
  7. ????????????params.quality?=?"high";??
  8. ????????????params.bgcolor?=?"#869ca7";??
  9. ????????????params.allowscriptaccess?=?"sameDomain";??
  10. ????????????params.allowfullscreen?=?"true";??
  11. ????????????var?attributes?=?{};??
  12. ????????????attributes.id?=?"IFrameCommTest";??
  13. ????????????attributes.name?=?"IFrameCommTest";??
  14. ????????????attributes.align?=?"middle";??
  15. ????????????swfobject.embedSWF(??
  16. ????????????????"IFrameCommTest.swf",?"flashContent",???
  17. ????????????????"100%",?"100%",???
  18. ????????????????swfVersionStr,?xiSwfUrlStr,108); list-style:decimal-leading-zero outside; color:inherit; line-height:18px"> ????????????????FlashVars,?params,?attributes);??
  19. ????????????<!--?JavaScript?enabled?so?display?the?flashContent?div?in?case?it?is?not?replaced?with?a?swf?object.?-->??
  20. ????????????swfobject.createCSS("#flashContent",?"display:block;text-align:left;");??
  21. >??

?

?

参考

http://blog.flexexamples.com/2007/08/07/grabbing-flashvars-from-the-embedding-html-template/

?

http://blog.flexexamples.com/2009/03/04/grabbing-flashvars-from-the-embedding-html-template-in-flex-gumbo-swfobject-edition/



转载:http://www.voidcn.com/article/p-zxszrhkd-dz.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读