Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    57
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Writing/reading cookies using Flash?

    I'm not quite sure if that's for here so - excuse me if it's not.

    I've heard that it was possible to write/read cookies using the Flash technology.

    I'm just not sure how.

    So I'd like to learn more about this. Also what other info can I read - like OS, Browser, etc.?

    Then another question - is it possible for a Flash object (which I understand would be needed to use Flash cookies) to read certain parameters passed from a CGI script and then pass them back?

    I'm not familiar with Flash and all I need it for is for the cookies capability - for my tracking needs so is there some simple solution?

    Thank you!
    Last edited by electrify77; 05-10-2009 at 03:37 PM.

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    http://www.flashkit.com/tutorials/Ac...1004/index.php

    Yes you can, or you can alternatively call Javascript to handle it, but thats probably confusing too. There are other tutorials on flash and cookies if this doesn't clarify it.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • Users who have thanked gnomeontherun for this post:

    electrify77 (05-11-2009)

  • #3
    New Coder
    Join Date
    Jan 2007
    Posts
    57
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Thanks for this!

    How would I go to pass on this data to a script?

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    What data exactly? You can use loadVars or similar functions to communicate from Flash with external scripts.

    http://www.smartwebby.com/Flash/external_data.asp
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #5
    New Coder
    Join Date
    Jan 2007
    Posts
    57
    Thanks
    11
    Thanked 0 Times in 0 Posts
    OK. So here's the deal. I need tracking for my affiliate program.

    What I mean by affiliate program?

    Simple. For example John joins my affiliate program. He gets a special link like http://www.domain.com/affiliate.cgi?affID=John

    So John gets people to click on that link and visit my site. If they buy John gets a commission.

    The problem is tracking.

    What I'm doing now is I write a simple cookie to the visitor's computer, which contains John's affID (eg. affID=John). So if the visitor doesn't buy right away and comes for example next week I can still see that it was John who referred them and split commissions with John.

    These days however so many people block cookies that it's getting real hard to track who has been referred by John, and I'm VERY interested in paying John what he really deserves - because John's efforts are VITAL to my business so I must make sure he is happy and gets all his commissions.

    I've heard about Flash cookies and I believe they aren't being blocked as much so they will probably be a much more precise way to track.

    But since some people don't use Flash I thought that maybe I could somehow use both methods for tracking - normal cookies and Flash cookies.

    What I need to do is when someone arrives at a page:

    1. Check if they were referred by some of my affiliates, John for example.
    2. If they have - write down a cookie in case they don't buy now and instead return later.
    3. If they haven't - check if there's an existing cookie
    4. Customize the order link - eg. if they were referred by an affiliate or I find a cookie with an affiliate ID - add that ID into the order link so it'll be passed to the order page and a script will do the rest. If there's no affiliate ID - add nothing to the order link.

    Any ideas how I can do that?

    Thanks!

  • #6
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    A cookie is a cookie, they are no different with Flash.

    You are better off using server based methods that track the IPs of the request, and that would remove any questions with using Cookies.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #7
    New Coder
    Join Date
    Jan 2007
    Posts
    57
    Thanks
    11
    Thanked 0 Times in 0 Posts
    I can't use IP's cause not everyone has a unique IP.

    I will use cookies I just want to somehow integrate both types...

    First it'll check the normal cookie, if it can't find anything then it'll check the Flash one and ultimately that data has to be added to a string in a link.

    That's the idea, but can it be done is the question.

  • #8
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Well people can disable cookies in their browser or in Flash. Cookies often get cleared when the browser closes, so I would think thats the least reliable method. I delete my cookies every time FF closes, its not that uncommon these days. You could start by looking for a cookie and the IP, and use them both.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #9
    New Coder
    Join Date
    Jan 2007
    Posts
    57
    Thanks
    11
    Thanked 0 Times in 0 Posts
    OK It's been kind of hard for me to digest all that stuff since I know nothing about Flash, but please bare with me for a second.

    If the Flash writes some data into an external TEXT file (as you pointed out in one of your links) would that data be somehow identifiable. Eg. there was an example with the YouTube videos sound settings. So if for example I export your sound setting into a TXT file - would it know it's your setting and recognize it when you visit again?

    Or to be slightly more precise can I export a particular element in the local share objects into an external text file?
    Last edited by electrify77; 05-21-2009 at 06:21 PM.


  •  

    Posting Permissions

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