A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to create personalized e-card

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    2

    Question How to create personalized e-card

    Hello,

    I have created an FLASH e-card that I would like to e-mail to a group of people. I would like to feed their first name into a variable on the FLASH e-card from a database. How can I do this? I was hoping I could feed the name variable through the url. Something like (www.domain.com/ecard/ecard.html?name=john)

    I also use an outside e-mail service, so I am not sure how that is going to work until I test it. Ultimately, I would have to upload a csv file to the email provider containing the personalized urls.

    Can I do this?

    Is there a better way?

    Am I asking for too much?

  2. #2
    Senior Member Shotsy247's Avatar
    Join Date
    Apr 2001
    Location
    Be there in a minute!
    Posts
    1,386
    What you need to do is add that variable and value to the flash movie param on the html page.

    Something like:

    code:
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!-- saved from url=(0013)about:internet -->
    <script language="javascript">

    function getURLVar(urlVarName) {
    var urlHalves = String(document.location).split('?');
    var urlVarValue = '';
    if(urlHalves[1]){
    var urlVars = urlHalves[1].split('&');
    for(var i=0; i<=(urlVars.length); i++){
    if(urlVars[i]){
    var urlVarPair = urlVars[i].split('=');
    if (urlVarPair[0] && urlVarPair[0].toLowerCase() == urlVarName.toLowerCase()) {
    urlVarValue = urlVarPair[1];
    }
    }
    }
    }
    return urlVarValue;
    }

    var vidPath = getURLVar("vidPath");

    if (AC_FL_RunContent == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {

    AC_FL_RunContent(
    'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
    'width', '640',
    'height', '522',
    'src', 'vidPlayer?vidPath='+vidPath,
    'quality', 'high',
    'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'noscale',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'vidPlayer',
    'bgcolor', '#ffffff',
    'name', 'vidPlayer',
    'menu', 'true',
    'allowFullScreen', 'false',
    'allowScriptAccess','sameDomain',
    'movie', 'vidPlayer?vidPath='+vidPath,
    'salign', ''
    ); //end AC code
    }
    </script>
    <noscript>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="640" height="522" id="vidPlayer" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="vidPlayer.swf?vidPath="+vidPath /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="bgcolor" value="#ffffff" /> <embed src="vidPlayer.swf?vidPath="+vidPath quality="high" scale="noscale" bgcolor="#ffffff" width="640" height="522" name="vidPlayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </noscript>



    Of course in this example I'm bringing in a variable called vidPath.

    So the URL is something like http://www.mysite.com?vidPath=some value.
    I don't feel tardy.

  3. #3
    Junior Member
    Join Date
    Jul 2008
    Posts
    2

    Thanks

    Thanks! I will give it a try.

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    you can also do what you asked initially in your first post. (grab the variable from the URL/query string)

    in my footer are some links on how to do it..

    I suggest using the swf object method..

    http://board.flashkit.com/board/show...ight=swfobject

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