How to change the cursor when over TLF text? - actionscript-3

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

Related

How can I align label of a button component

I have a button component on my scene. But when I set labelPlacement to left, it can't do that. How can I fix this?
From what I understand and have read about the labelPlacement property is that it works in conjunction with the use of an icon within the button, not to necessarily change the position of the text in relation to the button boundary.
Here is some text that documents this from the Adobe Website:
If you are using an icon with a Button instance, you can control the placement of the text label, relative to the icon, by setting the labelPlacement property using one of the constants from the ButtonLabelPlacement class (fl.controls.ButtonLabelPlacement). For more information on working with button icons, see Setting icons.
Source: http://www.adobe.com/devnet/flash/quickstart/button_component_as3.html
Additional sources: http://www.adobe.com/devnet/flash/quickstart/button_component_as3.html#articlecontentAdobe_numberedheader_6
However, a hackish way of moving the text to the left would be to add spaces to the right of the string. Currently, empty spaces at the start or end of the label are not auto trimmed. Here is an example of what I am talking about:
import fl.controls.Button;
var myButton:Button = new Button();
myButton.label = "Click me ";
addChild(myButton);
I tested the code shown above in Flash CC 2014 and the text looked like it was left aligned, when it really wasn't because of the additional spaces added to the end of label.
It is worth mentioning that I also experiemented with the textField property of the Button class to see if the autoSize or setTextFormat functionality could be used to left align the text, and those all failed.

AS3 - Removing the blinking cursor in text field

Can I remove this blinking cursor from a textfield?
Thanks,
Not in a INPUT Textfield.
You can still use some ticks with a Dynamic textfield which listens to KEY_UP events, but you'll have to do all the things by yourself (delete, home key, end key...), and you can forget about things like copy/paste, undo, mouse selection...
It's a tricky way. What can also work, is hide the textfield by setting its textcolor to the background color (so you won't see the cursor), or set its alpha to 0, then copy the text into another dynamic text field on KEY_UP events. Still, it's quite a hack.
Good luck.

How to Change Text Cursor Color of Text Input Flex 4?

I want to change the blinking text cursor color of Text Input in Flex 4...
How can I change it ?
Is there any way to handle it, or it can be only controlled by Flash Player ???
I had a similar question about this a while ago. I never found a way to update the actual cursor, so I got creative with the solution. My solution was to have two textfields stacked. One input field on top of a dynamic field.
Set the alpha of the input field to 0. Then, add a CHANGE event listener to the input field. In the handler, update the dynamic field and reposition your cursor based on the textWidth.
Not ideal, but it did the job.
I had solved this problem,
Actually there was a problem in skinning of text input.
If we set textinput skin's richeditabletext's alpha to 75 or some down value, flash player makes cursor color white itself.
So by increasing that alpha value, I got the cursor color black.
I change the TextField.textColor = OxFFFFFF, the cursor changes into white as well. Works for my case when I need the same color for the blinking cursor and text.

how to keep selected highlight

The process is like this as below.
a user choose some text and make selection on it. then it's gonna be highlighted.
the user move her mouse focus on the textbox on the html.
the highlight on the text in the html is still there.
If the user move her mouse back to the text, click somewhere on the text zone, the highlight would be gone.
The user can make another new highlight.
Here's my question.
Can I keep the highlight even though I change the focus on other object from text in the html?
I don't want to use span for it since if I want to make new highlight, it's tedious to move the span back out. Is there another way?
Try this: http://rangy.googlecode.com/svn/trunk/demos/highlighter.html?serializedHighlights=

Actionscript 3.0 TextField cursor change when above TextField

My scene has a TextField object.
I set up my TextField as DynamicText because I need to change it programmatically.
How do I prevent mouse cursor change to I-Beam form when it's above TextField?
Also, user of my flash application is able to select text of this TextField using mouse cursor. I would like to disable this behavoiur too.
In the TextField properties panel, there is an icon that reads "Selectable", you need to uncheck it, and you will disable both.
EDIT: The icon is right below the "Anti-Alias" drop down, first in row. There is a Ab (the b is selected/highlighted) inside.
If you want to do this by ActionScript, the code is:
myTextField.selectable = false;
Hope this helps!
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html?filter_flash=cs5&filter_flashplayer=10.2&filter_air=2.6
You are looking for the property selectable