Object と Dictionary
/**
* Copyright bkzen ( http://wonderfl.net/user/bkzen )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/nHsu
*/
package {
import flash.display.Sprite;
import com.actionscriptbible.Example;
import flash.utils.Dictionary;
public class FlashTest extends Example {
public function FlashTest() {
// write as3 code here..
var o:Object = {};
var d:Dictionary = new Dictionary();
var k:Object = {};
var k2: Object = { };
k.toString = function():String
{
return "a";
}
k2.toString = function(): String
{
return "a";
}
o[k] = "ok";
d[k] = "ok";
trace("o['a']: " + o["a"]);
trace("d['a']: " + d["a"]);
trace("o[k]: " + o[k]);
trace("d[k]: " + d[k]);
trace("o[k2]: " + o[k2]);
trace("d[k2]: " + d[k2]);
}
}
}