Can instance of Object and Dynamic types may be replaced with each other ? ie. Whether you create Object type of Dynamic type it will work same?
package myapp ;
import flash.Lib;
import js.Object;
import openfl.Assets;
import openfl.display.*;
class Main extends Sprite
{
public function new ()
{
super ();
var object:Object = new Object({a:1, b:2, c:3, f:function():Void {trace("Hello"); }});
trace(Reflect.getProperty(object, "f"));
var f:Void->Void = Reflect.field(object, "f" );
trace(Reflect.isFunction(f));
Reflect.callMethod(object, f, null);
Reflect.deleteField(object,"f"); //not working
Reflect.callMethod(object, f, null);
////////////////////////////////////////////////////////////
var object:Dynamic = {a:1, b:2, c:3, f:function():Void {trace("Hello"); }};
trace(Reflect.getProperty(object, "f"));
var f:Void->Void = Reflect.field(object, "f" );
trace(Reflect.isFunction(f));
Reflect.callMethod(object, f, null);
Reflect.deleteField(object,"f"); //not working
Reflect.callMethod(object, f, null);
//trace(object);
}
}