0 Replies Latest reply on Jun 27, 2007 10:09 AM by levimendes

    VerifyError #1025 - default xml namespace and getter function

    levimendes
      I have narrowed the problem down to a a few lines. I have created a simple example of the problem...

      // TestClass.as
      package {
      import flash.events.EventDispatcher;
      public class TestClass extends EventDispatcher {
      private var _testVar:String;
      public function TestClass() {
      var testXML:XML = <node1 xmlns=" http://www.testurl.com/"><node2><node3>some words of wisdom</node3></node2></node1>;
      default xml namespace = testXML.namespace("");
      _testVar = testXML.node2.node3;
      }
      public function get testVar():String {
      return _testVar;
      }
      }
      }

      // Test.fla - frame 1
      import TestClass;
      var myTestClass:TestClass = new TestClass();
      var someVar:String = myTestClass.testVar;
      trace(someVar);

      I get the following error...

      verify TestClass/get testVar()
      stack:
      scope: [global Object$ flash.events::EventDispatcher$ TestClass$]
      locals: TestClass
      0:getlocal0
      stack: TestClass
      scope: [global Object$ flash.events::EventDispatcher$ TestClass$]
      locals: TestClass
      1:pushscope
      stack:
      scope: [global Object$ flash.events::EventDispatcher$ TestClass$] TestClass
      locals: TestClass
      2:getlocal1
      VerifyError: Error #1025: An invalid register 1 was accessed.
      at TestClass/get testVar()
      at Test_fla::MainTimeline/Test_fla::frame1()

      However if I take out the default xml namespace line, and create a new namespace it will work.

      var testNS:Namespace = new Namespace(testXML.namespace(""));
      _testVar = testXML.testNS::node2.testNS::node3;

      Thoughts??? It's driving me crazy. Thanks in advance...

      levi