[Swfdec] 8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_string.c libswfdec/swfdec_as_string.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_load_object.c libswfdec/swfdec_loadvars_as.c test/trace

Pekka Lampila medar at kemper.freedesktop.org
Mon Aug 20 02:50:26 PDT 2007


 libswfdec/Makefile.am             |    1 
 libswfdec/swfdec_as_string.c      |   73 ++++++++++-------
 libswfdec/swfdec_as_string.h      |    1 
 libswfdec/swfdec_as_strings.c     |    1 
 libswfdec/swfdec_initialize.as    |   45 ++++++++++
 libswfdec/swfdec_initialize.h     |  163 ++++++++++++++++++++++++--------------
 libswfdec/swfdec_load_object.c    |   16 ++-
 libswfdec/swfdec_loadvars_as.c    |   70 ++++++++++++++++
 test/trace/loadobject-5.swf       |binary
 test/trace/loadobject-5.swf.trace |   19 +++-
 test/trace/loadobject-6.swf       |binary
 test/trace/loadobject-6.swf.trace |   19 +++-
 test/trace/loadobject-7.swf       |binary
 test/trace/loadobject-7.swf.trace |   19 +++-
 test/trace/loadobject.as          |    5 +
 test/trace/loadvars-5.swf         |binary
 test/trace/loadvars-5.swf.trace   |    2 
 test/trace/loadvars-6.swf         |binary
 test/trace/loadvars-6.swf.trace   |   39 +++++++++
 test/trace/loadvars-7.swf         |binary
 test/trace/loadvars-7.swf.trace   |   39 +++++++++
 test/trace/loadvars.as            |   39 +++++++++
 22 files changed, 446 insertions(+), 105 deletions(-)

New commits:
diff-tree 58a57fd8b8361870a39382099717b3fe2fdf38e7 (from 89b02c75b20577ae409d62deef48e1d9942ffdcd)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 12:39:59 2007 +0300

    Make LoadVars's properties use the propflag to disable them in v5

diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index dde8fce..009bbcc 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -120,4 +120,4 @@ LoadVars.prototype.getBytesTotal = funct
   return this._bytesTotal;
 };
 
-ASSetPropFlags(LoadVars.prototype, null, 1);
+ASSetPropFlags(LoadVars.prototype, null, 129);
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index c991bc5..15a9916 100644
--- a/libswfdec/swfdec_initialize.h
+++ b/libswfdec/swfdec_initialize.h
@@ -130,7 +130,7 @@ const unsigned char swfdec_initialize[] 
   0x0D, 0x00, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x3F, 0x4E, 0x3E, 0x4F,
   0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,
   0x40, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0x0D,  0x00, 0x96, 0x02, 0x00,  0x08, 0x06, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x41,  0x4E, 0x3E, 0x4F, 0x96,  0x08, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x02,
+  0x02, 0x00, 0x08, 0x41,  0x4E, 0x3E, 0x4F, 0x96,  0x08, 0x00, 0x07, 0x81,  0x00, 0x00, 0x00, 0x02,
   0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x07, 0x00,  0x07, 0x03, 0x00, 0x00,
   0x00, 0x08, 0x13, 0x3D,  0x17, 0x00
 };
diff-tree 89b02c75b20577ae409d62deef48e1d9942ffdcd (from b73fa2d44918c74e7ea8797f9f54a61b63b80245)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 12:24:50 2007 +0300

    Fixes to LoadVars implementation

diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index bd6215d..dde8fce 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -80,9 +80,6 @@ ASSetNativeAccessor (Stage, 666, "scaleM
 
 function LoadVars () { };
 
-LoadVars.prototype.loaded = undefined;
-LoadVars.prototype._bytesLoaded = undefined;
-LoadVars.prototype._bytesTotal = undefined;
 LoadVars.prototype.contentType = "application/x-www-form-urlencoded";
 
 LoadVars.prototype.load = ASnative (301, 0);
@@ -94,9 +91,9 @@ LoadVars.prototype.onLoad = function () 
 };
 
 LoadVars.prototype.onData = function (src) {
+  this.loaded = true;
   if (src != null) {
     this.decode (src);
-    this.loaded = true;
     this.onLoad (true);
   } else {
     this.onLoad (false);
@@ -123,4 +120,4 @@ LoadVars.prototype.getBytesTotal = funct
   return this._bytesTotal;
 };
 
-ASSetPropFlags(LoadVars.prototype, null, 132);
+ASSetPropFlags(LoadVars.prototype, null, 1);
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index 724ce85..c991bc5 100644
--- a/libswfdec/swfdec_initialize.h
+++ b/libswfdec/swfdec_initialize.h
@@ -30,16 +30,16 @@ const unsigned char swfdec_initialize[] 
   0x53, 0x74, 0x61, 0x67,  0x65, 0x00, 0x73, 0x63,  0x61, 0x6C, 0x65, 0x4D,  0x6F, 0x64, 0x65, 0x2C,
   0x61, 0x6C, 0x69, 0x67,  0x6E, 0x2C, 0x77, 0x69,  0x64, 0x74, 0x68, 0x2C,  0x68, 0x65, 0x69, 0x67,
   0x68, 0x74, 0x00, 0x4C,  0x6F, 0x61, 0x64, 0x56,  0x61, 0x72, 0x73, 0x00,  0x70, 0x72, 0x6F, 0x74,
-  0x6F, 0x74, 0x79, 0x70,  0x65, 0x00, 0x6C, 0x6F,  0x61, 0x64, 0x65, 0x64,  0x00, 0x5F, 0x62, 0x79,
-  0x74, 0x65, 0x73, 0x4C,  0x6F, 0x61, 0x64, 0x65,  0x64, 0x00, 0x5F, 0x62,  0x79, 0x74, 0x65, 0x73,
-  0x54, 0x6F, 0x74, 0x61,  0x6C, 0x00, 0x63, 0x6F,  0x6E, 0x74, 0x65, 0x6E,  0x74, 0x54, 0x79, 0x70,
+  0x6F, 0x74, 0x79, 0x70,  0x65, 0x00, 0x63, 0x6F,  0x6E, 0x74, 0x65, 0x6E,  0x74, 0x54, 0x79, 0x70,
   0x65, 0x00, 0x61, 0x70,  0x70, 0x6C, 0x69, 0x63,  0x61, 0x74, 0x69, 0x6F,  0x6E, 0x2F, 0x78, 0x2D,
   0x77, 0x77, 0x77, 0x2D,  0x66, 0x6F, 0x72, 0x6D,  0x2D, 0x75, 0x72, 0x6C,  0x65, 0x6E, 0x63, 0x6F,
   0x64, 0x65, 0x64, 0x00,  0x6C, 0x6F, 0x61, 0x64,  0x00, 0x64, 0x65, 0x63,  0x6F, 0x64, 0x65, 0x00,
-  0x6F, 0x6E, 0x4C, 0x6F,  0x61, 0x64, 0x00, 0x6F,  0x6E, 0x44, 0x61, 0x74,  0x61, 0x00, 0x73, 0x72,
-  0x63, 0x00, 0x74, 0x6F,  0x53, 0x74, 0x72, 0x69,  0x6E, 0x67, 0x00, 0x73,  0x74, 0x72, 0x00, 0x65,
-  0x73, 0x63, 0x61, 0x70,  0x65, 0x00, 0x3D, 0x00,  0x26, 0x00, 0x67, 0x65,  0x74, 0x42, 0x79, 0x74,
-  0x65, 0x73, 0x4C, 0x6F,  0x61, 0x64, 0x65, 0x64,  0x00, 0x67, 0x65, 0x74,  0x42, 0x79, 0x74, 0x65,
+  0x6F, 0x6E, 0x4C, 0x6F,  0x61, 0x64, 0x00, 0x6F,  0x6E, 0x44, 0x61, 0x74,  0x61, 0x00, 0x6C, 0x6F,
+  0x61, 0x64, 0x65, 0x64,  0x00, 0x73, 0x72, 0x63,  0x00, 0x74, 0x6F, 0x53,  0x74, 0x72, 0x69, 0x6E,
+  0x67, 0x00, 0x73, 0x74,  0x72, 0x00, 0x65, 0x73,  0x63, 0x61, 0x70, 0x65,  0x00, 0x3D, 0x00, 0x26,
+  0x00, 0x67, 0x65, 0x74,  0x42, 0x79, 0x74, 0x65,  0x73, 0x4C, 0x6F, 0x61,  0x64, 0x65, 0x64, 0x00,
+  0x5F, 0x62, 0x79, 0x74,  0x65, 0x73, 0x4C, 0x6F,  0x61, 0x64, 0x65, 0x64,  0x00, 0x67, 0x65, 0x74,
+  0x42, 0x79, 0x74, 0x65,  0x73, 0x54, 0x6F, 0x74,  0x61, 0x6C, 0x00, 0x5F,  0x62, 0x79, 0x74, 0x65,
   0x73, 0x54, 0x6F, 0x74,  0x61, 0x6C, 0x00, 0x9B,  0x12, 0x00, 0x41, 0x73,  0x42, 0x72, 0x6F, 0x61,
   0x64, 0x63, 0x61, 0x73,  0x74, 0x65, 0x72, 0x00,  0x00, 0x00, 0x00, 0x00,  0x9B, 0x0D, 0x00, 0x4C,
   0x6F, 0x61, 0x64, 0x56,  0x61, 0x72, 0x73, 0x00,  0x00, 0x00, 0x00, 0x00,  0x96, 0x13, 0x00, 0x08,
@@ -98,43 +98,40 @@ const unsigned char swfdec_initialize[] 
   0x02, 0x00, 0x08, 0x0F,  0x52, 0x17, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x2E,
   0x07, 0x9A, 0x02, 0x00,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x04, 0x00, 0x00, 0x00,
   0x08, 0x02, 0x3D, 0x17,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,
-  0x96, 0x03, 0x00, 0x08,  0x31, 0x03, 0x4F, 0x96,  0x02, 0x00, 0x08, 0x2F,  0x1C, 0x96, 0x02, 0x00,
-  0x08, 0x30, 0x4E, 0x96,  0x03, 0x00, 0x08, 0x32,  0x03, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x2F, 0x1C,
-  0x96, 0x02, 0x00, 0x08,  0x30, 0x4E, 0x96, 0x03,  0x00, 0x08, 0x33, 0x03,  0x4F, 0x96, 0x02, 0x00,
-  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x04, 0x00,  0x08, 0x34, 0x08, 0x35,
-  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x13, 0x00,
-  0x08, 0x36, 0x07, 0x00,  0x00, 0x00, 0x00, 0x07,  0x2D, 0x01, 0x00, 0x00,  0x07, 0x02, 0x00, 0x00,
-  0x00, 0x08, 0x01, 0x3D,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,
-  0x4E, 0x96, 0x13, 0x00,  0x08, 0x37, 0x07, 0x03,  0x00, 0x00, 0x00, 0x07,  0x2D, 0x01, 0x00, 0x00,
-  0x07, 0x02, 0x00, 0x00,  0x00, 0x08, 0x01, 0x3D,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x02, 0x00,  0x08, 0x38, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x4F, 0x96,  0x02, 0x00, 0x08, 0x2F,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x30, 0x4E, 0x96,
-  0x02, 0x00, 0x08, 0x39,  0x9B, 0x09, 0x00, 0x00,  0x01, 0x00, 0x73, 0x72,  0x63, 0x00, 0x64, 0x00,
-  0x96, 0x02, 0x00, 0x08,  0x3A, 0x1C, 0x96, 0x01,  0x00, 0x02, 0x49, 0x12,  0x9D, 0x02, 0x00, 0x19,
-  0x00, 0x96, 0x09, 0x00,  0x05, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x06, 0x1C, 0x96, 0x02,
-  0x00, 0x08, 0x38, 0x52,  0x17, 0x99, 0x02, 0x00,  0x3A, 0x00, 0x96, 0x02,  0x00, 0x08, 0x3A, 0x1C,
-  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x06, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x37,
-  0x52, 0x17, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x04, 0x00, 0x08,  0x31, 0x05, 0x01, 0x4F,
-  0x96, 0x09, 0x00, 0x05,  0x01, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x06,  0x1C, 0x96, 0x02, 0x00,
-  0x08, 0x38, 0x52, 0x17,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,
-  0x4E, 0x96, 0x02, 0x00,  0x08, 0x3B, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,  0xB3, 0x00, 0x96, 0x03,
-  0x00, 0x08, 0x3C, 0x02,  0x3C, 0x96, 0x02, 0x00,  0x08, 0x06, 0x46, 0x87,  0x01, 0x00, 0x00, 0x96,
-  0x01, 0x00, 0x02, 0x49,  0x9D, 0x02, 0x00, 0x91,  0x00, 0x96, 0x04, 0x00,  0x08, 0x07, 0x04, 0x00,
-  0x3C, 0x96, 0x02, 0x00,  0x08, 0x3C, 0x1C, 0x96,  0x01, 0x00, 0x02, 0x49,  0x9D, 0x02, 0x00, 0x41,
-  0x00, 0x96, 0x02, 0x00,  0x08, 0x3C, 0x4C, 0x1C,  0x96, 0x04, 0x00, 0x08,  0x3F, 0x08, 0x07, 0x1C,
-  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x3D, 0x3D, 0x47,  0x96, 0x02, 0x00, 0x08,
-  0x3E, 0x47, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x07, 0x1C, 0x4E, 0x96,
-  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x3D, 0x3D, 0x47, 0x47,  0x1D, 0x99, 0x02, 0x00,
-  0x33, 0x00, 0x96, 0x04,  0x00, 0x08, 0x3C, 0x08,  0x07, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,
-  0x00, 0x00, 0x08, 0x3D,  0x3D, 0x96, 0x02, 0x00,  0x08, 0x3E, 0x47, 0x96,  0x02, 0x00, 0x08, 0x06,
-  0x1C, 0x96, 0x02, 0x00,  0x08, 0x07, 0x1C, 0x4E,  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,
-  0x08, 0x3D, 0x3D, 0x47,  0x1D, 0x99, 0x02, 0x00,  0x61, 0xFF, 0x96, 0x02,  0x00, 0x08, 0x3C, 0x1C,
-  0x3E, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x2F, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x30, 0x4E, 0x96, 0x02,
-  0x00, 0x08, 0x40, 0x9B,  0x05, 0x00, 0x00, 0x00,  0x00, 0x0D, 0x00, 0x96,  0x02, 0x00, 0x08, 0x06,
-  0x1C, 0x96, 0x02, 0x00,  0x08, 0x32, 0x4E, 0x3E,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,
-  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x02, 0x00,  0x08, 0x41, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,
-  0x0D, 0x00, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x33, 0x4E, 0x3E, 0x4F,
-  0x96, 0x08, 0x00, 0x07,  0x84, 0x00, 0x00, 0x00,  0x02, 0x08, 0x2F, 0x1C,  0x96, 0x02, 0x00, 0x08,
-  0x30, 0x4E, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x13,  0x3D, 0x17, 0x00
+  0x96, 0x04, 0x00, 0x08,  0x31, 0x08, 0x32, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,
+  0x00, 0x08, 0x30, 0x4E,  0x96, 0x13, 0x00, 0x08,  0x33, 0x07, 0x00, 0x00,  0x00, 0x00, 0x07, 0x2D,
+  0x01, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,
+  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x13, 0x00, 0x08,  0x34, 0x07, 0x03, 0x00,
+  0x00, 0x00, 0x07, 0x2D,  0x01, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,
+  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,
+  0x35, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0x00,  0x00, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x2F, 0x1C,
+  0x96, 0x02, 0x00, 0x08,  0x30, 0x4E, 0x96, 0x02,  0x00, 0x08, 0x36, 0x9B,  0x09, 0x00, 0x00, 0x01,
+  0x00, 0x73, 0x72, 0x63,  0x00, 0x64, 0x00, 0x96,  0x02, 0x00, 0x08, 0x06,  0x1C, 0x96, 0x04, 0x00,
+  0x08, 0x37, 0x05, 0x01,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x38, 0x1C, 0x96,  0x01, 0x00, 0x02, 0x49,
+  0x12, 0x9D, 0x02, 0x00,  0x19, 0x00, 0x96, 0x09,  0x00, 0x05, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,
+  0x08, 0x06, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x35,  0x52, 0x17, 0x99, 0x02,  0x00, 0x2C, 0x00, 0x96,
+  0x02, 0x00, 0x08, 0x38,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,
+  0x96, 0x02, 0x00, 0x08,  0x34, 0x52, 0x17, 0x96,  0x09, 0x00, 0x05, 0x01,  0x07, 0x01, 0x00, 0x00,
+  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x35, 0x52, 0x17, 0x4F,  0x96, 0x02, 0x00, 0x08,
+  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,  0x39, 0x9B, 0x05, 0x00,
+  0x00, 0x00, 0x00, 0xB3,  0x00, 0x96, 0x03, 0x00,  0x08, 0x3A, 0x02, 0x3C,  0x96, 0x02, 0x00, 0x08,
+  0x06, 0x46, 0x87, 0x01,  0x00, 0x00, 0x96, 0x01,  0x00, 0x02, 0x49, 0x9D,  0x02, 0x00, 0x91, 0x00,
+  0x96, 0x04, 0x00, 0x08,  0x07, 0x04, 0x00, 0x3C,  0x96, 0x02, 0x00, 0x08,  0x3A, 0x1C, 0x96, 0x01,
+  0x00, 0x02, 0x49, 0x9D,  0x02, 0x00, 0x41, 0x00,  0x96, 0x02, 0x00, 0x08,  0x3A, 0x4C, 0x1C, 0x96,
+  0x04, 0x00, 0x08, 0x3D,  0x08, 0x07, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,
+  0x3B, 0x3D, 0x47, 0x96,  0x02, 0x00, 0x08, 0x3C,  0x47, 0x96, 0x02, 0x00,  0x08, 0x06, 0x1C, 0x96,
+  0x02, 0x00, 0x08, 0x07,  0x1C, 0x4E, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x3B,
+  0x3D, 0x47, 0x47, 0x1D,  0x99, 0x02, 0x00, 0x33,  0x00, 0x96, 0x04, 0x00,  0x08, 0x3A, 0x08, 0x07,
+  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x3B, 0x3D,  0x96, 0x02, 0x00, 0x08,
+  0x3C, 0x47, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x07, 0x1C, 0x4E, 0x96,
+  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x3B, 0x3D, 0x47, 0x1D,  0x99, 0x02, 0x00, 0x61,
+  0xFF, 0x96, 0x02, 0x00,  0x08, 0x3A, 0x1C, 0x3E,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,
+  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x02, 0x00,  0x08, 0x3E, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,
+  0x0D, 0x00, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x3F, 0x4E, 0x3E, 0x4F,
+  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,  0x96, 0x02, 0x00, 0x08,
+  0x40, 0x9B, 0x05, 0x00,  0x00, 0x00, 0x00, 0x0D,  0x00, 0x96, 0x02, 0x00,  0x08, 0x06, 0x1C, 0x96,
+  0x02, 0x00, 0x08, 0x41,  0x4E, 0x3E, 0x4F, 0x96,  0x08, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x02,
+  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x07, 0x00,  0x07, 0x03, 0x00, 0x00,
+  0x00, 0x08, 0x13, 0x3D,  0x17, 0x00
 };
 
diff --git a/test/trace/loadvars-5.swf b/test/trace/loadvars-5.swf
index 3bc1fc1..1c89902 100644
Binary files a/test/trace/loadvars-5.swf and b/test/trace/loadvars-5.swf differ
diff --git a/test/trace/loadvars-6.swf b/test/trace/loadvars-6.swf
index 992d61a..5d623a9 100644
Binary files a/test/trace/loadvars-6.swf and b/test/trace/loadvars-6.swf differ
diff --git a/test/trace/loadvars-6.swf.trace b/test/trace/loadvars-6.swf.trace
index c9d22b4..093c6d0 100644
--- a/test/trace/loadvars-6.swf.trace
+++ b/test/trace/loadvars-6.swf.trace
@@ -1,16 +1,39 @@
 [type Function]
 undefined
+onData: test=2&moi=terve&tyhja&=taysi&hehe=jotain%20muuta&hehe2=jotain muuta&on=lal=lel=luu
+
+false
+84
+84
+onLoad: true
+true
+84
+84
+hehe = jotain muuta
+hehe2 = jotain muuta
+moi = terve
+on = lal=lel=luu
+
+onData = [type Function]
+onDataReal = [type Function]
+onLoad = [type Function]
+test = 2
+tyhja = 
+onData: 
 true
+84
+84
+onLoad: false
 true
 84
 84
-on=lal%3Dlel%3Dluu%0A&hehe2=jotain%20muuta&hehe=jotain%20muuta&tyhja=&moi=terve&test=2&onLoad=%5Btype%20Function%5D
---
 hehe = jotain muuta
 hehe2 = jotain muuta
 moi = terve
 on = lal=lel=luu
 
+onData = [type Function]
+onDataReal = [type Function]
 onLoad = [type Function]
 test = 2
 tyhja = 
diff --git a/test/trace/loadvars-7.swf b/test/trace/loadvars-7.swf
index 9f9b76f..7af6ca7 100644
Binary files a/test/trace/loadvars-7.swf and b/test/trace/loadvars-7.swf differ
diff --git a/test/trace/loadvars-7.swf.trace b/test/trace/loadvars-7.swf.trace
index c9d22b4..11f965b 100644
--- a/test/trace/loadvars-7.swf.trace
+++ b/test/trace/loadvars-7.swf.trace
@@ -1,16 +1,39 @@
 [type Function]
 undefined
+onData: test=2&moi=terve&tyhja&=taysi&hehe=jotain%20muuta&hehe2=jotain muuta&on=lal=lel=luu
+
+false
+84
+84
+onLoad: true
+true
+84
+84
+hehe = jotain muuta
+hehe2 = jotain muuta
+moi = terve
+on = lal=lel=luu
+
+onData = [type Function]
+onDataReal = [type Function]
+onLoad = [type Function]
+test = 2
+tyhja = 
+onData: undefined
 true
+84
+84
+onLoad: false
 true
 84
 84
-on=lal%3Dlel%3Dluu%0A&hehe2=jotain%20muuta&hehe=jotain%20muuta&tyhja=&moi=terve&test=2&onLoad=%5Btype%20Function%5D
---
 hehe = jotain muuta
 hehe2 = jotain muuta
 moi = terve
 on = lal=lel=luu
 
+onData = [type Function]
+onDataReal = [type Function]
 onLoad = [type Function]
 test = 2
 tyhja = 
diff --git a/test/trace/loadvars.as b/test/trace/loadvars.as
index 778615d..b21ea99 100644
--- a/test/trace/loadvars.as
+++ b/test/trace/loadvars.as
@@ -1,23 +1,25 @@
 // makeswf -v 7 -r 1 -o loadvars-7.swf loadvars.as
 
-//_global.unescape = function () { return "moi"; };
-//_global.escape = function () { return "moi"; };
-
 var lv = new LoadVars ();
 
 trace (lv.onLoad);
 trace (lv.loaded);
 
+lv.onDataReal = lv.onData;
+lv.onData = function (src) {
+  trace ("onData: " + src);
+  trace (this.loaded);
+  trace (this._bytesLoaded);
+  trace (this._bytesTotal);
+  lv.onDataReal (src);
+};
+
 lv.onLoad = function (success) {
-  trace (success);
+  trace ("onLoad: " + success);
   trace (this.loaded);
   trace (this._bytesLoaded);
   trace (this._bytesTotal);
-  trace (this);
-  trace ("--");
   var props = new Array ();
-  //ASSetPropFlags (this, null, 0, 1);
-  //ASSetPropFlags (this.__proto__, null, 0, 1);
   for (var prop in this) {
     props.push (prop);
   }
@@ -28,6 +30,7 @@ lv.onLoad = function (success) {
 };
 
 lv.load ("params.txt");
+lv.load ("blah.txt");
 
 function quit () {
   loadMovie ("FSCommand:quit", "");
diff-tree b73fa2d44918c74e7ea8797f9f54a61b63b80245 (from 51dbe7d127eca9614957017d866adaa30244658d)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 12:14:54 2007 +0300

    Make LoadObject set loaded property to false, update test

diff --git a/libswfdec/swfdec_as_strings.c b/libswfdec/swfdec_as_strings.c
index 7674f3b..ce5a4de 100644
--- a/libswfdec/swfdec_as_strings.c
+++ b/libswfdec/swfdec_as_strings.c
@@ -252,6 +252,7 @@ const char swfdec_as_strings[] = 
   SWFDEC_AS_CONSTANT_STRING ("close")
   SWFDEC_AS_CONSTANT_STRING ("_bytesLoaded")
   SWFDEC_AS_CONSTANT_STRING ("_bytesTotal")
+  SWFDEC_AS_CONSTANT_STRING ("loaded")
   /* add more here */
 ;
 
diff --git a/libswfdec/swfdec_load_object.c b/libswfdec/swfdec_load_object.c
index 2b19f07..4d00a61 100644
--- a/libswfdec/swfdec_load_object.c
+++ b/libswfdec/swfdec_load_object.c
@@ -188,6 +188,10 @@ swfdec_load_object_load (SwfdecLoadObjec
   SWFDEC_AS_VALUE_SET_INT (&val, 0);
   swfdec_as_object_set_variable_and_flags (load_object->target,
       SWFDEC_AS_STR__bytesLoaded, &val, SWFDEC_AS_VARIABLE_HIDDEN);
+
+  SWFDEC_AS_VALUE_SET_BOOLEAN (&val, FALSE);
+  swfdec_as_object_set_variable_and_flags (load_object->target,
+      SWFDEC_AS_STR_loaded, &val, SWFDEC_AS_VARIABLE_HIDDEN);
 }
 
 SwfdecAsObject *
diff --git a/test/trace/loadobject-5.swf b/test/trace/loadobject-5.swf
index b3b144d..ae9765b 100644
Binary files a/test/trace/loadobject-5.swf and b/test/trace/loadobject-5.swf differ
diff --git a/test/trace/loadobject-5.swf.trace b/test/trace/loadobject-5.swf.trace
index ba49d21..cee074b 100644
--- a/test/trace/loadobject-5.swf.trace
+++ b/test/trace/loadobject-5.swf.trace
@@ -1,14 +1,18 @@
 Loaded: 
 Total: 
+Is loaded: 
 false
 Loaded: 
 Total: 
+Is loaded: 
 true
 Loaded: 0
 Total: 
+Is loaded: false
 true
 Loaded: 0
 Total: 
+Is loaded: false
 Got: string '// makeswf -v 7 -r 1 -o loadobject-7.swf loadobject.as
 
 var obj = new Object ();
@@ -19,19 +23,24 @@ obj.onData = function (str) {
   trace ("Got: " + typeof (str) + " '" + str + "'");
   trace ("Loaded: " + this._bytesLoaded);
   trace ("Total: " + this._bytesTotal);
+  trace ("Is loaded: " + obj.loaded);
 };
 
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ());
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("loadobject.as"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("404"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 
 function quit () {
   loadMovie ("FSCommand:quit", "");
@@ -39,8 +48,10 @@ function quit () {
 
 setInterval (quit, 1000);
 '
-Loaded: 755
-Total: 755
+Loaded: 937
+Total: 937
+Is loaded: false
 Got: undefined ''
-Loaded: 755
-Total: 755
+Loaded: 937
+Total: 937
+Is loaded: false
diff --git a/test/trace/loadobject-6.swf b/test/trace/loadobject-6.swf
index 3a19ff4..c7b3f43 100644
Binary files a/test/trace/loadobject-6.swf and b/test/trace/loadobject-6.swf differ
diff --git a/test/trace/loadobject-6.swf.trace b/test/trace/loadobject-6.swf.trace
index ba49d21..cee074b 100644
--- a/test/trace/loadobject-6.swf.trace
+++ b/test/trace/loadobject-6.swf.trace
@@ -1,14 +1,18 @@
 Loaded: 
 Total: 
+Is loaded: 
 false
 Loaded: 
 Total: 
+Is loaded: 
 true
 Loaded: 0
 Total: 
+Is loaded: false
 true
 Loaded: 0
 Total: 
+Is loaded: false
 Got: string '// makeswf -v 7 -r 1 -o loadobject-7.swf loadobject.as
 
 var obj = new Object ();
@@ -19,19 +23,24 @@ obj.onData = function (str) {
   trace ("Got: " + typeof (str) + " '" + str + "'");
   trace ("Loaded: " + this._bytesLoaded);
   trace ("Total: " + this._bytesTotal);
+  trace ("Is loaded: " + obj.loaded);
 };
 
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ());
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("loadobject.as"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("404"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 
 function quit () {
   loadMovie ("FSCommand:quit", "");
@@ -39,8 +48,10 @@ function quit () {
 
 setInterval (quit, 1000);
 '
-Loaded: 755
-Total: 755
+Loaded: 937
+Total: 937
+Is loaded: false
 Got: undefined ''
-Loaded: 755
-Total: 755
+Loaded: 937
+Total: 937
+Is loaded: false
diff --git a/test/trace/loadobject-7.swf b/test/trace/loadobject-7.swf
index 4d580e6..b6aaf29 100644
Binary files a/test/trace/loadobject-7.swf and b/test/trace/loadobject-7.swf differ
diff --git a/test/trace/loadobject-7.swf.trace b/test/trace/loadobject-7.swf.trace
index 8e6d8c0..48b10f4 100644
--- a/test/trace/loadobject-7.swf.trace
+++ b/test/trace/loadobject-7.swf.trace
@@ -1,14 +1,18 @@
 Loaded: undefined
 Total: undefined
+Is loaded: undefined
 false
 Loaded: undefined
 Total: undefined
+Is loaded: undefined
 true
 Loaded: 0
 Total: undefined
+Is loaded: false
 true
 Loaded: 0
 Total: undefined
+Is loaded: false
 Got: string '// makeswf -v 7 -r 1 -o loadobject-7.swf loadobject.as
 
 var obj = new Object ();
@@ -19,19 +23,24 @@ obj.onData = function (str) {
   trace ("Got: " + typeof (str) + " '" + str + "'");
   trace ("Loaded: " + this._bytesLoaded);
   trace ("Total: " + this._bytesTotal);
+  trace ("Is loaded: " + obj.loaded);
 };
 
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ());
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("loadobject.as"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("404"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 
 function quit () {
   loadMovie ("FSCommand:quit", "");
@@ -39,8 +48,10 @@ function quit () {
 
 setInterval (quit, 1000);
 '
-Loaded: 755
-Total: 755
+Loaded: 937
+Total: 937
+Is loaded: false
 Got: undefined 'undefined'
-Loaded: 755
-Total: 755
+Loaded: 937
+Total: 937
+Is loaded: false
diff --git a/test/trace/loadobject.as b/test/trace/loadobject.as
index 127e063..62acf8a 100644
--- a/test/trace/loadobject.as
+++ b/test/trace/loadobject.as
@@ -8,19 +8,24 @@ obj.onData = function (str) {
   trace ("Got: " + typeof (str) + " '" + str + "'");
   trace ("Loaded: " + this._bytesLoaded);
   trace ("Total: " + this._bytesTotal);
+  trace ("Is loaded: " + obj.loaded);
 };
 
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ());
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("loadobject.as"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 trace (obj.load ("404"));
 trace ("Loaded: " + obj._bytesLoaded);
 trace ("Total: " + obj._bytesTotal);
+trace ("Is loaded: " + obj.loaded);
 
 function quit () {
   loadMovie ("FSCommand:quit", "");
diff-tree 51dbe7d127eca9614957017d866adaa30244658d (from f3fafaa0f2c241b4c42c0f436cfe438d9ab3eadf)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 11:41:53 2007 +0300

    Fix unescape in version 5 I just broke

diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
index a200a22..720bc5c 100644
--- a/libswfdec/swfdec_as_string.c
+++ b/libswfdec/swfdec_as_string.c
@@ -523,7 +523,7 @@ swfdec_as_string_unescape_5 (SwfdecAsCon
   } else {
     g_warning ("can't convert %s to UTF-8", msg);
     g_free (out);
-    return NULL;
+    return g_strdup ("");
   }
 #undef APPEND
 }
@@ -655,7 +655,7 @@ swfdec_as_string_unescape_6 (SwfdecAsCon
   } else {
     g_warning ("%s unescaped is invalid UTF-8", msg);
     g_byte_array_free (array, TRUE);
-    return NULL;
+    return g_strdup ("");
   }
 #undef APPEND
 }
@@ -680,11 +680,10 @@ swfdec_as_string_unescape_internal (Swfd
     swfdec_as_string_unescape (cx, swfdec_as_value_to_string (cx, &argv[0]));
   if (result != NULL) {
     SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, result));
+    g_free (result);
   } else {
-    SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY);
+    SWFDEC_AS_VALUE_SET_UNDEFINED (ret);
   }
-
-  g_free (result);
 }
 
 void
diff-tree f3fafaa0f2c241b4c42c0f436cfe438d9ab3eadf (from 4c3971ef059f0f7a8c135250b60546170564175f)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 11:16:57 2007 +0300

    Add test case for LoadVars

diff --git a/test/trace/loadvars-5.swf b/test/trace/loadvars-5.swf
new file mode 100644
index 0000000..3bc1fc1
Binary files /dev/null and b/test/trace/loadvars-5.swf differ
diff --git a/test/trace/loadvars-5.swf.trace b/test/trace/loadvars-5.swf.trace
new file mode 100644
index 0000000..d4f80bf
--- /dev/null
+++ b/test/trace/loadvars-5.swf.trace
@@ -0,0 +1,2 @@
+undefined
+undefined
diff --git a/test/trace/loadvars-6.swf b/test/trace/loadvars-6.swf
new file mode 100644
index 0000000..992d61a
Binary files /dev/null and b/test/trace/loadvars-6.swf differ
diff --git a/test/trace/loadvars-6.swf.trace b/test/trace/loadvars-6.swf.trace
new file mode 100644
index 0000000..c9d22b4
--- /dev/null
+++ b/test/trace/loadvars-6.swf.trace
@@ -0,0 +1,16 @@
+[type Function]
+undefined
+true
+true
+84
+84
+on=lal%3Dlel%3Dluu%0A&hehe2=jotain%20muuta&hehe=jotain%20muuta&tyhja=&moi=terve&test=2&onLoad=%5Btype%20Function%5D
+--
+hehe = jotain muuta
+hehe2 = jotain muuta
+moi = terve
+on = lal=lel=luu
+
+onLoad = [type Function]
+test = 2
+tyhja = 
diff --git a/test/trace/loadvars-7.swf b/test/trace/loadvars-7.swf
new file mode 100644
index 0000000..9f9b76f
Binary files /dev/null and b/test/trace/loadvars-7.swf differ
diff --git a/test/trace/loadvars-7.swf.trace b/test/trace/loadvars-7.swf.trace
new file mode 100644
index 0000000..c9d22b4
--- /dev/null
+++ b/test/trace/loadvars-7.swf.trace
@@ -0,0 +1,16 @@
+[type Function]
+undefined
+true
+true
+84
+84
+on=lal%3Dlel%3Dluu%0A&hehe2=jotain%20muuta&hehe=jotain%20muuta&tyhja=&moi=terve&test=2&onLoad=%5Btype%20Function%5D
+--
+hehe = jotain muuta
+hehe2 = jotain muuta
+moi = terve
+on = lal=lel=luu
+
+onLoad = [type Function]
+test = 2
+tyhja = 
diff --git a/test/trace/loadvars.as b/test/trace/loadvars.as
new file mode 100644
index 0000000..778615d
--- /dev/null
+++ b/test/trace/loadvars.as
@@ -0,0 +1,36 @@
+// makeswf -v 7 -r 1 -o loadvars-7.swf loadvars.as
+
+//_global.unescape = function () { return "moi"; };
+//_global.escape = function () { return "moi"; };
+
+var lv = new LoadVars ();
+
+trace (lv.onLoad);
+trace (lv.loaded);
+
+lv.onLoad = function (success) {
+  trace (success);
+  trace (this.loaded);
+  trace (this._bytesLoaded);
+  trace (this._bytesTotal);
+  trace (this);
+  trace ("--");
+  var props = new Array ();
+  //ASSetPropFlags (this, null, 0, 1);
+  //ASSetPropFlags (this.__proto__, null, 0, 1);
+  for (var prop in this) {
+    props.push (prop);
+  }
+  props.sort ();
+  for (var i = 0; i < props.length; i++) {
+    trace (props[i] + " = " + this[props[i]]);
+  }
+};
+
+lv.load ("params.txt");
+
+function quit () {
+  loadMovie ("FSCommand:quit", "");
+};
+
+setInterval (quit, 1000);
diff-tree 4c3971ef059f0f7a8c135250b60546170564175f (from a7ae2ccc6a9f28b013e31293fcfa87b7c1b7fd88)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 11:16:33 2007 +0300

    Start implementing LoadVars class

diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am
index 85ec276..6d3aaaf 100644
--- a/libswfdec/Makefile.am
+++ b/libswfdec/Makefile.am
@@ -78,6 +78,7 @@ libswfdec_ at SWFDEC_MAJORMINOR@_la_SOURCES
 	swfdec_load_object_as.c \
 	swfdec_loader.c \
 	swfdec_loadertarget.c \
+	swfdec_loadvars_as.c \
 	swfdec_marshal.c \
 	swfdec_morph_movie.c \
 	swfdec_morphshape.c \
diff --git a/libswfdec/swfdec_initialize.as b/libswfdec/swfdec_initialize.as
index 70f5d8d..bd6215d 100644
--- a/libswfdec/swfdec_initialize.as
+++ b/libswfdec/swfdec_initialize.as
@@ -76,3 +76,51 @@ Stage = new Object ();
 AsBroadcaster.initialize (Stage);
 ASSetNativeAccessor (Stage, 666, "scaleMode,align,width,height", 1);
 
+/*** LOADVARS ***/
+
+function LoadVars () { };
+
+LoadVars.prototype.loaded = undefined;
+LoadVars.prototype._bytesLoaded = undefined;
+LoadVars.prototype._bytesTotal = undefined;
+LoadVars.prototype.contentType = "application/x-www-form-urlencoded";
+
+LoadVars.prototype.load = ASnative (301, 0);
+//LoadVars.prototype.send = ASnative (301, 1);
+//LoadVars.prototype.sendAndLoad = ASnative (301, 2);
+LoadVars.prototype.decode = ASnative (301, 3);
+
+LoadVars.prototype.onLoad = function () {
+};
+
+LoadVars.prototype.onData = function (src) {
+  if (src != null) {
+    this.decode (src);
+    this.loaded = true;
+    this.onLoad (true);
+  } else {
+    this.onLoad (false);
+  }
+};
+
+LoadVars.prototype.toString = function () {
+  var str = null;
+  for (var x in this) {
+    if (str == null) {
+      str = escape(x) + "=" + escape(this[x]);
+    } else {
+      str += "&" + escape(x) + "=" + escape(this[x]);
+    }
+  }
+  return str;
+};
+
+LoadVars.prototype.getBytesLoaded = function () {
+  return this._bytesLoaded;
+};
+
+LoadVars.prototype.getBytesTotal = function () {
+  return this._bytesTotal;
+};
+
+ASSetPropFlags(LoadVars.prototype, null, 132);
diff --git a/libswfdec/swfdec_initialize.h b/libswfdec/swfdec_initialize.h
index 51794cb..724ce85 100644
--- a/libswfdec/swfdec_initialize.h
+++ b/libswfdec/swfdec_initialize.h
@@ -2,7 +2,7 @@
 
 /* compiled from swfdec_initialize.as */
 const unsigned char swfdec_initialize[] = {
-  0x88, 0xB0, 0x01, 0x2F,  0x00, 0x41, 0x53, 0x53,  0x65, 0x74, 0x4E, 0x61,  0x74, 0x69, 0x76, 0x65,
+  0x88, 0x64, 0x02, 0x42,  0x00, 0x41, 0x53, 0x53,  0x65, 0x74, 0x4E, 0x61,  0x74, 0x69, 0x76, 0x65,
   0x00, 0x41, 0x53, 0x6E,  0x61, 0x74, 0x69, 0x76,  0x65, 0x00, 0x41, 0x53,  0x53, 0x65, 0x74, 0x4E,
   0x61, 0x74, 0x69, 0x76,  0x65, 0x41, 0x63, 0x63,  0x65, 0x73, 0x73, 0x6F,  0x72, 0x00, 0x41, 0x73,
   0x42, 0x72, 0x6F, 0x61,  0x64, 0x63, 0x61, 0x73,  0x74, 0x65, 0x72, 0x00,  0x62, 0x72, 0x6F, 0x61,
@@ -29,62 +29,112 @@ const unsigned char swfdec_initialize[] 
   0x62, 0x6A, 0x65, 0x63,  0x74, 0x00, 0x73, 0x68,  0x6F, 0x77, 0x00, 0x68,  0x69, 0x64, 0x65, 0x00,
   0x53, 0x74, 0x61, 0x67,  0x65, 0x00, 0x73, 0x63,  0x61, 0x6C, 0x65, 0x4D,  0x6F, 0x64, 0x65, 0x2C,
   0x61, 0x6C, 0x69, 0x67,  0x6E, 0x2C, 0x77, 0x69,  0x64, 0x74, 0x68, 0x2C,  0x68, 0x65, 0x69, 0x67,
-  0x68, 0x74, 0x00, 0x9B,  0x12, 0x00, 0x41, 0x73,  0x42, 0x72, 0x6F, 0x61,  0x64, 0x63, 0x61, 0x73,
-  0x74, 0x65, 0x72, 0x00,  0x00, 0x00, 0x00, 0x00,  0x96, 0x13, 0x00, 0x08,  0x00, 0x07, 0x00, 0x00,
-  0x00, 0x00, 0x07, 0x04,  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x1D,
-  0x96, 0x13, 0x00, 0x08,  0x02, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x04,  0x00, 0x00, 0x00, 0x07,
-  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x1D,  0x96, 0x02, 0x00, 0x08,  0x03, 0x1C, 0x96, 0x13,
-  0x00, 0x08, 0x04, 0x07,  0x0C, 0x00, 0x00, 0x00,  0x07, 0x65, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x03, 0x1C,  0x96, 0x02, 0x00, 0x08,
-  0x05, 0x9B, 0x07, 0x00,  0x00, 0x01, 0x00, 0x78,  0x00, 0x3C, 0x00, 0x96,  0x02, 0x00, 0x08, 0x07,
-  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,
-  0x08, 0x52, 0x17, 0x96,  0x02, 0x00, 0x08, 0x07,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,
-  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x09, 0x4E, 0x96, 0x02,  0x00, 0x08, 0x0A, 0x52,
-  0x17, 0x96, 0x02, 0x00,  0x05, 0x01, 0x3E, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x03, 0x1C, 0x96, 0x02,
-  0x00, 0x08, 0x08, 0x9B,  0x07, 0x00, 0x00, 0x01,  0x00, 0x78, 0x00, 0x8F,  0x00, 0x96, 0x04, 0x00,
-  0x08, 0x0B, 0x08, 0x06,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x09, 0x4E, 0x3C,  0x96, 0x02, 0x00, 0x08,
-  0x0C, 0x41, 0x96, 0x07,  0x00, 0x08, 0x0C, 0x07,  0x00, 0x00, 0x00, 0x00,  0x3C, 0x99, 0x02, 0x00,
-  0x09, 0x00, 0x96, 0x02,  0x00, 0x08, 0x0C, 0x4C,  0x1C, 0x50, 0x1D, 0x96,  0x02, 0x00, 0x08, 0x0C,
-  0x1C, 0x96, 0x02, 0x00,  0x08, 0x0B, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0D,  0x4E, 0x48, 0x12, 0x9D,
-  0x02, 0x00, 0x42, 0x00,  0x96, 0x02, 0x00, 0x08,  0x0B, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x0C, 0x1C,
-  0x4E, 0x96, 0x02, 0x00,  0x08, 0x07, 0x1C, 0x49,  0x12, 0x9D, 0x02, 0x00,  0x23, 0x00, 0x96, 0x07,
-  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x0C,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x02, 0x00, 0x00,
-  0x00, 0x08, 0x0B, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x0E, 0x52, 0x17, 0x96,  0x02, 0x00, 0x05, 0x01,
-  0x3E, 0x99, 0x02, 0x00,  0x9C, 0xFF, 0x96, 0x02,  0x00, 0x05, 0x00, 0x3E,  0x4F, 0x96, 0x02, 0x00,
-  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,  0x9B, 0x07, 0x00, 0x00,  0x01, 0x00, 0x6F, 0x00,
-  0x75, 0x00, 0x96, 0x02,  0x00, 0x08, 0x10, 0x1C,  0x96, 0x13, 0x00, 0x08,  0x04, 0x07, 0x0C, 0x00,
-  0x00, 0x00, 0x07, 0x65,  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,
-  0x96, 0x02, 0x00, 0x08,  0x10, 0x1C, 0x96, 0x04,  0x00, 0x08, 0x05, 0x08,  0x03, 0x1C, 0x96, 0x02,
-  0x00, 0x08, 0x05, 0x4E,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x10, 0x1C, 0x96,  0x04, 0x00, 0x08, 0x08,
-  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x08,  0x4E, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x10, 0x1C,
-  0x96, 0x09, 0x00, 0x08,  0x09, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x11,  0x40, 0x4F, 0x96, 0x09,
-  0x00, 0x07, 0x83, 0x00,  0x00, 0x00, 0x08, 0x12,  0x08, 0x10, 0x1C, 0x96,  0x07, 0x00, 0x07, 0x03,
-  0x00, 0x00, 0x00, 0x08,  0x13, 0x3D, 0x17, 0x4F,  0x96, 0x08, 0x00, 0x07,  0x83, 0x00, 0x00, 0x00,
-  0x02, 0x08, 0x03, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,  0x08, 0x13, 0x3D, 0x17,
-  0x96, 0x8C, 0x00, 0x08,  0x14, 0x08, 0x15, 0x07,  0x12, 0x00, 0x00, 0x00,  0x08, 0x16, 0x07, 0x08,
-  0x00, 0x00, 0x00, 0x08,  0x17, 0x07, 0x14, 0x00,  0x00, 0x00, 0x08, 0x18,  0x07, 0x11, 0x00, 0x00,
-  0x00, 0x08, 0x19, 0x07,  0x2E, 0x00, 0x00, 0x00,  0x08, 0x1A, 0x07, 0x28,  0x00, 0x00, 0x00, 0x08,
-  0x1B, 0x07, 0x23, 0x00,  0x00, 0x00, 0x08, 0x1C,  0x07, 0x0D, 0x00, 0x00,  0x00, 0x08, 0x1D, 0x07,
-  0x1B, 0x00, 0x00, 0x00,  0x08, 0x1E, 0x07, 0x24,  0x00, 0x00, 0x00, 0x08,  0x1F, 0x07, 0x2D, 0x00,
-  0x00, 0x00, 0x08, 0x20,  0x07, 0x25, 0x00, 0x00,  0x00, 0x08, 0x21, 0x07,  0x22, 0x00, 0x00, 0x00,
-  0x08, 0x22, 0x07, 0x21,  0x00, 0x00, 0x00, 0x08,  0x23, 0x07, 0x27, 0x00,  0x00, 0x00, 0x08, 0x24,
-  0x07, 0x10, 0x00, 0x00,  0x00, 0x08, 0x25, 0x07,  0x20, 0x00, 0x00, 0x00,  0x08, 0x26, 0x07, 0x09,
-  0x00, 0x00, 0x00, 0x08,  0x27, 0x07, 0x26, 0x00,  0x00, 0x00, 0x07, 0x13,  0x00, 0x00, 0x00, 0x43,
-  0x1D, 0x96, 0x09, 0x00,  0x08, 0x28, 0x07, 0x20,  0x03, 0x00, 0x00, 0x08,  0x14, 0x1C, 0x96, 0x07,
-  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x00,  0x3D, 0x17, 0x96, 0x02,  0x00, 0x08, 0x14, 0x1C,
-  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,
-  0x52, 0x17, 0x96, 0x08,  0x00, 0x07, 0x07, 0x00,  0x00, 0x00, 0x02, 0x08,  0x14, 0x1C, 0x96, 0x07,
-  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x13,  0x3D, 0x17, 0x96, 0x09,  0x00, 0x08, 0x29, 0x07,
-  0x00, 0x00, 0x00, 0x00,  0x08, 0x2A, 0x40, 0x1D,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x13,
-  0x00, 0x08, 0x2B, 0x07,  0x00, 0x00, 0x00, 0x00,  0x07, 0x05, 0x00, 0x00,  0x00, 0x07, 0x02, 0x00,
-  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,  0x96, 0x13, 0x00, 0x08,
-  0x2C, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x05,  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,
-  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,
-  0x00, 0x00, 0x08, 0x03,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x0F, 0x52, 0x17,  0x96, 0x09, 0x00, 0x08,
-  0x2D, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,  0x40, 0x1D, 0x96, 0x02,  0x00, 0x08, 0x2D, 0x1C,
-  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,
-  0x52, 0x17, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x2E,  0x07, 0x9A, 0x02, 0x00,
-  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x04, 0x00, 0x00, 0x00,  0x08, 0x02, 0x3D, 0x17,
-  0x00
+  0x68, 0x74, 0x00, 0x4C,  0x6F, 0x61, 0x64, 0x56,  0x61, 0x72, 0x73, 0x00,  0x70, 0x72, 0x6F, 0x74,
+  0x6F, 0x74, 0x79, 0x70,  0x65, 0x00, 0x6C, 0x6F,  0x61, 0x64, 0x65, 0x64,  0x00, 0x5F, 0x62, 0x79,
+  0x74, 0x65, 0x73, 0x4C,  0x6F, 0x61, 0x64, 0x65,  0x64, 0x00, 0x5F, 0x62,  0x79, 0x74, 0x65, 0x73,
+  0x54, 0x6F, 0x74, 0x61,  0x6C, 0x00, 0x63, 0x6F,  0x6E, 0x74, 0x65, 0x6E,  0x74, 0x54, 0x79, 0x70,
+  0x65, 0x00, 0x61, 0x70,  0x70, 0x6C, 0x69, 0x63,  0x61, 0x74, 0x69, 0x6F,  0x6E, 0x2F, 0x78, 0x2D,
+  0x77, 0x77, 0x77, 0x2D,  0x66, 0x6F, 0x72, 0x6D,  0x2D, 0x75, 0x72, 0x6C,  0x65, 0x6E, 0x63, 0x6F,
+  0x64, 0x65, 0x64, 0x00,  0x6C, 0x6F, 0x61, 0x64,  0x00, 0x64, 0x65, 0x63,  0x6F, 0x64, 0x65, 0x00,
+  0x6F, 0x6E, 0x4C, 0x6F,  0x61, 0x64, 0x00, 0x6F,  0x6E, 0x44, 0x61, 0x74,  0x61, 0x00, 0x73, 0x72,
+  0x63, 0x00, 0x74, 0x6F,  0x53, 0x74, 0x72, 0x69,  0x6E, 0x67, 0x00, 0x73,  0x74, 0x72, 0x00, 0x65,
+  0x73, 0x63, 0x61, 0x70,  0x65, 0x00, 0x3D, 0x00,  0x26, 0x00, 0x67, 0x65,  0x74, 0x42, 0x79, 0x74,
+  0x65, 0x73, 0x4C, 0x6F,  0x61, 0x64, 0x65, 0x64,  0x00, 0x67, 0x65, 0x74,  0x42, 0x79, 0x74, 0x65,
+  0x73, 0x54, 0x6F, 0x74,  0x61, 0x6C, 0x00, 0x9B,  0x12, 0x00, 0x41, 0x73,  0x42, 0x72, 0x6F, 0x61,
+  0x64, 0x63, 0x61, 0x73,  0x74, 0x65, 0x72, 0x00,  0x00, 0x00, 0x00, 0x00,  0x9B, 0x0D, 0x00, 0x4C,
+  0x6F, 0x61, 0x64, 0x56,  0x61, 0x72, 0x73, 0x00,  0x00, 0x00, 0x00, 0x00,  0x96, 0x13, 0x00, 0x08,
+  0x00, 0x07, 0x00, 0x00,  0x00, 0x00, 0x07, 0x04,  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,
+  0x08, 0x01, 0x3D, 0x1D,  0x96, 0x13, 0x00, 0x08,  0x02, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x04,
+  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x1D,  0x96, 0x02, 0x00, 0x08,
+  0x03, 0x1C, 0x96, 0x13,  0x00, 0x08, 0x04, 0x07,  0x0C, 0x00, 0x00, 0x00,  0x07, 0x65, 0x00, 0x00,
+  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x03, 0x1C,
+  0x96, 0x02, 0x00, 0x08,  0x05, 0x9B, 0x07, 0x00,  0x00, 0x01, 0x00, 0x78,  0x00, 0x3C, 0x00, 0x96,
+  0x02, 0x00, 0x08, 0x07,  0x1C, 0x96, 0x07, 0x00,  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,
+  0x96, 0x02, 0x00, 0x08,  0x08, 0x52, 0x17, 0x96,  0x02, 0x00, 0x08, 0x07,  0x1C, 0x96, 0x07, 0x00,
+  0x07, 0x01, 0x00, 0x00,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x09, 0x4E, 0x96, 0x02,
+  0x00, 0x08, 0x0A, 0x52,  0x17, 0x96, 0x02, 0x00,  0x05, 0x01, 0x3E, 0x4F,  0x96, 0x02, 0x00, 0x08,
+  0x03, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x08, 0x9B,  0x07, 0x00, 0x00, 0x01,  0x00, 0x78, 0x00, 0x8F,
+  0x00, 0x96, 0x04, 0x00,  0x08, 0x0B, 0x08, 0x06,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x09, 0x4E, 0x3C,
+  0x96, 0x02, 0x00, 0x08,  0x0C, 0x41, 0x96, 0x07,  0x00, 0x08, 0x0C, 0x07,  0x00, 0x00, 0x00, 0x00,
+  0x3C, 0x99, 0x02, 0x00,  0x09, 0x00, 0x96, 0x02,  0x00, 0x08, 0x0C, 0x4C,  0x1C, 0x50, 0x1D, 0x96,
+  0x02, 0x00, 0x08, 0x0C,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x0B, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0D,
+  0x4E, 0x48, 0x12, 0x9D,  0x02, 0x00, 0x42, 0x00,  0x96, 0x02, 0x00, 0x08,  0x0B, 0x1C, 0x96, 0x02,
+  0x00, 0x08, 0x0C, 0x1C,  0x4E, 0x96, 0x02, 0x00,  0x08, 0x07, 0x1C, 0x49,  0x12, 0x9D, 0x02, 0x00,
+  0x23, 0x00, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x0C,  0x1C, 0x96, 0x07, 0x00,
+  0x07, 0x02, 0x00, 0x00,  0x00, 0x08, 0x0B, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x0E, 0x52, 0x17, 0x96,
+  0x02, 0x00, 0x05, 0x01,  0x3E, 0x99, 0x02, 0x00,  0x9C, 0xFF, 0x96, 0x02,  0x00, 0x05, 0x00, 0x3E,
+  0x4F, 0x96, 0x02, 0x00,  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x0F,  0x9B, 0x07, 0x00, 0x00,
+  0x01, 0x00, 0x6F, 0x00,  0x75, 0x00, 0x96, 0x02,  0x00, 0x08, 0x10, 0x1C,  0x96, 0x13, 0x00, 0x08,
+  0x04, 0x07, 0x0C, 0x00,  0x00, 0x00, 0x07, 0x65,  0x00, 0x00, 0x00, 0x07,  0x02, 0x00, 0x00, 0x00,
+  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x10, 0x1C, 0x96, 0x04,  0x00, 0x08, 0x05, 0x08,
+  0x03, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x05, 0x4E,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x10, 0x1C, 0x96,
+  0x04, 0x00, 0x08, 0x08,  0x08, 0x03, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x08,  0x4E, 0x4F, 0x96, 0x02,
+  0x00, 0x08, 0x10, 0x1C,  0x96, 0x09, 0x00, 0x08,  0x09, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x11,
+  0x40, 0x4F, 0x96, 0x09,  0x00, 0x07, 0x83, 0x00,  0x00, 0x00, 0x08, 0x12,  0x08, 0x10, 0x1C, 0x96,
+  0x07, 0x00, 0x07, 0x03,  0x00, 0x00, 0x00, 0x08,  0x13, 0x3D, 0x17, 0x4F,  0x96, 0x08, 0x00, 0x07,
+  0x83, 0x00, 0x00, 0x00,  0x02, 0x08, 0x03, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x03, 0x00, 0x00, 0x00,
+  0x08, 0x13, 0x3D, 0x17,  0x96, 0x8C, 0x00, 0x08,  0x14, 0x08, 0x15, 0x07,  0x12, 0x00, 0x00, 0x00,
+  0x08, 0x16, 0x07, 0x08,  0x00, 0x00, 0x00, 0x08,  0x17, 0x07, 0x14, 0x00,  0x00, 0x00, 0x08, 0x18,
+  0x07, 0x11, 0x00, 0x00,  0x00, 0x08, 0x19, 0x07,  0x2E, 0x00, 0x00, 0x00,  0x08, 0x1A, 0x07, 0x28,
+  0x00, 0x00, 0x00, 0x08,  0x1B, 0x07, 0x23, 0x00,  0x00, 0x00, 0x08, 0x1C,  0x07, 0x0D, 0x00, 0x00,
+  0x00, 0x08, 0x1D, 0x07,  0x1B, 0x00, 0x00, 0x00,  0x08, 0x1E, 0x07, 0x24,  0x00, 0x00, 0x00, 0x08,
+  0x1F, 0x07, 0x2D, 0x00,  0x00, 0x00, 0x08, 0x20,  0x07, 0x25, 0x00, 0x00,  0x00, 0x08, 0x21, 0x07,
+  0x22, 0x00, 0x00, 0x00,  0x08, 0x22, 0x07, 0x21,  0x00, 0x00, 0x00, 0x08,  0x23, 0x07, 0x27, 0x00,
+  0x00, 0x00, 0x08, 0x24,  0x07, 0x10, 0x00, 0x00,  0x00, 0x08, 0x25, 0x07,  0x20, 0x00, 0x00, 0x00,
+  0x08, 0x26, 0x07, 0x09,  0x00, 0x00, 0x00, 0x08,  0x27, 0x07, 0x26, 0x00,  0x00, 0x00, 0x07, 0x13,
+  0x00, 0x00, 0x00, 0x43,  0x1D, 0x96, 0x09, 0x00,  0x08, 0x28, 0x07, 0x20,  0x03, 0x00, 0x00, 0x08,
+  0x14, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x00,  0x3D, 0x17, 0x96, 0x02,
+  0x00, 0x08, 0x14, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,
+  0x02, 0x00, 0x08, 0x0F,  0x52, 0x17, 0x96, 0x08,  0x00, 0x07, 0x07, 0x00,  0x00, 0x00, 0x02, 0x08,
+  0x14, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x13,  0x3D, 0x17, 0x96, 0x09,
+  0x00, 0x08, 0x29, 0x07,  0x00, 0x00, 0x00, 0x00,  0x08, 0x2A, 0x40, 0x1D,  0x96, 0x02, 0x00, 0x08,
+  0x29, 0x1C, 0x96, 0x13,  0x00, 0x08, 0x2B, 0x07,  0x00, 0x00, 0x00, 0x00,  0x07, 0x05, 0x00, 0x00,
+  0x00, 0x07, 0x02, 0x00,  0x00, 0x00, 0x08, 0x01,  0x3D, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x29, 0x1C,
+  0x96, 0x13, 0x00, 0x08,  0x2C, 0x07, 0x01, 0x00,  0x00, 0x00, 0x07, 0x05,  0x00, 0x00, 0x00, 0x07,
+  0x02, 0x00, 0x00, 0x00,  0x08, 0x01, 0x3D, 0x4F,  0x96, 0x02, 0x00, 0x08,  0x29, 0x1C, 0x96, 0x07,
+  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x03,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x0F, 0x52, 0x17,
+  0x96, 0x09, 0x00, 0x08,  0x2D, 0x07, 0x00, 0x00,  0x00, 0x00, 0x08, 0x2A,  0x40, 0x1D, 0x96, 0x02,
+  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x03, 0x1C, 0x96,
+  0x02, 0x00, 0x08, 0x0F,  0x52, 0x17, 0x96, 0x0E,  0x00, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x2E,
+  0x07, 0x9A, 0x02, 0x00,  0x00, 0x08, 0x2D, 0x1C,  0x96, 0x07, 0x00, 0x07,  0x04, 0x00, 0x00, 0x00,
+  0x08, 0x02, 0x3D, 0x17,  0x96, 0x02, 0x00, 0x08,  0x2F, 0x1C, 0x96, 0x02,  0x00, 0x08, 0x30, 0x4E,
+  0x96, 0x03, 0x00, 0x08,  0x31, 0x03, 0x4F, 0x96,  0x02, 0x00, 0x08, 0x2F,  0x1C, 0x96, 0x02, 0x00,
+  0x08, 0x30, 0x4E, 0x96,  0x03, 0x00, 0x08, 0x32,  0x03, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x2F, 0x1C,
+  0x96, 0x02, 0x00, 0x08,  0x30, 0x4E, 0x96, 0x03,  0x00, 0x08, 0x33, 0x03,  0x4F, 0x96, 0x02, 0x00,
+  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x04, 0x00,  0x08, 0x34, 0x08, 0x35,
+  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x13, 0x00,
+  0x08, 0x36, 0x07, 0x00,  0x00, 0x00, 0x00, 0x07,  0x2D, 0x01, 0x00, 0x00,  0x07, 0x02, 0x00, 0x00,
+  0x00, 0x08, 0x01, 0x3D,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,
+  0x4E, 0x96, 0x13, 0x00,  0x08, 0x37, 0x07, 0x03,  0x00, 0x00, 0x00, 0x07,  0x2D, 0x01, 0x00, 0x00,
+  0x07, 0x02, 0x00, 0x00,  0x00, 0x08, 0x01, 0x3D,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,
+  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x02, 0x00,  0x08, 0x38, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x4F, 0x96,  0x02, 0x00, 0x08, 0x2F,  0x1C, 0x96, 0x02, 0x00,  0x08, 0x30, 0x4E, 0x96,
+  0x02, 0x00, 0x08, 0x39,  0x9B, 0x09, 0x00, 0x00,  0x01, 0x00, 0x73, 0x72,  0x63, 0x00, 0x64, 0x00,
+  0x96, 0x02, 0x00, 0x08,  0x3A, 0x1C, 0x96, 0x01,  0x00, 0x02, 0x49, 0x12,  0x9D, 0x02, 0x00, 0x19,
+  0x00, 0x96, 0x09, 0x00,  0x05, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x06, 0x1C, 0x96, 0x02,
+  0x00, 0x08, 0x38, 0x52,  0x17, 0x99, 0x02, 0x00,  0x3A, 0x00, 0x96, 0x02,  0x00, 0x08, 0x3A, 0x1C,
+  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x06, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x37,
+  0x52, 0x17, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x04, 0x00, 0x08,  0x31, 0x05, 0x01, 0x4F,
+  0x96, 0x09, 0x00, 0x05,  0x01, 0x07, 0x01, 0x00,  0x00, 0x00, 0x08, 0x06,  0x1C, 0x96, 0x02, 0x00,
+  0x08, 0x38, 0x52, 0x17,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,  0x02, 0x00, 0x08, 0x30,
+  0x4E, 0x96, 0x02, 0x00,  0x08, 0x3B, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,  0xB3, 0x00, 0x96, 0x03,
+  0x00, 0x08, 0x3C, 0x02,  0x3C, 0x96, 0x02, 0x00,  0x08, 0x06, 0x46, 0x87,  0x01, 0x00, 0x00, 0x96,
+  0x01, 0x00, 0x02, 0x49,  0x9D, 0x02, 0x00, 0x91,  0x00, 0x96, 0x04, 0x00,  0x08, 0x07, 0x04, 0x00,
+  0x3C, 0x96, 0x02, 0x00,  0x08, 0x3C, 0x1C, 0x96,  0x01, 0x00, 0x02, 0x49,  0x9D, 0x02, 0x00, 0x41,
+  0x00, 0x96, 0x02, 0x00,  0x08, 0x3C, 0x4C, 0x1C,  0x96, 0x04, 0x00, 0x08,  0x3F, 0x08, 0x07, 0x1C,
+  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,  0x08, 0x3D, 0x3D, 0x47,  0x96, 0x02, 0x00, 0x08,
+  0x3E, 0x47, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x07, 0x1C, 0x4E, 0x96,
+  0x07, 0x00, 0x07, 0x01,  0x00, 0x00, 0x00, 0x08,  0x3D, 0x3D, 0x47, 0x47,  0x1D, 0x99, 0x02, 0x00,
+  0x33, 0x00, 0x96, 0x04,  0x00, 0x08, 0x3C, 0x08,  0x07, 0x1C, 0x96, 0x07,  0x00, 0x07, 0x01, 0x00,
+  0x00, 0x00, 0x08, 0x3D,  0x3D, 0x96, 0x02, 0x00,  0x08, 0x3E, 0x47, 0x96,  0x02, 0x00, 0x08, 0x06,
+  0x1C, 0x96, 0x02, 0x00,  0x08, 0x07, 0x1C, 0x4E,  0x96, 0x07, 0x00, 0x07,  0x01, 0x00, 0x00, 0x00,
+  0x08, 0x3D, 0x3D, 0x47,  0x1D, 0x99, 0x02, 0x00,  0x61, 0xFF, 0x96, 0x02,  0x00, 0x08, 0x3C, 0x1C,
+  0x3E, 0x4F, 0x96, 0x02,  0x00, 0x08, 0x2F, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x30, 0x4E, 0x96, 0x02,
+  0x00, 0x08, 0x40, 0x9B,  0x05, 0x00, 0x00, 0x00,  0x00, 0x0D, 0x00, 0x96,  0x02, 0x00, 0x08, 0x06,
+  0x1C, 0x96, 0x02, 0x00,  0x08, 0x32, 0x4E, 0x3E,  0x4F, 0x96, 0x02, 0x00,  0x08, 0x2F, 0x1C, 0x96,
+  0x02, 0x00, 0x08, 0x30,  0x4E, 0x96, 0x02, 0x00,  0x08, 0x41, 0x9B, 0x05,  0x00, 0x00, 0x00, 0x00,
+  0x0D, 0x00, 0x96, 0x02,  0x00, 0x08, 0x06, 0x1C,  0x96, 0x02, 0x00, 0x08,  0x33, 0x4E, 0x3E, 0x4F,
+  0x96, 0x08, 0x00, 0x07,  0x84, 0x00, 0x00, 0x00,  0x02, 0x08, 0x2F, 0x1C,  0x96, 0x02, 0x00, 0x08,
+  0x30, 0x4E, 0x96, 0x07,  0x00, 0x07, 0x03, 0x00,  0x00, 0x00, 0x08, 0x13,  0x3D, 0x17, 0x00
 };
 
diff --git a/libswfdec/swfdec_loadvars_as.c b/libswfdec/swfdec_loadvars_as.c
new file mode 100644
index 0000000..2e1553a
--- /dev/null
+++ b/libswfdec/swfdec_loadvars_as.c
@@ -0,0 +1,70 @@
+/* Swfdec
+ * Copyright (C) 2007 Benjamin Otte <otte at gnome.org>
+ *		 2007 Pekka Lampila <pekka.lampila at iki.fi>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+
+#include "swfdec_debug.h"
+#include "swfdec_as_types.h"
+#include "swfdec_as_object.h"
+#include "swfdec_as_string.h"
+#include "swfdec_as_strings.h"
+#include "swfdec_player_internal.h"
+
+/*** AS CODE ***/
+
+SWFDEC_AS_NATIVE (301, 3, swfdec_loadvars_decode)
+void
+swfdec_loadvars_decode (SwfdecAsContext *cx, SwfdecAsObject *obj,
+    guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval)
+{
+  if (argc > 0) {
+    SwfdecAsValue val;
+    const char *str;
+    char **varlist, *p;
+    guint i;
+
+    str =
+      swfdec_as_string_unescape (cx, swfdec_as_value_to_string (cx, &argv[0]));
+    if (str == NULL)
+      return;
+
+    varlist = g_strsplit (str, "&", -1);
+
+    for (i = 0; varlist[i] != NULL; i++) {
+      p = strchr (varlist[i], '=');
+      if (p != NULL) {
+	*p++ = '\0';
+	if (*p == '\0')
+	  p = NULL;
+      }
+
+      if (p != NULL) {
+	SWFDEC_AS_VALUE_SET_STRING (&val, swfdec_as_context_get_string (cx, p));
+      } else {
+	SWFDEC_AS_VALUE_SET_STRING (&val, SWFDEC_AS_STR_EMPTY);
+      }
+      swfdec_as_object_set_variable (obj, swfdec_as_context_get_string (cx, varlist[i]), &val);
+    }
+  }
+}
diff-tree a7ae2ccc6a9f28b013e31293fcfa87b7c1b7fd88 (from 25c7f3ad0a28525a041bfe895f04aeeaf2c73375)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 11:15:47 2007 +0300

    Mark _bytesLoaded and _bytesTotal hidden in LoadObject

diff --git a/libswfdec/swfdec_load_object.c b/libswfdec/swfdec_load_object.c
index 6542f7c..2b19f07 100644
--- a/libswfdec/swfdec_load_object.c
+++ b/libswfdec/swfdec_load_object.c
@@ -45,12 +45,12 @@ swfdec_load_object_loader_target_parse (
   SwfdecLoadObject *load_object = SWFDEC_LOAD_OBJECT (target);
 
   SWFDEC_AS_VALUE_SET_INT (&val, swfdec_loader_get_loaded (loader));
-  swfdec_as_object_set_variable (load_object->target,
-      SWFDEC_AS_STR__bytesLoaded, &val);
+  swfdec_as_object_set_variable_and_flags (load_object->target,
+      SWFDEC_AS_STR__bytesLoaded, &val, SWFDEC_AS_VARIABLE_HIDDEN);
 
   SWFDEC_AS_VALUE_SET_INT (&val, swfdec_loader_get_size (loader));
-  swfdec_as_object_set_variable (load_object->target, SWFDEC_AS_STR__bytesTotal,
-      &val);
+  swfdec_as_object_set_variable_and_flags (load_object->target,
+      SWFDEC_AS_STR__bytesTotal, &val, SWFDEC_AS_VARIABLE_HIDDEN);
 }
 
 static void
@@ -186,8 +186,8 @@ swfdec_load_object_load (SwfdecLoadObjec
   swfdec_loader_set_data_type (load_object->loader, SWFDEC_LOADER_DATA_TEXT);
 
   SWFDEC_AS_VALUE_SET_INT (&val, 0);
-  swfdec_as_object_set_variable (load_object->target,
-      SWFDEC_AS_STR__bytesLoaded, &val);
+  swfdec_as_object_set_variable_and_flags (load_object->target,
+      SWFDEC_AS_STR__bytesLoaded, &val, SWFDEC_AS_VARIABLE_HIDDEN);
 }
 
 SwfdecAsObject *
diff-tree 25c7f3ad0a28525a041bfe895f04aeeaf2c73375 (from c7b91a2f93c264e6c06adabe1b4fcd97fb590c50)
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Mon Aug 20 11:14:30 2007 +0300

    Make a version of unescape function that is available from the code

diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c
index 318a363..a200a22 100644
--- a/libswfdec/swfdec_as_string.c
+++ b/libswfdec/swfdec_as_string.c
@@ -465,12 +465,10 @@ swfdec_as_string_toUpperCase (SwfdecAsCo
 
 /* escape and unescape are implemented here so the mad string functions share the same place */
 
-static void
-swfdec_as_string_unescape_5 (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+static char *
+swfdec_as_string_unescape_5 (SwfdecAsContext *cx, const char *msg)
 {
   GByteArray *array;
-  const char *msg;
   char cur = 0; /* currently decoded character */
   char *out, *in, *s;
   guint decoding = 0; /* set if we're decoding a %XY string */
@@ -480,11 +478,10 @@ swfdec_as_string_unescape_5 (SwfdecAsCon
   g_byte_array_append (array, (guchar *) chr, 1); \
 }G_STMT_END
   array = g_byte_array_new ();
-  msg = swfdec_as_value_to_string (cx, &argv[0]);
   in = s = g_convert (msg, -1, "LATIN1", "UTF-8", NULL, NULL, NULL);
   if (s == NULL) {
     SWFDEC_FIXME ("%s can not be converted to utf8 - is this Flash 5 or what?", msg);
-    return;
+    return NULL;
   }
   while (*s != 0) {
     if (decoding) {
@@ -515,21 +512,19 @@ swfdec_as_string_unescape_5 (SwfdecAsCon
     s++;
   }
   g_free (in);
-  if (array->len == 0) {
-    SWFDEC_AS_VALUE_SET_UNDEFINED (ret);
-    return;
-  }
+  if (array->len == 0)
+    return NULL;
   cur = 0;
   g_byte_array_append (array, (guchar *) &cur, 1);
   out = g_convert ((char *) array->data, -1, "UTF-8", "LATIN1", NULL, NULL, NULL);
+  g_byte_array_free (array, TRUE);
   if (out) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, out));
-    g_free (out);
+    return out;
   } else {
     g_warning ("can't convert %s to UTF-8", msg);
-    SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY);
+    g_free (out);
+    return NULL;
   }
-  g_byte_array_free (array, TRUE);
 #undef APPEND
 }
 
@@ -573,12 +568,11 @@ swfdec_as_string_escape (SwfdecAsContext
   g_free (in);
 }
 
-static void
-swfdec_as_string_unescape (SwfdecAsContext *cx, SwfdecAsObject *object,
-    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+static char *
+swfdec_as_string_unescape_6 (SwfdecAsContext *cx, const char *s)
 {
   GByteArray *array;
-  const char *s, *msg;
+  const char *msg;
   char cur = 0; /* currently decoded character */
   guint decoding = 0; /* set if we're decoding a %XY string */
   guint utf8left = 0; /* how many valid utf8 chars are still required */
@@ -615,7 +609,7 @@ swfdec_as_string_unescape (SwfdecAsConte
   } \
 }G_STMT_END
   array = g_byte_array_new ();
-  msg = s = swfdec_as_value_to_string (cx, &argv[0]);
+  msg = s;
   while (*s != 0) {
     if (decoding) {
       decoding++;
@@ -657,15 +651,42 @@ swfdec_as_string_unescape (SwfdecAsConte
   }
   g_byte_array_append (array, (guchar *) &cur, 1);
   if (g_utf8_validate ((char *) array->data, -1, NULL)) {
-    SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, (char *) array->data));
+    return (char *) g_byte_array_free (array, FALSE);
   } else {
     g_warning ("%s unescaped is invalid UTF-8", msg);
-    SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY);
+    g_byte_array_free (array, TRUE);
+    return NULL;
   }
-  g_byte_array_free (array, TRUE);
 #undef APPEND
 }
 
+char *
+swfdec_as_string_unescape (SwfdecAsContext *context, const char *string)
+{
+  if (context->version < 6) {
+    return swfdec_as_string_unescape_5 (context, string);
+  } else {
+    return swfdec_as_string_unescape_6 (context, string);
+  }
+}
+
+static void
+swfdec_as_string_unescape_internal (SwfdecAsContext *cx, SwfdecAsObject *object,
+    guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
+{
+  char *result;
+
+  result =
+    swfdec_as_string_unescape (cx, swfdec_as_value_to_string (cx, &argv[0]));
+  if (result != NULL) {
+    SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, result));
+  } else {
+    SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR_EMPTY);
+  }
+
+  g_free (result);
+}
+
 void
 swfdec_as_string_init_context (SwfdecAsContext *context, guint version)
 {
@@ -710,12 +731,7 @@ swfdec_as_string_init_context (SwfdecAsC
   }
 
   /* add properties to global object */
-  if (version <= 5) {
-    swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_escape, 0, swfdec_as_string_escape, 1);
-    swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_unescape, 0, swfdec_as_string_unescape_5, 1);
-  } else {
-    swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_escape, 0, swfdec_as_string_escape, 1);
-    swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_unescape, 0, swfdec_as_string_unescape, 1);
-  }
+  swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_escape, 0, swfdec_as_string_escape, 1);
+  swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_unescape, 0, swfdec_as_string_unescape_internal, 1);
 }
 
diff --git a/libswfdec/swfdec_as_string.h b/libswfdec/swfdec_as_string.h
index 4266807..94d796e 100644
--- a/libswfdec/swfdec_as_string.h
+++ b/libswfdec/swfdec_as_string.h
@@ -49,6 +49,7 @@ GType		swfdec_as_string_get_type	(void);
 
 void		swfdec_as_string_init_context	(SwfdecAsContext *	context,
 						 guint			version);
+char		*swfdec_as_string_unescape	(SwfdecAsContext *	context,						 const char *		string);
 
 
 G_END_DECLS


More information about the Swfdec mailing list