В любом месте тестового проекта
(например евент initialize)

Код:
var tf:TextField = new TextField();
tf.text = "Hello Hello";
var format1:TextFormat = new TextFormat();
format1.color = 0xFF0000;
var format2:TextFormat = new TextFormat();
format2.font = "Courier";
tf.setTextFormat(format1);
var startRange:uint = 6;
tf.setTextFormat(format2, startRange);
addChild(tf);
выскакивает ошибка

Код:
Main Thread (Suspended: TypeError: Error #1034: Type Coercion failed: cannot convert flash.text::TextField@2b4d6a9 to mx.core.IUIComponent.)
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild
mx.core::Container/addChildAt
mx.core::Container/addChild
text_test_00/text_test_00::init
text_test_00/___Application1_initialize
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction [no source]
flash.events::EventDispatcher/dispatchEvent [no source]
mx.core::UIComponent/dispatchEvent
mx.core::UIComponent/set processedDescriptors
mx.core::Container/createComponentsFromDescriptors
mx.core::Container/mx.core:Container::createChildren
mx.core::UIComponent/initialize
mx.core::Container/initialize
mx.core::Application/initialize
text_test_00/initialize
mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::childAdded
mx.managers::SystemManager/mx.managers:SystemManager::initializeTopLevelWindow
mx.managers::SystemManager/mx.managers:SystemManager::docFrameHandler
причем примеров таких в хелпе масса
куда бежать? что делать?
весь код теста

Код:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="init()">
<mx:Script>
<![CDATA[
import mx.controls.Text;
private function init():void {
var tf:TextField = new TextField();
tf.text = "Hello Hello";
var format1:TextFormat = new TextFormat();
format1.color = 0xFF0000;
var format2:TextFormat = new TextFormat();
format2.font = "Courier";
tf.setTextFormat(format1);
var startRange:uint = 6;
tf.setTextFormat(format2, startRange);
addChild(tf);
}
]]>
</mx:Script>
</mx:Application>