Всем привет!
Есть мувиклип чайлд которого есть текстфилд, я рисую им по битмапе.
Пытаюсь установить тексфилду размер шрифта и у меня не получается это сделать. На битмапе рисуется тот, который установлен по умолчанию.
Почему? Есть предположение, что мувиклип которым я рисую не успел изменить своего состояния. Если это так, то как это обойти, если - же нет, то в чем дело?
Ниже представлен код класса унаследованного от мувиклипа и код метода, который собстьвенно и рисует.

Код AS3:
package com.atelecom.components
{
import com.atelecom.model.IndicatorModel;
import flash.display.MovieClip;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;
/**
* Indicator for showing new component.
* Also it used as renderer of indicators in section component.
* @author ....
*/
public class Indicator extends MovieClip
{
private var _shortDescription:TextField;
private var _indicatorPoint:MovieClip;
private var _backgroundRectangle:MovieClip;
private var _model:IndicatorModel;
public function Indicator()
{
this.addEventListener(Event.FRAME_CONSTRUCTED,frameConstuctedEvent);
}
private function frameConstuctedEvent(event:Event):void {
try{
_shortDescription = this["shortDescription"] as TextField;
_indicatorPoint = this["indicatorPoint"] as MovieClip;
_backgroundRectangle = this["backgroundRectangle"] as MovieClip;
}catch (e:Error) {
trace(e);
}finally {
this.removeEventListener(Event.FRAME_CONSTRUCTED,frameConstuctedEvent);
}
}
public function set indicatorPointScale(scale:Number):void {
this._indicatorPoint.scaleX = scale;
this._indicatorPoint.scaleY = scale;
}
public function set model(_model:IndicatorModel):void {
this._model = _model;
this._shortDescription.text = _model.shortInfo;
this._indicatorPoint.gotoAndPlay(_model.state);
trace("short description:",_shortDescription.text);
}
/**
* This method needs to specify text format of short info label
* @return text format of short info information.
* */
public function get shortInfoTextFormat():TextFormat {
return _shortDescription.getTextFormat();
}
public function set shortInfoTextFormat(textFormat:TextFormat):void {
_shortDescription.setTextFormat(textFormat);
}
}
}
Вот это метод, которым я рисую по битмапе.
_indicator - объект типа Indicator

Код AS3:
/**
* Draw indicators
* */
private function drawIndicators():void {
var indicatorModels:Dictionary = _sectionModel.indicatorsDictionary;
var sizeOfIndicatorsTable:int = Math.ceil(Math.sqrt(_sectionModel.numOfIndicators)) as int;
var shiftX:Number = _sectionBitmapWidth / sizeOfIndicatorsTable;
var shiftY:Number = _sectionBitmapHeight / sizeOfIndicatorsTable;
var coordsMatrix:Matrix = new Matrix();
var line:int = 0;
var column:int = 0;
_indicator.indicatorPointScale = SetParameters.countIndicatorPointScale(_sectionModel.numOfIndicators);
_indicator.shortInfoTextFormat = new TextFormat("Arial",20,0xFFFFFF,true,true,true);
for each (var indicatorModel:IndicatorModel in indicatorModels) {
var indicatorX:Number = shiftX / 2 + line * shiftX;
var indicatorY:Number = shiftY / 2 + column * shiftY;
line++;
if (line >= sizeOfIndicatorsTable) {
line = 0;
column++;
}
_indicator.model = indicatorModel;
coordsMatrix.tx = indicatorX;
coordsMatrix.ty = indicatorY;
_bitmapData.draw(_indicator,coordsMatrix);
}
}