gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r10949: Track which version of the V


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10949: Track which version of the VM is executing. It is now possible to initialize
Date: Mon, 01 Jun 2009 08:38:25 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 10949
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2009-06-01 08:38:25 +0200
message:
  Track which version of the VM is executing. It is now possible to initialize
  the correct object prototypes for AS2 and AS3, though not yet to execute
  both AS2 and AS3 in one run.
  
  Test that AS3 classes are not available in AS2, and fix all the new as_objects
  (except filters) to separate them while still allowing selective building
  of classes.
  
  Make classes that exist just for enumerating constants simpler.
removed:
  libcore/swf/DoABCTag.cpp
modified:
  libcore/asobj/flash/accessibility/accessibility.am
  libcore/asobj/flash/accessibility/accessibility_pkg.cpp
  libcore/asobj/flash/desktop/desktop.am
  libcore/asobj/flash/desktop/desktop_pkg.cpp
  libcore/asobj/flash/display/ActionScriptVersion_as.cpp
  libcore/asobj/flash/display/BitmapDataChannel_as.cpp
  libcore/asobj/flash/display/CapsStyle_as.cpp
  libcore/asobj/flash/display/GradientType_as.cpp
  libcore/asobj/flash/display/InterpolationMethod_as.cpp
  libcore/asobj/flash/display/JointStyle_as.cpp
  libcore/asobj/flash/display/LineScaleMode_as.cpp
  libcore/asobj/flash/display/PixelSnapping_as.cpp
  libcore/asobj/flash/display/SWFVersion_as.cpp
  libcore/asobj/flash/display/SpreadMethod_as.cpp
  libcore/asobj/flash/display/display.am
  libcore/asobj/flash/display/display_pkg.cpp
  libcore/asobj/flash/errors/errors.am
  libcore/asobj/flash/errors/errors_pkg.cpp
  libcore/asobj/flash/events/events.am
  libcore/asobj/flash/events/events_pkg.cpp
  libcore/asobj/flash/external/external.am
  libcore/asobj/flash/external/external_pkg.cpp
  libcore/asobj/flash/filters/filters.am
  libcore/asobj/flash/filters/filters_pkg.cpp
  libcore/asobj/flash/flash_pkg.cpp
  libcore/asobj/flash/flashclasses.h
  libcore/asobj/flash/geom/geom.am
  libcore/asobj/flash/geom/geom_pkg.cpp
  libcore/asobj/flash/media/media.am
  libcore/asobj/flash/media/media_pkg.cpp
  libcore/asobj/flash/net/SharedObjectFlushStatus_as.cpp
  libcore/asobj/flash/net/URLLoaderDataFormat_as.cpp
  libcore/asobj/flash/net/URLRequestMethod_as.cpp
  libcore/asobj/flash/net/net.am
  libcore/asobj/flash/net/net_pkg.cpp
  libcore/asobj/flash/printing/PrintJobOrientation_as.cpp
  libcore/asobj/flash/printing/printing.am
  libcore/asobj/flash/printing/printing_pkg.cpp
  libcore/asobj/flash/sampler/sampler.am
  libcore/asobj/flash/sampler/sampler_pkg.cpp
  libcore/asobj/flash/system/IMEConversionMode_as.cpp
  libcore/asobj/flash/system/system.am
  libcore/asobj/flash/system/system_pkg.cpp
  libcore/asobj/flash/text/AntiAliasType_as.cpp
  libcore/asobj/flash/text/GridFitType_as.cpp
  libcore/asobj/flash/text/TextColorType_as.cpp
  libcore/asobj/flash/text/TextDisplayMode_as.cpp
  libcore/asobj/flash/text/text.am
  libcore/asobj/flash/text/text_pkg.cpp
  libcore/asobj/flash/ui/ui.am
  libcore/asobj/flash/ui/ui_pkg.cpp
  libcore/asobj/flash/utils/utils.am
  libcore/asobj/flash/utils/utils_pkg.cpp
  libcore/asobj/flash/xml/XMLNodeType_as.cpp
  libcore/asobj/flash/xml/xml.am
  libcore/asobj/flash/xml/xml_pkg.cpp
  libcore/swf/DoABCTag.h
  libcore/vm/Machine.cpp
  libcore/vm/VM.cpp
  libcore/vm/VM.h
  libmedia/gst/GstUtil.cpp
  libmedia/gst/MediaHandlerGst.cpp
  libmedia/gst/MediaParserGst.h
  testsuite/actionscript.all/flash.as
  testsuite/as3/classes.all/net/SharedObject_as.hx
    ------------------------------------------------------------
    revno: 10946.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 08:11:27 +0200
    message:
      Don't make the preprocessor error out because it interrupts the testsuite,
      which is far more annoying than a segfault.
    modified:
      testsuite/as3/classes.all/net/SharedObject_as.hx
    ------------------------------------------------------------
    revno: 10946.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 08:11:46 +0200
    message:
      Simplify more constant enumeration classes.
    modified:
      libcore/asobj/flash/display/ActionScriptVersion_as.cpp
      libcore/asobj/flash/display/BitmapDataChannel_as.cpp
      libcore/asobj/flash/display/CapsStyle_as.cpp
      libcore/asobj/flash/display/GradientType_as.cpp
      libcore/asobj/flash/display/InterpolationMethod_as.cpp
      libcore/asobj/flash/display/JointStyle_as.cpp
      libcore/asobj/flash/display/LineScaleMode_as.cpp
      libcore/asobj/flash/display/PixelSnapping_as.cpp
      libcore/asobj/flash/display/SWFVersion_as.cpp
      libcore/asobj/flash/display/SpreadMethod_as.cpp
      libcore/asobj/flash/net/SharedObjectFlushStatus_as.cpp
      libcore/asobj/flash/net/URLLoaderDataFormat_as.cpp
      libcore/asobj/flash/net/URLRequestMethod_as.cpp
      libcore/asobj/flash/printing/PrintJobOrientation_as.cpp
      libcore/asobj/flash/system/IMEConversionMode_as.cpp
      libcore/asobj/flash/text/AntiAliasType_as.cpp
      libcore/asobj/flash/text/GridFitType_as.cpp
      libcore/asobj/flash/text/TextColorType_as.cpp
      libcore/asobj/flash/text/TextDisplayMode_as.cpp
      libcore/asobj/flash/xml/XMLNodeType_as.cpp
    ------------------------------------------------------------
    revno: 10946.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 08:50:02 +0200
    message:
      Drop empty file. Notify VM when it's executing AVM2 code, as this is the
      only way currently to know whether we are running AS1/2 or AS3. We have
      to know this in order to initialize objects correctly (and for many
      other things).
    removed:
      libcore/swf/DoABCTag.cpp
    modified:
      libcore/swf/DoABCTag.h
      libcore/vm/VM.cpp
      libcore/vm/VM.h
    ------------------------------------------------------------
    revno: 10946.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 09:25:38 +0200
    message:
      Load only AVM1 flash package classes when not running AVM2. This needs to
      be done also for the other AVM1 flash package classes (geom, net etc) so
      that extra classes are not loaded.
    modified:
      libcore/asobj/flash/flash_pkg.cpp
      libcore/asobj/flash/flashclasses.h
    ------------------------------------------------------------
    revno: 10946.1.5
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 09:36:14 +0200
    message:
      Rename asclasses arrays to as3classes so that we can distinguish between
      them and as2classes.
    modified:
      libcore/asobj/flash/accessibility/accessibility.am
      libcore/asobj/flash/accessibility/accessibility_pkg.cpp
      libcore/asobj/flash/desktop/desktop.am
      libcore/asobj/flash/desktop/desktop_pkg.cpp
      libcore/asobj/flash/display/display.am
      libcore/asobj/flash/display/display_pkg.cpp
      libcore/asobj/flash/errors/errors.am
      libcore/asobj/flash/errors/errors_pkg.cpp
      libcore/asobj/flash/events/events.am
      libcore/asobj/flash/events/events_pkg.cpp
      libcore/asobj/flash/external/external.am
      libcore/asobj/flash/external/external_pkg.cpp
      libcore/asobj/flash/filters/filters.am
      libcore/asobj/flash/filters/filters_pkg.cpp
      libcore/asobj/flash/geom/geom.am
      libcore/asobj/flash/geom/geom_pkg.cpp
      libcore/asobj/flash/media/media.am
      libcore/asobj/flash/media/media_pkg.cpp
      libcore/asobj/flash/net/net.am
      libcore/asobj/flash/net/net_pkg.cpp
      libcore/asobj/flash/printing/printing.am
      libcore/asobj/flash/printing/printing_pkg.cpp
      libcore/asobj/flash/sampler/sampler.am
      libcore/asobj/flash/sampler/sampler_pkg.cpp
      libcore/asobj/flash/system/system.am
      libcore/asobj/flash/system/system_pkg.cpp
      libcore/asobj/flash/text/text.am
      libcore/asobj/flash/text/text_pkg.cpp
      libcore/asobj/flash/ui/ui.am
      libcore/asobj/flash/ui/ui_pkg.cpp
      libcore/asobj/flash/utils/utils.am
      libcore/asobj/flash/utils/utils_pkg.cpp
      libcore/asobj/flash/xml/xml.am
      libcore/asobj/flash/xml/xml_pkg.cpp
    ------------------------------------------------------------
    revno: 10946.1.6
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 10:12:11 +0200
    message:
      Start to distinguish between as2 and as3 classes so that we don't get
      classes where they aren't expected. Assert that certain packages are only
      initialized from the correct kind of bytecode.
    modified:
      libcore/asobj/flash/accessibility/accessibility_pkg.cpp
      libcore/asobj/flash/desktop/desktop_pkg.cpp
      libcore/asobj/flash/display/display.am
      libcore/asobj/flash/display/display_pkg.cpp
      libcore/asobj/flash/errors/errors_pkg.cpp
      libcore/asobj/flash/events/events_pkg.cpp
      libcore/asobj/flash/external/external_pkg.cpp
      libcore/asobj/flash/filters/filters_pkg.cpp
      libcore/asobj/flash/geom/geom_pkg.cpp
      libcore/asobj/flash/media/media_pkg.cpp
    ------------------------------------------------------------
    revno: 10946.1.7
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 10:30:14 +0200
    message:
      Separate AS2 and AS3 flash.net classes. Don't miss headers in display.am.
    modified:
      libcore/asobj/flash/display/display.am
      libcore/asobj/flash/net/net.am
      libcore/asobj/flash/net/net_pkg.cpp
    ------------------------------------------------------------
    revno: 10946.1.8
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 14:30:07 +0200
    message:
      Only log unimplemented once, more information in log_abc.
    modified:
      libcore/vm/Machine.cpp
    ------------------------------------------------------------
    revno: 10946.1.9
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 14:30:46 +0200
    message:
      Line breaks, tabs to spaces.
    modified:
      libmedia/gst/GstUtil.cpp
      libmedia/gst/MediaHandlerGst.cpp
      libmedia/gst/MediaParserGst.h
    ------------------------------------------------------------
    revno: 10946.1.10
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 16:13:41 +0200
    message:
      Make sure all packages log the AVM version; AVM2-only packages will abort
      if called from AS2 to make sure this doesn't happen.
    modified:
      libcore/asobj/flash/printing/printing_pkg.cpp
      libcore/asobj/flash/sampler/sampler_pkg.cpp
      libcore/asobj/flash/system/system_pkg.cpp
      libcore/asobj/flash/text/text.am
      libcore/asobj/flash/text/text_pkg.cpp
      libcore/asobj/flash/ui/ui_pkg.cpp
      libcore/asobj/flash/utils/utils_pkg.cpp
      libcore/asobj/flash/xml/xml_pkg.cpp
    ------------------------------------------------------------
    revno: 10946.1.11
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 16:23:52 +0200
    message:
      Tabs to spaces...
    modified:
      libcore/asobj/flash/external/external_pkg.cpp
    ------------------------------------------------------------
    revno: 10946.1.12
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 16:23:57 +0200
    message:
      Move AVM2 switcher to Machine::execute, as this can also be called from
      SymbolClassTag.
    modified:
      libcore/swf/DoABCTag.h
      libcore/vm/Machine.cpp
    ------------------------------------------------------------
    revno: 10946.1.13
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-05-29 16:39:11 +0200
    message:
      Test the flash package for the absence of AS3 classes.
    modified:
      testsuite/actionscript.all/flash.as
=== modified file 'libcore/asobj/flash/accessibility/accessibility.am'
--- a/libcore/asobj/flash/accessibility/accessibility.am        2009-05-28 
07:00:14 +0000
+++ b/libcore/asobj/flash/accessibility/accessibility.am        2009-05-29 
07:36:14 +0000
@@ -44,7 +44,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_ACCESSIBILITY_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_ACCESSIBILITY_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(ACCESSIBILITY_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/accessibility/accessibility_pkg.cpp'
--- a/libcore/asobj/flash/accessibility/accessibility_pkg.cpp   2009-05-28 
07:00:14 +0000
+++ b/libcore/asobj/flash/accessibility/accessibility_pkg.cpp   2009-05-29 
08:12:11 +0000
@@ -33,15 +33,19 @@
 namespace gnash {
 
 static as_value
-get_flash_accessibility_package(const fn_call& /*fn*/)
+get_flash_accessibility_package(const fn_call& fn)
 {
-       log_debug("Loading flash.accessibility package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.accessibility package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       while (asclasses[++i] != 0) {
-           asclasses[i](*pkg);
+       while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
     }
 
        return pkg;

=== modified file 'libcore/asobj/flash/desktop/desktop.am'
--- a/libcore/asobj/flash/desktop/desktop.am    2009-05-28 06:05:17 +0000
+++ b/libcore/asobj/flash/desktop/desktop.am    2009-05-29 07:36:14 +0000
@@ -50,7 +50,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_DESKTOP_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_DESKTOP_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(DESKTOP_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/desktop/desktop_pkg.cpp'
--- a/libcore/asobj/flash/desktop/desktop_pkg.cpp       2009-05-28 06:31:22 
+0000
+++ b/libcore/asobj/flash/desktop/desktop_pkg.cpp       2009-05-29 08:12:11 
+0000
@@ -33,16 +33,20 @@
 namespace gnash {
 
 static as_value
-get_flash_desktop_package(const fn_call& /*fn*/)
+get_flash_desktop_package(const fn_call& fn)
 {
-       log_debug("Loading flash.desktop package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.desktop package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+    while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/display/ActionScriptVersion_as.cpp'
--- a/libcore/asobj/flash/display/ActionScriptVersion_as.cpp    2009-05-28 
17:10:05 +0000
+++ b/libcore/asobj/flash/display/ActionScriptVersion_as.cpp    2009-05-29 
06:11:46 +0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.ActionScriptVersion class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value actionscriptversion_ctor(const fn_call& fn);
-    void attachActionScriptVersionInterface(as_object& o);
     void attachActionScriptVersionStaticInterface(as_object& o);
-    as_object* getActionScriptVersionInterface();
-
 }
 
-class ActionScriptVersion_as : public as_object
-{
-
-public:
-
-    ActionScriptVersion_as()
-        :
-        as_object(getActionScriptVersionInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void actionscriptversion_class_init(as_object& global)
+void
+actionscriptversion_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&actionscriptversion_ctor, 
getActionScriptVersionInterface());
-        attachActionScriptVersionStaticInterface(*cl);
-    }
-
-    // Register _global.ActionScriptVersion
-    global.init_member("ActionScriptVersion", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachActionScriptVersionStaticInterface(*o);
+    global.init_member("ActionScriptVersion", o);
 }
 
 namespace {
 
 void
-attachActionScriptVersionInterface(as_object& o)
-{
-}
-
-void
 attachActionScriptVersionStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getActionScriptVersionInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachActionScriptVersionInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-actionscriptversion_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new ActionScriptVersion_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/BitmapDataChannel_as.cpp'
--- a/libcore/asobj/flash/display/BitmapDataChannel_as.cpp      2009-05-28 
17:10:05 +0000
+++ b/libcore/asobj/flash/display/BitmapDataChannel_as.cpp      2009-05-29 
06:11:46 +0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.BitmapDataChannel class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value bitmapdatachannel_ctor(const fn_call& fn);
-    void attachBitmapDataChannelInterface(as_object& o);
     void attachBitmapDataChannelStaticInterface(as_object& o);
-    as_object* getBitmapDataChannelInterface();
-
 }
 
-class BitmapDataChannel_as : public as_object
-{
-
-public:
-
-    BitmapDataChannel_as()
-        :
-        as_object(getBitmapDataChannelInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void bitmapdatachannel_class_init(as_object& global)
+void
+bitmapdatachannel_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&bitmapdatachannel_ctor, 
getBitmapDataChannelInterface());
-        attachBitmapDataChannelStaticInterface(*cl);
-    }
-
-    // Register _global.BitmapDataChannel
-    global.init_member("BitmapDataChannel", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachBitmapDataChannelStaticInterface(*o);
+    global.init_member("BitmapDataChannel", o);
 }
 
 namespace {
 
 void
-attachBitmapDataChannelInterface(as_object& o)
-{
-}
-
-void
 attachBitmapDataChannelStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getBitmapDataChannelInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachBitmapDataChannelInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-bitmapdatachannel_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new BitmapDataChannel_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/CapsStyle_as.cpp'
--- a/libcore/asobj/flash/display/CapsStyle_as.cpp      2009-05-28 17:10:05 
+0000
+++ b/libcore/asobj/flash/display/CapsStyle_as.cpp      2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.CapsStyle class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value capsstyle_ctor(const fn_call& fn);
-    void attachCapsStyleInterface(as_object& o);
     void attachCapsStyleStaticInterface(as_object& o);
-    as_object* getCapsStyleInterface();
-
 }
 
-class CapsStyle_as : public as_object
-{
-
-public:
-
-    CapsStyle_as()
-        :
-        as_object(getCapsStyleInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void capsstyle_class_init(as_object& global)
+void
+capsstyle_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&capsstyle_ctor, getCapsStyleInterface());
-        attachCapsStyleStaticInterface(*cl);
-    }
-
-    // Register _global.CapsStyle
-    global.init_member("CapsStyle", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachCapsStyleStaticInterface(*o);
+    global.init_member("CapsStyle", o);
 }
 
 namespace {
 
 void
-attachCapsStyleInterface(as_object& o)
-{
-}
-
-void
 attachCapsStyleStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getCapsStyleInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachCapsStyleInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-capsstyle_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new CapsStyle_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/GradientType_as.cpp'
--- a/libcore/asobj/flash/display/GradientType_as.cpp   2009-05-28 17:10:05 
+0000
+++ b/libcore/asobj/flash/display/GradientType_as.cpp   2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.GradientType class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value gradienttype_ctor(const fn_call& fn);
-    void attachGradientTypeInterface(as_object& o);
     void attachGradientTypeStaticInterface(as_object& o);
-    as_object* getGradientTypeInterface();
-
 }
 
-class GradientType_as : public as_object
-{
-
-public:
-
-    GradientType_as()
-        :
-        as_object(getGradientTypeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void gradienttype_class_init(as_object& global)
+void
+gradienttype_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&gradienttype_ctor, 
getGradientTypeInterface());
-        attachGradientTypeStaticInterface(*cl);
-    }
-
-    // Register _global.GradientType
-    global.init_member("GradientType", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachGradientTypeStaticInterface(*o);
+    global.init_member("GradientType", o);
 }
 
 namespace {
 
 void
-attachGradientTypeInterface(as_object& o)
-{
-}
-
-void
 attachGradientTypeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getGradientTypeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachGradientTypeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-gradienttype_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new GradientType_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/InterpolationMethod_as.cpp'
--- a/libcore/asobj/flash/display/InterpolationMethod_as.cpp    2009-05-28 
17:10:05 +0000
+++ b/libcore/asobj/flash/display/InterpolationMethod_as.cpp    2009-05-29 
06:11:46 +0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.InterpolationMethod class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value interpolationmethod_ctor(const fn_call& fn);
-    void attachInterpolationMethodInterface(as_object& o);
     void attachInterpolationMethodStaticInterface(as_object& o);
-    as_object* getInterpolationMethodInterface();
-
 }
 
-class InterpolationMethod_as : public as_object
-{
-
-public:
-
-    InterpolationMethod_as()
-        :
-        as_object(getInterpolationMethodInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void interpolationmethod_class_init(as_object& global)
+void
+interpolationmethod_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&interpolationmethod_ctor, 
getInterpolationMethodInterface());
-        attachInterpolationMethodStaticInterface(*cl);
-    }
-
-    // Register _global.InterpolationMethod
-    global.init_member("InterpolationMethod", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachInterpolationMethodStaticInterface(*o);
+    global.init_member("InterpolationMethod", o);
 }
 
 namespace {
 
 void
-attachInterpolationMethodInterface(as_object& o)
-{
-}
-
-void
 attachInterpolationMethodStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getInterpolationMethodInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachInterpolationMethodInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-interpolationmethod_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new InterpolationMethod_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/JointStyle_as.cpp'
--- a/libcore/asobj/flash/display/JointStyle_as.cpp     2009-05-28 17:10:05 
+0000
+++ b/libcore/asobj/flash/display/JointStyle_as.cpp     2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.JointStyle class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value jointstyle_ctor(const fn_call& fn);
-    void attachJointStyleInterface(as_object& o);
     void attachJointStyleStaticInterface(as_object& o);
-    as_object* getJointStyleInterface();
-
 }
 
-class JointStyle_as : public as_object
-{
-
-public:
-
-    JointStyle_as()
-        :
-        as_object(getJointStyleInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void jointstyle_class_init(as_object& global)
+void
+jointstyle_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&jointstyle_ctor, getJointStyleInterface());
-        attachJointStyleStaticInterface(*cl);
-    }
-
-    // Register _global.JointStyle
-    global.init_member("JointStyle", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachJointStyleStaticInterface(*o);
+    global.init_member("JointStyle", o);
 }
 
 namespace {
 
 void
-attachJointStyleInterface(as_object& o)
-{
-}
-
-void
 attachJointStyleStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getJointStyleInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachJointStyleInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-jointstyle_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new JointStyle_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/LineScaleMode_as.cpp'
--- a/libcore/asobj/flash/display/LineScaleMode_as.cpp  2009-05-28 17:10:05 
+0000
+++ b/libcore/asobj/flash/display/LineScaleMode_as.cpp  2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.LineScaleMode class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value linescalemode_ctor(const fn_call& fn);
-    void attachLineScaleModeInterface(as_object& o);
     void attachLineScaleModeStaticInterface(as_object& o);
-    as_object* getLineScaleModeInterface();
-
 }
 
-class LineScaleMode_as : public as_object
-{
-
-public:
-
-    LineScaleMode_as()
-        :
-        as_object(getLineScaleModeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void linescalemode_class_init(as_object& global)
+void
+linescalemode_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&linescalemode_ctor, 
getLineScaleModeInterface());
-        attachLineScaleModeStaticInterface(*cl);
-    }
-
-    // Register _global.LineScaleMode
-    global.init_member("LineScaleMode", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachLineScaleModeStaticInterface(*o);
+    global.init_member("LineScaleMode", o);
 }
 
 namespace {
 
 void
-attachLineScaleModeInterface(as_object& o)
-{
-}
-
-void
 attachLineScaleModeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getLineScaleModeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachLineScaleModeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-linescalemode_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new LineScaleMode_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/PixelSnapping_as.cpp'
--- a/libcore/asobj/flash/display/PixelSnapping_as.cpp  2009-05-28 17:10:05 
+0000
+++ b/libcore/asobj/flash/display/PixelSnapping_as.cpp  2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.PixelSnapping class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value pixelsnapping_ctor(const fn_call& fn);
-    void attachPixelSnappingInterface(as_object& o);
     void attachPixelSnappingStaticInterface(as_object& o);
-    as_object* getPixelSnappingInterface();
-
 }
 
-class PixelSnapping_as : public as_object
-{
-
-public:
-
-    PixelSnapping_as()
-        :
-        as_object(getPixelSnappingInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void pixelsnapping_class_init(as_object& global)
+void
+pixelsnapping_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&pixelsnapping_ctor, 
getPixelSnappingInterface());
-        attachPixelSnappingStaticInterface(*cl);
-    }
-
-    // Register _global.PixelSnapping
-    global.init_member("PixelSnapping", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachPixelSnappingStaticInterface(*o);
+    global.init_member("PixelSnapping", o);
 }
 
 namespace {
 
 void
-attachPixelSnappingInterface(as_object& o)
-{
-}
-
-void
 attachPixelSnappingStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getPixelSnappingInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachPixelSnappingInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-pixelsnapping_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new PixelSnapping_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/SWFVersion_as.cpp'
--- a/libcore/asobj/flash/display/SWFVersion_as.cpp     2009-05-28 17:10:05 
+0000
+++ b/libcore/asobj/flash/display/SWFVersion_as.cpp     2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.SWFVersion class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value swfversion_ctor(const fn_call& fn);
-    void attachSWFVersionInterface(as_object& o);
     void attachSWFVersionStaticInterface(as_object& o);
-    as_object* getSWFVersionInterface();
-
 }
 
-class SWFVersion_as : public as_object
-{
-
-public:
-
-    SWFVersion_as()
-        :
-        as_object(getSWFVersionInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void swfversion_class_init(as_object& global)
+void
+swfversion_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&swfversion_ctor, getSWFVersionInterface());
-        attachSWFVersionStaticInterface(*cl);
-    }
-
-    // Register _global.SWFVersion
-    global.init_member("SWFVersion", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachSWFVersionStaticInterface(*o);
+    global.init_member("SWFVersion", o);
 }
 
 namespace {
 
 void
-attachSWFVersionInterface(as_object& o)
-{
-}
-
-void
 attachSWFVersionStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getSWFVersionInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachSWFVersionInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-swfversion_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new SWFVersion_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/SpreadMethod_as.cpp'
--- a/libcore/asobj/flash/display/SpreadMethod_as.cpp   2009-05-28 17:10:05 
+0000
+++ b/libcore/asobj/flash/display/SpreadMethod_as.cpp   2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.display.SpreadMethod class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value spreadmethod_ctor(const fn_call& fn);
-    void attachSpreadMethodInterface(as_object& o);
     void attachSpreadMethodStaticInterface(as_object& o);
-    as_object* getSpreadMethodInterface();
-
 }
 
-class SpreadMethod_as : public as_object
-{
-
-public:
-
-    SpreadMethod_as()
-        :
-        as_object(getSpreadMethodInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void spreadmethod_class_init(as_object& global)
+void
+spreadmethod_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&spreadmethod_ctor, 
getSpreadMethodInterface());
-        attachSpreadMethodStaticInterface(*cl);
-    }
-
-    // Register _global.SpreadMethod
-    global.init_member("SpreadMethod", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachSpreadMethodStaticInterface(*o);
+    global.init_member("SpreadMethod", o);
 }
 
 namespace {
 
 void
-attachSpreadMethodInterface(as_object& o)
-{
-}
-
-void
 attachSpreadMethodStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getSpreadMethodInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachSpreadMethodInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-spreadmethod_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new SpreadMethod_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/display/display.am'
--- a/libcore/asobj/flash/display/display.am    2009-05-28 06:31:22 +0000
+++ b/libcore/asobj/flash/display/display.am    2009-05-29 08:30:14 +0000
@@ -20,6 +20,9 @@
 DISPLAY_SOURCES = flash/display/display_pkg.cpp
 DISPLAY_HEADERS = flash/display/display_pkg.h
 
+DISPLAY_SOURCES_AS2 =
+DISPLAY_HEADERS_AS2 =
+
 if BUILD_AVM1MOVIE_AS3
 DISPLAY_SOURCES += flash/display/AVM1Movie_as.cpp
 DISPLAY_HEADERS += flash/display/AVM1Movie_as.h
@@ -36,8 +39,8 @@
 endif
 
 if BUILD_BITMAPDATA_AS3
-DISPLAY_SOURCES += flash/display/BitmapData_as.cpp
-DISPLAY_HEADERS += flash/display/BitmapData_as.h
+DISPLAY_SOURCES_AS2 += flash/display/BitmapData_as.cpp
+DISPLAY_HEADERS_AS2 += flash/display/BitmapData_as.h
 endif
 
 # if BUILD_BITMAP_AS3
@@ -186,8 +189,8 @@
 DISPLAY_HEADERS += flash/display/Stage_as.h
 # endif
 
-libgnashasobjs_la_SOURCES += $(DISPLAY_SOURCES)
-noinst_HEADERS +=  $(DISPLAY_HEADERS) displayclasses.h
+libgnashasobjs_la_SOURCES += $(DISPLAY_SOURCES) $(DISPLAY_SOURCES_AS2)
+noinst_HEADERS +=  $(DISPLAY_HEADERS) $(DISPLAY_HEADERS_AS2) displayclasses.h
 
 # Build a header file that contains a generated array of *_init()
 # functions for the classes that are configured for this build, as
@@ -200,8 +203,17 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_DISPLAY_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_DISPLAY_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
-       sources="`echo $(DISPLAY_SOURCES) | cut -d ' ' -f 2-`"; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
+       sources="`echo $(DISPLAY_SOURCES) $(DISPLAY_SOURCES_AS2) | cut -d ' ' 
-f 2-`"; \
+       for i in $${sources}; do \
+         item=`basename $$i | sed -e 's:\_as.cpp::'`; \
+         lowname="`echo $${item} | tr '[A-Z]' '[a-z]'`"; \
+         echo "        gnash::$${lowname}_class_init,"  >> $${header}; \
+       done; \
+       echo '  0' >> $${header}; \
+       echo '};' >> $${header}; \
+       echo "static gnash::SharedLib::initentry *as2classes[] = {" >> 
$${header}; \
+       sources="`echo $(DISPLAY_SOURCES_AS2) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \
          lowname="`echo $${item} | tr '[A-Z]' '[a-z]'`"; \

=== modified file 'libcore/asobj/flash/display/display_pkg.cpp'
--- a/libcore/asobj/flash/display/display_pkg.cpp       2009-05-28 06:31:22 
+0000
+++ b/libcore/asobj/flash/display/display_pkg.cpp       2009-05-29 08:12:11 
+0000
@@ -63,16 +63,28 @@
 namespace gnash {
 
 static as_value
-get_flash_display_package(const fn_call& /*fn*/)
+get_flash_display_package(const fn_call& fn)
 {
-       log_debug("Loading flash.display package");
-       as_object *pkg = new as_object(getObjectInterface());
+    bool as3 = isAS3(fn.getVM());
+       log_debug("Loading %s flash.display package", as3 ? "AVM2" : "AVM1");
+    
+    as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+
+    if (as3) {
+        while (as3classes[i]) {
+            as3classes[i](*pkg);
+            ++i;
+        }
+    }
+    else {
+        while (as2classes[i]) {
+            as2classes[i](*pkg);
+            ++i;
+        }
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/errors/errors.am'
--- a/libcore/asobj/flash/errors/errors.am      2009-05-28 06:11:24 +0000
+++ b/libcore/asobj/flash/errors/errors.am      2009-05-29 07:36:14 +0000
@@ -71,7 +71,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_ERRORS_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_ERRORS_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(ERRORS_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/errors/errors_pkg.cpp'
--- a/libcore/asobj/flash/errors/errors_pkg.cpp 2009-05-28 06:31:22 +0000
+++ b/libcore/asobj/flash/errors/errors_pkg.cpp 2009-05-29 08:12:11 +0000
@@ -38,16 +38,20 @@
 namespace gnash {
 
 static as_value
-get_flash_errors_package(const fn_call& /*fn*/)
+get_flash_errors_package(const fn_call& fn)
 {
-       log_debug("Loading flash.errors package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+       
+    log_debug("Loading AVM2 flash.errors package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+    while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/events/events.am'
--- a/libcore/asobj/flash/events/events.am      2009-05-28 06:31:22 +0000
+++ b/libcore/asobj/flash/events/events.am      2009-05-29 07:36:14 +0000
@@ -149,7 +149,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_EVENTS_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_EVENTS_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(EVENTS_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/events/events_pkg.cpp'
--- a/libcore/asobj/flash/events/events_pkg.cpp 2009-05-28 06:31:22 +0000
+++ b/libcore/asobj/flash/events/events_pkg.cpp 2009-05-29 08:12:11 +0000
@@ -54,16 +54,20 @@
 namespace gnash {
 
 static as_value
-get_flash_events_package(const fn_call& /*fn*/)
+get_flash_events_package(const fn_call& fn)
 {
-       log_debug("Loading flash.events package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.events package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+       while(as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+       } 
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/external/external.am'
--- a/libcore/asobj/flash/external/external.am  2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/external/external.am  2009-05-29 07:36:14 +0000
@@ -41,7 +41,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_EXTERNAL_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_EXTERNAL_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(EXTERNAL_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/external/external_pkg.cpp'
--- a/libcore/asobj/flash/external/external_pkg.cpp     2009-05-26 06:41:31 
+0000
+++ b/libcore/asobj/flash/external/external_pkg.cpp     2009-05-29 14:23:52 
+0000
@@ -32,29 +32,33 @@
 namespace gnash {
 
 static as_value
-get_flash_external_package(const fn_call& /*fn*/)
+get_flash_external_package(const fn_call& fn)
 {
-       log_debug("Loading flash.external package");
-       as_object *pkg = new as_object(getObjectInterface());
-
-       // Call the [objectname]_init() function for each class.
-       int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
-
-       return pkg;
+    const bool as3 = isAS3(fn.getVM());
+    // This package is identical for AS2 and AS3 (as far as we know)
+    log_debug("Loading %s flash.external package", as3 ? "AVM2" : "AVM1");
+    
+    as_object *pkg = new as_object(getObjectInterface());
+
+    // Call the [objectname]_init() function for each class.
+    int i = 0;
+    while (as3classes[i]) {
+        as3classes[i](*pkg);
+        ++i;
+    } 
+
+    return pkg;
 }
 
 void
 flash_external_package_init(as_object& where)
 {
-       string_table& st = where.getVM().getStringTable();
+    string_table& st = where.getVM().getStringTable();
 
     // TODO: this may not be correct, but it should be enumerable.
     const int flags = 0;
-       where.init_destructive_property(st.find("external"),
-                       get_flash_external_package, flags);
+    where.init_destructive_property(st.find("external"),
+            get_flash_external_package, flags);
 }
 
 

=== modified file 'libcore/asobj/flash/filters/filters.am'
--- a/libcore/asobj/flash/filters/filters.am    2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/filters/filters.am    2009-05-29 07:36:14 +0000
@@ -99,7 +99,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_FILTERS_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_FILTERS_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(FILTERS_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/filters/filters_pkg.cpp'
--- a/libcore/asobj/flash/filters/filters_pkg.cpp       2009-05-26 06:41:31 
+0000
+++ b/libcore/asobj/flash/filters/filters_pkg.cpp       2009-05-29 08:12:11 
+0000
@@ -45,14 +45,17 @@
 static as_value
 get_flash_filters_package(const fn_call& /*fn*/)
 {
+
+    // TODO: there are differences between AS2 and AS3 here.
+
        log_debug("Loading flash.filters package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
        do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+           as3classes[i](*pkg);
+       } while (as3classes[++i] != 0);
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/flash_pkg.cpp'
--- a/libcore/asobj/flash/flash_pkg.cpp 2009-05-26 06:41:31 +0000
+++ b/libcore/asobj/flash/flash_pkg.cpp 2009-05-29 07:25:38 +0000
@@ -30,16 +30,28 @@
 class as_object;
 
 static as_value
-get_flash_package(const fn_call& /*fn*/)
+get_flash_package(const fn_call& fn)
 {
-       log_debug("Loading flash.flash package");
-         as_object *pkg = new as_object(getObjectInterface());
+    bool as3 = isAS3(fn.getVM());
+       log_debug("Loading %s flash package", as3 ? "AVM2" : "AVM1");
+    
+    as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+
+    if (as3) {
+        while (as3classes[i]) {
+            as3classes[i](*pkg);
+            ++i;
+        }
+    }
+    else {
+        while (as2classes[i]) {
+            as2classes[i](*pkg);
+            ++i;
+        }
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/flashclasses.h'
--- a/libcore/asobj/flash/flashclasses.h        2009-05-28 06:31:22 +0000
+++ b/libcore/asobj/flash/flashclasses.h        2009-05-29 07:25:38 +0000
@@ -42,7 +42,17 @@
 
 namespace gnash {
 
-static gnash::SharedLib::initentry *asclasses[] = {
+static gnash::SharedLib::initentry* as2classes[] = {
+    flash_text_package_init,
+    flash_display_package_init,
+    flash_filters_package_init,
+    flash_geom_package_init,
+    flash_net_package_init,
+    flash_external_package_init,
+    0
+};
+
+static gnash::SharedLib::initentry* as3classes[] = {
     flash_text_package_init,
     flash_display_package_init,
     flash_filters_package_init,

=== modified file 'libcore/asobj/flash/geom/geom.am'
--- a/libcore/asobj/flash/geom/geom.am  2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/geom/geom.am  2009-05-29 07:36:14 +0000
@@ -59,7 +59,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_GEOM_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_GEOM_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(GEOM_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/geom/geom_pkg.cpp'
--- a/libcore/asobj/flash/geom/geom_pkg.cpp     2009-05-26 06:41:31 +0000
+++ b/libcore/asobj/flash/geom/geom_pkg.cpp     2009-05-29 08:12:11 +0000
@@ -36,16 +36,21 @@
 namespace gnash {
 
 static as_value
-get_flash_geom_package(const fn_call& /*fn*/)
+get_flash_geom_package(const fn_call& fn)
 {
-       log_debug("Loading flash.geom package");
+    const bool as3 = isAS3(fn.getVM());
+
+    // The classes in this package are all both AS2 and AS3 (as far as we
+    // know).
+       log_debug("Loading %s flash.geom package", as3 ? "AVM2" : "AVM1");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+       while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/media/media.am'
--- a/libcore/asobj/flash/media/media.am        2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/media/media.am        2009-05-29 07:36:14 +0000
@@ -82,7 +82,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_MEDIA_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_MEDIA_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(MEDIA_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/media/media_pkg.cpp'
--- a/libcore/asobj/flash/media/media_pkg.cpp   2009-05-25 02:00:57 +0000
+++ b/libcore/asobj/flash/media/media_pkg.cpp   2009-05-29 08:12:11 +0000
@@ -40,16 +40,20 @@
 namespace gnash {
 
 static as_value
-get_flash_media_package(const fn_call& /*fn*/)
+get_flash_media_package(const fn_call& fn)
 {
-       log_debug("Loading flash.media package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.media package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+       while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/net/SharedObjectFlushStatus_as.cpp'
--- a/libcore/asobj/flash/net/SharedObjectFlushStatus_as.cpp    2009-05-28 
17:12:46 +0000
+++ b/libcore/asobj/flash/net/SharedObjectFlushStatus_as.cpp    2009-05-29 
06:11:46 +0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.net.SharedObjectFlushStatus class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value sharedobjectflushstatus_ctor(const fn_call& fn);
-    void attachSharedObjectFlushStatusInterface(as_object& o);
     void attachSharedObjectFlushStatusStaticInterface(as_object& o);
-    as_object* getSharedObjectFlushStatusInterface();
-
 }
 
-class SharedObjectFlushStatus_as : public as_object
-{
-
-public:
-
-    SharedObjectFlushStatus_as()
-        :
-        as_object(getSharedObjectFlushStatusInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void sharedobjectflushstatus_class_init(as_object& global)
+void
+sharedobjectflushstatus_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&sharedobjectflushstatus_ctor, 
getSharedObjectFlushStatusInterface());
-        attachSharedObjectFlushStatusStaticInterface(*cl);
-    }
-
-    // Register _global.SharedObjectFlushStatus
-    global.init_member("SharedObjectFlushStatus", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachSharedObjectFlushStatusStaticInterface(*o);
+    global.init_member("SharedObjectFlushStatus", o);
 }
 
 namespace {
 
 void
-attachSharedObjectFlushStatusInterface(as_object& o)
-{
-}
-
-void
 attachSharedObjectFlushStatusStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getSharedObjectFlushStatusInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachSharedObjectFlushStatusInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-sharedobjectflushstatus_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new SharedObjectFlushStatus_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/net/URLLoaderDataFormat_as.cpp'
--- a/libcore/asobj/flash/net/URLLoaderDataFormat_as.cpp        2009-05-28 
17:12:46 +0000
+++ b/libcore/asobj/flash/net/URLLoaderDataFormat_as.cpp        2009-05-29 
06:11:46 +0000
@@ -1,4 +1,4 @@
-/ URLLoaderDataFormat_as.cpp:  ActionScript "URLLoaderDataFormat" class, for 
Gnash.
+// URLLoaderDataFormat_as.cpp:  ActionScript "URLLoaderDataFormat" class, for 
Gnash.
 //
 //   Copyright (C) 2009 Free Software Foundation, Inc.
 //
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.net.URLLoaderDataFormat class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value urlloaderdataformat_ctor(const fn_call& fn);
-    void attachURLLoaderDataFormatInterface(as_object& o);
     void attachURLLoaderDataFormatStaticInterface(as_object& o);
-    as_object* getURLLoaderDataFormatInterface();
-
 }
 
-class URLLoaderDataFormat_as : public as_object
-{
-
-public:
-
-    URLLoaderDataFormat_as()
-        :
-        as_object(getURLLoaderDataFormatInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void urlloaderdataformat_class_init(as_object& global)
+void
+urlloaderdataformat_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&urlloaderdataformat_ctor, 
getURLLoaderDataFormatInterface());
-        attachURLLoaderDataFormatStaticInterface(*cl);
-    }
-
-    // Register _global.URLLoaderDataFormat
-    global.init_member("URLLoaderDataFormat", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachURLLoaderDataFormatStaticInterface(*o);
+    global.init_member("URLLoaderDataFormat", o);
 }
 
 namespace {
 
 void
-attachURLLoaderDataFormatInterface(as_object& o)
-{
-}
-
-void
 attachURLLoaderDataFormatStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getURLLoaderDataFormatInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachURLLoaderDataFormatInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-urlloaderdataformat_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new URLLoaderDataFormat_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/net/URLRequestMethod_as.cpp'
--- a/libcore/asobj/flash/net/URLRequestMethod_as.cpp   2009-05-28 17:12:46 
+0000
+++ b/libcore/asobj/flash/net/URLRequestMethod_as.cpp   2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.net.URLRequestMethod class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value urlrequestmethod_ctor(const fn_call& fn);
-    void attachURLRequestMethodInterface(as_object& o);
     void attachURLRequestMethodStaticInterface(as_object& o);
-    as_object* getURLRequestMethodInterface();
-
 }
 
-class URLRequestMethod_as : public as_object
-{
-
-public:
-
-    URLRequestMethod_as()
-        :
-        as_object(getURLRequestMethodInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void urlrequestmethod_class_init(as_object& global)
+void
+urlrequestmethod_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&urlrequestmethod_ctor, 
getURLRequestMethodInterface());
-        attachURLRequestMethodStaticInterface(*cl);
-    }
-
-    // Register _global.URLRequestMethod
-    global.init_member("URLRequestMethod", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachURLRequestMethodStaticInterface(*o);
+    global.init_member("URLRequestMethod", o);
 }
 
 namespace {
 
 void
-attachURLRequestMethodInterface(as_object& o)
-{
-}
-
-void
 attachURLRequestMethodStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getURLRequestMethodInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachURLRequestMethodInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-urlrequestmethod_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new URLRequestMethod_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/net/net.am'
--- a/libcore/asobj/flash/net/net.am    2009-05-28 06:17:24 +0000
+++ b/libcore/asobj/flash/net/net.am    2009-05-29 08:30:14 +0000
@@ -20,19 +20,22 @@
 NET_SOURCES = flash/net/net_pkg.cpp
 NET_HEADERS = flash/net/net_pkg.h
 
+NET_SOURCES_AS2 = 
+NET_HEADERS_AS2 = 
+
 if BUILD_FILEFILTER_AS3
 NET_SOURCES += flash/net/FileFilter_as.cpp
 NET_HEADERS += flash/net/FileFilter_as.h
 endif
 
 if BUILD_FILEREFERENCELIST_AS3
-NET_SOURCES += flash/net/FileReferenceList_as.cpp
-NET_HEADERS += flash/net/FileReferenceList_as.h
+NET_SOURCES_AS2 += flash/net/FileReferenceList_as.cpp
+NET_HEADERS_AS2 += flash/net/FileReferenceList_as.h
 endif
 
 if BUILD_FILEREFERENCE_AS3
-NET_SOURCES += flash/net/FileReference_as.cpp
-NET_HEADERS += flash/net/FileReference_as.h
+NET_SOURCES_AS2 += flash/net/FileReference_as.cpp
+NET_HEADERS_AS2 += flash/net/FileReference_as.h
 endif
 
 if BUILD_IDYNAMICPROPERTYOUTPUT_AS3
@@ -127,8 +130,8 @@
 NET_HEADERS += flash/net/XMLSocket_as.h
 endif
 
-libgnashasobjs_la_SOURCES  += $(NET_SOURCES)
-noinst_HEADERS +=  $(NET_HEADERS) netclasses.h
+libgnashasobjs_la_SOURCES  += $(NET_SOURCES) $(NET_SOURCES_AS2)
+noinst_HEADERS +=  $(NET_HEADERS) $(NET_HEADERS_AS2) netclasses.h
 
 # Build a header file that contains a generated array of *_init()
 # functions for the classes that are configured for this build, as
@@ -141,8 +144,17 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_NET_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_NET_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
-       sources="`echo $(NET_SOURCES) | cut -d ' ' -f 2-`"; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
+       sources="`echo $(NET_SOURCES) $(NET_SOURCES_AS2) | cut -d ' ' -f 2-`"; \
+       for i in $${sources}; do \
+         item=`basename $$i | sed -e 's:\_as.cpp::'`; \
+         lowname="`echo $${item} | tr '[A-Z]' '[a-z]'`"; \
+         echo "        gnash::$${lowname}_class_init,"  >> $${header}; \
+       done; \
+       echo '  0' >> $${header}; \
+       echo '};' >> $${header}; \
+       echo "static gnash::SharedLib::initentry *as2classes[] = {" >> 
$${header}; \
+       sources="`echo $(NET_SOURCES_AS2) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \
          lowname="`echo $${item} | tr '[A-Z]' '[a-z]'`"; \

=== modified file 'libcore/asobj/flash/net/net_pkg.cpp'
--- a/libcore/asobj/flash/net/net_pkg.cpp       2009-05-28 06:31:22 +0000
+++ b/libcore/asobj/flash/net/net_pkg.cpp       2009-05-29 08:30:14 +0000
@@ -51,16 +51,28 @@
 namespace gnash {
 
 static as_value
-get_flash_net_package(const fn_call& /*fn*/)
+get_flash_net_package(const fn_call& fn)
 {
-       log_debug("Loading flash.net package");
-       as_object *pkg = new as_object(getObjectInterface());
+    bool as3 = isAS3(fn.getVM());
+       log_debug("Loading %s flash.display package", as3 ? "AVM2" : "AVM1");
+    
+    as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+
+    if (as3) {
+        while (as3classes[i]) {
+            as3classes[i](*pkg);
+            ++i;
+        }
+    }
+    else {
+        while (as2classes[i]) {
+            as2classes[i](*pkg);
+            ++i;
+        }
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/printing/PrintJobOrientation_as.cpp'
--- a/libcore/asobj/flash/printing/PrintJobOrientation_as.cpp   2009-05-28 
17:12:25 +0000
+++ b/libcore/asobj/flash/printing/PrintJobOrientation_as.cpp   2009-05-29 
06:11:46 +0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.printing.PrintJobOrientation class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value printjoborientation_ctor(const fn_call& fn);
-    void attachPrintJobOrientationInterface(as_object& o);
     void attachPrintJobOrientationStaticInterface(as_object& o);
-    as_object* getPrintJobOrientationInterface();
-
 }
 
-class PrintJobOrientation_as : public as_object
-{
-
-public:
-
-    PrintJobOrientation_as()
-        :
-        as_object(getPrintJobOrientationInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void printjoborientation_class_init(as_object& global)
+void
+printjoborientation_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&printjoborientation_ctor, 
getPrintJobOrientationInterface());
-        attachPrintJobOrientationStaticInterface(*cl);
-    }
-
-    // Register _global.PrintJobOrientation
-    global.init_member("PrintJobOrientation", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachPrintJobOrientationStaticInterface(*o);
+    global.init_member("PrintJobOrientation", o);
 }
 
 namespace {
 
 void
-attachPrintJobOrientationInterface(as_object& o)
-{
-}
-
-void
 attachPrintJobOrientationStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getPrintJobOrientationInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachPrintJobOrientationInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-printjoborientation_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new PrintJobOrientation_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/printing/printing.am'
--- a/libcore/asobj/flash/printing/printing.am  2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/printing/printing.am  2009-05-29 07:36:14 +0000
@@ -49,7 +49,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_PRINTING_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_PRINTING_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(PRINTING_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/printing/printing_pkg.cpp'
--- a/libcore/asobj/flash/printing/printing_pkg.cpp     2009-05-25 02:00:57 
+0000
+++ b/libcore/asobj/flash/printing/printing_pkg.cpp     2009-05-29 14:13:41 
+0000
@@ -33,25 +33,31 @@
 namespace gnash {
 
 static as_value
-get_flash_printing_package(const fn_call& /*fn*/)
+get_flash_printing_package(const fn_call& fn)
 {
-       log_debug("Loading flash.printing package");
-       as_object *pkg = new as_object(getObjectInterface());
-
-       // Call the [objectname]_init() function for each class.
-       int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
-
-       return pkg;
+
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+    log_debug("Loading AVM2 flash.printing package");
+    as_object *pkg = new as_object(getObjectInterface());
+
+    // Call the [objectname]_init() function for each class.
+    int i = 0;
+    while (as3classes[i]) {
+        as3classes[i](*pkg);
+        ++i;
+    }
+
+    return pkg;
 }
 
 void
 flash_printing_package_init(as_object& where)
 {
-       string_table& st = where.getVM().getStringTable();
-       where.init_destructive_property(st.find("printing"), 
get_flash_printing_package);
+    string_table& st = where.getVM().getStringTable();
+    where.init_destructive_property(st.find("printing"),
+            get_flash_printing_package);
 }
 
 

=== modified file 'libcore/asobj/flash/sampler/sampler.am'
--- a/libcore/asobj/flash/sampler/sampler.am    2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/sampler/sampler.am    2009-05-29 07:36:14 +0000
@@ -54,7 +54,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_SAMPLAR_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_SAMPLAR_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(SAMPLAR_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/sampler/sampler_pkg.cpp'
--- a/libcore/asobj/flash/sampler/sampler_pkg.cpp       2009-05-26 07:22:26 
+0000
+++ b/libcore/asobj/flash/sampler/sampler_pkg.cpp       2009-05-29 14:13:41 
+0000
@@ -34,15 +34,19 @@
 namespace gnash {
 
 static as_value
-get_flash_sampler_package(const fn_call& /*fn*/)
+get_flash_sampler_package(const fn_call& fn)
 {
-       log_debug("Loading flash.sampler package");
+
+    /// This package is AS2 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.sampler package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       while (asclasses[++i] != 0) {
-           asclasses[i](*pkg);
+       while (as3classes[++i] != 0) {
+           as3classes[i](*pkg);
     }
 
        return pkg;

=== modified file 'libcore/asobj/flash/system/IMEConversionMode_as.cpp'
--- a/libcore/asobj/flash/system/IMEConversionMode_as.cpp       2009-05-28 
17:11:56 +0000
+++ b/libcore/asobj/flash/system/IMEConversionMode_as.cpp       2009-05-29 
06:11:46 +0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.system.IMEConversionMode class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value imeconversionmode_ctor(const fn_call& fn);
-    void attachIMEConversionModeInterface(as_object& o);
     void attachIMEConversionModeStaticInterface(as_object& o);
-    as_object* getIMEConversionModeInterface();
-
 }
 
-class IMEConversionMode_as : public as_object
-{
-
-public:
-
-    IMEConversionMode_as()
-        :
-        as_object(getIMEConversionModeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void imeconversionmode_class_init(as_object& global)
+void
+imeconversionmode_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&imeconversionmode_ctor, 
getIMEConversionModeInterface());
-        attachIMEConversionModeStaticInterface(*cl);
-    }
-
-    // Register _global.IMEConversionMode
-    global.init_member("IMEConversionMode", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachIMEConversionModeStaticInterface(*o);
+    global.init_member("IMEConversionMode", o);
 }
 
 namespace {
 
 void
-attachIMEConversionModeInterface(as_object& o)
-{
-}
-
-void
 attachIMEConversionModeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getIMEConversionModeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachIMEConversionModeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-imeconversionmode_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new IMEConversionMode_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/system/system.am'
--- a/libcore/asobj/flash/system/system.am      2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/system/system.am      2009-05-29 07:36:14 +0000
@@ -80,7 +80,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_SYSTEM_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_SYSTEM_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(SYSTEM_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/system/system_pkg.cpp'
--- a/libcore/asobj/flash/system/system_pkg.cpp 2009-05-28 07:00:14 +0000
+++ b/libcore/asobj/flash/system/system_pkg.cpp 2009-05-29 14:13:41 +0000
@@ -39,15 +39,19 @@
 namespace gnash {
 
 static as_value
-get_flash_system_package(const fn_call& /*fn*/)
+get_flash_system_package(const fn_call& fn)
 {
-       log_debug("Loading flash.system package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.system package");
        as_object *pkg = new as_object(getObjectInterface());
         
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       while (asclasses[++i] != 0) {
-           asclasses[i](*pkg);
+       while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
     }
         
        return pkg;

=== modified file 'libcore/asobj/flash/text/AntiAliasType_as.cpp'
--- a/libcore/asobj/flash/text/AntiAliasType_as.cpp     2009-05-28 17:11:27 
+0000
+++ b/libcore/asobj/flash/text/AntiAliasType_as.cpp     2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.text.AntiAliasType class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value antialiastype_ctor(const fn_call& fn);
-    void attachAntiAliasTypeInterface(as_object& o);
     void attachAntiAliasTypeStaticInterface(as_object& o);
-    as_object* getAntiAliasTypeInterface();
-
 }
 
-class AntiAliasType_as : public as_object
-{
-
-public:
-
-    AntiAliasType_as()
-        :
-        as_object(getAntiAliasTypeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void antialiastype_class_init(as_object& global)
+void
+antialiastype_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&antialiastype_ctor, 
getAntiAliasTypeInterface());
-        attachAntiAliasTypeStaticInterface(*cl);
-    }
-
-    // Register _global.AntiAliasType
-    global.init_member("AntiAliasType", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachAntiAliasTypeStaticInterface(*o);
+    global.init_member("AntiAliasType", o);
 }
 
 namespace {
 
 void
-attachAntiAliasTypeInterface(as_object& o)
-{
-}
-
-void
 attachAntiAliasTypeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getAntiAliasTypeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachAntiAliasTypeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-antialiastype_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new AntiAliasType_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/text/GridFitType_as.cpp'
--- a/libcore/asobj/flash/text/GridFitType_as.cpp       2009-05-28 17:11:27 
+0000
+++ b/libcore/asobj/flash/text/GridFitType_as.cpp       2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.text.GridFitType class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value gridfittype_ctor(const fn_call& fn);
-    void attachGridFitTypeInterface(as_object& o);
     void attachGridFitTypeStaticInterface(as_object& o);
-    as_object* getGridFitTypeInterface();
-
 }
 
-class GridFitType_as : public as_object
-{
-
-public:
-
-    GridFitType_as()
-        :
-        as_object(getGridFitTypeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void gridfittype_class_init(as_object& global)
+void
+gridfittype_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&gridfittype_ctor, 
getGridFitTypeInterface());
-        attachGridFitTypeStaticInterface(*cl);
-    }
-
-    // Register _global.GridFitType
-    global.init_member("GridFitType", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachGridFitTypeStaticInterface(*o);
+    global.init_member("GridFitType", o);
 }
 
 namespace {
 
 void
-attachGridFitTypeInterface(as_object& o)
-{
-}
-
-void
 attachGridFitTypeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getGridFitTypeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachGridFitTypeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-gridfittype_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new GridFitType_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/text/TextColorType_as.cpp'
--- a/libcore/asobj/flash/text/TextColorType_as.cpp     2009-05-28 17:11:27 
+0000
+++ b/libcore/asobj/flash/text/TextColorType_as.cpp     2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.text.TextColorType class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value textcolortype_ctor(const fn_call& fn);
-    void attachTextColorTypeInterface(as_object& o);
     void attachTextColorTypeStaticInterface(as_object& o);
-    as_object* getTextColorTypeInterface();
-
 }
 
-class TextColorType_as : public as_object
-{
-
-public:
-
-    TextColorType_as()
-        :
-        as_object(getTextColorTypeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void textcolortype_class_init(as_object& global)
+void
+textcolortype_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&textcolortype_ctor, 
getTextColorTypeInterface());
-        attachTextColorTypeStaticInterface(*cl);
-    }
-
-    // Register _global.TextColorType
-    global.init_member("TextColorType", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachTextColorTypeStaticInterface(*o);
+    global.init_member("TextColorType", o);
 }
 
 namespace {
 
 void
-attachTextColorTypeInterface(as_object& o)
-{
-}
-
-void
 attachTextColorTypeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getTextColorTypeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachTextColorTypeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-textcolortype_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new TextColorType_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/text/TextDisplayMode_as.cpp'
--- a/libcore/asobj/flash/text/TextDisplayMode_as.cpp   2009-05-28 17:11:27 
+0000
+++ b/libcore/asobj/flash/text/TextDisplayMode_as.cpp   2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.text.TextDisplayMode class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value textdisplaymode_ctor(const fn_call& fn);
-    void attachTextDisplayModeInterface(as_object& o);
     void attachTextDisplayModeStaticInterface(as_object& o);
-    as_object* getTextDisplayModeInterface();
-
 }
 
-class TextDisplayMode_as : public as_object
-{
-
-public:
-
-    TextDisplayMode_as()
-        :
-        as_object(getTextDisplayModeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void textdisplaymode_class_init(as_object& global)
+void
+textdisplaymode_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&textdisplaymode_ctor, 
getTextDisplayModeInterface());
-        attachTextDisplayModeStaticInterface(*cl);
-    }
-
-    // Register _global.TextDisplayMode
-    global.init_member("TextDisplayMode", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachTextDisplayModeStaticInterface(*o);
+    global.init_member("TextDisplayMode", o);
 }
 
 namespace {
 
 void
-attachTextDisplayModeInterface(as_object& o)
-{
-}
-
-void
 attachTextDisplayModeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getTextDisplayModeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachTextDisplayModeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-textdisplaymode_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new TextDisplayMode_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/text/text.am'
--- a/libcore/asobj/flash/text/text.am  2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/text/text.am  2009-05-29 14:13:41 +0000
@@ -20,6 +20,9 @@
 TEXT_SOURCES = flash/text/text_pkg.cpp
 TEXT_HEADERS = flash/text/text_pkg.h
 
+TEXT_SOURCES_AS2 = 
+TEXT_HEADERS_AS2 = 
+
 if BUILD_ANTIALIASTYPE_AS3
 TEXT_SOURCES += flash/text/AntiAliasType_as.cpp
 TEXT_HEADERS += flash/text/AntiAliasType_as.h
@@ -103,8 +106,8 @@
 endif
 
 if BUILD_TEXTRENDERER_AS3
-TEXT_SOURCES += flash/text/TextRenderer_as.cpp
-TEXT_HEADERS += flash/text/TextRenderer_as.h
+TEXT_SOURCES_AS2 += flash/text/TextRenderer_as.cpp
+TEXT_HEADERS_AS2 += flash/text/TextRenderer_as.h
 endif
 
 # FIXME: already exists
@@ -113,8 +116,8 @@
 TEXT_HEADERS += flash/text/TextSnapshot_as.h
 endif
 
-libgnashasobjs_la_SOURCES += $(TEXT_SOURCES)
-noinst_HEADERS +=  $(TEXT_HEADERS) textclasses.h
+libgnashasobjs_la_SOURCES += $(TEXT_SOURCES) $(TEXT_SOURCES_AS2)
+noinst_HEADERS +=  $(TEXT_HEADERS) $(TEXT_HEADERS_AS2) textclasses.h
 
 # Build a header file that contains a generated array of *_init()
 # functions for the classes that are configured for this build, as
@@ -127,8 +130,17 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_TEXT_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_TEXT_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
-       sources="`echo $(TEXT_SOURCES) | cut -d ' ' -f 2-`"; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
+       sources="`echo $(TEXT_SOURCES) $(TEXT_SOURCES_AS2) | cut -d ' ' -f 
2-`"; \
+       for i in $${sources}; do \
+         item=`basename $$i | sed -e 's:\_as.cpp::'`; \
+         lowname="`echo $${item} | tr '[A-Z]' '[a-z]'`"; \
+         echo "        gnash::$${lowname}_class_init,"  >> $${header}; \
+       done; \
+       echo '  0' >> $${header}; \
+       echo '};' >> $${header}; \
+       echo "static gnash::SharedLib::initentry *as2classes[] = {" >> 
$${header}; \
+       sources="`echo $(TEXT_SOURCES_AS2) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \
          lowname="`echo $${item} | tr '[A-Z]' '[a-z]'`"; \

=== modified file 'libcore/asobj/flash/text/text_pkg.cpp'
--- a/libcore/asobj/flash/text/text_pkg.cpp     2009-05-26 06:41:31 +0000
+++ b/libcore/asobj/flash/text/text_pkg.cpp     2009-05-29 14:13:41 +0000
@@ -48,16 +48,28 @@
 namespace gnash {
 
 static as_value
-get_flash_text_package(const fn_call& /*fn*/)
+get_flash_text_package(const fn_call& fn)
 {
-       log_debug("Loading flash.text package");
-       as_object *pkg = new as_object(getObjectInterface());
+    bool as3 = isAS3(fn.getVM());
+       log_debug("Loading %s flash.text package", as3 ? "AVM2" : "AVM1");
+    
+    as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+
+    if (as3) {
+        while (as3classes[i]) {
+            as3classes[i](*pkg);
+            ++i;
+        }
+    }
+    else {
+        while (as2classes[i]) {
+            as2classes[i](*pkg);
+            ++i;
+        }
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/ui/ui.am'
--- a/libcore/asobj/flash/ui/ui.am      2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/ui/ui.am      2009-05-29 07:36:14 +0000
@@ -65,7 +65,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_UI_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_UI_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(UI_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/ui/ui_pkg.cpp'
--- a/libcore/asobj/flash/ui/ui_pkg.cpp 2009-05-25 02:00:57 +0000
+++ b/libcore/asobj/flash/ui/ui_pkg.cpp 2009-05-29 14:13:41 +0000
@@ -36,16 +36,20 @@
 namespace gnash {
 
 static as_value
-get_flash_ui_package(const fn_call& /*fn*/)
+get_flash_ui_package(const fn_call& fn)
 {
-       log_debug("Loading flash.ui package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.ui package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+       while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+       } 
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/utils/utils.am'
--- a/libcore/asobj/flash/utils/utils.am        2009-05-28 06:20:02 +0000
+++ b/libcore/asobj/flash/utils/utils.am        2009-05-29 07:36:14 +0000
@@ -74,7 +74,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_UTILS_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_UTILS_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(UTILS_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/utils/utils_pkg.cpp'
--- a/libcore/asobj/flash/utils/utils_pkg.cpp   2009-05-28 06:31:22 +0000
+++ b/libcore/asobj/flash/utils/utils_pkg.cpp   2009-05-29 14:13:41 +0000
@@ -39,16 +39,20 @@
 namespace gnash {
 
 static as_value
-get_flash_utils_package(const fn_call& /*fn*/)
+get_flash_utils_package(const fn_call& fn)
 {
-       log_debug("Loading flash.utils package");
+    // This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.utils package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+       while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+    }
 
        return pkg;
 }

=== modified file 'libcore/asobj/flash/xml/XMLNodeType_as.cpp'
--- a/libcore/asobj/flash/xml/XMLNodeType_as.cpp        2009-05-28 17:11:03 
+0000
+++ b/libcore/asobj/flash/xml/XMLNodeType_as.cpp        2009-05-29 06:11:46 
+0000
@@ -25,75 +25,34 @@
 #include "log.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "GnashException.h" // for ActionException
+#include "builtin_function.h" 
+#include "Object.h" 
+
+/// The flash.xml.XMLNodeType class is AS3 only. It enumerates
+/// constants for use in other classes.
 
 namespace gnash {
 
 // Forward declarations
 namespace {
-    as_value xmlnodetype_ctor(const fn_call& fn);
-    void attachXMLNodeTypeInterface(as_object& o);
     void attachXMLNodeTypeStaticInterface(as_object& o);
-    as_object* getXMLNodeTypeInterface();
-
 }
 
-class XMLNodeType_as : public as_object
-{
-
-public:
-
-    XMLNodeType_as()
-        :
-        as_object(getXMLNodeTypeInterface())
-    {}
-};
-
 // extern (used by Global.cpp)
-void xmlnodetype_class_init(as_object& global)
+void
+xmlnodetype_class_init(as_object& global)
 {
-    static boost::intrusive_ptr<builtin_function> cl;
-
-    if (!cl) {
-        cl = new builtin_function(&xmlnodetype_ctor, 
getXMLNodeTypeInterface());
-        attachXMLNodeTypeStaticInterface(*cl);
-    }
-
-    // Register _global.XMLNodeType
-    global.init_member("XMLNodeType", cl.get());
+    static as_object* o = new as_object(getObjectInterface());
+    attachXMLNodeTypeStaticInterface(*o);
+    global.init_member("XMLNodeType", o);
 }
 
 namespace {
 
 void
-attachXMLNodeTypeInterface(as_object& o)
-{
-}
-
-void
 attachXMLNodeTypeStaticInterface(as_object& o)
 {
-
-}
-
-as_object*
-getXMLNodeTypeInterface()
-{
-    static boost::intrusive_ptr<as_object> o;
-    if ( ! o ) {
-        o = new as_object();
-        attachXMLNodeTypeInterface(*o);
-    }
-    return o.get();
-}
-
-as_value
-xmlnodetype_ctor(const fn_call& fn)
-{
-    boost::intrusive_ptr<as_object> obj = new XMLNodeType_as;
-
-    return as_value(obj.get()); // will keep alive
+    // TODO: add constants here.
 }
 
 } // anonymous namespace 

=== modified file 'libcore/asobj/flash/xml/xml.am'
--- a/libcore/asobj/flash/xml/xml.am    2009-05-27 18:53:04 +0000
+++ b/libcore/asobj/flash/xml/xml.am    2009-05-29 07:36:14 +0000
@@ -49,7 +49,7 @@
        echo "#ifndef GNASH_ASOBJ_FLASH_XML_H" >> $${header}; \
        echo "#define GNASH_ASOBJ_FLASH_XML_H 1" >> $${header}; \
        echo "#include \"sharedlib.h\"" >> $${header}; \
-       echo "static gnash::SharedLib::initentry *asclasses[] = {" >> 
$${header}; \
+       echo "static gnash::SharedLib::initentry *as3classes[] = {" >> 
$${header}; \
        sources="`echo $(XML_SOURCES) | cut -d ' ' -f 2-`"; \
        for i in $${sources}; do \
          item=`basename $$i | sed -e 's:\_as.cpp::'`; \

=== modified file 'libcore/asobj/flash/xml/xml_pkg.cpp'
--- a/libcore/asobj/flash/xml/xml_pkg.cpp       2009-05-25 02:00:57 +0000
+++ b/libcore/asobj/flash/xml/xml_pkg.cpp       2009-05-29 14:13:41 +0000
@@ -34,16 +34,21 @@
 namespace gnash {
 
 static as_value
-get_flash_xml_package(const fn_call& /*fn*/)
+get_flash_xml_package(const fn_call& fn)
 {
-       log_debug("Loading flash.xml package");
+
+    /// This package is AS3 only!
+    assert(isAS3(fn.getVM()));
+
+       log_debug("Loading AVM2 flash.xml package");
        as_object *pkg = new as_object(getObjectInterface());
 
        // Call the [objectname]_init() function for each class.
        int i = 0;
-       do {
-           asclasses[i](*pkg);
-       } while (asclasses[++i] != 0);
+       while (as3classes[i]) {
+           as3classes[i](*pkg);
+        ++i;
+       } 
 
        return pkg;
 }

=== removed file 'libcore/swf/DoABCTag.cpp'
=== modified file 'libcore/swf/DoABCTag.h'
--- a/libcore/swf/DoABCTag.h    2009-05-27 10:28:19 +0000
+++ b/libcore/swf/DoABCTag.h    2009-05-29 14:23:57 +0000
@@ -25,6 +25,7 @@
 #include "SWFStream.h" // for inlines
 #include "abc_block.h"
 #include "Machine.h"
+#include "VM.h"
 
 // Forward declarations
 namespace gnash {
@@ -36,7 +37,7 @@
 
 /// SWF Tag DoABC (72)
 //
-///
+/// Execute an ABC tag. This is AVM2 bytecode.
 class DoABCTag : public ControlTag
 {
 public:
@@ -44,7 +45,8 @@
     virtual void execute(MovieClip* m, DisplayList& /* dlist */) const
        {
                VM& vm = m->getVM();
-               log_debug("getting machine.");
+        
+        log_debug("getting machine.");
                Machine *mach = vm.getMachine();
                as_object* global = vm.getGlobal();
                

=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp    2009-05-27 14:13:57 +0000
+++ b/libcore/vm/Machine.cpp    2009-05-29 14:23:57 +0000
@@ -242,10 +242,37 @@
        break;                                                                  
                                                                \
 }                                                                              
                                  /* end of JUMPIF */
 
+namespace {
+
+/// Switch the execution context to AVM2, and make sure it's
+/// switched back again even when there's an exception.
+class AVM2Switcher
+{
+public:
+    AVM2Switcher(VM& vm)
+        :
+        _vm(vm)
+    {
+        _vm.setAVMVersion(VM::AVM2);
+    }
+
+    ~AVM2Switcher()
+    {
+        _vm.setAVMVersion(VM::AVM1);
+    }
+private:
+    VM& _vm;
+};
+
+}
+
 void
 Machine::execute()
 {
 
+    // This automatically switches back again when we leave this scope.
+    AVM2Switcher avm2(_vm);
+
        for (;;) {
                std::size_t opStart = mStream->tellg();
         
@@ -2066,7 +2093,7 @@
                     asName a = pool_name(mStream->read_V32(), mPoolObject);
 
                     as_value value = mStack.top(0);
-                    log_unimpl("ABC_ACTION_COERCE");
+                    LOG_ONCE(log_unimpl("ABC_ACTION_COERCE"));
                     log_abc("COERCE: object for conversion is %s, "
                             "desired type %s", value,
                             mST.value(a.getGlobalName()));

=== modified file 'libcore/vm/VM.cpp'
--- a/libcore/vm/VM.cpp 2009-05-18 13:41:45 +0000
+++ b/libcore/vm/VM.cpp 2009-05-29 06:50:02 +0000
@@ -100,7 +100,8 @@
 #endif
        _clock(clock),
        _stack(),
-    _shLib(new SharedObjectLibrary(*this))
+    _shLib(new SharedObjectLibrary(*this)),
+    _avmVersion(AVM1)
 {
        _clock.restart();
 }

=== modified file 'libcore/vm/VM.h'
--- a/libcore/vm/VM.h   2009-05-18 13:41:45 +0000
+++ b/libcore/vm/VM.h   2009-05-29 06:50:02 +0000
@@ -84,34 +84,20 @@
 /// For the moment, it will be a singleton, providing one-time
 /// initialization.
 ///
-class DSOEXPORT VM : boost::noncopyable {
+class DSOEXPORT VM : boost::noncopyable
+{
 
 public:
 
        typedef as_value (*as_c_function_ptr)(const fn_call& fn);
 
-       SafeStack<as_value>& getStack()
-       {
-               return _stack;
-       }
-
-       CallStack& getCallStack()
-       {
-               return _callStack;
-       }
-
-    /// Get the VM clock
-    //
-    /// NOTE: this clock should drive all internal operations
-    /// but maybe accessing it trough VM isn't the best idea.
-    /// TODO: consider making this accessible trough RunInfo
-    /// instead.
-    ///
-    VirtualClock& getClock() {
-        return _clock;
-    }
-
-       /// \brief
+    enum AVMVersion
+    {
+        AVM1,
+        AVM2
+    };
+       
+    /// \brief
        /// Initialize the virtual machine singleton with the given
        /// movie definition and return a reference to it.
        //
@@ -130,6 +116,25 @@
        ///
        static VM& init(int version, movie_root& root, VirtualClock& clock);
 
+       SafeStack<as_value>& getStack() {
+               return _stack;
+       }
+
+       CallStack& getCallStack() {
+               return _callStack;
+       }
+
+    /// Get the VM clock
+    //
+    /// NOTE: this clock should drive all internal operations
+    /// but maybe accessing it trough VM isn't the best idea.
+    /// TODO: consider making this accessible trough RunInfo
+    /// instead.
+    ///
+    VirtualClock& getClock() {
+        return _clock;
+    }
+
        /// Return true if the singleton VM has been initialized
        static bool isInitialized();
 
@@ -162,6 +167,15 @@
        /// Set SWF version of the currently executing code
        void setSWFVersion(int v);
 
+    AVMVersion getAVMVersion() const {
+        return _avmVersion;
+    }
+
+    /// Set the version of the currently executing VM.
+    void setAVMVersion(AVMVersion v) {
+        _avmVersion = v;
+    }
+
        /// Get the number of milliseconds since VM was started
        unsigned long int getTime() const;
 
@@ -329,8 +343,25 @@
        /// Library of SharedObjects. Owned by the VM.
     std::auto_ptr<SharedObjectLibrary> _shLib;
 
+    /// The currently executing machine
+    //
+    /// This is a hack like switching the SWF version, but without this
+    /// there is no way for AS functions to know which version of the
+    /// virtual machine called them. This is necessary e.g. for initializing
+    /// the correct object prototypes etc.
+    AVMVersion _avmVersion;
+
 };
 
+/// Check whether the currently executing code is AS3 (ABC)
+//
+/// This is a non-member, non-friend function for better encapsulation.
+/// TODO: drop these when there is a better design!
+inline bool
+isAS3(const VM& vm) {
+    return vm.getAVMVersion() == VM::AVM2;
+}
+
 } // namespace gnash
 
 #endif // GNASH_VM_H

=== modified file 'libmedia/gst/GstUtil.cpp'
--- a/libmedia/gst/GstUtil.cpp  2009-02-25 22:33:03 +0000
+++ b/libmedia/gst/GstUtil.cpp  2009-05-29 12:30:46 +0000
@@ -100,7 +100,7 @@
 bool
 GstUtil::check_missing_plugins(GstCaps* caps)
 {
-    GstElementFactory * factory = swfdec_gst_get_element_factory (caps);
+    GstElementFactory * factory = swfdec_gst_get_element_factory(caps);
 
     if (factory) {
         gst_object_unref(factory);
@@ -116,7 +116,7 @@
                     " Will try anyway, but expect failure."));
     }
 
-    char* detail = gst_missing_decoder_installer_detail_new (caps);
+    char* detail = gst_missing_decoder_installer_detail_new(caps);
     if (!detail) {
         log_error(_("Missing plugin, but failed to convert it to gst"
                     " missing plugin detail."));
@@ -138,7 +138,8 @@
         return true;
     }
 #else
-    log_error(_("Missing plugin, but plugin installation not available."));
+    log_error(_("Missing plugin, but automatic plugin installation not "
+                "available."));
 #endif
 
     return false;

=== modified file 'libmedia/gst/MediaHandlerGst.cpp'
--- a/libmedia/gst/MediaHandlerGst.cpp  2009-02-25 02:00:44 +0000
+++ b/libmedia/gst/MediaHandlerGst.cpp  2009-05-29 12:30:46 +0000
@@ -42,7 +42,7 @@
 std::auto_ptr<MediaParser>
 MediaHandlerGst::createMediaParser(std::auto_ptr<IOChannel> stream)
 {
-       std::auto_ptr<MediaParser> parser;
+    std::auto_ptr<MediaParser> parser;
 
     try
     {
@@ -52,8 +52,8 @@
         }
         else
         {
-                       parser.reset(new MediaParserGst(stream));
-               }
+            parser.reset(new MediaParserGst(stream));
+        }
     }
     catch (GnashException& ex)
     {
@@ -62,53 +62,55 @@
         assert(!parser.get());
     }
 
-       return parser;
+    return parser;
 }
 
 std::auto_ptr<VideoDecoder>
 MediaHandlerGst::createVideoDecoder(const VideoInfo& info)
 {
-       if ( info.type != FLASH )
-       {
-               ExtraInfoGst* extrainfo = 
dynamic_cast<ExtraInfoGst*>(info.extra.get());
-               if (!extrainfo) {
-                       log_error(_("Wrong arguments given to GST 
VideoDecoder"));
-                       return std::auto_ptr<VideoDecoder>(0);
-               }
-               return std::auto_ptr<VideoDecoder>(new 
VideoDecoderGst(extrainfo->caps));
-       }
-       videoCodecType format = static_cast<videoCodecType>(info.codec);
-       int width = info.width;
-       int height = info.height;
-
-       boost::uint8_t* extradata = 0;
-       size_t datasize = 0;
-
-       ExtraVideoInfoFlv* extrainfo = 
dynamic_cast<ExtraVideoInfoFlv*>(info.extra.get());
-       if (extrainfo) {
-               extradata = extrainfo->data.get();
+    if (info.type != FLASH) {
+
+        ExtraInfoGst* extrainfo = 
dynamic_cast<ExtraInfoGst*>(info.extra.get());
+
+       if (!extrainfo) {
+            log_error(_("Wrong arguments given to GST VideoDecoder"));
+            return std::auto_ptr<VideoDecoder>();
+        }
+        return std::auto_ptr<VideoDecoder>(
+                       new VideoDecoderGst(extrainfo->caps));
+    }
+    videoCodecType format = static_cast<videoCodecType>(info.codec);
+    int width = info.width;
+    int height = info.height;
+
+    boost::uint8_t* extradata = 0;
+    size_t datasize = 0;
+
+    ExtraVideoInfoFlv* extrainfo = 
dynamic_cast<ExtraVideoInfoFlv*>(info.extra.get());
+    if (extrainfo) {
+        extradata = extrainfo->data.get();
                 datasize = extrainfo->size;
-       }
+    }
 
-       std::auto_ptr<VideoDecoder> ret( new VideoDecoderGst(format, width, 
height, extradata, datasize) );
-       return ret;
+    std::auto_ptr<VideoDecoder> ret( new VideoDecoderGst(format, width, 
height, extradata, datasize) );
+    return ret;
 }
 
 std::auto_ptr<AudioDecoder>
 MediaHandlerGst::createAudioDecoder(const AudioInfo& info)
 {
-       std::auto_ptr<AudioDecoder> ret;
+    std::auto_ptr<AudioDecoder> ret;
 
 #ifdef DECODING_SPEEX
-       if (info.codec == AUDIO_CODEC_SPEEX) {
-               assert(info.type == FLASH);
-               ret.reset(new AudioDecoderSpeex);
-       } else
+    if (info.codec == AUDIO_CODEC_SPEEX) {
+        assert(info.type == FLASH);
+        ret.reset(new AudioDecoderSpeex);
+    } else
 #endif
-       {
+    {
         try
         {
-                   ret.reset(new AudioDecoderGst(info));
+            ret.reset(new AudioDecoderGst(info));
         }
         catch (MediaException& ex)
         {
@@ -128,9 +130,9 @@
             }
         }
     
-       }
+    }
 
-       return ret;
+    return ret;
 }
 
 std::auto_ptr<VideoConverter>

=== modified file 'libmedia/gst/MediaParserGst.h'
--- a/libmedia/gst/MediaParserGst.h     2009-02-25 22:33:03 +0000
+++ b/libmedia/gst/MediaParserGst.h     2009-05-29 12:30:46 +0000
@@ -17,8 +17,8 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 
-#ifndef __MEDIAPARSER_GST_H__
-#define __MEDIAPARSER_GST_H__
+#ifndef GNASH_MEDIAPARSER_GST_H
+#define GNASH_MEDIAPARSER_GST_H
 
 #ifdef HAVE_CONFIG_H
 #include "gnashconfig.h"
@@ -45,7 +45,8 @@
 namespace gst {
 
 /// Class to hold extra info found in any stream by the parser.
-struct ExtraInfoGst : public AudioInfo::ExtraInfo, VideoInfo::ExtraInfo, 
boost::noncopyable
+struct ExtraInfoGst : public AudioInfo::ExtraInfo, VideoInfo::ExtraInfo,
+       boost::noncopyable
 {
     ExtraInfoGst(GstCaps* gstcaps)
     :

=== modified file 'testsuite/actionscript.all/flash.as'
--- a/testsuite/actionscript.all/flash.as       2009-05-26 07:01:03 +0000
+++ b/testsuite/actionscript.all/flash.as       2009-05-29 14:39:11 +0000
@@ -33,7 +33,49 @@
 };
 check_equals(r, "external,net,geom,filters,display,text,");
 
-totals(1);
+check_equals(flash.external.toString(), "[object Object]");
+check_equals(flash.net.toString(), "[object Object]");
+check_equals(flash.geom.toString(), "[object Object]");
+check_equals(flash.filters.toString(), "[object Object]");
+check_equals(flash.display.toString(), "[object Object]");
+check_equals(flash.text.toString(), "[object Object]");
+
+// Check that AS3 packages are not available here.
+check_equals(flash.ui.toString(), undefined);
+check_equals(flash.accessibility.toString(), undefined);
+check_equals(flash.desktop.toString(), undefined);
+check_equals(flash.errors.toString(), undefined);
+check_equals(flash.events.toString(), undefined);
+check_equals(flash.media.toString(), undefined);
+check_equals(flash.printing.toString(), undefined);
+check_equals(flash.sampler.toString(), undefined);
+check_equals(flash.system.toString(), undefined);
+check_equals(flash.utils.toString(), undefined);
+check_equals(flash.xml.toString(), undefined);
+
+ASSetPropFlags(_global.flash, null, 6, true);
+
+r = "";
+for (i in flash) {
+    r += i + ",";
+};
+
+// Gnash has no constructor, but otherwise okay.
+xcheck_equals(r, 
"external,net,geom,filters,display,text,__proto__,constructor,");
+check_equals(flash.ui.toString(), undefined);
+check_equals(flash.accessibility.toString(), undefined);
+check_equals(flash.desktop.toString(), undefined);
+check_equals(flash.errors.toString(), undefined);
+check_equals(flash.events.toString(), undefined);
+check_equals(flash.media.toString(), undefined);
+check_equals(flash.printing.toString(), undefined);
+check_equals(flash.sampler.toString(), undefined);
+check_equals(flash.system.toString(), undefined);
+check_equals(flash.utils.toString(), undefined);
+check_equals(flash.xml.toString(), undefined);
+
+
+totals(30);
 
 #endif
 

=== modified file 'testsuite/as3/classes.all/net/SharedObject_as.hx'
--- a/testsuite/as3/classes.all/net/SharedObject_as.hx  2009-05-28 16:25:59 
+0000
+++ b/testsuite/as3/classes.all/net/SharedObject_as.hx  2009-05-29 06:11:27 
+0000
@@ -23,7 +23,7 @@
 // This test case must be processed by CPP before compiling to include the
 //  DejaGnu.hx header file for the testing framework support.
 
-#error
+//#error
 //FIXME: This test produces a Segmentation Fault
 
 #if flash9


reply via email to

[Prev in Thread] Current Thread [Next in Thread]