This content has been marked as final. Show 5 replies
use the attached function. If you specify a 'max' parameter, e.g. 10, it stops after this number of entries. If you don't pass anything for 'max', it goes through the complete xml.
Thanks for the response, you'll have to excuse me for being a bit of a noob. Should I be able to just copy and paste that code into my flash file? I'm getting an output error of "type mismatch" on the ( var strHTMLNewsText:String = parseFile(objNewsPath, 10); ) line. Not sure what I'm doing wrong here. Thanks again.
Hm, is there an info for which variable the type mismatch is found? Maybe it's objNewsPath, it should be a XMLNode object, maybe you try to pass a XML object instead? In a test, I used the first child of a XML object (the root element) for the function, worked fine.
You could rewrite the function to accept XML objects, but then the reading (the for loop) would look a bit different.
I have an xml file with multiple sections, i.e. Intro, news, and around the office. When I'm parsing it in flash I do it with the attached code at the bottom. Maybe this will help. Oh also, I've been changing the objNewsPath variable around and instead of getting the type mismatch I'm getting undefined in the area to parse the info, so I'm thinking it's the problem.
Oh I got it working. Thanks a lot for your help man!! or woman...