Hi,

try this:

<?php echo "&sentStr=".rawurlencode($string)."&"; ?>

Flash:
unescape(string);

Regards,
Sebastian Wichmann

-----Ursprüngliche Nachricht----- Von: "Elie Zananiri" <[EMAIL PROTECTED]>
An: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Gesendet: Dienstag, 8. August 2006 20:28
Betreff: Re: [Flashcoders] quotes in XML


Thanks, that worked!

I actually XML-encoded the string in PHP using pipes instead of ampersands
and then converted the pipes back to ampersand in Flash once the string was
received.  The conversion from XML-encoding to regular characters is done
automatically.

**************************************************************
in PHP:
$string = pipe_encode($string);
echo "&sentStr=".$string."&";

function pipe_encode($str) {
 $encoded = "";

 // encode each character one at a time
 for ($i=0; $i < strlen($str); $i++) {
   $currChar = substr($str, $i, 1);

   switch ($currChar) {
     case '<':
       $encoded .= "|lt;";
       break;
     case '>':
       $encoded .= "|gt;";
       break;
     case '&':
       $encoded .= "|amp;";
       break;
     case '\'':
       $encoded .= "|apos;";
       break;
     case '"':
       $encoded .= "|quot;";
       break;
     default:
       $encoded .= $currChar;
   }
 }

 return $encoded;
}

in Flash:
var myXML:XML = new XML(loadedString.split("|").join("&"));
**************************************************************

On 8/8/06, Steven Sacks | BLITZ <[EMAIL PROTECTED]> wrote:

Character substitution, perhaps?

Use pipes |  perhaps.

Then, in Flash...

myLoadedString.split("|").join("\"");

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Elie Zananiri
http://www.prisonerjohn.com
http://www.digital-spa.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to