6 Replies Latest reply on Feb 1, 2007 1:28 AM by Newsgroup_User

    Director / Lingo / Cookies

    smalbil
      My Macromedia Director DVD project has got 3 designs.
      My website has got 3 CSS scripts, that have the 3 designs as well.
      3 Designs for the following groups:

      1. for teachers
      2. for students
      3. for employers

      The website can change CSS scripts by setting a cookie.
      How can I get Director to create a cookie, so that the users of the DVD will see the same design when the go to my URL. All is setup, but the cookie.
      And please do not tell my that it doesnt excist... that would be a major bug.
        • 1. Re: Director / Lingo / Cookies
          Level 7
          Isn't a cookie as simple as a named text file in a particular directory?
          You could figure out what to put into such a file by examining some
          existing cookies and then using something like FileIO or any other
          write-capable xtra to create one.
          • 2. Re: Director / Lingo / Cookies
            Level 7
            I wouldn't go as far as calling a nonexistent feature a bug, but here's
            my $0.05:

            I suppose you open the webpage with something like:
            gotoNetPage(" http://www.yada.com")

            I'd pass a parameter on the URL indicating which CSS-file to load as
            main (and implicitly which as alternates), catch that parameter with
            whatever serverside language you have and use it well :)

            so something like:
            gotoNetPage(" http://www.yada.com/index.php?style=student")

            Althoug probably possible, I personally would not get into editing
            cookies. Doing off-standard stuff with the internets and it's plethora
            of browsers would have me shivering.

            Hope this helps,
            Manno


            smalbil wrote:
            > My Macromedia Director DVD project has got 3 designs.
            > My website has got 3 CSS scripts, that have the 3 designs as well.
            > 3 Designs for the following groups:
            >
            > 1. for teachers
            > 2. for students
            > 3. for employers
            >
            > The website can change CSS scripts by setting a cookie.
            > How can I get Director to create a cookie, so that the users of the DVD will
            > see the same design when the go to my URL. All is setup, but the cookie.
            > And please do not tell my that it doesnt excist... that would be a major bug.
            >

            --
            ----------
            Manno Bult
            http://www.aloft.nl
            manno@xs4all.nl
            • 3. Director / Lingo / Cookies
              Lukewig Level 1
              Hi,

              I'm not sure how a Director Projector would be able to write a cookie for each browser on a user's system (I'm sure its possible - but a simpler solution might be to pass a css preferences in the URL query string.

              In other words, rather than going from your Director movie to foo.com, go to foo.com?css= teachers for example,

              Then, on your website, check the query and set the appropriate cookie.

              Regards,

              -Luke
              • 4. Re: Director / Lingo / Cookies
                smalbil Level 1
                I tried a http query, but it doesnt open the correct CSS.
                I will not try to write a cookie with FileIO, because the save location could be a different place on every PC.
                I tried about everything that you people suggest, but I think I will have to do it the easy way and write a redirect for each of the 3 designs. Too bad, it gives me 3 extra php files. Thanks anyways guys. If you do think of something, please post.

                Xander Smalbil
                • 5. Re: Director / Lingo / Cookies
                  the real POTMO Level 1
                  you could open a webpage that writes the cookie.
                  and then you open the webpage that reads the cookie otr the writerpage redirects you directly.
                  Ugly but it might work :)

                  But I would recomend you not to use cookies at all and use the nicer pass a parameter with the css style. Not everyone have cookies turned on.

                  • 6. Re: Director / Lingo / Cookies
                    Level 7
                    Hi,

                    How do you decide which stylesheet to show if people view the webpage
                    directly (not from link on DVD)? You need to have a decision mechanism
                    there too.

                    Hard to definitely say at a distance, but I would have the logic in the
                    PHP something like:

                    // see if $_GET["style"] is set
                    // if so, (visitor probably from from DVD) read value and echo
                    corresponding style
                    // if $_GET["style"] is not set but cookie _is_ set, read and echo style
                    accordingly.
                    // if none of the above apply (no $_GET and no cookie), echo a default style

                    HTH,
                    Manno

                    smalbil wrote:
                    > I tried a http query, but it doesnt open the correct CSS.
                    > I will not try to write a cookie with FileIO, because the save location could
                    > be a different place on every PC.
                    > I tried about everything that you people suggest, but I think I will have to
                    > do it the easy way and write a redirect for each of the 3 designs. Too bad, it
                    > gives me 3 extra php files. Thanks anyways guys. If you do think of something,
                    > please post.
                    >
                    > Xander Smalbil
                    >

                    --
                    ----------
                    Manno Bult
                    http://www.aloft.nl
                    manno@xs4all.nl