8 Replies Latest reply on Jun 7, 2007 5:11 AM by smartino

    Using onload and XML

    smartino Level 1
      Hi, I have a project where I load XML, SWF and image files into my MAIN.swf. This makes my project dynamic and easy to work with, but it only works now and again and is NOT consistant. If it fails I don't get an error even though I've put some error reporters in and it only takes a Ctrl shift refresh to work!!!
      The other point I must make is that the MAIN.swf is duplicated in different folders picking up the correct stuff that is relative to it. When I test each individual MAIN.swf I have to refresh to get the right imformation! again it only takes a refresh to work.

      I'm not a AS guru but have got experience in other coding lanuages. I'm lost here, please help if you can.

      Thanks in advance.
        • 1. Re: Using onload and XML
          smartino Level 1
          Does it matter if I have many onload and Unload statements in the same script window doing similar actions?

          • 2. Re: Using onload and XML
            smartino Level 1
            This is really stumped me...I'm trying to join two strings together like this...

            It only works now and again. Anybody got a clue why this should happen?
            • 3. Re: Using onload and XML
              hey could u please post the FULL code including:
              how you load the XML
              how you handle the onLoad event
              just all related to it.

              Hmm. XMLs always seems to work strangely. Though mine are working well here after some workarounds.
              • 4. Re: Using onload and XML
                smartino Level 1
                Here it is...

                • 5. Re: Using onload and XML
                  smartino Level 1
                  The fix and I don't know why was to do this. I moved BRTEXT.load(brtextURL); and put it after like so...see attached code.

                  Could someone explain why some time. Thanks. Simon.
                  • 6. Re: Using onload and XML
                    SmileKZS Level 1
                    I don't see much problem outta here...
                    Try changing some of the codes into other ways? You can use the childNodes[] array to iterate through the nodes. and use _root[yournode.nodename]=yournode.firstChild.nodeValue; instead of those IFs. Then try to assert if the yournode.firstChild.nodetype==3. Just change, change, change.

                    P.S. does your loaded movie work?
                    Also you may want to trace the URLs before using them to load the XMLs/Movies. You may also want to comment those processing and manually set the URLs for a try. Those are my debugging opinions. They may work and they may not.
                    • 7. Re: Using onload and XML
                      SmileKZS Level 1
                      And about your fix!
                      Before your fix the two XML's asynchorized loading are separated. Now they are sequenced. When the first XML is loaded, the second XML starts to load... Difference? I thought they are the same.

                      Maybe your server messed up... This is possible!

                      And you work for communitymx.com?
                      • 8. Re: Using onload and XML
                        smartino Level 1
                        Hi, as you pointed out I couldn't find anything wrong with it either. I have in another app this code which is the way you are suggesting I think...

                        This works ok but I only load one XML into this app and hadn't really seen any reason to ditch the other code when it works, granted not consistently.

                        Not sure what you meant by sequenced. I would’ve thought the code would load one XML and then load the next. The structure has changed to make it work but it's still doing the same thing!!!

                        When you say the server might have messed up i did try it on other servers which also had the same result, basically worked now and again! It works more than not.

                        No, I don't work at community.mx.com, but trying to fix this problem I looked into cache issue's etc.