-
SWF Base Referencing
Hello,
I'm having issues with references. I'll do my best to explain the problem simply.
I have a website I'm currently working on in flash. I've created the base of the site and most of its content. It functions fine.
I went online and found a decent looking gallery that I wanted to incorporate into the site and it works great also. The gallery is in its own directory.
When I try and load the main .SWF of the gallery into another .SWF within the base directory, the references break.
I understand that this is because its being pulled and the gallery's .SWF looks for its assets based on where its located.
Is there anyway possible to make a .SWF keep its paths relative to where it is pulled from instead of changing when it is pulled into another .SWF from different directories?
Here is a simple model:
-- Base Directory --
site.SWF
- -:gallery
- - - -:images
- - - -:thumbs
- - - -gallery.SWF
- - - -gallery.xml
site.SWF pulls gallery.SWF and then all the references break.
When embeding flash onto a site with swfobject, adding Param.base = "."; causes the .SWF embeded to keep its paths relative to where it is pulled from. Is this not possible in Flash?
I hope this makes sense.
-
Of course its possible. The execution will depend on the architecture of your existing base code , or framework, and the architecture of the gallery you are trying to use. You would certainly want to offset whatever it is the Gallery is doing by default to allow time for your framework , to pass in reference. Another way would be to write a static class , that contains reference to the base , that the gallery can import , and then access. You could cache off a reference to your base , from the static class, in a local var to the gallery. Then the gallery would have access.