- 浏览: 44789 次
- 性别:
- 来自: 天津
最新评论
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 6351:replace 函数 ... -
c#正则表达示收藏
2012-07-06 09:45 642-、"^"头匹配 ^front表示 ... -
qt-x11 qvfb过程
2012-07-06 09:30 1159最近开始学习QT,现在的QT更新的比较快,FC9下已经安装 ... -
ajax访问后台,获得数据显示DIV,JS获得单元格位置
2012-07-05 20:45 1052index.jsp 正在加载...' //读 ... -
C# COM组件注册
2012-07-03 13:43 1646为了C# COM组件的注册,浪费了我一天半的时间。现把经验 ... -
JAVA+fms
2012-07-02 10:56 1392最近完成的 Java Flex Fms 视频聊天程序,虽然 ... -
Cairngorm文档--模块化示例程序解读
2012-07-02 10:56 529模块化示例程序解 ... -
使用MXDataGridItemRenderer组件为DataGrid自定义显示模式
2012-07-02 10:56 958MXDataGridItemRenderer 类定义 Sp ... -
java面笔试总结
2012-07-01 00:35 6082010、10、12 湖南华诺集团面试题集 1、D ... -
手机、桌面和浏览器应用程序开发的差异
2012-07-01 00:35 987使用 Flex 可以针对以下部署环境开发应用程序: 浏览器 ... -
使用Flare3D在FB中搭建第一个Molehill项目
2012-07-01 00:35 553本文介绍如何使用第三方开发框架Flare 3D 2.0在F ... -
软件架构设计
2012-07-01 00:35 587软件架构是具有一 ...
相关推荐
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.
Passing Binary Data in COM在COM中传递二进制数据
represent the business data associated with your application. This document provides guidance to help you choose the most appropriate way of exposing, persisting, and passing that data through the ...
Brendan J. Frey* and Delbert DueckClustering data by identifying a subset of rep
Microsoft Designing Data Tier Components and Passing Data Through Tiers. From Patterns & Practices.
这个项目是用引导的。 您将在下面找到有关如何执行常见任务的一些信息。 您可以在找到本指南的最新版本。目录自动格式化代码更改页面<title>... 使用 AJAX 请求获取数据与 API 后端集成节点Ruby on Rails 在开发...
Until recently, many people thought big data was a passing fad. "Data science" was an enigmatic term. Today, big data is taken seriously, and data science is considered downright sexy. With this ...
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...
selling Beginning iPhone Development with Swift, you’ll learn tips for organizing and debugging Swift code, using multi-threaded programming with Grand Central Dispatch, passing data between view ...
html5的data-role的属性,The jQuery Mobile ... To avoid naming conflicts with other plugins or frameworks that also use data- attributes, set a custom namespace by modifying the ns global option。
Clojure is a highly pragmatic language with efficient and easy data manipulation capabilities. This provides us with an opportunity to easily explore many challenging and varied algorithmic topics, ...
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