Flash and ASP Integration

chrome-mac-arm64-160.0.8184.0(Canary).zip Chrome for Testing 官方测试构建包,内含 Chrome 浏览器、ChromeDriver 与 Chrome Headless Shell,适用于对应平台的自动化测试、Selenium/Playwright 驱动与 CI 环境搭建。解压即用,请按文件名中的平台选择对应版本。 立即下载

Flash and ASP Integration

by Dan Waters

ASP and Flash? How?

Macromedia's Flash and Microsoft's Active Server Pages technologies are two products with an extremely heavy impact on the world of web site development. Flash allows you to create zippy, vector-based animation and interactivity in a small ActiveX control, and ASP allows you to create dynamic HTML content on the fly. Hopefully, by the time you're done skimming this article, you'll be confident enough to use ASP in the creation of zippy, vector-based Flash content on the fly.

To many developers, a site done in Flash is worth many done in HTML. The ease of use and graphical appeal of Flash is unmatched. Where many of us get stuck, however, is at the question "How am I going to get data into Flash from an external source?" The answer to this question is also the key to a frighteningly successful web site.

The Concept

The first thing you need to know about Flash is the method in which it handles variables from remote files. Flash will take an URL-encoded query string and transform it into a list of variables within its own memory. An example of a string that Flash recognizes as variable definitions looks like this:

size=Medium&color=Navy+Blue&style=Mandarin+Collar

When you import this string into Flash, you will have three new variables: size, color, and style. These variables will already be initialized; loaded with the data you passed in the string.

sizeMedium
colorNavy Blue
styleMandarin Collar

Be aware that Flash is incredibly easy to please as long as you employ the Server.URLEncode method. Flash does all the decoding itself. In the same respect, when Flash sends variables to a script, they will already be URL-encoded.

Techniques

Returning a valid string from ASP

The code below will return a valid string to the Flash movie.

<%@Language="VBScript"%>
<%
    Option Explicit
    Dim var(3), i, count

    i = 0
    count = 3

    var(0) = "Winken"
    var(1) = "Blinken"
    var(2) = "Nod"

    Do While i < count
        Response.Write "var" & i & "=" & var(i) & "&"
        i = i + 1
    Loop

    Response.Write "i=" & i
%>

When you execute this program, ASP returns this string:

var0=Winken&var1=Blinken&var2=Nod&i=3
Passing values from ASP to Flash

Remember that query string I mentioned above? You'll be using this format with ASP next. To pass variables from ASP to Flash, you must write a string back to the response in the above format.

To load variables from an ASP file, you should use the following action script:

Load Variables ("myscript.asp", 0)

( The Load Variables command can be found by choosing Load/Unload Movie from the dropdown list and selecting the Load Variables Into Location radio button. )

Generally, you should not use Get URL unless you are a) rewriting the object code to embed a new movie or b) generate HTML in a new page.

The zero in the above script represents the level at which you will load the movie. If you have movies stacked upon one another, you should reference them by their z-order. _level0 is the first movie, _level1 is the movie stacked above the first, and so on. For our current purpose, we'll assume there is only one movie in the picture and use 0 for the level specification.

Passing values from Flash to ASP

Surely you will want to send out form data from Flash to ASP. To send variables from Flash to an ASP program, use the following ActionScript code:

Load Variables ("myscript.asp", 0, vars=POST)

When you send variables using POST, you can access them in your ASP script using one of two methods:

  1. Request.Form("flash_var_1")
  2. Request("flash_var_1")

That's right... when you POST variables, Flash sends them in the form collection.

When you send Flash variables using GET, however, they are written into the query string, and subsequently you should use Request.QueryString("flash_var_1").

When you specify "Don't send" as a destination for the variables, Flash assumes you're loading data from the ASP file. You can use a query string parameter for the URL value of the Load Variables call and still retain the "don't send" variable transmission specification to avoid overwriting variable values.

Exercise: Transferring Values
From Flash to ASP to a Database to ASP to Flash

Download support materials for Exercise 1 from here.

View the code here.

The files are named as such:

employee.mdbAccess database
employee.aspASP script
employee.flaFlash file
employee.swfFlash movie
employee.htmlMovie mounting page

We will be employing ADO database routines in this example to make all this useful to you in the future. I have created a table called Employees in a file called employee.mdb which resides in the same directory as the script. The table looks like the one below:

IDNameLastNameFirstPosition
1SMITHJOHNCEO
2BROWNSUSANMARKETING DIRECTOR
3STANFORDROBERTSALES REPRESENTATIVE

That's it; three simple records. Notice how all the data is in capital letters: In a real-world application, this would really only be relevant to the fields upon which you would search. Putting the data in capital (or lowercase) letters guards against case mismatch in searches, because we can UCase the data from Flash before sending it to ADO.

Save your table as Employees and save your database as employee.mdb in a directory by itself.

Next, we'll make the input screen in Flash.

Open up Flash or use the support materials available.

The Data Entry Frame

In the first frame, create a screen with a text label that reads "Please enter employee's last name." Next to it, create a text field (push the |ab button down to make it an editable field) and right-click on it. Go to Properties, and where it says Variable, enter NameLast. You should go to the first frame's Properties and add an action script that simply says "Stop." This prevents the movie from advancing until you have entered a value and clicked Submit.

The Submit Button
Create a button that says Submit. Then drop it onto the stage and go to its Instance Properties by double clicking it. In the Actions tab, enter this action script:
Go To and Play (2)

This sends the user to the second frame.

Loading The Variables Behind The Scenes

Create, in the second frame, a blank keyframe with one frame action:

Load Variables ("employee.asp", 0, vars=GET)
The "Loading Data" Loop

In the third frame, you will want to create a short animation that tells the user that ASP is loading data. In this case, I used frames 3-8 for this animation. At frame 3, I entered the following frame action:

If (Position ne "")
   Go To and Stop (9)
End If

This checks to make sure that ADO has pulled our last variable, Position, from the database and returned it to the response. Otherwise it continues to play the Loading sequence until frame 5, at which we have this action:

Go To and Play (3)

This causes the animation to play over and over again and continue to check the value of Position. When ASP is finished, the animation will automatically go to frame 6.

The Result Frame

At frame 6, we should have a small text label that reads "ASP has returned the following results." Below this text label, we should have three more text labels in a row which read "Last Name", "First Name", and "Position". These are captions for our editable text fields below. Insert editable text fields (click the |ab button on the toolbar when you drop it, just like in the first frame). Set one's Variable equal to "NameLast", set another one's equal to "NameFirst", and the last one's equal to "Position" (all without the quotation marks).

Publishing

Save your document file as employee.fla in the same directory as your database.

Then, go to File menu -> Publish, and you will find employee.swf and employee.html residing in the same directory you saved employee.fla.

Okay, that's it, you're done with the Flash side of it. Now it's time to move on to ASP.

Open up your favorite ASP Editor (Mine is Textpad!), such as InterDev or even Notepad. You will be using an ADODB recordset and connection with a SQL connection string. You will not return anything to the response except the URL-encoded variable definition string. Are you ready? Well, get that way, because here's the code.

<%@Language="VBScript"%>
<%
    Option Explicit     ' Don't ever let me catch you without this line!

    Dim oRS, oConn      ' Recordset and connection objects

    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
        "DBQ=" & Server.MapPath("employees.mdb")
    oConn.Open

    Set oRS = Server.CreateObject("ADODB.Recordset")
    oRS.Open "SELECT * FROM Employees", oConn, 2, 3

    ' The next line looks for the specified name and UCases the
    ' last name we searched for to avoid case-sensitive issues.
    oRS.Find "NameLast = '" & UCase(Request.QueryString("NameLast")) & "'"

    ' If the last name does not exist, then return Not Found to the response.
    ' Otherwise return appropriate variables.
    If oRS.EOF Then
        Response.Write "NameLast=Not+Found&NameFirst=Not+Found" & _
            "&Position=Not+Found"
    Else
        Response.Write "NameFirst=" & Server.URLEncode(oRS("NameFirst")) & _
            "&NameLast=" & Server.URLEncode(oRS("NameLast")) & _
            "&Position=" & Server.URLEncode(oRS("Position"))
    End If

    ' Clean up and say goodbye.
    oRS.Close
    Set oRS = Nothing
    oConn.Close
    Set oConn = Nothing
%>

Save this code as employee.asp

Now, access employee.html through the local intranet. You should, if you haven't already, stick all these files somewhere in your web root and access it via http://localhost/employee/employee.html (or wherever you have stored the files). Since ASP is processed server-side, you cannot access employee.html via the hard drive and expect values from the ASP application. This means you will have an endless "Loading" loop

Once you have pulled up the page on the Intranet, enter a name which you know is in the database, such as Smith. ASP will return the values to Flash, and you will see the results when ADO is done processing.

Good Luck with this! If you have troubles, please contact me at dan@catapultic.com.

商BC1360年世界历史地图矢量文件SHP格式.zip 本资源为《商BC1360年世界历史地图矢量文件SHP格式》压缩包,文件大小约 17.83 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。 立即下载

相关推荐

检测装置管理培训.pdf

技术分享

jquery插件推荐

i2.feixin.10086.cn/pages/46293/1326973352 i2.feixin.10086.cn/pages/46293/1326973338 i2.feixin.10086.cn/pages/46293/1326973328 i2.feixin.10086.cn/pages/46293/1326973316 i2.feixin.10086.cn/pages/462

360

执行力训练.pdf

技术分享

技术谣言识别指南:从Silverlight误读看开发者信息判断力

在技术传播中,‘框架被抛弃’‘某技术已死’等断言常源于信息压缩与语境剥离。理解一项技术的真实定位,需回归其核心原理——如Silverlight并非浏览器插件的简单复刻,而是WP7系统级运行时;其价值也不在跨平台代码复用,而在开发者心智模型与工程能力的可迁移性。这种基于产品边界、演进节奏与商业逻辑的三维分析,构成了抵御技术噪音的技术判断力基础。尤其在HTML5崛起与PDC战略转向的交叉节点,Silverlight的‘隐身式演进’揭示了技术生命周期中常见的策略适配现象:分发模式升级不等于技术退场,平台重心转移不

as2886089的博客 487

高速加工高级应用之编程策略培训纲要.doc

技术分享

模切工艺教材.pptx

技术分享

OpenClaw进阶指南:五大模块打造专属AI助手,从能用变精通

在人工智能与软件开发领域,构建一个真正“精通”业务、能深度融入工作流的智能助手,是许多开发者和技术团队追求的目标。其核心原理在于通过模块化与可扩展的架构设计,赋予AI助手持续学习、主动执行和深度集成的能力。这不仅能极大提升开发效率,更能将AI从被动的问答工具转变为主动的智能协作者。具体的技术价值体现在为AI构建**身份系统**与长期记忆,使其能理解上下文和用户偏好;通过开发**Skills技能库**,让AI从生成文本扩展到执行具体操作任务;利用**MCP协议**安全连接外部工具与数据源;集成多模态能力处理图

weixin_34151004的博客 447

工业智能电动多回转执行器:工业阀门自动化升级与智能控制驱动市场增长.docx

工业智能电动多回转执行器:工业阀门自动化升级与智能控制驱动市场增长

设置ODBC的自定义类CSetODBC

何志丹一,功能描述用于配置数据源用户名及密码.1,可以得到连接串,此串可用于CMyRecordset(派生于CRecordset)的GetDefaultConnect(),也可以用干CDataBase类OpenEx.2,如果用户配置正确,只需要配置一次,相关信息记录在文件.3,可以指定存储信息的文件名.因为有可能几个程序共用一个数据源.4,用户可以重新配置数据5,可以得到当前数据的类型.6

闻缺陷则喜何志丹 3203

电动钉枪:无绳化与智能化升级加速,全球市场迎来稳步增长新机遇.docx

电动钉枪:无绳化与智能化升级加速,全球市场迎来稳步增长新机遇

【财务智能系统】基于四层架构的财务智算平台:总账应收应付费用资产成本资金税务预算合并与共享中心全流程操作指南

内容概要:本手册为YimCore财务智算系统的用户培训指南,全面覆盖总账、应收应付、费用、资产、成本、资金、税务、预算合并及共享中心等财务核心模块的全流程操作。通过四层架构、五条主链(事项→凭证→过账→结账→报表)、八组菜单48个入口的设计,系统实现了从业务事项到财务报表的端到端自动化处理。手册详细阐述了12条铁律、四张状态机、20角色与SoD控制、88个典型场景,并提供核心操作流程图与逐步指引,强调“一数一源、动作驱动、追溯闭环”的设计理念,确保财务数据的合规性、一致性与可审计性。; 适合人群:财务系统终端用户、财务主管、内审人员及实施顾问,适用于企业财务数字化转型过程中系统上线与日常操作指导。; 使用场景及目标:①指导用户完成从凭证录入、往来核销、成本分摊、税务申报到合并报表的全流程操作;②帮助理解系统控制逻辑如期间锁定、状态迁移、SoD职责分离与异常拦截机制;③支持上线前配置检查、问题排查与合规审计追溯。; 阅读建议:建议按“模块总览→产品架构→核心场景实操→功能路径→参数配置→上线自检”的顺序阅读,结合系统界面实际操作,重点关注状态机流转、错误码拦截与三段追溯链条,确保每一步操作符合财务合规要求。

大型国企在构建供应链创新图谱时,如何定义和量化科创企业的技术适配性指标?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

Logo.zip自定义光标!

Logo.zip自定义光标!

江苏省创新联合体现状数据及主要分布领域有哪些?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

科研院所管理内部创新战略联盟资源,有哪些好用的项目管理或协作软件推荐?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

3_2. 课程设计说明书模板(11111.doc

3_2. 课程设计说明书模板(11111.doc

江苏地级市想培育创新联合体,第一步应该做什么?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

引进新技术进行产业化落地前,如何建立一套科学的潜在合作方画像评估模型?.docx

科易网基于行业知识库+行业大数据+科技资源要素+AI模型,以AI,赋能技术转移、成果转化、技术经理人培训、知识产权管理、区域产业分析与布局、地方科技招商、创新创业大赛等场景,推出科技创新领域的AI工具、场景化服务和数智化解决方案,推动科技创新与产业创新智能化发展。

上一篇: VC中调用CHM帮助文件
下一篇: VC常用数据类型使用转换详解
AFXAPI
博客等级 码龄22年 0粉丝 16原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址