简体   繁体   中英

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. 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's are persistent objects that can be loaded and modified, and are automatically saved. When you modify the data within a SharedObject, it is saved to the user's computer. Using SharedObject.getLocal() loads the object.

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.

Here is the link to documentation on SharedObjects: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html

Store this information in a 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM