用ASP控制Flash

2016-01-29 18:17 7 1 收藏

用ASP控制Flash,用ASP控制Flash

【 tulaoshi.com - ASP 】

  Controlling Flash with ASP

A recent project has required a few things that I haven't done for a while. One is dealing with Flash -
which I haven't done since shortly after the release of Flash 3.0. The other is to actually figure some
way of getting dynamic content in without using Generator. One solution we've come up with involves
jumping out of a flash movie into an ASP page, then back again. Of course our designers were a little
miffed, since they've built the flash movie with all sorts of different transitions from place to place,
and this solution would mean starting from the opening scene of the movie evry time. It also stank from a
usability standpoint.

Not so, said I

To accomplish the effect of jumping back in at a specific frame, we simply load some variables into the
flash movie and use them to jump to the right frame. Cool huh?

Initially we had a little trouble, since designers don't need to know anything about ASP, so conveying
information back and forth was a little tricky, but we got there. How it works is like this

In the flash Movie, the first frame has a piece of actionscript which simply reads

GoToAndPlay(scene);
Stop();
The syntax is slightly different in Flash 4.0 - this is Flash 5.0, but you get my drift

Now, when jumping back from the ASP page to the Flash page, we tag a querystring parameter onto the links

flash.asp?scene=awards
flash.asp?scene=services
flash.asp?scene=contact
And so on. The script flash.asp looks something like this...

<%@Language="JScript"%<%
Response.Buffer = true; Response.Expires = -1441;
var s = new String(Request.Querystring("scene"));
strScene = (s!='undefined'&&s!='')?s:'default';
%<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"
<html
<head
<titleFlash Control</title
</head
<body
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0"
width="750" height="395"
<param name="movie" value="movie.swf?scene=<%= strScene %"
<param name="quality" value="high"
<embed src="http://img.jcwcn.com/attachment/portal/jcwcj/2005-12/10/05121000553481150.swf"?scene=<%= strScene %" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="750" height="395"
</embed
</object
</body
</html
So, if we have nothing in the querystring, it loads the scene 'default' - else it loads whatever ASP tells
it to. cool huh?

This trick will work from Flash 4.0 upwards - flash 5.0 is particularly nifty, and i could get to like
it...
 

来源:http://www.tulaoshi.com/n/20160129/1505142.html

延伸阅读
标签: 电脑入门
在PowerPoint课件中,插入Flash动画已经不是什么新鲜事了。这不,这次的英语课件中,应英语老师的要求,插入了网上找来的一个 Flash英文歌,果然为课件增色不少。但英语老师提出要在课件中控制这个英文歌,比如说播放、暂停、快进、快退等。呵呵,这倒也难不倒我,用 Office中的VBA就可以做到。 插入Flash影片 单击视图/工具栏/控件工具箱,...
标签: ASP
  julyclyde(原作) 作者系2月份 微软社区之星Microsoft China Community Star     在编程中,经常需要使用事务。所谓事务,就是一系列必须都成功的操作,只要有一步操作失败,所有其他的步骤也必须撤销。比如用ASP开发一个网络硬盘系统,其用户注册部分要做的事有: 将用户信息记入数据库 为用户开个文件夹用于存...
标签: 电脑应用
Flash一帧可以完成.asp也可以一个文件完成,这里我将用户登录和用户注册分为两步做,方便大家理解,Flash分两帧,asp分两个文件。 准备: Flash8 , IIS ,Miscrosoft Access 2003; 开始: 数据库中: 用设计视图新建一个名为 UserTable 的表,三个字段分别为 id 为自动编号,u...
标签: ASP
         用ASP生成Chart   2000-05-17· nightcat ·转载网易      <SCRIPT LANGUAGE="VBScript" RUNAT="SERVER">   function makechart(title, numarray, labelarray, color, bgcolor, bordersize, maxheight, maxwidth, addvalues)   ...
标签: ASP
  这个功能要装上WINDOWS NT OPTON PACK 的SMTP SERVICE。 首先 Set mail = Server.CreateObject("CDONTS.NewMail")以呼叫SMTP Service的元件,然后设定: mail.To = "收件者E-Mail地址" mail.From = "寄件者的E-Mail地址" mail.Subject = "主旨" mail.Body = "E-mail内文" 最后Mail.S...

经验教程

403

收藏

8
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部