VerifyError: Error #1025: An invalid register 1 was accessed

If you need to parse some XML with namespaces in ActionScript 3 you may find this error quite soon: VerifyError: Error #1025: An invalid register 1 was accessed

It all comes because of this line:

default xml namespace = myXML.namespace();

It is needed in order to access the values in the namespaced value so removing it is not an option. The problem appears when you call any other function in your object… and you get that weird error.

I haven’t managed to find out why. It kind of seems that changing the namespace (as the very example from Flash’s reference on how to read an RSS feed suggests) also alters the namespace of later function calls, and so the interpreter can’t find the functions.

I found the simplest solution was to reset the namespace back to nothing when I was done with accessing the XML:

default xml namespace = new Namespace('');

There should be an explanation for this but I haven’t yet found it. Meanwhile this can save your life :-)

16 Responses to “VerifyError: Error #1025: An invalid register 1 was accessed”

  1. Tomek says:

    Your note did save my life! Thank you!

    (I visited Valencia some time ago – I have nice memories…)

    Cheers,

    tomek

  2. sole says:

    I’m glad that helped you :-)

  3. Tim says:

    Thanks for you help. I’m not going to say it saved my life, but it is going to save me some much needed sleep which I appreciate very much. Thanks from a tired student.:)

    Tim

  4. sole says:

    It’s great to hear that helped you to save some hours of sleep – because sleeping is sooo good!! :-)

  5. jmc says:

    Another life saved … Thank’s for all.

  6. sole says:

    /me begins to feel flattered :-$

  7. Tom says:

    You just saved another life! I was going nuts over this! Thank you!

  8. chris says:

    u are bookmarked !!! :)

    thanks

  9. solver says:

    YEA!

    bookmarked! :)

    thx.

  10. Endre says:

    I thought this will not help because I got this error in a List selection, but it DID HELP!!!!

    Thanks a lot!

  11. warappa says:

    Thank you very, very much!
    I was faced to this problem too and this simple solution made my day(s)!

  12. Sorin Vasilescu says:

    Hey, thanks a million. Buy yourself a beer on my behalf. ;)

  13. ST says:

    Awesome, Great find, Thank You!

  14. I followed your post from another website, but just wanted to say thanks! I was up till 1:30 in the morning working on this. I’m sure I would have been there till 5….or until I eventually passed out. Glad I ran across this. I told the other guy, you need to leave a Paypal link on your site. I would have gladly bought you a cup ‘o jo for taking the time to post. You saved me lots of time.

  15. sole says:

    Cool, each time I see someone being able to sleep thanks to this ‘trick’, I feel super happy for you guys & gals.

    I might consider the paypal thing I guess! Thx for the comment. You’re welcome :)

Leave a Reply