I have a custom renderer based on canvas that has the following
setters:
public function set trainId(value:String):void
{
_trainId = value;
}
public function get trainId():String
{
return _trainId;
}
public function set highlightCurrentHour(value:String):void
{
_backgroundColor = value;
}
public function get highlightCurrentHour():String
{
return _backgroundColor;
}
public function set xmlModelData(value:XML):void
{
_xmlModelData = value;
}
public function get xmlModelData():XML
{
return _xmlModelData;
}
then I have:
override protected function commitProperties():void
{
super.commitProperties();
assignBlocks(xmlModelData, trainId, highlightCurrentHour);
}
and
public function assignBlocks(xmlModelData:XML, trainId:String,
highlightCurrentHour:String):void
{
callLater(trainDepartGrid.assignBlocks, [trainId,
xmlModelData, highlightCurrentHour]);
trainDepartGrid.width = xmlModelData.trainshours.(train_id ==
trainId).setwidth;
callLater(trainReceivingGrid.assignCars, [trainId,
xmlModelData, highlightCurrentHour]);
trainReceivingGrid.width = xmlModelData.trainshours.(train_id
== trainId).setwidth;
}
I am setting these properties on this renderer like this:
ClassFactory(codeDestinationRenderer).properties =
{trainId:prop.train_id, highlightCurrentHour:bBackgroundColor,
xmlModelData:xmlModelData};
My question is:
Is commitProperties is a right place to call assignBlocks?
Before I changed my code to this version the program worked much
better though.
Please help.
Thanks