5 Replies Latest reply on Oct 22, 2009 3:31 PM by Guillermo Odone

    Problem with some classes and error 1034

    Guillermo Odone

      Hi, all

       

      I'm having some trouble with some classes here.
      I have 3 classes which are:
      - ILCActionsFile
      - ILCActions
      - ILCAction

       

      + ILCActionsFile -> has inside an Array with ILCActions instances.
      + ILCActions -> has inside an Array with ILCAction instances.

       

      my problem is that when I want to return from ILCActionsFile an ILCActions instance, doing:

      Code:
      public function getActionsByPos( pos:int ):Actions{
        return this.__actions[ i ] as Actions ;
      }
      


      it always returns "null"; BUT, with the debuger, I could see that "__actions[ i ]" is an ILCActions instance with data.

       

      I used that code before in my app, to test some things, cause I have this ILCActions Array to be shown in a DataGrid.
      IF, instead I do:

       

      IN ILCActions class

      Code:
      public function get _actions():Array{ return this.__actions ; }
      


      IN MXML Module with the DataGrid:

      Code:
      this.grd.dataProvider = new ArrayCollection( axnF._actions ) ;
      


      This 2 codes, worked fine, I could see the data in the DataGrid.

       


      Here I attached an image with some traces showing the problem with ILCActions.
      Also I attached the ILCActionsFile/ILCActions/ILCAction classes.

       

      The strange thing is that I have something similar to this working and don't know why the other is working and this not.

       


      Thanks a lot.
      Guillermo.

        • 1. Re: Problem with some classes and error 1034
          Flex harUI Adobe Employee

          The obvious question is: "is ILCActions and Action?"

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

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

          • 2. Re: Problem with some classes and error 1034
            Guillermo Odone Level 1

            Hi,

             

            No, its ILCActions.

            in the Image I uploaded you can see that I tried all the "is "  with action, actions and anctionsfile

            in the code I added inline in the post

            public function getActionsByPos( pos:int ):Actions{
              return this.__actions[ i ] as Actions ;
            }
            //- It was the previous code I used, but now I changed the names from Action* to ILCAction*
            //- So the code is:
            public function getActionsByPos( pos:int ):ILCActions{
              return this.__actions[ i ] as ILCActions ;
            }

             

            What I did now is get rid of the "...):ILCActions" and just use "...):Object".

            Like this the code works, but actually I like a more clean code, and I like to know exactly what I put and where; thats why I would like to solved my problem here.

            Meanwhile I can continue working, but I don't nkow if this will make something else and worst ahead in the application.

             

            In the image witch the traces, there's something that it's strange for me...

            There's a trace like this: "trace( "obj (What is?): " + obj ) ;" which actually returns [object ILCActions]; but when I tried to do " obj as ILCActions" returns null.

             

            Thanks.

            Guillermo.

            • 3. Re: Problem with some classes and error 1034
              Flex harUI Adobe Employee

              If your app is using modules you might be having an applicationDomain issue.

               

              You can use describeType or getQualifiedClassName to help debug the problem.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

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

              • 4. Re: Problem with some classes and error 1034
                Guillermo Odone Level 1

                Hi,

                 

                I added to my code "ApplicationDomain.currentDomain" to see if changes between one "ilc_actionsFile" module and "ilc_actions" module.

                The result with the watch was:

                 

                [FROM ILC_ACTIONSFILE]
                appdom = (flash.system.ApplicationDomain) flash.system.ApplicationDomain (@b51d269)   
                    parentDomain = flash.system.ApplicationDomain (@b3a7ba1)   
                        parentDomain = null   


                [FROM ILC_ACTIONS]
                appdom = (flash.system.ApplicationDomain) flash.system.ApplicationDomain (@b3291a1)   
                    parentDomain = flash.system.ApplicationDomain (@b353b29)   
                        parentDomain = null   

                 

                I also added the describetype and and getQualifiedClassName (and watched "xa" and "xobj"):

                var xobj:XML ;
                var xa:XML ;
                var a:ILCActions = new ILCActions( "axntest", "devidtest", "opertest" ) ;
                     a.addAction( new ILCAction( CommonCfg.ACTION_TYPE_QUERY, "querytest", "9999", "01" ) ) ;
                     a.addAction( new ILCAction( CommonCfg.ACTION_TYPE_QUERY, "querytest", "1118", "01" ) ) ;
                     a.addAction( new ILCAction( CommonCfg.ACTION_TYPE_QUERY, "querytest", "1119" ) ) ;
                               
                     trace( "obj (What is?): " + obj ) ;
                     trace( "getQualifiedClassName( obj ): " + getQualifiedClassName( obj ) ) ;
                     xobj = describeType( obj ) ;
                     trace( "obj is ILCActions?: " + (obj is ILCActions) ) ;
                
                     trace( "a (What is?): " + a ) ;
                     trace( "getQualifiedClassName( a ): " + getQualifiedClassName( a ) ) ;
                     xa = describeType( a ) ;
                     trace( "a is ILCActions?: " + (a is ILCActions) ) ;
                

                 

                The traces returned:

                obj (What is?): [object ILCActions]
                getQualifiedClassName( obj ): mds.ilc::ILCActions
                obj is ILCActions?: false
                a (What is?): [object ILCActions]
                getQualifiedClassName( a ): mds.ilc::ILCActions
                a is ILCActions?: true

                 

                XML returned in xobj: File named xobj.xml

                XML returned in xa: File named xa.xml

                 

                 

                If there's an ApplicationDomain problem as you say, how can be solved ?

                 

                 

                Thanks,

                Guillermo.

                • 5. Re: Problem with some classes and error 1034
                  Guillermo Odone Level 1

                  Hi,

                   

                  I just installed the Flex SDK 3.4 to see if that was the problem. but it still the same, but one thing changed!

                   

                  Before the ApplicationDomain.currentDomain returned:

                   

                  [FROM ILC_ACTIONSFILE]
                  appdom = (flash.system.ApplicationDomain) flash.system.ApplicationDomain (@b51d269)  
                      parentDomain = flash.system.ApplicationDomain (@b3a7ba1)  
                          parentDomain = null  


                  [FROM ILC_ACTIONS]
                  appdom = (flash.system.ApplicationDomain) flash.system.ApplicationDomain (@b3291a1)  
                      parentDomain = flash.system.ApplicationDomain (@b353b29)  
                          parentDomain = null

                   

                  Now the ApplicationDomain.currentDomain returned:

                   

                  [FROM ILC_ACTIONSFILE]
                  appdom = (flash.system.ApplicationDomain) flash.system.ApplicationDomain (@42453f9)   
                      parentDomain = flash.system.ApplicationDomain (@3dda831)   
                          parentDomain = null   


                  [FROM ILC_ACTIONS]
                  appdom = (flash.system.ApplicationDomain) flash.system.ApplicationDomain (@42748d1)   
                      parentDomain = flash.system.ApplicationDomain (@3dda831)   
                          parentDomain = null   

                   

                  I've no idea if thats something to look at or it was just luck to be "parentDomain" the same in the two modules.

                   

                   

                  Thanks,

                  Guillermo.