Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: ASP to Flash comma delimter problem

date posted 14th March 2003 15:46

Hi Paul,

>I'm passing data from ASP to Flash by Response.Writing a string. This string
>uses commas to seperate values. However some of the actual values (that come
>from a database) already have commas in them. Has anyone come across this
>before. I think that other characters might also be causing me problems such
>as '+' signs. Any help would be greatly appreciated. Basically I think I
>need to come up with an ASP function that will replace the problem
>characters and then an actionScript function that does the reverse.
>
I'm more of a FlashPHP bod myself, but basically you should use
Server.URLEncode() to encode your string before setting it up as a
variable. Flash will decode this automatically, meaning that your
variables will be ready for use as soon as they're loaded.

The problem of having the character you're using for your own separation
cropping up in text can be solved one of two ways:

1) Rather than using CSV, separate the values into individual variables.

&myVars=1,147,234,1234

...becomes...

myVar1=1&myVar2=147&myVar3=234&myVar4=1234

2) Choose a different character to separate your values - one that won't
crop up in the text.

Using the pipe symbol (|)...

&myVars=1,147,234,1234

...becomes...

&myVars=1|147|234|1234

You could also try formatting your data as XML and using the XML object
in Flash to load+decode the data, or try Flash Remoting, which will
allow you to send objects, strings etc from ASP to Flash and back
without having to URL-encode it, though neither of these will solve the
CSV issue as that's inherent to the data you're using and not how Flash
is processing it.

HTH

Regards,

Steve



Messages by Day
March 31st 2003
March 30th 2003
March 29th 2003
March 28th 2003
March 27th 2003
March 26th 2003
March 25th 2003
March 24th 2003
March 23rd 2003
March 22nd 2003
March 21st 2003
March 20th 2003
March 19th 2003
March 18th 2003
March 17th 2003
March 16th 2003
March 15th 2003
March 14th 2003
March 13th 2003
March 12th 2003
March 11th 2003
March 10th 2003
March 9th 2003
March 8th 2003
March 7th 2003
March 6th 2003
March 5th 2003
March 4th 2003
March 3rd 2003
March 2nd 2003
March 1st 2003


Messages by Month
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000