Flash spec. chars HELP!!!
- Started
- Last post
- 18 Responses
- yah
Hey, I'm having enormous trouble with dynamic text from MySQL. I'm trying to use ® and TM but when I do it bugs out! The paragraphs don't wrap correctly (3rd p down, 1rst line) and when I roll over the links (via CSS) it moves! Check it: http://www.zenithstentgraft.com/…
*disclaimer - This is not the real design, just hooking up to a db first...
- Mimio0
Are you using a escape or replace string function when you're creating the DB record? There might be some extra stuff coming in from that character. Try looking at that string before displaying it as html.
- tomkat0
urlencode is your friend.
- yah0
Thanks Mimio. I'm actually displaying it in Flash and HTML. HTML displays fine:
http://www.zenithstentgraft.com/…...but the Flash gets all weird. You mean use a function in the middleware, correct? I wonder if there's anything I can do with that. I could perform the replacement at the flash level so that it doesn't affect the html side, but I wonder what to change it to?
- yah0
OK, tomkat, but do I need to change it back at the Flash? I'll try it...
- yah0
http://www.zenithstentgraft.com/…
Ok, I used urlencode on the field for the body text only. But you can still see it bugging out when you roll-over the 'dummy link'
incidentally, the ® is stored in the db as:
- Anarchitect0
#1 output your query as xml
http://www.kirupa.com/web/mysql_…1.1 give your php an xml header
1.2 give your xml an utf-8 encoding
1.3 your $xml should be contained as a variable. output it as:
print utf8_encode($myxml);
- yah0
I mean: & # 1 7 4 ;
- yah0
Thanks, Anarchitect, I'll give this a shot.
- System-Idle0
in flash you can use the unicode eq:
var from db to flash
&r_sign='\u00AE'in flash:
myTextField.htmlText=r_sign
- talltyler0
http://www.macromedia.com/cfusio…
url incoded characters will fix things
- unfittoprint0
if u have the possibility of using a backend language like php, don't encode within Flash.
- yah0
I am using MySQL > PHP > Flash/HTML. Meaning, this site needs to be displayed in html or Flash, depending on the user's preference.
I'm assuming LoadVars will load as unicode?
- unfittoprint0
yeah, LoadVars for example.
if as stated earlier u utf8_encode the whole thing before 'echoing' it within the php, you'll not have any problems.
works fine for my pretty portuguese characters...
- yah0
The MySQL data:
Since introducing our first AAA stent graft in Australia in 1994 - the Zenith& # 1 7 4 ; AAA Endovascular Graft has revolutionized the treatment of abdominal aortic aneurysms.The PHP:
// Output text to Flash
print "&newsText=".urlencode($theText...In Flash:
new LoadVars;
- yah0
unfittoprint, Anarchitect
Thanks for your responses, I'm still having trouble with both ways.
1. When I use utf8_encode() in PHP it completely drops all ampersands.
2. If I print an XML from PHP then it how do I get the data into Flash within the LoadVars object? eg.
In Flash:
myLV = new LoadVars();
myLV.onLoad = function() {
myText.htmlText = this.newsText;
// do I create a new xml object here?
}
myLV.load("fetch_data.php");The URL:
http://www.zenithstentgraft.com/…The PHP (text):
http://www.zenithstentgraft.com/…Thanks for your help.
- unfittoprint0
when I call an XML through php, I don't use loadVars but the XML() object. Deploy the result within its onLoad event.
secondly, you're echoing it as a whole variable not as an XML object. follow this tutorial:
http://www.kirupa.com/web/mysql_…
- yah0
when I call an XML through php, I don't use loadVars but the XML() object. Deploy the result within its onLoad event.
-OH, I was trying to create an xml inside the LV...
secondly, you're echoing it as a whole variable not as an XML object. follow this tutorial:
www.kirupa.com/web/mys...-yeah, I did, for another test, but it stops where you actually get it into Flash. Now that I know to use the XML instead of the LV I should be good.
Unfittoprint, would you mind trying to place a ® (& #174; w/o space between & and #) within your Portuguese for me? Just to see what happens? Thanks for your help. I'll get back when I give this a shot.
- yah0
Hey everyone who helped out...
espec. Anarchitect and Unfittoprint...T H A N K S ! ! !
I loaded the text, with special chars and w/o the craziness. A whole new set of formatting issues have formed, but no more bugs so I can deal.