Hola lista,
Me estoy rompiendo los cuernos para conseguir embeder una tipografía
y no lo consigo, me lanza este error:
TextoCuerpo__cuerpo.as(9): col: 50 Error: No se encontró la
definición de la clase base FontAsset.
public class TextoCuerpo__cuerpo extends mx.core.FontAsset
Primero pensé que podría ser algún bug de flex sdk 2 y me bajé la
beta 3 pero sigue dando el mismo error
el codigo de la clase es el siguiente:
package {
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
/**
* @author Siroko
*/
public class TextoCuerpo {
[Embed(source="../assets/
akbar.ttf",fontName="cuerpo",mimeType="application/x-font-truetype")]
private var _cuerpo:Class;
private var _textfield:TextField;
private var _formato:TextFormat;
private var _clip:MovieClip;
private var _txt:String;
private var _x:int;
private var _y:int;
private var _width:int;
private var _height:int;
public function TextoCuerpo
(donde:MovieClip,txt:String,x:int,y:int,ancho:int,alto:int){
_clip = donde;
_txt = txt;
_x = x;
_y = y;
_width = ancho;
_height = alto;
setFormat();
setText();
}
private function setFormat():void{
_formato = new TextFormat();
_formato.color = 0x361C0D;
_formato.font = "cuerpo";
_formato.size = 11;
}
private function setText():TextField{
_textfield = new TextField();
_textfield.autoSize = "center";
_textfield.selectable = false;
_textfield.wordWrap = true;
_textfield.height = _height;
_textfield.width = _width;
_textfield.x = _x;
_textfield.y = _y;
_textfield.text = _txt;
_textfield.setTextFormat(_formato);
_clip.addChild(_textfield);
return _textfield;
}
}
}
No sé si existe alguna otra manera de embeder tipografias en as3 con
sdk, estoy usando el plug in para eclipse (FDT). A ver si me podeis
echar una mano.
Saludos.
-----------------------------------------------------
ASNativos
www.5dms.com
subscripciones/desubscripciones
http://asnativos.5dms.com
-----------------------------------------------------