Flex4 flashVars 传值

[html] view plaincopy

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <!-- saved from url=(0014)about:internet -->
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  4. <!--
  5. Smart developers always View Source.
  6. This application was built using Adobe Flex, an open source framework
  7. for building rich Internet applications that get delivered via the
  8. Flash Player or to desktops via Adobe AIR.
  9. Learn more about Flex at http://flex.org
  10. // -->
  11. <head>
  12. <title>${title}</title>
  13. <meta name="google" value="notranslate" />
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  15. <!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
  16. the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
  17. the percentage of the height of its parent container, which has to be set explicitly.  Fix for
  18. Firefox 3.6 focus border issues.  Initially, don‘t display flashContent div so it won‘t show
  19. if JavaScript disabled.
  20. -->
  21. <style type="text/css" media="screen">
  22. html, body  { height:100%; }
  23. body { margin:0; padding:0; overflow:auto; text-align:center;
  24. background-color: ${bgcolor}; }
  25. object:focus { outline:none; }
  26. #flashContent { display:none; }
  27. </style>
  28. <!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
  29. <!-- BEGIN Browser History required section ${useBrowserHistory}>
  30. <link rel="stylesheet" type="text/css" href="history/history.css" />
  31. <script type="text/javascript" src="history/history.js"></script>
  32. <!${useBrowserHistory} END Browser History required section -->
  33. <script type="text/javascript" src="swfobject.js"></script>
  34. <script type="text/javascript">
  35. // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
  36. var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
  37. // To use express install, set to playerProductInstall.swf, otherwise the empty string.
  38. var xiSwfUrlStr = "${expressInstallSwf}";
  39. var flashvars = {employeeName:"中文",language:"en_US"};
  40. var params = {};
  41. params.quality = "high";
  42. params.bgcolor = "${bgcolor}";
  43. params.allowscriptaccess = "sameDomain";
  44. params.allowfullscreen = "true";
  45. var attributes = {};
  46. attributes.id = "${application}";
  47. attributes.name = "${application}";
  48. attributes.align = "middle";
  49. swfobject.embedSWF(
  50. "${swf}.swf?version=1.0", "flashContent",
  51. "${width}", "${height}",
  52. swfVersionStr, xiSwfUrlStr,
  53. flashvars, params, attributes);
  54. // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
  55. swfobject.createCSS("#flashContent", "display:block;text-align:left;");
  56. </script>
  57. </head>
  58. <body>
  59. <!-- SWFObject‘s dynamic embed method replaces this alternative HTML content with Flash content when enough
  60. JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn‘t show
  61. when JavaScript is disabled.
  62. -->
  63. <div id="flashContent">
  64. <p>
  65. To view this page ensure that Adobe Flash Player version
  66. ${version_major}.${version_minor}.${version_revision} or greater is installed.
  67. </p>
  68. <script type="text/javascript">
  69. var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
  70. document.write("<a href=‘http://www.adobe.com/go/getflashplayer‘><img src=‘"
  71. + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif‘ alt=‘Get Adobe Flash player‘ /></a>" );
  72. </script>
  73. </div>
  74. <noscript>
  75. <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="${width}" height="${height}" id="${application}">
  76. <param name="movie" value="${swf}.swf?version=1.0" />
  77. <param name="quality" value="high" />
  78. <param name="bgcolor" value="${bgcolor}" />
  79. <param name="allowScriptAccess" value="sameDomain" />
  80. <param name="allowFullScreen" value="true" />
  81. <param name="FlashVars" value="employeeName=中文&language=en_US"/>
  82. <!--[if !IE]>-->
  83. <object type="application/x-shockwave-flash" data="${swf}.swf?version=1.0" width="${width}" height="${height}">
  84. <param name="quality" value="high" />
  85. <param name="bgcolor" value="${bgcolor}" />
  86. <param name="allowScriptAccess" value="sameDomain" />
  87. <param name="allowFullScreen" value="true" />
  88. <param name="FlashVars" value="employeeName=中文&language=en_US"/>
  89. <!--<![endif]-->
  90. <!--[if gte IE 6]>-->
  91. <p>
  92. Either scripts and active content are not permitted to run or Adobe Flash Player version
  93. ${version_major}.${version_minor}.${version_revision} or greater is not installed.
  94. </p>
  95. <!--<![endif]-->
  96. <a href="http://www.adobe.com/go/getflashplayer">
  97. <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
  98. </a>
  99. <!--[if !IE]>-->
  100. </object>
  101. <!--<![endif]-->
  102. </object>
  103. </noscript>
  104. </body>
  105. </html>

flashvars 传值

传递的方式一致:

<param name="FlashVars" value="myName=julabs&amp;myHometown=china" />

<embed src="demo.swf" FlashVars="myName=julabs&amp;myHometown=china" ........ />

demo.swf??u1=good&u2=bad

其中可以在FlashVars中指定,也可以通过 
movie或 src中的swf url指定参数,修改所有包含flashvar的地方

获取flashVars的值

Flex4中获取flashVars值:(Flex4的取值方式与Flex3不同)

xxx = FlexGlobals.topLevelApplication.parameters.employeeName;

xxx = FlexGlobals.topLevelApplication.parameters.language;

Flex3中的取值方式为:

XXX = Application.application.parameters.employeeName;

时间: 2024-08-29 13:03:56

Flex4 flashVars 传值的相关文章

网页制作之flash FlashVars参数传值

最近遇到一个问题,关于flash通过flashVars参数传值! 贴出源代码: <script type="text/javascript">imgUrl1="img/1.jpg";imgtext1=""imgLink1=escape("");imgUrl2="img/2.jpg";imgtext2=""imgLink2=escape("");imgUrl

JS 传值 传址

在JS中,有两种不同的方式可以操作数据的值,这两种技术分别叫做 传值 和 传址. 传值:在赋值过程中,首先对值进行了一份拷贝,而后将这份拷贝存储到一个变量.对象属性或数组元素中.拷贝的值和原始的值是完全独立.互不影响的.当一份数据通过值传递给一个函数,实际上被传递的不是数据本身,而是数据的一份拷贝.因此,如果函数修改了这个值,影响到的只是数据的那份拷贝,而并不影响数据本身. 传址:在赋值过程中,变量实际上存储的是数据的地址(对数据的引用),而不是原始数据或者是数据的拷贝.如果值通过一个地址发生了

Swift代理和传值

第一个视图控制器: import UIKit // 遵循协议 class ViewController: UIViewController,SecondVCDelegate { override func viewDidLoad() { super.viewDidLoad() // 创建一个button let button1 = UIButton(frame: CGRectMake(120, 120, 50, 50)) // 修改背景颜色 button1.backgroundColor = U

iOS pop使用通知传值

iOS pop回父级页面,使用通知传值 输入所要发送的信息 ,同时将label的值通过button方法调用传递, - (IBAction)buttonClick:(id)sender { //添加 字典,将label的值通过key值设置传递 NSDictionary *dict =[[NSDictionary alloc]initWithObjectsAndKeys:self.textFieldOne.text,@"textOne",self.textFieldTwo.text,@&q

iOS之页面传值

页面之间的传值方式 设有firstView和secondView两个视图 属性传值(适用于页面之间的正向传值) 1.在要显示信息的页面,创建属性 2.在要传值的页面,设置属性值 3.在显示信息的页面的ViewdidLoad方法中,接收属性值 代理传值(适用于页面之间的反向传值) 1.创建协议及协议方法,在反向传值的页面(secondVC)中 2.创建协议类型的属性,   在secondVC中创建属性 3.调用属性  即delegate,在secondVC页面中的对象传值的方法中调用[self.d

iOS中多视图的传值 属性传值和代理传值

首先创建两个类 ,FirstViewController和SecondViewController,都继承于UIViewController 1 #import "AppDelegate.h" 2 #import "FirstViewController.h" 3 4 @interface AppDelegate () 5 6 @end 7 8 @implementation AppDelegate 9 10 11 - (BOOL)application:(UIAp

JQuery ajax 在aspx中传值和取值

传值:ajax中的data(json)  js代码: <script type="text/javascript"> $(function () { $("#btnAddNews").bind("click", function () { var _name= $.trim($("#txtNewTitle").val()); $.ajax({ type: "POST", url: "A

webform之session传值(临时数据的存储)与扩展属性 --(购物车练习)

页面传值:1.QueryString传值在源页面写:Response.Redirect("Main.aspx?uid="+uid+"&pwd="+pwd);在目标页面:Request["uid"].ToString();2.Session *****特点:可以存任何东西,每个用户都会生成一个特定的Session,Session是存储在服务中的,一般默认存储20分钟,20分钟之后过期用法:在登录页面:Session["uid&qu

ios-私人通讯录 页面间的跳转和传值

这个demo 有多个页面 并涉及顺传和逆传 而且还有一个第三方库的导入 来实现自定义提示消息的特效 利用代理来实现页面间的传值 一个页面代表一个controller 这次  ViewController  反而一句代码都没写 // // HMContact.h // 私人通讯录 // // Created by YaguangZhu on 15/9/6. // Copyright (c) 2015年 YaguangZhu. All rights reserved. // #import <Fou