Passing text values to Flash templates

#1
Hello all, I have the feeling this question is a very simple and dumb... but I can't figure it out. I've been trying to find an answer for this issue in the forum and I found a little on this post: https://casparcg.com/forum/viewtopic.ph ... lue#p28845.

In any case, what I need to do is to send values to text boxes using their mapping in Animate... however I can't make this work. I've made a very simple test template with two text boxes using dynamic text. One is inside a MovieClip and the other is not. Based in Animate I can see the mapping to each box as this:

(1) TestText1.text > This text box is called "text" and is inside a MovieClip called "TestText1"
(2) TestText2 > This text box is called "TestText2"

When call the template and I send a text string to TestText1.text it doesn't come up; but the string is sent to TestText2 this one works.

This is the line command sent to CasparCG:

Code: Select all

CG 1-20 ADD 1 "TEXTTEST" 1 "<templateData><componentData id=\"TestText1.text\"><data id=\"text\" value=\"11111\"/></componentData><componentData id=\"TestText2\"><data id=\"text\" value=\"2222222\"/></componentData></templateData>"
What is the mapping I need to use to reach "text"?

Thank you!

PS: I tried to attach the FLA file but I get an "invalid extensions" error .

Re: Passing text values to Flash templates

#4
Hi guys, thanks for the replies! I understand the comment about the name fields, in real production we use less confusing names :)

Tsipas, tip worked, however due the nature of some of the templates we will be creating multiple instances of the same movieclip. Because of this, for example we will end up with several instances of an element called "DayBox" which will contain "MaxTemp", "MinTemp", "POP", etc. I would like to see if I can populate the values of 4 boxes using something like this:


DayBox1.MaxTemp
DayBox1.MinTemp
DayBox1.POP

DayBox2.MaxTemp
DayBox2.MinTemp
DayBox2.POP

DayBox3.MaxTemp
DayBox3.MinTemp
DayBox3.POP

DayBox4.MaxTemp
DayBox4.MinTemp
DayBox4.POP


Thanks for the tip Didi, I've renamed the textfield to be "xtxt" and sending the value as below... but the text field does not gets the values

Code: Select all

CG 1-20 ADD 1 "TEXTTEST" 1 "<templateData><componentData id=\"TestText1.xtxt\"><data id=\"text\" value=\"11111\"/></componentData><componentData id=\"TestText2\"><data id=\"text\" value=\"2222222\"/></componentData></templateData>"

Thanks

Re: Passing text values to Flash templates

#5
Didi... actually, when I followed your response completely (using "Text" as the textfield) the text field gets cleared when sending this command:

Code: Select all

CG 1-20 ADD 1 "TEXTTEST" 1 "<templateData><componentData id=\"TestText1.Text\"><data id=\"text\" value=\"11111\"/></componentData><componentData id=\"TestText2\"><data id=\"text\" value=\"2222222\"/></componentData></templateData>"
The template has some dummy text, but when called in the text field shows empty... so at least I'm reaching to that element?

Re: Passing text values to Flash templates

#6
Ok the command should read :

Code: Select all

CG 1-20 ADD 1 "TEXTTEST" 1 "<templateData><componentData id=\"Text\"><data id=\"text\" value=\"11111\"/></componentData><componentData id=\"TestText2\"><data id=\"text\" value=\"2222222\"/></componentData></templateData>"
You never send the name of the movieClip in the CG command. That is also the reason why "DayBox1.MaxTemp" would get the same value as "DayBox2.MaxTemp" because you would need to send it as "MaxTemp", so that anything happens. To make this work as intended you would create a saparate .as file and set the values inside the movieclips from there. See here for explaination:
http://casparcg.com/wiki/Content_/_Medi ... _Templates
or
http://casparcg.com/wiki/Content_/_Medi ... h_Template
Didi Kunz
CasparCG Client-Programmer, Template Maker & Live CG-Operator
Media Support, CH-5722 Gränichen, Switzerland http://mediasupport.ch/
Problems? Guide to posting Bug reports & Feature requests