Adobe AIR softKeyboardBehavior auto-pan - actionscript-3

I have an Adobe AIR mobile app with many editable text fields, some of which get partially covered up by the soft keyboard when it opens. I am trying to take advantage of the "pan" softKeyboardBehavior, which causes the screen to automatically pan so the text is above the keyboard.
However, this always scrolls so that the line of text containing the cursor is immediately above the keyboard. In other words, if I have a 7-line textfield and the user taps the top line, the other 6 lines will be covered by the keyboard, making editing the text nearly impossible.
Is there any way to adjust how AIR positions the text relative to the keyboard when softKeyboardBehavior is set to "pan"?

Almost immediately after I posted this, I thought about a decent workaround:
private function onSoftKeyboardActivate(event:SoftKeyboardEvent):void {
textField.setSelection(textField.text.length, textField.text.length);
}
This forces the cursor to the end of the text that's already in the textfield, which will scroll the textfield higher. If the number of lines of text is shorter than the length of the textfield, adding new text from the bottom will scroll the screen to make more of the textfield visible.

Related

Actionscript: input text on iOS working differently than in the simulator

I have an input box created in Flash Professional 500px x 500px, set as Classic Text > Input Text > Singleline.
I import this into my Actionscript project and set to
wordWrap = true;
In the simulator this works great.
However on iOS wordwrap does not occur during input. Everything appears on a single line which is in the center of the textbox height, when focus returns to the app the text is then correctly wrapped.
How can I make it work like it does in the simulator.
As a fix I tried using multiline text box.
This does not have the issue above, however it introduces a new issue, on selection of the textbox the cursor appears one line below the top, I have to press backspace to move to the top of the textbox, interestingly the text box has size 0 despite some sort of new line existing. This occurs in the simulator as well as on the device.

How to change the cursor when over TLF text?

With any of the editable text fields such as RichEditableText, TextArea and any TextFlow containers the cursor is always the familiar text entry pipe character with serifs thing. Whatever.
I need to be able to change that to a hand cursor as it moves over an inline graphic image and then revert back to text entry cursor on mouse out.
I've been looking at the CursorManager class but have had no luck yet.
UPDATE:
I found a class FlowElementMouseEventManager that manages the cursor as it moves over a text flow container. It's not clear how to change the cursor to a hand cursor yet but the LinkElement will change to a hand cursor when the mouse is over it and the CTRL is held down.
Set buttonmode = true for that inline graphic image and you are good to go

Text not appearing on textfield

To appear softkeyboard for android app i written textfield.needsSoftKeyboard = true and onclick on textfield call textfield.requestSoftKeyboard() method. keyboard is appearing..but the problem is text is not appearing on textfield...
It would make sense if you could post the code snippet here for further investigation. Other than that, it might be that your textfield loses focus for some reason so you may get your issue resolved by calling "stage.focus = textfield;". It could also be the case that there is a problem with font embedding or styles (e.g. white text on white background). Make sure the textfield shows text at all by passing a prefilled text to it. There is currently also a bug, where Chinese and Japanese chars cannot be displayed on some Android devices (https://bugbase.adobe.com/index.cfm?event=bug&id=3839647).
Problem is textfield loses focus.Finally I got solution.We have to set Focus for that tlf textfield like this.txtField.textFlow.interactionManager = new EditManager();
txtField.textFlow.interactionManager.selectRange(0, 0);
txtField.textFlow.interactionManager.setFocus();

Strange Chrome rendering text in textbox issue

As you can see in this image I have a text box, when the user click on the textbox and starts typing the placeholder disappears and you begin typing. Although what ever you type on the first line, the text renders in a strange way.
If you look closely at the screen shot you can see white lines around the g and also along the line, these disappear once you drop down a line so is it something to do with the placeholder?
See it in action here
http://joshhornby.co.uk/typewriter/

HTML5: make an editable textzone draggable with no side-effect?

I'am currently working on a web application in which I would have a page with a list of editable text areas and I would like to be able to change their order, simply by dragging and dropping each text area in the wanted position.
Basically, each of these text areas would come nested in , like this:
<div class="outsideDiv">
<div>
<textarea>
</textarea>
</div>
</div>
As I was trying to implement Drag and Drop feature using native HTML5 "draggable" attribute (more precisely, I put it as attribute of my most outside ), I noticed that would make my text areas draggable but also yield a side effect: whenever I click in the text area, it would, the typing cursor would always be at position 0. Thus, it is then impossible to move the cursor to another position, which is not that handy in case you want to edit an existing text.
So my question is, how could I make a text area draggable while keeping all of its features (I mean, without the mentioned side-effect)?
Have a look at the draggable effect in jQuery-ui (http://jqueryui.com/demos/draggable/)