Flash AS3.0 Class Samples


●XML E4X code sample
/* Initialize */
var str:String = "";
var xml:XML=
<xml>
<param><child1 flag0="0">value001</child1></param>
<param><child1 flag0="1">value002</child1></param>
<single>single000
<option type0="xxx" >option000</option>
<option type0="yyy" >option001</option>
</xml>;
srctext.text 	= xml.toString();

str += "SAMPLE A----------\n";
for(var i=0;i<xml.param.length();i++){
	 str += xml.param[i].child1 + "\n";
}
str += "SAMPLE B----------\n";
str += xml.single + "\n";
str += xml.option.@type0 + "\n";
str += xml.option[0].@type0 + "\n";
if(xml.param.child1.hasOwnProperty("@flag0")){
	str += xml..child1.(@flag0 == 1) + "\n";
}
str += "SAMPLE C----------\n";
str += xml..option.(/^x/.test(@type0)) + "\n";

dsttext.text = str;

stop();


●Literal code sample

/* Initialize */
var str:String = "";
var ary:Array = new Array();
ary[0] = 100;
ary[1] = "strings";
ary[2] = {str:"h-str",val:99};

var ary2:Array = [100,"strings",{str:"h-str",val:99}];

str += ary2[2]["str"] + "\n";
str += ary2[2].val + "\n";


srctext.text = str;
stop();



●Flash Lite LoadVars sample

on (keyPress "") { loadVariables("xxxx.cgi", " /wind"); }
キー入力毎にサーバ時間を取得


Flash lite LoadVars Sample


●Flash Dynamic SWF sample

入力された文字列を埋め込み動的にSWFを生成します。


Flash Dynamic SWF sample


●Flash Webpage sample

※音量に注意してください。

Flash Webpage sample