static void Test2() { Avm.Class klass = Avm.Class.Find("Utils", "Msg"); Utils.Msg msg = (Utils.Msg)klass.CreateInstance(); msg.value = "aaa"; Console.WriteLine(msg.value); }
static void Test1() { Avm.Class klass = Avm.Class.Find("", "Object"); Avm.Object obj = (Avm.Object)klass.CreateInstance(); obj.SetProperty("a", "1"); Console.WriteLine(obj.GetProperty("a")); }
public MyApp() { Function f = (Func) delegate { Alert.show("Hello World!!!"); }; f.call(null); Type type = typeof(Application); Avm.Class klass = type; }
public MyApp() { VDividedBox box = new VDividedBox(); box.setStyle("left", 10); box.setStyle("right", 10); box.setStyle("top", 30); box.setStyle("bottom", 10); addChild(box); RichTextEditor ed = new RichTextEditor(); ed.percentWidth = 100; ed.percentHeight = 100; box.addChild(ed); ed = new RichTextEditor(); ed.percentWidth = 100; ed.percentHeight = 100; box.addChild(ed); Button btn = ed.boldButton; Avm.Class klass = btn.getStyle("icon") as Avm.Class; if (klass != null) { BitmapAsset bmp = avm.CreateInstance(klass) as BitmapAsset; if (bmp != null) { if (bmp.bitmapData == null) { Alert.show("Bad bitmapData"); return; } Sprite sprite = new Sprite(); Graphics g = sprite.graphics; g.beginBitmapFill(bmp.bitmapData); g.drawRect(0, 0, 16, 16); g.endFill(); addChild(sprite); } else { Alert.show("Icon class is not BitmapAsset"); } } }