I'm creating AIR application with AS3, Citrus Engine and Starling. Here are two different concepts of creating TextField:
/*
Using native AS3 component.
import flash.text.TextField;
*/
var meaningTitle = new TextField();
meaningTitle.text = 'Meaning';
addChild(meaningTitle);
/*
Using Starling framework.
import starling.text.TextField;
*/
var meaningTitle = new TextField(0, 0, 'Meaning');
addChild(meaningTitle);
By using Starling framework I can't achieve text formatting and other cool features of AS3 TextField. If I creating TextField with native AS3 component and then adding it to the scene I getting this error:
Type Coercion failed: cannot convert flash.text::TextField@37aada9 to starling.display.DisplayObject.
I found one solution, it says I have to use this:
... as DisplayObject
But this solution also doesn't work. Please, help me. All I want is TextField formatting.