flash - How to programatically inject texts into a SWF file -


i'm using dynamic text fields in swf , reading values external text file, i'm able use same swf "template" on , on again different texts. great if somehow wrap swf , variables file 1 swf file programatically, don't need mess 2 files per instance (or inject texts , create static swf instance, long done without manual intervention , result 1 swf file, solution fine). real plus able processing on linux server.

if external file xml, can embedded in class such as:

public class data  {      [embed(source='data.xml', mimetype="application/octet-stream")]     public static const xml:class;  } 

...and instantiated as:

var xml:xml = new xml(new data.xml); 

or, xml can pasted class, such as:

public class data {      public static var xml:xml = <root>                                     <menu>                                         <item>waffles</item>                                         <item>belgian waffles</item>                                     </menu>                                 </root>; } 

at higher level, seems unnecessary recompile new swf per template.

if each swf unique, text set in file. having single swf able accept configuration file make greater reuse of template.

there approaches use mxmlc compiler on server side. enables server automate complex build processes resulting in multiple swfs.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -