?
Solved

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

Posted on 2007-10-04
14
Medium Priority
?
177 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:leronj23
  • 6
  • 4
  • 3
  • +1
14 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20013917
Try giving \&
0
 
LVL 13

Expert Comment

by:MasonWolf
ID: 20013980
0
 

Author Comment

by:leronj23
ID: 20014815
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:MasonWolf
ID: 20014887
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
0
 

Author Comment

by:leronj23
ID: 20015239
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(
0
 
LVL 13

Expert Comment

by:MasonWolf
ID: 20015333
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.
0
 

Author Comment

by:leronj23
ID: 20015419
i've read that it has something to do with Flash not reading special characters.
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20015984
escape(text) is the function being used in flash.
0
 

Author Comment

by:leronj23
ID: 20016214
asvforce, i dont understand.
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20019735
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")
0
 
LVL 2

Expert Comment

by:thebrainman
ID: 20050974
can you show us your ActionScript and PHP code so we can see whats going on?
0
 

Author Comment

by:leronj23
ID: 20051099
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.
0
 
LVL 13

Accepted Solution

by:
MasonWolf earned 2000 total points
ID: 20051187
please try:
$Event = rawurlencode($ourData["Event"]);
0
 

Author Comment

by:leronj23
ID: 20051325
MasonWolf you are great thank you. thats exactly what i needed it to do.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question