2 Replies Latest reply on Nov 21, 2009 2:12 AM by tfcenturion

    use module var in itemrenderer

    tfcenturion Level 1

      Hi all,

       

      Iv hit a small snag in an app im playing with.

       

      The app loads in a module which holds a public var to a reference folder.

       

      Im trying to use that var in an itemrenderer, i have been able to achive it by placing the var at the root app using 'source="{Application.application._resourceFolder + data.folder + data.image}" '

       

      I have tryed using the module name eg mod._resourceFolder but it gives me a statice class error

       

      is there a way i can achive the same using the module instead??

       

      Cheers for any help given...

       

       

        • 1. Re: use module var in itemrenderer
          Flex harUI Adobe Employee

          Depending on how you wrote the renderer, you may be able to access it as outerDocument.mod._resourceFolder or parentDocument.mod._resourceFolder

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: use module var in itemrenderer
            tfcenturion Level 1

            Hi Alex,

             

            Yes i forgot all about the parentDocument bit, once i read what you wrote it came back to me and the issue got resolved.

             

            I had to put it in a init function first though as the console was givening errors of binding. Is there a way to bind directly in the image.source tag.

             

            eg i have at mo a binded var  source="{resourceFolder + data.image}"

             

            but would like to get rid of the init() function and just have it like this. source="{this.parentDocument._resourceFolder + data.image}" << this works but as said it comes with a console binding error the app still complies thoughs and works.