Ask the HTML page to play the Flash movie only once (and not when viewing it again ...)

How would it be possible for an HTML page to play flash animation only once, that is, when a person returns to this page, Flash will not play from the very beginning, but simply show the last frame of the animation (or even a simple .jpg image of this last frame) ? Is it possible?

Thank you L.

+2
source share
2 answers

you can save a cookie on your first visit to show what the user has visited before. ( http://plugins.jquery.com/project/Cookie )

, ( flashvars), , . (http://bowievanling.com/blog/using-flashvars-with-swfobject-20-and-as3/)

swfObject 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, flashvar iscookie = true:

for (var fv in root.loaderInfo.parameters) {
   if(fv == 'iscookie'){
      if(root.loaderInfo.parameters[fv] == 'true'){
         gotoAndStop(frameNumber);
      }
   }
}

+7

cookie Flash SharedObject. cookie, ActionScript, , Flash-. , Flash , , , .

: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html

+2

Source: https://habr.com/ru/post/1778747/


All Articles