Link to home
Start Free TrialLog in
Avatar of leronj23
leronj23

asked on

500 points. Flash will not load a whole paragraph with & symbol in it. Only whats in front of it.

Im trying to get my information to load into flash from SQL, but only half shows up. Im using Flash 8, PHP, and SQL. Im doing everything right but when flash reads the '&' symbol. It cuts everything off after that. I know in flash and PHP, you use the '&' symbol to separate variables that you are trying to load into flash.

I need everything after the '&' symbol and the '&' symbol to print also.
When i run the PHP file. Everything shows up, but not in flash.

Example:
Event1=September 6, 2007- 1st day of Class for College Park Site
October 6, 2007- 1st day of Class for Smyrna
March 6, 2008 - ParentMeeting /Recital & Costume Money Due for College Park Site
March 8, 2008 - Parent Meeting/ Recital & Costume Money Due for Smyrna Site
SiteOctober 12 13 2007 - Pirouette Dance Conference at Central Baptist Church
November 3, 2007- Pirouette Model Casting Call February 9, 2008- Pirouette Valentines Soirée

This is whats showing in flash:
September 6, 2007- 1st day of Class for College Park Site
October 6, 2007- 1st day of Class for Smyrna
March 6, 2008 - ParentMeeting /Recital

Please Help.
Avatar of Ashish Patel
Ashish Patel
Flag of India image

Try giving \&
Avatar of leronj23
leronj23

ASKER

I tried htmlspecialchars and it didnt work. basicly if someone is writing a posting on my site and decide to use '&' instead of 'and'. then it should show up. I dont know if something needs to change in Flash or PHP.

Flash:
loadText = new LoadVars();
loadText.load("Load_Event_Info.php");
loadText.onLoad = function(){
EventBox.text=loadText.Event1;}

PHP:
print("Event1 = $Event);

Didnt work:
print(htmlspecialchars("Event1=$Event"));

when i ran the php file. Everything showed up. But everything wont show up in Flash.
Hmm. Sorry, I'm not really a Flash programmer. I just assumed that was where your problem was. I did a quick Google search and I think I found the solution: http://www.jabbypanda.com/blog/?p=4

Basically, Flash needs the text to be url-encoded. So use "$html = urlencode($html);"
http://us2.php.net/manual/en/function.urlencode.php
Well i tried the example and it didnt work. i just want whatever the customer inputs in. it will show up. This shouldnt be so hard to do. :o(
Ah, I just looked at the link I provided again. Apparently, "+" is a special character that needs to be escaped. With url encode, spaces become '+'. Try using "rawurlencode()" instead.
i've read that it has something to do with Flash not reading special characters.
escape(text) is the function being used in flash.
asvforce, i dont understand.
Event1=escape("September 6, 2007- 1st day of Class for College Park Site
October 6, 2007- 1st day of Class for Smyrna
March 6, 2008 - ParentMeeting /Recital & Costume Money Due for College Park Site
March 8, 2008 - Parent Meeting/ Recital & Costume Money Due for Smyrna Site
SiteOctober 12 13 2007 - Pirouette Dance Conference at Central Baptist Church
November 3, 2007- Pirouette Model Casting Call February 9, 2008- Pirouette Valentines Soirée")
can you show us your ActionScript and PHP code so we can see whats going on?
PHP:
$query = @mysql_query("SELECT Event FROM $MainTable WHERE Id = '1'");
while($ourData = @mysql_fetch_array($query)){
$Event = $ourData["Event"];}

print("Event1=$Event");

This is what is printed when PHP is ran by itself:
Event1=September 6, 2007- 1st day of Class for College Park Site
October 6, 2007- 1st day of Class for Smyrna
March 6, 2008 - ParentMeeting /Recital & Costume Money Due for College Park Site
March 8, 2008 - Parent Meeting/ Recital & Costume Money Due for Smyrna Site
SiteOctober 12 13 2007 - Pirouette Dance Conference at Central Baptist Church
November 3, 2007- Pirouette Model Casting Call February 9, 2008- Pirouette Valentines Soirée

Flash:
loadText = new LoadVars();
loadText.load("Load_Event_Info.php");
loadText.onLoad = function(){
EventBox.text=loadText.Event1;}

In Flash i get this:
September 6, 2007- 1st day of Class for College Park Site
October 6, 2007- 1st day of Class for Smyrna
March 6, 2008 - ParentMeeting /Recital

When i should get this:
September 6, 2007- 1st day of Class for College Park Site
October 6, 2007- 1st day of Class for Smyrna
March 6, 2008 - ParentMeeting /Recital & Costume Money Due for College Park Site
March 8, 2008 - Parent Meeting/ Recital & Costume Money Due for Smyrna Site
SiteOctober 12 13 2007 - Pirouette Dance Conference at Central Baptist Church
November 3, 2007- Pirouette Model Casting Call February 9, 2008- Pirouette Valentines Soirée

When i take the '&' symbol and change it to 'and' it works. Everything shows up.
I know in PHP you used the '&' symbol to seperate variable being printed to Flash, but i know some how Flash came up with a way to override that if people decided to used the '&' in a paragraph or sentence.
ASKER CERTIFIED SOLUTION
Avatar of MasonWolf
MasonWolf
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
MasonWolf you are great thank you. thats exactly what i needed it to do.