Hi,
I’m trying to send an INVOKE comand to one of the templates, if I send play it’s ok but if I send an invoke appears undefined.
Here is the output from the server:
[2019-07-22 01:22:27.950] [info] Received message from 127.0.0.1: CG 1-20 ADD 1 CLOCK “0” “<componentData id=“gameTime”><data id=“text” value=“00:00”/>”\r\n
[2019-07-22 01:22:27.951] [info] flash[D:/CasparCG/Server n Client/casparcg-server-2.2.0/template/\cg20.fth.1080p2500|0] Initialized
[2019-07-22 01:22:28.144] [info] flash-player[cg20.fth.1080p2500|1920x1080] Initialized.
[2019-07-22 01:22:28.250] [info] Sent message to 127.0.0.1:202 CG OK\r\n
[2019-07-22 01:22:35.572] [info] Received message from 127.0.0.1: CG 1-20 INVOKE 1 “clockShowHide”\r\n
[2019-07-22 01:22:35.575] [info] Sent message to 127.0.0.1:201 CG OK\r\n<undefined/>\r\n
And this is the script I’m using
package {
import se.svt.caspar.ICommunicationManager;
import se.svt.caspar.IRegisteredDataSharer;
import se.svt.caspar.template.CasparTemplate;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.display.MovieClip;
public class Clock extends CasparTemplate {
var clockVisible:Boolean = false;
private var myTimer:Timer;
private const customParameterDescription:XML =
<parameters>
<parameter id="gameTime" type="string" info="File URL for Flag Home" />
</parameters>;
override public function SetData(xmlData:XML):void
{
for each (var element:XML in xmlData.children())
{
if (element.@id == "gameTime")
{
this.clockmainbar.clock.text = element.data.@value.toString();
}
}
super.SetData(xmlData);
} // constructor code
public function clockShowHide():void
{
clockVisible=true;
}
}
}
Do I need to add sommenting more?
Tks.