[Flashcoders] Converting amp; in a URL?

2006-01-20 Thread Sascha Balkau

Hi list,

does ActionScript have any facilities to convert special characters like 
amp; into just ? I have one Flash movie that reads URLs from an RDF file 
where all URLs are written with amp; inside the adress. My client would 
like these special chars to be converted to ''. Does Flash has anything to 
do that automatically (haven't found anything so far) or do I have to write 
my own convert method?


Thanks for help,
Sascha


--
Flash Game Programming Wiki http://fgpwiki.corewatch.net/
H1DD3N.R350URC3 http://hiddenresource.corewatch.net/

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Converting amp; in a URL?

2006-01-20 Thread Yotam Laufer
You write your own or use the %26 escape sequence instead of amp;

On 20/01/06, Sascha Balkau [EMAIL PROTECTED] wrote:

 Hi list,

 does ActionScript have any facilities to convert special characters like
 amp; into just ? I have one Flash movie that reads URLs from an RDF file
 where all URLs are written with amp; inside the adress. My client would
 like these special chars to be converted to ''. Does Flash has anything
 to
 do that automatically (haven't found anything so far) or do I have to
 write
 my own convert method?

 Thanks for help,
 Sascha


 --
 Flash Game Programming Wiki http://fgpwiki.corewatch.net/
 H1DD3N.R350URC3 http://hiddenresource.corewatch.net/

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
Yotam Laufer | Flash Developer | mobile +44 (0) 79 205 17 212
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Converting amp; in a URL?

2006-01-20 Thread Adrian Lynch
Are you outputting these URLs or using them in getURL()?

That should work in getURL(). But if you're outputting them, one way to
convert them is to use HTML text fields.

Or, if you can't change the text fields, try this:

str = Sometext with an amp; in.;

function convert(str, from, to) {
return str.split(from).join(to);
}

trace(convert(str, amp;, ));

Adrian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Sascha
Balkau
Sent: 20 January 2006 14:10
To: flashcoders
Subject: [Flashcoders] Converting amp; in a URL?


Hi list,

does ActionScript have any facilities to convert special characters like
amp; into just ? I have one Flash movie that reads URLs from an RDF file
where all URLs are written with amp; inside the adress. My client would
like these special chars to be converted to ''. Does Flash has anything to
do that automatically (haven't found anything so far) or do I have to write
my own convert method?

Thanks for help,
Sascha

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Converting amp; in a URL?

2006-01-20 Thread Sascha Balkau
It's used in getURL. Thanks Adrian! Your small function solved it and helped 
me a ton!


Sascha



Are you outputting these URLs or using them in getURL()?

That should work in getURL(). But if you're outputting them, one way to
convert them is to use HTML text fields.

Or, if you can't change the text fields, try this:

str = Sometext with an amp; in.;

function convert(str, from, to) {
return str.split(from).join(to);
}

trace(convert(str, amp;, ));

Adrian



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders