A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: cookies & flash??? HELP!!!

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    15

    resolved

    I've been working on this script for days ... here it is

    I have an intro which is like 20 secs long. At the end of the 20 secs, the menus pop up and the movie stops. When they make their selection, they will go to an html site. I have numerous links on the html site in the footers which point back to the intro. The thing is that I dont want them going back and viewing the whole intro (just the last frame of the flash file). So what I have decided to do is to create a cookie file which stores whether the computer has been at the home page or not. If they have visited the site, the user is sent to the last frame of the flash file when they click to go back home (I've done this by using javascript variables and transfering them to flash variables and then using an if then statement at the beginning of the flash file). This is still not working. Any better ideas??????

    here is the script:


    <====IN HTML============================>

    <SCRIPT LANGUAGE="JavaScript">
    <!--

    // create an instance of the Date object
    var now = new Date();
    // fix the bug in Navigator 2.0, Macintosh
    fixDate(now);
    // cookie expires in one year (actually, 365 days)
    // 365 days in a year
    // 24 hours in a day
    // 60 minutes in an hour
    // 60 seconds in a minute
    // 1000 milliseconds in a second
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    var beenhere = getCookie("beenhere");
    // if the cookie wasn't found, the person hasnt been here
    if (!beenhere) {
    beenhere=false
    }
    // -->
    </SCRIPT>

    <====IN FLASH - 1st frame===========================>

    If (beenhere=true)
    Go to and Play (Scene 1, 225)
    Else
    Play
    End If

    <====IN FLASH - last frame===========================>

    Set Variable: "beenhere" = "true"
    FS Command ("cookie", "beenhere")
    Get URL ("javascript: setCookie('beenhere', beenhere, now);")


  2. #2
    Junior Member
    Join Date
    Aug 2000
    Posts
    14
    didn't really look at you're code but check this site out might help

    http://www.enetserve.com/tutorials/cookietemplate.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center