Skip navigation
AnimationWeb
Currently Being Moderated

TLFTextField foucs

Apr 25, 2013 7:34 PM

Tags: #tlftextfield #foucs

import flash.display.Bitmap;

import flash.text.TextField;

import flashx.textLayout.formats.ITabStopFormat;

import flash.net.FileReference;

import flash.text.TextFormat;

import flash.display.Sprite;

import flashx.textLayout.container.ContainerController;

import flashx.textLayout.elements.ParagraphElement;

import flashx.textLayout.elements.SpanElement;

import flashx.textLayout.elements.TextFlow;

import flashx.textLayout.formats.TabStopFormat;

import flashx.textLayout.formats.TextLayoutFormat;

import flash.text.TextField;

import flashx.textLayout.events.TextLayoutEvent;

 

 

 

 

var _tmf3:TextLayoutFormat = new TextLayoutFormat();

_tmf3.fontSize = 10;

_tmf3.fontFamily="Balloon XBd BT"

_tmf3.textAlign = flashx.textLayout.formats.TextAlign.CENTER 

var myTextFlow3:TextFlow = tlf_txt.textFlow;

myTextFlow3.hostFormat = _tmf3;

//stage.focus=this.tlf_txt.controller.container

//trace(tlf_txt.textFlow.interactionManager.focused)

tlf_txt.addEventListener(Event.CHANGE,onChange);

function onChange(e:Event):void

{

          if(tlf_txt.text.length==1)

          {

                    _tmf3.fontSize=70;

          }else if(tlf_txt.text.length==2)

          {

                    _tmf3.fontSize=80;

          }else if(tlf_txt.text.length==3)

          {

                    _tmf3.fontSize=90;

          }else if(tlf_txt.text.length==4)

          {

                    _tmf3.fontSize=90;

          }else if(tlf_txt.text.length==5)

          {

                    _tmf3.fontSize=100;

          }

          myTextFlow3.hostFormat = _tmf3;

}

 

According to this wording TLFTextField foucs myTextFlow3 cursor.But not be selected from the input text

If myTextFlow3.hostFormat = _tmf3; remove the cursor.

How to make the cursor appears, or text can be selected

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points