Skip to content

Instantly share code, notes, and snippets.

@RhinoLu
Created July 24, 2012 05:29
Show Gist options
  • Save RhinoLu/3168220 to your computer and use it in GitHub Desktop.
Save RhinoLu/3168220 to your computer and use it in GitHub Desktop.
AS3 XML 使用變數
package
{
import flash.display.Sprite;
/**
* @link http://www.peterelst.com/blog/2007/09/13/actionscript-30-using-variables-in-xml/
*/
public class XMLExample extends Sprite
{
private var someXML:XML;
private var myName:String = "Peter";
private var myEmail:String = "info at peterelst dot com";
public function XMLExample()
{
someXML =
<friends>
<person name={myName}>
<email>{myEmail}</email></person></friends>;
trace(someXML.toString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment