You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by bgoldnyxnet <Ba...@ca.rr.com> on 2014/02/14 02:53:51 UTC

How do I put character entities into my text control

I'm compiling a project that includes a script that controls the game
progress.  The simplest way I could figure out of putting the script where
it can be processed at runtime was to store it in a non-displayed mx:Text
control.

But my text includes character entities like &nbsp; and the compiler doesn't
like that:
C:\home\barry\flex\GHens\src\GHens.mxml(69): col: 11 Error: The entity
"nbsp" was referenced, but not declared.

What is the magic spell for putting a non-breaking space (and other
character entities I may want, like &mdash;) into a text control?



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/How-do-I-put-character-entities-into-my-text-control-tp4975.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: How do I put character entities into my text control

Posted by Alex Harui <ah...@adobe.com>.
I'm not sure that works in MXML.  It is standard XML, not XHTML.

Try using the number format instead.  See [1]

[1] 
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_referenc
es

On 2/13/14 5:53 PM, "bgoldnyxnet" <Ba...@ca.rr.com> wrote:

>I'm compiling a project that includes a script that controls the game
>progress.  The simplest way I could figure out of putting the script where
>it can be processed at runtime was to store it in a non-displayed mx:Text
>control.
>
>But my text includes character entities like &nbsp; and the compiler
>doesn't
>like that:
>C:\home\barry\flex\GHens\src\GHens.mxml(69): col: 11 Error: The entity
>"nbsp" was referenced, but not declared.
>
>What is the magic spell for putting a non-breaking space (and other
>character entities I may want, like &mdash;) into a text control?
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/How-do-I-put-character-enti
>ties-into-my-text-control-tp4975.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: How do I put character entities into my text control

Posted by bgoldnyxnet <Ba...@ca.rr.com>.
Okay, that seems to have fixed one problem.  I'll try ant and see if it fixes
the next one.

But as a follow-up, can anybody think of a better way to get some multi-line
text into a Flex program?  Is <mx:Text><mx:text>...</mx:text></mx:Text>
really the best way, or is there a better way that I haven't spotted.

If this were PHP, I'd just quote the whole thing.  But the PHP way has its
own disadvantages -- like the ability to have whole chunks of your program
simply disappear if you leave off a close quote, so I can hardly fault Adobe
for choosing  the more common/conventional rule that a string has to all be
on one line.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/How-do-I-put-character-entities-into-my-text-control-tp4975p4980.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.