In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Object と Dictionary

Get Adobe Flash player
by bkzen 01 Jun 2010
/**
 * 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]);
        }
    }
}