Link to home
Start Free TrialLog in
Avatar of ksecor
ksecor

asked on

Need to pass a special character into flash with xml

I'm dynamically creating buttons with actionscript 3 from xml. One of my strings has the notorious middle dot. I've tried unicode #x00B7, &midddot; and a few other things, but flash always takes those characters literally. How do I pass the middle dot in so flash displays it as a middle dot?
Avatar of Antonio Estrada
Antonio Estrada
Flag of Mexico image

Try the following:

<code>

-V
XML:
 
<someElements>
  <someElement><![CDATA[haha · hehe]]></someElement>
</someElements>
 
AS:
 
var someXML:XML = new XML();
someXML.ignoreWhite = true;
someXML.load("lol.xml");
 
someXML.onLoad = function(success) {
	if(success) {
		trace(this.firstChild.childNodes[0].childNodes[0].nodeValue);
	}	
}

Open in new window

Avatar of ksecor
ksecor

ASKER

Don't think I can do that in an attribute...            
<client name="<![CDATA[20 · 21 Restaurant & Bar]]">
ASKER CERTIFIED SOLUTION
Avatar of Antonio Estrada
Antonio Estrada
Flag of Mexico 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
Try using unicode as follows:

<client name="20 \u0095 21 Restaurant \u0026 Bar">

Also make sure your font charset is embeded in the application.



Avatar of ksecor

ASKER

No...that doesn't work....you can see the gall at http://mm214.com/6dg/6dgGall.swf and the xml at http://mm214.com/6dg/port.xml
what about using url encoded characters?


<client name="20 %B7 21 Restaurant & Bar">

Then you can use unescape() function to convert that string before using in the labels
I agree with VULTUROUS. If you want to make this XML scalable, turn the attribute into a node. You'll spend some time on it now, but in the long run, you'll save yourself a lot of headache and even more time.
Avatar of ksecor

ASKER

The unescape does't work, I'm convinced it has to be a node value...thank you all