Example: Creating a template without using Flash Pro

#1
One of the great things with CasparCG is that it is free, with the exception that you are forced to use Adobe Flash Professional to create your templates, until now! Well, actually, this have always been possible to do but has not been very clear.

WHAT YOU NEED

1. You will need Flash Develop since this example is created in this wonderful free editor. The project is compiled with the Flex compiler which is installed together with the program. Just press ctrl + enter as usual.

http://www.flashdevelop.org/

2. Basic coding skills in AS3. The code is pretty well commented but you will need to know some of the basics.

WHAT YOU GET

1. A pretty ugly template that you can play with.

2. Hopefully a better understanding of how to create templates without using the CasparCG TemplateGenerator.

3. An example on how to use the inbuilt component flow to create custom components so you don't need to override SetData and doing all the xml-parsing in the document class.

SOME NOTES
As you might notice the output file is suffixed with .ft. This is not the act of magic as with the CasparCG TemplateGenerator, it is merely a setting in the properties for the project. I have just changed the "swf" to "ft".

I hope this will make CasparCG even more accessible than before! Of course you can use any editor/IDE with this method, it's just that I prefer Flash Develop.

http://sourceforge.net/projects/casparc ... p/download

Happy coding!
CasparCG flash guru

Re: Example: Creating a template without using Flash Pro

#6
iTech wrote:Is it safe to say that FlashDevelop is good for the coding side and Flash Professional for the animation/visual side?


Yes, that is exactly the case! Generally speaking you would only use flash for creating animations, movie clips and so on, and then export this as a precompiled library, a "swc", then you can import this file into flash develop and adding all the logic. A programmer typically loves to separate the visual and the logic as much as possible, and this workflow makes it possible.

This example was primary made for showing that you can create caspar templates for free (without using adobes products), but the workflow described above is also possible by following this example. And also, the flex compiler used by flash develop is typically much faster than the compiler inside flash pro.
CasparCG flash guru

Re: Example: Creating a template without using Flash Pro

#8
firstly thanx for sharing knowledge

actually I don't have any experience with Flash Develop but could I build dynamic text or templates by Flash Develop

because I want to use casparcg in my TV station and I have problem and I can not enter Arabic language on caspar

I try to create template by Flash Develop but it doesn't work with me .. am asking there is any tutorial how to create that step by step >>>
:) I have knowledge but am not professional :)

and thankx again

Re: Example: Creating a template without using Flash Pro

#9
Hello!
I have this issue:

Code: Select all

Running process: C:\Program Files (x86)\FlashDevelop\Tools\fdbuild\fdbuild.exe "D:\DISTR\templatewithoutflashpro\CasparTemplateWithoutFlashPro.as3proj" -ipc 2ff2882f-c0db-4d0e-ae66-17989f5ce459 -version "4.6.0; 24.0" -compiler "C:\Users\Ultra\AppData\Local\FlashDevelop\Apps\flexairsdk\4.6.0+24.0.0" -library "C:\Program Files (x86)\FlashDevelop\Library"
Building CasparTemplateWithoutFlashPro
mxmlc -load-config+=obj\CasparTemplateWithoutFlashProConfig.xml -debug=true -incremental=true -swf-version=12 -o obj\CasparTemplateWithoutFlashPro634998248120000000
Starting java as: java -Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=US -Djava.util.Arrays.useLegacyMergeSort=true -Dapplication.home="C:\Users\Ultra\AppData\Local\FlashDevelop\Apps\flexairsdk\4.6.0+24.0.0" -jar "C:\Users\Ultra\AppData\Local\FlashDevelop\Apps\flexairsdk\4.6.0+24.0.0\lib\fcsh.jar"
Unable to start java.exe: Не удается найти указанный файл
Could not compile because the fcsh process could not be started.
Build halted with errors (fcsh).
INITIALIZING: Failed, unable to run compiler
Done(1)
What am i do?

Re: Example: Creating a template without using Flash Pro

#11
Ultravibe wrote:By the way - why in Flash Developer there are no TLFTextField?!?!??!
Why would you want to use them? The normal dynamic textfields can also be used for unicode text (kirilian or arabic etc.) Just use a font that supports the alphabet.
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

Re: Example: Creating a template without using Flash Pro

#12
Well you know, there was a problem (there is a topic about it):
When text field width exceed specific value it must be resized. When i'm using TextField inside of MovieClip -
mc.width = 300; doesn't change the width of text, but change visible area - characters are remains the same. It's like a sh.graphics.lineStyle() with "scale" property - it might be "none" - when you resize MovieClip with this graphics - the thickness of line unchanged. The same story with text - if it is TextField.
If i use TLFTextField - width of characters is changed when mc.width is changed. It is very important for me

Re: Example: Creating a template without using Flash Pro

#14
Ultravibe wrote:Well you know, there was a problem (there is a topic about it):
When text field width exceed specific value it must be resized. When i'm using TextField inside of MovieClip -
mc.width = 300; doesn't change the width of text, but change visible area - characters are remains the same. It's like a sh.graphics.lineStyle() with "scale" property - it might be "none" - when you resize MovieClip with this graphics - the thickness of line unchanged. The same story with text - if it is TextField.
If i use TLFTextField - width of characters is changed when mc.width is changed. It is very important for me
I still do not need to uses TLF text, I use this function to scale the textfields, if they are wider than the should:

Code: Select all

		private static function ScaleDownTextField(Input:String, Field:TextField, initialFieldWidth:int, initialFieldX:int, align:int):void
		{
			var wi:int = initialFieldWidth;
		    Field.autoSize = TextFieldAutoSize.LEFT;
			Field.scaleX = 1;
		    Field.text = Input;
			if (wi < Field.width)
			{
		    	Field.scaleX = wi / Field.width;
			}
			
			if (align == 1)  //center
			{
				Field.x = initialFieldX + (initialFieldWidth - Field.width) / 2;
			}
			if (align == 2)  //right
			{
				Field.x = initialFieldX + initialFieldWidth - Field.width;
			}
		}
While Input is the dynamic text, Field is the name of the TextField, initialFieldWidth is the size the field must not exceeed, initialFieldX is the x coordinate of the field and align is 0 for left, 1 for centered and 2 for right aligned.
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

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron