Exemplo n.º 1
0
        /// <summary>
        /// Returns instance that stores reflection data for API builtin in target player (AVM, Flash, AIR).
        /// </summary>
        /// <returns></returns>
        private AbcInstance DefineReflectionInstance()
        {
            if (_instanceReflection != null)
            {
                return(_instanceReflection);
            }
            var name = Abc.DefineName(QName.PfxPackage("PlayerReflectionData"));

            _instanceReflection = Abc.DefineEmptyInstance(name, true);
            Abc.DefineScript(_instanceReflection);
            return(_instanceReflection);
        }
Exemplo n.º 2
0
        private AbcInstance BuildInstance(IAssembly assembly)
        {
            var name     = Abc.DefineName(QName.PfxPackage(assembly.Name + "$runtime"));
            var instance = Abc.Instances[name];

            if (instance != null)
            {
                return(instance);
            }
            instance = Abc.DefineEmptyInstance(name, true);
            Abc.DefineScript(instance);
            return(instance);
        }
Exemplo n.º 3
0
        private AbcInstance BuildRecord(object name, params object[] args)
        {
            var mn = Abc.DefineName(name);

            var instance = Abc.DefineEmptyInstance(mn, true);

            int slotID = 1;

            for (int i = 0; i < args.Length; i += 2)
            {
                var value = instance.CreateStaticSlot(args[i], args[i + 1]);
                value.SlotId = slotID;
                ++slotID;
            }

            return(instance);
        }