# Special characters within Actionscript

**URL:** <https://forum.kirupa.com/t/special-characters-within-actionscript/65960>\
**Category:** Uncategorized\
**Created:** [September 30, 2004, 11:06pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960 "2004-09-30T23:06:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![emolen](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@emolen](https://forum.kirupa.com/u/emolen)\
**Post date:** [September 30, 2004, 11:06pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/1 "2004-09-30T23:06:16Z")

</div>

Ok so i’ve searched through the forums and only found hints on special characters when loading text from an external source like mysql or php, however my problem seems different because I can’t get those solutions to work. I simply want to add quotes around a portion of text that is in the actionscript being loaded with a createTextField. If i use the Qoutes themselves they interfere by breaking up the text since the loaded text is specified by “whatever the text is”;  
and I tried things like &qout; %22 and " but none of them read correctly. I also tried adding the  
System.useCodePage=true;  
script but wasn’t quite sure where to pt it but no matter where I did try it didn’t seem to work

hopes this makes sense

also for some reason I can’t get multiline=true; to work and am having to use  
for every line break. Exhausting when formatting many paragraphs of text. any hints on either would be greatly appreciated  
Cheers!  
erok

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 11:10pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/2 "2004-09-30T23:10:59Z")

</div>

post your PHP code… I’ve solved most issues around HTML and other encoding issues… usually it’s a simple $str = encode(utf8($str)); command or some such

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 11:18pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/3 "2004-09-30T23:18:39Z")

</div>

sorry, no php involved  
it’s all actionscript  
\_root.createTextField(“tfNewfield2”, 2, 0, 0, 416, 160);  
\_root.tfNewfield2.text = “my text yada yadada but then I want to quote something “like this” and then end”;

but the qoutes breake the code  
hope this makes sense

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 11:34pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/4 "2004-09-30T23:34:39Z")

</div>

anyone???  
:{ \< that’s a sad seal, obviuosly bored and waiting, well I’ll move on and be back in a minute.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 11:35pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/5 "2004-09-30T23:35:57Z")

</div>

owww it replaced it with a smilly???  
didn’t know there were quick keys for smilies

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 30, 2004, 11:49pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/6 "2004-09-30T23:49:21Z")

</div>

obvious question… but after creating the textfield, did you remember to set htmlText to true? then use " in your text… umm why are you creating a text box with BUILT in text? why not just use a static text box? I can’t imagine it adds alot to file size…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 4:41pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/7 "2004-10-01T16:41:21Z")

</div>

ok, back to the basics.  
I tried what you suggested, again, but I didn’t get any result. Maybe I’m putting the code in the wrong place?? but I tried multiple different arrangements out of frustration and still didn’t get a result I was looking for. The reason I am doing this is because there is no need to load it externally since it won’t change, but I want to be able to format the text’s color and and use italics etc. Creating text boxes dynamically is the only way I could figure it out. I realize this might be simple for you but I just can’t get the " to work. I’m using an imbeded font that was added to the library so that the font could be of my choice as well, and I am sure that the font has a “”" characters, but maybe it has to do with somthing along those lines. I’m stumped. Any suggestions.  
Any help is greatly appreciated and I hope I don’t sound like a rambling fool, but I’m fed up because I feel like I have tried it all, and I just can’t get it to read the " as html text. AAAHHHHHHH

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 6:20pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/8 "2004-10-01T18:20:25Z")

</div>

Hi  
Based from your

> \_root.createTextField(“tfNewfield2”, 2, 0, 0, 416, 160);

I would add the textfield property of multiline and htmlText like

\_root.createTextField(“tfNewfield2”, 2, 0, 0, 416, 160);  
\_root.tfNewfield2.multiline = true;  
\_root.tfNewfield2.wordWrap = true;  
\_root.tfNewfield2.html = true;  
var tryThis = ‘\<p\>my text yada yadada but then I want to quote something "like this" and then end\</p\>’;  
\_root.tfNewfield2.htmlText = tryThis;

\_root.tfNewfield2.property = Pick a property( The properties appear in the following

order: variable, text, htmlText, html, textWidth, textHeight, maxChars, borderColor,

backgroundColor, textColor, border, background, wordWrap, password, multiline, selectable,

scroll, hscroll, maxscroll, maxhscroll, bottomScroll, type, embedFonts, restrict, length,

tabIndex, autoSize.)

More info online at

[http://livedocs.macromedia.com/flash/mx2004/main\_7\_2/wwhelp/wwhimpl/js/html/wwhelp.ht](http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.ht)

m?href=Part\_ASLR.html

[http://livedocs.macromedia.com/flash/mx2004/main\_7\_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash\_MX\_2004&file=00000238.html](http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00000238.html)

and you may want to use the textfield Stylesheet to load other properties  
[http://livedocs.macromedia.com/flash/mx2004/main\_7\_2/wwhelp/wwhimpl/js/html/wwhelp.ht](http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/js/html/wwhelp.ht)

m?href=Part\_ASLR.html

Hope that helps point you in the right direction  
Findal  
[www.fndzinz.com](http://www.fndzinz.com)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 6:30pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/9 "2004-10-01T18:30:22Z")

</div>

OK, just waiting.  
hope a the fish’ns a goin a well.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 6:52pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/10 "2004-10-01T18:52:49Z")

</div>

There, NOW the code works  
🙂  
Fishin’s Great!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 6:57pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/11 "2004-10-01T18:57:56Z")

</div>

posting some code could help… what I really don’t get is the dynamic part (yet), you want to format the text, on the fly? based on a users input? or you want to be able to swap CSS, later? it seems like the easiest way to do this, is to make it an external file (I know you said it won’t change) but if coding it inside the AS causes issues with display, then use Flash’s built in error correction for external loading… I think you’re making the problem harder than it has to be… plus it can’t really hurt having it external, cause maybe, just maybe you will need to change it…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 1, 2004, 7:11pm UTC](https://forum.kirupa.com/t/special-characters-within-actionscript/65960/12 "2004-10-01T19:11:54Z")

</div>

took a quick look at it. Seems like it should work, but real bussy all of a sudden trying to get something else out so I’ll have to come back to it, but thanks for the help. Greatly appreciated, it definatly points in the right direction, and in the future I probably will just use external text no matter what. Oh and when I mentioned dynamic I just meant that it wasn’t static, but that’s probably using the wrong tech verbage as I was being to vague. Sorry for the confusion.  
thanks again,  
give a man a fish and feed him for a day  
teach a man to fish and he’ll never go hungry, or something like that.  
erok
