Paulitino commented on issue #814:
URL: https://github.com/apache/royale-asjs/issues/814#issuecomment-740796602


   Hello,
   
   First I would like to say thank you to @carlosrovira and @alinakazi  for 
your fast responses.
   
   I still got problems even with the sample you gave me. I have two files, one 
_index.mxml_ that should load the module in  _module.mxml_.
   
   index.mxml:
   ```<?xml version="1.0" encoding="UTF-8"?>
   <ex:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                   xmlns:j="library://ns.apache.org/royale/jewel"
                   xmlns:js="library://ns.apache.org/royale/basic"
                   xmlns:html="library://ns.apache.org/royale/html"
                   xmlns:ex="library://ns.apache.org/royale/express"
                   xmlns:mx="library://ns.apache.org/royale/mx"
                   xmlns:views="modules.*"
                   xmlns:ns1="components.*">
   
       <fx:Script>
                <![CDATA[
               import org.apache.royale.events.Event;
   
               private function loadForm():void {
                loadModule("modules/module",null);
               }
   
               public function loadModule(swfApp:String, link:String=""):void {
                   mMainLoader.url = swfApp;
                   mMainLoader.visible = true;
                   mMainLoader.includeInLayout = true;
               }
                ]]>
        </fx:Script>
   
       <ex:beads>
           <js:ApplicationDataBinding />
       </ex:beads>
   
       <ex:initialView>
           <j:View>
               <j:beads>
                   <j:VerticalCenteredLayout/>
               </j:beads>
   
               <mx:ModuleLoader id="mMainLoader" paddingTop="0"
                         width="100%" height="100%" y="0" x="0"/>
   
                         <mx:Button label="Change Icon" click="loadForm()"/>
           </j:View>
       </ex:initialView>
   </ex:Application>
   ```
   
   module.mxml:
   ```<?xml version="1.0" encoding="utf-8"?>
   <j:Module xmlns:fx="http://ns.adobe.com/mxml/2009";
           xmlns:j="library://ns.apache.org/royale/jewel"
           xmlns:js="library://ns.apache.org/royale/basic"
           initComplete="initModule()">
   
       <fx:Script>
           <![CDATA[
               private function initModule():void
               {
                   trace("Initialize the module!");
               }
           ]]>
       </fx:Script>
   
       <j:beads>
           <js:ContainerDataBinding/>
           <j:VerticalLayout/>
       </j:beads>
   
       <j:HGroup gap="3">
           <j:IconTextInput>
               <j:beads>
                   <j:TextPrompt prompt="Search..."/>
                   <j:SizeControl size="xlarge"/>
               </j:beads>
               <j:icon>
                   <js:MaterialIcon text="{MaterialIconType.SEARCH}"/>
               </j:icon>
           </j:IconTextInput>
           <j:Button text="Search" emphasis="secondary">
               <j:beads>
                   <j:SizeControl size="xlarge"/>
               </j:beads>
           </j:Button>
       </j:HGroup>
   
   </j:Module>
   ```
   
   To build (not with Maven, I will try later on) I use the commands:
   mxmlc +configname=flex src/index.mxml
   mxmlc +configname=flex -module-output=modules src/modules/module.mxml
   
   I have no error during the build.
   
   The files organization is:
   
![screentreefiles](https://user-images.githubusercontent.com/39162485/101520579-fe4f2c80-3984-11eb-858a-d8a616722e14.png)
   
   I have the error _**Uncaught TypeError: Cannot read property 'addElement' of 
undefined**_ to the first click to the button and then **_Uncaught TypeError: 
c.za is not a function_** each time I click the button.
   
   Do you have any idea or solution on these errors ?
   
   Thank you,


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to