3 Replies Latest reply on Mar 22, 2011 11:07 PM by Flex harUI

    createComponentsFromDescriptors doesn't work in Flex4

    Flex Rock Level 1

      Hi all,

       

           I set the application itself to have  creationPolicy="none" and then try to call  createComponentesFromDescriptors at the end of my event handler that  parses the configuration file. But  for whatever reason, it still doesn't  instantiate all the children,  even when I tell it to recursively.

      Then i tried with createDeferredContent still no use. Is there anyother way to instantiate all the children.

       

      thanks,

      Jayagopal.

        • 1. Re: createComponentsFromDescriptors doesn't work in Flex4
          Flex harUI Adobe Employee

          Post a 20-line test case.

          • 2. Re: createComponentsFromDescriptors doesn't work in Flex4
            Flex Rock Level 1

            Hi,

                    I have been loading a theme dynamically. So what i done was

             

            I compiled the css files to swf.

            Then i loaded the swf using style manager in the preinitialize event by setting the creationPolicy="none" in application tag.

             

            (ex).

             

            private var eventDispatcher:IEventDispatcher;


            eventDispatcher = StyleManager.loadStyleDeclarations(themeUrl,true,true,ApplicationDomain.currentDomain);

            eventDispatcher.addEventListener(StyleEvent.COMPLETE, themeCompleteHandler, false, 0, true);


            In the complereHandler i tried to load the components


            private function themeCompleteHandler(evt:StyleEvent):void{
                        IEventDispatcher(evt.currentTarget).removeEventListener(evt.type , themeCompleteHandler);
                        createComponentsFromDescriptors();
                    }


            this i what i tried to do.

            Note: It worked in Flex 3.1, but when moved it to Flex4.1 (ie) Flashbuilder4.1 it is not working. Components are not displayed. It shows a blank screen.

             

            regards,

            Jayagopal.

            • 3. Re: createComponentsFromDescriptors doesn't work in Flex4
              Flex harUI Adobe Employee

              A 20-line test case requires that you strip out all unnecessary stuff.

              Often in stripping down your app you'll find the problem.