A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: SWF Base Referencing

  1. #1
    Progressive Designer
    Join Date
    Nov 2009
    Posts
    1

    Question 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.

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center