This content has been marked as final.
Show 18 replies
-
1. Re: problem displaying xml field on stage
kglad Apr 5, 2006 4:06 PM (in response to hollywoodbb)where's your group.xml file? -
-
3. Re: problem displaying xml field on stage
kglad Apr 5, 2006 10:25 PM (in response to hollywoodbb)learn to use the trace() function. in your loadXML() function see what you get when you use trace(xmlNode). -
4. Re: problem displaying xml field on stage
BBRiD Apr 5, 2006 10:28 PM (in response to hollywoodbb)I am trying to load an XML file, too. I did not get an error on the URL, but when I did a trace on the data, I found that my data wasn't being loaded into my variable.
So, are you sure the data is getting loaded into aImage ? -
5. Re: problem displaying xml field on stage
BBRiD Apr 5, 2006 10:48 PM (in response to BBRiD)Here's the essence of my code. The "output" shows that the file is opened and the returned .length is correct.
But it isn't retrieving the data. I have tried changing the number of "childNodes" and giving them different "offsetss"
I just can't figure out what is wrong.
//Program to retrieve and play requested songs
//
stop();
soundList = new XML();
soundList.ignoreWhite = true;
trace("line6");
soundList.onLoad = function() {
i = 0;
trace("there");
trace(soundList.firstChild.childNodes.length);
_global.tryNo = soundList.firstChild.childNodes.childNodes[0].attributes.tryNo;
trace(_global.tryNo);
trace("here we are");
};
//load the xml file to trigger functions
soundList.load("soundList.xml");
Here's my XML file
<?xml version='1.0' encoding='utf-8'?>
<sounds>
<attempts tryNo="0" kindOSound="commercials">
<sound soundTitle="Waterworld " file="Commercials/Waterworld.mp3"/>
<sound soundTitle="Cereal " file="Commercials/cereal.mp3"/>
<sound soundTitle="Cliffbar " file="Commercials/Cliffbar.mp3"/>
<sound soundTitle="realtor " file="Commercials/realtor.mp3"/>
<sound soundTitle="restaurant " file="Commercials/restaurant.mp3"/>
</attempts>
<attempts tryNo="1" kindOSound="Squirrel Mitzvah">
<sound soundTitle="Frankie " file="Characters/Frankie.mp3"/>
<sound soundTitle="Gramps " file="Characters/Gramps.mp3"/>
<sound soundTitle="Amy " file="Characters/Amy.mp3"/>
<sound soundTitle="Lulubong " file="Characters/04_sisters.mp3"/>
</attempts>
</sounds> -
6. Re: problem displaying xml field on stage
Detonate 2004 Apr 6, 2006 6:01 AM (in response to hollywoodbb)I think your trying to pull your xml from a folder ("xml/group.xml"),
here in your example, it's in the root with all the rest.
Have you tried getting rid of xml/ ? -
7. Re: problem displaying xml field on stage
kglad Apr 6, 2006 8:51 AM (in response to hollywoodbb)look, to track the error start at the beginning. is the xml file being loaded correctly?
if you do a simple trace(xmlNode) in loadXML() you'll see nonsense. so, then you would go and look at the xml file and you see.. . nonsense. what are all those dashes supposed to be doing? that's not a properly formed xml file. fix it and retry. -
8. Re: problem displaying xml field on stage
hollywoodbb Apr 6, 2006 7:19 PM (in response to kglad)Thanks for the input guys. I just tried tracing the xml and it seems like there is an undefined error. I'll try to see if i can fix it. -
9. Re: problem displaying xml field on stage
kglad Apr 6, 2006 7:36 PM (in response to hollywoodbb)just remove those dashes that are outside of your tags. -
10. Re: problem displaying xml field on stage
hollywoodbb Apr 7, 2006 7:10 AM (in response to kglad)I couldn't figure out why my origianl code wasn't loading the image. So i just tried creating another xml load in flash a different way. I have it loading data (text) from the XML but the images don't want to load on the stage. Appreciate any help.
File -
11. Re: problem displaying xml field on stage
kglad Apr 7, 2006 7:26 AM (in response to hollywoodbb)what do you expect your latest linked file to do that it fails to do? -
12. problem displaying xml field on stage
hollywoodbb Apr 7, 2006 7:32 AM (in response to kglad)I can't get the jpeg "image100.jpg" to display on the flash stage. Can you see whats wrong in my code. -
13. Re: problem displaying xml field on stage
kglad Apr 8, 2006 10:12 AM (in response to hollywoodbb)there's no code in the latest link that attempts to upload anything.
but in general you should again use the trace() function to see if the file you think you are trying to upload (imag100.jpg) is the value of the variable that you're using in your loadMovie() or loadClip() statement. -
14. Re: problem displaying xml field on stage
hollywoodbb Apr 11, 2006 9:34 PM (in response to kglad)I having trouble to get the image to load. Can you help me script this part in. Appreciate your help. -
15. Re: problem displaying xml field on stage
kglad Apr 12, 2006 12:31 PM (in response to hollywoodbb)you need some code to load your images. if your images have file names, image100.jpg, image200.jpg etc, you can use:
-
16. Re: problem displaying xml field on stage
hollywoodbb Apr 12, 2006 3:01 PM (in response to kglad)Thanks kglad, I attached your script but it seemed that it doesn't wanna get displayed on the flash stage. I posted the file if you can take a look at it.
File -
17. Re: problem displaying xml field on stage
kglad Apr 12, 2006 6:19 PM (in response to hollywoodbb)all i gave was sample code for your loadXML() function. you'll still need to create your xml object and load your xml file and define your xml onLoad() handler. -
18. Re: problem displaying xml field on stage
hollywoodbb Apr 20, 2006 11:10 AM (in response to kglad)I'm having trouble getting the script to work properly. Can you help me script this.