Hi there!
I’ve been using flash Templates for a while now and I’m very happy with it! We launch our CG through bitfocus Companion app and it’s really nice just out of the box!
Trying to get more complicated CG, I’ve been working on a Template wich takes Text from an external file.
Everything works inside Animate but when calling It into Caspar it returns a “PARAMETER_MISSING: 402 CG ERROR”.
That is an error of the server, that does not get a parameter to the template. Is this code only a snippet of a larger code? Is it in a separate ActionScript file? It could be, that Caspar does not consider this as a valid template. Do you run TemplateGenerator from Animate?
That code is on the actions layer to load the content on the first frame. As I would do for a normal Animate project.
Then I buid using templateGenerator without errors, but when loading to Caspar is when I get the error.
Should I script on a separate file?
I’m really new to Caspar Scripting! Am I missing some tutorials?
(What is this underscore shit about? There is the button </> to format code). I think it would make sense to have the i3Title dynamic textfield already on the stage, it could mess up everything when you add it later.
I think I don’t get It.
The field is on a text object from the stage.
The problem is that the Exporter doesn’t return any error to guess what’s happening.
If there’s a proper way to get a variable from an external file, or some documentation where I can search…
Thanks in advance!
What is the idea behind the line: addChild(l3Title);
if the field is already on the stage?
That is sometimes the case, that the template can be compiled without a problem, but does not work in CasparCG Is there any other information displayed in the log, after you play the template? Sometimes there is an ActionScript error logged, that helps a bit.
Ok, you where right, addChild(l3Title)
was useless. I took it from another project of mine and didn’t remember what it did…
Then I looked to the Caspar logs and found this:
flash-player[cg20.fth.1080p6000|1920x1080] [error] <invoke name="OnError" returntype="xml"><arguments><string>@Runtime error on template "file://C:\Users\LPE\Desktop\TESTING\casparcg-server-2.2.0\template\CHYRONS\CP_TITULAR_TEST.ft@1@Error #2032@</string></arguments></invoke>
I quickly compared your code to one of my templates, were I also used the URLLoader. There is no error in the code. So, the only thing I can see is, that the template does not find the data file. Are you sure, that “Titular.txt” is in Caspar’s template folder? It’s there were the code expect it to be.
By the way: Have you see the DATA commands, that allow to send data sets to Caspar asynchronously? Could probably be a better way to achieve what you are trying to do.
Damn!
You were totally right!
The txt file was located on the template folder (so Adobe Animate found could find it)
But when placed on templates folder directly it worked flawless!
That is a pretty funny way to do it. Have you considered using the Advanced Flash Template workflow? That would make it also possible to to a in and out animation without loosing the auto refresh feature. The refreshing could be implemented using a timer, instead if the gotoAndPlay loop trick.
Just by reading the code I think you missed the “load” call of the first file on the “timerListener” function, so it never triggers the Event.COMPLETE and never runs “processURL”.