Setting text on non existing elements

#1
Hello guys, I'm trying to set the text value using SetData but I'm finding a problem. If all elements that are being set are present on frame 1 the template compile correctly, but if there are any elements that appear after frame 1 then the template does not compile.

How can I set the values for these elements?

This it the code I'm using:

Code: Select all

 package
{
	import se.svt.caspar.template.CasparTemplate;
	import flash.events.*;
	import flash.net.*;

	public class Test06 extends CasparTemplate
	{
		public var sPlaceCode:String = ""; 
		public var sLanguage:String;
		public var pathToXML:String = "D:\\SVN\\AndySystem\\server\\data\\";
		public var cityData_xml:XML;
		
		public var xmlLoader:URLLoader = new URLLoader();
			
		public function Test06()
		{
		}
		
		override public function preDispose():void
		{
		}
		
		override public function SetData(xmlData:XML):void
		{	
				MainProduct.FirstElement.Year.xtxt.text = "Text goes here";
		}
		
      		override public function postInitialize():void
		{
		}
	}
}
Thanks

PS: I'm using AcrobatCC and Flash templates.