Android, backspace doesn't work properly in a flash.text.TextField
Hello,
I have a bug on my Nexus 5 Android 4.4 Air 4.0.
when I scroll the text in the textField and I select the text (in my example near "subclass" word), the TextField get focus, if I put on the backspace key, the character deleted is the previous character the first time, and if I put again on the backspace key, the caracter deleted is the first character and not the previous character.
package{
import flash.text.TextField;
import flash.display.Sprite;
import flash.events.Event;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
public class Main extends Sprite {
private var myTextField:TextField = new TextField();
public function Main() {
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(event:Event):void {
myTextField.type="input";
myTextField.text="The TextField class is used to create display objects for text display and input. You can give a text field an instance name in the Property inspector and use the methods and properties of the TextField class to manipulate it with ActionScript. TextField instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel.\nTo create a text field dynamically, use the TextField() constructor.\n\nThe methods of the TextField class let you set, select, and manipulate text in a dynamic or input text field that you create during authoring or at runtime.\n\nActionScript provides several ways to format your text at runtime. The TextFormat class lets you set character and paragraph formatting for TextField objects. You can apply Cascading Style Sheets (CSS) styles to text fields by using the TextField.styleSheet property and the StyleSheet class. You can use CSS to style built-in HTML tags, define new formatting tags, or apply styles. You can assign HTML formatted text, which optionally uses CSS styles, directly to a text field. HTML text that you assign to a text field can contain embedded media (movie clips, SWF files, GIF files, PNG files, and JPEG files). The text wraps around the embedded media in the same way that a web browser wraps text around media embedded in an HTML document.\n\nFlash Player supports a subset of HTML tags that you can use to format text. See the list of supported HTML tags in the description of the htmlText property.\n\nView the examples\n\nMore examples\n\nModifying the text field contents\nDisplaying HTML text\nUsing images in text fields\nScrolling text in a text field\nSelecting and manipulating text\nCapturing text input\nRestricting text input\nFormatting text\nWorking with static text\nTextField Example: Newspaper-style text formatting\nLearn more\n\nUse native features with a soft keyboard\nDisplay programming\nBasics of display programming\nCore display classes\nChoosing a DisplayObject subclass\nBasics of Working with text\nUsing the TextField class\nDisplaying text\nAdvanced text rendering\nRelated API Elements\n\nflash.text.TextFormat\nflash.text.StyleSheet\nhtmlText\n\nPublic Properties\n Show Inherited Public Properties\n Property Defined By\n alwaysShowSelection : Boolean\nWhen set to true and the text field is not in focus, Flash Player highlights the selection in the text field in gray.\nTextField\n antiAliasType : String\nThe type of anti-aliasing used for this text field.\nTextField\n autoSize : String\nControls automatic sizing and alignment of text fields.\nTextField\n background : Boolean\nSpecifies whether the text field has a background fill.\nTextField\n backgroundColor : uint\nThe color of the text field background.\nTextField\n border : Boolean\nSpecifies whether the text field has a border.\nTextField\n borderColor : uint\nThe color of the text field border.\nTextField\n bottomScrollV : int\n[read-only] An integer (1-based index) that indicates the bottommost line that is currently visible in the specified text field.\nTextField\n caretIndex : int\n[read-only] The index of the insertion point (caret) position.\nTextField\n condenseWhite : Boolean\nA Boolean value that specifies whether extra white space (spaces, line breaks, and so on) in a text field with HTML text is removed.\nTextField\n defaultTextFormat : flash.text:TextFormat\nSpecifies the format applied to newly inserted text, such as text entered by a user or text inserted with the replaceSelectedText() method.\nTextField\n displayAsPassword : Boolean\nSpecifies whether the text field is a password text field.\nTextField\n embedFonts : Boolean\nSpecifies whether to render by using embedded font outlines.\nTextField\n gridFitType : String\nThe type of grid fitting used for this text field.\nTextField\n htmlText : String\nContains the HTML representation of the text field contents.\nTextField\n length : int\n[read-only] The number of characters in a text field.\nTextField\n maxChars : int\nThe maximum number of characters that the text field can contain, as entered by a user.\nTextField\n maxScrollH : int\n[read-only] The maximum value of scrollH.\nTextField\n maxScrollV : int\n[read-only] The maximum value of scrollV.\nTextField\n mouseWheelEnabled : Boolean\nA Boolean value that indicates whether Flash Player automatically scrolls multiline text fields when the user clicks a text field and rolls the mouse wheel.\nTextField\n multiline : Boolean\nIndicates whether field is a multiline text field.\nTextField\n numLines : int\n[read-only] Defines the number of text lines in a multiline text field.\nTextField\n restrict : String\nIndicates the set of characters that a user can enter into the text field.\nTextField\n scrollH : int\nThe current horizontal scrolling position.\nTextField\n scrollV : int\nThe vertical position of text in a text field.\nTextField\n selectable : Boolean\nA Boolean value that indicates whether the text field is selectable.\nTextField\n selectionBeginIndex : int\n[read-only] The zero-based character index value of the first character in the current selection.\nTextField\n selectionEndIndex : int\n[read-only] The zero-based character index value of the last character in the current selection.\nTextField\n sharpness : Number\nThe sharpness of the glyph edges in this text field.\nTextField\n styleSheet : StyleSheet\nAttaches a style sheet to the text field.\nTextField\n text : String\nA string that is the current text in the text field.\nTextField\n textColor : uint\nThe color of the text in a text field, in hexadecimal format.\nTextField\n textHeight : Number\n[read-only] The height of the text in pixels.\nTextField\n textInteractionMode : String\n[read-only] The interaction mode property, Default value is TextInteractionMode.NORMAL.\nTextField\n textWidth : Number\n[read-only] The width of the text in pixels.\nTextField\n thickness : Number\nThe thickness of the glyph edges in this text field.\nTextField\n type : String\nThe type of the text field.\nTextField\n useRichTextClipboard : Boolean\nSpecifies whether to copy and paste the text formatting along with the text.\nTextField\n wordWrap : Boolean\nA Boolean value that indicates whether the text field has word wrap.\nTextField";
myTextField.border=true;
myTextField.width=myTextField.height=300;
addChild(myTextField);
}
}
}
Thanks.
