[flexcoders] Re: ModuleLoader.child is null
In your module code I don't see where it implements com.storefront.interfaces.controller.ITest. If there is no implementation of the interface, the child will be null. --- In flexcoders@yahoogroups.com, method_air loudjazz@... wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip
RE: [flexcoders] Re: ModuleLoader.child is null
var test:ITest ITest(this._moduleLoader.child); // null The module implements ITest. Regardless, before the module is cast to an interface, this._moduleLoader.child is null. I read on another thread that the module 'ready' event may be dispatched before it's ready... To: flexcoders@yahoogroups.com From: valdhorli...@embarqmail.com Date: Fri, 4 Nov 2011 16:10:22 + Subject: [flexcoders] Re: ModuleLoader.child is null In your module code I don't see where it implements com.storefront.interfaces.controller.ITest. If there is no implementation of the interface, the child will be null. --- In flexcoders@yahoogroups.com, method_air loudjazz@... wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip
[flexcoders] Re: ModuleLoader.child is null
I do it a different way than you which you may like to try... private function onReady(e:ModuleEvent):void { var ml:ModuleLoader = e.target as ModuleLoader; // cast the module (the child property of the ModuleLoader) to the // ITest interface. If the child implements this interface // ichild will not be null. var ichild:* = ml.child as ITest; if(ichild != null) { // Pass data to module via interface ichild.somedataiwanttopass = this.thedataiwanttopass; } } Using this I have never found the child to be null (Although I do check). --- In flexcoders@yahoogroups.com, Philip Smith loudjazz@... wrote: var test:ITest ITest(this._moduleLoader.child); // null The module implements ITest. Regardless, before the module is cast to an interface, this._moduleLoader.child is null. I read on another thread that the module 'ready' event may be dispatched before it's ready... To: flexcoders@yahoogroups.com From: valdhorlists@... Date: Fri, 4 Nov 2011 16:10:22 + Subject: [flexcoders] Re: ModuleLoader.child is null In your module code I don't see where it implements com.storefront.interfaces.controller.ITest. If there is no implementation of the interface, the child will be null. --- In flexcoders@yahoogroups.com, method_air loudjazz@ wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip
[flexcoders] Re: ModuleLoader.child is null
Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. Also, this line is missing an equal sign: var test:ITest ITest(this._moduleLoader.child); Should be: var test:ITest = ITest(this._moduleLoader.child); -TH --- In flexcoders@yahoogroups.com, method_air loudjazz@... wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip
RE: [flexcoders] Re: ModuleLoader.child is null
Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. The ModuleEvent.READY listener is executing, the path is correct. var test:ITest ITest(this._moduleLoader.child); This was a typo. this._moduleLoader.child is still null here though. I get the same problem using mx and spark ModuleLoader. So unless someone can spot the problem, I'm going to use SWFLoader... To: flexcoders@yahoogroups.com From: timh...@aol.com Date: Thu, 3 Nov 2011 18:35:10 + Subject: [flexcoders] Re: ModuleLoader.child is null Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. Also, this line is missing an equal sign: var test:ITest ITest(this._moduleLoader.child); Should be: var test:ITest = ITest(this._moduleLoader.child); -TH --- In flexcoders@yahoogroups.com, method_air loudjazz@... wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip
RE: [flexcoders] Re: ModuleLoader.child is null
The module loads fine in a simple testbed, but in this particular larger application context, fails (and it's time consuming/costly debugging, when by all extents and purposes, it should work). In the end, I can achieve a similar result with SWFLoader, and cast the result as an interface type... To: flexcoders@yahoogroups.com From: loudj...@hotmail.com Date: Thu, 3 Nov 2011 19:36:57 + Subject: RE: [flexcoders] Re: ModuleLoader.child is null Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. The ModuleEvent.READY listener is executing, the path is correct. var test:ITest ITest(this._moduleLoader.child); This was a typo. this._moduleLoader.child is still null here though. I get the same problem using mx and spark ModuleLoader. So unless someone can spot the problem, I'm going to use SWFLoader... To: flexcoders@yahoogroups.com From: timh...@aol.com Date: Thu, 3 Nov 2011 18:35:10 + Subject: [flexcoders] Re: ModuleLoader.child is null Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. Also, this line is missing an equal sign: var test:ITest ITest(this._moduleLoader.child); Should be: var test:ITest = ITest(this._moduleLoader.child); -TH --- In flexcoders@yahoogroups.com, method_air loudjazz@... wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip
RE: [flexcoders] Re: ModuleLoader.child is null
In the end, I can achieve a similar result with SWFLoader, and cast the result as an interface type... Same. I gave up on all the quirks and pains and limitations of Flex Modules and went with loading in separate .swfs calling them an interface. Worked just as well, and I felt more in control. Jason Merrill Instructional Technology Architect II Bank of America Global Learning ___ From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Philip Smith Sent: Thursday, November 03, 2011 3:53 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: ModuleLoader.child is null The module loads fine in a simple testbed, but in this particular larger application context, fails (and it's time consuming/costly debugging, when by all extents and purposes, it should work). In the end, I can achieve a similar result with SWFLoader, and cast the result as an interface type... To: flexcoders@yahoogroups.com From: loudj...@hotmail.com Date: Thu, 3 Nov 2011 19:36:57 + Subject: RE: [flexcoders] Re: ModuleLoader.child is null Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. The ModuleEvent.READY listener is executing, the path is correct. var test:ITest ITest(this._moduleLoader.child); This was a typo. this._moduleLoader.child is still null here though. I get the same problem using mx and spark ModuleLoader. So unless someone can spot the problem, I'm going to use SWFLoader... To: flexcoders@yahoogroups.com From: timh...@aol.com Date: Thu, 3 Nov 2011 18:35:10 + Subject: [flexcoders] Re: ModuleLoader.child is null Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. Also, this line is missing an equal sign: var test:ITest ITest(this._moduleLoader.child); Should be: var test:ITest = ITest(this._moduleLoader.child); -TH --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, method_air loudjazz@... wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing.
Re: [flexcoders] Re: ModuleLoader.child is null
Can you post link-reports for the main app and the module? The implication is that the factory.create() didn’t work because the module’s class definition is not in the module swf. On 11/3/11 12:52 PM, Philip Smith loudj...@hotmail.com wrote: The module loads fine in a simple testbed, but in this particular larger application context, fails (and it's time consuming/costly debugging, when by all extents and purposes, it should work). In the end, I can achieve a similar result with SWFLoader, and cast the result as an interface type... To: flexcoders@yahoogroups.com From: loudj...@hotmail.com Date: Thu, 3 Nov 2011 19:36:57 + Subject: RE: [flexcoders] Re: ModuleLoader.child is null Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. The ModuleEvent.READY listener is executing, the path is correct. var test:ITest ITest(this._moduleLoader.child); This was a typo. this._moduleLoader.child is still null here though. I get the same problem using mx and spark ModuleLoader. So unless someone can spot the problem, I'm going to use SWFLoader... To: flexcoders@yahoogroups.com From: timh...@aol.com Date: Thu, 3 Nov 2011 18:35:10 + Subject: [flexcoders] Re: ModuleLoader.child is null Perhaps you're getting an error on load; probably due to the path. Try adding an event listener for ModuleEvent.ERROR. Also, this line is missing an equal sign: var test:ITest ITest(this._moduleLoader.child); Should be: var test:ITest = ITest(this._moduleLoader.child); -TH --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , method_air loudjazz@... wrote: Can anyone explain why ModuleLoader.child is null in the module event 'ready' event listener: this._moduleLoader = new ModuleLoader(); this._moduleLoader.url = ImageComparisonModule.swf; // this._moduleLoader.addEventListener(ModuleEvent.READY, onReady); private function onReady(e:ModuleEvent):void { var test:ITest ITest(this._moduleLoader.child); // null } Module code: ?xml version=1.0 encoding=utf-8? s:Module xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx implements=com.storefront.interfaces.controller.ITest fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:VGroup width=100% / /s:Module Cheers, Philip -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui