-
1. Re: URLloader with different file formats
Andrei1 Jul 4, 2010 3:36 PM (in response to Petteri_Paananen)If I understood you correctly, these kind of things are accomplished via passing configuration values into Flash at runtime. Flash has no way to to read directories. If you don't want to make you clients configure your application by pointing to the right image to load, one of the ways (which will not be an improvement but rather a hack) is to attempt loading all the possible variations in some predefine logical sequence and load only images/swfs that don't return IOError.
But, again, this is an ugly hack and it cannot possibly cover all the unfoseeable scenarios. For instance, what if the name is not logo but logo1?
Just a word of caution. Basically, in any case, there are rules of engagement. Clients should be aware that by breaking these rules they will not have a properly working application. If you promise clients this kind of automation - you may subject yourself to unpleasant surprises down the road.
-
2. Re: URLloader with different file formats
Petteri_Paananen Jul 4, 2010 7:10 PM (in response to Andrei1)Thanks for you answer.
Naming is not a problem, it has worked so far with logo.swf so I think adding couple of choises for file extensions will not be too hard for my clients either....=)
How that IOError thing would work... do you mean that my URLloader first tries to load logo.swf, if there is none, it would continue to try load logo.png, and if theres no such file either, it finally tries to load logo.jpeg?
Do I need some kind of event listener for those tries?
-
3. Re: URLloader with different file formats
Andrei1 Jul 4, 2010 10:00 PM (in response to Petteri_Paananen)Yes, you will need to listen to IOErrorEvent to figure if file exists.

