2

I created a small SWF game with AS3 with a small form at the end to capture the users' details and send with a mailto function. It works perfectly on the desktop but when I tested it on the tablet - the mailto function works except that it does not include the details that the user entered in the form. I have tried using different mail apps and different SWF players but to no avail.

Here is my script for the form page

submit_BTN.addEventListener(MouseEvent.MOUSE_UP, openEmail);
    function openEmail(e:Event):void{
    navigateToURL(new URLRequest("mailto:" + "thisemailaddressleftout" + 
    "?subject="+"thissubjectleftout"+ "&body=" + name2_field.text + "\n" + 
    cell2_field.text + "\n" + email2_field.text));
    gotoAndPlay(1, "Thank you");
    }

Any help would be appreciated as I am a junior in flash.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Ruan Petersen
  • 141
  • 14

1 Answers1

0

Be aware that the URLRequest string must be a valid URL encoded string, so no spaces or special characters.

Perform an initial test with no variables, so try something like:

function openEmail(e:Event):void{
navigateToURL(new URLRequest("mailto:name@domain.com?subject=Test&body=Hello"));
gotoAndPlay(1, "Thank you");
}

If that works you know you're on the right track.

If that does work you can encode your variables with encodeURIComponent();

When are you supposed to use escape instead of encodeURI / encodeURIComponent?

Community
  • 1
  • 1
crooksy88
  • 3,849
  • 1
  • 24
  • 30
  • Thank you very much for your reply, I will keep this in mind in further scripting adventures - I managed to get it working with another SWF player herewith the link if someone else should have a similar problem with finding an SWF player for android that works decently; https://play.google.com/store/apps/details?id=org.coolcode.utils.swfviewer&feature=search_result#?t=W251bGwsMSwyLDEsIm9yZy5jb29sY29kZS51dGlscy5zd2Z2aWV3ZXIiXQ.. Further still, thank you for the support – Ruan Petersen Jun 19 '13 at 14:18