1 Reply Latest reply on Nov 11, 2008 1:33 PM by Newsgroup_User

    Issue with Library Path and Source Attachment

    estanley888
      Hello All,

      I'm having some problems with a swc I compiled in Flash using the Flex Component Kit. It worked great when all my files: the fla, resulting swf and swc, and all external classes, were all in the same directory.

      However, I recently changed the file structure to make more sense within my larger flex application. I changed the package structure in all the classes and the base class locations in my fla, accordingly, and recompiled. Now, it works as expected in Flash but I can't get it to work in Flex.

      I have tried to add the swc in the library build path and edit the swc's source attachment property to point to the root directory of my classes, but it seems to be ignoring the package structure. That or I don't understand how Flex uses the source attachment directory for the swc.

      I'm expecting the swc to be able to find the necessary classes in the source attachment directory via package declaration. For instance if the swc is depending on a class with the following package structure: components.flash.customChart.mcBar, then I would expect the swc to start looking in the source attachment directory and dig down through the appropriate directories to find mcBar. But it doesn't seem to be finding the classes at all. Can anyone explain or point me to some info on how this should work?

      Also, another detail: I'm using the same directory, as my class path directory in flash and flash finds all the necessary classes just fine. Why wouldn't the same be true in Flex?

      Thanks,
      Erica
        • 1. Re: Issue with Library Path and Source Attachment
          Level 7

          "estanley888" <webforumsuser@macromedia.com> wrote in message
          news:gfcpg0$mnn$1@forums.macromedia.com...
          > Hello All,
          >
          > I'm having some problems with a swc I compiled in Flash using the Flex
          > Component Kit. It worked great when all my files: the fla, resulting swf
          > and
          > swc, and all external classes, were all in the same directory. However, I
          > recently changed the file structure to make more sense within my larger
          > flex
          > application. I changed the package structure in all the classes and the
          > base
          > class locations in my fla, accordingly, and recompiled. Now, it works as
          > expected in Flash but I can't get it to work in Flex.
          >
          > I have tried to add the swc in the library build path and edit the swc's
          > source attachment property to point to the root directory of my classes,
          > but it
          > seems to be ignoring the package structure. That or I don't understand how
          > Flex
          > uses the source attachment directory for the swc. I'm expecting the swc
          > to be
          > able to find the necessary classes in the source attachment directory via
          > package declaration. For instance if the swc is depending on a class with
          > the
          > following package structure: components.flash.customChart.mcBar, then I
          > would
          > expect the swc to start looking in the source attachment directory and dig
          > down
          > through the appropriate directories to find mcBar. But it doesn't seem to
          > be
          > finding the classes at all. Can anyone explain or point me to some info
          > on how
          > this should work?

          The swc will compile all of the classes it uses inside itself. What is your
          actual structure, and what symptoms are you seeing that reveal the problem?