_media / __data - which URL should I use?

Morning


Today's question is regarding the URLs of files - in this case, XML files.



I have a flash calculator which calls an XML file stored on Matrix. The path I have used for this file within Flash uses an "_media" path. I have to use the full URL sadly, which is not ideal.



The calculator seems to work and seems to be pulling in the XML fine. However if I navigate to the XML file in a browser using the same "_media" path it returns nothing - a blank screen.



If I then go to the XML file in Matrix and view the web paths, the paths are all "__data". If I navigate directly to that path, it returns the full XML.



So my question is really what is the distinction between the two URL types, is there any reason why the "_media" URL seems to work in the flash but not in a browser, and which should I be using in Flash?



Note - all assets are live.



Thanks!

You should get __data paths for files assets if your pages have public read access and they are live. This allows apache to directly serve the files rather than having Matrix do it.


If you are getting _media paths, that means Matrix is serving these files. Do they have public read applied?



If you don't need the files private, you should always be using __data paths.

What we tend to do for flash movies where the html embed tags are served out through matrix is pass through the paths in the flashVars parameter. If matrix is generating the html embed you can usually use the ./?a=[assetid] syntax to refer to your xml file in flashVars then it will be accessible regardless of what url it managed to pick up (assuming the right permissions of course). Any parameter passed through is available in flash in the _root variable scope.

Thanks nnhubard - that makes sense. It is served via __data and that works fine, but the Flash file seemed to have _media in it and that was working too. I think perhaps it was _media before it went live and, as I didn't understand this differentiation, I never updated it once live.


Anthony - very interesting. I'll look into that as it'd be good to not have to hard code and rely on URLs. Not entirely sure I understand what you're saying but a bit of trial and error never went amiss!!