How to force using Unicode symbols for replaced text in Flash template (C#)

Submitted by eLenka on 6 July, 2011 - 14:59

The sample shows how to force using Unicode for text replacement in SWF template with SWF Scout library.

Visual C# Source Code:

' IMPORTANT: in this C# example UNICODE text is used in .AddTemplateRule_Text parameter
 ' UNICODE symbols are supported in C# in source code but not supported in VB6, VC++ 6, ASP (not .NET) so be aware of UNICODE support in your
 ' programming language IDE while passing UNICODE text as a parameter
 ' To pass UNICODE text in programming languages which do not support UNICODE text in source code use UNICODE variable and load UNICODE
 ' text into it and then pass as a parameter in .AddTempateRule_Text
 
 
 
private void Form1_Load(object sender, System.EventArgs e)
 {
 
 int W = 640;
 int H = 480;
 SWFScout.FlashMovie Movie = new SWFScout.FlashMovie();
 Movie.InitLibrary("demo", "demo");
 
Movie.BeginMovieFromTemplate("template.swf", true); // template.swf
 
Movie.AddTemplateRule_Text("setmyname", "UNICODE://degistiriyor", true); // UNICODE string. UNICODE:// will be removed automatically as indiciates UNICODE symbols even if non-UNICODE text was used in initial template
 
Movie.ProcessTemplateRules();
 
Movie.EndMovie();
 
Movie.SaveToFile("final.swf");
 
Process MyProcess = new Process();
 
// Set the file to open
 MyProcess.StartInfo.FileName = "final.swf";
 MyProcess.StartInfo.Verb = "Open";
// Start the process
 MyProcess.Start();
 
 }

 

Download source code (Visual C#):