flash on 2013-5-13
♥0 |
Line 30 |
Modified 2013-05-13 23:10:36 |
MIT License
archived:2017-03-30 22:53:11
ActionScript3 source code
/**
* Copyright mutantleg ( http://wonderfl.net/user/mutantleg )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/98xh
*/
package {
import flash.text.TextField;
import flash.utils.Dictionary;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
var t:TextField;
var dict:Dictionary;
t = new TextField();
addChild(t);
dict = new Dictionary();
var k:int;
//k = 0;
k = dict["idontexist"];
t.text = "value of k: " + k;
var temp:String;
temp = "<myRoot>"+
"<myObj> <work mk='2'> </work> </myObj>"+
" </myRoot> ";
var xm:XML;
xm = new XML(temp);
var o:XML;
var m:int;
//t.appendText(xm);
m = xm.myObj[0].work[0].@mk;
o = xm.notExist[0];
//m = xm.notExist[0].@mk;
t.appendText("\nvalue of m: " + m);
t.appendText("\nvalue of o: " + o);
t.appendText("\nreach");
}//ctor
}//classend
}