[英]How to detect if flash movie already played for viewer
I am looking to see if there is a way to program to see if movie played on a person machine. 我正在寻找是否有一种方法可以编程查看电影是否在人机上播放。
I looking to design and flash movie intro. 我希望设计和制作电影简介。 if played go to home page if not play 30 second promo.
如果播放过,则转到主页;如果不播放30秒促销,则转到主页。 Is this possible if so where do I begin to look for information on how to do it.
如果可以,我可以从哪里开始寻找有关如何做的信息。
I am assuming that all of this is in flash. 我假设所有这些都在瞬间。
At the beginning of movie: 电影开头:
var played_so:SharedObject = SharedObject.getLocal("PlayedBefore")
if (played_so.data.before) {
gotoAndPlay("HomePage")
} else {
gotoAndPlay("intro")
}
And at the end of the intro you will need to put: 在介绍的最后,您需要输入:
played_so.data.before = true
A SharedObject
is somewhat like a cookie. SharedObject
有点像cookie。 SharedObject's are persistent objects that can be loaded and modified, and are automatically saved. SharedObject是可以加载和修改并自动保存的持久对象。 When you modify the data within a SharedObject, it is saved to the user's computer.
修改SharedObject中的数据时,该数据将保存到用户的计算机中。 Using
SharedObject.getLocal()
loads the object. 使用
SharedObject.getLocal()
加载对象。
I think that only your flash can access your SharedObjects, so the naming of the SharedObject (the parameter passed to getLocal()) can be anything you want. 我认为只有您的闪存才能访问您的SharedObjects,因此SharedObject的命名(传递给getLocal()的参数)可以是您想要的任何东西。
Here is the link to documentation on SharedObjects: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html 这是指向SharedObjects的文档的链接: http : //help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html
Store this information in a cookie. 将此信息存储在cookie中。 Set a specific value if the movie has been played.
如果已播放电影,则设置一个特定的值。
Query the cookie in order to see if the movie has of has not been played and act accordingly. 查询cookie以查看电影是否已播放过,并采取相应措施。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.