This content has been marked as final. Show 4 replies
This code seems to work. Maybe I am missing something in this contrived sample app.
The only part about your post that doesn't really make sense to me is that you said
quote:however any time I have ever loaded an image into Flex and passed it a string (quite a few times) I've never gotten a run time error just because it couldn't find a source, the application just showed either nothing or a broken image icon. I think there is something else tripping up the application, what is the full output of the error you get? Also, are you catching any errors on the image component itself like IOError, Security errors, etc...?
So now I get a runtime error, "cannot load ''", which would seem it is trying to load an image file of an empty string.
Well, me too, that was just a guess.
All I know for a fact is that when that IF block is in there, and my XML file has no values in ANY of its <image> nodes, I get an error.
If I remove that block OR I use an XML wherein some <image> nodes have valid image paths, no error.
Greg: Yes, my previous project had an xml file similar to your example app, where some items had images, and it too worked fine. I was very surprised when I used my app for this second project which was the same except its xml file had ONLY empty <image></image> tags. This struck me as very odd, since the logic I used (and you use) seemed to be correct. I am not sure why it threw that error this time. The xml file validates fine.