Simple tutorial


Simple example


For example, you want to change some coord in some object.


Use code:

XMLScriptEngine.getInstance().runCommands(Button1,null,new XML("<cmd><sp n="x" v="400"/><sp n="y" v="200"/></cmd>"));


Script is passed in third param; second – environemnt (associative array), first – default object;


Using environment


var env:Object = {world: Canvas1};
  XMLScriptEngine.getInstance().runCommands(Button1,env,new XML("<cmd><sp id="world" n="width" v="800"/><sp id="world" n="height" v="600"/></cmd>"));


Run functions


XMLScriptEngine.getInstance().runCommands(Image1,null,new XML("<cmd><run1 n="load" p1="assets/personLeft.gif"/></cmd>"));


You can also run functions with much more params (use run0, run1, run2, run3)