Old 06-01-2008, 13:07   #1 (permalink)
Banan
Registered User
 
Join Date: Apr 2006
Posts: 15
symbols in dynamic TXT

hi ppl,
im trying to use the "&" symbol in a dynamically loaded txt file, i tried using the ascii value of it ( &, or &amp but neither show up and the text is cut off at the place i insert them.

anybody knows how can i solve this problem?
thanks.
  Reply With Quote
Old 06-01-2008, 16:26   #2 (permalink)
proc355
Trailer Trash™
 
proc355's Avatar
 
Join Date: Sep 2006
Posts: 853
url-encode your ampersands; the default delimiter for loaded data in flash is the ampersand e.g.

&mytext=yada yada yada&

so your code thinks the data has terminated

& = %26

&mytext=yada yada yada & another thing& // bork!
&mytext=yada yada yada %26 another thing& // woot!

you can use the escape method in flash to do it for you

Code:
var str = "yada yada yada & another thing"; var estr = escape(str); var ustr = unescape(estr); trace("String = "+str); trace("Escaped = "+estr); trace("Unescaped = "+ustr); // trace output: // // String = yada yada yada & another thing // Escaped = yada%20yada%20yada%20%26%20another%20thing // Unescaped = yada yada yada & another thing
__________________
meh.
  Reply With Quote
Old 07-01-2008, 04:38   #3 (permalink)
Banan
Registered User
 
Join Date: Apr 2006
Posts: 15
works!!!
thanks a lot!
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8