有一个HTML页面播放Flash影片只有一次(不重新审视的时候......) [英] Have a HTML page play Flash movie only once (not when revisited...)
问题描述
如何将有可能有一个HTML网页播放Flash动画只有一次,即当一个人又回到了该网页,闪光灯将不会再从一开始播放,但只会显示动画的最后一帧(或者甚至一个简单的.JPG去年帧的图像)?它甚至有可能?
How would it be possible to have a HTML page play a flash animation only once, i.e. when a person goes back to that page, the Flash won't play again from the start but will just show the last frame of the animation (or even a simple .jpg image of that last frame)? Is it even possible?
谢谢,
L;
Thanks, L.
推荐答案
您可以拯救一个cookie的用户第一次访问,以显示该用户已经访问过。 ( http://plugins.jquery.com/project/Cookie )
you could save a cookie the first time the user visits to show that the user has visited before. (http://plugins.jquery.com/project/Cookie)
然后,当他们返回值传递给闪光灯(使用Flash变量),因此只知道玩的最后一帧。 ( http://bowievanling.com/blog/using-flashvars -with-swfobject的-20和-AS3 / )
Then when they return pass that value to the flash (using flashvars) so it knows only to play the last frame. (http://bowievanling.com/blog/using-flashvars-with-swfobject-20-and-as3/)
使用 SwfObject的嵌入您的Flash:
Using swfObject to embed your flash:
<script type="text/javascript">
var flashvars = {
iscookie: "true"
};
var params = {
menu: "false"
};
var attributes = { };
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>
在AS3加载frameNumber的,如果Flash变量iscookie =真:
in AS3 to load frameNumber if flashvar iscookie = true:
for (var fv in root.loaderInfo.parameters) {
if(fv == 'iscookie'){
if(root.loaderInfo.parameters[fv] == 'true'){
gotoAndStop(frameNumber);
}
}
}
乔希
这篇关于有一个HTML页面播放Flash影片只有一次(不重新审视的时候......)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!