all groups > coldfusion flash integration > november 2006 >
You're in the

coldfusion flash integration

group:

ColdFusion truncating text


ColdFusion truncating text Reg Phipps
11/9/2006 12:34:03 AM
coldfusion flash integration:
I'm using coldfusion to get data for a flashTextEditor control (InputText) in
a flash movie clip.

In a flash action script I'm using

myData.sendAndLoad("getcontent.cfm", myData, "POST");
myData.onLoad = function(success) {
if(success){ .....
...
...

to get back some string data. The getcontent.cfm returns a text string from a
database to flash. The cfm script contains the following:

<cfset returnToFlash ="&writing="#GETBlogContentForMaxSeqNum.Content#&">
<cfprocessingdirective suppresswhitespace="Yes">
<cfoutput>
#returnToFlash#
</cfoutput>
</cfprocessingdirective>

The GETBlogContentForMaxSeqNum is a stored procedure which gets the text
content from a string column in the table. If the string from the table
contains html formatted text like "this &amp; that" it only returns the "this"
part of the string or if it's "that&apos; all folks" then it only return "that"
for the text content. The script seems to be clipping at the first & in the
text. If the text does not contain an & then all is well. How can I get it to
return all of the text if the text contains an & in the string.:confused;
Re: ColdFusion truncating text Reg Phipps
11/9/2006 9:50:17 PM
Eureka!!! after investigating a number of different possibilities I found a
solution. The solution is to use UrlEncodedFormat as shown below.

<cfset returnToFlash =
"&writing=#UrlEncodedFormat("#GETBlogContentTestForMaxSeqNum.Content#")#">

This fixes the problem of an '&' in a string clipping the returned text. Quite
simple really after I found the solution.
AddThis Social Bookmark Button