2 Replies Latest reply on Dec 12, 2008 8:24 AM by Newsgroup_User

    Error 1045 using Flex Library

    Someonewhere Level 1
      I have an interface defined in a Flex Library project. It's included in the library and objects in the library are referencing it just fine.

      I've created an MXML project and would like my components to utilize this interface. I've linked the project to the Flex Library but when I try to define the interface:

      i.e., <mx:Canvas implements="ISomeInterfaceInLibrary">

      The compiler complains: "1045:Interface ISomeInterfaceInLibrary was not found."

      I've tried pulling in the swc file, fully define the location:

      i.e., <mx:Canvas implements="Foo.Bar.ISomeInterfaceInLibrary">

      If I place the interface definition within the MXML project, it works but then I get conflicting definitions when I try to utilize the various classes in the library.

      Help! :)

        • 1. Re: Error 1045 using Flex Library
          Someonewhere Level 1
          I've moved the ISomeInterfaceInLibrary definition file to the root folder of the Flex Library and now it can find the definition of the interface.

          I tried:

          <mx:Canvas xmlns:foo="Foo.Bar.*" implements="ISomeInterfaceInLibrary">

          but it didn't work either. Maybe I have the xmlns definition incorrect?

          Anyway, having the interface definitions in the root of the library project will work for me but it seems to be the kind of work-around that shouldn't be necessary.

          If someone has an answer on how to declare interfaces somewhere in a package other than the root and utilize them in a MXML application, it would be much appreciated.

          Happy coding.
          • 2. Re: Error 1045 using Flex Library
            Level 7

            "Someonewhere" <webforumsuser@macromedia.com> wrote in message
            news:ghu22j$srp$1@forums.macromedia.com...
            > I've moved the ISomeInterfaceInLibrary definition file to the root folder
            > of
            > the Flex Library and now it can find the definition of the interface.
            >
            > I tried:
            >
            > <mx:Canvas xmlns:foo="Foo.Bar.*" implements="ISomeInterfaceInLibrary">
            >
            > but it didn't work either. Maybe I have the xmlns definition incorrect?
            >
            > Anyway, having the interface definitions in the root of the library
            > project
            > will work for me but it seems to be the kind of work-around that shouldn't
            > be
            > necessary.
            >
            > If someone has an answer on how to declare interfaces somewhere in a
            > package
            > other than the root and utilize them in a MXML application, it would be
            > much
            > appreciated.

            There's an itemRenderer associated with this example
            http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html
            that implements IDropInListItemRenderer in an mxml file. Maybe that will
            point you in the right direction.