How to use subscript & superscript in dynamic and input text field
![Search Search](https://i.stack.imgur.com/ietFn.png)
![Input Text As3 Input Text As3](https://www.handyarchive.com/images/scr/116085.jpg)
Issue:
Response to Input Text Field (as3) Dec 14, 2009 1176 means Comparison between a value with static type%s and a possibly unrelated type%s. This error is enabled in strict mode. Means that say you have a string, you may be comparing it to an int, you should compare only similar or exact data types. I have been wanting to use the TEXTINPUT event handler to get hold of the contents of my input text fields, but whenever I have tried to do so, I dont get the full string, instead everything but the last character entered as the TEXTINPUT event seems to trigger as the key is being pressed and so outputs the state of the text before the key press. I have a Character class, one of the properties is sName:String I`m trying to do the following on the main timeline: character. sName = inputTextField.text; By default, inputTextField.text = “un-named” which is because on the stage i wrote that inside, but when I start the swf (ctrl+enter) and change the content of inputTextField, it doesn`t save the newly entered text. ActionScript ® 3.0 Reference for the Adobe. Flash.text TextField - AS3: Properties Properties Constructor Methods. In the following example, the text input's prompt's properties are updated (this example assumes that the prompt text renderer is a TextFieldTextRenderer): input.promptProperties.textFormat = new TextFormat( 'Source Sans Pro', 16, 0x333333 ); input.promptProperties.embedFonts = true; The.
- Unable to use subscript or superscript in dynamic and input text field.
- Unable to display subscript or superscript for external loaded text.
- Unable to use <sub> & <sup> tags in dynamic or input text field.
- To create subscript or superscript text without Text Layout Framework (TLF).
Reason:
<sub> & <sup> tags are not supported by Flash.
TechNote: Subscript and superscript fail in dynamic and input text fields
LiveDocs: Supported HTML tags
Solution:
- Download & install GG Subscript & GG Superscript TrueType fonts. You will need to restart Flash software after installed fonts.
- Create a dynamic text field with Arial font embeded. Set the HTML property to true.
- Create a dynamic text field with GG Subscript font embeded.
- Create a dynamic text field with GG Superscript font embeded.
- Use HTML tag to set text to subscript or superscript like below:
If you are using ActionScript to test the htmlText, use script like below:
Demo:
Input Text Align Center
Download:
superscript.fla
superscript.swf
Updated: (2008-09-21)
A new set of superscript & subscript fonts includes both sans & serif type, with more complete & improved glyphs, standard scale & shift, is now available to be downloaded (free) from here.
Updated: (2010-10-23)
Another set of fonts for displaying square root (SQRT), cube root, nth root, and other roots formula in dynamic and input text field is now available here.
Input Text Attribute
Related:
For creating subscript & superscript text with Text Layout Framework in AS3 or Flex project, refer to here