It is currently 27 Apr 2017, 11:59



Example: Creating a template without using Flash Pro

Videos, graphics, Flash templates – how to create and play them using CasparCG

Moderators: Macey, Jonas Hummelstrand, didikunz

Example: Creating a template without using Flash Pro

Postby Andreas » 26 Mar 2013, 13:55

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
User avatar
Andreas
 
Posts: 107
Joined: 24 Oct 2008, 08:50

Re: Example: Creating a template without using flash pro

Postby santhosh » 26 Mar 2013, 16:01

Awesome work !! , Andreas :). I downloaded the zip file and tested the .FT file. Its working perfectly well. With this work, I think CasparCG has become a 100% FOSS product :). Well done :).
santhosh
 
Posts: 52
Joined: 18 Aug 2012, 17:14

Re: Example: Creating a template without using Flash Pro

Postby Jonas Hummelstrand » 01 Apr 2013, 21:37

This is now added to the wiki documentation:
http://casparcg.com/wiki/Content_/_Medi ... ofessional
Jonas Hummelstrand
Independent Consultant at SuperFly.tv
Former Community Manager for CasparCG

Problems? Guide to posting Bug reports & Feature requests
User avatar
Jonas Hummelstrand
 
Posts: 2538
Joined: 21 Apr 2009, 08:07
Location: Stockholm, Sweden

Re: Example: Creating a template without using Flash Pro

Postby iTech » 23 Apr 2013, 03:30

Is it safe to say that FlashDevelop is good for the coding side and Flash Professional for the animation/visual side?
iTech
 
Posts: 132
Joined: 11 Aug 2012, 17:54

Re: Example: Creating a template without using Flash Pro

Postby Jonas Hummelstrand » 23 Apr 2013, 06:34

From what I gather, it's a religious question more than anything...
Jonas Hummelstrand
Independent Consultant at SuperFly.tv
Former Community Manager for CasparCG

Problems? Guide to posting Bug reports & Feature requests
User avatar
Jonas Hummelstrand
 
Posts: 2538
Joined: 21 Apr 2009, 08:07
Location: Stockholm, Sweden

Re: Example: Creating a template without using Flash Pro

Postby Andreas » 03 May 2013, 14:39

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
User avatar
Andreas
 
Posts: 107
Joined: 24 Oct 2008, 08:50

Re: Example: Creating a template without using Flash Pro

Postby st599 » 20 Jun 2013, 11:40

Jonas Hummelstrand wrote:From what I gather, it's a religious question more than anything...



That would be an ecumenical decision!
st599
 
Posts: 59
Joined: 06 Nov 2012, 12:28

Re: Example: Creating a template without using Flash Pro

Postby d3aak117 » 02 Mar 2016, 13:42

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
d3aak117
 
Posts: 48
Joined: 26 Nov 2015, 13:24

Re: Example: Creating a template without using Flash Pro

Postby Ultravibe » 23 Dec 2016, 23:30

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?
User avatar
Ultravibe
 
Posts: 275
Joined: 11 Jan 2015, 09:05

Re: Example: Creating a template without using Flash Pro

Postby Ultravibe » 27 Dec 2016, 12:37

By the way - why in Flash Developer there are no TLFTextField?!?!??!
User avatar
Ultravibe
 
Posts: 275
Joined: 11 Jan 2015, 09:05

Re: Example: Creating a template without using Flash Pro

Postby didikunz » 27 Dec 2016, 17:33

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
User avatar
didikunz
 
Posts: 3427
Joined: 10 May 2010, 09:08
Location: Aarau, Switzerland

Re: Example: Creating a template without using Flash Pro

Postby Ultravibe » 28 Dec 2016, 19:04

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
User avatar
Ultravibe
 
Posts: 275
Joined: 11 Jan 2015, 09:05

Re: Example: Creating a template without using Flash Pro

Postby Jesper Stærkær » 28 Dec 2016, 19:19

The TLF library is availably as a standalone .SWC and can be used through code, regardless of the editor.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 841
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: Example: Creating a template without using Flash Pro

Postby didikunz » 28 Dec 2016, 19:34

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
User avatar
didikunz
 
Posts: 3427
Joined: 10 May 2010, 09:08
Location: Aarau, Switzerland

Re: Example: Creating a template without using Flash Pro

Postby Jesper Stærkær » 28 Dec 2016, 20:34

TLF is a much superior font rendering framework. You have better font support, better rendering, better layout engine. So for advanced templates, TLF is the best framework of them all.

For 90% of cases: straight dynamic text fields, as Didi says, does the trick.
Jesper Stærkær
Independent Consultant at SuperFly.tv
User avatar
Jesper Stærkær
 
Posts: 841
Joined: 13 Apr 2010, 18:06
Location: Trondheim, Norway

Re: Example: Creating a template without using Flash Pro

Postby Ultravibe » 28 Dec 2016, 22:50

Copy .swc file with TLF implementation and FlashDevelop is ok about TLF
User avatar
Ultravibe
 
Posts: 275
Joined: 11 Jan 2015, 09:05


Return to Content

Who is online

Users browsing this forum: No registered users and 2 guests