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 :-)
Tomek
Your note did save my life! Thank you!
(I visited Valencia some time ago – I have nice memories…)
Cheers,
tomek
sole
I’m glad that helped you :-)
Tim
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
sole
It’s great to hear that helped you to save some hours of sleep – because sleeping is sooo good!! :-)
jmc
Another life saved … Thank’s for all.
sole
/me begins to feel flattered :-$
Tom
You just saved another life! I was going nuts over this! Thank you!
chris
u are bookmarked !!! :)
thanks
solver
YEA!
bookmarked! :)
thx.
Endre
I thought this will not help because I got this error in a List selection, but it DID HELP!!!!
Thanks a lot!
warappa
Thank you very, very much!
I was faced to this problem too and this simple solution made my day(s)!
Sorin Vasilescu
Hey, thanks a million. Buy yourself a beer on my behalf. ;)
ST
Awesome, Great find, Thank You!
Senica Gonzalez
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.
sole
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 :)
hawaiiantime
thank you sooooooooooo much!!!!!!
you saved my life! ;-)
sole
:)