actionscript 3 - AS3: Embedding characters -


i having trouble textfields , caracter embedding. have understood, way embed character in flash, have textfield in movieclip exported actionscript via classname. have textfield embed characters.

but when try use textfield in project, cannot auto resize field longer!? there better way embed charactes? or missing unknow attribute? (and yes have tried textfield.autosize = "left" (or "center" or "right")).

the textfield configured in flash cs4:
properties: http://screencast.com/t/0vb6knno6g
library implementation: http://screencast.com/t/w3yqlqit0vei

and embed movieclip containing textfield this:

protected var tabname:movieclip = new text(); // property on object 

adding text , setting settings:

var txt:textfield = tabname.txt;          if( !contains(tabname) )         {             addchild(tabname);              var format:textformat = new textformat();                 format.bold = true;                 format.font = "arial";                 format.size = 12;                 format.align = "left";              var dropshadow = new dropshadowfilter(0);                 dropshadow.color = 0xffffff;                 dropshadow.strength = 2;                 dropshadow.blurx = dropshadow.blury = 5;                 dropshadow.alpha = .7;              txt.type = textfieldtype.dynamic;             txt.multiline = tabname.wordwrap = false;             txt.autosize = textfieldautosize.left;             txt.defaulttextformat = format;             txt.filters = [dropshadow];             txt.mouseenabled = false;             txt.x = 10;         }          txt.text = value;         txt.y = math.ceil((tabmask.height - txt.height) /2); 

to embed fonts, don't rely on wrapping them in movieclips in library. should embedded correctly fonts. have included basic steps below embedding fonts, example particular situation:

1 - make textfield dynamic , click embed.. button

enter image description here

2 - name font meaningful (like fonts name) , tick character sets using (usually select caps, lowercase, numbers , punctuation). note style 'bold', need embed font set each style. if want use bold , regular, need embed 2 fonts.

enter image description here

3 - if plan on adding textfields dynamically through actionscript, goto actionscript tab , add class (again, use meaningful name)

enter image description here

4 - click ok, , away go. have setup example, using these steps, , auto size method, can see results below

enter image description here


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -