Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: danyul_cPosted on 2009-11-01 at 13:54:33ID: 25715746
The onLoad event is designed to only fire once, and only once the file has been loaded.
I notice you have the var of xmlFile, which no doubt holds the xml data. The more ideal approach to this problem would be in this order:
You create an xml onLoad function, that upon loading the xml, creates the onClick events for the buttons. (This way button clicks won't throw an error about an xml file that's not loaded)
Your onClick function can then still call the function to set the name. It doesn't have to worry about checking to see if the file is loaded because it has to finish loading for the onClicks to be created.
I hope I'm not too confusing with this but here is a basic example, I'm not sure if my syntax is correct since I rarely use AS2 these days, but this should get you going in the right direction.
Select allOpen in new window