dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Reading My Cookie Help insanity is calling

  1. #1
    Looking for News Things
    Join Date
    Jun 2001
    Location
    Netherlands
    Posts
    27
    I used the Flookies tutorial to write cookies works greart. Now everybody is saying that reading your cooke-values into flash is easy. But no examples can be found. Only an irritating AlertPopup with my set values. I just want to read them into Flash, but how......

    I used following Javascript apparently i can call cookieString???????? HElp.....Thanx


    <SCRIPT LANGUAGE="JavaScript1.1">
    <!--
    // Get Cookies script
    cookString = "?"
    // does the visitor have a cookie?
    if(document.cookie != "") {
    theCook = document.cookie.split("; ")
    // add each part of the cookie to a string variable
    for (i = 0; i < theCook.length; i ++) {
    cookString += theCook[i] + "&"
    }
    }

    function cookit() {
    exDate = new Date
    exDate.setMonth(exDate.getMonth()+9)
    // This function writes a cookie sting from your Flash file.
    // to call this function, use the Get URL command and pass the
    // two variables to the JavaScript.
    for(i=0;i<cookit.arguments.length;i++) {
    ckThing = cookit.arguments[i] + '=' + cookit.arguments[i+1]
    i++
    document.cookie = ckThing + '; expires=' + exDate.toGMTString()
    }
    // The command to call this function is on the button 'click to
    // write cookie'. It uses the 'Get URL' command and passes
    // cookie information in pairs. The first item in a pair is
    // the cookie variable name, the second is the value for the
    // variable.
    }
    // -->
    </SCRIPT>

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    you are probably looking for some code that document.write()s the whole embed code for the movie and adds the cookie string. I answered this same question yesterday, but with a location.search rather than a cookie string (the thread had "url" in the title)

    Musicman

  3. #3
    Looking for News Things
    Join Date
    Jun 2001
    Location
    Netherlands
    Posts
    27

    Only want to read cookies variables into flash

    Writing them is easy with the script.
    But reading a cookie....
    They assume it is so easy nobody has to tell how to do it. But i need to know


    Script taken from
    http://www.virtual-fx.net/tutorials/html/flookies.html

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    you really should have found the code in url based dynamic flash content - just replace location.search by cookString

    Musicman

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