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?
Adobe Flash

Avatar of undefined
Last Comment
ksecor

8/22/2022 - Mon
Antonio Estrada

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

ASKER
ksecor

Don't think I can do that in an attribute...            
<client name="<![CDATA[20 · 21 Restaurant & Bar]]">
ASKER CERTIFIED SOLUTION
Antonio Estrada

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
julianopolito

Try using unicode as follows:

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

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



Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER
ksecor

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
julianopolito

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
yarunii

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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
ksecor

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