• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

External links from an app

Explorer ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

Hi,

couple of general questions please:

when I set up a contact form on a website I use an external php file to process the form.

Would I use the same method for an app? Link to a php file on my server?

Or is there another method I need to be aware of.

Similarly, I'd like to use a widget which is available to embed in a html page (it's a weather widget). Would that work in an app created with Animate?

Any advice appreciated.

Views

900

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 09, 2017 Jun 09, 2017

yes, you can do that.  eg, if you've saved the email address in the variable emailS, you would use:

navigateToURL(new URLRequest("mailto:"+emailS));

Votes

Translate

Translate
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

you could, or you could use navigateToURL() and utilize the user's default email client.  because all mobiles (if you're making a mobile app) have email clients you can be sure they have one.

the widget will fail unless you re-work it.  it probably would be easier to retrieve an rss weather report and create your own weather display in animate.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

It is a mobile app so what url would you navigate to? Would the user have to enter their email address?

Also, since I'm doing a mobile app, would that be the way for me to send via sms?

And, what if I want to send an image as part of the message?

Someone gave me a link to pngencode (I think it was you actually) but I can't find any documentation to show how to use that.

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

The weather widget aspect sounds way too complicated for me at the mo.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

yes, here's the link again, URI Handlers in AIR for Android: Phone Calls, Email, Text Messages, Maps, Market, and URLs

sample code to use is shown at that page:

 navigateToURL(new URLRequest("mailto:christian.cantrell@adobe.com?subject=AIR%20Rocks"));

you can google (actionscript 3 email) if you want to add more to the email (eg, body, cc).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

This is really useful. Cheers.

But this is just to one email address isn't it and to one phone number for sms.

I want the user to be able to send to a number or email address of their own choice.

Would the method above allow that?

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

yes. you can separate email addresses by a comma or semi-colon.

navigateToURL(new URLRequest("mailto:christian.cantrell@adobe.com;whomever@mail.com;xxx@xxx.com"));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

OK, I see.

But what I mean is, I wont know the email address of phone number that the info will be sent to.

The user of the app has to provide that.

So, to be clear, the user installs the app. They answer a bunch of questions, they end up with a sort of pie chart which is built in response to the answers they give and at the end of the exercise I need them to save a copy of what they've entered (including the pie chart)>

So, the user has the option to email or sms it to themselves or whatever email address or phone number they enter themselves. I'd also like them to be able to download a copy of it too perhaps as a png.

Hope that makes sense and thanks again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

yes, you can do that.  eg, if you've saved the email address in the variable emailS, you would use:

navigateToURL(new URLRequest("mailto:"+emailS));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

Bingo!

That's exactly what I need thank you.

Would that work for sms too?

ie

private function onTextAdobe():void

  {

  navigateToURL(new URLRequest("sms:+smsnumberS"));

  }

That would work right?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

yes, it works for sms (and more).  but your code is incorrect. if you want to text smsnumberS, use:

navigateToURL(new URLRequest("sms:"+smsnumberS));

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

OK brilliant thank you.

I'll be implementing this over the weekend so I may be back . . . sorry.

Meanwhile, it's Friday and there's a pub with a sunny beer garden and a pint of beer with my name on it beckoning.

Thanks for your support and bye for now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2017 Jun 09, 2017

Copy link to clipboard

Copied

cheers.  (and have one for me!)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 02, 2017 Jul 02, 2017

Copy link to clipboard

Copied

Hi,

I've at last got to the point where I'm finishing the form and this project . . . at last.

I'm trying to make the code you gave above work with this form structure but it's not working obviously.

For the AS3 front end of the form I've got this:

submit_btn.addEventListener(MouseEvent.CLICK, sendMessage);

function sendMessage(e:MouseEvent):void{

var my_vars:URLVariables = new URLVariables();

my_vars.senderName = name_text.text;

my_vars.senderEmail = email_text.text;

my_vars.senderMsg = message_text.text;

var my_url:URLRequest = new URLRequest("mail.php");

my_url.method = URLRequestMethod.POST;

my_url.data = my_vars;

var my_loader:URLLoader = new URLLoader();

my_loader.dataFormat = URLLoaderDataFormat.VARIABLES;

my_loader.load(my_url);

name_text.text = "";

email_text.text = "";

message_text.text = "Thank you! Your notes have been sent";

}

I'm not sure where these two lines go - I'm trying to send to the email address and / or the phone number the user enters.

navigateToURL(new URLRequest("mailto:"+emailS));

navigateToURL(new URLRequest("sms:"+smsnumberS));

On the PHP side I've got this:

<?php

$to = "yourAddress@domain.com";

$subject = ($_POST['senderName']);

$message = ($_POST['senderMsg']);

$message .= "\n\n---------------------------\n";

$message .= "E-mail Sent From: " . $_POST['senderName'] . " <" . $_POST['senderEmail'] . ">\n";

$headers = "From: " . $_POST['senderName'] . " <" . $_POST['senderEmail'] . ">\n";

if(@mail($to, $subject, $message, $headers))

{

echo "answer=ok";

}

else

{

echo "answer=error";

}

?>

Any advice appreciated.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2017 Jul 02, 2017

Copy link to clipboard

Copied

you don't use navigateToURL if you're using php.

you as3 looks ok, but your php does not.

change your headers to:

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= 'From:this should be your server email address'. "\r\n";

$headers .= 'Reply-to: '.$_POST["senderEmail"]. "\r\n";

and change

if(@mail...

to

if(mail...

then debug in your browser's developer console

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

A basic question that I need to clarify.

For an app, should I be using the same pho method I would use on a website. Or is there a better way to submit forms in an app ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

Also, if I'm not using

navigateToURL(new URLRequest("sms:"+smsnumberS));

How do I send an sms?

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

for a mobile app, use navigateToURL.

if you want to use php to send an sms, google: php send sms

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

It is acceptable to use the php method for an app - it just wouldn't work at all?

Or do I use navigateToUrl . This is the only method that would work in an app?

Or are both methods workable in an app?

Sorry to be a pain, but I really need to clear this point up for myself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

desktop app or mobile app?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

Mobile app

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

I'm giving up on the sms option.

There seems to be a lot of diverse thinking about its reliability and compatibility issues at the moment.

So I'm just going with Name, Email and Enquiry fields.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

I've just tested a simple form using the php method sending to my address.

It doesn't work. So I think I've answered my own question.

So how do I set up a button which just opens the phone's email client pls?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 03, 2017 Jul 03, 2017

Copy link to clipboard

Copied

LATEST

use navigateToURL

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines