Created
July 24, 2012 05:29
-
-
Save RhinoLu/3168220 to your computer and use it in GitHub Desktop.
AS3 XML 使用變數
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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