To save on bandwidth, we often load transparent external images as SWF’s instead of PNG’s. It’s a bit more production work but it makes everything load a whole lot faster, as SWF uses JPEG compression on the image while maintaining the PNG’s transparency.
This requires no extra coding as long as the SWF’s are served from the same domain as your application. If they are not, then you’ll need to prepare the SWF’s with a few lines of Actionscript below.
Let’s say your application is SWF A and is loading in SWF B from another domain. SWF B needs to have a few lines of code in it to allow A to access it’s properties.
Quick note: this applies even if you are using SWF B as a static image or animation with no code. When you load the object and need to test it’s “bytesLoaded”, you’ll need to access it’s LoaderInfo/Loader. This will throw a Security Sandbox (#2121) error unless you add the following to SWF B:
Obviously, www.swfAdomain.com is where SWF A is hosted.
If you are loading SWF B from HTTPS and SWF A is on HTTP, then you’ll need to instead call:
You can read more about cross-domain issues here.
