用ASP控制Flash


来源:   

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>
<title>Flash 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="movie.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

编辑:

相关内容

 娱乐专题

more...

高峰私生子

王伯昭被打

傅彪肝癌晚期

赵薇餐馆打人事件

《云南映象》图集

张铁林拖欠中介费

女医生状告赵忠祥

高虎被捕事件

演绎经典美丽

解读《十面埋伏》

揭示明星美丽秘诀

五颜六色娱乐圈

明星纤体大比拼

《绿茶》精彩影评

天地英雄

吕丽萍群星艺术学校被起诉

于娜出道前被包养是真是假?

香港英皇贪污丑闻追踪

多少明星追忆中

2003环球小姐大赛

 

 叨叨专栏

more...

冯小刚,你怎么敢抽"上帝"?

流氓与流氓

娱乐媒体,请站直一点

原来张铁林不是中国人!

《神雕侠侣》的悲惨前途

男人,要硬派不要阴柔

请不要随便脱裤子

李欣,《自娱自乐》的挺滋儿!

不服没用,人家就是红了!

陆毅演戏吧,别唱歌了。

 

 

 
报业集团
- 版权声明 - 广告业务 - 联系方式
Copyright (C) 2001-2002 dzwww.com. All Rights Reserved
大众报业集团网络中心主办
Email:webmaster@mail.dzdaily.com.cn