This content has been marked as final. Show 7 replies
Its actually pretty hard to let people know what's going on with XML without seeing an example of the XML itself sometimes. But I can't figure out what you're trying to do with the loops there...I don't *think* you need 2 for what you're doing...if I understand correctly what you want to do... here's my guess (something like this):
Do you mean that the traces inside bannerInfo.onLoad trace 'undefined' ?
Thanks for your help and my apologies for a confusing post. Let me clarify a bit and show you some of my XML.
I am building a banner rotator -- something that will give the web producers at my office the ability to edit an XML file and add a new Flash banner without having to touch any code. I need to capture 3 or 4 attributes in each XML entry: "swf_url", "click_url", "descrption", and maybe "id" at some point. You'll see in my XML example why the two loops are needed. (I'm also experimenting with an XML file that doesn't nest as many tags and that I could probably call in using ".attributes" in Flash. I'll attach that as well.)
I guess I'm just trying to figure out how to use this information once I pull it into an array since I'll need to extract it make this project work. Obviously, this isn't very difficult for a more advance programmer -- I'm guessing I have some sort of scoping issue going on, but I'm not knowledgable enough with arrays to pinpoint the problem.
Here's some of my code that might give you a better understanding. Any tips or suggestions for better ways to build this would be very much appreciated!
Well the code I posted will work for your first example, then - you don't need the 2 loops.
Try it like this and see.
Of course, you can't do anything with those arrays until after bannerInfo.onLoad has executed... so if you want to use the loaded values you need to call a function or goto a frame that uses them after those trace actions.
Very cool. Thanks for your help.
Aren't I already launching bannerInfo.onLoad in the function?
And here's a rough sketch of changes to make the attributes version work.
You're putting objects in a single array there, so tracing the element would trace as [object Object] or similar. I've changed the trace to the individual properties of each newly inserted array element.
-untested, but I think its right-