Copy link to clipboard
Copied
Hello everyone... euhm, i would like to have a "bink caret" (if it's the correct expression), in a textfield "input". Like this (after the "A:") :
but when i search on the net for the "input textfield", it seems difficult.
So, if it's not possible, i thought about a solution, with for example :
a1.text (the input textfield)
levrai.text (the "label" textfield)
when the letters of the keyboard are detected in a1.Text, it's immediately copy in levrai.Text, where we put a "blink cursor", like this :
stage.addEventListener(KeyboardEvent.KEY_UP, keyDownHandler)
function keyDownHandler(ev:KeyboardEvent):void{
levrai.text = a1.text + "â–ˆ";
}
It works... but i don't know to make a blinking caret, like this :
"blablablaâ–ˆ"
"blablabla"
"blablablaâ–ˆ"
"blablabla"
xD like a true old computer screen...
Any ideas, please?
Thanks kglad but the solution with the movieclip seems difficult x)...
but finally i make this : I found and modify a script on the net, and it's works ..
So... I have an input textfield named "a1", a dynamic text field named "levrai", and a small textield named "cl" with a blink symbol inside ( â–ˆ )
When i write a text in the a1.text, it's automatically duplicate in the levrai.text + the super blinking cursor . And then the real cursor is not visible because it's a dynamic textfield... it's cool !!
...Copy link to clipboard
Copied
if you use an input textfield you'll see the default 'bar' cursor indicator.
if you want to use a custom cursor like you indicated, create a blinking cursor movieclip and add it to a movieclip that looks and acts like a textfield. you can use an invisible textfield to capture keyboard input and display that in your movieclip that acts like a textfield.
Copy link to clipboard
Copied
Thanks kglad but the solution with the movieclip seems difficult x)...
but finally i make this : I found and modify a script on the net, and it's works ..
So... I have an input textfield named "a1", a dynamic text field named "levrai", and a small textield named "cl" with a blink symbol inside ( â–ˆ )
When i write a text in the a1.text, it's automatically duplicate in the levrai.text + the super blinking cursor . And then the real cursor is not visible because it's a dynamic textfield... it's cool !!
var m:String = "";
var mBlink:String = "â–ˆ";
var numOfBlinks:Number = 0; //5;
var speedBetweenBlinks:Number = 400;
var blinkOn:Boolean = false;
var t:Timer = new Timer(speedBetweenBlinks,0);
t.addEventListener(TimerEvent.TIMER, setBlink);
t.start();
function setBlink(e:TimerEvent):void{
if(blinkOn)
{ cl.text = m;
blinkOn = false;
levrai.text = a1.text + cl.text;
} else {
cl.text = mBlink;
blinkOn = true;
levrai.text = a1.text + cl.text;
}
}
but it give me another question that i will write in another subject, about focus... because in my project, a1.text is not "visible" finally ; i will see it later...