6 Replies Latest reply on Nov 19, 2007 3:32 PM by nik c

    automated but personalized Xmas cards

    nik c Level 1

      My Boss wants (isn't that all they every do?):

      A Xmas card, that can be sent to our sales staff which they then can in turn customise with their personal message for their personal customers. So the actiual card with its animation, etc is the same for everyone, but the message is different for every card, and customer. Sales perosn X might write on his: 'Happy holidays, Bob, Hope your skiing is fantastic in Banf! X', the next one might write 'Seasons greetings, from your most dedicated sales rep!'

      What we need to send to the sales people must be easy to fill in and handle. What goes out to the final customer must be only one link.

      Has anyone done something similar before? I can't really think of anything immediate that doesn't involve at least some server side scripting, etc. (which I would not know where to start yet)

      At the moment we have the ecard set up so it uses loadvars to load the content of a text file to fill it with a message, but I presume we'd have to start dealing with XML, databases and automated sending back of links?

      Might there be a way of sending the text along as part of the link to the xmas card? But that doesn't sound terribly secure or elegant?

      ANY ideas (even to say that it is impossible, or a very bad idea) very welcome! (Well,....)


      Nik C
        • 1. automated but personalized Xmas cards
          abeall Level 3
          These are always fun projects.

          To answer your last question first, you could send all the text along in the url. It would look something like this:


          The text is url encoded, which Flash can do for you.

          Then in the PHP (or whatever server side language you use) you can pass the text into the SWF object easily, using FlashVars. Or if you don't want to use any server side language at all, you could actually do the same thing but link directly to the .swf, like this:


          Then in the .swf the variable "mytext" is available.

          But you are exactly right, this would mean that anyone could insert any message they want. This isn't that big of a deal, since it's just a harmless message wrapped in an animation, but the url is pretty messy looking. If you had some way to hide the url from the user, ie using an HTML <a> tag with friendly text, that would largely fix that problem.

          I think that would be a perfectly fine solution for a fun little app like this.


          Now, to do it with a clean url, you will need to user server-side scripting, though nothing too intense. You wouldn't have to get into XML, but you would probably want to use a database. Or you could actually use the server-side script to simply create text files. Then you create a link that looks more like:


          You could either pull a row out of a database with that id, and feed it into the Flash (Flash will treat it just like a text file, so you still use LoadVars, only the url points to a PHP which returns text, rather than an actual text file), or you could pass that id into Flash and Flash loads up 1432.txt.

          Hope that helps and good luck!
          • 2. Re: automated but personalized Xmas cards
            nik c Level 1
            Hi Aaron,

            Thanks for the many options you list.
            I would want to go for this:

            - create on 'input page' on which people would create their xmas cards in the following way. All the date to be stored in a database so the 'clena URL version' can be implemented:
            1) click a button 'create new card'
            2) enter the greeting bit of the card ('Hi Bob,'
            3) enter the body of the message
            4) enter the sign off ('Have a good one, Ed')
            5) enter recipient email
            6) enter their own email
            7) click preview
            8) have a choice of edinting the message (back to previous page) or sending it off

            - for the viewing o9f the card:
            -- the link is a clean link (i.e. no message text in the URL)
            -- the .swf loads in one row of the database as a text file loading the 'greetings', 'body' and 'signOff' vars

            How do I get the swf to load the right data from the database?
            How to I prepare the data from the db so that flash can read it as it would read a text file to fill its variables? I will be using php for this.

            I'll tryu and figure much of this out in the course of my morning here - but do youhave any pointers to pre existin scripts -- woudl be very much appreciated. I am used to developing apps with php and mySQL, usually using the interakt php stuff, now it's calleed the adobe developers tool box (but has lsot a lot f its original functionality); and am reasonably up to speed with actionscript v2


            Nik c
            • 3. Re: automated but personalized Xmas cards
              nik c Level 1
              OK, so I got the database set up and working and I got the swf set up and working.
              the problem is how to I get them work together?

              I have a php page on my server now that based on an ID number I am sending it, it returns a text file that the swf can read and nicely load into the it and display.

              How to I get the ID into the swf so that this call can be made from the swf.

              So far I have tested it with the link hared coded into it, so I know it would work if flash made that call, but I need flash to somehow pick it up from it external html page that is created by the php script.

              Is this possible?


              Nik C
              • 4. Re: automated but personalized Xmas cards
                Greg Dove Level 4
                Yes, you can use the flashvars embedding parameter/attribute.

                Heres the as2 help doc:
                • 5. Re: automated but personalized Xmas cards
                  Greg Dove Level 4
                  If you're using javascript embedding (either adobe's activecontent.js or swfobject etc) then the javascript embedding method, normally has its own way of adding them..normally its easier because you don't have to repeat it for both object and embed tags...

                  • 6. Re: automated but personalized Xmas cards
                    nik c Level 1
                    that's exactly what I ended up using! took me a whiule to find and I started to loose believe that this possibility HAS TO exist!

                    So our proof of concept scraped in with about 5 minutes to spare at 4.55pm !

                    Thanks All
                    Nik C