Beispiel #1
0
        public override bool Equals(System.Object obj)
        {
            bool isEqual = false;

            if (base.Equals(obj) && (obj is DefineButton))
            {
                DefineButton defineButton = (DefineButton)obj;

                if (ArrayUtil.equals(defineButton.buttonRecords, this.buttonRecords) && equals(defineButton.sounds, this.sounds) && equals(defineButton.cxform, this.cxform) && (defineButton.trackAsMenu == this.trackAsMenu) && ArrayUtil.equals(defineButton.condActions, this.condActions))
                {
                    isEqual = true;
                }
            }

            return(isEqual);
        }
		public override void  defineButton2(DefineButton tag)
		{
			tags.Add(tag);
		}
		public override void  defineButton2(DefineButton tag)
		{
			collectCondActions(tag.condActions);
		}
		public override void  defineButton(DefineButton tag)
		{
			String[] temp = pool;
			collectActions(tag.condActions[0].actionList);
			pool = temp;
		}
            public DefineButtonIterator(DefineButton defineButton)
			{
                m_DefineButton = defineButton;
			}
		public virtual void  defineButton(DefineButton tag)
		{
		}
Beispiel #7
0
 public DefineButtonIterator(DefineButton defineButton)
 {
     m_DefineButton = defineButton;
 }
        public override void defineButton2(DefineButton tag)
		{
			if (tag.condActions.Length > 0)
			{
				for (int i = 0; i < tag.condActions.Length; i++)
				{
					ButtonCondAction cond = tag.condActions[i];
					recordActions(cond.actionList);
				}
			}
		}
        public override void defineButton(DefineButton tag)
		{
			recordActions(tag.condActions[0].actionList);
		}
		private Tag decodeDefineButton(int length)
		{
			int startPos = r.Offset;
			DefineButton t;
			t = new DefineButton(Flash.Swf.TagValues.stagDefineButton);
			int id = r.readUI16();
			
			System.Collections.ArrayList list = new System.Collections.ArrayList();
			ButtonRecord record;
			do 
			{
				record = decodeButtonRecord(t.code);
				if (record != null)
				{
					list.Add(record);
				}
			}
			while (record != null);
			
			t.buttonRecords = new ButtonRecord[list.Count];
			SupportClass.ICollectionSupport.ToArray(list, t.buttonRecords);
			
			// old school button actions only handle one possible transition
			int consumed = r.Offset - startPos;
			t.condActions = new ButtonCondAction[1];
			t.condActions[0].overDownToOverUp = true;
			ActionDecoder actionDecoder = new ActionDecoder(r, swd);
			actionDecoder.KeepOffsets = keepOffsets;
			t.condActions[0].actionList = actionDecoder.decode(length - consumed);
			t.trackAsMenu = false;
			
			dict.add(id, t);
			return t;
		}
		private Tag decodeDefineButton2(int length)
		{
			int endpos = r.Offset + length;
			DefineButton t = new DefineButton(Flash.Swf.TagValues.stagDefineButton2);
			
			int id = r.readUI16();
			
			r.syncBits();
			r.readUBits(7); // reserved
			t.trackAsMenu = r.readBit();
			
			int actionOffset = r.readUI16();
			
			// read button data
			System.Collections.ArrayList list = new System.Collections.ArrayList(5);
			ButtonRecord record;
			while ((record = decodeButtonRecord(t.code)) != null)
			{
				list.Add(record);
			}

            t.buttonRecords = (ButtonRecord[])list.ToArray(typeof(ButtonRecord));
			list.Clear();
			
			if (actionOffset > 0)
			{
				list = new System.Collections.ArrayList();
				
				int pos = r.Offset;
				while ((actionOffset = r.readUI16()) > 0)
				{
					list.Add(decodeButtonCondAction(actionOffset - 2));
					if (r.Offset != pos + actionOffset)
					{
						throw new SwfFormatException("incorrect offset read in ButtonCondAction. read " + actionOffset + "");
					}
					pos = r.Offset;
				}
				// actionOffset == 0 means this will be the last record
				list.Add(decodeButtonCondAction(endpos - r.Offset));

                t.condActions = (ButtonCondAction[])list.ToArray(typeof(ButtonCondAction));
			}
			else
			{
				t.condActions = new ButtonCondAction[0];
			}
			while (r.Offset < endpos)
			{
				int b = r.readUI8();
				if (b != 0)
				{
					throw new SwfFormatException("nonzero data past end of DefineButton2");
				}
			}
			
			dict.add(id, t);
			return t;
		}