- 浏览: 47387 次
- 性别:
- 来自: 天津
最新评论
If you are using the generated wrapper from Flash Builder, then you add flashVars variables by creating an object called flashvars, setting properties on that object, and then passing that object to the swfobject.embedSWF() method of SWFObject 2. The following example sets the firstname and lastname properties of the flashvars object, and then passes that object to the embedSWF() method: var swfVersionStr = "10.0.0"; var xiSwfUrlStr = "playerProductInstall.swf"; var flashvars = {}; flashvars.firstname = "Nick"; flashvars.lastname = "Danger"; var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "sameDomain"; var attributes = {}; attributes.id = "TestProject"; attributes.name = "TestProject"; attributes.align = "middle"; swfobject.embedSWF( "FlashVarTest.swf", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); swfobject.createCSS("#flashContent", "display:block;text-align:left;");
If your wrapper uses the and tags, you can pass variables to your applications by using the flashVars properties in the and tags in your wrapper. You do this by adding ampersand-separated sets of name-value pairs to these properties. The following example sets the values of the firstname and lastname in the flashVars properties inside the and tags in a simple wrapper: code/wrapper/SimplestFlashVarTestWrapper.html body { margin: 0px; overflow:hidden } width='100%' height='100%' cellspacing='0' cellpadding='0'> Simplest FlashVarTest Wrapper width='100%'> width='100%' flashVars='firstname=Nick&lastname=Danger'/>
The value of the flashVars properties do not have to be static. If you use JSP to return the wrapper, for example, you can use any JSP expression for the value of the flashVars properties that can be evaluated to a String. The following example uses the values stored in the HttpServletRequest object (in this case, you can use form or query string parameters): DynamicFlashVarTestWrapper.jsp var swfVersionStr = "0"; var xiSwfUrlStr = ""; var flashvars = {}; flashvars.firstname = ""; flashvars.lastname = ""; var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "sameDomain"; var attributes = {}; attributes.id = "FlashVarTest"; attributes.name = "FlashVarTest"; attributes.align = "middle"; swfobject.embedSWF( "FlashVarTest.swf", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
You can also PHP expressions to pass query string parameters in a wrapper, as the following example shows: var swfVersionStr = ""; var xiSwfUrlStr = ""; var flashvars = {}; flashvars.fName = "" flashvars.lName = "" var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "sameDomain"; var attributes = {}; attributes.id = "FlashVarTest"; attributes.name = "FlashVarTest"; attributes.align = "middle"; swfobject.embedSWF( "FlashVarTest.swf", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); swfobject.createCSS("#flashContent", "display:block;text-align:left;");
For more information about the HTML wrapper, see Creating a wrapper. If your user requests the SWF file directly in the browser, without a wrapper, you can access variables on the query string without providing additional code in the wrapper (because there is no wrapper). The following URL passes the name Nick and the hometown San Francisco to the application: About flashVars properties encoding
The values of the flashVars properties must be URL encoded. The format of the string is a set of name-value pairs separated by an ampersand (&). You can escape special and nonprintable characters with a percent symbol (%) followed by a two-digit hexadecimal value. You can represent a single blank space by using the plus sign (+). The encoding for flashVars properties is the same as the page. Internet Explorer provides UTF-16-compliant strings on the Windows platform. Netscape sends a UTF-8-encoded string to Flash Player. Most browsers support a flashVars string or query string up to 64 KB (65535 bytes) in length. They can include any number of name-value pairs. You can append the values of properties to the application's SWF file path in the wrapper. The swfUrlStr property identifies the location of the application's SWF file. It is the first argument in theswfobject.embedSWF() method call. The following example appends query string parameters to the swfUrlStr properties in the custom wrapper: wrapper/SwfObjectWithFlashVars.html var swfVersionStr = "0"; var xiSwfUrlStr = ""; var flashvars = {}; var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "sameDomain"; var attributes = {}; attributes.id = "FlashVarTest"; attributes.name = "FlashVarTest"; attributes.align = "middle"; swfobject.embedSWF( "FlashVarTest.swf?firstname=Nick&lastname=Danger", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
Variables you define in this manner are accessible in the same way as flashVars properties. For more information, see Accessing the flashVars properties. To access the values of the flashVars properties, you use the FlexGlobals object's topLevelApplication.parameters property. This property points to a dynamic object that stores the parameters as name-value pairs. You can access variables on the parameters object by specifying parameters.variable_name. In your application, you typically assign the values of the run-time properties to local variables. You assign the values of these properties after the Application's creationComplete event is dispatched. Otherwise, the run-time properties might not be available when you try to assign their values to local variables. The following example defines the myName and myHometown variables and binds them to the text of Label controls in the initVars() method: flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="initVars()">
When a user requests this application with the myName and myHometown parameters defined as flashVars properties or as query string parameters, Flex displays their values in the Label controls. To view all the flashVars properties, you can iterate over the FlexGlobals.topLevelApplication.parameters properties, as the following example shows: flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="init()"> width="300" height="200"/> Adobe Link : http://help.adobe.com/en_US/flex/using/WS2db454920 e96a9e51e63e3d11c0bf626ae-7feb.html
发表评论
-
关于SQL字符串处理的一些函数
2012-07-06 09:52 6551:replace 函数 ... -
c#正则表达示收藏
2012-07-06 09:45 663-、"^"头匹配 ^front表示 ... -
qt-x11 qvfb过程
2012-07-06 09:30 1180最近开始学习QT,现在的QT更新的比较快,FC9下已经安装 ... -
ajax访问后台,获得数据显示DIV,JS获得单元格位置
2012-07-05 20:45 1073index.jsp 正在加载...' //读 ... -
C# COM组件注册
2012-07-03 13:43 1677为了C# COM组件的注册,浪费了我一天半的时间。现把经验 ... -
JAVA+fms
2012-07-02 10:56 2740最近完成的 Java Flex Fms 视频聊天程序,虽然 ... -
Cairngorm文档--模块化示例程序解读
2012-07-02 10:56 546模块化示例程序解 ... -
使用MXDataGridItemRenderer组件为DataGrid自定义显示模式
2012-07-02 10:56 983MXDataGridItemRenderer 类定义 Sp ... -
java面笔试总结
2012-07-01 00:35 6272010、10、12 湖南华诺集团面试题集 1、D ... -
手机、桌面和浏览器应用程序开发的差异
2012-07-01 00:35 1010使用 Flex 可以针对以下部署环境开发应用程序: 浏览器 ... -
使用Flare3D在FB中搭建第一个Molehill项目
2012-07-01 00:35 573本文介绍如何使用第三方开发框架Flare 3D 2.0在F ... -
软件架构设计
2012-07-01 00:35 603软件架构是具有一 ...
相关推荐
AP算法提出原文。Clustering data by identifying a subset of ... Affinity propagation found clusters with much lower error than other methods, and it did so in less than one-hundredth the amount of time.
Exam Ref 70-761 Querying Data with Transact-SQL by Itzik Ben-Gan English | 4 Apr. 2017 | ASIN: B06Y21QGGQ | 352 Pages | AZW3 | 23.79 MB Prepare for Microsoft Exam 70-761–and help demonstrate your ...
Passing parameters with data reports. I have set two parameters and passed them during run time.Open with VB6.
在COM(Component Object Model)中,传递二进制数据是一个常见的需求,特别是在处理图像、音频、文件等非结构化数据时。... 首先,让我们来看看`BufferVariant.h`这个文件名,它暗示了一个使用了`VARIANT`类型的缓冲...
### 设计数据层组件与跨层传递数据 在设计分布式应用程序时,如何高效地访问、表示及管理业务数据是至关重要的。本篇文章旨在提供一系列指导原则,帮助开发人员选择最合适的暴露、持久化以及跨应用层传递数据的方法...
这个项目是用引导的。 您将在下面找到有关如何执行常见任务的一些信息。 您可以在找到本指南的最新版本。目录自动格式化代码更改页面<title>... 使用 AJAX 请求获取数据与 API 后端集成节点Ruby on Rails 在开发...
【标题】:AP聚类(Affinity Propagation)_通过数据点间传递消息进行聚类 【描述】:AP聚类方法是由Brendan J. Frey和Delbert Dueck提出的一种新的数据聚类技术,它着重于寻找数据集中的代表性实例(exemplars),...
Message Passing Interface (MPI),Message Passing Interface (MPI)
该项目是通过。 您将在下面找到一些有关如何执行常见任务的信息。 您可以在找到本指南的最新版本。目录更新到新版本Create React App分为两个包: create-react-app是用于创建新项目的全局命令行实用程序。...
用于LDPC的译码程序,使用message passing 算法,可以选择迭代次数, 调整信噪比,用LLR计算
3.4.1. Working with request and session scope 3.4.2. Declaring scoped proxies in XML 3.5. Runtime value injection 3.5.1. Injecting external values 3.5.2. Wiring with the Spring Expression Language 3.6...
描述提到的是"Microsoft Designing Data Tier Components and Passing Data Through Tiers",这显然是一个讨论如何在多层架构中设计数据层组件并有效地在各层之间传递数据的教程或指南。 在IT领域,特别是在企业级...
In this paper, we develop an alternative network reduction approach to characterizing transport in DFNs, by combining graph theoretical and ma- ...consistent with those of the original network.
该项目是通过引导的。 您将在下面找到一些有关如何执行常见任务的信息。 您可以在找到本指南的最新版本。 目录 自动格式化代码 更改页面<title> 安装依赖项 导入组件 代码分割 添加样式表 ...met
* Axios and Ajax Request (Passing request for fetch and crud operation) * How to Use Moment js on Laravel (Used for formating date time) * How to Use sweetalert2 (Used for flash message) * How to ...
Interest-aware Message-Passing GCN for Recommendat.md