| Ultrashock Forums
• trying to strip formatting from input text field |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
17 Creative Assets
|
2009-06-28
#2 |
||
|
It sounds as though you are reading the HTML from the text field instead of the plain text. Internally, Flash always uses HTML regardless of the render setting, the render setting simply changes the way the text field content is displayed. Code:
|
|
|
|
2009-06-28
#3 |
||
|
is this version/actionscript version dependent? if I trace myTextField.text, it returns undefined if I trace myTextField, it returns the entry (plus all the HTML formatting) the .text part does have a blue color so it does appear to be a reserved word. var v4:String = "Complaint/history: " + chart_comp_hist.text; trace(chart_comp_hist.text); trace(chart_comp_hist); I input 1234 in the box, and from the trace output: undefined <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#000000" LETTERSPACING="0" KERNING="0">1234</FONT></P></TEXTFORMAT> |
|
17 Creative Assets
|
2009-06-28
#4 |
||
|
Yep, the code is AS version dependent but the code I posted is AS2 so it should be working fine. Are you sure the chart_comp_hist variable is referencing the text field? Running the following code will help: Code:
trace( typeof chart_comp_hist ); |
|
|
|
2009-06-28
#5 |
||
|
I believe it is referencing the text field correctly: trace( typeof chart_comp_hist); returns string trace (chart_comp_hist.text); returns undefined trace (chart_comp_hist); returns the text I input, along with the formatting tags. I create a text input box, then under the Var field in properties subwindow, gave it the name chart_comp_hist. When refering to chart_comp_hist in another scene, it does display the data properly within the flash file. It just gets this formatting text along with the data when I attempt to send the data from the input box to either a url or to an email. |
|
17 Creative Assets
|
2009-06-28
#6 |
||
|
Ok, that is the problem. Instead of giving the text field the variable name "chart_comp_hist" give it the instance name "chart_comp_hist", the chart_comp_hist variable in the code will then reference the actual text field and not the text field content (which is what it is doing at the moment).
|
|
|
|
2009-06-28
#7 |
||
|
ok. I was looking at another discussion on the Adobe forums, and it looks like I should be using the instance field rather than the variable field to avoid this issue. (I will need to look into the difference in use between instance and variable). Creating instance names and refering to them got around the issue. next is trying to figure out how to convert newline to \n or some such ![]() thank you for looking at the problem! |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


6 comments
| 302 views

17 Creative Assets


Linear Mode