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
Related
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
I am trying to simulate button click with event change. It works well but when i type a character in textbox, it calculates. I cant type the word. How can i fix this.
stage.addEventListener(Event.CHANGE, autohesap);
function autohesap(event:Event) {
hesapla_btn.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
TextField dispatches the Event.CHANGE every time it's contents are changed (e.g. a new character is entered). As you're adding the Event.CHANGE listener to the stage, the stage is going to pick up all the events of type CHANGE, including the one dispatched by your TextField. I'm not sure if this is the behaviour you're looking for?
If it is, and you "cant type the word", then it looks like it's because your autohesap is changing the stage.focus - when you click on a TextField to write in it, stage.focus is set to the TextField in question - if you manually set stage.focus = null, then the TextField will be deselected and you won't be able to type into any more, until you click it again.
Create a container object to hold all of the 'changeable' objects as children. But leave the textfield out of the container's 'family.' You can still position the textfield anywhere but its events will bypass the container, which will 'hear' events only in itself or its children.
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.
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.
In AS3 I have a button on the stage and above it I create a textbox box dynamically with code.
My problem is that the area that is under the text (i.e. that part of the button) is no longer clickable.
I have set:
tBox.selectable = false;
but that doesn't solve it.
Any ideas
Season greetings,
Luben
Use InteractiveObject.mouseEnabled:
textField.mouseEnabled=false;
If you set component.visible to false it does not interact with the user.
So, if you set tBox.visible = false then it will be invisible and the button will become clickable. Just a thought, but overlapping components is really bad UI design. If you have space on your stage, you should consider keeping them separate
The problem is that text field (despite it's transparent) is lying over button. To make click on button possible you have to be sure that button is in front of text. Take a look at AddChildAt method of DisplayObject. Objects with greater position index are lying over objects with lower position index. So all you need is to make sure that button has greater index:
container.addChildAt(button, 1)
...
container.addChildAt(text, 0)
P.S.: you may embed button dirrectly into text field using html <a href="javascript:..."><img src="link_to_image"><a/> or something like that.