Relative path to SWF in loadMovie() is relative to HTML page not the parent SWF
- Problem: a relative path URL defined in a loadMovie() script is relative to the HTML page containing the parent SWF, not the parent SWF of loaded SWF...
- This means that, if you want the SWFs to work in Flash Player as well as the in the HTML page (don't we all?!), the parent SWF must be in the same directory as the HTML page that contains it. The problem with this is that you can't embed that parent SWF from other HTML pages in different directories without breaking the relative links to the child SWFs.
Solutions??
- Just have one HTML page holding the parent SWF that loads all the children, but this is very limiting and in the job I'm on now - not possible
- You could have Absolute links to your child SWFs, but Best Practice of Actionscript advises against it.
- You could have multiple copies of the parent and child SWFs for each HTML page, even if they all look and work the same, with relative links to the child SWFs appropriate for each HTML page. You could re-save the one set of SWFs and make sure that the directory structure is the same for each HTML page so the loadMovie URLs don't have to be changed for each parent SWF - but that's just annoying. There must be a better way...
Bookmarks