Exemple #1
0
        ///<summary>
        /// Compile list of Action objects to byte code.
        ///</summary>
        /// <param name="actionRecord">List of <see cref="SwfDotNet.IO.ByteCode.Actions.BaseAction">action objects</see></param>
        public byte[] Compile(ArrayList actionRecord)
        {
            // code blocks
            CollapsPushActions(actionRecord);
            CalcBranchOffsets(actionRecord);
            CalcBlockOffsets(actionRecord);

            // compile action-by-action
            foreach (object o in actionRecord)
            {
                BaseAction action = (BaseAction)o;
                action.Compile(binWriter);
            }

            return(memStream.ToArray());
        }