Dynamic Image Error 1085

Hi guys! I tried to make an template with dynamic images (UILoader) and get this error response from the caspar server. I checked the file path to the flags but this is the right one. The UiLoader is called “Image1A” and “Image1B”.

[2023-06-17 21:39:25.631] [info] Received message from 127.0.0.1: CG 1-20 ADD 1 “MatchID” 1 "<componentData id="fTeamA"><data id="text" value="GERMANY"/><componentData id="Image1A"><data id="text" value="file:///E:/test/casparcg/template/flags/GER.png"><componentData id="fTeamB"><data id="text" value="NORTH MAZEDONIA"/><componentData id="Image1B"><data id="text" value="file:///E:/test/casparcg/template/flags/NMD.png">\r\n
[2023-06-17 21:39:25.654] [warning] flash-player[cg20.fth.1080p5000|1920x1080] Flash call failed:TypeError: Error #1085
[2023-06-17 21:39:25.655] [info] Sent message to 127.0.0.1:202 CG OK\r\n

This is my AS file:

package
{
	import flash.display.MovieClip;
	import se.svt.caspar.ICommunicationManager;
	import se.svt.caspar.IRegisteredDataSharer;
	import se.svt.caspar.template.CasparTemplate;
      
	public class flags extends CasparTemplate
	{
		private const customParameterDescription:XML = 	
		<parameters>
	   		<parameter id="Image1A" type="string" info="File URL for Flag Home" />
	   		<parameter id="Image1B" type="string" info="File URL for Flag Guest" />
		</parameters>;
		
		override public function SetData(xmlData:XML):void 
		{			
		   for each (var element:XML in xmlData.children())
		   {
			  if (element.@id == "Image1A") 		
			  {
				  Image1A.source = element.data.@value.toString();
			  }
			  if (element.@id == "Image1B") 		
			  {
				  Image1B.source = element.data.@value.toString();
			  }
		   }
		   super.SetData(xmlData);		
		}
	}
}

Any ideas? Thanks!

Hi, I don’t know if this has anything to do with your issue, but it looks like you’re sending data with unescaped quotes, therefore Caspar probably just sees “<componentData id=” from the data.

Thanks but Caspar can see everything. I checked it in the Server Console.

The command sent is:

cgserver.sendCommand("CG 1-20 ADD 1 " + "\"MatchID\"" + " 1 " + "\"<templateData>" +
                    "<componentData id=\\\"fTeamA\\\"><data id=\\\"text\\\" value=\\\"" + labelTeamA.Text.ToUpper() + "\\\"/></componentData>" +
                    "<componentData id=\\\"Image1A\\\"><data id=\\\"text\\\" value=\\\"" + "file:///E:/testt/casparcg/template/flags/" + FlaggeTeamA + ".png\\\"></componentData>" +
                    "<componentData id=\\\"fTeamB\\\"><data id=\\\"text\\\" value=\\\"" + labelTeamB.Text.ToUpper() + "\\\"/></componentData>" +
                    "<componentData id=\\\"Image1B\\\"><data id=\\\"text\\\" value=\\\"" + "file:///E:/testt/casparcg/template/flags/" + FlaggeTeamB + ".png\\\"></componentData>" +
                    "</templateData>");

… and the whole error message from the server:

[2023-06-19 20:07:35.252] [info]    Received message from 127.0.0.1: CG 1-20 ADD 1 "MatchID" 1 "<templateData><componentData id=\"fTeamA\"><data id=\"text\" value=\"GERMANY"/></componentData><componentData id=\"Image1A\"><data id=\"text\" value=\"file:///E:/testt/casparcg/template/flags/GER.png\"/></componentData><componentData id=\"fTeamB\"><data id=\"text\" value=\"NORTH MAZEDONIA"/></componentData><componentData id=\"Image1B\"><data id=\"text\" value=\"file:///E:/testt/casparcg/template/flags/NMD.png\"/></componentData></templateData>\r\n
[2023-06-19 20:07:35.285] [warning] flash-player[cg20.fth.1080p5000|1920x1080] Flash call failed:<exception>TypeError: Error #1095</exception>

Next thing that is coming to my mind is that in this guide Guide: Loading Dynamic Images in a Flash Template · CasparCG/help Wiki · GitHub the parameter id is different from the name of the image object. In your mutation those two are the same words (Team1Image and Image1.source in guide, Image1A and Image1A.source in your code). Could this maybe cause the problem?

In the guide, that you mentioned, “Image1” ist the instance name of the UILoader object. “Team1Image” is the name of the variable. They can be the same or totally different. the description of error 1085 reads "The element type "%S" must be terminated by the matching end-tag "". what does not make too much sense to me. It also says “TypeError”. So let’s check the following:

  • Is the instance name of the UILoader really “Image1A”?

  • Ist there the UILoader inside a MovieClip? If yes the instance name of the MovieClip needs to be add, like MovieClipName.Image1A.source = ...

  • Any other spelling errors?

If everything is checked and the error still exists: Can you upload the whole thing (.fla and .as file) somewhere, so that I can check it?

[2023-06-19 20:07:35.252] [info]    Received message from 127.0.0.1: CG 1-20 ADD 1 "MatchID" 1 "<templateData><componentData id=\"fTeamA\"><data id=\"text\" value=\"GERMANY"/></componentData><componentData id=\"Image1A\"><data id=\"text\" value=\"file:///E:/testt/casparcg/template/flags/GER.png\"/></componentData><componentData id=\"fTeamB\"><data id=\"text\" value=\"NORTH MAZEDONIA"/></componentData><componentData id=\"Image1B\"><data id=\"text\" value=\"file:///E:/testt/casparcg/template/flags/NMD.png\"/></componentData></templateData>\r\n
[2023-06-19 20:07:35.285] [warning] flash-player[cg20.fth.1080p5000|1920x1080] Flash call failed:<exception>TypeError: Error #1095</exception>

Double quote on the name is not scaped like

value=\"NORTH MAZEDONIA"

should be
value=\"NORTH MAZEDONIA\"

1 Like