Have you tried:  

 

escape(body)  

 

?

 

Regards, 

-Keith 
http://keithreinfeld.home.comcast.net
<http://keithreinfeld.home.comcast.net/> 
 

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of cedar.rabbit
Sent: Monday, December 22, 2008 11:56 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] mailto from textarea in AIR application - line breaks
fail in windows

 

I have an AIR app that needs to open and pre-populate an email in the user's
default email 
application. This is not difficult, see the application code I've provided
at the end of this 
post. 

When you build this AIR app and run it on a mac, it works fine - any
carriage returns you 
typed in the text area are displayed properly in apple mail and other mac
email clients. 

When you build this AIR app and run it on a pc, it fails. Only the text
before the first 
carriage return is displayed.

I have tried the following:
1. forcing word wrapping in the text area
2. replacing new lines in the text ("\n") with a windows return and new line
("\r\n") using 
this regular expression: /\r\n/gm;

Any ideas or suggestions would be greatly appreciated!
Thanks

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.
<http://www.adobe.com/2006/mxml> com/2006/mxml" 
layout="absolute" width="800" height="600" backgroundColor="white">

<mx:Script>
<![CDATA[
import flash.net.navigateToURL;

private function onSend():void
{
var address:String = "<address>";
var subject:String = "<subject>";
var body:String = ta.text;

var sendURL:URLRequest = new URLRequest("mailto:"+address+";?
subject="+subject+"&body="+body);
navigateToURL(sendURL);
}
]]>
</mx:Script>
<mx:VBox width="100%" height="100%">
<mx:TextArea id="ta" width="100%" height="100%"/>
<mx:Button label="Send" verticalCenter="0" horizontalCenter="0" 
click="onSend()"/>
</mx:VBox>

</mx:WindowedApplication>

 

Reply via email to