flash on 2013-1-3
♥0 |
Line 27 |
Modified 2013-01-03 17:16:07 |
MIT License
archived:2017-03-20 03:49:24
ActionScript3 source code
/**
* Copyright TmskSt ( http://wonderfl.net/user/TmskSt )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/8xaN
*/
package {
import flash.display.Sprite;
import com.actionscriptbible.Example;
public class FlashTest extends Example {
public function FlashTest() {
// write as3 code here..
const obj:Object = {};
obj[K.A] = new K(100);
obj["2"] = 29;
trace(obj[K.A]);
trace("*");
for (var p:String in obj) trace(p, obj[p].valueOf());
}
}
}
class K {
public static const A:K = new K(1);
public function K(s:int) {
_s = s;
}
private var _s:int;
public function toString():String {
return "#" + _s.toString() + "#";
}
public function valueOf():String {
return "$" + _s.toString() + "$";
}
}