reformat whitespace in abcdump.as (no other changes)

--- utils/abcdump.as
+++ utils/abcdump.as
@@ -1,4 +1,4 @@
-/* -*- tab-width: 4 -*- */
+/* -*- indent-tabs-mode: nil; tab-width: 4 -*- */
 /* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -39,64 +39,64 @@

 package abcdump
 {
-	import flash.utils.ByteArray
-	import avmplus.System
-
-	include "abc-constants.as"
-
-	var usage = [
-	"Displays the contents of abc or swf files",
-	"",
-	"Usage:",
-	"",
-	"    abcdump [options] file ...",
-	"",
-	"Each file can be an ABC or SWF/SWC format file",
-	"",
-	"Options:",
-	"",
-	" -a   Extract the ABC blocks from the SWF/SWC, but do not",
-	"      otherwise display their contents.  The file names are",
-	"      of the form file<n>.abc where \"file\" is the name",
-	"      of the input file minus the .swf/.swc extension;",
-	"      and <n> is omitted if it is 0.",
-	"",
-	" -i   Print information about the ABC, but do not dump the",
-	"      byte code.",
-	].join("\n");
-
-	const TAB = "  "
-
-	var totalSize:int
-	var opSizes:Array = new Array(256)
-
-	function dumpPrint(s) {
-	    if (!(doExtractAbc || doExtractInfo))
-		    print(s);
-    }
-
-	function infoPrint(s) {
-	    if (doExtractInfo || !doExtractAbc)
-		    print(s);
-	}
-
-	class Multiname
-	{
-		var nsset:Array
-		var name:String
-		function Multiname(nsset:Array, name:String)
-		{
-			this.nsset = nsset
-			this.name = name
-		}
-
-		public function toString()
-		{
-			return /*'{' + nsset + '}::' + */name
-		}
-	}
-
-	class TypeName
+    import flash.utils.ByteArray
+    import avmplus.System
+
+    include "abc-constants.as"
+
+    var usage = [
+    "Displays the contents of abc or swf files",
+    "",
+    "Usage:",
+    "",
+    "    abcdump [options] file ...",
+    "",
+    "Each file can be an ABC or SWF/SWC format file",
+    "",
+    "Options:",
+    "",
+    " -a   Extract the ABC blocks from the SWF/SWC, but do not",
+    "      otherwise display their contents.  The file names are",
+    "      of the form file<n>.abc where \"file\" is the name",
+    "      of the input file minus the .swf/.swc extension;",
+    "      and <n> is omitted if it is 0.",
+    "",
+    " -i   Print information about the ABC, but do not dump the",
+    "      byte code.",
+    ].join("\n");
+
+    const TAB = "  "
+
+    var totalSize:int
+    var opSizes:Array = new Array(256)
+
+    function dumpPrint(s) {
+        if (!(doExtractAbc || doExtractInfo))
+            print(s);
+    }
+
+    function infoPrint(s) {
+        if (doExtractInfo || !doExtractAbc)
+            print(s);
+    }
+
+    class Multiname
+    {
+        var nsset:Array
+        var name:String
+        function Multiname(nsset:Array, name:String)
+        {
+            this.nsset = nsset
+            this.name = name
+        }
+
+        public function toString()
+        {
+            return /*'{' + nsset + '}::' + */name
+        }
+    }
+
+    class TypeName
     {
         var name;
         var types:Array;
@@ -116,558 +116,558 @@
             return s;
         }
     }
-
-	dynamic class MetaData
-	{
-		var name:String
-		public function toString():String
-		{
-			var last:String
-			var s:String = last = '['+name+'('
-			var n
-			for (n in this)
-				s = (last = s + n + "=" + '"' + this[n] + '"') + ','
-			return last + ')]'
-		}
-	}
-
-	class MemberInfo
-	{
-		var id:int
-		var kind:int
-		var name
-		var metadata:Array
-	}
-
-	dynamic class LabelInfo
-	{
-		var count:int
-		function labelFor (target:int):String
-		{
-			if (target in this)
-				return this[target]
-			return this[target] = "L" + (++count)
-		}
-	}
-
-	class MethodInfo extends MemberInfo
-	{
-		var flags:int
-		var debugName
-		var paramTypes
-		var optionalValues
-		var returnType
-		var local_count:int
-		var max_scope:int
-		var max_stack:int
-		var code_length:uint
-		var code:ByteArray
-		var activation:Traits
-		var anon:Boolean
-
-		public function toString():String
-		{
-			return format()
-		}
-
-		public function format():String
-		{
-			var s:String = ""
-			if (flags & NATIVE)
-				s = "native "
-
-			return s + traitKinds[kind] + " " + name + "(" + paramTypes + "):" + returnType + "\t/* disp_id " + id + "*/"
-		}
-
-		function dump(abc:Abc, indent:String, attr:String="")
-		{
-			dumpPrint("")
-
-			if (metadata) {
-				for each (var md in metadata)
-					dumpPrint(indent+md)
-			}
-
-			dumpPrint(indent+attr+format())
-			if (code)
-			{
-				dumpPrint(indent+"{")
-				var oldindent = indent
-				indent += TAB
-				if (flags & NEED_ACTIVATION) {
-					dumpPrint(indent+"activation {")
-					activation.dump(abc, indent+TAB, "")
-					dumpPrint(indent+"}")
-				}
-				dumpPrint(indent+"// local_count="+local_count+
-					      " max_scope=" + max_scope +
-					      " max_stack=" + max_stack +
-					      " code_len=" + code.length)
-				code.position = 0
-				var labels:LabelInfo = new LabelInfo()
-				while (code.bytesAvailable > 0)
-				{
-					var start:int = code.position
-					var s = indent + start
-					while (s.length < 12) s += ' ';
-					var opcode = code.readUnsignedByte()
-
-					if (opcode == OP_label || ((code.position-1) in labels)) {
-						dumpPrint(indent)
-						dumpPrint(indent + labels.labelFor(code.position-1) + ": ")
-					}
-
-					s += opNames[opcode]
-					s += opNames[opcode].length < 8 ? "\t\t" : "\t"
-
-					switch(opcode)
-					{
-						case OP_debugfile:
-						case OP_pushstring:
-							s += '"' + abc.strings[readU32()].replace(/\n/g,"\\n").replace(/\t/g,"\\t") + '"'
-							break
-						case OP_pushnamespace:
-							s += abc.namespaces[readU32()]
-							break
-						case OP_pushint:
-							var i:int = abc.ints[readU32()]
-							s += i + "\t// 0x" + i.toString(16)
-							break
-						case OP_pushuint:
-							var u:uint = abc.uints[readU32()]
-							s += u + "\t// 0x" + u.toString(16)
-							break;
-						case OP_pushdouble:
-							s += abc.doubles[readU32()]
-							break;
-						case OP_getsuper:
-						case OP_setsuper:
-						case OP_getproperty:
-						case OP_initproperty:
-						case OP_setproperty:
-						case OP_getlex:
-						case OP_findpropstrict:
-						case OP_findproperty:
-						case OP_finddef:
-						case OP_deleteproperty:
-						case OP_istype:
-						case OP_coerce:
-						case OP_astype:
-						case OP_getdescendants:
-							s += abc.names[readU32()]
-							break;
-						case OP_constructprop:
-						case OP_callproperty:
-						case OP_callproplex:
-						case OP_callsuper:
-						case OP_callsupervoid:
-						case OP_callpropvoid:
-							s += abc.names[readU32()]
-							s += " (" + readU32() + ")"
-							break;
-						case OP_newfunction: {
-							var method_id = readU32()
-							s += abc.methods[method_id]
-							abc.methods[method_id].anon = true
-							break;
-						}
-						case OP_callstatic:
-							s += abc.methods[readU32()]
-							s += " (" + readU32() + ")"
-							break;
-						case OP_newclass:
-							s += abc.instances[readU32()]
-							break;
-						case OP_lookupswitch:
-							var pos = code.position-1;
-							var target = pos + readS24()
-							var maxindex = readU32()
-							s += "default:" + labels.labelFor(target) // target + "("+(target-pos)+")"
-							s += " maxcase:" + maxindex
-							for (var i:int=0; i <= maxindex; i++) {
-								target = pos + readS24();
-								s += " " + labels.labelFor(target) // target + "("+(target-pos)+")"
-							}
-							break;
-						case OP_jump:
-						case OP_iftrue:		case OP_iffalse:
-						case OP_ifeq:		case OP_ifne:
-						case OP_ifge:		case OP_ifnge:
-						case OP_ifgt:		case OP_ifngt:
-						case OP_ifle:		case OP_ifnle:
-						case OP_iflt:		case OP_ifnlt:
-						case OP_ifstricteq:	case OP_ifstrictne:
-							var offset = readS24()
-							var target = code.position+offset
-							//s += target + " ("+offset+")"
-							s += labels.labelFor(target)
-							if (!((code.position) in labels))
-								s += "\n"
-							break;
-						case OP_inclocal:
-						case OP_declocal:
-						case OP_inclocal_i:
-						case OP_declocal_i:
-						case OP_getlocal:
-						case OP_kill:
-						case OP_setlocal:
-						case OP_debugline:
-						case OP_getglobalslot:
-						case OP_getslot:
-						case OP_setglobalslot:
-						case OP_setslot:
-						case OP_pushshort:
-						case OP_newcatch:
-							s += readU32()
-							break
-						case OP_debug:
-							s += code.readUnsignedByte()
-							s += " " + readU32()
-							s += " " + code.readUnsignedByte()
-							s += " " + readU32()
-							break;
-						case OP_newobject:
-							s += "{" + readU32() + "}"
-							break;
-						case OP_newarray:
-							s += "[" + readU32() + "]"
-							break;
-						case OP_call:
-						case OP_construct:
-						case OP_constructsuper:
+
+    dynamic class MetaData
+    {
+        var name:String
+        public function toString():String
+        {
+            var last:String
+            var s:String = last = '['+name+'('
+            var n
+            for (n in this)
+                s = (last = s + n + "=" + '"' + this[n] + '"') + ','
+            return last + ')]'
+        }
+    }
+
+    class MemberInfo
+    {
+        var id:int
+        var kind:int
+        var name
+        var metadata:Array
+    }
+
+    dynamic class LabelInfo
+    {
+        var count:int
+        function labelFor (target:int):String
+        {
+            if (target in this)
+                return this[target]
+            return this[target] = "L" + (++count)
+        }
+    }
+
+    class MethodInfo extends MemberInfo
+    {
+        var flags:int
+        var debugName
+        var paramTypes
+        var optionalValues
+        var returnType
+        var local_count:int
+        var max_scope:int
+        var max_stack:int
+        var code_length:uint
+        var code:ByteArray
+        var activation:Traits
+        var anon:Boolean
+
+        public function toString():String
+        {
+            return format()
+        }
+
+        public function format():String
+        {
+            var s:String = ""
+            if (flags & NATIVE)
+                s = "native "
+
+            return s + traitKinds[kind] + " " + name + "(" + paramTypes + "):" + returnType + "\t/* disp_id " + id + "*/"
+        }
+
+        function dump(abc:Abc, indent:String, attr:String="")
+        {
+            dumpPrint("")
+
+            if (metadata) {
+                for each (var md in metadata)
+                    dumpPrint(indent+md)
+            }
+
+            dumpPrint(indent+attr+format())
+            if (code)
+            {
+                dumpPrint(indent+"{")
+                var oldindent = indent
+                indent += TAB
+                if (flags & NEED_ACTIVATION) {
+                    dumpPrint(indent+"activation {")
+                    activation.dump(abc, indent+TAB, "")
+                    dumpPrint(indent+"}")
+                }
+                dumpPrint(indent+"// local_count="+local_count+
+                          " max_scope=" + max_scope +
+                          " max_stack=" + max_stack +
+                          " code_len=" + code.length)
+                code.position = 0
+                var labels:LabelInfo = new LabelInfo()
+                while (code.bytesAvailable > 0)
+                {
+                    var start:int = code.position
+                    var s = indent + start
+                    while (s.length < 12) s += ' ';
+                    var opcode = code.readUnsignedByte()
+
+                    if (opcode == OP_label || ((code.position-1) in labels)) {
+                        dumpPrint(indent)
+                        dumpPrint(indent + labels.labelFor(code.position-1) + ": ")
+                    }
+
+                    s += opNames[opcode]
+                    s += opNames[opcode].length < 8 ? "\t\t" : "\t"
+
+                    switch(opcode)
+                    {
+                        case OP_debugfile:
+                        case OP_pushstring:
+                            s += '"' + abc.strings[readU32()].replace(/\n/g,"\\n").replace(/\t/g,"\\t") + '"'
+                            break
+                        case OP_pushnamespace:
+                            s += abc.namespaces[readU32()]
+                            break
+                        case OP_pushint:
+                            var i:int = abc.ints[readU32()]
+                            s += i + "\t// 0x" + i.toString(16)
+                            break
+                        case OP_pushuint:
+                            var u:uint = abc.uints[readU32()]
+                            s += u + "\t// 0x" + u.toString(16)
+                            break;
+                        case OP_pushdouble:
+                            s += abc.doubles[readU32()]
+                            break;
+                        case OP_getsuper:
+                        case OP_setsuper:
+                        case OP_getproperty:
+                        case OP_initproperty:
+                        case OP_setproperty:
+                        case OP_getlex:
+                        case OP_findpropstrict:
+                        case OP_findproperty:
+                        case OP_finddef:
+                        case OP_deleteproperty:
+                        case OP_istype:
+                        case OP_coerce:
+                        case OP_astype:
+                        case OP_getdescendants:
+                            s += abc.names[readU32()]
+                            break;
+                        case OP_constructprop:
+                        case OP_callproperty:
+                        case OP_callproplex:
+                        case OP_callsuper:
+                        case OP_callsupervoid:
+                        case OP_callpropvoid:
+                            s += abc.names[readU32()]
+                            s += " (" + readU32() + ")"
+                            break;
+                        case OP_newfunction: {
+                            var method_id = readU32()
+                            s += abc.methods[method_id]
+                            abc.methods[method_id].anon = true
+                            break;
+                        }
+                        case OP_callstatic:
+                            s += abc.methods[readU32()]
+                            s += " (" + readU32() + ")"
+                            break;
+                        case OP_newclass:
+                            s += abc.instances[readU32()]
+                            break;
+                        case OP_lookupswitch:
+                            var pos = code.position-1;
+                            var target = pos + readS24()
+                            var maxindex = readU32()
+                            s += "default:" + labels.labelFor(target) // target + "("+(target-pos)+")"
+                            s += " maxcase:" + maxindex
+                            for (var i:int=0; i <= maxindex; i++) {
+                                target = pos + readS24();
+                                s += " " + labels.labelFor(target) // target + "("+(target-pos)+")"
+                            }
+                            break;
+                        case OP_jump:
+                        case OP_iftrue:     case OP_iffalse:
+                        case OP_ifeq:       case OP_ifne:
+                        case OP_ifge:       case OP_ifnge:
+                        case OP_ifgt:       case OP_ifngt:
+                        case OP_ifle:       case OP_ifnle:
+                        case OP_iflt:       case OP_ifnlt:
+                        case OP_ifstricteq: case OP_ifstrictne:
+                            var offset = readS24()
+                            var target = code.position+offset
+                            //s += target + " ("+offset+")"
+                            s += labels.labelFor(target)
+                            if (!((code.position) in labels))
+                                s += "\n"
+                            break;
+                        case OP_inclocal:
+                        case OP_declocal:
+                        case OP_inclocal_i:
+                        case OP_declocal_i:
+                        case OP_getlocal:
+                        case OP_kill:
+                        case OP_setlocal:
+                        case OP_debugline:
+                        case OP_getglobalslot:
+                        case OP_getslot:
+                        case OP_setglobalslot:
+                        case OP_setslot:
+                        case OP_pushshort:
+                        case OP_newcatch:
+                            s += readU32()
+                            break
+                        case OP_debug:
+                            s += code.readUnsignedByte()
+                            s += " " + readU32()
+                            s += " " + code.readUnsignedByte()
+                            s += " " + readU32()
+                            break;
+                        case OP_newobject:
+                            s += "{" + readU32() + "}"
+                            break;
+                        case OP_newarray:
+                            s += "[" + readU32() + "]"
+                            break;
+                        case OP_call:
+                        case OP_construct:
+                        case OP_constructsuper:
                         case OP_applytype:
-							s += "(" + readU32() + ")"
-							break;
-						case OP_pushbyte:
-						case OP_getscopeobject:
-							s += code.readByte()
-							break;
-						case OP_hasnext2:
-							s += readU32() + " " + readU32()
-						default:
-							/*if (opNames[opcode] == ("0x"+opcode.toString(16).toUpperCase()))
-								s += " UNKNOWN OPCODE"*/
-							break
-					}
-					var size:int = code.position - start
-					totalSize += size
-					opSizes[opcode] = int(opSizes[opcode]) + size
-					dumpPrint(s)
-				}
-				dumpPrint(oldindent+"}\n")
-			}
-		}
-
-		function readU32():int
-		{
-			var result:int = code.readUnsignedByte();
-			if (!(result & 0x00000080))
-				return result;
-			result = result & 0x0000007f | code.readUnsignedByte()<<7;
-			if (!(result & 0x00004000))
-				return result;
-			result = result & 0x00003fff | code.readUnsignedByte()<<14;
-			if (!(result & 0x00200000))
-				return result;
-			result = result & 0x001fffff | code.readUnsignedByte()<<21;
-			if (!(result & 0x10000000))
-				return result;
-			return   result & 0x0fffffff | code.readUnsignedByte()<<28;
-		}
-
-		function readS24():int
-		{
-			var b:int = code.readUnsignedByte()
-			b |= code.readUnsignedByte()<<8
-			b |= code.readByte()<<16
-			return b
-		}
-	}
-
-	class SlotInfo extends MemberInfo
-	{
-		var type
-		var value
-		public function format():String
-		{
-			return traitKinds[kind] + " " + name + ":" + type +
-				(value !== undefined ? (" = " + (value is String ? ('"'+value+'"') : value)) : "") +
-				"\t/* slot_id " + id + " */"
-		}
-		function dump(abc:Abc, indent:String, attr:String="")
-		{
-			if (kind == TRAIT_Const || kind == TRAIT_Slot)
-			{
-				if (metadata) {
-					for each (var md in metadata)
-						dumpPrint(indent+md)
-				}
-				dumpPrint(indent+attr+format())
-				return
-			}
-
-			// else, class
-
-			var ct:Traits = value
-			var it:Traits = ct.itraits
-			dumpPrint('')
-			if (metadata) {
-				for each (var md in metadata)
-					dumpPrint(indent+md)
-			}
-			var def:String;
-			if (it.flags & CLASS_FLAG_interface)
-				def = "interface"
-			else {
-				def = "class";
-				if (!(it.flags & CLASS_FLAG_sealed))
-					def = "dynamic " + def;
-				if (it.flags & CLASS_FLAG_final)
-					def = "final " + def;
-
-			}
-			dumpPrint(indent+attr+def+" "+name+" extends "+it.base)
-			var oldindent = indent
-			indent += TAB
-			if (it.interfaces.length > 0)
-				dumpPrint(indent+"implements "+it.interfaces)
-			dumpPrint(oldindent+"{")
-			it.init.dump(abc,indent)
-			it.dump(abc,indent)
-			ct.dump(abc,indent,"static ")
-			ct.init.dump(abc,indent,"static ")
-			dumpPrint(oldindent+"}\n")
-		}
-	}
-
-	class Traits
-	{
-		var name
-		var init:MethodInfo
-		var itraits:Traits
-		var base
-		var flags:int
-		var protectedNs:Namespace
-		const interfaces:Array = []
-		const names:Object = {}
-		const slots:Array = []
-		const methods:Array = []
-		const members:Array = []
-
-		public function toString():String
-		{
-			return String(name)
-		}
-
-		public function dump(abc:Abc, indent:String, attr:String="")
-		{
-			for each (var m in members)
-				m.dump(abc,indent,attr)
-		}
-	}
-
-	class Abc
-	{
-		private var data:ByteArray
-
-		var major:int
-		var minor:int
-
-		var ints:Array
-		var uints:Array
-		var doubles:Array
-		var strings:Array
-		var namespaces:Array
-		var nssets:Array
-		var names:Array
-
-		var defaults:Array = new Array(constantKinds.length)
-
-		var methods:Array
-		var instances:Array
-		var classes:Array
-		var scripts:Array
-
-		var publicNs = new Namespace("")
-		var anyNs = new Namespace("*")
-
-		var magic:int
-
-		function Abc(data:ByteArray)
-		{
-			data.position = 0
-			this.data = data
-			magic = data.readInt()
-
-			infoPrint("magic " + magic.toString(16))
-
-			if (magic != (46<<16|14) && magic != (46<<16|15) && magic != (46<<16|16))
-				throw new Error("not an abc file.  magic=" + magic.toString(16))
-
-			parseCpool()
-
-			defaults[CONSTANT_Utf8] = strings
-			defaults[CONSTANT_Int] = ints
-			defaults[CONSTANT_UInt] = uints
-			defaults[CONSTANT_Double] = doubles
-			defaults[CONSTANT_Int] = ints
-			defaults[CONSTANT_False] = { 10:false }
-			defaults[CONSTANT_True] = { 11:true }
-			defaults[CONSTANT_Namespace] = namespaces
-			defaults[CONSTANT_PrivateNs] = namespaces
-			defaults[CONSTANT_PackageNs] = namespaces
-			defaults[CONSTANT_PackageInternalNs] = namespaces
-			defaults[CONSTANT_ProtectedNs] = namespaces
-			defaults[CONSTANT_StaticProtectedNs] = namespaces
-			defaults[CONSTANT_StaticProtectedNs2] = namespaces
-			defaults[CONSTANT_Null] = { 12: null }
-
-			parseMethodInfos()
-			parseMetadataInfos()
-			parseInstanceInfos()
-			parseClassInfos()
-			parseScriptInfos()
-			parseMethodBodies()
-
-			if (doExtractAbc==true)
-			    data.writeFile(nextAbcFname());
-		}
-
-		function readU32():int
-		{
-			var result:int = data.readUnsignedByte();
-			if (!(result & 0x00000080))
-				return result;
-			result = result & 0x0000007f | data.readUnsignedByte()<<7;
-			if (!(result & 0x00004000))
-				return result;
-			result = result & 0x00003fff | data.readUnsignedByte()<<14;
-			if (!(result & 0x00200000))
-				return result;
-			result = result & 0x001fffff | data.readUnsignedByte()<<21;
-			if (!(result & 0x10000000))
-				return result;
-			return   result & 0x0fffffff | data.readUnsignedByte()<<28;
-		}
-
-		function parseCpool()
-		{
-			var i:int, j:int
-			var n:int
-			var kind:int
-
-			var start:int = data.position
-
-			// ints
-			n = readU32()
-			ints = [0]
-			for (i=1; i < n; i++)
-				ints[i] = readU32()
-
-			// uints
-			n = readU32()
-			uints = [0]
-			for (i=1; i < n; i++)
-				uints[i] = uint(readU32())
-
-			// doubles
-			n = readU32()
-			doubles = [NaN]
-			for (i=1; i < n; i++)
-				doubles[i] = data.readDouble()
-
-			infoPrint("Cpool numbers size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-			start = data.position
-
-			// strings
-			n = readU32()
-			strings = [""]
-			for (i=1; i < n; i++)
-				strings[i] = data.readUTFBytes(readU32())
-
-			infoPrint("Cpool strings count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-			start = data.position
-
-			// namespaces
-			n = readU32()
-			namespaces = [publicNs]
-			for (i=1; i < n; i++)
-				switch (data.readByte())
-				{
-				case CONSTANT_Namespace:
-				case CONSTANT_PackageNs:
-				case CONSTANT_PackageInternalNs:
-				case CONSTANT_ProtectedNs:
-				case CONSTANT_StaticProtectedNs:
-				case CONSTANT_StaticProtectedNs2:
-				{
-					namespaces[i] = new Namespace(strings[readU32()])
-					// todo mark kind of namespace.
-					break;
-				}
-				case CONSTANT_PrivateNs:
-					readU32();
-					namespaces[i] = new Namespace(null, "private")
-					break;
-				}
-
-			infoPrint("Cpool namespaces count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-			start = data.position
-
-			// namespace sets
-			n = readU32()
-			nssets = [null]
-			for (i=1; i < n; i++)
-			{
-				var count:int = readU32()
-				var nsset = nssets[i] = []
-				for (j=0; j < count; j++)
-					nsset[j] = namespaces[readU32()]
-			}
-
-			infoPrint("Cpool nssets count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-			start = data.position
-
-			// multinames
-			n = readU32()
-			names = [null]
-			namespaces[0] = anyNs
-			strings[0] = "*" // any name
-			for (i=1; i < n; i++)
-				switch (data.readByte())
-				{
-				case CONSTANT_Qname:
-				case CONSTANT_QnameA:
-					names[i] = new QName(namespaces[readU32()], strings[readU32()])
-					break;
-
-				case CONSTANT_RTQname:
-				case CONSTANT_RTQnameA:
-					names[i] = new QName(strings[readU32()])
-					break;
-
-				case CONSTANT_RTQnameL:
-				case CONSTANT_RTQnameLA:
-					names[i] = null
-					break;
-
-				case CONSTANT_NameL:
-				case CONSTANT_NameLA:
-					names[i] = new QName(new Namespace(""), null)
-					break;
-
-				case CONSTANT_Multiname:
-				case CONSTANT_MultinameA:
-					var name = strings[readU32()]
-					names[i] = new Multiname(nssets[readU32()], name)
-					break;
-
-				case CONSTANT_MultinameL:
-				case CONSTANT_MultinameLA:
-					names[i] = new Multiname(nssets[readU32()], null)
-					break;
-
-			    case CONSTANT_TypeName:
+                            s += "(" + readU32() + ")"
+                            break;
+                        case OP_pushbyte:
+                        case OP_getscopeobject:
+                            s += code.readByte()
+                            break;
+                        case OP_hasnext2:
+                            s += readU32() + " " + readU32()
+                        default:
+                            /*if (opNames[opcode] == ("0x"+opcode.toString(16).toUpperCase()))
+                                s += " UNKNOWN OPCODE"*/
+                            break
+                    }
+                    var size:int = code.position - start
+                    totalSize += size
+                    opSizes[opcode] = int(opSizes[opcode]) + size
+                    dumpPrint(s)
+                }
+                dumpPrint(oldindent+"}\n")
+            }
+        }
+
+        function readU32():int
+        {
+            var result:int = code.readUnsignedByte();
+            if (!(result & 0x00000080))
+                return result;
+            result = result & 0x0000007f | code.readUnsignedByte()<<7;
+            if (!(result & 0x00004000))
+                return result;
+            result = result & 0x00003fff | code.readUnsignedByte()<<14;
+            if (!(result & 0x00200000))
+                return result;
+            result = result & 0x001fffff | code.readUnsignedByte()<<21;
+            if (!(result & 0x10000000))
+                return result;
+            return   result & 0x0fffffff | code.readUnsignedByte()<<28;
+        }
+
+        function readS24():int
+        {
+            var b:int = code.readUnsignedByte()
+            b |= code.readUnsignedByte()<<8
+            b |= code.readByte()<<16
+            return b
+        }
+    }
+
+    class SlotInfo extends MemberInfo
+    {
+        var type
+        var value
+        public function format():String
+        {
+            return traitKinds[kind] + " " + name + ":" + type +
+                (value !== undefined ? (" = " + (value is String ? ('"'+value+'"') : value)) : "") +
+                "\t/* slot_id " + id + " */"
+        }
+        function dump(abc:Abc, indent:String, attr:String="")
+        {
+            if (kind == TRAIT_Const || kind == TRAIT_Slot)
+            {
+                if (metadata) {
+                    for each (var md in metadata)
+                        dumpPrint(indent+md)
+                }
+                dumpPrint(indent+attr+format())
+                return
+            }
+
+            // else, class
+
+            var ct:Traits = value
+            var it:Traits = ct.itraits
+            dumpPrint('')
+            if (metadata) {
+                for each (var md in metadata)
+                    dumpPrint(indent+md)
+            }
+            var def:String;
+            if (it.flags & CLASS_FLAG_interface)
+                def = "interface"
+            else {
+                def = "class";
+                if (!(it.flags & CLASS_FLAG_sealed))
+                    def = "dynamic " + def;
+                if (it.flags & CLASS_FLAG_final)
+                    def = "final " + def;
+
+            }
+            dumpPrint(indent+attr+def+" "+name+" extends "+it.base)
+            var oldindent = indent
+            indent += TAB
+            if (it.interfaces.length > 0)
+                dumpPrint(indent+"implements "+it.interfaces)
+            dumpPrint(oldindent+"{")
+            it.init.dump(abc,indent)
+            it.dump(abc,indent)
+            ct.dump(abc,indent,"static ")
+            ct.init.dump(abc,indent,"static ")
+            dumpPrint(oldindent+"}\n")
+        }
+    }
+
+    class Traits
+    {
+        var name
+        var init:MethodInfo
+        var itraits:Traits
+        var base
+        var flags:int
+        var protectedNs:Namespace
+        const interfaces:Array = []
+        const names:Object = {}
+        const slots:Array = []
+        const methods:Array = []
+        const members:Array = []
+
+        public function toString():String
+        {
+            return String(name)
+        }
+
+        public function dump(abc:Abc, indent:String, attr:String="")
+        {
+            for each (var m in members)
+                m.dump(abc,indent,attr)
+        }
+    }
+
+    class Abc
+    {
+        private var data:ByteArray
+
+        var major:int
+        var minor:int
+
+        var ints:Array
+        var uints:Array
+        var doubles:Array
+        var strings:Array
+        var namespaces:Array
+        var nssets:Array
+        var names:Array
+
+        var defaults:Array = new Array(constantKinds.length)
+
+        var methods:Array
+        var instances:Array
+        var classes:Array
+        var scripts:Array
+
+        var publicNs = new Namespace("")
+        var anyNs = new Namespace("*")
+
+        var magic:int
+
+        function Abc(data:ByteArray)
+        {
+            data.position = 0
+            this.data = data
+            magic = data.readInt()
+
+            infoPrint("magic " + magic.toString(16))
+
+            if (magic != (46<<16|14) && magic != (46<<16|15) && magic != (46<<16|16))
+                throw new Error("not an abc file.  magic=" + magic.toString(16))
+
+            parseCpool()
+
+            defaults[CONSTANT_Utf8] = strings
+            defaults[CONSTANT_Int] = ints
+            defaults[CONSTANT_UInt] = uints
+            defaults[CONSTANT_Double] = doubles
+            defaults[CONSTANT_Int] = ints
+            defaults[CONSTANT_False] = { 10:false }
+            defaults[CONSTANT_True] = { 11:true }
+            defaults[CONSTANT_Namespace] = namespaces
+            defaults[CONSTANT_PrivateNs] = namespaces
+            defaults[CONSTANT_PackageNs] = namespaces
+            defaults[CONSTANT_PackageInternalNs] = namespaces
+            defaults[CONSTANT_ProtectedNs] = namespaces
+            defaults[CONSTANT_StaticProtectedNs] = namespaces
+            defaults[CONSTANT_StaticProtectedNs2] = namespaces
+            defaults[CONSTANT_Null] = { 12: null }
+
+            parseMethodInfos()
+            parseMetadataInfos()
+            parseInstanceInfos()
+            parseClassInfos()
+            parseScriptInfos()
+            parseMethodBodies()
+
+            if (doExtractAbc==true)
+                data.writeFile(nextAbcFname());
+        }
+
+        function readU32():int
+        {
+            var result:int = data.readUnsignedByte();
+            if (!(result & 0x00000080))
+                return result;
+            result = result & 0x0000007f | data.readUnsignedByte()<<7;
+            if (!(result & 0x00004000))
+                return result;
+            result = result & 0x00003fff | data.readUnsignedByte()<<14;
+            if (!(result & 0x00200000))
+                return result;
+            result = result & 0x001fffff | data.readUnsignedByte()<<21;
+            if (!(result & 0x10000000))
+                return result;
+            return   result & 0x0fffffff | data.readUnsignedByte()<<28;
+        }
+
+        function parseCpool()
+        {
+            var i:int, j:int
+            var n:int
+            var kind:int
+
+            var start:int = data.position
+
+            // ints
+            n = readU32()
+            ints = [0]
+            for (i=1; i < n; i++)
+                ints[i] = readU32()
+
+            // uints
+            n = readU32()
+            uints = [0]
+            for (i=1; i < n; i++)
+                uints[i] = uint(readU32())
+
+            // doubles
+            n = readU32()
+            doubles = [NaN]
+            for (i=1; i < n; i++)
+                doubles[i] = data.readDouble()
+
+            infoPrint("Cpool numbers size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+            start = data.position
+
+            // strings
+            n = readU32()
+            strings = [""]
+            for (i=1; i < n; i++)
+                strings[i] = data.readUTFBytes(readU32())
+
+            infoPrint("Cpool strings count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+            start = data.position
+
+            // namespaces
+            n = readU32()
+            namespaces = [publicNs]
+            for (i=1; i < n; i++)
+                switch (data.readByte())
+                {
+                case CONSTANT_Namespace:
+                case CONSTANT_PackageNs:
+                case CONSTANT_PackageInternalNs:
+                case CONSTANT_ProtectedNs:
+                case CONSTANT_StaticProtectedNs:
+                case CONSTANT_StaticProtectedNs2:
+                {
+                    namespaces[i] = new Namespace(strings[readU32()])
+                    // todo mark kind of namespace.
+                    break;
+                }
+                case CONSTANT_PrivateNs:
+                    readU32();
+                    namespaces[i] = new Namespace(null, "private")
+                    break;
+                }
+
+            infoPrint("Cpool namespaces count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+            start = data.position
+
+            // namespace sets
+            n = readU32()
+            nssets = [null]
+            for (i=1; i < n; i++)
+            {
+                var count:int = readU32()
+                var nsset = nssets[i] = []
+                for (j=0; j < count; j++)
+                    nsset[j] = namespaces[readU32()]
+            }
+
+            infoPrint("Cpool nssets count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+            start = data.position
+
+            // multinames
+            n = readU32()
+            names = [null]
+            namespaces[0] = anyNs
+            strings[0] = "*" // any name
+            for (i=1; i < n; i++)
+                switch (data.readByte())
+                {
+                case CONSTANT_Qname:
+                case CONSTANT_QnameA:
+                    names[i] = new QName(namespaces[readU32()], strings[readU32()])
+                    break;
+
+                case CONSTANT_RTQname:
+                case CONSTANT_RTQnameA:
+                    names[i] = new QName(strings[readU32()])
+                    break;
+
+                case CONSTANT_RTQnameL:
+                case CONSTANT_RTQnameLA:
+                    names[i] = null
+                    break;
+
+                case CONSTANT_NameL:
+                case CONSTANT_NameLA:
+                    names[i] = new QName(new Namespace(""), null)
+                    break;
+
+                case CONSTANT_Multiname:
+                case CONSTANT_MultinameA:
+                    var name = strings[readU32()]
+                    names[i] = new Multiname(nssets[readU32()], name)
+                    break;
+
+                case CONSTANT_MultinameL:
+                case CONSTANT_MultinameLA:
+                    names[i] = new Multiname(nssets[readU32()], null)
+                    break;
+
+                case CONSTANT_TypeName:
                     var name = names[readU32()];
                     var count = readU32();
                     var types = [];
@@ -676,389 +676,389 @@
                     names[i] = new TypeName(name, types);
                     break;

-				default:
-					throw new Error("invalid kind " + data[data.position-1])
-				}
-
-			infoPrint("Cpool names count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-			start = data.position
-
-			namespaces[0] = publicNs
-			strings[0] = "*"
-		}
-
-		function parseMethodInfos()
-		{
-			var start:int = data.position
-			names[0] = new QName(publicNs,"*")
-			var method_count:int = readU32()
-			methods = []
-			for (var i:int=0; i < method_count; i++)
-			{
-				var m = methods[i] = new MethodInfo()
-				var param_count:int = readU32()
-				m.returnType = names[readU32()]
-				m.paramTypes = []
-				for (var j:int=0; j < param_count; j++)
-					m.paramTypes[j] = names[readU32()]
-				m.debugName = strings[readU32()]
-				m.flags = data.readByte()
-				if (m.flags & HAS_OPTIONAL)
-				{
-					// has_optional
-					var optional_count:int = readU32();
-					m.optionalValues = []
-					for( var k:int = param_count-optional_count; k < param_count; ++k)
-					{
-						var index = readU32()    // optional value index
-						var kind:int = data.readByte() // kind byte for each default value
-						if (index == 0)
-						{
-							// kind is ignored, default value is based on type
-							m.optionalValues[k] = undefined
-						}
-						else
-						{
-							if (!defaults[kind])
-								print("ERROR kind="+kind+" method_id " + i)
+                default:
+                    throw new Error("invalid kind " + data[data.position-1])
+                }
+
+            infoPrint("Cpool names count "+ n +" size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+            start = data.position
+
+            namespaces[0] = publicNs
+            strings[0] = "*"
+        }
+
+        function parseMethodInfos()
+        {
+            var start:int = data.position
+            names[0] = new QName(publicNs,"*")
+            var method_count:int = readU32()
+            methods = []
+            for (var i:int=0; i < method_count; i++)
+            {
+                var m = methods[i] = new MethodInfo()
+                var param_count:int = readU32()
+                m.returnType = names[readU32()]
+                m.paramTypes = []
+                for (var j:int=0; j < param_count; j++)
+                    m.paramTypes[j] = names[readU32()]
+                m.debugName = strings[readU32()]
+                m.flags = data.readByte()
+                if (m.flags & HAS_OPTIONAL)
+                {
+                    // has_optional
+                    var optional_count:int = readU32();
+                    m.optionalValues = []
+                    for( var k:int = param_count-optional_count; k < param_count; ++k)
+                    {
+                        var index = readU32()    // optional value index
+                        var kind:int = data.readByte() // kind byte for each default value
+                        if (index == 0)
+                        {
+                            // kind is ignored, default value is based on type
+                            m.optionalValues[k] = undefined
+                        }
+                        else
+                        {
+                            if (!defaults[kind])
+                                print("ERROR kind="+kind+" method_id " + i)
                             else
-							    m.optionalValues[k] = defaults[kind][index]
-						}
-					}
-				}
-				if (m.flags & HAS_ParamNames)
-				{
-					// has_paramnames
-					for( var k:int = 0; k < param_count; ++k)
+                                m.optionalValues[k] = defaults[kind][index]
+                        }
+                    }
+                }
+                if (m.flags & HAS_ParamNames)
+                {
+                    // has_paramnames
+                    for( var k:int = 0; k < param_count; ++k)
                     {
                         readU32();
                     }
                 }
-			}
-			infoPrint("MethodInfo count " +method_count+ " size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-		}
-
-		function parseMetadataInfos()
-		{
-			var count:int = readU32()
-			metadata = []
-			for (var i:int=0; i < count; i++)
-	        {
-				// MetadataInfo
-				var m = metadata[i] = new MetaData()
-				m.name = strings[readU32()];
-	            var values_count:int = readU32();
-	            var names:Array = []
-	            for(var q:int = 0; q < values_count; ++q)
-					names[q] = strings[readU32()] // name
-				for(var q:int = 0; q < values_count; ++q)
-					m[names[q]] = strings[readU32()] // value
-			}
-		}
-
-		function parseInstanceInfos()
-		{
-			var start:int = data.position
-			var count:int = readU32()
-			instances = []
-			for (var i:int=0; i < count; i++)
-	        {
-	        	var t = instances[i] = new Traits()
-	        	t.name = names[readU32()]
-	        	t.base = names[readU32()]
-	        	t.flags = data.readByte()
-				if (t.flags & 8)
-					t.protectedNs = namespaces[readU32()]
-	        	var interface_count = readU32()
-	        	for (var j:int=0; j < interface_count; j++)
-	        		t.interfaces[i] = names[readU32()]
-	        	var m = t.init = methods[readU32()]
-	        	m.name = t.name
-	        	m.kind = TRAIT_Method
-	        	m.id = -1
-	        	parseTraits(t)
-	        }
-			infoPrint("InstanceInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-		}
-
-		function parseTraits(t:Traits)
-		{
-			var namecount = readU32()
-			for (var i:int=0; i < namecount; i++)
-			{
-				var name = names[readU32()]
-				var tag = data.readByte()
-				var kind = tag & 0xf
-				var member
-				switch(kind) {
-				case TRAIT_Slot:
-				case TRAIT_Const:
-				case TRAIT_Class:
-					var slot = member = new SlotInfo()
-					slot.id = readU32()
-					t.slots[slot.id] = slot
-					if (kind==TRAIT_Slot || kind==TRAIT_Const)
-					{
-						slot.type = names[readU32()]
-						var index=readU32()
-						if (index)
-							slot.value = defaults[data.readByte()][index]
-					}
-					else // (kind == TRAIT_Class)
-					{
-						slot.value = classes[readU32()]
-					}
-					break;
-				case TRAIT_Method:
-				case TRAIT_Getter:
-				case TRAIT_Setter:
-					var disp_id = readU32()
-					var method = member = methods[readU32()]
-					t.methods[disp_id] = method
-					method.id = disp_id
-					//print("\t",traitKinds[kind],name,disp_id,method,"// disp_id", disp_id)
-					break;
-				}
-				if (!member)
-					print("error trait kind "+kind)
-				member.kind = kind
-				member.name = name
-				t.names[String(name)] = t.members[i] = member
-
-	            if ( (tag >> 4) & ATTR_metadata ) {
-					member.metadata = []
-					for(var j:int=0, mdCount:int=readU32(); j < mdCount; ++j)
-						member.metadata[j] = metadata[readU32()]
-				}
-			}
-		}
-
-		function parseClassInfos()
-		{
-			var start:int = data.position
-			var count:int = instances.length
-			classes = []
-			for (var i:int=0; i < count; i++)
-	        {
-	        	var t:Traits = classes[i] = new Traits()
-	        	t.init = methods[readU32()]
-	        	t.base = "Class"
-	        	t.itraits = instances[i]
-	        	t.name = t.itraits.name + "$"
-	        	t.init.name = t.itraits.name + "$cinit"
-	        	t.init.kind = TRAIT_Method
-	        	parseTraits(t)
-			}
-			infoPrint("ClassInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+"%")
-		}
-
-		function parseScriptInfos()
-		{
-			var start:int = data.position
-			var count:int = readU32()
-			scripts = []
-			for (var i:int=0; i < count; i++)
-	        {
-	        	var t = new Traits()
-				scripts[i] = t
-	        	t.name = "script" + i
-	        	t.base = names[0] // Object
-	        	t.init = methods[readU32()]
-	        	t.init.name = t.name + "$init"
-				t.init.kind = TRAIT_Method
-	        	parseTraits(t)
-	        }
-			infoPrint("ScriptInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-		}
-
-		function parseMethodBodies()
-		{
-			var start:int = data.position
-			var count:int = readU32()
-			for (var i:int=0; i < count; i++)
-	        {
-	        	var m = methods[readU32()]
-				m.max_stack = readU32()
-	        	m.local_count = readU32()
-	        	var initScopeDepth = readU32()
-	        	var maxScopeDepth = readU32()
-	        	m.max_scope = maxScopeDepth - initScopeDepth
-	        	var code_length = readU32()
-	        	m.code = new ByteArray()
-				m.code.endian = "littleEndian"
-	        	if (code_length > 0)
-		        	data.readBytes(m.code, 0, code_length)
-	       		var ex_count = readU32()
-	       		for (var j:int = 0; j < ex_count; j++)
-	       		{
-	       			var from = readU32()
-	       			var to = readU32()
-	       			var target = readU32()
-	       			var type = names[readU32()]
-					//print("magic " + magic.toString(16))
-					//if (magic >= (46<<16|16))
-						var name = names[readU32()];
-	       		}
-	       		parseTraits(m.activation = new Traits)
-	        }
-			infoPrint("MethodBodies size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
-		}
-
-		function dump(indent:String="")
-		{
-		    for each (var t in scripts)
-		    {
-			    dumpPrint(indent+t.name)
-			    t.dump(this,indent)
-			    t.init.dump(this,indent)
-		    }
-
-		    for each (var m in methods)
-		    {
-			    if (m.anon) {
-				    m.dump(this,indent)
-			    }
-		    }
-
-			infoPrint("OPCODE\tSIZE\t% OF "+totalSize)
-			var done = []
-			for (;;)
-			{
-				var max:int = -1;
-				var maxsize:int = 0;
-				for (var i:int=0; i < 256; i++)
-				{
-					if (opSizes[i] > maxsize && !done[i])
-					{
-						max = i;
-						maxsize = opSizes[i];
-					}
-				}
-				if (max == -1)
-					break;
-				done[max] = 1;
-				infoPrint(opNames[max]+"\t"+int(opSizes[max])+"\t"+int(100*opSizes[max]/totalSize)+"%")
-			}
-		}
-	}
-
-	class Rect
-	{
-		var nBits:int
-		var xMin:int, xMax:int
-		var yMin:int, yMax:int
-		public function toString()
-		{
-			return "[Rect "+xMin+" "+yMin+" "+xMax+" "+yMax+"]"
-		}
-	}
-
-	const stagDoABC					:int = 72;   // embedded .abc (AVM+) bytecode
-	const stagSymbolClass				:int = 76;
+            }
+            infoPrint("MethodInfo count " +method_count+ " size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+        }
+
+        function parseMetadataInfos()
+        {
+            var count:int = readU32()
+            metadata = []
+            for (var i:int=0; i < count; i++)
+            {
+                // MetadataInfo
+                var m = metadata[i] = new MetaData()
+                m.name = strings[readU32()];
+                var values_count:int = readU32();
+                var names:Array = []
+                for(var q:int = 0; q < values_count; ++q)
+                    names[q] = strings[readU32()] // name
+                for(var q:int = 0; q < values_count; ++q)
+                    m[names[q]] = strings[readU32()] // value
+            }
+        }
+
+        function parseInstanceInfos()
+        {
+            var start:int = data.position
+            var count:int = readU32()
+            instances = []
+            for (var i:int=0; i < count; i++)
+            {
+                var t = instances[i] = new Traits()
+                t.name = names[readU32()]
+                t.base = names[readU32()]
+                t.flags = data.readByte()
+                if (t.flags & 8)
+                    t.protectedNs = namespaces[readU32()]
+                var interface_count = readU32()
+                for (var j:int=0; j < interface_count; j++)
+                    t.interfaces[i] = names[readU32()]
+                var m = t.init = methods[readU32()]
+                m.name = t.name
+                m.kind = TRAIT_Method
+                m.id = -1
+                parseTraits(t)
+            }
+            infoPrint("InstanceInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+        }
+
+        function parseTraits(t:Traits)
+        {
+            var namecount = readU32()
+            for (var i:int=0; i < namecount; i++)
+            {
+                var name = names[readU32()]
+                var tag = data.readByte()
+                var kind = tag & 0xf
+                var member
+                switch(kind) {
+                case TRAIT_Slot:
+                case TRAIT_Const:
+                case TRAIT_Class:
+                    var slot = member = new SlotInfo()
+                    slot.id = readU32()
+                    t.slots[slot.id] = slot
+                    if (kind==TRAIT_Slot || kind==TRAIT_Const)
+                    {
+                        slot.type = names[readU32()]
+                        var index=readU32()
+                        if (index)
+                            slot.value = defaults[data.readByte()][index]
+                    }
+                    else // (kind == TRAIT_Class)
+                    {
+                        slot.value = classes[readU32()]
+                    }
+                    break;
+                case TRAIT_Method:
+                case TRAIT_Getter:
+                case TRAIT_Setter:
+                    var disp_id = readU32()
+                    var method = member = methods[readU32()]
+                    t.methods[disp_id] = method
+                    method.id = disp_id
+                    //print("\t",traitKinds[kind],name,disp_id,method,"// disp_id", disp_id)
+                    break;
+                }
+                if (!member)
+                    print("error trait kind "+kind)
+                member.kind = kind
+                member.name = name
+                t.names[String(name)] = t.members[i] = member
+
+                if ( (tag >> 4) & ATTR_metadata ) {
+                    member.metadata = []
+                    for(var j:int=0, mdCount:int=readU32(); j < mdCount; ++j)
+                        member.metadata[j] = metadata[readU32()]
+                }
+            }
+        }
+
+        function parseClassInfos()
+        {
+            var start:int = data.position
+            var count:int = instances.length
+            classes = []
+            for (var i:int=0; i < count; i++)
+            {
+                var t:Traits = classes[i] = new Traits()
+                t.init = methods[readU32()]
+                t.base = "Class"
+                t.itraits = instances[i]
+                t.name = t.itraits.name + "$"
+                t.init.name = t.itraits.name + "$cinit"
+                t.init.kind = TRAIT_Method
+                parseTraits(t)
+            }
+            infoPrint("ClassInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+"%")
+        }
+
+        function parseScriptInfos()
+        {
+            var start:int = data.position
+            var count:int = readU32()
+            scripts = []
+            for (var i:int=0; i < count; i++)
+            {
+                var t = new Traits()
+                scripts[i] = t
+                t.name = "script" + i
+                t.base = names[0] // Object
+                t.init = methods[readU32()]
+                t.init.name = t.name + "$init"
+                t.init.kind = TRAIT_Method
+                parseTraits(t)
+            }
+            infoPrint("ScriptInfo size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+        }
+
+        function parseMethodBodies()
+        {
+            var start:int = data.position
+            var count:int = readU32()
+            for (var i:int=0; i < count; i++)
+            {
+                var m = methods[readU32()]
+                m.max_stack = readU32()
+                m.local_count = readU32()
+                var initScopeDepth = readU32()
+                var maxScopeDepth = readU32()
+                m.max_scope = maxScopeDepth - initScopeDepth
+                var code_length = readU32()
+                m.code = new ByteArray()
+                m.code.endian = "littleEndian"
+                if (code_length > 0)
+                    data.readBytes(m.code, 0, code_length)
+                var ex_count = readU32()
+                for (var j:int = 0; j < ex_count; j++)
+                {
+                    var from = readU32()
+                    var to = readU32()
+                    var target = readU32()
+                    var type = names[readU32()]
+                    //print("magic " + magic.toString(16))
+                    //if (magic >= (46<<16|16))
+                        var name = names[readU32()];
+                }
+                parseTraits(m.activation = new Traits)
+            }
+            infoPrint("MethodBodies size "+(data.position-start)+" "+int(100*(data.position-start)/data.length)+" %")
+        }
+
+        function dump(indent:String="")
+        {
+            for each (var t in scripts)
+            {
+                dumpPrint(indent+t.name)
+                t.dump(this,indent)
+                t.init.dump(this,indent)
+            }
+
+            for each (var m in methods)
+            {
+                if (m.anon) {
+                    m.dump(this,indent)
+                }
+            }
+
+            infoPrint("OPCODE\tSIZE\t% OF "+totalSize)
+            var done = []
+            for (;;)
+            {
+                var max:int = -1;
+                var maxsize:int = 0;
+                for (var i:int=0; i < 256; i++)
+                {
+                    if (opSizes[i] > maxsize && !done[i])
+                    {
+                        max = i;
+                        maxsize = opSizes[i];
+                    }
+                }
+                if (max == -1)
+                    break;
+                done[max] = 1;
+                infoPrint(opNames[max]+"\t"+int(opSizes[max])+"\t"+int(100*opSizes[max]/totalSize)+"%")
+            }
+        }
+    }
+
+    class Rect
+    {
+        var nBits:int
+        var xMin:int, xMax:int
+        var yMin:int, yMax:int
+        public function toString()
+        {
+            return "[Rect "+xMin+" "+yMin+" "+xMax+" "+yMax+"]"
+        }
+    }
+
+    const stagDoABC                 :int = 72;   // embedded .abc (AVM+) bytecode
+    const stagSymbolClass               :int = 76;
     const stagDoABC2                  :int = 82;   // revised ABC version with a name

-	var tagNames:Array = [
-		"End",					// 00
-		"ShowFrame",			// 01
-		"DefineShape",			// 02
-		"FreeCharacter",		// 03
-		"PlaceObject",			// 04
-		"RemoveObject",			// 05
-		"DefineBits",			// 06
-		"DefineButton",			// 07
-		"JPEGTables",			// 08
-		"SetBackgroundColor",	// 09
-
-		"DefineFont",			// 10
-		"DefineText",			// 11
-		"DoAction",				// 12
-		"DefineFontInfo",		// 13
-
-		"DefineSound",			// 14
-		"StartSound",			// 15
-		"StopSound",			// 16
-
-		"DefineButtonSound",	// 17
-
-		"SoundStreamHead",		// 18
-		"SoundStreamBlock",		// 19
-
-		"DefineBitsLossless",	// 20
-		"DefineBitsJPEG2",		// 21
-
-		"DefineShape2",			// 22
-		"DefineButtonCxform",	// 23
-
-		"Protect",				// 24
-
-		"PathsArePostScript",	// 25
-
-		"PlaceObject2",			// 26
-		"27 (invalid)",			// 27
-		"RemoveObject2",		// 28
-
-		"SyncFrame",			// 29
-		"30 (invalid)",			// 30
-		"FreeAll",				// 31
-
-		"DefineShape3",			// 32
-		"DefineText2",			// 33
-		"DefineButton2",		// 34
-		"DefineBitsJPEG3",		// 35
-		"DefineBitsLossless2",	// 36
-		"DefineEditText",		// 37
-
-		"DefineVideo",			// 38
-
-		"DefineSprite",			// 39
-		"NameCharacter",		// 40
-		"ProductInfo",			// 41
-		"DefineTextFormat",		// 42
-		"FrameLabel",			// 43
-		"DefineBehavior",		// 44
-		"SoundStreamHead2",		// 45
-		"DefineMorphShape",		// 46
-		"FrameTag",				// 47
-		"DefineFont2",			// 48
-		"GenCommand",			// 49
-		"DefineCommandObj",		// 50
-		"CharacterSet",			// 51
-		"FontRef",				// 52
-
-		"DefineFunction",		// 53
-		"PlaceFunction",		// 54
-
-		"GenTagObject",			// 55
-
-		"ExportAssets",			// 56
-		"ImportAssets",			// 57
-
-		"EnableDebugger",		// 58
-
-		"DoInitAction",			// 59
-		"DefineVideoStream",	// 60
-		"VideoFrame",			// 61
-
-		"DefineFontInfo2",		// 62
-		"DebugID", 				// 63
-		"EnableDebugger2", 		// 64
-        "ScriptLimits", 		// 65
-
-        "SetTabIndex", 			// 66
-
-		"DefineShape4", 		// 67
-		"DefineMorphShape2", 	// 68
-
-		"FileAttributes", 		// 69
-
-		"PlaceObject3", 		// 70
-		"ImportAssets2", 		// 71
-
-		"DoABC", 				// 72
-		"73 (invalid)",			// 73
-		"74 (invalid)",			// 74
-		"75 (invalid)",			// 75
-		"SymbolClass",			// 76
+    var tagNames:Array = [
+        "End",                  // 00
+        "ShowFrame",            // 01
+        "DefineShape",          // 02
+        "FreeCharacter",        // 03
+        "PlaceObject",          // 04
+        "RemoveObject",         // 05
+        "DefineBits",           // 06
+        "DefineButton",         // 07
+        "JPEGTables",           // 08
+        "SetBackgroundColor",   // 09
+
+        "DefineFont",           // 10
+        "DefineText",           // 11
+        "DoAction",             // 12
+        "DefineFontInfo",       // 13
+
+        "DefineSound",          // 14
+        "StartSound",           // 15
+        "StopSound",            // 16
+
+        "DefineButtonSound",    // 17
+
+        "SoundStreamHead",      // 18
+        "SoundStreamBlock",     // 19
+
+        "DefineBitsLossless",   // 20
+        "DefineBitsJPEG2",      // 21
+
+        "DefineShape2",         // 22
+        "DefineButtonCxform",   // 23
+
+        "Protect",              // 24
+
+        "PathsArePostScript",   // 25
+
+        "PlaceObject2",         // 26
+        "27 (invalid)",         // 27
+        "RemoveObject2",        // 28
+
+        "SyncFrame",            // 29
+        "30 (invalid)",         // 30
+        "FreeAll",              // 31
+
+        "DefineShape3",         // 32
+        "DefineText2",          // 33
+        "DefineButton2",        // 34
+        "DefineBitsJPEG3",      // 35
+        "DefineBitsLossless2",  // 36
+        "DefineEditText",       // 37
+
+        "DefineVideo",          // 38
+
+        "DefineSprite",         // 39
+        "NameCharacter",        // 40
+        "ProductInfo",          // 41
+        "DefineTextFormat",     // 42
+        "FrameLabel",           // 43
+        "DefineBehavior",       // 44
+        "SoundStreamHead2",     // 45
+        "DefineMorphShape",     // 46
+        "FrameTag",             // 47
+        "DefineFont2",          // 48
+        "GenCommand",           // 49
+        "DefineCommandObj",     // 50
+        "CharacterSet",         // 51
+        "FontRef",              // 52
+
+        "DefineFunction",       // 53
+        "PlaceFunction",        // 54
+
+        "GenTagObject",         // 55
+
+        "ExportAssets",         // 56
+        "ImportAssets",         // 57
+
+        "EnableDebugger",       // 58
+
+        "DoInitAction",         // 59
+        "DefineVideoStream",    // 60
+        "VideoFrame",           // 61
+
+        "DefineFontInfo2",      // 62
+        "DebugID",              // 63
+        "EnableDebugger2",      // 64
+        "ScriptLimits",         // 65
+
+        "SetTabIndex",          // 66
+
+        "DefineShape4",         // 67
+        "DefineMorphShape2",    // 68
+
+        "FileAttributes",       // 69
+
+        "PlaceObject3",         // 70
+        "ImportAssets2",        // 71
+
+        "DoABC",                // 72
+        "73 (invalid)",         // 73
+        "74 (invalid)",         // 74
+        "75 (invalid)",         // 75
+        "SymbolClass",          // 76
         "77 (invalid)",         // 77
         "78 (invalid)",         // 78
         "79 (invalid)",         // 79
@@ -1066,232 +1066,232 @@
         "81 (invalid)",         // 81
         "DoABC2",               // 82
         "83 (invalid)"          // 83
-	]
-
-
-	class Swf
-	{
-		private var bitPos:int
-		private var bitBuf:int
-
-		private var data:ByteArray
-
-		function Swf(data:ByteArray)
-		{
-			this.data = data
-			infoPrint("size "+decodeRect())
-			infoPrint("frame rate "+(data.readUnsignedByte()<<8|data.readUnsignedByte()))
-			infoPrint("frame count "+data.readUnsignedShort())
-			decodeTags()
-		}
-
-		private function decodeTags()
-		{
-	        var type:int, h:int, length:int
-			var offset:int
-
-	        while (data.position < data.length)
-	        {
-	            type = (h = data.readUnsignedShort()) >> 6;
-
-	            if (((length = h & 0x3F) == 0x3F))
-	                length = data.readInt();
-
-				infoPrint(tagNames[type]+" "+length+"b "+int(100*length/data.length)+"%")
-				switch (type)
-				{
-				case 0: return
-				case stagDoABC2:
-					var pos1:int = data.position
-					data.readInt()
-					infoPrint("\nabc name "+readString())
-					length -= (data.position-pos1)
-					// fall through
-				case stagDoABC:
-					var data2 = new ByteArray
-					data2.endian = "littleEndian"
-					data.readBytes(data2,0,length)
-					new Abc(data2).dump("  ")
-					infoPrint("")
-					break
-				default:
-					data.position += length
-				}
-	        }
-		}
-
-		private function readString():String
-		{
-			var s:String = ""
-			var c:int
-
-			while (c=data.readUnsignedByte())
-				s += String.fromCharCode(c)
-
-			return s
-		}
-
-		private function syncBits()
-		{
-			bitPos = 0
-		}
-
-	    private function decodeRect():Rect
-	    {
-	        syncBits();
-
-	        var rect:Rect = new Rect();
-
-	        var nBits:int = readUBits(5)
-	        rect.xMin = readSBits(nBits);
-	        rect.xMax = readSBits(nBits);
-	        rect.yMin = readSBits(nBits);
-	        rect.yMax = readSBits(nBits);
-
-	        return rect;
-	    }
-
-	    function readSBits(numBits:int):int
-	    {
-	        if (numBits > 32)
-	            throw new Error("Number of bits > 32");
-
-	        var num:int = readUBits(numBits);
-	        var shift:int = 32-numBits;
-	        // sign extension
-	        num = (num << shift) >> shift;
-	        return num;
-	    }
-
-		function readUBits(numBits:int):uint
-	    {
-	        if (numBits == 0)
-	        	return 0
-
-	        var bitsLeft:int = numBits;
-	        var result:int = 0;
-
-	        if (bitPos == 0) //no value in the buffer - read a byte
-	        {
-	            bitBuf = data.readUnsignedByte()
-	            bitPos = 8;
-	        }
-
-	        while (true)
-	        {
-	            var shift:int = bitsLeft - bitPos;
-	            if (shift > 0)
-	            {
-	                // Consume the entire buffer
-	                result |= bitBuf << shift;
-	                bitsLeft -= bitPos;
-
-	                // Get the next byte from the input stream
-	                bitBuf = data.readUnsignedByte();
-	                bitPos = 8;
-	            }
-	            else
-	            {
-	                // Consume a portion of the buffer
-	                result |= bitBuf >> -shift;
-	                bitPos -= bitsLeft;
-	                bitBuf &= 0xff >> (8 - bitPos); // mask off the consumed bits
-
-	//                if (print) System.out.println("  read"+numBits+" " + result);
-	                return result;
-	            }
-	        }
-	    }
-    }
-
-	function help()
-	{
-		print(usage);
-		System.exit(1)
-	}
-
-	function processArg(arg:String)
-	{
-		if (arg == '-a')
-			doExtractAbc = true;
-		else if (arg == '-i')
-			doExtractInfo = true;
-		else
-		{
-			print('Unknown option '+arg)
-			help()
-		}
-	}
-
-	function nextAbcFname():String
-	{
-		var s = currentFname
-		if (currentFcount>0)
-			s = s.concat(currentFcount);
-		currentFcount++
-		return s+'.abc'
-	}
-
-	// main
-	var doExtractAbc = false
-	var doExtractInfo = false
-	var currentFname = ''
-	var currentFcount = 0
-	for each (var file in System.argv)
-	{
-		if (file.indexOf('-')==0)
-		{
-			processArg(file)
-			continue
-		}
-
-		var x;
-		if ((x = file.lastIndexOf(".swf")) != -1 || (x = file.lastIndexOf(".swc")) != -1)
-		    currentFname = file.substring(0,x);
-		else
-			currentFname = file;
-		var data:ByteArray = ByteArray.readFile(file)
-		data.endian = "littleEndian"
-		var version:uint = data.readUnsignedInt()
-		switch (version) {
-		case 46<<16|14:
-		case 46<<16|15:
-		case 46<<16|16:
-			var abc:Abc = new Abc(data)
-			abc.dump()
-			break
-		case 67|87<<8|83<<16|10<<24: // SWC10
-		case 67|87<<8|83<<16|9<<24: // SWC9
-		case 67|87<<8|83<<16|8<<24: // SWC8
-		case 67|87<<8|83<<16|7<<24: // SWC7
-		case 67|87<<8|83<<16|6<<24: // SWC6
-			var udata:ByteArray = new ByteArray
-			udata.endian = "littleEndian"
-			data.position = 8
-			data.readBytes(udata,0,data.length-data.position)
-			var csize:int = udata.length
-			udata.uncompress()
-			infoPrint("decompressed swf "+csize+" -> "+udata.length)
-			udata.position = 0
-		    /*var swf:Swf =*/ new Swf(udata)
-			break
-		case 70|87<<8|83<<16|10<<24: // SWC10
-		case 70|87<<8|83<<16|9<<24: // SWC9
-		case 70|87<<8|83<<16|8<<24: // SWC8
-		case 70|87<<8|83<<16|7<<24: // SWC7
-		case 70|87<<8|83<<16|6<<24: // SWC6
-		case 70|87<<8|83<<16|5<<24: // SWC5
-		case 70|87<<8|83<<16|4<<24: // SWC4
-			data.position = 8 // skip header and length
-		    /*var swf:Swf =*/ new Swf(data)
-			break
-		default:
-			print('unknown format '+version)
-			break
-		}
-	}
-
-	if (System.argv<2)
-		help();
+    ]
+
+
+    class Swf
+    {
+        private var bitPos:int
+        private var bitBuf:int
+
+        private var data:ByteArray
+
+        function Swf(data:ByteArray)
+        {
+            this.data = data
+            infoPrint("size "+decodeRect())
+            infoPrint("frame rate "+(data.readUnsignedByte()<<8|data.readUnsignedByte()))
+            infoPrint("frame count "+data.readUnsignedShort())
+            decodeTags()
+        }
+
+        private function decodeTags()
+        {
+            var type:int, h:int, length:int
+            var offset:int
+
+            while (data.position < data.length)
+            {
+                type = (h = data.readUnsignedShort()) >> 6;
+
+                if (((length = h & 0x3F) == 0x3F))
+                    length = data.readInt();
+
+                infoPrint(tagNames[type]+" "+length+"b "+int(100*length/data.length)+"%")
+                switch (type)
+                {
+                case 0: return
+                case stagDoABC2:
+                    var pos1:int = data.position
+                    data.readInt()
+                    infoPrint("\nabc name "+readString())
+                    length -= (data.position-pos1)
+                    // fall through
+                case stagDoABC:
+                    var data2 = new ByteArray
+                    data2.endian = "littleEndian"
+                    data.readBytes(data2,0,length)
+                    new Abc(data2).dump("  ")
+                    infoPrint("")
+                    break
+                default:
+                    data.position += length
+                }
+            }
+        }
+
+        private function readString():String
+        {
+            var s:String = ""
+            var c:int
+
+            while (c=data.readUnsignedByte())
+                s += String.fromCharCode(c)
+
+            return s
+        }
+
+        private function syncBits()
+        {
+            bitPos = 0
+        }
+
+        private function decodeRect():Rect
+        {
+            syncBits();
+
+            var rect:Rect = new Rect();
+
+            var nBits:int = readUBits(5)
+            rect.xMin = readSBits(nBits);
+            rect.xMax = readSBits(nBits);
+            rect.yMin = readSBits(nBits);
+            rect.yMax = readSBits(nBits);
+
+            return rect;
+        }
+
+        function readSBits(numBits:int):int
+        {
+            if (numBits > 32)
+                throw new Error("Number of bits > 32");
+
+            var num:int = readUBits(numBits);
+            var shift:int = 32-numBits;
+            // sign extension
+            num = (num << shift) >> shift;
+            return num;
+        }
+
+        function readUBits(numBits:int):uint
+        {
+            if (numBits == 0)
+                return 0
+
+            var bitsLeft:int = numBits;
+            var result:int = 0;
+
+            if (bitPos == 0) //no value in the buffer - read a byte
+            {
+                bitBuf = data.readUnsignedByte()
+                bitPos = 8;
+            }
+
+            while (true)
+            {
+                var shift:int = bitsLeft - bitPos;
+                if (shift > 0)
+                {
+                    // Consume the entire buffer
+                    result |= bitBuf << shift;
+                    bitsLeft -= bitPos;
+
+                    // Get the next byte from the input stream
+                    bitBuf = data.readUnsignedByte();
+                    bitPos = 8;
+                }
+                else
+                {
+                    // Consume a portion of the buffer
+                    result |= bitBuf >> -shift;
+                    bitPos -= bitsLeft;
+                    bitBuf &= 0xff >> (8 - bitPos); // mask off the consumed bits
+
+    //                if (print) System.out.println("  read"+numBits+" " + result);
+                    return result;
+                }
+            }
+        }
+    }
+
+    function help()
+    {
+        print(usage);
+        System.exit(1)
+    }
+
+    function processArg(arg:String)
+    {
+        if (arg == '-a')
+            doExtractAbc = true;
+        else if (arg == '-i')
+            doExtractInfo = true;
+        else
+        {
+            print('Unknown option '+arg)
+            help()
+        }
+    }
+
+    function nextAbcFname():String
+    {
+        var s = currentFname
+        if (currentFcount>0)
+            s = s.concat(currentFcount);
+        currentFcount++
+        return s+'.abc'
+    }
+
+    // main
+    var doExtractAbc = false
+    var doExtractInfo = false
+    var currentFname = ''
+    var currentFcount = 0
+    for each (var file in System.argv)
+    {
+        if (file.indexOf('-')==0)
+        {
+            processArg(file)
+            continue
+        }
+
+        var x;
+        if ((x = file.lastIndexOf(".swf")) != -1 || (x = file.lastIndexOf(".swc")) != -1)
+            currentFname = file.substring(0,x);
+        else
+            currentFname = file;
+        var data:ByteArray = ByteArray.readFile(file)
+        data.endian = "littleEndian"
+        var version:uint = data.readUnsignedInt()
+        switch (version) {
+        case 46<<16|14:
+        case 46<<16|15:
+        case 46<<16|16:
+            var abc:Abc = new Abc(data)
+            abc.dump()
+            break
+        case 67|87<<8|83<<16|10<<24: // SWC10
+        case 67|87<<8|83<<16|9<<24: // SWC9
+        case 67|87<<8|83<<16|8<<24: // SWC8
+        case 67|87<<8|83<<16|7<<24: // SWC7
+        case 67|87<<8|83<<16|6<<24: // SWC6
+            var udata:ByteArray = new ByteArray
+            udata.endian = "littleEndian"
+            data.position = 8
+            data.readBytes(udata,0,data.length-data.position)
+            var csize:int = udata.length
+            udata.uncompress()
+            infoPrint("decompressed swf "+csize+" -> "+udata.length)
+            udata.position = 0
+            /*var swf:Swf =*/ new Swf(udata)
+            break
+        case 70|87<<8|83<<16|10<<24: // SWC10
+        case 70|87<<8|83<<16|9<<24: // SWC9
+        case 70|87<<8|83<<16|8<<24: // SWC8
+        case 70|87<<8|83<<16|7<<24: // SWC7
+        case 70|87<<8|83<<16|6<<24: // SWC6
+        case 70|87<<8|83<<16|5<<24: // SWC5
+        case 70|87<<8|83<<16|4<<24: // SWC4
+            data.position = 8 // skip header and length
+            /*var swf:Swf =*/ new Swf(data)
+            break
+        default:
+            print('unknown format '+version)
+            break
+        }
+    }
+
+    if (System.argv<2)
+        help();
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260260 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/Iris.as
+++ frameworks/projects/framework/src/mx/effects/Iris.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2006 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.effects
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1290583 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/advancedgrids/src/mx/olap/OLAPAttribute.as
+++ frameworks/projects/advancedgrids/src/mx/olap/OLAPAttribute.as
@@ -0,0 +1,486 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.olap
+{
+import flash.utils.Dictionary;
+
+import mx.collections.IList;
+import mx.collections.ArrayCollection;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="levels", kind="property")]
+[Exclude(name="elements", kind="property")]
+
+/**
+ *  The OLAPAttribute class represents a single attribute of an OLAPDimension.
+ *  Use this class to associate a field of the flat data that is used to populate
+ *  an OLAP cube with a level of the dimension.
+ *
+ *  @mxml
+ *

+ *  The <mx:OLAPAttribute> tag inherits all of the tag attributes
+ *  of its superclass, and adds the following tag attributes:
+ *

+ *

+ *  <mx:OLAPAttribute
+ *    Properties
+ *    dataField=""
+ *  />
+ *.
+ *  @see mx.olap.OLAPDimension
+ *  @see mx.olap.OLAPLevel
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class OLAPAttribute extends OLAPHierarchy implements IOLAPAttribute
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param name The name of the OLAPAttribute instance.
+     *  You use this parameter to associate the OLAPAttribute instance with an OLAPLevel instance.
+     *
+     *  @param displayName The name of the attribute, as a String, which can be used for display.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function OLAPAttribute(name:String = null, displayName:String=null)
+    {
+        super(name, displayName);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    private var uniqueChildrenMap:Dictionary = new Dictionary(true);
+
+    private var uniqueMembers:IList = new ArrayCollection;
+
+    private var singleLevel:OLAPLevel;
+
+    mx_internal var userDataFunction:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // allLevels
+    //----------------------------------
+
+    /**
+     * @private
+     */
+    override mx_internal function get allLevels():IList
+    {
+        return new ArrayCollection([allLevel, singleLevel]);
+    }
+
+    //----------------------------------
+    // hasAll
+    //----------------------------------
+
+    /**
+     *  Contains true becasue attributes are assumed to be aggregatable
+     *  and all member is present.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function get hasAll():Boolean
+    {
+        //can this flag be false?
+        //if the attribute is not aggregatable this can be false
+        //but we are not supporting this as of now
+        return true;
+    }
+
+    //----------------------------------
+    // members
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function get members():IList
+    {
+        //TODO ***** we need to send the all member here.
+        var temp:ArrayCollection = new ArrayCollection(uniqueMembers.toArray());
+        temp.addItemAt(super.findMember(allMemberName), 0);
+
+        return temp;
+    }
+
+    //----------------------------------
+    // children
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function get children():IList
+    {
+        return uniqueMembers;
+    }
+
+    //----------------------------------
+    // levels
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set levels(value:IList):void
+    {
+        // attribute doesn't allow setting up of levels by users
+        // it has its own level creation logic
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // userHierarchy
+    //----------------------------------
+
+    private var _userHierarchy:IOLAPHierarchy;
+
+    mx_internal function get userHierarchy():IOLAPHierarchy
+    {
+        return _userHierarchy;
+    }
+
+    mx_internal function set userHierarchy(value:IOLAPHierarchy):void
+    {
+        _userHierarchy = value;
+    }
+
+    //----------------------------------
+    // userHierarchyLevel
+    //----------------------------------
+
+    private var _userHierarchyLevel:OLAPLevel;
+
+    mx_internal function get userHierarchyLevel():OLAPLevel
+    {
+        return _userHierarchyLevel;
+    }
+
+    mx_internal function set userHierarchyLevel(value:OLAPLevel):void
+    {
+        _userHierarchyLevel = value;
+    }
+
+    //----------------------------------
+    // dataField
+    //----------------------------------
+
+    private var _dataField:String;
+
+    /**
+     *  The field of the input data set that provides the data for
+     *  this OLAPAttribute instance.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function set dataField(value:String):void
+    {
+        _dataField = value;
+    }
+
+    /**
+     * @private
+     */
+    public function get dataField():String
+    {
+        return _dataField;
+    }
+
+    //----------------------------------
+    // dataFunction
+    //----------------------------------
+
+    /**
+     * @private
+     */
+    protected var _dataFunction:Function = internalDataFunction;
+
+    /**
+    *  A callback function that returns the actual data for the attribute.
+    *  Use this callback function to return computed data based on the
+    *  actual data. For example, you can return the month name as a String
+    *  from actual date that represents the month as a number.
+    *  Or, you can calculate a value.
+    *  For example, your input data contains the ages of people,
+    *  such as 1, 4, 9, 10, 12, 15, or 20.
+    *  Your callback function can return an age group
+    *  that contains the age, as in 1-10, or 11-20.
+    *
+    *
The signature of the callback function is:

+    *
+    *

+    *      function myDataFunction(rowData:Object, dataField:String):Object;

+    *
+    *  where rowData contains the data for the row of
+    *  the input flat data, and dataField contains
+    *  the name of the data field.
+    *
+    *
The function can return a String or a Number.

+    *
+    *
The following example returns the age group for each age value
+    *  in the flat data:

+    *
+    *

+    *      private function ageGroupingHandler(rowData:Object, field:String):Object
+    *      {
+    *          return rowData[field] / 10;
+    *      }

+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
+    */
+    public function get dataFunction():Function
+    {
+        return _dataFunction;
+    }
+
+    public function set dataFunction(value:Function):void
+    {
+        if (value != null)
+        {
+            _dataFunction = value;
+            userDataFunction = true;
+        }
+        else
+        {
+            _dataFunction = internalDataFunction;
+            userDataFunction = false;
+        }
+    }
+
+    /**
+     *  User supplied callback function that would be used to compare
+     *  the data elements while sorting the data. By default the data
+     *  members would be compared directly.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var dataCompareFunction:Function = internalDataCompareFunction;
+
+    /**
+     *  A callback function that returns the display name of a member element.
+     *  Flex calls this function for each member added
+     *  to the OLAPAttribute instance.
+     *
+     *
The function signature is:

+     *
+     *

+     *      function myDisplayNameFunction(memberName:String):String

+     *
+     *
where memberName contains the name of the element.

+     *
+     *
The function returns the display name of the element.

+     *
+     *
The following example converts a numeric group name, such as 1,2, or 3
+     *  into display names "0-9", "10-19":

+     *
+     *

+     *      private function myDispFunction(name:String):String
+     *      {
+     *          var value:int = parseInt(name);
+     *          return String((value)*10 + " - ") + String((value+1)*10-1);
+     *      }

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var displayNameFunction:Function;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @private
+     */
+    override public function findLevel(name:String):IOLAPLevel
+    {
+        return null;
+    }
+
+
+    override mx_internal function processData(data:Object):void
+    {
+        var name:String = dataFunction(data, dataField);
+        if (!uniqueChildrenMap[name])
+        {
+            var m:IOLAPMember = singleLevel.createMember(allMember, name);
+
+            if (displayNameFunction != null)
+                OLAPMember(m).displayName = displayNameFunction(name);
+            uniqueChildrenMap[m.name] = m;
+            uniqueMembers.addItem(m);
+        }
+    }
+
+    /**
+     * @private
+     */
+    override mx_internal function refresh():void
+    {
+    	uniqueChildrenMap = new Dictionary(true);
+    	uniqueMembers = new ArrayCollection();
+
+        if (!super.findLevel(name))
+        {
+            createAllLevelIfRequired();
+
+            singleLevel = createLevel(name);
+
+            OLAPLevel(allLevel).refresh();
+            singleLevel.refresh();
+
+            if (userHierarchyLevel)
+            {
+                if (userHierarchyLevel.depth == 1)
+                    OLAPAttributeLevel(allLevel).userLevel = OLAPHierarchy(userHierarchy).allLevel;
+                OLAPAttributeLevel(singleLevel).userLevel = userHierarchyLevel;
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function createAllLevelIfRequired():void
+    {
+        var level:OLAPLevel;
+        if (hasAll)
+        {
+            //check if we don't have all level and member
+            // if we don't have create them
+            level = _levelMap[allLevelName];
+            if (!level)
+            {
+                //level = createLevel(allLevelName);
+                level = new OLAPAttributeLevel(allLevelName);
+                level.hierarchy = this;
+                level.dimension = dimension;
+                level.attributeName = name;
+                allLevel = level;
+                allMember = level.createMember(null, allMemberName) as OLAPMember;
+                allMember.setIsAll(true);
+            }
+        }
+        else
+        {
+            allLevel = null;
+            allMember = null;
+            level = _levelMap[allLevelName];
+            if (level)
+            {
+                var index:int = _levels.getItemIndex(level);
+                if (index > -1)
+                    _levels.removeItemAt(index);
+                delete _levelMap[allLevelName];
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override mx_internal function createLevel(name:String):OLAPLevel
+    {
+        var l:OLAPAttributeLevel = new OLAPAttributeLevel(name);
+        l.hierarchy = this;
+        l.dimension = dimension;
+        l.attributeName = name;
+        _levels.addItem(l);
+        _levelMap[name] = l;
+
+        return l;
+    }
+
+    /**
+     *  @private
+     */
+    private function internalDataFunction(rowData:Object, dataField:String):Object
+    {
+        return rowData[dataField];
+    }
+
+    /**
+     *  @private
+     */
+    private function internalDataCompareFunction(data1:Object, data2:Object):int
+    {
+        var value1:Object = internalDataFunction(data1, dataField);
+        var value2:Object = internalDataFunction(data2, dataField);
+
+        if (value1 < value2)
+            return -1;
+        if (value1 > value2)
+            return 1;
+        return 0;
+
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1258501 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/binding/BindingManager.as
+++ frameworks/projects/framework/src/mx/binding/BindingManager.as
@@ -0,0 +1,199 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.binding
+{
+
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ *  @private
+ */
+public class BindingManager
+{
+    include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+     *  Store a Binding for the destination relative to the passed in document.
+	 *  We don't hold a list of bindings per destination
+	 *  even though it is possible to have multiple.
+     *  The reason is that when we refresh the last binding will
+	 *  always win anyway, so why execute the ones that will lose.
+     *
+     *  @param document The document that this binding relates to.
+	 *
+     *  @param destStr The destination field of this binding.
+	 *
+     *  @param b The binding itself.
+     */
+    public static function addBinding(document:Object, destStr:String,
+									  b:Binding):void
+    {
+        if (!document._bindingsByDestination)
+        {
+            document._bindingsByDestination = {};
+            document._bindingsBeginWithWord = {};
+        }
+
+        document._bindingsByDestination[destStr] = b;
+        document._bindingsBeginWithWord[getFirstWord(destStr)] = true;
+    }
+
+    /**
+     *  Set isEnabled for all bindings associated with a document.
+     *
+     *  @param document The document that contains the bindings.
+     */
+    public static function setEnabled(document:Object, isEnabled:Boolean):void
+    {
+        if ((document is IBindingClient) && document._bindings)
+        {
+            var bindings:Array = document._bindings as Array;
+
+            for (var i:uint = 0; i < bindings.length; i++)
+            {
+                var binding:Binding = bindings[i];
+                binding.isEnabled = isEnabled;
+            }
+        }
+    }
+
+    /**
+     *  Execute all bindings that bind into the specified object.
+     *
+     *  @param document The document that this binding relates to.
+	 *
+     *  @param destStr The destination field that needs to be refreshed.
+	 *
+     *  @param destObj The actual destination object
+	 *  (used for RepeatableBinding).
+     */
+    public static function executeBindings(document:Object,
+                                           destStr:String,
+										   destObj:Object):void
+    {
+        // Bail if this method is accidentally called with an empty or
+        // null destination string. Otherwise, all bindings will
+        // be executed!
+        if (!destStr || (destStr == ""))
+            return;
+
+        // Flex 3 documents will implement IBindingClient when using
+        // data binding.  Flex 2.X document's will have a non-null
+        // public _bindingsByDestination variable.
+        if (document &&
+            (document is IBindingClient || document.hasOwnProperty("_bindingsByDestination")) &&
+            document._bindingsByDestination &&
+            document._bindingsBeginWithWord[getFirstWord(destStr)])
+        {
+            for (var binding:String in document._bindingsByDestination)
+            {
+                // If we have been told to execute bindings into a UIComponent
+                // or Repeater with id "a", we want to execute all bindings
+                // whose destination strings look like "a", "a.b", "a.b.c",
+                // "a['b']", etc. but not "aa.bb", "b.a", "b.a.c", "b['a']",
+                // etc.
+
+                // Currently, the only way that this method is used by the
+                // framework is when the destStr passed in is the id of a
+                // UIComponent or Repeater.
+
+                // However, advanced users can call
+                // BindingManager.executeBindings() and pass a compound
+                // destStr like "a.b.c". This has a gotcha: If they have
+                // written <mx:Binding> tags with destination attributes
+                // like "a['b'].c.d" rather than "a.b.c.d", these will
+                // not get executed. They should pass the same form of
+                // destStr to executeBindings() as they used in their
+                // Binding tags.
+
+                if (binding.charAt(0) == destStr.charAt(0))
+                {
+                    if (binding.indexOf(destStr + ".") == 0 ||
+                        binding.indexOf(destStr + "[") == 0 ||
+                        binding == destStr)
+                    {
+                        // If this is a RepeatableBindings, execute it on just the
+                        // specified object, not on all its repeated siblings.  For
+                        // example, if we are instantiating o[2][3], we don't want to also
+                        // refresh o[0][0], o[0][1], etc.
+                        document._bindingsByDestination[binding].execute(destObj);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+	 *  @private
+	 */
+	private static function getFirstWord(destStr:String):String
+    {
+        // indexPeriod and indexBracket will be equal only if they
+        // both are -1.
+        var indexPeriod:int = destStr.indexOf(".");
+        var indexBracket:int = destStr.indexOf("[");
+        if (indexPeriod == indexBracket)
+            return destStr;
+
+        // Get the characters leading up to the first period or
+        // bracket.
+        var minIndex:int = Math.min(indexPeriod, indexBracket);
+        if (minIndex == -1)
+            minIndex = Math.max(indexPeriod, indexBracket);
+
+        return destStr.substr(0, minIndex);
+    }
+
+    /**
+     *  @private
+     */
+    internal static var debugDestinationStrings:Object = {};
+
+    /**
+     *  Enables debugging output for the Binding or Bindings with a matching
+     *  destination string.
+     *
+     *  @param destinationString The Binding's destination string.
+     */
+    public static function debugBinding(destinationString:String):void
+    {
+        debugDestinationStrings[destinationString] = true;
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  BindingManager has only static methods.
+	 *  We don't create instances of BindingManager.
+	 */
+	public function BindingManager()
+	{
+		super();
+	}
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 4611
Author:   chaase@adobe.com
Date:     2009-01-22T00:30:21.783682Z

Log Message:
-----------
Various bug fixes in effects, mostly in the area of seeking, auto-reversing, and shader transitions.

QE Notes: None
Doc Notes: None
Bugs: sdk-17783, sdk-18767, sdk-18759, sdk-18461, sdk-18309, sdk-18013, sdk-18688
Reviewer: Jason
Tests: checkintests, Mustella: Effects, gumbo/effects, ListDataEffects

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/SetAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/UnconstrainItemAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/AddChildAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/ParallelInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Parallel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/SetPropertyAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/RemoveChildAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/effectClasses/FxAnimateShaderTransitionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/FxAnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/effects/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/AddItemAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/SetStyleAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/RemoveItemAction.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260303 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/SetStyleAction.as
+++ frameworks/projects/framework/src/mx/effects/SetStyleAction.as
@@ -65,7 +65,7 @@
 	public function SetStyleAction(target:Object = null)
 	{
 		super(target);
-
+        duration = 0;
 		instanceClass = SetStyleActionInstance;
 	}